Main Page

WinCvs Source Documentation

1.3 Beta 11 (Build 1

Generated on Fri Jan 31 12:08:31 2003 for WinCvs Source by doxygen 1.3-rc2


File Index

WinCvs Source File List

Here is a list of all files with brief descriptions:
common/AboutDlg.cpp [code]
common/AboutDlg.h [code]
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.cpp [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_i18n.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/ItemListDlg.cpp [code]
common/ItemListDlg.h [code]
common/KeywordComboBox.cpp [code]
common/KeywordComboBox.h [code]
common/LineCmd.cpp [code]
common/LineCmd.h [code]
common/LogDlg.cpp [code]
common/LogDlg.h [code]
common/LoginDlg.cpp [code]
common/LoginDlg.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/ProgressDlg.cpp [code]
common/ProgressDlg.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/SelectionDetailsDlg.cpp [code]
common/SelectionDetailsDlg.h [code]
common/SmartComboBox.cpp [code]
common/SmartComboBox.h [code]
common/SortList.h [code]
common/StatusDlg.cpp [code]
common/StatusDlg.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/CvsStatusBar.cpp [code]
WinCvs/CvsStatusBar.h [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/MfFileDialog.cpp [code]
WinCvs/MfFileDialog.h [code]
WinCvs/ndir.c [code]
WinCvs/ndir.h [code]
WinCvs/NoPython.cpp [code]
WinCvs/NoPython.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 Fri Jan 31 12:08:31 2003 for WinCvs Source by doxygen 1.3-rc2


AboutDlg.cpp File Reference

common/AboutDlg.cpp File Reference

#include "stdafx.h"
#include "uwidget.h"
#include "AboutDlg.h"
#include "UCvsApp.h"

Include dependency graph for AboutDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void AboutDialog (void)

Function Documentation

void AboutDialog ( void )

Definition at line 76 of file AboutDlg.cpp.

References EV_INIT_WIDGET, EV_SETTEXT, UCvsApp::gApp, UCvsApp::GetAppName(), kUMainWidget, UCreate_AboutDlg(), and UEventSendMessage().

Referenced by UCvsFrame::OnAbout().

00077 {
00078     void *wid = UCreate_AboutDlg();
00079     UStr  appText = UCvsApp::gApp->GetAppName();
00080
00081     UAboutDlg *dlg = new UAboutDlg ();
00082     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00083     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, appText);
00084
00085     bool res = false;
00086
00087     res = dlg->DoModal();
00088
00089     return;
00090 }

Generated on Fri Jan 31 12:09:12 2003 for WinCvs Source by doxygen 1.3-rc2


AboutDlg.h File Reference

common/AboutDlg.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

void AboutDialog (void)

Function Documentation

void AboutDialog ( void )

Definition at line 76 of file AboutDlg.cpp.

References EV_INIT_WIDGET, EV_SETTEXT, UCvsApp::gApp, UCvsApp::GetAppName(), kUMainWidget, UCreate_AboutDlg(), and UEventSendMessage().

Referenced by UCvsFrame::OnAbout().

00077 {
00078     void *wid = UCreate_AboutDlg();
00079     UStr  appText = UCvsApp::gApp->GetAppName();
00080
00081     UAboutDlg *dlg = new UAboutDlg ();
00082     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00083     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, appText);
00084
00085     bool res = false;
00086
00087     res = dlg->DoModal();
00088
00089     return;
00090 }

Generated on Fri Jan 31 12:09:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 CAdminOptionDlg::m_optionString.

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 Fri Jan 31 12:09:13 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

References CAdminOptionDlg::m_optionString.

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 Fri Jan 31 12:09:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiString.h"
#include "MultiFiles.h"
#include "ItemListDlg.h"
#include "GetPrefs.h"

Include dependency graph for AnnotateDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetAnnotate (const MultiFiles *mf, bool &noRecurs, bool &isDate, UPStr &rev, bool &force)
Get the annotate options.

Function Documentation

bool CompatGetAnnotate | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | isDate,
 |  | UPStr & | rev,
 |  | bool & | force
 | ) |

Get the annotate options.

Definition at line 165 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.

Referenced by CvsCmdAnnotate().

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

Generated on Fri Jan 31 12:09:14 2003 for WinCvs Source by doxygen 1.3-rc2


AnnotateDlg.h File Reference

common/AnnotateDlg.h File Reference

#include "CPStr.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 (const MultiFiles *mf, bool &noRecurs, bool &isDate, UPStr &rev, bool &force)
Get the annotate options.

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 | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | isDate,
 |  | UPStr & | rev,
 |  | bool & | force
 | ) |

Get the annotate options.

Definition at line 165 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.

Referenced by CvsCmdAnnotate().

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

Variable Documentation

CMString gDateNames

Definition at line 40 of file AnnotateDlg.h.

CMString gRevNames

Definition at line 39 of file AnnotateDlg.h.

Generated on Fri Jan 31 12:09:14 2003 for WinCvs Source by doxygen 1.3-rc2


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, CWincvsView::OutConsole(), UCvsConsole::OutConsole(), and UAppConsole().

Referenced by _loadPersistentSettings(), ControlCvsArgs::addfile(), RemoveCvsArgs::addfile(), AskCreatePersistentSettings(), BrowserGetDirectory(), BrowserGetMultiFiles(), BuildIgnoredList(), CompatEndMoveToTrash(), CompatGetPrefs(), CompatImportFilter(), CompatMoveToTrash(), CProgress::CProgress(), CPython_Interp::CPython_Interp(), CTcl_Interp::CTcl_Interp(), CvsCmdAdd(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdMoveToTrash(), CvsCmdRelease(), CvsLogParse(), CBrowseFileView::EditSel(), Entries_Open(), Entries_SetVisited(), FileTimeToUnixTime(), FileTraverse(), FillBuffer(), FormatDefaultSettingsLoc(), AuthenModel::GetInstance(), GetNextEntriesLine(), glue_getenv(), InitializeInterp(), CLogoutThread::InitInstance(), CWincvsApp::InitInstance(), launchCVS(), LaunchDiff(), LaunchEditor(), LaunchViewer(), list_add_type(), list_add_warning(), CPersistent::LoadAll(), loadSettingsInternal(), MakeTmpFile(), mystrdup(), UCvsFiles::OnCmdExplore(), UCvsFolders::OnCmdExplore(), MacroTraversal::OnError(), CFindSettings::OnError(), TBrowserFillDummy::OnError(), MacroTraversal::OnFile(), CBrowseFileView::OnInitialUpdate(), CBrowseFileView::OnViewExplore(), CWinCvsBrowser::OnViewExplore(), ReadIgnoredFile(), CPersistent::SaveAll(), CWincvsApp::SaveAllModified(), CPersistent::SaveAllSettings(), UCvsApp::SayWelcome(), UCvsFolders::SetDefaultRoot(), CGraphDoc::SetNode(), SettingsGetLoc(), Tag_Open(), tclSafeRemove(), Authen::tokenToKind(), UCvsApp::UCvsApp(), and UCvsGraph::UCvsGraph().

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, CWincvsView::OutConsole(), UCvsConsole::OutConsole(), and UAppConsole().

Referenced by CStreamConsole::cvs_err(), CItemListConsole::cvs_err(), CRevisionConsole::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 NULL, CWincvsView::OutConsole(), UCvsConsole::OutConsole(), and UAppConsole().

Referenced by ControlCvsArgs::addfile(), RemoveCvsArgs::addfile(), CompatEndMoveToTrash(), CompatGetPrefs(), CvsCmdMoveToTrash(), ImportReport::EnterDirectory(), glue_exit(), CWincvsApp::InitInstance(), CWincvsApp::OnAppCopyrights(), CWincvsApp::OnAppCredits(), UCvsFrame::OnCmdStopcvs(), UCvsFrame::OnCopyrights(), UCvsFrame::OnCredits(), CMainFrame::OnDropFiles(), CWincvsDoc::OnUsePyshell(), CWincvsDoc::OnUseTclshell(), CvsArgs::print(), UCvsApp::SayWelcome(), and stopCVS().

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, CWincvsView::OutConsole(), UCvsConsole::OutConsole(), and UAppConsole().

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 Fri Jan 31 12:09:15 2003 for WinCvs Source by doxygen 1.3-rc2


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

Defines

#define | WCHARFORMAT CHARFORMAT

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)

Define Documentation

#define WCHARFORMAT CHARFORMAT

Definition at line 54 of file AppConsole.h.

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 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.

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

Referenced by _loadPersistentSettings(), RemoveCvsArgs::addfile(), ControlCvsArgs::addfile(), AskCreatePersistentSettings(), BrowserGetDirectory(), BrowserGetMultiFiles(), BuildIgnoredList(), CompatEndMoveToTrash(), CompatGetPrefs(), CompatImportFilter(), CompatMoveToTrash(), CProgress::CProgress(), CPython_Interp::CPython_Interp(), CTcl_Interp::CTcl_Interp(), CvsCmdAdd(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdMoveToTrash(), CvsCmdRelease(), CvsLogParse(), CBrowseFileView::EditSel(), Entries_Open(), Entries_SetVisited(), FileTimeToUnixTime(), FileTraverse(), FillBuffer(), FormatDefaultSettingsLoc(), AuthenModel::GetInstance(), GetNextEntriesLine(), glue_getenv(), InitializeInterp(), CWincvsApp::InitInstance(), CLogoutThread::InitInstance(), launchCVS(), LaunchDiff(), LaunchEditor(), LaunchViewer(), list_add_type(), list_add_warning(), CPersistent::LoadAll(), loadSettingsInternal(), MakeTmpFile(), mystrdup(), UCvsFolders::OnCmdExplore(), UCvsFiles::OnCmdExplore(), TBrowserFillDummy::OnError(), CFindSettings::OnError(), MacroTraversal::OnError(), MacroTraversal::OnFile(), CBrowseFileView::OnInitialUpdate(), CWinCvsBrowser::OnViewExplore(), CBrowseFileView::OnViewExplore(), ReadIgnoredFile(), CPersistent::SaveAll(), CWincvsApp::SaveAllModified(), CPersistent::SaveAllSettings(), UCvsApp::SayWelcome(), UCvsFolders::SetDefaultRoot(), CGraphDoc::SetNode(), SettingsGetLoc(), Tag_Open(), tclSafeRemove(), Authen::tokenToKind(), UCvsApp::UCvsApp(), and UCvsGraph::UCvsGraph().

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().

Referenced by CRevisionConsole::cvs_err(), CItemListConsole::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 NULL, UCvsConsole::OutConsole(), CWincvsView::OutConsole(), and UAppConsole().

Referenced by RemoveCvsArgs::addfile(), ControlCvsArgs::addfile(), CompatEndMoveToTrash(), CompatGetPrefs(), CvsCmdMoveToTrash(), ImportReport::EnterDirectory(), glue_exit(), CWincvsApp::InitInstance(), CWincvsApp::OnAppCopyrights(), CWincvsApp::OnAppCredits(), UCvsFrame::OnCmdStopcvs(), UCvsFrame::OnCopyrights(), UCvsFrame::OnCredits(), CMainFrame::OnDropFiles(), CWincvsDoc::OnUsePyshell(), CWincvsDoc::OnUseTclshell(), CvsArgs::print(), UCvsApp::SayWelcome(), and stopCVS().

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().

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 Fri Jan 31 12:09:16 2003 for WinCvs Source by doxygen 1.3-rc2


AppGlue.cpp File Reference

common/AppGlue.cpp File Reference

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "wincvs.h"
#include "PromptFiles.h"
#include "BrowseFileView.h"
#include "wincvs_winutil.h"
#include <process.h>
#include <direct.h>
#include "cvsgui_process.h"
#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 "CvsCommands.h"
#include "cvsgui_i18n.h"

Include dependency graph for AppGlue.cpp:

Include dependency graph

Go to the source code of this file.

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 | launchCVS (int test, const char *path, int argc, char *const *argv, CCvsConsole *console, const char *cvsfile)
void | stopCVS ()
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)
Wait for the cvs thread to terminate.

Variables

CCvsConsole * | gConsole = 0L
Console to which the current cvs process writes.

int | sLastExitCode
Last cvs command exit code.

CTmpFiles sTmpList
Temporary files list.

CvsProcessCallbacks sCallTable

Define Documentation

#define CVS_EXTERN_C

Definition at line 115 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
 | ) |

Send stderr of the cvs command to the console

Parameters:
txt | Text to be send to the console
len | Text lenght
Returns:
The printed text lenght

Definition at line 161 of file AppGlue.cpp.

References CCvsConsole::cvs_err(), cvs_errstr(), CVS_EXTERN_C, and gConsole.

00162 {
00163     if( gConsole != 0L )
00164         return gConsole->cvs_err(txt, len);
00165
00166     cvs_errstr(txt, len);
00167
00168     return len;
00169 }

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

Send stdin of the console to the cvs command

Parameters:
txt | Text to be send to the cvs command
len | Text lenght
Returns:
The sent text lenght

Definition at line 177 of file AppGlue.cpp.

References CVS_EXTERN_C.

00178 {
00179     return 0;
00180 }

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

Send stdout of the cvs command to the console

Parameters:
txt | Text to be send to the console
len | Text lenght
Returns:
The printed text lenght

Definition at line 145 of file AppGlue.cpp.

References CVS_EXTERN_C, CCvsConsole::cvs_out(), cvs_outstr(), and gConsole.

00146 {
00147     if( gConsole != 0L )
00148         return gConsole->cvs_out(txt, len);
00149
00150     cvs_outstr(txt, len);
00151
00152     return len;
00153 }

void glue_exit ( int code )

Print the cvs command exit code

Parameters:
code Exit code to print

Definition at line 131 of file AppGlue.cpp.

References _i18n, CVS_EXTERN_C, cvs_out(), and sLastExitCode.

00132 {
00133     if( !gCvsPrefs.IsTclFileRunning() )
00134         cvs_out(_i18n("\n***** CVS exited normally with code %d *****\n\n"), code);
00135
00136     sLastExitCode = code;
00137 }

const char* glue_getenv ( char * name )

Set the environmental variables for the cvs command

Parameters:
name Environmental variable name
Returns:
The environmental variable value as const char*
Note:
Make sure that the returned pointer doesn't get deallocated prematurely

Definition at line 207 of file AppGlue.cpp.

References _i18n, AskYesNo(), ASSERT, 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.

Referenced by CMainFrame::OnTimer().

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

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

Launch cvs command and put the cvs output in a file

Parameters:
dir | Directory
args | Cvs arguments
prefix | File prefix
extension | File extension
Returns:
The file name on success, NULL on error
Note:
The temp file is automatically removed when quitting

Definition at line 675 of file AppGlue.cpp.

References CStr, CTmpFiles::push_back(), and sTmpList.

Referenced by CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), cvsgui_RunCvs(), CvsLogParse(), launchCVS(), LaunchItemListCommand(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnQueryAnnotate(), CGraphView::OnViewDelrev(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), CGraphView::OnViewUpdate(), tclCvsProc(), and testCVS().

00677 {
00678     CStr filename;
00679     FILE* file = launchCVS(dir, args, filename, prefix, extension);
00680     if( file == 0L )
00681         return 0L;
00682
00683     fclose(file);
00684
00685     return sTmpList.push_back(filename);
00686 }

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

Launch cvs command and send a stream of the cvs output into a file

Parameters:
dir | Directory
args | Cvs arguments
tmpFile | File name
prefix | File prefix
extension | File extension
Returns:
The output file handle on success, NULL on error

Definition at line 643 of file AppGlue.cpp.

00645 {
00646     if( !MakeTmpFile(tmpFile, prefix, extension) )
00647         return 0L;
00648
00649     FILE* res = fopen(tmpFile, gCvsPrefs.UnixLF() ? "wb+" : "w+");
00650     if( res == 0L )
00651     {
00652         cvs_err(_i18n("Impossible to open the temp file '%s' for write (error %d)"),
00653             (const char*)tmpFile, errno);
00654
00655         return 0L;
00656     }
00657
00658     CStreamConsole myconsole(res);
00659
00660     launchCVS(dir, args.Argc(), args.Argv(), &myconsole);
00661     fseek(res, 0L, SEEK_SET);
00662
00663     return res;
00664 }

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

Launch cvs command

Parameters:
path | Cvs binary file
argc | Arguments count
argv | Arguments
console | Console
Returns:
The process return error code

Definition at line 629 of file AppGlue.cpp.

00630 {
00631     return launchCVS(FALSE, path, argc, argv, console, NULL);
00632 }

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

Launch cvs command

Parameters:
test | cvs testing
path | Cvs binary file
argc | Arguments count
argv | Arguments
console | Console
cvsfile | Cvs binary file
Returns:
The process return error code

Definition at line 465 of file AppGlue.cpp.

00466 {
00467     CAuthenSetUp setupEnv;
00468     CvsProcessStartupInfo startupInfo;
00469
00470     startupInfo.hasTty = ( !test ? gCvsPrefs.CvsConsole() : true ); // test cvs has always tty (prevent printing cvs version info on console
00471     startupInfo.currentDirectory = path;
00472
00473     gConsole = console;
00474
00475 #if TARGET_RT_MAC_CFM
00476     CompatConnectID connID;
00477
00478     if( !loadCVS(connID) ) || test
00479         return errInternal;
00480
00481     int exitc = 0;
00482
00483     // call the main
00484     if( !CompatCallLibrary3(connID, exitc, uppMainProcInfo, "dllglue_main",
00485         dllglue_main_func, path, argc, (char**)argv) )
00486     {
00487         cvs_err(_i18n("Error : Cannot find symbol ""dllglue_main""\n"));
00488         exitc = errInternal;
00489     }
00490
00491     unloadCVS(connID, exitc);
00492
00493     return exitc;
00494
00495 #elif defined(WIN32) || defined(qUnix) || TARGET_RT_MAC_MACHO
00496     CStr cvscmd;
00497
00498 #ifdef WIN32
00499     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00500 #elif qUnix
00501     UCvsApp* app = UCvsApp::gApp;
00502 #elif TARGET_RT_MAC_MACHO
00503     CMacCvsApp* app = CMacCvsApp::gApp;
00504 #endif
00505
00506     if( app->IsCvsRunning() && cvs_process_is_active(app->GetCvsProcess()) ) {
00507         cvs_err(_i18n("Error : cvs is already running !\n"));
00508         return -1;
00509     }
00510
00511 #if qUnix || TARGET_RT_MAC_MACHO
00512     if(path != 0L && chdir(path) != 0) {
00513         cvs_err(("Error : cannot chdir to %s (error %d)!\n"), path, errno);
00514     }
00515 #endif // qUnix
00516
00517     app->SetCvsStopping(false);
00518
00519     if( !test ) {
00520         gCvsPrefs.WhichCvs(cvscmd, gCvsPrefs.UseAltCvs());
00521         sLastExitCode = 0;
00522     } else {
00523         cvscmd = cvsfile;
00524         sLastExitCode = errNoCvsguiProtocol;
00525     }
00526
00527     struct stat sb;
00528
00529     if( stat(cvscmd, &sb) == -1 ||
00530 #if qUnix || TARGET_RT_MAC_MACHO
00531          S_ISLNK(sb.st_mode) ||
00532 #endif
00533          !(S_ISREG(sb.st_mode)) )
00534     {
00535         cvs_err(_i18n("Unable to find the cvs process in : (error %d)\n"), errno);
00536         cvs_err("1) %s\n", (const char*)cvscmd);
00537     }
00538
00539     CvsProcess* proc = cvs_process_run(cvscmd, argc - 1, (char**)argv + 1, &sCallTable, &startupInfo);
00540     if( proc == 0L )
00541     {
00542         cvs_err(_i18n("Unable to initialize the cvs process (error %d)\n"), errno);
00543         cvs_err(_i18n("The cvs used is : %s\n"), (const char*)cvscmd);
00544     }
00545     else
00546     {
00547 #ifdef TARGET_RT_MAC_MACHO
00548         UInt32 ticker = ::TickCount();
00549 #endif
00550
00551         app->SetCvsRunning(true);
00552         app->SetCvsProcess(proc);
00553 #if defined(WIN32) || defined(qUnix)
00554         app->PeekPumpAndIdle(true);
00555 #endif
00556 #ifndef qUnix
00557         if( console != 0L )
00558 #endif
00559         {
00560             time_t start = time(NULL);
00561
00562             while( TRUE )
00563             {
00564 #if TARGET_RT_MAC_MACHO
00565                 UInt32 ticker = ::TickCount();
00566 #elif defined(WIN32) || defined(qUnix)
00567                 app->PeekPumpAndIdle(false);
00568 #endif
00569
00570 #if TARGET_RT_MAC_MACHO
00571                 if( (::TickCount () - ticker) > 40 )
00572                 {
00573                     glue_eventdispatcher(0L);
00574                     ticker = ::TickCount ();
00575                 }
00576 #endif
00577                 cvs_process_give_time();
00578
00579                 if( !cvs_process_is_active(proc) )
00580                     break;
00581
00582                 if ( test && ( (time(NULL) - start) > 10 ) )
00583                 {
00584                     cvs_err(_i18n("testing cvs timed out\n"));
00585                     cvs_process_stop(proc);
00586                 }
00587             } // end while
00588         }
00589     }
00590
00591     return sLastExitCode;
00592
00593 #endif
00594 }

void stopCVS ( )

Stop running CVS command

Definition at line 599 of file AppGlue.cpp.

References _i18n, cvs_out(), cvs_process_stop(), CWincvsApp::GetCvsProcess(), and CWincvsApp::SetCvsStopping().

Referenced by CItemListDlg::OnCancel(), and CWincvsDoc::OnStopcvs().

00600 {
00601 #ifdef WIN32
00602     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00603     app->SetCvsStopping(true);
00604
00605     cvs_process_stop(app->GetCvsProcess());
00606     cvs_out(_i18n("***** CVS stopped on user request !!! *****\n\n"));
00607 #endif
00608 }

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

Test whether specified cvs binary supports cvsgui protocol

Parameters:
cvsfile | Cvs binary file
argc | Arguments count
argv | Arguments
Returns:
The process return error code

Definition at line 617 of file AppGlue.cpp.

References launchCVS().

00618 {
00619     return launchCVS(TRUE, NULL, argc, argv, NULL, cvsfile);
00620 }

void WaitForCvs ( void )

Wait for the cvs thread to terminate.

Definition at line 689 of file AppGlue.cpp.

References cvs_process_is_active(), and CWincvsApp::GetCvsProcess().

Referenced by CvsCmdLogin(), and CWincvsApp::SaveAllModified().

00690 {
00691     // pump messages manually
00692     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00693
00694     while( TRUE )
00695     {
00696         if( app->GetCvsProcess() == 0L )
00697             return;
00698
00699         if( !cvs_process_is_active(app->GetCvsProcess()) )
00700             return;
00701
00702         Sleep(100);
00703     }
00704 }

Variable Documentation

CCvsConsole* gConsole = 0L

Console to which the current cvs process writes.

Definition at line 104 of file AppGlue.cpp.

Referenced by glue_consoleerr(), glue_consoleout(), and launchCVS().

CvsProcessCallbacks sCallTable [static]

Initial value:

 {
    glue_consoleout,
    glue_consoleerr,
    glue_getenv,
    glue_exit
}

Definition at line 119 of file AppGlue.cpp.

int sLastExitCode [static]

Last cvs command exit code.

Definition at line 107 of file AppGlue.cpp.

Referenced by glue_exit(), and launchCVS().

CTmpFiles sTmpList

Temporary files list.

Definition at line 110 of file AppGlue.cpp.

Referenced by launchCVS().

Generated on Fri Jan 31 12:09:17 2003 for WinCvs Source by doxygen 1.3-rc2


AppGlue.h File Reference

common/AppGlue.h File Reference

#include <stdio.h>
#include <vector>

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 | CAuthenSetUp
Class to setup authentication model and proper environment. More...

class | CCvsConsole
Base class for cvs process console. More...

class | CStreamConsole
Class to implement stream console. More...

class | CTmpFiles
Class to support the clean up of any temporary files created. More...

Defines

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

Functions

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)
int | testCVS (const char *path, int argc, char *const *argv)
int | launchCVS (const char *path, int argc, char *const *argv, CCvsConsole *console=0L)
int | launchCVS (int test, const char *path, int argc, char *const *argv, CCvsConsole *console=0L, const char *cvsfile=0L)
void | stopCVS ()
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)
void | WaitForCvs (void)
Wait for the cvs thread to terminate.

Variables

CCvsConsole * gConsole
Console to which the current cvs process writes.

Define Documentation

#define errInternal -99

Definition at line 31 of file AppGlue.h.

Referenced by launchCVS().

#define errNoCvsguiProtocol -97

Definition at line 33 of file AppGlue.h.

Referenced by launchCVS().

#define errThreadRunning -98

Definition at line 32 of file AppGlue.h.

Function Documentation

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

Send stderr of the cvs command to the console

Parameters:
txt | Text to be send to the console
len | Text lenght
Returns:
The printed text lenght

Definition at line 161 of file AppGlue.cpp.

References CCvsConsole::cvs_err(), cvs_errstr(), CVS_EXTERN_C, and gConsole.

00162 {
00163     if( gConsole != 0L )
00164         return gConsole->cvs_err(txt, len);
00165
00166     cvs_errstr(txt, len);
00167
00168     return len;
00169 }

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

Send stdin of the console to the cvs command

Parameters:
txt | Text to be send to the cvs command
len | Text lenght
Returns:
The sent text lenght

Definition at line 177 of file AppGlue.cpp.

References CVS_EXTERN_C.

00178 {
00179     return 0;
00180 }

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

Send stdout of the cvs command to the console

Parameters:
txt | Text to be send to the console
len | Text lenght
Returns:
The printed text lenght

Definition at line 145 of file AppGlue.cpp.

References CVS_EXTERN_C, CCvsConsole::cvs_out(), cvs_outstr(), and gConsole.

00146 {
00147     if( gConsole != 0L )
00148         return gConsole->cvs_out(txt, len);
00149
00150     cvs_outstr(txt, len);
00151
00152     return len;
00153 }

void glue_exit ( int code )

Print the cvs command exit code

Parameters:
code Exit code to print

Definition at line 131 of file AppGlue.cpp.

References _i18n, CVS_EXTERN_C, cvs_out(), and sLastExitCode.

00132 {
00133     if( !gCvsPrefs.IsTclFileRunning() )
00134         cvs_out(_i18n("\n***** CVS exited normally with code %d *****\n\n"), code);
00135
00136     sLastExitCode = code;
00137 }

const char* glue_getenv ( char * name )

Set the environmental variables for the cvs command

Parameters:
name Environmental variable name
Returns:
The environmental variable value as const char*
Note:
Make sure that the returned pointer doesn't get deallocated prematurely

Definition at line 207 of file AppGlue.cpp.

References _i18n, AskYesNo(), ASSERT, 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.

Referenced by CMainFrame::OnTimer().

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

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

Launch cvs command and put the cvs output in a file

Parameters:
dir | Directory
args | Cvs arguments
prefix | File prefix
extension | File extension
Returns:
The file name on success, NULL on error
Note:
The temp file is automatically removed when quitting

Definition at line 675 of file AppGlue.cpp.

References CStr, CTmpFiles::push_back(), and sTmpList.

Referenced by CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), cvsgui_RunCvs(), CvsLogParse(), launchCVS(), LaunchItemListCommand(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnQueryAnnotate(), CGraphView::OnViewDelrev(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), CGraphView::OnViewUpdate(), tclCvsProc(), and testCVS().

00677 {
00678     CStr filename;
00679     FILE* file = launchCVS(dir, args, filename, prefix, extension);
00680     if( file == 0L )
00681         return 0L;
00682
00683     fclose(file);
00684
00685     return sTmpList.push_back(filename);
00686 }

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

Launch cvs command and send a stream of the cvs output into a file

Parameters:
dir | Directory
args | Cvs arguments
tmpFile | File name
prefix | File prefix
extension | File extension
Returns:
The output file handle on success, NULL on error

Definition at line 643 of file AppGlue.cpp.

References _i18n, CvsArgs::Argc(), CvsArgs::Argv(), cvs_err(), launchCVS(), and MakeTmpFile().

00645 {
00646     if( !MakeTmpFile(tmpFile, prefix, extension) )
00647         return 0L;
00648
00649     FILE* res = fopen(tmpFile, gCvsPrefs.UnixLF() ? "wb+" : "w+");
00650     if( res == 0L )
00651     {
00652         cvs_err(_i18n("Impossible to open the temp file '%s' for write (error %d)"),
00653             (const char*)tmpFile, errno);
00654
00655         return 0L;
00656     }
00657
00658     CStreamConsole myconsole(res);
00659
00660     launchCVS(dir, args.Argc(), args.Argv(), &myconsole);
00661     fseek(res, 0L, SEEK_SET);
00662
00663     return res;
00664 }

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

Launch cvs command

Parameters:
test | cvs testing
path | Cvs binary file
argc | Arguments count
argv | Arguments
console | Console
cvsfile | Cvs binary file
Returns:
The process return error code

Definition at line 465 of file AppGlue.cpp.

References _i18n, CompatCallLibrary3, CompatConnectID, CStr, _CvsProcessStartupInfo::currentDirectory, cvs_err(), cvs_process_give_time(), cvs_process_is_active(), cvs_process_run(), cvs_process_stop(), errInternal, errNoCvsguiProtocol, UCvsApp::gApp, gConsole, glue_eventdispatcher(), _CvsProcessStartupInfo::hasTty, loadCVS(), sLastExitCode, stat, and unloadCVS().

00466 {
00467     CAuthenSetUp setupEnv;
00468     CvsProcessStartupInfo startupInfo;
00469
00470     startupInfo.hasTty = ( !test ? gCvsPrefs.CvsConsole() : true ); // test cvs has always tty (prevent printing cvs version info on console
00471     startupInfo.currentDirectory = path;
00472
00473     gConsole = console;
00474
00475 #if TARGET_RT_MAC_CFM
00476     CompatConnectID connID;
00477
00478     if( !loadCVS(connID) ) || test
00479         return errInternal;
00480
00481     int exitc = 0;
00482
00483     // call the main
00484     if( !CompatCallLibrary3(connID, exitc, uppMainProcInfo, "dllglue_main",
00485         dllglue_main_func, path, argc, (char**)argv) )
00486     {
00487         cvs_err(_i18n("Error : Cannot find symbol ""dllglue_main""\n"));
00488         exitc = errInternal;
00489     }
00490
00491     unloadCVS(connID, exitc);
00492
00493     return exitc;
00494
00495 #elif defined(WIN32) || defined(qUnix) || TARGET_RT_MAC_MACHO
00496     CStr cvscmd;
00497
00498 #ifdef WIN32
00499     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00500 #elif qUnix
00501     UCvsApp* app = UCvsApp::gApp;
00502 #elif TARGET_RT_MAC_MACHO
00503     CMacCvsApp* app = CMacCvsApp::gApp;
00504 #endif
00505
00506     if( app->IsCvsRunning() && cvs_process_is_active(app->GetCvsProcess()) ) {
00507         cvs_err(_i18n("Error : cvs is already running !\n"));
00508         return -1;
00509     }
00510
00511 #if qUnix || TARGET_RT_MAC_MACHO
00512     if(path != 0L && chdir(path) != 0) {
00513         cvs_err(("Error : cannot chdir to %s (error %d)!\n"), path, errno);
00514     }
00515 #endif // qUnix
00516
00517     app->SetCvsStopping(false);
00518
00519     if( !test ) {
00520         gCvsPrefs.WhichCvs(cvscmd, gCvsPrefs.UseAltCvs());
00521         sLastExitCode = 0;
00522     } else {
00523         cvscmd = cvsfile;
00524         sLastExitCode = errNoCvsguiProtocol;
00525     }
00526
00527     struct stat sb;
00528
00529     if( stat(cvscmd, &sb) == -1 ||
00530 #if qUnix || TARGET_RT_MAC_MACHO
00531          S_ISLNK(sb.st_mode) ||
00532 #endif
00533          !(S_ISREG(sb.st_mode)) )
00534     {
00535         cvs_err(_i18n("Unable to find the cvs process in : (error %d)\n"), errno);
00536         cvs_err("1) %s\n", (const char*)cvscmd);
00537     }
00538
00539     CvsProcess* proc = cvs_process_run(cvscmd, argc - 1, (char**)argv + 1, &sCallTable, &startupInfo);
00540     if( proc == 0L )
00541     {
00542         cvs_err(_i18n("Unable to initialize the cvs process (error %d)\n"), errno);
00543         cvs_err(_i18n("The cvs used is : %s\n"), (const char*)cvscmd);
00544     }
00545     else
00546     {
00547 #ifdef TARGET_RT_MAC_MACHO
00548         UInt32 ticker = ::TickCount();
00549 #endif
00550
00551         app->SetCvsRunning(true);
00552         app->SetCvsProcess(proc);
00553 #if defined(WIN32) || defined(qUnix)
00554         app->PeekPumpAndIdle(true);
00555 #endif
00556 #ifndef qUnix
00557         if( console != 0L )
00558 #endif
00559         {
00560             time_t start = time(NULL);
00561
00562             while( TRUE )
00563             {
00564 #if TARGET_RT_MAC_MACHO
00565                 UInt32 ticker = ::TickCount();
00566 #elif defined(WIN32) || defined(qUnix)
00567                 app->PeekPumpAndIdle(false);
00568 #endif
00569
00570 #if TARGET_RT_MAC_MACHO
00571                 if( (::TickCount () - ticker) > 40 )
00572                 {
00573                     glue_eventdispatcher(0L);
00574                     ticker = ::TickCount ();
00575                 }
00576 #endif
00577                 cvs_process_give_time();
00578
00579                 if( !cvs_process_is_active(proc) )
00580                     break;
00581
00582                 if ( test && ( (time(NULL) - start) > 10 ) )
00583                 {
00584                     cvs_err(_i18n("testing cvs timed out\n"));
00585                     cvs_process_stop(proc);
00586                 }
00587             } // end while
00588         }
00589     }
00590
00591     return sLastExitCode;
00592
00593 #endif
00594 }

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

Launch cvs command

Parameters:
path | Cvs binary file
argc | Arguments count
argv | Arguments
console | Console
Returns:
The process return error code

Definition at line 629 of file AppGlue.cpp.

References launchCVS().

00630 {
00631     return launchCVS(FALSE, path, argc, argv, console, NULL);
00632 }

void stopCVS ( )

Stop running CVS command

Definition at line 599 of file AppGlue.cpp.

References _i18n, cvs_out(), cvs_process_stop(), CWincvsApp::GetCvsProcess(), and CWincvsApp::SetCvsStopping().

Referenced by CItemListDlg::OnCancel(), and CWincvsDoc::OnStopcvs().

00600 {
00601 #ifdef WIN32
00602     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00603     app->SetCvsStopping(true);
00604
00605     cvs_process_stop(app->GetCvsProcess());
00606     cvs_out(_i18n("***** CVS stopped on user request !!! *****\n\n"));
00607 #endif
00608 }

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

Test whether specified cvs binary supports cvsgui protocol

Parameters:
cvsfile | Cvs binary file
argc | Arguments count
argv | Arguments
Returns:
The process return error code

Definition at line 617 of file AppGlue.cpp.

References launchCVS().

00618 {
00619     return launchCVS(TRUE, NULL, argc, argv, NULL, cvsfile);
00620 }

void WaitForCvs ( void )

Wait for the cvs thread to terminate.

Definition at line 689 of file AppGlue.cpp.

References cvs_process_is_active(), and CWincvsApp::GetCvsProcess().

Referenced by CvsCmdLogin(), and CWincvsApp::SaveAllModified().

00690 {
00691     // pump messages manually
00692     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00693
00694     while( TRUE )
00695     {
00696         if( app->GetCvsProcess() == 0L )
00697             return;
00698
00699         if( !cvs_process_is_active(app->GetCvsProcess()) )
00700             return;
00701
00702         Sleep(100);
00703     }
00704 }

Variable Documentation

CCvsConsole* gConsole

Console to which the current cvs process writes.

Definition at line 45 of file AppGlue.h.

Referenced by glue_consoleerr(), glue_consoleout(), and launchCVS().

Generated on Fri Jan 31 12:09:18 2003 for WinCvs Source by doxygen 1.3-rc2


AppGlue.mac.cpp File Reference

common/AppGlue.mac.cpp File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:09:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 CvsCmdAnnotate(), and CvsCmdDiff().

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 Fri Jan 31 12:09:18 2003 for WinCvs Source by doxygen 1.3-rc2


AskYesNo.cpp File Reference

common/AskYesNo.cpp File Reference

#include "stdafx.h"
#include "resource.h"
#include "AskYesNo.h"
#include "uwidget.h"
#include "cvsgui_i18n.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 82 of file AskYesNo.cpp.

References _i18n, and CvsAlert().

Referenced by glue_getenv().

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

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

Definition at line 241 of file AskYesNo.cpp.

Referenced by cvsgui_PromptEditMessage().

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

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

Definition at line 181 of file AskYesNo.cpp.

Referenced by cvsgui_PromptMessage().

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

Generated on Fri Jan 31 12:09:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 82 of file AskYesNo.cpp.

References _i18n, and CvsAlert().

Referenced by glue_getenv().

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

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

Definition at line 241 of file AskYesNo.cpp.

Referenced by cvsgui_PromptEditMessage().

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

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

Definition at line 181 of file AskYesNo.cpp.

Referenced by cvsgui_PromptMessage().

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

Generated on Fri Jan 31 12:09:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 "uwidget.h"
#include "SmartComboBox.h"
#include "CvsCommands.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 | UAuthen_Sspi
class | AuthenGserver
class | AuthenKserver
class | AuthenLocal
class | AuthenNtserver
class | AuthenPserver
class | AuthenRhosts
class | AuthenServer
class | AuthenSSH
class | AuthenSspi

Defines

#define | STR_UNSETENV_EQUAL "="
#define | unsetenv(a) putenv(a STR_UNSETENV_EQUAL)

Functions

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

Variables

Authen gAuthen
AuthenLocal localInstance
AuthenPserver pserverInstance
AuthenRhosts rhostsInstance
AuthenNtserver ntserverInstance
AuthenGserver gserverInstance
AuthenSspi sspiInstance
AuthenServer serverInstance
AuthenSSH sshInstance

Define Documentation

#define STR_UNSETENV_EQUAL "="

Definition at line 70 of file Authen.cpp.

#define unsetenv ( a ) putenv(a STR_UNSETENV_EQUAL)

Definition at line 76 of file Authen.cpp.

Referenced by AuthenRhosts::OnRestoreEnv(), AuthenPserver::OnRestoreEnv(), AuthenSSH::OnRestoreEnv(), and AuthenModel::OnRestoreEnv().

Function Documentation

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

Referenced by Authen::kind(), and Authen::setkind().

Variable Documentation

Authen gAuthen

Definition at line 84 of file Authen.cpp.

AuthenGserver gserverInstance [static]

Definition at line 1957 of file Authen.cpp.

AuthenLocal localInstance [static]

Definition at line 1949 of file Authen.cpp.

AuthenNtserver ntserverInstance [static]

Definition at line 1956 of file Authen.cpp.

AuthenPserver pserverInstance [static]

Definition at line 1950 of file Authen.cpp.

AuthenRhosts rhostsInstance [static]

Definition at line 1951 of file Authen.cpp.

AuthenServer serverInstance [static]

Definition at line 1959 of file Authen.cpp.

AuthenSSH sshInstance [static]

Definition at line 1965 of file Authen.cpp.

AuthenSspi sspiInstance [static]

Definition at line 1958 of file Authen.cpp.

Generated on Fri Jan 31 12:09:19 2003 for WinCvs Source by doxygen 1.3-rc2


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,
sspi,
server
}
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
sspi | sspi
server | server

Definition at line 32 of file Authen.h.

Referenced by CompatGetPrefs(), AuthenServer::GetKind(), AuthenSspi::GetKind(), AuthenGserver::GetKind(), AuthenNtserver::GetKind(), AuthenKserver::GetKind(), AuthenRhosts::GetKind(), AuthenPserver::GetKind(), AuthenSSH::GetKind(), AuthenLocal::GetKind(), Authen::kind(), Authen::numToKind(), and Authen::tokenToKind().

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

Variable Documentation

Authen gAuthen

Definition at line 113 of file Authen.h.

Generated on Fri Jan 31 12:09:20 2003 for WinCvs Source by doxygen 1.3-rc2


BrowseViewColumn.cpp File Reference

common/BrowseViewColumn.cpp File Reference

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

Include dependency graph for BrowseViewColumn.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | KoConflictColumn
Conflict column. More...

class | KoDateColumn
Date column. More...

class | KoNameColumn
Name column. More...

class | KoOptionColumn
Option column. More...

class | KoPathColumn
Path column. More...

class | KoRecursiveModel
Recursive columnar model. More...

class | KoRegularModel
Regular columnar model. More...

class | KoRevisionColumn
Revision column. More...

class | KoStatusColumn
Status column. More...

class | KoTagColumn
Tag column. More...

Defines

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

Functions

void | SafeCopy (char *buffer, const char *value, int bufferSize)
int CALLBACK | _Compare (LPARAM data1, LPARAM data2, LPARAM data)
Compare callback.

Variables

KoNameColumn nameColumn
Name column.

KoPathColumn pathColumn
Path column.

KoRevisionColumn revisionColumn
Revision column.

KoOptionColumn optionColumn
Option column.

KoStatusColumn statusColumn
Status column.

KoTagColumn tagColumn
Tag column.

KoDateColumn dateColumn
Date column.

KoConflictColumn conflictColumn
Conflict column.

const KiColumn * | columnsRegular []
All known columns for view's perusal.

const int | typesRegular []
const KiColumn * | columnsRecursive []
const int | typesRecursive []
KoRegularModel modelRegular
Regular columnar model.

KoRecursiveModel modelRecursive
Recursive columnar model.

Define Documentation

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

Definition at line 41 of file BrowseViewColumn.cpp.

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

Function Documentation

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

Compare callback.

Definition at line 600 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.

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

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

Make a "safe" copy of the string

Parameters:
buffer | Destination
value | Source
bufferSize | Destination buffer size

Definition at line 50 of file BrowseViewColumn.cpp.

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

00051 {
00052     if( value && *value )
00053     {
00054         strncpy(buffer, value, bufferSize);
00055     }
00056     else
00057     {
00058         *buffer = 0;
00059     }
00060 }

Variable Documentation

const KiColumn* columnsRecursive[] [static]

Initial value:

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

Definition at line 523 of file BrowseViewColumn.cpp.

Referenced by KoRecursiveModel::GetAt().

const KiColumn* columnsRegular[] [static]

Initial value:

 {
    &nameColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
}
All known columns for view's perusal.

Definition at line 514 of file BrowseViewColumn.cpp.

Referenced by KoRegularModel::GetAt().

KoConflictColumn conflictColumn

Conflict column.

KoDateColumn dateColumn

Date column.

KoRecursiveModel modelRecursive

Recursive columnar model.

Referenced by KiColumnModel::GetRecursiveModel().

KoRegularModel modelRegular

Regular columnar model.

Referenced by KiColumnModel::GetRegularModel().

KoNameColumn nameColumn

Name column.

KoOptionColumn optionColumn

Option column.

KoPathColumn pathColumn

Path column.

KoRevisionColumn revisionColumn

Revision column.

KoStatusColumn statusColumn

Status column.

KoTagColumn tagColumn

Tag column.

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 527 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 518 of file BrowseViewColumn.cpp.

Referenced by KoRegularModel::GetType().

Generated on Fri Jan 31 12:09:20 2003 for WinCvs Source by doxygen 1.3-rc2


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
Column descriptor interface. More...

class | KiColumnModel
Columnar model of the data. More...

class | KoColumnContext
Context in which a column is accessed. More...

struct | CSortParam
Sort parameters. More...

Functions

int CALLBACK | _Compare (LPARAM data1, LPARAM data2, LPARAM data)
Compare callback.

Function Documentation

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

Compare callback.

Definition at line 600 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.

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

Generated on Fri Jan 31 12:09:21 2003 for WinCvs Source by doxygen 1.3-rc2


BrowseViewHandlers.cpp File Reference

common/BrowseViewHandlers.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "BrowseViewHandlers.h"
#include "PromptFiles.h"
#include "MultiFiles.h"

Include dependency graph for BrowseViewHandlers.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Fri Jan 31 12:09:22 2003 for WinCvs Source by doxygen 1.3-rc2


BrowseViewHandlers.h File Reference

common/BrowseViewHandlers.h File Reference

#include "CvsCommands.h"
#include "CPStr.h"
#include "cvsgui_i18n.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
Interface describing a handler to process a selection-related command. More...

class | KoAddBinaryHandler
Handles binary addition of the selected items. More...

class | KoAddHandler
Handles addition of the selected items. More...

class | KoAddUnicodeHandler
Handles unicode addition of the selected items. More...

class | KoAnnotateHandler
Handles annotate on the selected items. More...

class | KoBranchTagHandler
Handles branch request on the selected items. More...

class | KoCancelChangesHandler
Handles cancel changes on the selected items. More...

class | KoCheckoutHandler
Handles Checkout. More...

class | KoCommandLineHandler
Handles Command Line. More...

class | KoCommitHandler
Handles commits of the selected items. More...

class | KoCreateTagHandler
Handles create tag request on the selected items. More...

class | KoDeleteTagHandler
Handles delete tag request on the selected items. More...

class | KoDiffHandler
Handles diffing on the selected items. More...

class | KoEditHandler
Handles edit start request on the selected items. More...

class | KoEditorsHandler
Handles editors on the selected items. More...

class | KoFileRemoveHandler
Handles file remove requests. More...

class | KoForceEditHandler
Handles force edit start request on the selected items. More...

class | KoGraphDiffHandler
Handles diffing on the selected items. More...

class | KoGraphHandler
Handles graph log queries on the selected items. More...

class | KoImportHandler
Handles Import. More...

class | KoLockHandler
Handles locking on the selected items. More...

class | KoLogHandler
Handles log queries on the selected items. More...

class | KoMoveToTrashHandler
Handles moving files to trash. More...

class | KoQueryUpdateHandler
Handles query updates on the selected items. More...

class | KoReleaseHandler
Handles releasing on the selected items. More...

class | KoReservedEditHandler
Handles reserved edit start request on the selected items. More...

class | KoRtagBranchHandler
Handles Rtag Branch. More...

class | KoRtagCreateHandler
Handles Rtag Create. More...

class | KoRtagDeleteHandler
Handles Rtag Delete. More...

class | KoStatusHandler
Handles status queries on the selected items. More...

class | KoUneditHandler
Handles edit stop request on the selected items. More...

class | KoUnlockHandler
Handles unlocking on the selected items. More...

class | KoUpdateHandler
Handles updates on the selected items. More...

class | KoUpdateMoveToTrashHandler
Handles figuring out if moving files to trash is enabled. More...

class | KoWatchersHandler
Handles watchers on the selected items. More...

class | KoWatchOffHandler
Handles watch off on the selected items. More...

class | KoWatchOnHandler
Handles watch on on the selected items. More...

Enumerations

enum kSelType {
kSelNone,
kSelFiles,
kSelDir
}
Command selection type enum. More...

Enumeration Type Documentation

enum kSelType

Command selection type enum.

Enumeration values:
kSelNone | Not specified
kSelFiles | Selection contains files
kSelDir | Selection contains directory

Definition at line 25 of file BrowseViewHandlers.h.

Referenced by KiSelectionHandler::GetSelType().

00026 {
00027     kSelNone,
00028     kSelFiles,
00029     kSelDir
00030 } kSelType;

Generated on Fri Jan 31 12:09:22 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Variables

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)

Variable Documentation

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoIgnoreModel::KoIgnoreModel(), and KoIgnoreModel::~KoIgnoreModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoRecursionModel::KoRecursionModel(), and KoRecursionModel::~KoRecursionModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

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

Referenced by KoFilterModel::KoFilterModel(), and KoFilterModel::~KoFilterModel().

Generated on Fri Jan 31 12:09:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 | Node
class | NotificationManager

Typedefs

typedef void(* | FNOBSERVER )(CObject *)

Typedef Documentation

typedef void(* FNOBSERVER)(CObject*)

Definition at line 35 of file BrowseViewModel.h.

Generated on Fri Jan 31 12:09:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiString.h"
#include "MultiFiles.h"
#include "UpdateDlg.h"
#include "PromptFiles.h"
#include "ItemListDlg.h"
#include "GetPrefs.h"

Include dependency graph for CheckoutDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatGetCheckout (const MultiFiles *mf, 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, UPStr &keyword)
Get the checkout options.

Variables

CMString | gOldModules (10,"P_OldModules")

Function Documentation

bool CompatGetCheckout | ( | const MultiFiles * | mf,
 |  | 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,
 |  | UPStr & | keyword
 | ) |

Get the checkout options.

Definition at line 641 of file CheckoutDlg.cpp.

References BrowserGetDirectory(), CPStr, CStr, 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_keyword, CCheckout_OPTIONS::m_match, CUpdateMerge::m_merge, CCheckout_MAIN::m_moduleName, CCheckout_MAIN::m_noRecurse, CCheckout_MAIN::m_overrideCoDir, CCheckout_MAIN::m_path, CCheckout_OPTIONS::m_rev, CUpdateMerge::m_rev1, CUpdateMerge::m_rev2, CCheckout_MAIN::m_stdout, CGetPrefs_CVSROOT::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_CheckoutDlg(), and UEventSendMessage().

Referenced by CvsCmdCheckoutModule().

00649 {
00650     bool userHitOK = false;
00651
00652     date = "";
00653     rev = "";
00654     modname = "";
00655     norecurs = false;
00656     toStdout = false;
00657     useMostRecent = false;
00658     doexport = false;
00659     forceCvsroot = false;
00660     overrideCheckoutDir = false;
00661
00662     static CPStr sLastModName;
00663     static CPStr sLastRev;
00664     static CPStr sLastDate;
00665     static CPStr sLastRev1;
00666     static CPStr sLastRev2;
00667     static CPStr sLastDate1;
00668     static CPStr sLastDate2;
00669
00670     bool hasDate = false;
00671     bool hasRev = false;
00672     bool merge1 = false;
00673     bool merge2 = false;
00674     bool hasDate1 = false;
00675     bool hasDate2 = false;
00676     keyword = "";
00677
00678 #ifdef WIN32
00679     CPropertySheet pages("Checkout settings");
00680     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00681     CCheckout_MAIN page1(mf, sLastModName, path);
00682     CCheckout_OPTIONS page2(mf, sLastRev, sLastDate, keyword);
00683     CUpdateMerge page3(mf, true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00684     CGetPrefs_CVSROOT page4;
00685     CGetPrefs_GLOBALS page5;
00686     pages.AddPage(&page1);
00687     pages.AddPage(&page2);
00688     pages.AddPage(&page3);
00689     pages.AddPage(&page4);
00690     pages.AddPage(&page5);
00691     if(pages.DoModal() == IDOK)
00692     {
00693         sLastModName = (const char *)page1.m_moduleName;
00694         path = (const char *)page1.m_path;
00695         norecurs = page1.m_noRecurse == TRUE;
00696         toStdout = page1.m_stdout == TRUE;
00697         overrideCheckoutDir = page1.m_overrideCoDir == TRUE;
00698         checkoutDir = (const char *)page1.m_checkoutDir;
00699
00700         sLastDate = page2.m_date;
00701         sLastRev = page2.m_rev;
00702         hasDate = page2.m_hasDate == TRUE;
00703         hasRev = page2.m_hasRev == TRUE;
00704         useMostRecent = page2.m_match == TRUE;
00705         doexport = page2.m_export == TRUE;
00706         forceCvsroot = page2.m_forceRoot == TRUE;
00707         keyword = page2.m_keyword;
00708
00709         merge1 = page3.m_merge >= 1;
00710         merge2 = page3.m_merge == 2;
00711         sLastRev1 = page3.m_rev1;
00712         sLastRev2 = page3.m_rev2;
00713         hasDate1 = page3.m_hasDate1 == TRUE;
00714         hasDate2 = page3.m_hasDate2 == TRUE;
00715         sLastDate1 = page3.m_date1;
00716         sLastDate2 = page3.m_date2;
00717
00718         page4.StoreValues();
00719         page5.StoreValues();
00720         userHitOK = true;
00721     }
00722 #endif /* WIN32 */
00723 #ifdef qMacCvsPP
00724     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00725     LWindow *theDialog = theHandler.GetDialog();
00726     ThrowIfNil_(theDialog);
00727     static UInt16 sRuntimePanel = 1;
00728
00729     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00730         (theDialog->FindPaneByID(item_MultiViewPrefs));
00731     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00732
00733     multiView->SwitchToPanel(3);
00734     DoDataExchange_Globals(theDialog, true);
00735     multiView->SwitchToPanel(2);
00736     DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00737         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00738     multiView->SwitchToPanel(1);
00739     DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00740     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00741     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00742
00743
00744     groupView->SetValue(sRuntimePanel);
00745     theDialog->Show();
00746     MessageT hitMessage;
00747     while (true)
00748     {       // Let DialogHandler process events
00749         hitMessage = theHandler.DoDialog();
00750
00751         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00752             break;
00753
00754         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00755         {
00756             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00757             {
00758                 continue;
00759             }
00760
00761             CStr dir;
00762             if( BrowserGetDirectory("Select a directory to checkout to", dir) )
00763             {
00764                 CPStr tmp(dir.c_str());
00765                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00766             }
00767             else if(hitMessage == item_CheckGroupPath)
00768             {
00769                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00770             }
00771         }
00772     }
00773     theDialog->Hide();
00774     sRuntimePanel = groupView->GetValue();
00775
00776     if(hitMessage == msg_OK)
00777     {
00778         multiView->SwitchToPanel(1);
00779         DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00780         multiView->SwitchToPanel(2);
00781         DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00782             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00783         multiView->SwitchToPanel(3);
00784         DoDataExchange_Globals(theDialog, false);
00785
00786         Assert_(sLastModName.length() != 0);
00787
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791 #if qUnix
00792     void *wid = UCreate_CheckoutDlg();
00793
00794     UCvsCheckout *dlg = new UCvsCheckout();
00795     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00796     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00797     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00798     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00799     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00800     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00801     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00802
00803     if(dlg->DoModal())
00804     {
00805         sLastModName = tab1->m_modname;
00806         path = tab1->m_path;
00807         norecurs = tab1->m_norecurs;
00808         toStdout = tab1->m_stdout;
00809
00810         sLastDate = tab2->m_date;
00811         sLastRev = tab2->m_rev;
00812         hasDate = tab2->m_hasdate;
00813         hasRev = tab2->m_hasrev;
00814         useMostRecent = tab2->m_match;
00815
00816         doexport = tab3->m_export;
00817         forceCvsroot = tab3->m_forceroot;
00818
00819         userHitOK = true;
00820     }
00821
00822     delete dlg;
00823 #endif // qUnix
00824
00825     if( userHitOK )
00826     {
00827         if( hasDate && !sLastDate.empty() )
00828             date = sLastDate;
00829
00830         if( hasRev && !sLastRev.empty() )
00831             rev = sLastRev;
00832
00833         modname = sLastModName;
00834
00835         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
00836         {
00837             rev1 = sLastRev1;
00838             rev2 = sLastRev2;
00839
00840             if( hasDate1 )
00841                 rev1 << ":" << sLastDate1;
00842
00843             if( hasDate2 )
00844                 rev2 << ":" << sLastDate2;
00845
00846         }
00847
00848         if( merge1 && !merge2 && !sLastRev1.empty() )
00849         {
00850             rev1 = sLastRev1;
00851
00852             if( hasDate1 )
00853                 rev1 << ":" << sLastDate1;
00854         }
00855
00856         gCvsPrefs.save();
00857     }
00858
00859     return userHitOK;
00860 }

Variable Documentation

CMString gOldModules(10, "P_OldModules")

Definition at line 47 of file CheckoutDlg.h.

Generated on Fri Jan 31 12:09:24 2003 for WinCvs Source by doxygen 1.3-rc2


CheckoutDlg.h File Reference

common/CheckoutDlg.h File Reference

#include "CPStr.h"
#include "SmartComboBox.h"
#include "KeywordComboBox.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 (const MultiFiles *mf, 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, UPStr &keyword)
Get the checkout options.

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 | ( | const MultiFiles * | mf,
 |  | 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,
 |  | UPStr & | keyword
 | ) |

Get the checkout options.

Definition at line 641 of file CheckoutDlg.cpp.

References BrowserGetDirectory(), CPStr, CStr, 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_keyword, CCheckout_OPTIONS::m_match, CUpdateMerge::m_merge, CCheckout_MAIN::m_moduleName, CCheckout_MAIN::m_noRecurse, CCheckout_MAIN::m_overrideCoDir, 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().

Referenced by CvsCmdCheckoutModule().

00649 {
00650     bool userHitOK = false;
00651
00652     date = "";
00653     rev = "";
00654     modname = "";
00655     norecurs = false;
00656     toStdout = false;
00657     useMostRecent = false;
00658     doexport = false;
00659     forceCvsroot = false;
00660     overrideCheckoutDir = false;
00661
00662     static CPStr sLastModName;
00663     static CPStr sLastRev;
00664     static CPStr sLastDate;
00665     static CPStr sLastRev1;
00666     static CPStr sLastRev2;
00667     static CPStr sLastDate1;
00668     static CPStr sLastDate2;
00669
00670     bool hasDate = false;
00671     bool hasRev = false;
00672     bool merge1 = false;
00673     bool merge2 = false;
00674     bool hasDate1 = false;
00675     bool hasDate2 = false;
00676     keyword = "";
00677
00678 #ifdef WIN32
00679     CPropertySheet pages("Checkout settings");
00680     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00681     CCheckout_MAIN page1(mf, sLastModName, path);
00682     CCheckout_OPTIONS page2(mf, sLastRev, sLastDate, keyword);
00683     CUpdateMerge page3(mf, true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00684     CGetPrefs_CVSROOT page4;
00685     CGetPrefs_GLOBALS page5;
00686     pages.AddPage(&page1);
00687     pages.AddPage(&page2);
00688     pages.AddPage(&page3);
00689     pages.AddPage(&page4);
00690     pages.AddPage(&page5);
00691     if(pages.DoModal() == IDOK)
00692     {
00693         sLastModName = (const char *)page1.m_moduleName;
00694         path = (const char *)page1.m_path;
00695         norecurs = page1.m_noRecurse == TRUE;
00696         toStdout = page1.m_stdout == TRUE;
00697         overrideCheckoutDir = page1.m_overrideCoDir == TRUE;
00698         checkoutDir = (const char *)page1.m_checkoutDir;
00699
00700         sLastDate = page2.m_date;
00701         sLastRev = page2.m_rev;
00702         hasDate = page2.m_hasDate == TRUE;
00703         hasRev = page2.m_hasRev == TRUE;
00704         useMostRecent = page2.m_match == TRUE;
00705         doexport = page2.m_export == TRUE;
00706         forceCvsroot = page2.m_forceRoot == TRUE;
00707         keyword = page2.m_keyword;
00708
00709         merge1 = page3.m_merge >= 1;
00710         merge2 = page3.m_merge == 2;
00711         sLastRev1 = page3.m_rev1;
00712         sLastRev2 = page3.m_rev2;
00713         hasDate1 = page3.m_hasDate1 == TRUE;
00714         hasDate2 = page3.m_hasDate2 == TRUE;
00715         sLastDate1 = page3.m_date1;
00716         sLastDate2 = page3.m_date2;
00717
00718         page4.StoreValues();
00719         page5.StoreValues();
00720         userHitOK = true;
00721     }
00722 #endif /* WIN32 */
00723 #ifdef qMacCvsPP
00724     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00725     LWindow *theDialog = theHandler.GetDialog();
00726     ThrowIfNil_(theDialog);
00727     static UInt16 sRuntimePanel = 1;
00728
00729     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00730         (theDialog->FindPaneByID(item_MultiViewPrefs));
00731     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00732
00733     multiView->SwitchToPanel(3);
00734     DoDataExchange_Globals(theDialog, true);
00735     multiView->SwitchToPanel(2);
00736     DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00737         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00738     multiView->SwitchToPanel(1);
00739     DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00740     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00741     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00742
00743
00744     groupView->SetValue(sRuntimePanel);
00745     theDialog->Show();
00746     MessageT hitMessage;
00747     while (true)
00748     {       // Let DialogHandler process events
00749         hitMessage = theHandler.DoDialog();
00750
00751         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00752             break;
00753
00754         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00755         {
00756             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00757             {
00758                 continue;
00759             }
00760
00761             CStr dir;
00762             if( BrowserGetDirectory("Select a directory to checkout to", dir) )
00763             {
00764                 CPStr tmp(dir.c_str());
00765                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00766             }
00767             else if(hitMessage == item_CheckGroupPath)
00768             {
00769                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00770             }
00771         }
00772     }
00773     theDialog->Hide();
00774     sRuntimePanel = groupView->GetValue();
00775
00776     if(hitMessage == msg_OK)
00777     {
00778         multiView->SwitchToPanel(1);
00779         DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00780         multiView->SwitchToPanel(2);
00781         DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00782             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00783         multiView->SwitchToPanel(3);
00784         DoDataExchange_Globals(theDialog, false);
00785
00786         Assert_(sLastModName.length() != 0);
00787
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791 #if qUnix
00792     void *wid = UCreate_CheckoutDlg();
00793
00794     UCvsCheckout *dlg = new UCvsCheckout();
00795     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00796     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00797     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00798     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00799     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00800     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00801     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00802
00803     if(dlg->DoModal())
00804     {
00805         sLastModName = tab1->m_modname;
00806         path = tab1->m_path;
00807         norecurs = tab1->m_norecurs;
00808         toStdout = tab1->m_stdout;
00809
00810         sLastDate = tab2->m_date;
00811         sLastRev = tab2->m_rev;
00812         hasDate = tab2->m_hasdate;
00813         hasRev = tab2->m_hasrev;
00814         useMostRecent = tab2->m_match;
00815
00816         doexport = tab3->m_export;
00817         forceCvsroot = tab3->m_forceroot;
00818
00819         userHitOK = true;
00820     }
00821
00822     delete dlg;
00823 #endif // qUnix
00824
00825     if( userHitOK )
00826     {
00827         if( hasDate && !sLastDate.empty() )
00828             date = sLastDate;
00829
00830         if( hasRev && !sLastRev.empty() )
00831             rev = sLastRev;
00832
00833         modname = sLastModName;
00834
00835         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
00836         {
00837             rev1 = sLastRev1;
00838             rev2 = sLastRev2;
00839
00840             if( hasDate1 )
00841                 rev1 << ":" << sLastDate1;
00842
00843             if( hasDate2 )
00844                 rev2 << ":" << sLastDate2;
00845
00846         }
00847
00848         if( merge1 && !merge2 && !sLastRev1.empty() )
00849         {
00850             rev1 = sLastRev1;
00851
00852             if( hasDate1 )
00853                 rev1 << ":" << sLastDate1;
00854         }
00855
00856         gCvsPrefs.save();
00857     }
00858
00859     return userHitOK;
00860 }

Variable Documentation

CMString gOldModules

Definition at line 47 of file CheckoutDlg.h.

Generated on Fri Jan 31 12:09:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "getline.h"
#include "MultiString.h"
#include "CvsCommands.h"
#include "EditorMonDlg.h"
#include "ItemListDlg.h"
#include "BrowseViewHandlers.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

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

Variables

CMString | gCommitLogs (10,"P_CommitLogs")
CPersistentBool | gCheckValidEdits ("P_CheckValidEdits", false)

Define Documentation

#define HOWMUCH_WORDS 5

Function Documentation

void combozify ( UStr & str )

Show the ellipsis if the string is too long

Parameters:
str String to modify

Definition at line 67 of file CommitDlg.cpp.

References CStr.

00068 {
00069     // extract the first xxx words
00070     const char* tmp = str;
00071     CStr result;
00072     int numWords = 0;
00073 #   define HOWMUCH_WORDS 5
00074     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00075     {
00076         while(*tmp != '\0' && isspace(*tmp))
00077             tmp++;
00078
00079         while(*tmp != '\0' && !isspace(*tmp))
00080             result << *tmp ++;
00081
00082         if( *tmp != '\0' )
00083             result << ' ';
00084
00085         numWords++;
00086     }
00087
00088     if( *tmp != '\0' )
00089     {
00090         result << "...";
00091     }
00092
00093     str = result;
00094 }

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

Get the commit options

Note:
The path is used to read the /path/CVS/Template optionally

Definition at line 1070 of file CommitDlg.cpp.

References MultiFiles::begin(), CPStr, CStr, UStr::empty(), MultiFiles::end(), UStr::endsWith(), EV_INIT_WIDGET, gCheckValidEdits, 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, MultiFiles::newdir(), MultiFiles::newfile(), KoDiffHandler::OnFiles(), CGetPrefs_GLOBALS::StoreValues(), MultiFiles::TotalNumFiles(), UCreate_CommitDlg(), and UEventSendMessage().

Referenced by CvsCmdCommit().

01075 {
01076     bool userHitOK = false;
01077
01078     static CStr sLastMsg;
01079     static CPStr sLastRev;
01080
01081     bool hasRev = false;
01082
01083     norecurs = false;
01084     commit = "";
01085     forceCommit = false;
01086     forceRecurse = false;
01087     rev = "";
01088     noModuleProgram = false;
01089     checkValidEdits = (bool)gCheckValidEdits;
01090
01091 #ifdef WIN32
01092     CPropertySheet pages("Commit settings");
01093     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01094     CCommit_MAIN page1(mf, sLastMsg, pathTmpl);
01095     CCommit_OPTIONS page2(mf);
01096     CGetPrefs_GLOBALS page3;
01097     pages.AddPage(&page1);
01098     pages.AddPage(&page2);
01099     pages.AddPage(&page3);
01100     if(pages.DoModal() == IDOK)
01101     {
01102         commit = (const char *)page1.m_logMsg;
01103         sLastMsg = (const char *)page1.m_logMsg;
01104         norecurs = page2.m_noRecurse ? true : false;
01105         forceCommit = page2.m_forceCommit ? true : false;
01106         forceRecurse = page2.m_forceRecurse ? true : false;
01107         hasRev = page2.m_forceRevision ? true : false;
01108         sLastRev = page2.m_rev;
01109         noModuleProgram = page2.m_noModuleProgram ? true : false;
01110         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
01111         page3.StoreValues();
01112
01113         userHitOK = true;
01114     }
01115 #endif /* WIN32 */
01116 #ifdef qMacCvsPP
01117     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
01118     LWindow *theDialog = theHandler.GetDialog();
01119     ThrowIfNil_(theDialog);
01120     static UInt16 sRuntimePanel = 1;
01121
01122     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01123         (theDialog->FindPaneByID(item_MultiViewPrefs));
01124     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01125
01126     multiView->SwitchToPanel(3);
01127     DoDataExchange_Globals(theDialog, true);
01128     multiView->SwitchToPanel(2);
01129     DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
01130     multiView->SwitchToPanel(1);
01131     DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, true);
01132
01133     LPopupButton *previewDiff = dynamic_cast<LPopupButton*>
01134                                 (theDialog->FindPaneByID(item_PreviewDiffPopup));
01135     LPushButton *previewBtn = dynamic_cast<LPushButton*>
01136                                 (theDialog->FindPaneByID(item_PreviewDiffBtn));
01137     previewBtn->AddListener(&theHandler);
01138     previewDiff->DeleteAllMenuItems();
01139     if( mf && mf->TotalNumFiles() )
01140     {
01141         MultiFiles::const_iterator mfi;
01142         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01143         {
01144             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
01145             {
01146                 UStr path;
01147                 UStr fileName, currRev;
01148
01149                 mfi->get(nIndex, path, fileName, currRev);
01150                 if(!path.empty() && !path.endsWith(kPathDelimiter))
01151                     path << kPathDelimiter;
01152                 path << fileName;
01153                 previewDiff->InsertMenuItem(LStr255(path), ::CountMenuItems(previewDiff->GetMacMenuH()));
01154             }
01155         }
01156     }
01157     else
01158     {
01159         previewDiff->Disable();
01160         previewBtn->Disable();
01161     }
01162
01163     groupView->SetValue(sRuntimePanel);
01164     theDialog->Show();
01165     MessageT hitMessage;
01166     while (true)
01167     {       // Let DialogHandler process events
01168         hitMessage = theHandler.DoDialog();
01169
01170         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01171             break;
01172
01173         if(hitMessage == item_PreviewDiffBtn)
01174         {
01175             int file = previewDiff->GetCurrentMenuItem(), count = 1;
01176             MultiFiles::const_iterator mfi;
01177             for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01178             {
01179                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++, count++)
01180                 {
01181                     if(count == file)
01182                     {
01183                         UStr path;
01184                         UStr fileName, currRev;
01185                         mfi->get(nIndex, path, fileName, currRev);
01186
01187                         MultiFiles mf;
01188                         mf.newdir(path);
01189                         mf.newfile(fileName, 0, currRev);
01190
01191                         KoDiffHandler handler;
01192                         handler.OnFiles(&mf);
01193                         break;
01194                     }
01195                 }
01196             }
01197         }
01198     }
01199     theDialog->Hide();
01200     sRuntimePanel = groupView->GetValue();
01201
01202     if(hitMessage == msg_OK)
01203     {
01204         multiView->SwitchToPanel(1);
01205         DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, false);
01206         multiView->SwitchToPanel(2);
01207         DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
01208         multiView->SwitchToPanel(3);
01209         DoDataExchange_Globals(theDialog, false);
01210         commit = sLastMsg;
01211         commit.replace('\015', '\012');
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215 #if qUnix
01216     void *wid = UCreate_CommitDlg();
01217
01218     UCvsCommit *dlg = new UCvsCommit();
01219     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN( mf, sLastMsg, pathTmpl);
01220     UCvsCommit_OPTIONS *tab2 = new UCvsCommit_OPTIONS( mf);
01221
01222     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01223     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
01224     dlg->AddPage(tab2, UCvsCommit::kTabGeneral, 1);
01225
01226     if(dlg->DoModal())
01227     {
01228         commit = tab1->m_logmsg;
01229         sLastMsg = tab1->m_logmsg;
01230         norecurs = tab2->m_noRecurse;
01231         forceCommit = tab2->m_forceCommit;
01232         forceRecurse = tab2->m_forceRecurse;
01233         hasRev = tab2->m_forceRevision;
01234         sLastRev = tab2->m_rev;
01235         noModuleProgram = tab2->m_noModuleProgram;
01236         gCheckValidEdits = tab2->m_checkValidEdits;
01237
01238         userHitOK = true;
01239     }
01240
01241     delete dlg;
01242 #endif // qUnix
01243
01244     if(userHitOK)
01245     {
01246         if(commit.length() == 0)
01247             commit = "no message";
01248
01249         if(hasRev && !sLastRev.empty())
01250             rev = sLastRev;
01251
01252         checkValidEdits = (bool)gCheckValidEdits;
01253
01254         gCvsPrefs.save();
01255     }
01256
01257     return userHitOK;
01258 }

Variable Documentation

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

Referenced by CCommit_OPTIONS::CCommit_OPTIONS(), and CompatGetCommit().

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

Referenced by CCommit_MAIN::DoDataExchange(), and CCommit_MAIN::OnSelchangeCombo().

Generated on Fri Jan 31 12:09:26 2003 for WinCvs Source by doxygen 1.3-rc2


CommitDlg.h File Reference

common/CommitDlg.h File Reference

#include "CPStr.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 (const MultiFiles *mf, UStr &commit, bool &norecurs, bool &forceCommit, bool &forceRecurse, UPStr &rev, bool &noModuleProgram, bool &checkValidEdits, const char *pathTmpl=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 )

Show the ellipsis if the string is too long

Parameters:
str String to modify

Definition at line 67 of file CommitDlg.cpp.

References CStr.

00068 {
00069     // extract the first xxx words
00070     const char* tmp = str;
00071     CStr result;
00072     int numWords = 0;
00073 #   define HOWMUCH_WORDS 5
00074     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00075     {
00076         while(*tmp != '\0' && isspace(*tmp))
00077             tmp++;
00078
00079         while(*tmp != '\0' && !isspace(*tmp))
00080             result << *tmp ++;
00081
00082         if( *tmp != '\0' )
00083             result << ' ';
00084
00085         numWords++;
00086     }
00087
00088     if( *tmp != '\0' )
00089     {
00090         result << "...";
00091     }
00092
00093     str = result;
00094 }

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

Get the commit options

Note:
The path is used to read the /path/CVS/Template optionally

Definition at line 1070 of file CommitDlg.cpp.

References MultiFiles::begin(), CPStr, CStr, UStr::empty(), MultiFiles::end(), UStr::endsWith(), EV_INIT_WIDGET, gCheckValidEdits, 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, MultiFiles::newdir(), MultiFiles::newfile(), KoDiffHandler::OnFiles(), CGetPrefs_GLOBALS::StoreValues(), MultiFiles::TotalNumFiles(), UCreate_CommitDlg(), and UEventSendMessage().

Referenced by CvsCmdCommit().

01075 {
01076     bool userHitOK = false;
01077
01078     static CStr sLastMsg;
01079     static CPStr sLastRev;
01080
01081     bool hasRev = false;
01082
01083     norecurs = false;
01084     commit = "";
01085     forceCommit = false;
01086     forceRecurse = false;
01087     rev = "";
01088     noModuleProgram = false;
01089     checkValidEdits = (bool)gCheckValidEdits;
01090
01091 #ifdef WIN32
01092     CPropertySheet pages("Commit settings");
01093     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01094     CCommit_MAIN page1(mf, sLastMsg, pathTmpl);
01095     CCommit_OPTIONS page2(mf);
01096     CGetPrefs_GLOBALS page3;
01097     pages.AddPage(&page1);
01098     pages.AddPage(&page2);
01099     pages.AddPage(&page3);
01100     if(pages.DoModal() == IDOK)
01101     {
01102         commit = (const char *)page1.m_logMsg;
01103         sLastMsg = (const char *)page1.m_logMsg;
01104         norecurs = page2.m_noRecurse ? true : false;
01105         forceCommit = page2.m_forceCommit ? true : false;
01106         forceRecurse = page2.m_forceRecurse ? true : false;
01107         hasRev = page2.m_forceRevision ? true : false;
01108         sLastRev = page2.m_rev;
01109         noModuleProgram = page2.m_noModuleProgram ? true : false;
01110         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
01111         page3.StoreValues();
01112
01113         userHitOK = true;
01114     }
01115 #endif /* WIN32 */
01116 #ifdef qMacCvsPP
01117     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
01118     LWindow *theDialog = theHandler.GetDialog();
01119     ThrowIfNil_(theDialog);
01120     static UInt16 sRuntimePanel = 1;
01121
01122     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01123         (theDialog->FindPaneByID(item_MultiViewPrefs));
01124     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01125
01126     multiView->SwitchToPanel(3);
01127     DoDataExchange_Globals(theDialog, true);
01128     multiView->SwitchToPanel(2);
01129     DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
01130     multiView->SwitchToPanel(1);
01131     DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, true);
01132
01133     LPopupButton *previewDiff = dynamic_cast<LPopupButton*>
01134                                 (theDialog->FindPaneByID(item_PreviewDiffPopup));
01135     LPushButton *previewBtn = dynamic_cast<LPushButton*>
01136                                 (theDialog->FindPaneByID(item_PreviewDiffBtn));
01137     previewBtn->AddListener(&theHandler);
01138     previewDiff->DeleteAllMenuItems();
01139     if( mf && mf->TotalNumFiles() )
01140     {
01141         MultiFiles::const_iterator mfi;
01142         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01143         {
01144             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
01145             {
01146                 UStr path;
01147                 UStr fileName, currRev;
01148
01149                 mfi->get(nIndex, path, fileName, currRev);
01150                 if(!path.empty() && !path.endsWith(kPathDelimiter))
01151                     path << kPathDelimiter;
01152                 path << fileName;
01153                 previewDiff->InsertMenuItem(LStr255(path), ::CountMenuItems(previewDiff->GetMacMenuH()));
01154             }
01155         }
01156     }
01157     else
01158     {
01159         previewDiff->Disable();
01160         previewBtn->Disable();
01161     }
01162
01163     groupView->SetValue(sRuntimePanel);
01164     theDialog->Show();
01165     MessageT hitMessage;
01166     while (true)
01167     {       // Let DialogHandler process events
01168         hitMessage = theHandler.DoDialog();
01169
01170         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01171             break;
01172
01173         if(hitMessage == item_PreviewDiffBtn)
01174         {
01175             int file = previewDiff->GetCurrentMenuItem(), count = 1;
01176             MultiFiles::const_iterator mfi;
01177             for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01178             {
01179                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++, count++)
01180                 {
01181                     if(count == file)
01182                     {
01183                         UStr path;
01184                         UStr fileName, currRev;
01185                         mfi->get(nIndex, path, fileName, currRev);
01186
01187                         MultiFiles mf;
01188                         mf.newdir(path);
01189                         mf.newfile(fileName, 0, currRev);
01190
01191                         KoDiffHandler handler;
01192                         handler.OnFiles(&mf);
01193                         break;
01194                     }
01195                 }
01196             }
01197         }
01198     }
01199     theDialog->Hide();
01200     sRuntimePanel = groupView->GetValue();
01201
01202     if(hitMessage == msg_OK)
01203     {
01204         multiView->SwitchToPanel(1);
01205         DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, false);
01206         multiView->SwitchToPanel(2);
01207         DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
01208         multiView->SwitchToPanel(3);
01209         DoDataExchange_Globals(theDialog, false);
01210         commit = sLastMsg;
01211         commit.replace('\015', '\012');
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215 #if qUnix
01216     void *wid = UCreate_CommitDlg();
01217
01218     UCvsCommit *dlg = new UCvsCommit();
01219     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN( mf, sLastMsg, pathTmpl);
01220     UCvsCommit_OPTIONS *tab2 = new UCvsCommit_OPTIONS( mf);
01221
01222     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01223     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
01224     dlg->AddPage(tab2, UCvsCommit::kTabGeneral, 1);
01225
01226     if(dlg->DoModal())
01227     {
01228         commit = tab1->m_logmsg;
01229         sLastMsg = tab1->m_logmsg;
01230         norecurs = tab2->m_noRecurse;
01231         forceCommit = tab2->m_forceCommit;
01232         forceRecurse = tab2->m_forceRecurse;
01233         hasRev = tab2->m_forceRevision;
01234         sLastRev = tab2->m_rev;
01235         noModuleProgram = tab2->m_noModuleProgram;
01236         gCheckValidEdits = tab2->m_checkValidEdits;
01237
01238         userHitOK = true;
01239     }
01240
01241     delete dlg;
01242 #endif // qUnix
01243
01244     if(userHitOK)
01245     {
01246         if(commit.length() == 0)
01247             commit = "no message";
01248
01249         if(hasRev && !sLastRev.empty())
01250             rev = sLastRev;
01251
01252         checkValidEdits = (bool)gCheckValidEdits;
01253
01254         gCvsPrefs.save();
01255     }
01256
01257     return userHitOK;
01258 }

Variable Documentation

CMString gRevNames

Definition at line 46 of file CommitDlg.h.

Generated on Fri Jan 31 12:09:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:27 2003 for WinCvs Source by doxygen 1.3-rc2


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(), CompatGetAnnotate(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetDiff(), CompatGetImport(), CompatGetLog(), CompatGetUpdate(), CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), CvsCmdAnnotate(), CvsCmdCheckoutModule(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdImportModule(), CvsCmdLog(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUpdate(), PCPStr::GetData(), ReportWarning::GetDesc(), ReportConflict::GetDesc(), ReportConflict::GetKindDesc(), ReportWarning::GetStateDesc(), ReportConflict::GetStateDesc(), CPersistent::LoadAll(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), 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 CvsArgs::addcvsroot(), RemoveCvsArgs::addfile(), ReportWarning::AddWarning(), BrowserGetDirectory(), BrowserGetMultiFiles(), BuildIgnoredList(), CAboutDlg::CAboutDlg(), CImportEntry::CImportEntry(), CImportWarning::CImportWarning(), CMString::CMString(), combozify(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetEditorMsg(), CompatGetImport(), CompatGetModuleListItem(), CompatGetTagListItem(), CompatMoveToTrash(), CWinCvsBrowser::Create(), CTcl_Interp::CTcl_Interp(), CTipDlg::CTipDlg(), CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdImportModule(), CvsCmdMacrosAdmin(), CvsCmdMoveToTrash(), CvsCmdRelease(), cvsgui_LaunchTclMacro(), CvsLogParse(), DDV_CheckPathExists(), CSelectionDetailsDlg::DisplaySelection(), UCvsFiles::EditSel(), Entries_SetVisited(), FileTraverse(), FormatMenuString(), CWincvsApp::GetAppPath(), PCStr::GetData(), CWinCvsBrowser::GetItemByLocation(), UCvsFolders::GetItemByLocation(), getLoc(), CTCLBrowserEnt::GetNormalized(), CBrowseFileView::GetPath(), UCvsFiles::GetPath(), CWinCvsBrowser::GetRoot(), KiSelectionHandler::GetSelection(), getSettingName(), glue_getenv(), CvsPrefs::Home(), ign_add(), InitializeInterp(), CWincvsApp::InitInstance(), CTCLBrowserEnt::IsSamePath(), Authen::kindstr(), launchCVS(), LaunchDiff(), LaunchEditor(), LaunchItemListCommand(), LaunchViewer(), CPersistent::LoadAll(), CWincvsApp::LookForResourceFile(), MacrosReloadAll(), MakeTmpFile(), MigrateCvsrootList(), myTcl_CreateInterp(), MultiFiles::Normalize(), CWinCvsBrowser::NotifySelectionChange(), CGetPrefs_CVS::OnAltcvssel(), CGetPrefs_WINCVS::OnAltsettingschk(), CWincvsApp::OnAppCredits(), CRtag_MAIN::OnBrowseModules(), CImport_MAIN::OnBrowseModules(), CCheckout_MAIN::OnBrowseModules(), CItemListDlg::OnBrowseReadfrom(), CWincvsDoc::OnBrowserOpen(), UCvsFrame::OnBrowserPopup(), CUpdateSticky::OnBrowseTag(), CTag_MAIN::OnBrowseTag(), CRtag_OPTIONS::OnBrowseTag(), CRtag_MAIN::OnBrowseTag(), CLogFilters::OnBrowseTag(), CItemListDlg::OnBrowseTag(), CCommit_OPTIONS::OnBrowseTag(), CCheckout_OPTIONS::OnBrowseTag(), CAnnotate_MAIN::OnBrowseTag(), CUpdateMerge::OnBrowseTag1(), CImport_MAIN::OnBrowseTag1(), CDiff_MAIN::OnBrowseTag1(), CUpdateMerge::OnBrowseTag2(), CImport_MAIN::OnBrowseTag2(), CDiff_MAIN::OnBrowseTag2(), CGetPrefs_CVS::OnBtnhome(), UAuthen_SSH::OnBtnName(), CImport_OPTIONS::OnBtnpath(), CCheckout_MAIN::OnBtnPath(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnsettings(), CGetPrefs_WINCVS::OnBtnviewer(), CCmdLine_MAIN::OnCheckpath(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUIEditseldef(), CCommit_MAIN::OnDiff(), TViewFill::OnDirectory(), CGetPrefs_WINCVS::OnExtdiffsel(), MacroTraversal::OnFile(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CWincvsApp::OnHelpCvs(), CWincvsApp::OnHelpCvsclient(), CItemListDlg::OnInitDialog(), CWinCvsBrowser::OnItemexpanding(), UCvsFiles::OnMacroSel(), CCmdLine_MAIN::OnModule(), CSplashWnd::OnPaint(), CGraphView::OnQueryAnnotate(), CItemListDlg::OnSelection(), CCmdLine_MAIN::OnSelfolder(), CCmdLine_MAIN::OnTag(), CWinCvsBrowser::OnUpdateCmd(), CWinCvsBrowser::OnUpdateMacro(), CWinCvsBrowser::OnViewExplore(), CGraphView::OnViewReload(), CGraphView::OnViewRetrieve(), CGraphView::OnViewUnlockf(), PCStr::operator char *(), PCStr::operator const char *(), PCStr::operator=(), PCStr::PCStr(), print(), CvsArgs::print(), CWinCvsBrowser::ProcessSelectionCommand(), CvsArgs::reset(), CWinCvsBrowser::ResetBrowser(), UCvsFolders::ResetBrowser(), CWinCvsBrowser::ResetView(), CWinCvsBrowser::RetrievePath(), KoRevisionColumn::revcmp(), CPersistent::SaveAll(), PCStr::SetData(), CHistComboBoxEx::SetIcon(), CGraphDoc::SetNode(), CWinCvsBrowser::StepToLocation(), CWinCvsBrowser::StoreExpanded(), Tag_Open(), tclCvsBrowserProc(), tclCvsEntriesProc(), tclSafeRemove(), Authen::token(), and TGraphDelCmd::TraverseNode().

Generated on Fri Jan 31 12:09:30 2003 for WinCvs Source by doxygen 1.3-rc2


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().

#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 Fri Jan 31 12:09:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 | AnsiSeq
class | irciiAttrCvt
class | mircAttrCvt
struct | RGBColor
class | CTCP2Parse

Generated on Fri Jan 31 12:09:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 151 of file CvsAlert.cpp.

References _i18n, EV_INIT_WIDGET, EV_SETTEXT, kUMainWidget, NULL, UCreate_AskYesNo(), and UEventSendMessage().

Referenced by AskCreatePersistentSettings(), UCvsFrame::AskForQuitting(), AskYesNo(), CvsCmdAdd(), CvsCmdMoveToTrash(), CGraphView::OnGraphSetstate(), and USmartCombo::RemoveItem().

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

Generated on Fri Jan 31 12:09:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 151 of file CvsAlert.cpp.

References _i18n, EV_INIT_WIDGET, EV_SETTEXT, kUMainWidget, NULL, UCreate_AskYesNo(), and UEventSendMessage().

Referenced by AskCreatePersistentSettings(), UCvsFrame::AskForQuitting(), AskYesNo(), CvsCmdAdd(), CvsCmdMoveToTrash(), CGraphView::OnGraphSetstate(), and USmartCombo::RemoveItem().

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

Generated on Fri Jan 31 12:09:32 2003 for WinCvs Source by doxygen 1.3-rc2


CvsArgs.cpp File Reference

common/CvsArgs.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "CvsPrefs.h"
#include "CvsArgs.h"
#include "AppConsole.h"
#include "Authen.h"
#include "FileTraversal.h"
#include "MoveToTrash.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)
Reduce a long string for printing, add "..." if the length is up the limit.

char * | expandLF (const char *str, CStaticAllocT< char > &buf)
Replace
by "
" so it's readable.

Variables

CStaticAllocT< char > | buf

Define Documentation

#define MAX_PRINT_ARG 80

Definition at line 46 of file CvsArgs.cpp.

Referenced by CvsArgs::print(), and reduceString().

Function Documentation

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

Replace
by "
" so it's readable.

Definition at line 86 of file CvsArgs.cpp.

References CStaticAllocT< char >::AdjustSize(), and buf.

Referenced by CvsArgs::print().

00087 {
00088     int numLFs = 0;
00089     const char *runner = str;
00090     while((runner = strchr(runner, '\n')) != 0L)
00091     {
00092         numLFs++;
00093         runner++;
00094     }
00095
00096     size_t len = strlen(str);
00097     buf.AdjustSize(len + numLFs + 1); // numLFs * "\n" + '\0'
00098
00099     char *tmp = buf;
00100     char c;
00101     runner = str;
00102     while((c = *runner++) != '\0')
00103     {
00104         if(c == '\n')
00105         {
00106             *tmp++ = '\\';
00107             *tmp++ = 'n';
00108         }
00109         else
00110             *tmp++ = c;
00111     }
00112     *tmp++ = '\0';
00113
00114     return buf;
00115 }

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

Definition at line 50 of file CvsArgs.cpp.

References cvs_err(), exit, malloc, and NULL.

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

00051 {
00052     int size = strlen(string);
00053     char *result = (char *)malloc((size + 1) * sizeof(char));
00054     if(result == NULL)
00055     {
00056         cvs_err("Impossible to allocate %d bytes !\n", size + 1);
00057         exit(1);
00058     }
00059     strcpy(result, string);
00060     return result;
00061 }

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

Reduce a long string for printing, add "..." if the length is up the limit.

Definition at line 64 of file CvsArgs.cpp.

References CStaticAllocT< char >::AdjustSize(), buf, and MAX_PRINT_ARG.

Referenced by CvsArgs::print().

00065 {
00066     buf.AdjustSize(MAX_PRINT_ARG + 4); // "..." + '\0'
00067     size_t len = strlen(str);
00068     if(len < MAX_PRINT_ARG)
00069     {
00070         strcpy(buf, str);
00071     }
00072     else
00073     {
00074         memcpy((char *)buf, str, MAX_PRINT_ARG * sizeof(char));
00075         char *tmp = (char *)buf + MAX_PRINT_ARG;
00076         *tmp++ = '.';
00077         *tmp++ = '.';
00078         *tmp++ = '.';
00079         *tmp = '\0';
00080     }
00081
00082     return buf;
00083 }

Variable Documentation

CStaticAllocT<char> buf [static]

Definition at line 48 of file CvsArgs.cpp.

Referenced by expandLF(), CvsArgs::print(), and reduceString().

Generated on Fri Jan 31 12:09:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 | AddBinCvsArgs
Class to add binary files. More...

class | AddCvsArgs
Class to add files. More...

class | AddUnicodeCvsArgs
Class to add Unicode files. More...

class | ControlCvsArgs
Base class for control arguments used by add commands (added files are tested appropriate). More...

class | RemoveCvsArgs
Class to remove files. More...

class | CvsArgs
Class to handle cvs arguments, append "cvs" and misc options defined by preferences ("-z9" for example). More...

Defines

#define | CVS_CMD "cvs"
CVS command line client abbreviation.

Define Documentation

#define CVS_CMD "cvs"

CVS command line client abbreviation.

Definition at line 34 of file CvsArgs.h.

Generated on Fri Jan 31 12:09:33 2003 for WinCvs Source by doxygen 1.3-rc2


CvsCommands.cpp File Reference

common/CvsCommands.cpp File Reference

#include "stdafx.h"
#include <errno.h>
#include <process.h>
#include <io.h>
#include "wincvs.h"
#include "CvsCommands.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 "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 "StatusDlg.h"
#include "LoginDlg.h"
#include "BrowseViewHandlers.h"

Include dependency graph for CvsCommands.cpp:

Include dependency graph

Go to the source code of this file.

Functions

char * | CleanupLogMsg (const char *msg)
bool | SplitPath (const char *dir, UStr &uppath, UStr &folder, bool dontSkipDelimiter)
bool | MakeTmpFile (UStr &file, const char *prefix, const char *extension, bool create)
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)
bool | LaunchDiff (const char *f1, const char *f2)
bool | LaunchViewer (const char *filePath, bool useDefault)
bool | LaunchEditor (const char *filePath, void *par)
void | FlatenSubFolders (UStr &tmpf)
void | CvsCmdMacrosAdmin (const char *macroName)
bool | CheckSelectionHandler (KiSelectionHandler &handler, MultiFiles *&mf, bool forceNormalize=false)
void | CvsCmdInit ()
void | CvsCmdLogin (void)
void | CvsCmdLogout (void)
void | CvsCmdRtagCreate (KiSelectionHandler &handler)
void | CvsCmdRtagDelete (KiSelectionHandler &handler)
void | CvsCmdRtagBranch (KiSelectionHandler &handler)
void | CvsCmdCheckoutModule (KiSelectionHandler &handler)
void | CvsCmdImportModule (KiSelectionHandler &handler)
void | CvsCmdCommandLine (KiSelectionHandler &handler)
void | CvsCmdCancelChanges (KiSelectionHandler &handler)
void | CvsCmdUpdate (KiSelectionHandler &handler, bool queryOnly)
void | CvsCmdCommit (KiSelectionHandler &handler)
void | CvsCmdDiff (KiSelectionHandler &handler, kDiffCmdType diffType)
void | CvsCmdAdd (KiSelectionHandler &handler, kAddCmdType addType)
void | CvsCmdRemove (KiSelectionHandler &handler)
void | CvsCmdLog (KiSelectionHandler &handler, bool outGraph, void *defWnd)
void | CvsCmdStatus (KiSelectionHandler &handler)
void | CvsCmdLock (KiSelectionHandler &handler)
void | CvsCmdUnlock (KiSelectionHandler &handler)
void | CvsCmdTagCreate (KiSelectionHandler &handler)
void | CvsCmdTagDelete (KiSelectionHandler &handler)
void | CvsCmdTagBranch (KiSelectionHandler &handler)
void | CvsCmdEdit (KiSelectionHandler &handler, kEditCmdType editType)
void | CvsCmdUnedit (KiSelectionHandler &handler)
void | CvsCmdWatchOn (KiSelectionHandler &handler)
void | CvsCmdWatchOff (KiSelectionHandler &handler)
void | CvsCmdRelease (KiSelectionHandler &handler)
void | CvsCmdWatchers (KiSelectionHandler &handler)
void | CvsCmdEditors (KiSelectionHandler &handler)
void | CvsCmdAnnotate (KiSelectionHandler &handler)
void | CvsCmdMoveToTrash (KiSelectionHandler &handler)

Function Documentation

bool CheckSelectionHandler | ( | KiSelectionHandler & | handler,
 |  | MultiFiles *& | mf,
 |  | bool | forceNormalize = false
 | ) | [static]

Verify the selection handler is properly setup to carry on launching command

Parameters:
handler | Command handler to be tested
mf | Returned selection as MultiFiles
forceNormalize | specifies whether to force normalization of the MultiFiles or rely on the selection handler's requirements
Returns:
true if handler is properly setup, false otherwise

Definition at line 833 of file CvsCommands.cpp.

References KiSelectionHandler::GetNeedSelection(), KiSelectionHandler::GetSelection(), KiSelectionHandler::NeedsNormalize(), and MultiFiles::Normalize().

Referenced by CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdLock(), CvsCmdLog(), CvsCmdMoveToTrash(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), and CvsCmdWatchOn().

00834 {
00835     if( gCvsPrefs.empty() )
00836     {
00837         return false;
00838     }
00839
00840     mf = handler.GetSelection();
00841     if( !mf && handler.GetNeedSelection() )
00842     {
00843         return false;
00844     }
00845
00846     return ( forceNormalize || handler.NeedsNormalize() ) ? mf->Normalize() : true;
00847 }

char* CleanupLogMsg ( const char * msg )

Clean up the log message for the server and put the good line feeds

Parameters:
msg Message to be cleaned
Returns:
The cleaned message
Todo:
mac : ISO conversion

Definition at line 86 of file CvsCommands.cpp.

References CStaticAllocT< T >::AdjustSize().

Referenced by CvsCmdCommit(), CvsCmdImportModule(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), and CGraphView::OnGraphSetstate().

00087 {
00088     static CStaticAllocT<char> buf;
00089
00090     size_t len = strlen(msg);
00091     buf.AdjustSize(len + 1);
00092
00093     char* tmp = buf;
00094     char c;
00095
00096
00097     while( (c = *msg++) != '\0' )
00098     {
00099 #ifdef WIN32
00100         if(c == '\r')
00101             continue;
00102 #endif /* WIN32 */
00103 #ifdef TARGET_OS_MAC
00104         if(c == '\r')
00105             c = '\n';
00106 #endif /* TARGET_OS_MAC */
00107         *tmp++ = c;
00108     }
00109
00110     *tmp++ = '\0';
00111
00112     return buf;
00113 }

void CvsCmdAdd | ( | KiSelectionHandler & | handler,
 |  | kAddCmdType | addType
 | ) |

Execute cvs add command

Parameters:
handler | Selection for the command
addType | Add type

Definition at line 1795 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CStr, cvs_err(), CvsAlert(), MultiFiles::end(), ControlCvsArgs::HasProblem(), kAddBinary, kAddNormal, kAddUnicode, launchCVS(), NULL, CvsArgs::print(), and SplitPath().

Referenced by KoAddHandler::OnFiles(), KoAddBinaryHandler::OnFiles(), KoAddUnicodeHandler::OnFiles(), KoAddHandler::OnFolder(), KoAddBinaryHandler::OnFolder(), and KoAddUnicodeHandler::OnFolder().

01796 {
01797     MultiFiles* mf = NULL;
01798     if( !CheckSelectionHandler(handler, mf) )
01799         return;
01800
01801     MultiFiles::const_iterator mfi;
01802     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01803     {
01804         if( mfi->NumFiles() > 0 )
01805         {
01806             // Files
01807             ControlCvsArgs* args = NULL;
01808             switch( addType )
01809             {
01810             default:
01811             case kAddNormal:
01812                 args = new AddCvsArgs;
01813                 break;
01814             case kAddBinary:
01815                 args = new AddBinCvsArgs;
01816                 break;
01817             case kAddUnicode:
01818                 args = new AddUnicodeCvsArgs;
01819                 break;
01820             }
01821
01822             if( !args )
01823             {
01824                 cvs_err("Unable to allocate memory for arguments list\n");
01825                 return;
01826             }
01827
01828             args->add("add");
01829
01830             if( addType == kAddBinary )
01831             {
01832                 args->add("-kb");
01833             }
01834             else if( addType == kAddUnicode )
01835             {
01836                 args->add("-ku");
01837             }
01838
01839             const char* dir = mfi->add(*args);
01840
01841             if( !args->HasProblem() ||
01842                 !CvsAlert(_i18n("Some problems have been found while adding files and should be corrected"), _i18n("Cancel"), _i18n("Ignore")) )
01843             {
01844                 args->print(dir);
01845                 launchCVS(dir, args->Argc(), args->Argv());
01846             }
01847
01848             delete args;
01849         }
01850         else
01851         {
01852             // Directory
01853             const char* dir = mfi->getdir();
01854             CStr uppath, folder;
01855
01856             if( !SplitPath(dir, uppath, folder) )
01857             {
01858                 cvs_err(_i18n("Unable to convert path name '%s'\n"), dir);
01859                 return;
01860             }
01861
01862             CvsArgs args;
01863             args.add("add");
01864             args.add(folder);
01865
01866             args.print(uppath);
01867             launchCVS(uppath, args.Argc(), args.Argv());
01868         }
01869     }
01870 }

void CvsCmdAnnotate ( KiSelectionHandler & handler )

Execute cvs annotate command

Parameters:
handler Selection for the command

Definition at line 2406 of file CvsCommands.cpp.

References CvsArgs::add(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetAnnotate(), CPStr, CStr, decodeCVS(), MultiFiles::end(), FlatenSubFolders(), GetExtension(), launchCVS(), LaunchViewer(), NULL, and CvsArgs::print().

Referenced by KoAnnotateHandler::OnFiles().

02407 {
02408     MultiFiles* mf = NULL;
02409     if( !CheckSelectionHandler(handler, mf) )
02410         return;
02411
02412     bool noRecurs;
02413     bool isDate;
02414     CPStr rev;
02415     bool force;
02416
02417     if( !CompatGetAnnotate(mf, noRecurs, isDate, rev, force) )
02418         return;
02419
02420     MultiFiles::const_iterator mfi;
02421     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02422     {
02423         CStr path, filename, ext, base, currRev;
02424         CStr file;
02425
02426         for(int i = 0; ; i++)
02427         {
02428             if( !mfi->get(i, path, filename, currRev) )
02429                 break;
02430
02431             // note that filename can contain subfolders
02432
02433             GetExtension(filename, base, ext);
02434
02435             CvsArgs args;
02436             CStr tmpf(base);
02437
02438             if( !rev.empty() )
02439             {
02440                 tmpf << "_ann_";
02441                 tmpf << rev;
02442                 tmpf << '_';
02443             }
02444             else
02445                 tmpf << "_ann_";
02446
02447             // convert subfolder names to regular name
02448             FlatenSubFolders(tmpf);
02449
02450             args.add("annotate");
02451
02452             if( noRecurs )
02453             {
02454                 args.add("-l");
02455             }
02456
02457             if( force )
02458             {
02459                 args.add("-f");
02460             }
02461
02462             if( !rev.empty() )
02463             {
02464                 args.add(isDate ? "-D" : "-r");
02465                 args.add(rev);
02466             }
02467
02468             args.add(filename);
02469             args.print(path);
02470             file = launchCVS(path, args, (const char *)tmpf, ext);
02471 #ifdef qMacCvsPP
02472             decodeCVS (file);
02473 #endif
02474
02475             if( file.empty() )
02476                 continue;
02477
02478             LaunchViewer(file, true);
02479         }
02480     }
02481 }

void CvsCmdCancelChanges ( KiSelectionHandler & handler )

Execute cvs update command

Parameters:
handler Selection for the command

Definition at line 1401 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCancelChangesHandler::OnFiles().

01402 {
01403     MultiFiles* mf = NULL;
01404     if( !CheckSelectionHandler(handler, mf) )
01405         return;
01406
01407     MultiFiles::const_iterator mfi;
01408     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01409     {
01410         RemoveCvsArgs args;
01411         args.add("update");
01412
01413         const char* dir = mfi->add(args);
01414         args.print(dir);
01415         launchCVS(dir, args.Argc(), args.Argv());
01416     }
01417 }

void CvsCmdCheckoutModule ( KiSelectionHandler & handler )

Execute cvs checkout and cvs export command

Parameters:
handler Selection for the command

Definition at line 1090 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetCheckout(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by UCvsFolders::OnCmdCheckout(), KoCheckoutHandler::OnFiles(), and KoCheckoutHandler::OnFolder().

01091 {
01092     MultiFiles* mf = NULL;
01093     if( !CheckSelectionHandler(handler, mf) )
01094         return;
01095
01096     MultiFiles::const_iterator mfi = mf->begin();
01097     const char* dir = mfi->getdir();
01098     bool norecurs;
01099     CPStr modname;
01100     CPStr path(dir);
01101     bool toStdout;
01102     CPStr date;
01103     CPStr rev;
01104     bool useMostRecent;
01105     CPStr rev1;
01106     CPStr rev2;
01107     bool doexport;
01108     bool forceCvsroot;
01109     bool overrideCheckoutDir;
01110     CPStr checkoutDir;
01111     CPStr keyword;
01112
01113     if( !CompatGetCheckout(mf, modname, path, norecurs,
01114         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
01115         overrideCheckoutDir, checkoutDir, keyword) )
01116     {
01117         return;
01118     }
01119
01120     CvsArgs args;
01121
01122     if( forceCvsroot )
01123     {
01124         args.addcvsroot();
01125     }
01126
01127     args.add(doexport ? "export" : "checkout");
01128
01129     if( !keyword.empty() )
01130     {
01131         args.add(keyword);
01132     }
01133
01134     if( gCvsPrefs.PruneOption() && !doexport )
01135         args.add("-P");
01136
01137     if( norecurs )
01138         args.add("-l");
01139
01140     if( toStdout )
01141         args.add("-p");
01142
01143     if( useMostRecent )
01144         args.add("-f");
01145
01146     if( !rev1.empty() )
01147     {
01148         CPStr tmp;
01149         tmp = "-j";
01150         tmp << rev1;
01151         args.add(tmp);
01152     }
01153
01154     if( !rev2.empty() )
01155     {
01156         CPStr tmp;
01157         tmp = "-j";
01158         tmp << rev2;
01159         args.add(tmp);
01160     }
01161
01162     if( !date.empty() )
01163     {
01164         args.add("-D");
01165         args.add(date);
01166     }
01167
01168     if( !rev.empty() )
01169     {
01170         args.add("-r");
01171         args.add(rev);
01172     }
01173
01174     if( doexport && rev.empty() && date.empty() )
01175     {
01176         args.add("-r");
01177         args.add("HEAD");
01178     }
01179
01180     if( overrideCheckoutDir )
01181     {
01182         args.add("-d");
01183         args.add(checkoutDir);
01184     }
01185
01186     args.add(modname);
01187
01188     args.print(path);
01189     launchCVS(path, args.Argc(), args.Argv());
01190 }

void CvsCmdCommandLine ( KiSelectionHandler & handler )

Execute command line

Parameters:
handler Selection for the command

Definition at line 1316 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetCommand(), CStr, MultiFiles::end(), launchCVS(), MAX_ARGS, NULL, CvsArgs::print(), and StringToArgv().

Referenced by CWincvsDoc::OnAppCmdline(), UCvsFrame::OnCmdCmdline(), KoCommandLineHandler::OnFiles(), and KoCommandLineHandler::OnFolder().

01317 {
01318     MultiFiles* mf = NULL;
01319     if( !CheckSelectionHandler(handler, mf) )
01320         return;
01321
01322     CStr dir;
01323     CStr cmd;
01324     bool addDefault;
01325     bool addSelection;
01326     bool forceCvsroot;
01327
01328     if( !CompatGetCommand(mf, cmd, dir, addDefault, addSelection, forceCvsroot) )
01329         return;
01330
01331     char* argv[MAX_ARGS];
01332     int argc = StringToArgv(cmd.c_str(), argv);
01333
01334     if( addSelection )
01335     {
01336         MultiFiles::const_iterator mfi;
01337         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01338         {
01339             CvsArgs args(addDefault);
01340
01341             if( addDefault && forceCvsroot )
01342             {
01343                 args.addcvsroot();
01344             }
01345
01346             for(int i = 0; i < argc; i++)
01347             {
01348                 if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01349                 {
01350                     // Skip the "cvs" arguments as it's already added by args constructor
01351                     continue;
01352                 }
01353
01354                 args.add(argv[i]);
01355
01356                 if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01357                 {
01358                     args.addcvsroot();
01359                 }
01360             }
01361
01362             const char* dir = mfi->add(args);
01363             args.print(dir);
01364             launchCVS(dir, args.Argc(), args.Argv());
01365         }
01366     }
01367     else
01368     {
01369         CvsArgs args(addDefault);
01370
01371         if( addDefault && forceCvsroot )
01372         {
01373             args.addcvsroot();
01374         }
01375
01376         for(int i = 0; i < argc; i++)
01377         {
01378             if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01379             {
01380                 // Skip the "cvs" arguments as it's already added by args constructor
01381                 continue;
01382             }
01383
01384             args.add(argv[i]);
01385
01386             if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01387             {
01388                 args.addcvsroot();
01389             }
01390         }
01391
01392         args.print(dir);
01393         launchCVS(dir, args.Argc(), args.Argv());
01394     }
01395 }

void CvsCmdCommit ( KiSelectionHandler & handler )

Execute cvs commit command

Parameters:
handler Selection for the command

Definition at line 1523 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CleanupLogMsg(), CompatGetCommit(), CPStr, CStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCommitHandler::OnFiles(), and KoCommitHandler::OnFolder().

01524 {
01525     MultiFiles* mf = NULL;
01526     if( !CheckSelectionHandler(handler, mf) )
01527         return;
01528
01529     bool firstTime = true;
01530     bool norecurs;
01531     CStr logmsg;
01532     bool forceCommit;
01533     bool forceRecurse;
01534     CPStr rev;
01535     bool noModuleProgram;
01536     bool checkValidEdits;
01537
01538     MultiFiles::const_iterator mfi;
01539     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01540     {
01541         if( firstTime )
01542         {
01543             // we have to give the path where the commit is done is
01544             // the user expects to fill the CVS/Template file. we just
01545             // grab the first one for this purpose.
01546             CStr pathTmpl;
01547             pathTmpl = mfi->getdir();
01548
01549             if( !CompatGetCommit(mf, logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, pathTmpl) )
01550                 return;
01551
01552             firstTime = false;
01553         }
01554
01555         CvsArgs args;
01556         args.add("commit");
01557
01558         if( checkValidEdits )
01559             args.add("-c");
01560
01561         if( norecurs )
01562             args.add("-l");
01563
01564         if( noModuleProgram )
01565             args.add("-n");
01566
01567         if( forceCommit )
01568             args.add("-f");
01569
01570         if( forceRecurse )
01571             args.add("-R");
01572
01573         args.add("-m");
01574         args.add(CleanupLogMsg(logmsg));
01575
01576         if( !rev.empty() )
01577         {
01578             args.add("-r");
01579             args.add(rev);
01580         }
01581
01582         const char* dir = mfi->add(args);
01583         args.print(dir);
01584         launchCVS(dir, args.Argc(), args.Argv());
01585     }
01586 }

void CvsCmdDiff | ( | KiSelectionHandler & | handler,
 |  | kDiffCmdType | diffType
 | ) |

Execute cvs diff or external diff command

Parameters:
handler | Selection for the command
diffType | Diff command type

Definition at line 1593 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetDiff(), CPStr, CStr, decodeCVS(), MultiFiles::end(), FlatenSubFolders(), MultiFilesEntry::get(), GetExtension(), kDiffGraph, launchCVS(), LaunchDiff(), NULL, MultiFilesEntry::NumFiles(), CvsArgs::print(), and MultiFiles::TotalNumFiles().

Referenced by KoDiffHandler::OnFiles(), KoGraphDiffHandler::OnFiles(), and KoDiffHandler::OnFolder().

01594 {
01595     MultiFiles* mf = NULL;
01596     if( !CheckSelectionHandler(handler, mf) )
01597         return;
01598
01599     bool noRecurs;
01600     bool isDate1;
01601     bool isDate2;
01602     bool useExtDiff;
01603     CPStr rev1;
01604     CPStr rev2;
01605     bool unifiedDiff;
01606     bool noWhiteSpace;
01607     bool noBlankLines;
01608     bool ignoreCase;
01609     bool extDiffResult;
01610     CPStr diffOptions;
01611     CPStr keyword;
01612
01613     if ( diffType == kDiffGraph )
01614     {
01615       // determine initial revision settings
01616       //
01617       if ( mf->TotalNumFiles() > 0 )
01618       {
01619         const MultiFilesEntry&  mfe = *mf->begin();
01620         CStr              ignorePath, ignoreName, rev;
01621         switch ( mfe.NumFiles() )
01622       {
01623         case 2:
01624           if ( mfe.get(1, ignorePath, ignoreName, rev) ) rev2 = rev;
01625           // fall thru
01626         case 1:
01627           if ( mfe.get(0, ignorePath, ignoreName, rev) ) rev1 = rev;
01628           break;
01629       }
01630       }
01631     }
01632
01633     if( !CompatGetDiff(mf, diffType, noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff,
01634         unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase, keyword, diffOptions,
01635         mf->TotalNumFiles() > 0) )
01636     {
01637         return;
01638     }
01639
01640     MultiFiles::const_iterator mfi;
01641     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01642     {
01643         extDiffResult = false;
01644
01645         if( mfi->NumFiles() && useExtDiff )
01646         {
01647             CStr path, filename, ext, base, currRev;
01648             CStr file1, file2;
01649
01650             for(int i = 0; ; i++)
01651             {
01652                 if( !mfi->get(i, path, filename, currRev) )
01653                     break;
01654
01655                 if( 0 < i && kDiffGraph == diffType )
01656                 {
01657                     // Graph diff contains two files, but it's actually the same one
01658                     break;
01659                 }
01660
01661                 // note that filename can contain subfolders
01662
01663                 GetExtension(filename, base, ext);
01664
01665                 CvsArgs args;
01666                 CStr tmpf(base);
01667                 tmpf << '_';
01668
01669                 if( !rev1.empty() )
01670                     tmpf << rev1;
01671                 else
01672                     tmpf << currRev;
01673
01674                 tmpf << '_';
01675
01676                 // convert subfolder names to regular name
01677                 FlatenSubFolders(tmpf);
01678
01679                 args.add("update");
01680                 args.add("-p");
01681
01682                 if( !rev1.empty() )
01683                 {
01684                     args.add(isDate1 ? "-D" : "-r");
01685                     args.add(rev1);
01686                 }
01687                 else if( !currRev.empty() )
01688                 {
01689                     args.add("-r");
01690                     args.add(currRev);
01691                 }
01692
01693                 args.add(filename);
01694                 args.print(path);
01695                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
01696
01697 #if TARGET_RT_MAC_CFM
01698                 decodeCVS (file1);
01699 #endif
01700
01701                 if( rev2.empty() )
01702                 {
01703                     file2 = path;
01704
01705                     if( !file2.endsWith(kPathDelimiter) )
01706                         file2 << kPathDelimiter;
01707
01708                     file2 << filename;
01709                 }
01710                 else
01711                 {
01712                     CvsArgs args2;
01713
01714                     tmpf = base;
01715                     tmpf << '_';
01716                     tmpf << rev2;
01717                     tmpf << '_';
01718
01719                     // convert subfolder names to regular name
01720                     FlatenSubFolders(tmpf);
01721
01722                     args2.add("update");
01723                     args2.add("-p");
01724                     args2.add(isDate2 ? "-D" : "-r");
01725                     args2.add(rev2);
01726                     args2.add(filename);
01727                     args2.print(path);
01728                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
01729 #if TARGET_RT_MAC_CFM
01730                     decodeCVS (file2);
01731 #endif
01732                 }
01733
01734                 if( file1.empty() || file2.empty() )
01735                     continue;
01736
01737                 extDiffResult = LaunchDiff(file1, file2);
01738             }
01739         }
01740
01741         if( !mfi->NumFiles() || !useExtDiff || !extDiffResult )
01742         {
01743             CvsArgs args;
01744             args.add("diff");
01745
01746             if( noRecurs )
01747                 args.add("-l");
01748
01749             if( !rev1.empty() )
01750             {
01751                 args.add(isDate1 ? "-D" : "-r");
01752                 args.add(rev1);
01753             }
01754
01755             if( !rev2.empty() )
01756             {
01757                 args.add(isDate2 ? "-D" : "-r");
01758                 args.add(rev2);
01759             }
01760
01761             if( unifiedDiff )
01762                 args.add("-u");     // --unified, -u
01763
01764             if( noWhiteSpace )
01765                 args.add("-wb");    //--ignore-all-space --ignore-space-change
01766
01767             if( noBlankLines )
01768                 args.add("-B");     //--ignore-blank-lines
01769
01770             if( ignoreCase )
01771                 args.add("-i");     //--ignore-case
01772
01773             if( !keyword.empty() )
01774             {
01775                 args.add(keyword);
01776             }
01777
01778             if( !diffOptions.empty() )
01779             {
01780                 args.add(diffOptions);
01781             }
01782
01783             const char* dir = mfi->add(args);
01784             args.print(dir);
01785             launchCVS(dir, args.Argc(), args.Argv());
01786         }
01787     }
01788 }

void CvsCmdEdit | ( | KiSelectionHandler & | handler,
 |  | kEditCmdType | editType
 | ) |

Execute cvs command

Parameters:
handler | Selection for the command
editType | Edit type

Definition at line 2200 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), kEditForce, kEditNormal, kEditReserved, launchCVS(), NULL, and CvsArgs::print().

Referenced by KoEditHandler::OnFiles(), KoReservedEditHandler::OnFiles(), KoForceEditHandler::OnFiles(), KoEditHandler::OnFolder(), KoReservedEditHandler::OnFolder(), and KoForceEditHandler::OnFolder().

02201 {
02202     MultiFiles* mf = NULL;
02203     if( !CheckSelectionHandler(handler, mf) )
02204         return;
02205
02206     MultiFiles::const_iterator mfi;
02207     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02208     {
02209         CvsArgs args;
02210         args.add("edit");
02211
02212         switch( editType )
02213         {
02214         default:
02215         case kEditNormal:
02216             // intentionally blank
02217             break;
02218         case kEditReserved:
02219             args.add("-c");
02220             break;
02221         case kEditForce:
02222             args.add("-f");
02223             break;
02224         }
02225
02226         const char* dir = mfi->add(args);
02227         args.print(dir);
02228         launchCVS(dir, args.Argc(), args.Argv());
02229     }
02230 }

void CvsCmdEditors ( KiSelectionHandler & handler )

Execute cvs editors command

Parameters:
handler Selection for the command

Definition at line 2384 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoEditorsHandler::OnFiles(), and KoEditorsHandler::OnFolder().

02385 {
02386     MultiFiles* mf = NULL;
02387     if( !CheckSelectionHandler(handler, mf) )
02388         return;
02389
02390     MultiFiles::const_iterator mfi;
02391     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02392     {
02393         CvsArgs args;
02394         args.add("editors");
02395
02396         const char* dir = mfi->add(args);
02397         args.print(dir);
02398         launchCVS(dir, args.Argc(), args.Argv());
02399     }
02400 }

void CvsCmdImportModule ( KiSelectionHandler & handler )

Execute cvs import command

Parameters:
handler Selection for the command

Definition at line 1196 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CleanupLogMsg(), CompatGetImport(), CompatImportFilter(), CPStr, CStr, MultiFiles::end(), free_list_types(), ReportConflict::GetPattern(), ReportConflict::HasForceBinary(), ReportConflict::HasForceNoKeywords(), ReportConflict::HasForceText(), ReportConflict::HasForceUnicode(), ReportConflict::HasIgnore(), ReportConflict::IsBinary(), ReportConflict::IsExtension(), ReportConflict::IsUnicode(), launchCVS(), ReportConflict::next, NULL, and CvsArgs::print().

Referenced by UCvsFolders::OnCmdImport(), KoImportHandler::OnFiles(), and KoImportHandler::OnFolder().

01197 {
01198     MultiFiles* mf = NULL;
01199     if( !CheckSelectionHandler(handler, mf) )
01200         return;
01201
01202     MultiFiles::const_iterator mfi;
01203     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01204     {
01205         ReportConflict* entries;
01206         ReportWarning* warnings;
01207         const char* dir = mfi->getdir();
01208
01209         if( !CompatImportFilter(dir, entries, warnings) )
01210             return;
01211
01212         CPStr modname, vendortag, reltag, path(dir);
01213         CStr logmsg;
01214         bool useDefIgnore;
01215         bool useFilesTime;
01216
01217         if( !CompatGetImport(mf, modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
01218             return;
01219
01220         CvsArgs args;
01221         args.add("import");
01222
01223         if( useFilesTime )
01224         {
01225             args.add("-d");
01226         }
01227
01228         // fill the wrappers
01229         ReportConflict* tmpentry = entries;
01230
01231         if( !useDefIgnore )
01232         {
01233             args.add("-I"); // no default (core, *.o...)
01234             args.add("!");
01235             args.add("-I"); // but ignore the CVS folders
01236             args.add("CVS");
01237         }
01238
01239         while( tmpentry != 0L )
01240         {
01241             if( tmpentry->HasIgnore() )
01242             {
01243                 CPStr ign;
01244                 args.add("-I");
01245
01246                 if( tmpentry->IsExtension() )
01247                     ign << '*';
01248
01249                 ign << tmpentry->GetPattern();
01250                 args.add(ign);
01251             }
01252             else if( !tmpentry->HasForceText() &&
01253                 (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
01254                 tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
01255             {
01256                 CPStr wrap;
01257                 const char* pattern = tmpentry->GetPattern();
01258                 bool hasSpace = strchr(pattern, ' ') != 0L;
01259                 args.add("-W");
01260
01261                 if( hasSpace )
01262                     wrap << '"';
01263
01264                 if( tmpentry->IsExtension() )
01265                     wrap << '*';
01266
01267                 wrap << pattern;
01268
01269                 if( hasSpace )
01270                     wrap << '"';
01271
01272                 if( tmpentry->HasForceNoKeywords() )
01273                 {
01274                     wrap << " -k 'o'";
01275                 }
01276                 else if( tmpentry->HasForceBinary() )
01277                 {
01278                     wrap << " -k 'b'";
01279                 }
01280                 else if( tmpentry->HasForceUnicode() )
01281                 {
01282                     wrap << " -k 'u'";
01283                 }
01284                 else if( tmpentry->IsBinary() )
01285                 {
01286                     wrap << " -k 'b'";
01287                 }
01288                 else if( tmpentry->IsUnicode() )
01289                 {
01290                     wrap << " -k 'u'";
01291                 }
01292
01293                 args.add(wrap);
01294             }
01295
01296             tmpentry = tmpentry->next;
01297         }
01298
01299         free_list_types(warnings, entries);
01300
01301         args.add("-m");
01302         args.add(CleanupLogMsg(logmsg));
01303         args.add(modname);
01304         args.add(vendortag);
01305         args.add(reltag);
01306
01307         args.print(path);
01308         launchCVS(path, args.Argc(), args.Argv());
01309     }
01310 }

void CvsCmdInit ( )

Execute cvs init command

Definition at line 852 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), CompatGetInit(), launchCVS(), and CvsArgs::print().

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

00853 {
00854     if( gCvsPrefs.empty() )
00855         return;
00856
00857     bool forceCvsroot;
00858
00859     if( !CompatGetInit(forceCvsroot) )
00860         return;
00861
00862     CvsArgs args;
00863
00864     if( forceCvsroot )
00865     {
00866         args.addcvsroot();
00867     }
00868
00869     args.add("init");
00870
00871     args.print();
00872     launchCVS(0L, args.Argc(), args.Argv());
00873 }

void CvsCmdLock ( KiSelectionHandler & handler )

Execute cvs admin -l command

Parameters:
handler Selection for the command

Definition at line 2043 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoLockHandler::OnFiles(), and KoLockHandler::OnFolder().

02044 {
02045     MultiFiles* mf = NULL;
02046     if( !CheckSelectionHandler(handler, mf) )
02047         return;
02048
02049     MultiFiles::const_iterator mfi;
02050     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02051     {
02052         CvsArgs args;
02053         args.add("admin");
02054         args.add("-l");
02055
02056         const char* dir = mfi->add(args);
02057         args.print(dir);
02058         launchCVS(dir, args.Argc(), args.Argv());
02059     }
02060 }

void CvsCmdLog | ( | KiSelectionHandler & | handler,
 |  | bool | outGraph,
 |  | void * | defWnd
 | ) |

Execute cvs log or graph command

Parameters:
handler | Selection for the command
outGraph | true for the graph
defWnd | Default window

Definition at line 1905 of file CvsCommands.cpp.

References CvsArgs::add(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetLog(), CPStr, CvsLogParse(), MultiFiles::end(), NULL, and CvsArgs::print().

Referenced by KoLogHandler::OnFiles(), KoGraphHandler::OnFiles(), and KoLogHandler::OnFolder().

01906 {
01907     MultiFiles* mf = NULL;
01908     if( !CheckSelectionHandler(handler, mf) )
01909         return;
01910
01911     bool noRecurs;
01912     bool defBranch;
01913     CPStr date;
01914     bool headerOnly;
01915     bool headerDesc;
01916     bool supress;
01917     bool noTags;
01918     bool onlyRCSfile;
01919     bool hasRev;
01920     CPStr rev;
01921     CPStr states;
01922     bool hasUser;
01923     CPStr users;
01924
01925     if( !CompatGetLog(mf, noRecurs, defBranch, date,
01926         headerOnly, headerDesc, supress,
01927         noTags, onlyRCSfile, hasRev,
01928         rev, states, hasUser, users,
01929         outGraph) )
01930     {
01931         return;
01932     }
01933
01934     MultiFiles::const_iterator mfi;
01935     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01936     {
01937         CvsArgs args;
01938         args.add("log");
01939
01940         if( noRecurs )
01941             args.add("-l");
01942
01943         if( defBranch )
01944             args.add("-b");
01945
01946         if( headerDesc )
01947         {
01948             args.add("-t");
01949         }
01950         else
01951         {
01952             if( headerOnly )
01953                 args.add("-h");
01954         }
01955
01956         if( supress )
01957             args.add("-S");
01958
01959         if( noTags )
01960             args.add("-N");
01961
01962         if( onlyRCSfile )
01963             args.add("-R");
01964
01965         if( !date.empty() )
01966         {
01967             args.add("-d");
01968             args.add(date);
01969         }
01970
01971         if( !states.empty() )
01972         {
01973             args.add("-s");
01974             args.add(states);
01975         }
01976
01977         if( hasRev )
01978         {
01979             CPStr tmp;
01980             tmp = "-r";
01981             tmp << rev;
01982             args.add(tmp);
01983         }
01984
01985         if( hasUser )
01986         {
01987             CPStr tmp;
01988             tmp = "-w";
01989             tmp << users;
01990             args.add(tmp);
01991         }
01992
01993         const char* dir = mfi->add(args);
01994         args.print(dir);
01995         CvsLogParse(dir, args, outGraph, defWnd);
01996     }
01997 }

void CvsCmdLogin ( void )

Execute cvs login command

Definition at line 878 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), CompatGetLogin(), cvs_err(), CvsCmdLogout(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), launchCVS(), CvsArgs::print(), and WaitForCvs().

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

00879 {
00880     if( gCvsPrefs.empty() )
00881         return;
00882
00883     bool forceCvsroot;
00884
00885     if( !CompatGetLogin(forceCvsroot) )
00886         return;
00887
00888     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00889     if( !curModel->HasLogin() )
00890     {
00891         cvs_err(_i18n("Logging in is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00892             "Please consult the CVS manual for more details.\n"));
00893     }
00894
00895     if( gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0 )
00896     {
00897         cvs_err(_i18n("Making automatic logout:\n"));
00898         CvsCmdLogout();
00899         WaitForCvs();
00900     }
00901
00902     gCvsPrefs.SetHasLoogedIn(true);
00903
00904     CvsArgs args;
00905
00906     if( forceCvsroot )
00907     {
00908         args.addcvsroot();
00909     }
00910
00911     args.add("login");
00912
00913     args.print();
00914     launchCVS(0L, args.Argc(), args.Argv());
00915 }

void CvsCmdLogout ( void )

Execute cvs logou command

Definition at line 920 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), cvs_err(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), launchCVS(), and CvsArgs::print().

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

00921 {
00922     if( gCvsPrefs.empty() )
00923         return;
00924
00925     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00926     if( curModel->HasLogin() )
00927     {
00928         cvs_err(_i18n("Logging out is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00929             "Please consult the CVS manual for more details.\n"));
00930     }
00931
00932     gCvsPrefs.SetHasLoogedIn(false);
00933
00934     CvsArgs args;
00935
00936     args.add("logout");
00937
00938     args.print();
00939     launchCVS(0L, args.Argc(), args.Argv());
00940 }

void CvsCmdMacrosAdmin ( const char * macroName )

Execute admin macro

Parameters:
macroName Macro name to be executed

Definition at line 815 of file CvsCommands.cpp.

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

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

00816 {
00817     if( gCvsPrefs.empty() || !CTcl_Interp::IsAvail() )
00818         return;
00819
00820     CTcl_Interp interp;
00821     CStr path = macroName;
00822     CTcl_Interp::Unixfy(path);
00823     interp.DoScriptVar("source \"%s\"", (const char*)path);
00824 }

void CvsCmdMoveToTrash ( KiSelectionHandler & handler )

Execute erase command

Parameters:
handler Selection for the command

Definition at line 2487 of file CvsCommands.cpp.

References _i18n, MultiFiles::begin(), UStr::c_str(), CheckSelectionHandler(), CompatBeginMoveToTrash(), CompatEndMoveToTrash(), CompatMoveToTrash(), CStr, cvs_err(), cvs_out(), CvsAlert(), MultiFiles::end(), UStr::endsWith(), and NULL.

Referenced by KoMoveToTrashHandler::OnFiles().

02488 {
02489     MultiFiles* mf = NULL;
02490     if( !CheckSelectionHandler(handler, mf) )
02491         return;
02492
02493     if( !CvsAlert(_i18n("Are you sure you want to erase selected files?"), _i18n("Yes"), _i18n("No")) )
02494     {
02495         return;
02496     }
02497
02498     CompatBeginMoveToTrash();
02499
02500     MultiFiles::const_iterator mfi;
02501     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02502     {
02503         int count = mfi->NumFiles();
02504         for(int i = 0; i < count; i++)
02505         {
02506             CStr path, fileName, currRev;
02507             if( mfi->get(i, path, fileName, currRev) )
02508             {
02509                 UStr fn(path);
02510                 if( !fn.endsWith(kPathDelimiter) )
02511                     fn << kPathDelimiter;
02512
02513                 fn << fileName;
02514
02515                 if( !CompatMoveToTrash(fn) )
02516                 {
02517                     UStr errText;
02518                     errText << _i18n("Unable to remove '") << fn << _i18n("' (error ") << errno << ")\n";
02519
02520                     cvs_err( errText.c_str() );
02521                 }
02522                 else
02523                 {
02524                     UStr errText;
02525 #if TARGET_OS_MAC
02526                     errText << "'" << fn << _i18n("' has been moved successfully to the trash...\n");
02527 #elif WIN32
02528                     errText << "'" << fn << _i18n("' has been moved successfully to the recycle bin ...\n");
02529 #else
02530                     errText << "'" << fn << _i18n("' has been removed successfully ...\n");
02531 #endif
02532                     cvs_out( errText.c_str() );
02533                 }
02534             }
02535         }
02536     }
02537
02538     CompatEndMoveToTrash();
02539 }

void CvsCmdRelease ( KiSelectionHandler & handler )

Execute cvs release command

Parameters:
handler Selection for the command

Definition at line 2304 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatGetRelease(), CStr, cvs_err(), MultiFiles::getdir(), kReleaseDelAll, kReleaseDelCvsInfo, kReleaseDelDir, kReleaseDelType, kReleaseNoDel, launchCVS(), NULL, CvsArgs::print(), and SplitPath().

Referenced by KoReleaseHandler::OnFolder().

02305 {
02306     MultiFiles* mf = NULL;
02307     if( !CheckSelectionHandler(handler, mf) )
02308         return;
02309
02310     CStr dir;
02311     if( !mf->getdir(0, dir) )
02312     {
02313         return;
02314     }
02315
02316     CStr uppath, folder;
02317     if( !SplitPath(dir, uppath, folder) )
02318     {
02319         cvs_err(_i18n("Unable to convert path name '%s'\n"), dir.c_str());
02320
02321         // Even thought something didn't work we will try to continue and put all the responsibility onto the user
02322         uppath = dir;
02323         folder = ".";
02324     }
02325
02326     kReleaseDelType removeDirectoryOption = kReleaseNoDel;
02327
02328     if( !CompatGetRelease(mf, dir, removeDirectoryOption) )
02329     {
02330         return;
02331     }
02332
02333     CvsArgs args;
02334     args.add("release");
02335
02336     switch( removeDirectoryOption )
02337     {
02338     default:
02339     case kReleaseNoDel:
02340         break;
02341     case kReleaseDelDir:
02342         args.add("-d");
02343         break;
02344     case kReleaseDelAll:
02345         args.add("-f");
02346         break;
02347     case kReleaseDelCvsInfo:
02348         args.add("-e");
02349         break;
02350     }
02351
02352     args.add(folder);
02353
02354     args.print(uppath);
02355     launchCVS(uppath, args.Argc(), args.Argv());
02356 }

void CvsCmdRemove ( KiSelectionHandler & handler )

Execute cvs remove command

Parameters:
handler Selection for the command

Definition at line 1876 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatBeginMoveToTrash(), CompatEndMoveToTrash(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoFileRemoveHandler::OnFiles().

01877 {
01878     MultiFiles* mf = NULL;
01879     if( !CheckSelectionHandler(handler, mf) )
01880         return;
01881
01882     MultiFiles::const_iterator mfi;
01883     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01884     {
01885         RemoveCvsArgs args;
01886
01887         CompatBeginMoveToTrash();
01888
01889         args.add("remove");
01890         const char* dir = mfi->add(args);
01891         args.print(dir);
01892
01893         CompatEndMoveToTrash();
01894
01895         launchCVS(dir, args.Argc(), args.Argv());
01896     }
01897 }

void CvsCmdRtagBranch ( KiSelectionHandler & handler )

Execute cvs rtag -b command

Parameters:
handler Selection for the command

Definition at line 1037 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagBranch(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagBranch(), UCvsFrame::OnCmdRtagBranch(), KoRtagBranchHandler::OnFiles(), and KoRtagBranchHandler::OnFolder().

01038 {
01039     MultiFiles* mf = NULL;
01040     if( !CheckSelectionHandler(handler, mf) )
01041         return;
01042
01043     bool norecurs;
01044     bool useMostRecent;
01045     bool lookAttic;
01046     CPStr modname;
01047     CPStr branchname;
01048     CPStr date;
01049     CPStr rev;
01050
01051     if( !CompatRtagBranch(mf, norecurs, branchname, modname, date, rev, useMostRecent, lookAttic) )
01052             return;
01053
01054     CvsArgs args;
01055     args.add("rtag");
01056     args.add("-b");
01057
01058     if( norecurs )
01059         args.add("-l");
01060
01061     if( useMostRecent )
01062         args.add("-f");
01063
01064     if( lookAttic )
01065         args.add("-a");
01066
01067     if( !date.empty() )
01068     {
01069         args.add("-D");
01070         args.add(date);
01071     }
01072
01073     if( !rev.empty() )
01074     {
01075         args.add("-r");
01076         args.add(rev);
01077     }
01078
01079     args.add(branchname);
01080     args.add(modname);
01081
01082     args.print();
01083     launchCVS(0L, args.Argc(), args.Argv());
01084 }

void CvsCmdRtagCreate ( KiSelectionHandler & handler )

Execute cvs rtag command

Parameters:
handler Selection for the command

Definition at line 946 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagCreate(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagNew(), UCvsFrame::OnCmdRtagNew(), KoRtagCreateHandler::OnFiles(), and KoRtagCreateHandler::OnFolder().

00947 {
00948     MultiFiles* mf = NULL;
00949     if( !CheckSelectionHandler(handler, mf) )
00950         return;
00951
00952     bool norecurs;
00953     bool useMostRecent;
00954     bool overwriteExisting;
00955     bool lookAttic;
00956     CPStr modname;
00957     CPStr tagname;
00958     CPStr date;
00959     CPStr rev;
00960
00961     if( !CompatRtagCreate(mf, norecurs, overwriteExisting, tagname, modname, date, rev, useMostRecent, lookAttic) )
00962         return;
00963
00964     CvsArgs args;
00965     args.add("rtag");
00966
00967     if( norecurs )
00968         args.add("-l");
00969
00970     if( useMostRecent )
00971         args.add("-f");
00972
00973     if( overwriteExisting )
00974         args.add("-F");
00975
00976     if( lookAttic )
00977         args.add("-a");
00978
00979     if( !date.empty() )
00980     {
00981         args.add("-D");
00982         args.add(date);
00983     }
00984
00985     if( !rev.empty() )
00986     {
00987         args.add("-r");
00988         args.add(rev);
00989     }
00990
00991     args.add(tagname);
00992     args.add(modname);
00993
00994     args.print();
00995     launchCVS(0L, args.Argc(), args.Argv());
00996 }

void CvsCmdRtagDelete ( KiSelectionHandler & handler )

Execute cvs rtag -d command

Parameters:
handler Selection for the command

Definition at line 1002 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagDelete(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagDelete(), UCvsFrame::OnCmdRtagDelete(), KoRtagDeleteHandler::OnFiles(), and KoRtagDeleteHandler::OnFolder().

01003 {
01004     MultiFiles* mf = NULL;
01005     if( !CheckSelectionHandler(handler, mf) )
01006         return;
01007
01008     bool norecurs;
01009     bool lookAttic;
01010     CPStr modname;
01011     CPStr tagname;
01012
01013     if( !CompatRtagDelete(mf, norecurs, lookAttic, tagname, modname) )
01014             return;
01015
01016     CvsArgs args;
01017     args.add("rtag");
01018     args.add("-d");
01019
01020     if( norecurs )
01021         args.add("-l");
01022
01023     if( lookAttic )
01024         args.add("-a");
01025
01026     args.add(tagname);
01027     args.add(modname);
01028
01029     args.print();
01030     launchCVS(0L, args.Argc(), args.Argv());
01031 }

void CvsCmdStatus ( KiSelectionHandler & handler )

Execute cvs status command

Parameters:
handler Selection for the command

Definition at line 2003 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetStatus(), MultiFiles::end(), launchCVS(), NULL, CvsArgs::print(), STATUSOUTPUT_QUICK, STATUSOUTPUT_TYPE, and STATUSOUTPUT_VERBOSE.

Referenced by KoStatusHandler::OnFiles(), and KoStatusHandler::OnFolder().

02004 {
02005     MultiFiles* mf = NULL;
02006     if( !CheckSelectionHandler(handler, mf) )
02007         return;
02008
02009     bool noRecurs = false;
02010     STATUSOUTPUT_TYPE outputType = STATUSOUTPUT_VERBOSE;
02011
02012     if( !CompatGetStatus(mf, noRecurs, outputType) )
02013         return;
02014
02015     MultiFiles::const_iterator mfi;
02016     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02017     {
02018         CvsArgs args;
02019         args.add("status");
02020
02021         if( noRecurs )
02022             args.add("-l");
02023
02024         if( STATUSOUTPUT_VERBOSE == outputType )
02025         {
02026             args.add("-v");
02027         }
02028         else if( STATUSOUTPUT_QUICK == outputType )
02029         {
02030             args.add("-q");
02031         }
02032
02033         const char* dir = mfi->add(args);
02034         args.print(dir);
02035         launchCVS(dir, args.Argc(), args.Argv());
02036     }
02037 }

void CvsCmdTagBranch ( KiSelectionHandler & handler )

Execute cvs tag -b command

Parameters:
handler Selection for the command

Definition at line 2162 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagBranch(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoBranchTagHandler::OnFiles(), and KoBranchTagHandler::OnFolder().

02163 {
02164     MultiFiles* mf = NULL;
02165     if( !CheckSelectionHandler(handler, mf) )
02166         return;
02167
02168     bool noRecurs, checkUnmod;
02169     CPStr branchName;
02170
02171     if( !CompatTagBranch(mf, noRecurs, branchName, checkUnmod) )
02172         return;
02173
02174     MultiFiles::const_iterator mfi;
02175     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02176     {
02177         CvsArgs args;
02178         args.add("tag");
02179         args.add("-b");
02180
02181         if( noRecurs )
02182             args.add("-l");
02183
02184         if( checkUnmod )
02185             args.add("-c");
02186
02187         args.add(branchName);
02188
02189         const char* dir = mfi->add(args);
02190         args.print(dir);
02191         launchCVS(dir, args.Argc(), args.Argv());
02192     }
02193 }

void CvsCmdTagCreate ( KiSelectionHandler & handler )

Execute cvs tag command

Parameters:
handler Selection for the command

Definition at line 2089 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagCreate(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCreateTagHandler::OnFiles(), and KoCreateTagHandler::OnFolder().

02090 {
02091     MultiFiles* mf = NULL;
02092     if( !CheckSelectionHandler(handler, mf) )
02093         return;
02094
02095     bool noRecurs, overwriteExisting, checkUnmod;
02096     CPStr tagName;
02097
02098     if( !CompatTagCreate(mf, noRecurs, overwriteExisting, tagName, checkUnmod) )
02099         return;
02100
02101     MultiFiles::const_iterator mfi;
02102     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02103     {
02104         CvsArgs args;
02105         args.add("tag");
02106
02107         if( noRecurs )
02108             args.add("-l");
02109
02110         if( overwriteExisting )
02111             args.add("-F");
02112
02113         if( checkUnmod )
02114             args.add("-c");
02115
02116         args.add(tagName);
02117
02118         const char* dir = mfi->add(args);
02119         args.print(dir);
02120         launchCVS(dir, args.Argc(), args.Argv());
02121     }
02122 }

void CvsCmdTagDelete ( KiSelectionHandler & handler )

Execute cvs tag -d command

Parameters:
handler Selection for the command

Definition at line 2128 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagDelete(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoDeleteTagHandler::OnFiles(), and KoDeleteTagHandler::OnFolder().

02129 {
02130     MultiFiles* mf = NULL;
02131     if( !CheckSelectionHandler(handler, mf) )
02132         return;
02133
02134     bool noRecurs;
02135     CPStr tagName;
02136
02137     if( !CompatTagDelete(mf, noRecurs, tagName) )
02138         return;
02139
02140     MultiFiles::const_iterator mfi;
02141     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02142     {
02143         CvsArgs args;
02144         args.add("tag");
02145         args.add("-d");
02146
02147         if( noRecurs )
02148             args.add("-l");
02149
02150         args.add(tagName);
02151
02152         const char* dir = mfi->add(args);
02153         args.print(dir);
02154         launchCVS(dir, args.Argc(), args.Argv());
02155     }
02156 }

void CvsCmdUnedit ( KiSelectionHandler & handler )

Execute cvs unedit command

Parameters:
handler Selection for the command

Definition at line 2236 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoUneditHandler::OnFiles(), and KoUneditHandler::OnFolder().

02237 {
02238     MultiFiles* mf = NULL;
02239     if( !CheckSelectionHandler(handler, mf) )
02240         return;
02241
02242     MultiFiles::const_iterator mfi;
02243     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02244     {
02245         CvsArgs args;
02246         args.add("unedit");
02247
02248         const char* dir = mfi->add(args);
02249         args.print(dir);
02250         launchCVS(dir, args.Argc(), args.Argv());
02251     }
02252 }

void CvsCmdUnlock ( KiSelectionHandler & handler )

Execute cvs admin -u command

Parameters:
handler Selection for the command

Definition at line 2066 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoUnlockHandler::OnFiles(), and KoUnlockHandler::OnFolder().

02067 {
02068     MultiFiles* mf = NULL;
02069     if( !CheckSelectionHandler(handler, mf) )
02070         return;
02071
02072     MultiFiles::const_iterator mfi;
02073     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02074     {
02075         CvsArgs args;
02076         args.add("admin");
02077         args.add("-u");
02078
02079         const char* dir = mfi->add(args);
02080         args.print(dir);
02081         launchCVS(dir, args.Argc(), args.Argv());
02082     }
02083 }

void CvsCmdUpdate | ( | KiSelectionHandler & | handler,
 |  | bool | queryOnly
 | ) |

Execute cvs update command

Parameters:
handler | Selection for the command
queryOnly | true for query update, false for the update command

Definition at line 1424 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetUpdate(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoUpdateHandler::OnFiles(), KoQueryUpdateHandler::OnFiles(), KoUpdateHandler::OnFolder(), and KoQueryUpdateHandler::OnFolder().

01425 {
01426     MultiFiles* mf = NULL;
01427     if( !CheckSelectionHandler(handler, mf) )
01428         return;
01429
01430     bool toStdout;
01431     bool noRecurs;
01432     bool resetSticky;
01433     CPStr date;
01434     CPStr rev;
01435     bool useMostRecent;
01436     CPStr rev1;
01437     CPStr rev2;
01438     bool createMissDir;
01439     bool getCleanCopy;
01440     CPStr keyword;
01441
01442     if( !queryOnly && !CompatGetUpdate(mf, toStdout, noRecurs, resetSticky,
01443         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy, keyword) )
01444         return;
01445
01446     MultiFiles::const_iterator mfi;
01447     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01448     {
01449         CvsArgs args;
01450
01451         if( queryOnly )
01452             args.add("-n");
01453
01454         args.add("update");
01455
01456         if( !keyword.empty() )
01457         {
01458             args.add(keyword);
01459         }
01460
01461         if( gCvsPrefs.PruneOption() )
01462             args.add("-P");
01463
01464         if( !queryOnly )
01465         {
01466             if( resetSticky )
01467                 args.add("-A");
01468
01469             if( createMissDir )
01470                 args.add("-d");
01471
01472             if( getCleanCopy )
01473                 args.add("-C");
01474
01475             if( !date.empty() )
01476             {
01477                 args.add("-D");
01478                 args.add(date);
01479             }
01480
01481             if( useMostRecent )
01482                 args.add("-f");
01483
01484             if( !rev1.empty() )
01485             {
01486                 CPStr tmp;
01487                 tmp = "-j";
01488                 tmp << rev1;
01489                 args.add(tmp);
01490             }
01491
01492             if( !rev2.empty() )
01493             {
01494                 CPStr tmp;
01495                 tmp = "-j";
01496                 tmp << rev2;
01497                 args.add(tmp);
01498             }
01499
01500             if( noRecurs )
01501                 args.add("-l");
01502
01503             if( toStdout )
01504                 args.add("-p");
01505
01506             if( !rev.empty() )
01507             {
01508                 args.add("-r");
01509                 args.add(rev);
01510             }
01511         }
01512
01513         const char* dir = mfi->add(args);
01514         args.print(dir);
01515         launchCVS(dir, args.Argc(), args.Argv());
01516     }
01517 }

void CvsCmdWatchers ( KiSelectionHandler & handler )

Execute cvs watchers command

Parameters:
handler Selection for the command

Definition at line 2362 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchersHandler::OnFiles(), and KoWatchersHandler::OnFolder().

02363 {
02364     MultiFiles* mf = NULL;
02365     if( !CheckSelectionHandler(handler, mf) )
02366         return;
02367
02368     MultiFiles::const_iterator mfi;
02369     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02370     {
02371         CvsArgs args;
02372         args.add("watchers");
02373
02374         const char* dir = mfi->add(args);
02375         args.print(dir);
02376         launchCVS(dir, args.Argc(), args.Argv());
02377     }
02378 }

void CvsCmdWatchOff ( KiSelectionHandler & handler )

Execute cvs watch remove command

Parameters:
handler Selection for the command

Definition at line 2281 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchOffHandler::OnFiles(), and KoWatchOffHandler::OnFolder().

02282 {
02283     MultiFiles* mf = NULL;
02284     if( !CheckSelectionHandler(handler, mf) )
02285         return;
02286
02287     MultiFiles::const_iterator mfi;
02288     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02289     {
02290         CvsArgs args;
02291         args.add("watch");
02292         args.add("remove");
02293
02294         const char* dir = mfi->add(args);
02295         args.print(dir);
02296         launchCVS(dir, args.Argc(), args.Argv());
02297     }
02298 }

void CvsCmdWatchOn ( KiSelectionHandler & handler )

Execute cvs watch add command

Parameters:
handler Selection for the command

Definition at line 2258 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchOnHandler::OnFiles(), and KoWatchOnHandler::OnFolder().

02259 {
02260     MultiFiles* mf = NULL;
02261     if( !CheckSelectionHandler(handler, mf) )
02262         return;
02263
02264     MultiFiles::const_iterator mfi;
02265     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02266     {
02267         CvsArgs args;
02268         args.add("watch");
02269         args.add("add");
02270
02271         const char* dir = mfi->add(args);
02272         args.print(dir);
02273         launchCVS(dir, args.Argc(), args.Argv());
02274     }
02275 }

void FlatenSubFolders ( UStr & tmpf ) [static]

Removes folder separators by replacing them with dots so that temporary file could be created without creating matching subfolders in the temporary file folder

Parameters:
tmpf File with subfolder
Returns:
true on success, false otherwise
Note:
Windows client may provide file names pointing into subfolders

Definition at line 780 of file CvsCommands.cpp.

Referenced by CvsCmdAnnotate(), and CvsCmdDiff().

00781 {
00782     char* cp = (char*)tmpf;
00783
00784     if( cp )
00785     {
00786         while( *cp )
00787         {
00788             if( *cp == kPathDelimiter )
00789             {
00790                 *cp = '.';
00791             }
00792
00793             cp++;
00794         }
00795     }
00796 }

bool GetEnvValue | ( | const char * | cmd,
 |  | const char * | key,
 |  | UStr & | value
 | ) |

Parse a command like 'user=whohost=cvs'

Parameters:
cmd | Command
key | Key
value | Return value
Returns:
true on success, false otherwise

Definition at line 314 of file CvsCommands.cpp.

References UStr::set().

Referenced by CompatGetPassword().

00315 {
00316     const char* tmp = strstr(cmd, key);
00317     if( tmp == 0L )
00318         return false;
00319
00320     tmp = strchr(tmp, '=');
00321     if( tmp == 0L )
00322         return false;
00323
00324     tmp++;
00325
00326     const char* tmp2 = strchr(tmp, '&');
00327     if( tmp2 == 0L )
00328         value = tmp;
00329     else
00330         value.set(tmp, tmp2 - tmp);
00331
00332     return true;
00333 }

void GetExtension | ( | const char * | file,
 |  | UStr & | base,
 |  | UStr & | ext
 | ) |

Extract the extension from the filename

Parameters:
file | File name to extract extension from
base | Return the base of the filename
ext | Return the file's extension

Definition at line 290 of file CvsCommands.cpp.

Referenced by CvsCmdAnnotate(), CvsCmdDiff(), getSettingName(), and CGraphView::OnQueryAnnotate().

00291 {
00292     char* tmp = strrchr(file, '.');
00293
00294     if( tmp == 0L )
00295     {
00296         ext = "";
00297         base = file;
00298     }
00299     else
00300     {
00301         ext = tmp + 1;
00302         base = file;
00303         base[tmp - file] = '\0';
00304     }
00305 }

bool LaunchDiff | ( | const char * | f1,
 |  | const char * | f2
 | ) |

Launch a diff of two files

Parameters:
f1 | First file name
f2 | Second file name
Returns:
true on success, false otherwise

Definition at line 424 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, cvs_err(), UCvsApp::Execute(), FSSpec, UCvsApp::gApp, and NULL.

Referenced by CvsCmdDiff().

00425 {
00426 #if TARGET_RT_MAC_CFM
00427     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00428     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00429
00430     //  Resourcerer's Compare suite
00431     const   DescType    kAECompareClass = 'Comp';
00432     const   DescType    kAECompareEvent = 'Comp';
00433         const   DescType    keyNewer        = 'kNew';
00434         const   DescType    keyOlder        = 'kOld';
00435         const   DescType    keyShowDiff     = 'kShD';
00436         const   DescType    keyReturnDiff   = 'kRtD';
00437
00438     OSErr               e = noErr;
00439
00440     try {
00441         //  Convert to file specs
00442         Boolean             inShowDiffs = true;
00443         FSSpec              spec1 = GUSIFileSpec (f1);
00444         FSSpec              spec2 = GUSIFileSpec (f2);
00445
00446         //  Find the file type
00447         FInfo   info;
00448         e = ::FSpGetFInfo (&spec2, &info);
00449         ThrowIfOSErr_(e);
00450
00451         //  Decide on the application
00452         OSType              applCreator = FOUR_CHAR_CODE('????');
00453         switch (info.fdType) {
00454             case 'TEXT':
00455                 applCreator = kBBEditDiffCreatorCode;
00456                 break;
00457
00458             default:
00459                 applCreator = kResourcererCreatorCode;
00460                 break;
00461             } // switch
00462
00463         //  Try to launch it
00464         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00465         OSType              applType = FOUR_CHAR_CODE('APPL');
00466         FSSpec              applSpec;
00467         ProcessSerialNumber applPSN;
00468         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00469
00470         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00471             //  Create the parameters
00472         StAEDescriptor  newerDesc (spec1);
00473         StAEDescriptor  olderDesc (spec2);
00474         StAEDescriptor  showDesc (inShowDiffs);
00475
00476             //  Create the event
00477         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00478
00479         StAEDescriptor  diffEvent;
00480         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00481         ThrowIfOSErr_(e);
00482
00483             //  Add the parameters
00484         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00485         ThrowIfOSErr_(e);
00486         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00487         ThrowIfOSErr_(e);
00488         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00489         ThrowIfOSErr_(e);
00490
00491             //  Send the event
00492         UAppleEventsMgr::SendAppleEvent (diffEvent);
00493
00494         return true;
00495         } // try
00496
00497     catch (LException ex) {
00498         } // catch
00499 #endif
00500
00501     if( gCvsPrefs.ExtDiff() == 0L )
00502     {
00503         cvs_err(_i18n("The external diff program is not defined.\n"));
00504         cvs_err(_i18n("You need to set it in the preferences dialog.\n"));
00505         return false;
00506     }
00507
00508 #ifdef WIN32
00509     CString args;
00510     CStr program, file1, file2;
00511
00512     if( strchr(gCvsPrefs.ExtDiff(), ' ') != 0L )
00513     {
00514         program << '\"';
00515         program << gCvsPrefs.ExtDiff();
00516         program << '\"';
00517     }
00518     else
00519         program = gCvsPrefs.ExtDiff();
00520
00521     if( strchr(f1, ' ') != 0L )
00522     {
00523         file1 << '\"';
00524         file1 << f1;
00525         file1 << '\"';
00526     }
00527     else
00528         file1 = f1;
00529
00530     if( strchr(f2, ' ') != 0L )
00531     {
00532         file2 << '\"';
00533         file2 << f2;
00534         file2 << '\"';
00535     }
00536     else
00537         file2 = f2;
00538
00539     args += file1;
00540     args += " ";
00541     args += file2;
00542
00543     CWnd* pMainWnd = AfxGetMainWnd();
00544     HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00545
00546     HINSTANCE hInst = ShellExecute(hParentWnd, NULL, gCvsPrefs.ExtDiff(), args, NULL, SW_SHOWDEFAULT);
00547
00548     if( (UINT)hInst < 32 )
00549     {
00550         // ExtDiff app was not found. Let's try to execute it from
00551         // the application path. However, this is done only when ExtDiff
00552         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00553         if( strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\' )
00554         {
00555             CStr appPath;
00556
00557             ((CWincvsApp*)AfxGetApp())->GetAppPath(appPath);
00558             if( !appPath.endsWith(kPathDelimiter) )
00559                 appPath << kPathDelimiter;
00560
00561             appPath << gCvsPrefs.ExtDiff();
00562
00563             hInst = ShellExecute(hParentWnd, NULL, appPath, args, NULL, SW_SHOWDEFAULT);
00564         }
00565     }
00566
00567     if( (UINT)hInst < 32 )
00568     {
00569         LPVOID lpMsgBuf;
00570         FormatMessage(
00571             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00572             FORMAT_MESSAGE_FROM_SYSTEM |
00573             FORMAT_MESSAGE_IGNORE_INSERTS,
00574             NULL,
00575             GetLastError(),
00576             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00577             (LPTSTR)&lpMsgBuf,
00578             0,
00579             NULL
00580             );
00581
00582         cvs_err(_i18n("Unable to open '%s' (%s), using console instead\n"), (char*)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00583         // Free the buffer.
00584         LocalFree( lpMsgBuf );
00585         return false;
00586     }
00587
00588     return true;
00589 #elif qUnix
00590     CvsArgs args(false);
00591     args.add(gCvsPrefs.ExtDiff());
00592     args.add(f1);
00593     args.add(f2);
00594     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00595     return true;
00596 #elif TARGET_RT_MAC_MACHO
00597     CvsArgs args(false);
00598     args.add(gCvsPrefs.ExtDiff());
00599     args.add(f1);
00600     args.add(f2);
00601     CMacCvsApp::gApp->Execute(args.Argc(), args.Argv());
00602     return true;
00603 #endif
00604 }

bool LaunchEditor | ( | const char * | filePath,
 |  | void * | par
 | ) |

Launch an editor for a file

Parameters:
filePath | File name
par | Return data parameter to return the info about running editor process
Returns:
true on success, false otherwise

Definition at line 685 of file CvsCommands.cpp.

References _i18n, CStr, and cvs_err().

Referenced by CompatGetEditorMsg(), and LaunchViewer().

00686 {
00687     bool res = false;
00688
00689     if( gCvsPrefs.Viewer() == 0L )
00690     {
00691         cvs_err(_i18n("You need to define a default viewer in the preferences\n"));
00692         return false;
00693     }
00694
00695     CStr program, file;
00696
00697     if( strchr(gCvsPrefs.Viewer(), ' ') != 0L )
00698     {
00699         program << '\"';
00700         program << gCvsPrefs.Viewer();
00701         program << '\"';
00702     }
00703     else
00704         program = gCvsPrefs.Viewer();
00705
00706     if( strchr(filePath, ' ') != 0L )
00707     {
00708         file << '\"';
00709         file << filePath;
00710         file << '\"';
00711     }
00712     else
00713         file = filePath;
00714
00715     CStr command;
00716     command << program;
00717     command << " ";
00718     command << file;
00719
00720 #ifdef WIN32
00721     STARTUPINFO sStartupInfo = { 0 };
00722     PROCESS_INFORMATION sProcessInformation = { 0 };
00723
00724     // Execute the command with a call to the CreateProcess API call.
00725     sStartupInfo.cb = sizeof(sStartupInfo);
00726     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00727     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00728
00729     if( !CreateProcess( NULL,
00730         (char*)command,
00731         NULL,
00732         NULL,
00733         FALSE,
00734         0,
00735         NULL,
00736         NULL,
00737         &sStartupInfo,
00738         &sProcessInformation) )
00739     {
00740         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
00741         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
00742     }
00743
00744     if( sProcessInformation.hProcess != INVALID_HANDLE_VALUE )
00745     {
00746         res = true;
00747     }
00748
00749     if( par )
00750     {
00751         *((PROCESS_INFORMATION*)par) = sProcessInformation;
00752     }
00753     else if( res )
00754     {
00755         CloseHandle(sProcessInformation.hProcess);
00756         CloseHandle(sProcessInformation.hThread);
00757     }
00758
00759 #endif /* WIN32 */
00760
00761 #ifdef qMacCvsPP
00762     res = true;
00763 #endif /* qMacCvsPP */
00764
00765 #if qUnix
00766     res = true;
00767 #endif // qUnix
00768
00769     return res;
00770 }

bool LaunchViewer | ( | const char * | filePath,
 |  | bool | useDefault
 | ) |

Launch a viewer for file

Parameters:
filePath | Full path to the file
useDefault | true to use the default viewer, false to use system association
Returns:
true on success, false otherwise

Definition at line 612 of file CvsCommands.cpp.

References _i18n, CStr, cvs_err(), LaunchEditor(), NULL, and SplitPath().

Referenced by CvsCmdAnnotate(), UCvsFiles::EditSel(), CBrowseFileView::EditSel(), and CGraphView::OnQueryAnnotate().

00613 {
00614     bool res = false;
00615
00616 #ifdef WIN32
00617     if( !gCvsPrefs.UseViewerAlways() )
00618     {
00619         CStr folder, file;
00620         SplitPath(filePath, folder, file);
00621
00622         // MSS fix bug with files not being found by FindExecutable
00623         // (see Article ID: Q140724 for the problem desc of FindExecutable)
00624         if( !useDefault )
00625         {
00626             CWnd* pMainWnd = AfxGetMainWnd();
00627             HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00628
00629             HINSTANCE hInst = ShellExecute(hParentWnd, "open", filePath, 0L, folder, SW_SHOWDEFAULT);
00630             if( (long)hInst < 32 )
00631             {
00632                 // If it failed because of no valid association and file has an extension then try the "Open with..." dialog instead
00633                 if( file.rfind('.') &&
00634                     (SE_ERR_NOASSOC == (long)hInst || SE_ERR_ASSOCINCOMPLETE == (long)hInst) )
00635                 {
00636                     SHELLEXECUTEINFO seInfo = { 0 };
00637                     seInfo.cbSize = sizeof(SHELLEXECUTEINFO);
00638                     seInfo.hwnd = hParentWnd;
00639                     seInfo.lpVerb = "openas";
00640                     seInfo.lpFile = filePath;
00641                     seInfo.lpDirectory = folder;
00642
00643                     if( ShellExecuteEx(&seInfo) )
00644                     {
00645                         res = true;
00646                     }
00647                 }
00648             }
00649             else
00650             {
00651                 res = true;
00652             }
00653
00654             if( !res )
00655             {
00656                 cvs_err(_i18n("Unable to open '%s' (error %d), using default viewer instead\n"), (char*)filePath, GetLastError());
00657             }
00658         }
00659     }
00660
00661     if( !res )
00662     {
00663         res = LaunchEditor(filePath);
00664     }
00665
00666 #endif /* WIN32 */
00667
00668 #ifdef qMacCvsPP
00669     res = true;
00670 #endif /* qMacCvsPP */
00671
00672 #if qUnix
00673     res = true;
00674 #endif // qUnix
00675
00676     return res;
00677 }

bool MakeTmpFile | ( | UStr & | file,
 |  | const char * | prefix,
 |  | const char * | extension,
 |  | bool | create
 | ) |

Find a unique name for a temporary file

Parameters:
file | Return temporary file name
prefix | Prefix of the filename
extension | Extension of the filename
create | Set to true to create the file
Returns:
true on success, false otherwise

Definition at line 174 of file CvsCommands.cpp.

References _i18n, CStr, cvs_err(), err, getenv, MacGetTempFolder(), MAX_PATH, stat, and UFSSpec.

Referenced by CompatGetEditorMsg(), and launchCVS().

00175 {
00176     static int count = 0;
00177     char filename[MAX_PATH];
00178
00179     CStr tmpPath;
00180     CStr ext;
00181     CStr prf;
00182
00183     if( extension != 0L && extension[0] != '\0' )
00184     {
00185         if( extension[0] != '.' )
00186             ext = ".";
00187
00188         ext << extension;
00189     }
00190
00191     if( prefix != 0L && prefix[0] != '\0' )
00192     {
00193         prf = prefix;
00194     }
00195     else
00196     {
00197         prf = "cvsgui";
00198     }
00199
00200 #ifdef WIN32
00201     char* ptr;
00202     ptr = getenv(_T("TMP"));
00203     if( ptr != 0L && _access(ptr, 0) != -1 )
00204     {
00205         tmpPath = ptr;
00206     }
00207     else
00208     {
00209         tmpPath = ".";
00210     }
00211 #endif /* !WIN32 */
00212 #ifdef TARGET_OS_MAC
00213     UFSSpec theFolder;
00214     OSErr err;
00215
00216     if( (err = MacGetTempFolder(theFolder, tmpPath)) != noErr )
00217     {
00218         cvs_err(_i18n("Unable to locate the preferences folder (error %d) !\n"), err);
00219         return 0L;
00220     }
00221
00222 #if !TARGET_RT_MAC_MACHO  // no problems with long file names on Mac OS X...
00223     for( ; ; )
00224     {
00225         sprintf(filename, "%s%d%s", (const char*)prf, count, (const char*)ext);
00226         if( ::strlen(filename) <= 31 )
00227             break;
00228
00229         if( prf.length() == 0 )
00230         {
00231             cvs_err(_i18n("Unable to truncate temp file !\n"));
00232             return 0L;
00233         }
00234
00235         prf.set (prf, prf.length () - 1);
00236     }
00237 #endif // !TARGET_RT_MAC_MACHO
00238 #endif /* !TARGET_OS_MAC */
00239 #if qUnix
00240     tmpPath = "/tmp";
00241 #endif
00242
00243     struct stat sb;
00244     if( stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode) )
00245     {
00246         cvs_err(_i18n("Unable to access '%s' (error %d) !\n"), (const char*)tmpPath, errno);
00247         return false;
00248     }
00249
00250     if( !tmpPath.endsWith(kPathDelimiter) )
00251         tmpPath << kPathDelimiter;
00252
00253     int maxtry = 10000;
00254     while( true )
00255     {
00256         sprintf(filename, "%s%d%s", (const char*)prf, count++, (const char*)ext);
00257         file = tmpPath;
00258         file << filename;
00259
00260         if( stat(file, &sb) == -1 && errno == ENOENT )
00261         {
00262             if( create )
00263             {
00264                 FILE* stream = fopen(file, "w");
00265                 if( stream )
00266                 {
00267                     fclose(stream);
00268                 }
00269             }
00270
00271             return true;
00272         }
00273
00274         if( maxtry-- == 0 )
00275         {
00276             cvs_err(_i18n("Time out to access '%s' !\n"), (const char*)tmpPath);
00277             break;
00278         }
00279     }
00280
00281     return false;
00282 }

bool SplitPath | ( | const char * | dir,
 |  | UStr & | uppath,
 |  | UStr & | folder,
 |  | bool | dontSkipDelimiter
 | ) |

Split the path into the up-directory and the folder

Parameters:
dir | Path to be split
uppath | Return up-directory
folder | Return folder or file
dontSkipDelimiter | Set to true to prevent skipping the delimiter if the path to be split ends with one
Returns:
true on success, false otherwise
Note:
Passing NULL is considered an error, passing empty string returns true

Definition at line 124 of file CvsCommands.cpp.

References MAX_PATH.

Referenced by BrowserGetDirectory(), BrowserGetMultiFiles(), CompatGetEditorMsg(), CompatGetImport(), CvsCmdAdd(), CvsCmdRelease(), USaveSettings::DoDataExchange(), FormatMenuString(), getLoc(), CTCLBrowserEnt::GetNormalized(), getSettingName(), LaunchItemListCommand(), LaunchViewer(), CWincvsApp::LookForResourceFile(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUpone(), CGetPrefs_WINCVS::OnExtdiffsel(), CWinCvsBrowser::OnUpdateMacro(), and CHistComboBoxEx::SetIcon().

00125 {
00126     char newDir[MAX_PATH * 2] = "";
00127     char oldDir[MAX_PATH * 2] = "";
00128     char newFile[MAX_PATH] = "";
00129
00130     if( !dir )
00131     {
00132         // Null pointer
00133         return false;
00134     }
00135
00136     int dirLen = strlen(dir);
00137     if( dirLen > 0 )
00138     {
00139         strcpy(oldDir, dir);
00140
00141         if( !dontSkipDelimiter && (dir[dirLen - 1] == kPathDelimiter) )
00142         {
00143             oldDir[dirLen - 1] = '\0';
00144             --dirLen;
00145         }
00146
00147         const char* tmp = oldDir;
00148         const char* prev = oldDir;
00149
00150         while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
00151         {
00152             prev = ++tmp;
00153         }
00154
00155         strcpy(newDir, oldDir);
00156         newDir[prev - oldDir] = '\0';
00157         strcpy(newFile, prev);
00158     }
00159
00160     uppath = newDir;
00161     folder = newFile;
00162
00163     return true;
00164 }

int StringToArgv | ( | const char * | cmdLine,
 |  | char ** | argv
 | ) |

Convert a command line (possibly quoted) into regular argc, argv arguments

Parameters:
cmdLine | Command line
argv | Return argv arguments
Returns:
The count of arguments (argc)

Definition at line 341 of file CvsCommands.cpp.

References MAX_ARGS, and MAX_CMD_LEN.

Referenced by CvsCmdCommandLine().

00342 {
00343     int argc = 0;
00344
00345     char Quote = '\0';              /*  Contains the quote character if we are inside "" or '', or \0 otherwise */
00346     const char* walker1 = cmdLine;  /*  walker1 traverses the original command line */
00347     char* walker2;                  /*  walker2 traverses the parsed copy of the commandline */
00348     char theChar;                   /*  theChar is the character we are currently parsing */
00349     char arguments[MAX_CMD_LEN];    /*  Will contain a parsed copy of the command line */
00350
00351     /* Copy into arguments */
00352     walker2 = arguments;
00353
00354     /* Parse command line to \0 */
00355     while( (theChar = *walker1++) != '\0' )
00356     {
00357         /* Skip leading space before an argument */
00358         if( theChar == ' ' )
00359             continue;
00360
00361         /* Set argv to point to the space where we copy the next argument */
00362         argv [argc++] = walker2;
00363
00364         /* If we filled argv, skip the rest */
00365         if( argc > MAX_ARGS)
00366         {
00367             argc--;
00368             break;
00369         }
00370
00371         do
00372         {
00373             /* Parse an argument skip \s */
00374             if( theChar == '\\' && *walker1++ )
00375             {
00376                 theChar = *walker1++;
00377             }
00378             else
00379             {
00380                 /* When we find a quote... */
00381                 if( theChar == '"' || theChar == '\'' )
00382                 {
00383                     /* If we are not inside quotes already, */
00384                     if( Quote == '\0' )
00385                     {
00386                         /* Remember we are inside quotes now */
00387                         Quote = theChar;
00388
00389                         /* Go to the next character */
00390                         continue;
00391                     }
00392
00393                     /* If we are already inside that kind of quotes */
00394                     if( theChar == Quote )
00395                     {
00396                         /* Close quotes */
00397                         Quote = '\0';
00398
00399                         /* Go to the next character */
00400                         continue;
00401                     }
00402                 }
00403             }
00404
00405             /* Copy the character into args */
00406             *walker2++ = theChar;
00407
00408             /* Repeat until we reach the end of arguments or we reach a space that is not inside quotes */
00409         }while( (*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')) );
00410
00411         /* Null-terminate the last argument */
00412         *walker2++ = 0;
00413     }
00414
00415     return argc;
00416 }

Generated on Fri Jan 31 12:09:35 2003 for WinCvs Source by doxygen 1.3-rc2


CvsCommands.h File Reference

common/CvsCommands.h File Reference

#include "CPStr.h"

Include dependency graph for CvsCommands.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 | MAX_ARGS 40
#define | MAX_CMD_LEN 2048

Enumerations

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

enum kAddCmdType {
kAddNormal,
kAddBinary,
kAddUnicode
}
Add command type enum. More...

enum kDiffCmdType {
kDiffFile,
kDiffFolder,
kDiffGraph
}
Diff command type enum. More...

Functions

char * | CleanupLogMsg (const char *msg)
bool | SplitPath (const char *dir, UStr &uppath, UStr &folder, bool dontSkipDelimiter=false)
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)
bool | LaunchDiff (const char *file1, const char *file2)
bool | LaunchViewer (const char *filePath, bool useDefault=false)
bool | LaunchEditor (const char *filePath, void *par=0L)
void | CvsCmdInit ()
void | CvsCmdLogin (void)
void | CvsCmdLogout (void)
void | CvsCmdRtagCreate (KiSelectionHandler &handler)
void | CvsCmdRtagDelete (KiSelectionHandler &handler)
void | CvsCmdRtagBranch (KiSelectionHandler &handler)
void | CvsCmdCommandLine (KiSelectionHandler &handler)
void | CvsCmdCheckoutModule (KiSelectionHandler &handler)
void | CvsCmdImportModule (KiSelectionHandler &handler)
void | CvsCmdCancelChanges (KiSelectionHandler &handler)
void | CvsCmdUpdate (KiSelectionHandler &handler, bool queryOnly=false)
void | CvsCmdCommit (KiSelectionHandler &handler)
void | CvsCmdDiff (KiSelectionHandler &handler, kDiffCmdType diffType)
void | CvsCmdAdd (KiSelectionHandler &handler, kAddCmdType addType=kAddNormal)
void | CvsCmdRemove (KiSelectionHandler &handler)
void | CvsCmdLog (KiSelectionHandler &handler, bool outGraph=false, void *defWnd=0L)
void | CvsCmdStatus (KiSelectionHandler &handler)
void | CvsCmdLock (KiSelectionHandler &handler)
void | CvsCmdUnlock (KiSelectionHandler &handler)
void | CvsCmdTagCreate (KiSelectionHandler &handler)
void | CvsCmdTagDelete (KiSelectionHandler &handler)
void | CvsCmdTagBranch (KiSelectionHandler &handler)
void | CvsCmdEdit (KiSelectionHandler &handler, kEditCmdType editType=kEditNormal)
void | CvsCmdUnedit (KiSelectionHandler &handler)
void | CvsCmdWatchOn (KiSelectionHandler &handler)
void | CvsCmdWatchOff (KiSelectionHandler &handler)
void | CvsCmdRelease (KiSelectionHandler &handler)
void | CvsCmdWatchers (KiSelectionHandler &handler)
void | CvsCmdEditors (KiSelectionHandler &handler)
void | CvsCmdAnnotate (KiSelectionHandler &handler)
void | CvsCmdMoveToTrash (KiSelectionHandler &handler)
void | CvsCmdMacrosAdmin (const char *macroName)

Define Documentation

#define MAX_ARGS 40

Definition at line 30 of file CvsCommands.h.

Referenced by CvsCmdCommandLine(), and StringToArgv().

#define MAX_CMD_LEN 2048

Definition at line 31 of file CvsCommands.h.

Referenced by StringToArgv().

Enumeration Type Documentation

enum kAddCmdType

Add command type enum.

Enumeration values:
kAddNormal | cvs add
kAddBinary | cvs add -kb
kAddUnicode | cvs add -ku

Definition at line 42 of file CvsCommands.h.

00043 {
00044     kAddNormal,
00045     kAddBinary,
00046     kAddUnicode
00047 } kAddCmdType;

enum kDiffCmdType

Diff command type enum.

Enumeration values:
kDiffFile | Diff file selection
kDiffFolder | Diff folder selection
kDiffGraph | Diff graph selection

Definition at line 50 of file CvsCommands.h.

00051 {
00052     kDiffFile,
00053     kDiffFolder,
00054     kDiffGraph
00055 } kDiffCmdType;

enum kEditCmdType

Edit command type enum.

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

Definition at line 34 of file CvsCommands.h.

00035 {
00036     kEditNormal,
00037     kEditReserved,
00038     kEditForce
00039 } kEditCmdType;

Function Documentation

char* CleanupLogMsg ( const char * msg )

Clean up the log message for the server and put the good line feeds

Parameters:
msg Message to be cleaned
Returns:
The cleaned message
Todo:
mac : ISO conversion

Definition at line 86 of file CvsCommands.cpp.

References CStaticAllocT< T >::AdjustSize().

Referenced by CvsCmdCommit(), CvsCmdImportModule(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), and CGraphView::OnGraphSetstate().

00087 {
00088     static CStaticAllocT<char> buf;
00089
00090     size_t len = strlen(msg);
00091     buf.AdjustSize(len + 1);
00092
00093     char* tmp = buf;
00094     char c;
00095
00096
00097     while( (c = *msg++) != '\0' )
00098     {
00099 #ifdef WIN32
00100         if(c == '\r')
00101             continue;
00102 #endif /* WIN32 */
00103 #ifdef TARGET_OS_MAC
00104         if(c == '\r')
00105             c = '\n';
00106 #endif /* TARGET_OS_MAC */
00107         *tmp++ = c;
00108     }
00109
00110     *tmp++ = '\0';
00111
00112     return buf;
00113 }

void CvsCmdAdd | ( | KiSelectionHandler & | handler,
 |  | kAddCmdType | addType
 | ) |

Execute cvs add command

Parameters:
handler | Selection for the command
addType | Add type

Definition at line 1795 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CStr, cvs_err(), CvsAlert(), MultiFiles::end(), ControlCvsArgs::HasProblem(), kAddBinary, kAddNormal, kAddUnicode, launchCVS(), NULL, CvsArgs::print(), and SplitPath().

Referenced by KoAddUnicodeHandler::OnFiles(), KoAddBinaryHandler::OnFiles(), KoAddHandler::OnFiles(), KoAddUnicodeHandler::OnFolder(), KoAddBinaryHandler::OnFolder(), and KoAddHandler::OnFolder().

01796 {
01797     MultiFiles* mf = NULL;
01798     if( !CheckSelectionHandler(handler, mf) )
01799         return;
01800
01801     MultiFiles::const_iterator mfi;
01802     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01803     {
01804         if( mfi->NumFiles() > 0 )
01805         {
01806             // Files
01807             ControlCvsArgs* args = NULL;
01808             switch( addType )
01809             {
01810             default:
01811             case kAddNormal:
01812                 args = new AddCvsArgs;
01813                 break;
01814             case kAddBinary:
01815                 args = new AddBinCvsArgs;
01816                 break;
01817             case kAddUnicode:
01818                 args = new AddUnicodeCvsArgs;
01819                 break;
01820             }
01821
01822             if( !args )
01823             {
01824                 cvs_err("Unable to allocate memory for arguments list\n");
01825                 return;
01826             }
01827
01828             args->add("add");
01829
01830             if( addType == kAddBinary )
01831             {
01832                 args->add("-kb");
01833             }
01834             else if( addType == kAddUnicode )
01835             {
01836                 args->add("-ku");
01837             }
01838
01839             const char* dir = mfi->add(*args);
01840
01841             if( !args->HasProblem() ||
01842                 !CvsAlert(_i18n("Some problems have been found while adding files and should be corrected"), _i18n("Cancel"), _i18n("Ignore")) )
01843             {
01844                 args->print(dir);
01845                 launchCVS(dir, args->Argc(), args->Argv());
01846             }
01847
01848             delete args;
01849         }
01850         else
01851         {
01852             // Directory
01853             const char* dir = mfi->getdir();
01854             CStr uppath, folder;
01855
01856             if( !SplitPath(dir, uppath, folder) )
01857             {
01858                 cvs_err(_i18n("Unable to convert path name '%s'\n"), dir);
01859                 return;
01860             }
01861
01862             CvsArgs args;
01863             args.add("add");
01864             args.add(folder);
01865
01866             args.print(uppath);
01867             launchCVS(uppath, args.Argc(), args.Argv());
01868         }
01869     }
01870 }

void CvsCmdAnnotate ( KiSelectionHandler & handler )

Execute cvs annotate command

Parameters:
handler Selection for the command

Definition at line 2406 of file CvsCommands.cpp.

References CvsArgs::add(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetAnnotate(), CPStr, CStr, decodeCVS(), MultiFiles::end(), FlatenSubFolders(), GetExtension(), launchCVS(), LaunchViewer(), NULL, and CvsArgs::print().

Referenced by KoAnnotateHandler::OnFiles().

02407 {
02408     MultiFiles* mf = NULL;
02409     if( !CheckSelectionHandler(handler, mf) )
02410         return;
02411
02412     bool noRecurs;
02413     bool isDate;
02414     CPStr rev;
02415     bool force;
02416
02417     if( !CompatGetAnnotate(mf, noRecurs, isDate, rev, force) )
02418         return;
02419
02420     MultiFiles::const_iterator mfi;
02421     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02422     {
02423         CStr path, filename, ext, base, currRev;
02424         CStr file;
02425
02426         for(int i = 0; ; i++)
02427         {
02428             if( !mfi->get(i, path, filename, currRev) )
02429                 break;
02430
02431             // note that filename can contain subfolders
02432
02433             GetExtension(filename, base, ext);
02434
02435             CvsArgs args;
02436             CStr tmpf(base);
02437
02438             if( !rev.empty() )
02439             {
02440                 tmpf << "_ann_";
02441                 tmpf << rev;
02442                 tmpf << '_';
02443             }
02444             else
02445                 tmpf << "_ann_";
02446
02447             // convert subfolder names to regular name
02448             FlatenSubFolders(tmpf);
02449
02450             args.add("annotate");
02451
02452             if( noRecurs )
02453             {
02454                 args.add("-l");
02455             }
02456
02457             if( force )
02458             {
02459                 args.add("-f");
02460             }
02461
02462             if( !rev.empty() )
02463             {
02464                 args.add(isDate ? "-D" : "-r");
02465                 args.add(rev);
02466             }
02467
02468             args.add(filename);
02469             args.print(path);
02470             file = launchCVS(path, args, (const char *)tmpf, ext);
02471 #ifdef qMacCvsPP
02472             decodeCVS (file);
02473 #endif
02474
02475             if( file.empty() )
02476                 continue;
02477
02478             LaunchViewer(file, true);
02479         }
02480     }
02481 }

void CvsCmdCancelChanges ( KiSelectionHandler & handler )

Execute cvs update command

Parameters:
handler Selection for the command

Definition at line 1401 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCancelChangesHandler::OnFiles().

01402 {
01403     MultiFiles* mf = NULL;
01404     if( !CheckSelectionHandler(handler, mf) )
01405         return;
01406
01407     MultiFiles::const_iterator mfi;
01408     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01409     {
01410         RemoveCvsArgs args;
01411         args.add("update");
01412
01413         const char* dir = mfi->add(args);
01414         args.print(dir);
01415         launchCVS(dir, args.Argc(), args.Argv());
01416     }
01417 }

void CvsCmdCheckoutModule ( KiSelectionHandler & handler )

Execute cvs checkout and cvs export command

Parameters:
handler Selection for the command

Definition at line 1090 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetCheckout(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by UCvsFolders::OnCmdCheckout(), KoCheckoutHandler::OnFiles(), and KoCheckoutHandler::OnFolder().

01091 {
01092     MultiFiles* mf = NULL;
01093     if( !CheckSelectionHandler(handler, mf) )
01094         return;
01095
01096     MultiFiles::const_iterator mfi = mf->begin();
01097     const char* dir = mfi->getdir();
01098     bool norecurs;
01099     CPStr modname;
01100     CPStr path(dir);
01101     bool toStdout;
01102     CPStr date;
01103     CPStr rev;
01104     bool useMostRecent;
01105     CPStr rev1;
01106     CPStr rev2;
01107     bool doexport;
01108     bool forceCvsroot;
01109     bool overrideCheckoutDir;
01110     CPStr checkoutDir;
01111     CPStr keyword;
01112
01113     if( !CompatGetCheckout(mf, modname, path, norecurs,
01114         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
01115         overrideCheckoutDir, checkoutDir, keyword) )
01116     {
01117         return;
01118     }
01119
01120     CvsArgs args;
01121
01122     if( forceCvsroot )
01123     {
01124         args.addcvsroot();
01125     }
01126
01127     args.add(doexport ? "export" : "checkout");
01128
01129     if( !keyword.empty() )
01130     {
01131         args.add(keyword);
01132     }
01133
01134     if( gCvsPrefs.PruneOption() && !doexport )
01135         args.add("-P");
01136
01137     if( norecurs )
01138         args.add("-l");
01139
01140     if( toStdout )
01141         args.add("-p");
01142
01143     if( useMostRecent )
01144         args.add("-f");
01145
01146     if( !rev1.empty() )
01147     {
01148         CPStr tmp;
01149         tmp = "-j";
01150         tmp << rev1;
01151         args.add(tmp);
01152     }
01153
01154     if( !rev2.empty() )
01155     {
01156         CPStr tmp;
01157         tmp = "-j";
01158         tmp << rev2;
01159         args.add(tmp);
01160     }
01161
01162     if( !date.empty() )
01163     {
01164         args.add("-D");
01165         args.add(date);
01166     }
01167
01168     if( !rev.empty() )
01169     {
01170         args.add("-r");
01171         args.add(rev);
01172     }
01173
01174     if( doexport && rev.empty() && date.empty() )
01175     {
01176         args.add("-r");
01177         args.add("HEAD");
01178     }
01179
01180     if( overrideCheckoutDir )
01181     {
01182         args.add("-d");
01183         args.add(checkoutDir);
01184     }
01185
01186     args.add(modname);
01187
01188     args.print(path);
01189     launchCVS(path, args.Argc(), args.Argv());
01190 }

void CvsCmdCommandLine ( KiSelectionHandler & handler )

Execute command line

Parameters:
handler Selection for the command

Definition at line 1316 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetCommand(), CStr, MultiFiles::end(), launchCVS(), MAX_ARGS, NULL, CvsArgs::print(), and StringToArgv().

Referenced by CWincvsDoc::OnAppCmdline(), UCvsFrame::OnCmdCmdline(), KoCommandLineHandler::OnFiles(), and KoCommandLineHandler::OnFolder().

01317 {
01318     MultiFiles* mf = NULL;
01319     if( !CheckSelectionHandler(handler, mf) )
01320         return;
01321
01322     CStr dir;
01323     CStr cmd;
01324     bool addDefault;
01325     bool addSelection;
01326     bool forceCvsroot;
01327
01328     if( !CompatGetCommand(mf, cmd, dir, addDefault, addSelection, forceCvsroot) )
01329         return;
01330
01331     char* argv[MAX_ARGS];
01332     int argc = StringToArgv(cmd.c_str(), argv);
01333
01334     if( addSelection )
01335     {
01336         MultiFiles::const_iterator mfi;
01337         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01338         {
01339             CvsArgs args(addDefault);
01340
01341             if( addDefault && forceCvsroot )
01342             {
01343                 args.addcvsroot();
01344             }
01345
01346             for(int i = 0; i < argc; i++)
01347             {
01348                 if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01349                 {
01350                     // Skip the "cvs" arguments as it's already added by args constructor
01351                     continue;
01352                 }
01353
01354                 args.add(argv[i]);
01355
01356                 if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01357                 {
01358                     args.addcvsroot();
01359                 }
01360             }
01361
01362             const char* dir = mfi->add(args);
01363             args.print(dir);
01364             launchCVS(dir, args.Argc(), args.Argv());
01365         }
01366     }
01367     else
01368     {
01369         CvsArgs args(addDefault);
01370
01371         if( addDefault && forceCvsroot )
01372         {
01373             args.addcvsroot();
01374         }
01375
01376         for(int i = 0; i < argc; i++)
01377         {
01378             if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01379             {
01380                 // Skip the "cvs" arguments as it's already added by args constructor
01381                 continue;
01382             }
01383
01384             args.add(argv[i]);
01385
01386             if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01387             {
01388                 args.addcvsroot();
01389             }
01390         }
01391
01392         args.print(dir);
01393         launchCVS(dir, args.Argc(), args.Argv());
01394     }
01395 }

void CvsCmdCommit ( KiSelectionHandler & handler )

Execute cvs commit command

Parameters:
handler Selection for the command

Definition at line 1523 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CleanupLogMsg(), CompatGetCommit(), CPStr, CStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCommitHandler::OnFiles(), and KoCommitHandler::OnFolder().

01524 {
01525     MultiFiles* mf = NULL;
01526     if( !CheckSelectionHandler(handler, mf) )
01527         return;
01528
01529     bool firstTime = true;
01530     bool norecurs;
01531     CStr logmsg;
01532     bool forceCommit;
01533     bool forceRecurse;
01534     CPStr rev;
01535     bool noModuleProgram;
01536     bool checkValidEdits;
01537
01538     MultiFiles::const_iterator mfi;
01539     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01540     {
01541         if( firstTime )
01542         {
01543             // we have to give the path where the commit is done is
01544             // the user expects to fill the CVS/Template file. we just
01545             // grab the first one for this purpose.
01546             CStr pathTmpl;
01547             pathTmpl = mfi->getdir();
01548
01549             if( !CompatGetCommit(mf, logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, pathTmpl) )
01550                 return;
01551
01552             firstTime = false;
01553         }
01554
01555         CvsArgs args;
01556         args.add("commit");
01557
01558         if( checkValidEdits )
01559             args.add("-c");
01560
01561         if( norecurs )
01562             args.add("-l");
01563
01564         if( noModuleProgram )
01565             args.add("-n");
01566
01567         if( forceCommit )
01568             args.add("-f");
01569
01570         if( forceRecurse )
01571             args.add("-R");
01572
01573         args.add("-m");
01574         args.add(CleanupLogMsg(logmsg));
01575
01576         if( !rev.empty() )
01577         {
01578             args.add("-r");
01579             args.add(rev);
01580         }
01581
01582         const char* dir = mfi->add(args);
01583         args.print(dir);
01584         launchCVS(dir, args.Argc(), args.Argv());
01585     }
01586 }

void CvsCmdDiff | ( | KiSelectionHandler & | handler,
 |  | kDiffCmdType | diffType
 | ) |

Execute cvs diff or external diff command

Parameters:
handler | Selection for the command
diffType | Diff command type

Definition at line 1593 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetDiff(), CPStr, CStr, decodeCVS(), MultiFiles::end(), FlatenSubFolders(), MultiFilesEntry::get(), GetExtension(), kDiffGraph, launchCVS(), LaunchDiff(), NULL, MultiFilesEntry::NumFiles(), CvsArgs::print(), and MultiFiles::TotalNumFiles().

Referenced by KoGraphDiffHandler::OnFiles(), KoDiffHandler::OnFiles(), and KoDiffHandler::OnFolder().

01594 {
01595     MultiFiles* mf = NULL;
01596     if( !CheckSelectionHandler(handler, mf) )
01597         return;
01598
01599     bool noRecurs;
01600     bool isDate1;
01601     bool isDate2;
01602     bool useExtDiff;
01603     CPStr rev1;
01604     CPStr rev2;
01605     bool unifiedDiff;
01606     bool noWhiteSpace;
01607     bool noBlankLines;
01608     bool ignoreCase;
01609     bool extDiffResult;
01610     CPStr diffOptions;
01611     CPStr keyword;
01612
01613     if ( diffType == kDiffGraph )
01614     {
01615       // determine initial revision settings
01616       //
01617       if ( mf->TotalNumFiles() > 0 )
01618       {
01619         const MultiFilesEntry&  mfe = *mf->begin();
01620         CStr              ignorePath, ignoreName, rev;
01621         switch ( mfe.NumFiles() )
01622       {
01623         case 2:
01624           if ( mfe.get(1, ignorePath, ignoreName, rev) ) rev2 = rev;
01625           // fall thru
01626         case 1:
01627           if ( mfe.get(0, ignorePath, ignoreName, rev) ) rev1 = rev;
01628           break;
01629       }
01630       }
01631     }
01632
01633     if( !CompatGetDiff(mf, diffType, noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff,
01634         unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase, keyword, diffOptions,
01635         mf->TotalNumFiles() > 0) )
01636     {
01637         return;
01638     }
01639
01640     MultiFiles::const_iterator mfi;
01641     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01642     {
01643         extDiffResult = false;
01644
01645         if( mfi->NumFiles() && useExtDiff )
01646         {
01647             CStr path, filename, ext, base, currRev;
01648             CStr file1, file2;
01649
01650             for(int i = 0; ; i++)
01651             {
01652                 if( !mfi->get(i, path, filename, currRev) )
01653                     break;
01654
01655                 if( 0 < i && kDiffGraph == diffType )
01656                 {
01657                     // Graph diff contains two files, but it's actually the same one
01658                     break;
01659                 }
01660
01661                 // note that filename can contain subfolders
01662
01663                 GetExtension(filename, base, ext);
01664
01665                 CvsArgs args;
01666                 CStr tmpf(base);
01667                 tmpf << '_';
01668
01669                 if( !rev1.empty() )
01670                     tmpf << rev1;
01671                 else
01672                     tmpf << currRev;
01673
01674                 tmpf << '_';
01675
01676                 // convert subfolder names to regular name
01677                 FlatenSubFolders(tmpf);
01678
01679                 args.add("update");
01680                 args.add("-p");
01681
01682                 if( !rev1.empty() )
01683                 {
01684                     args.add(isDate1 ? "-D" : "-r");
01685                     args.add(rev1);
01686                 }
01687                 else if( !currRev.empty() )
01688                 {
01689                     args.add("-r");
01690                     args.add(currRev);
01691                 }
01692
01693                 args.add(filename);
01694                 args.print(path);
01695                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
01696
01697 #if TARGET_RT_MAC_CFM
01698                 decodeCVS (file1);
01699 #endif
01700
01701                 if( rev2.empty() )
01702                 {
01703                     file2 = path;
01704
01705                     if( !file2.endsWith(kPathDelimiter) )
01706                         file2 << kPathDelimiter;
01707
01708                     file2 << filename;
01709                 }
01710                 else
01711                 {
01712                     CvsArgs args2;
01713
01714                     tmpf = base;
01715                     tmpf << '_';
01716                     tmpf << rev2;
01717                     tmpf << '_';
01718
01719                     // convert subfolder names to regular name
01720                     FlatenSubFolders(tmpf);
01721
01722                     args2.add("update");
01723                     args2.add("-p");
01724                     args2.add(isDate2 ? "-D" : "-r");
01725                     args2.add(rev2);
01726                     args2.add(filename);
01727                     args2.print(path);
01728                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
01729 #if TARGET_RT_MAC_CFM
01730                     decodeCVS (file2);
01731 #endif
01732                 }
01733
01734                 if( file1.empty() || file2.empty() )
01735                     continue;
01736
01737                 extDiffResult = LaunchDiff(file1, file2);
01738             }
01739         }
01740
01741         if( !mfi->NumFiles() || !useExtDiff || !extDiffResult )
01742         {
01743             CvsArgs args;
01744             args.add("diff");
01745
01746             if( noRecurs )
01747                 args.add("-l");
01748
01749             if( !rev1.empty() )
01750             {
01751                 args.add(isDate1 ? "-D" : "-r");
01752                 args.add(rev1);
01753             }
01754
01755             if( !rev2.empty() )
01756             {
01757                 args.add(isDate2 ? "-D" : "-r");
01758                 args.add(rev2);
01759             }
01760
01761             if( unifiedDiff )
01762                 args.add("-u");     // --unified, -u
01763
01764             if( noWhiteSpace )
01765                 args.add("-wb");    //--ignore-all-space --ignore-space-change
01766
01767             if( noBlankLines )
01768                 args.add("-B");     //--ignore-blank-lines
01769
01770             if( ignoreCase )
01771                 args.add("-i");     //--ignore-case
01772
01773             if( !keyword.empty() )
01774             {
01775                 args.add(keyword);
01776             }
01777
01778             if( !diffOptions.empty() )
01779             {
01780                 args.add(diffOptions);
01781             }
01782
01783             const char* dir = mfi->add(args);
01784             args.print(dir);
01785             launchCVS(dir, args.Argc(), args.Argv());
01786         }
01787     }
01788 }

void CvsCmdEdit | ( | KiSelectionHandler & | handler,
 |  | kEditCmdType | editType
 | ) |

Execute cvs command

Parameters:
handler | Selection for the command
editType | Edit type

Definition at line 2200 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), kEditForce, kEditNormal, kEditReserved, launchCVS(), NULL, and CvsArgs::print().

Referenced by KoForceEditHandler::OnFiles(), KoReservedEditHandler::OnFiles(), KoEditHandler::OnFiles(), KoForceEditHandler::OnFolder(), KoReservedEditHandler::OnFolder(), and KoEditHandler::OnFolder().

02201 {
02202     MultiFiles* mf = NULL;
02203     if( !CheckSelectionHandler(handler, mf) )
02204         return;
02205
02206     MultiFiles::const_iterator mfi;
02207     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02208     {
02209         CvsArgs args;
02210         args.add("edit");
02211
02212         switch( editType )
02213         {
02214         default:
02215         case kEditNormal:
02216             // intentionally blank
02217             break;
02218         case kEditReserved:
02219             args.add("-c");
02220             break;
02221         case kEditForce:
02222             args.add("-f");
02223             break;
02224         }
02225
02226         const char* dir = mfi->add(args);
02227         args.print(dir);
02228         launchCVS(dir, args.Argc(), args.Argv());
02229     }
02230 }

void CvsCmdEditors ( KiSelectionHandler & handler )

Execute cvs editors command

Parameters:
handler Selection for the command

Definition at line 2384 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoEditorsHandler::OnFiles(), and KoEditorsHandler::OnFolder().

02385 {
02386     MultiFiles* mf = NULL;
02387     if( !CheckSelectionHandler(handler, mf) )
02388         return;
02389
02390     MultiFiles::const_iterator mfi;
02391     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02392     {
02393         CvsArgs args;
02394         args.add("editors");
02395
02396         const char* dir = mfi->add(args);
02397         args.print(dir);
02398         launchCVS(dir, args.Argc(), args.Argv());
02399     }
02400 }

void CvsCmdImportModule ( KiSelectionHandler & handler )

Execute cvs import command

Parameters:
handler Selection for the command

Definition at line 1196 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CleanupLogMsg(), CompatGetImport(), CompatImportFilter(), CPStr, CStr, MultiFiles::end(), free_list_types(), ReportConflict::GetPattern(), ReportConflict::HasForceBinary(), ReportConflict::HasForceNoKeywords(), ReportConflict::HasForceText(), ReportConflict::HasForceUnicode(), ReportConflict::HasIgnore(), ReportConflict::IsBinary(), ReportConflict::IsExtension(), ReportConflict::IsUnicode(), launchCVS(), ReportConflict::next, NULL, and CvsArgs::print().

Referenced by UCvsFolders::OnCmdImport(), KoImportHandler::OnFiles(), and KoImportHandler::OnFolder().

01197 {
01198     MultiFiles* mf = NULL;
01199     if( !CheckSelectionHandler(handler, mf) )
01200         return;
01201
01202     MultiFiles::const_iterator mfi;
01203     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01204     {
01205         ReportConflict* entries;
01206         ReportWarning* warnings;
01207         const char* dir = mfi->getdir();
01208
01209         if( !CompatImportFilter(dir, entries, warnings) )
01210             return;
01211
01212         CPStr modname, vendortag, reltag, path(dir);
01213         CStr logmsg;
01214         bool useDefIgnore;
01215         bool useFilesTime;
01216
01217         if( !CompatGetImport(mf, modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
01218             return;
01219
01220         CvsArgs args;
01221         args.add("import");
01222
01223         if( useFilesTime )
01224         {
01225             args.add("-d");
01226         }
01227
01228         // fill the wrappers
01229         ReportConflict* tmpentry = entries;
01230
01231         if( !useDefIgnore )
01232         {
01233             args.add("-I"); // no default (core, *.o...)
01234             args.add("!");
01235             args.add("-I"); // but ignore the CVS folders
01236             args.add("CVS");
01237         }
01238
01239         while( tmpentry != 0L )
01240         {
01241             if( tmpentry->HasIgnore() )
01242             {
01243                 CPStr ign;
01244                 args.add("-I");
01245
01246                 if( tmpentry->IsExtension() )
01247                     ign << '*';
01248
01249                 ign << tmpentry->GetPattern();
01250                 args.add(ign);
01251             }
01252             else if( !tmpentry->HasForceText() &&
01253                 (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
01254                 tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
01255             {
01256                 CPStr wrap;
01257                 const char* pattern = tmpentry->GetPattern();
01258                 bool hasSpace = strchr(pattern, ' ') != 0L;
01259                 args.add("-W");
01260
01261                 if( hasSpace )
01262                     wrap << '"';
01263
01264                 if( tmpentry->IsExtension() )
01265                     wrap << '*';
01266
01267                 wrap << pattern;
01268
01269                 if( hasSpace )
01270                     wrap << '"';
01271
01272                 if( tmpentry->HasForceNoKeywords() )
01273                 {
01274                     wrap << " -k 'o'";
01275                 }
01276                 else if( tmpentry->HasForceBinary() )
01277                 {
01278                     wrap << " -k 'b'";
01279                 }
01280                 else if( tmpentry->HasForceUnicode() )
01281                 {
01282                     wrap << " -k 'u'";
01283                 }
01284                 else if( tmpentry->IsBinary() )
01285                 {
01286                     wrap << " -k 'b'";
01287                 }
01288                 else if( tmpentry->IsUnicode() )
01289                 {
01290                     wrap << " -k 'u'";
01291                 }
01292
01293                 args.add(wrap);
01294             }
01295
01296             tmpentry = tmpentry->next;
01297         }
01298
01299         free_list_types(warnings, entries);
01300
01301         args.add("-m");
01302         args.add(CleanupLogMsg(logmsg));
01303         args.add(modname);
01304         args.add(vendortag);
01305         args.add(reltag);
01306
01307         args.print(path);
01308         launchCVS(path, args.Argc(), args.Argv());
01309     }
01310 }

void CvsCmdInit ( )

Execute cvs init command

Definition at line 852 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), CompatGetInit(), launchCVS(), and CvsArgs::print().

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

00853 {
00854     if( gCvsPrefs.empty() )
00855         return;
00856
00857     bool forceCvsroot;
00858
00859     if( !CompatGetInit(forceCvsroot) )
00860         return;
00861
00862     CvsArgs args;
00863
00864     if( forceCvsroot )
00865     {
00866         args.addcvsroot();
00867     }
00868
00869     args.add("init");
00870
00871     args.print();
00872     launchCVS(0L, args.Argc(), args.Argv());
00873 }

void CvsCmdLock ( KiSelectionHandler & handler )

Execute cvs admin -l command

Parameters:
handler Selection for the command

Definition at line 2043 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoLockHandler::OnFiles(), and KoLockHandler::OnFolder().

02044 {
02045     MultiFiles* mf = NULL;
02046     if( !CheckSelectionHandler(handler, mf) )
02047         return;
02048
02049     MultiFiles::const_iterator mfi;
02050     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02051     {
02052         CvsArgs args;
02053         args.add("admin");
02054         args.add("-l");
02055
02056         const char* dir = mfi->add(args);
02057         args.print(dir);
02058         launchCVS(dir, args.Argc(), args.Argv());
02059     }
02060 }

void CvsCmdLog | ( | KiSelectionHandler & | handler,
 |  | bool | outGraph,
 |  | void * | defWnd
 | ) |

Execute cvs log or graph command

Parameters:
handler | Selection for the command
outGraph | true for the graph
defWnd | Default window

Definition at line 1905 of file CvsCommands.cpp.

References CvsArgs::add(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetLog(), CPStr, CvsLogParse(), MultiFiles::end(), NULL, and CvsArgs::print().

Referenced by KoGraphHandler::OnFiles(), KoLogHandler::OnFiles(), and KoLogHandler::OnFolder().

01906 {
01907     MultiFiles* mf = NULL;
01908     if( !CheckSelectionHandler(handler, mf) )
01909         return;
01910
01911     bool noRecurs;
01912     bool defBranch;
01913     CPStr date;
01914     bool headerOnly;
01915     bool headerDesc;
01916     bool supress;
01917     bool noTags;
01918     bool onlyRCSfile;
01919     bool hasRev;
01920     CPStr rev;
01921     CPStr states;
01922     bool hasUser;
01923     CPStr users;
01924
01925     if( !CompatGetLog(mf, noRecurs, defBranch, date,
01926         headerOnly, headerDesc, supress,
01927         noTags, onlyRCSfile, hasRev,
01928         rev, states, hasUser, users,
01929         outGraph) )
01930     {
01931         return;
01932     }
01933
01934     MultiFiles::const_iterator mfi;
01935     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01936     {
01937         CvsArgs args;
01938         args.add("log");
01939
01940         if( noRecurs )
01941             args.add("-l");
01942
01943         if( defBranch )
01944             args.add("-b");
01945
01946         if( headerDesc )
01947         {
01948             args.add("-t");
01949         }
01950         else
01951         {
01952             if( headerOnly )
01953                 args.add("-h");
01954         }
01955
01956         if( supress )
01957             args.add("-S");
01958
01959         if( noTags )
01960             args.add("-N");
01961
01962         if( onlyRCSfile )
01963             args.add("-R");
01964
01965         if( !date.empty() )
01966         {
01967             args.add("-d");
01968             args.add(date);
01969         }
01970
01971         if( !states.empty() )
01972         {
01973             args.add("-s");
01974             args.add(states);
01975         }
01976
01977         if( hasRev )
01978         {
01979             CPStr tmp;
01980             tmp = "-r";
01981             tmp << rev;
01982             args.add(tmp);
01983         }
01984
01985         if( hasUser )
01986         {
01987             CPStr tmp;
01988             tmp = "-w";
01989             tmp << users;
01990             args.add(tmp);
01991         }
01992
01993         const char* dir = mfi->add(args);
01994         args.print(dir);
01995         CvsLogParse(dir, args, outGraph, defWnd);
01996     }
01997 }

void CvsCmdLogin ( void )

Execute cvs login command

Definition at line 878 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), CompatGetLogin(), cvs_err(), CvsCmdLogout(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), launchCVS(), CvsArgs::print(), and WaitForCvs().

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

00879 {
00880     if( gCvsPrefs.empty() )
00881         return;
00882
00883     bool forceCvsroot;
00884
00885     if( !CompatGetLogin(forceCvsroot) )
00886         return;
00887
00888     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00889     if( !curModel->HasLogin() )
00890     {
00891         cvs_err(_i18n("Logging in is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00892             "Please consult the CVS manual for more details.\n"));
00893     }
00894
00895     if( gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0 )
00896     {
00897         cvs_err(_i18n("Making automatic logout:\n"));
00898         CvsCmdLogout();
00899         WaitForCvs();
00900     }
00901
00902     gCvsPrefs.SetHasLoogedIn(true);
00903
00904     CvsArgs args;
00905
00906     if( forceCvsroot )
00907     {
00908         args.addcvsroot();
00909     }
00910
00911     args.add("login");
00912
00913     args.print();
00914     launchCVS(0L, args.Argc(), args.Argv());
00915 }

void CvsCmdLogout ( void )

Execute cvs logou command

Definition at line 920 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), cvs_err(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), launchCVS(), and CvsArgs::print().

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

00921 {
00922     if( gCvsPrefs.empty() )
00923         return;
00924
00925     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00926     if( curModel->HasLogin() )
00927     {
00928         cvs_err(_i18n("Logging out is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00929             "Please consult the CVS manual for more details.\n"));
00930     }
00931
00932     gCvsPrefs.SetHasLoogedIn(false);
00933
00934     CvsArgs args;
00935
00936     args.add("logout");
00937
00938     args.print();
00939     launchCVS(0L, args.Argc(), args.Argv());
00940 }

void CvsCmdMacrosAdmin ( const char * macroName )

Execute admin macro

Parameters:
macroName Macro name to be executed

Definition at line 815 of file CvsCommands.cpp.

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

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

00816 {
00817     if( gCvsPrefs.empty() || !CTcl_Interp::IsAvail() )
00818         return;
00819
00820     CTcl_Interp interp;
00821     CStr path = macroName;
00822     CTcl_Interp::Unixfy(path);
00823     interp.DoScriptVar("source \"%s\"", (const char*)path);
00824 }

void CvsCmdMoveToTrash ( KiSelectionHandler & handler )

Execute erase command

Parameters:
handler Selection for the command

Definition at line 2487 of file CvsCommands.cpp.

References _i18n, MultiFiles::begin(), UStr::c_str(), CheckSelectionHandler(), CompatBeginMoveToTrash(), CompatEndMoveToTrash(), CompatMoveToTrash(), CStr, cvs_err(), cvs_out(), CvsAlert(), MultiFiles::end(), UStr::endsWith(), and NULL.

Referenced by KoMoveToTrashHandler::OnFiles().

02488 {
02489     MultiFiles* mf = NULL;
02490     if( !CheckSelectionHandler(handler, mf) )
02491         return;
02492
02493     if( !CvsAlert(_i18n("Are you sure you want to erase selected files?"), _i18n("Yes"), _i18n("No")) )
02494     {
02495         return;
02496     }
02497
02498     CompatBeginMoveToTrash();
02499
02500     MultiFiles::const_iterator mfi;
02501     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02502     {
02503         int count = mfi->NumFiles();
02504         for(int i = 0; i < count; i++)
02505         {
02506             CStr path, fileName, currRev;
02507             if( mfi->get(i, path, fileName, currRev) )
02508             {
02509                 UStr fn(path);
02510                 if( !fn.endsWith(kPathDelimiter) )
02511                     fn << kPathDelimiter;
02512
02513                 fn << fileName;
02514
02515                 if( !CompatMoveToTrash(fn) )
02516                 {
02517                     UStr errText;
02518                     errText << _i18n("Unable to remove '") << fn << _i18n("' (error ") << errno << ")\n";
02519
02520                     cvs_err( errText.c_str() );
02521                 }
02522                 else
02523                 {
02524                     UStr errText;
02525 #if TARGET_OS_MAC
02526                     errText << "'" << fn << _i18n("' has been moved successfully to the trash...\n");
02527 #elif WIN32
02528                     errText << "'" << fn << _i18n("' has been moved successfully to the recycle bin ...\n");
02529 #else
02530                     errText << "'" << fn << _i18n("' has been removed successfully ...\n");
02531 #endif
02532                     cvs_out( errText.c_str() );
02533                 }
02534             }
02535         }
02536     }
02537
02538     CompatEndMoveToTrash();
02539 }

void CvsCmdRelease ( KiSelectionHandler & handler )

Execute cvs release command

Parameters:
handler Selection for the command

Definition at line 2304 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatGetRelease(), CStr, cvs_err(), MultiFiles::getdir(), kReleaseDelAll, kReleaseDelCvsInfo, kReleaseDelDir, kReleaseDelType, kReleaseNoDel, launchCVS(), NULL, CvsArgs::print(), and SplitPath().

Referenced by KoReleaseHandler::OnFolder().

02305 {
02306     MultiFiles* mf = NULL;
02307     if( !CheckSelectionHandler(handler, mf) )
02308         return;
02309
02310     CStr dir;
02311     if( !mf->getdir(0, dir) )
02312     {
02313         return;
02314     }
02315
02316     CStr uppath, folder;
02317     if( !SplitPath(dir, uppath, folder) )
02318     {
02319         cvs_err(_i18n("Unable to convert path name '%s'\n"), dir.c_str());
02320
02321         // Even thought something didn't work we will try to continue and put all the responsibility onto the user
02322         uppath = dir;
02323         folder = ".";
02324     }
02325
02326     kReleaseDelType removeDirectoryOption = kReleaseNoDel;
02327
02328     if( !CompatGetRelease(mf, dir, removeDirectoryOption) )
02329     {
02330         return;
02331     }
02332
02333     CvsArgs args;
02334     args.add("release");
02335
02336     switch( removeDirectoryOption )
02337     {
02338     default:
02339     case kReleaseNoDel:
02340         break;
02341     case kReleaseDelDir:
02342         args.add("-d");
02343         break;
02344     case kReleaseDelAll:
02345         args.add("-f");
02346         break;
02347     case kReleaseDelCvsInfo:
02348         args.add("-e");
02349         break;
02350     }
02351
02352     args.add(folder);
02353
02354     args.print(uppath);
02355     launchCVS(uppath, args.Argc(), args.Argv());
02356 }

void CvsCmdRemove ( KiSelectionHandler & handler )

Execute cvs remove command

Parameters:
handler Selection for the command

Definition at line 1876 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatBeginMoveToTrash(), CompatEndMoveToTrash(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoFileRemoveHandler::OnFiles().

01877 {
01878     MultiFiles* mf = NULL;
01879     if( !CheckSelectionHandler(handler, mf) )
01880         return;
01881
01882     MultiFiles::const_iterator mfi;
01883     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01884     {
01885         RemoveCvsArgs args;
01886
01887         CompatBeginMoveToTrash();
01888
01889         args.add("remove");
01890         const char* dir = mfi->add(args);
01891         args.print(dir);
01892
01893         CompatEndMoveToTrash();
01894
01895         launchCVS(dir, args.Argc(), args.Argv());
01896     }
01897 }

void CvsCmdRtagBranch ( KiSelectionHandler & handler )

Execute cvs rtag -b command

Parameters:
handler Selection for the command

Definition at line 1037 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagBranch(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagBranch(), UCvsFrame::OnCmdRtagBranch(), KoRtagBranchHandler::OnFiles(), and KoRtagBranchHandler::OnFolder().

01038 {
01039     MultiFiles* mf = NULL;
01040     if( !CheckSelectionHandler(handler, mf) )
01041         return;
01042
01043     bool norecurs;
01044     bool useMostRecent;
01045     bool lookAttic;
01046     CPStr modname;
01047     CPStr branchname;
01048     CPStr date;
01049     CPStr rev;
01050
01051     if( !CompatRtagBranch(mf, norecurs, branchname, modname, date, rev, useMostRecent, lookAttic) )
01052             return;
01053
01054     CvsArgs args;
01055     args.add("rtag");
01056     args.add("-b");
01057
01058     if( norecurs )
01059         args.add("-l");
01060
01061     if( useMostRecent )
01062         args.add("-f");
01063
01064     if( lookAttic )
01065         args.add("-a");
01066
01067     if( !date.empty() )
01068     {
01069         args.add("-D");
01070         args.add(date);
01071     }
01072
01073     if( !rev.empty() )
01074     {
01075         args.add("-r");
01076         args.add(rev);
01077     }
01078
01079     args.add(branchname);
01080     args.add(modname);
01081
01082     args.print();
01083     launchCVS(0L, args.Argc(), args.Argv());
01084 }

void CvsCmdRtagCreate ( KiSelectionHandler & handler )

Execute cvs rtag command

Parameters:
handler Selection for the command

Definition at line 946 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagCreate(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagNew(), UCvsFrame::OnCmdRtagNew(), KoRtagCreateHandler::OnFiles(), and KoRtagCreateHandler::OnFolder().

00947 {
00948     MultiFiles* mf = NULL;
00949     if( !CheckSelectionHandler(handler, mf) )
00950         return;
00951
00952     bool norecurs;
00953     bool useMostRecent;
00954     bool overwriteExisting;
00955     bool lookAttic;
00956     CPStr modname;
00957     CPStr tagname;
00958     CPStr date;
00959     CPStr rev;
00960
00961     if( !CompatRtagCreate(mf, norecurs, overwriteExisting, tagname, modname, date, rev, useMostRecent, lookAttic) )
00962         return;
00963
00964     CvsArgs args;
00965     args.add("rtag");
00966
00967     if( norecurs )
00968         args.add("-l");
00969
00970     if( useMostRecent )
00971         args.add("-f");
00972
00973     if( overwriteExisting )
00974         args.add("-F");
00975
00976     if( lookAttic )
00977         args.add("-a");
00978
00979     if( !date.empty() )
00980     {
00981         args.add("-D");
00982         args.add(date);
00983     }
00984
00985     if( !rev.empty() )
00986     {
00987         args.add("-r");
00988         args.add(rev);
00989     }
00990
00991     args.add(tagname);
00992     args.add(modname);
00993
00994     args.print();
00995     launchCVS(0L, args.Argc(), args.Argv());
00996 }

void CvsCmdRtagDelete ( KiSelectionHandler & handler )

Execute cvs rtag -d command

Parameters:
handler Selection for the command

Definition at line 1002 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CheckSelectionHandler(), CompatRtagDelete(), CPStr, launchCVS(), NULL, and CvsArgs::print().

Referenced by CWincvsDoc::OnAppRtagDelete(), UCvsFrame::OnCmdRtagDelete(), KoRtagDeleteHandler::OnFiles(), and KoRtagDeleteHandler::OnFolder().

01003 {
01004     MultiFiles* mf = NULL;
01005     if( !CheckSelectionHandler(handler, mf) )
01006         return;
01007
01008     bool norecurs;
01009     bool lookAttic;
01010     CPStr modname;
01011     CPStr tagname;
01012
01013     if( !CompatRtagDelete(mf, norecurs, lookAttic, tagname, modname) )
01014             return;
01015
01016     CvsArgs args;
01017     args.add("rtag");
01018     args.add("-d");
01019
01020     if( norecurs )
01021         args.add("-l");
01022
01023     if( lookAttic )
01024         args.add("-a");
01025
01026     args.add(tagname);
01027     args.add(modname);
01028
01029     args.print();
01030     launchCVS(0L, args.Argc(), args.Argv());
01031 }

void CvsCmdStatus ( KiSelectionHandler & handler )

Execute cvs status command

Parameters:
handler Selection for the command

Definition at line 2003 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetStatus(), MultiFiles::end(), launchCVS(), NULL, CvsArgs::print(), STATUSOUTPUT_QUICK, STATUSOUTPUT_TYPE, and STATUSOUTPUT_VERBOSE.

Referenced by KoStatusHandler::OnFiles(), and KoStatusHandler::OnFolder().

02004 {
02005     MultiFiles* mf = NULL;
02006     if( !CheckSelectionHandler(handler, mf) )
02007         return;
02008
02009     bool noRecurs = false;
02010     STATUSOUTPUT_TYPE outputType = STATUSOUTPUT_VERBOSE;
02011
02012     if( !CompatGetStatus(mf, noRecurs, outputType) )
02013         return;
02014
02015     MultiFiles::const_iterator mfi;
02016     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02017     {
02018         CvsArgs args;
02019         args.add("status");
02020
02021         if( noRecurs )
02022             args.add("-l");
02023
02024         if( STATUSOUTPUT_VERBOSE == outputType )
02025         {
02026             args.add("-v");
02027         }
02028         else if( STATUSOUTPUT_QUICK == outputType )
02029         {
02030             args.add("-q");
02031         }
02032
02033         const char* dir = mfi->add(args);
02034         args.print(dir);
02035         launchCVS(dir, args.Argc(), args.Argv());
02036     }
02037 }

void CvsCmdTagBranch ( KiSelectionHandler & handler )

Execute cvs tag -b command

Parameters:
handler Selection for the command

Definition at line 2162 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagBranch(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoBranchTagHandler::OnFiles(), and KoBranchTagHandler::OnFolder().

02163 {
02164     MultiFiles* mf = NULL;
02165     if( !CheckSelectionHandler(handler, mf) )
02166         return;
02167
02168     bool noRecurs, checkUnmod;
02169     CPStr branchName;
02170
02171     if( !CompatTagBranch(mf, noRecurs, branchName, checkUnmod) )
02172         return;
02173
02174     MultiFiles::const_iterator mfi;
02175     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02176     {
02177         CvsArgs args;
02178         args.add("tag");
02179         args.add("-b");
02180
02181         if( noRecurs )
02182             args.add("-l");
02183
02184         if( checkUnmod )
02185             args.add("-c");
02186
02187         args.add(branchName);
02188
02189         const char* dir = mfi->add(args);
02190         args.print(dir);
02191         launchCVS(dir, args.Argc(), args.Argv());
02192     }
02193 }

void CvsCmdTagCreate ( KiSelectionHandler & handler )

Execute cvs tag command

Parameters:
handler Selection for the command

Definition at line 2089 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagCreate(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoCreateTagHandler::OnFiles(), and KoCreateTagHandler::OnFolder().

02090 {
02091     MultiFiles* mf = NULL;
02092     if( !CheckSelectionHandler(handler, mf) )
02093         return;
02094
02095     bool noRecurs, overwriteExisting, checkUnmod;
02096     CPStr tagName;
02097
02098     if( !CompatTagCreate(mf, noRecurs, overwriteExisting, tagName, checkUnmod) )
02099         return;
02100
02101     MultiFiles::const_iterator mfi;
02102     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02103     {
02104         CvsArgs args;
02105         args.add("tag");
02106
02107         if( noRecurs )
02108             args.add("-l");
02109
02110         if( overwriteExisting )
02111             args.add("-F");
02112
02113         if( checkUnmod )
02114             args.add("-c");
02115
02116         args.add(tagName);
02117
02118         const char* dir = mfi->add(args);
02119         args.print(dir);
02120         launchCVS(dir, args.Argc(), args.Argv());
02121     }
02122 }

void CvsCmdTagDelete ( KiSelectionHandler & handler )

Execute cvs tag -d command

Parameters:
handler Selection for the command

Definition at line 2128 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatTagDelete(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoDeleteTagHandler::OnFiles(), and KoDeleteTagHandler::OnFolder().

02129 {
02130     MultiFiles* mf = NULL;
02131     if( !CheckSelectionHandler(handler, mf) )
02132         return;
02133
02134     bool noRecurs;
02135     CPStr tagName;
02136
02137     if( !CompatTagDelete(mf, noRecurs, tagName) )
02138         return;
02139
02140     MultiFiles::const_iterator mfi;
02141     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02142     {
02143         CvsArgs args;
02144         args.add("tag");
02145         args.add("-d");
02146
02147         if( noRecurs )
02148             args.add("-l");
02149
02150         args.add(tagName);
02151
02152         const char* dir = mfi->add(args);
02153         args.print(dir);
02154         launchCVS(dir, args.Argc(), args.Argv());
02155     }
02156 }

void CvsCmdUnedit ( KiSelectionHandler & handler )

Execute cvs unedit command

Parameters:
handler Selection for the command

Definition at line 2236 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoUneditHandler::OnFiles(), and KoUneditHandler::OnFolder().

02237 {
02238     MultiFiles* mf = NULL;
02239     if( !CheckSelectionHandler(handler, mf) )
02240         return;
02241
02242     MultiFiles::const_iterator mfi;
02243     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02244     {
02245         CvsArgs args;
02246         args.add("unedit");
02247
02248         const char* dir = mfi->add(args);
02249         args.print(dir);
02250         launchCVS(dir, args.Argc(), args.Argv());
02251     }
02252 }

void CvsCmdUnlock ( KiSelectionHandler & handler )

Execute cvs admin -u command

Parameters:
handler Selection for the command

Definition at line 2066 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoUnlockHandler::OnFiles(), and KoUnlockHandler::OnFolder().

02067 {
02068     MultiFiles* mf = NULL;
02069     if( !CheckSelectionHandler(handler, mf) )
02070         return;
02071
02072     MultiFiles::const_iterator mfi;
02073     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02074     {
02075         CvsArgs args;
02076         args.add("admin");
02077         args.add("-u");
02078
02079         const char* dir = mfi->add(args);
02080         args.print(dir);
02081         launchCVS(dir, args.Argc(), args.Argv());
02082     }
02083 }

void CvsCmdUpdate | ( | KiSelectionHandler & | handler,
 |  | bool | queryOnly
 | ) |

Execute cvs update command

Parameters:
handler | Selection for the command
queryOnly | true for query update, false for the update command

Definition at line 1424 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), CompatGetUpdate(), CPStr, MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoQueryUpdateHandler::OnFiles(), KoUpdateHandler::OnFiles(), KoQueryUpdateHandler::OnFolder(), and KoUpdateHandler::OnFolder().

01425 {
01426     MultiFiles* mf = NULL;
01427     if( !CheckSelectionHandler(handler, mf) )
01428         return;
01429
01430     bool toStdout;
01431     bool noRecurs;
01432     bool resetSticky;
01433     CPStr date;
01434     CPStr rev;
01435     bool useMostRecent;
01436     CPStr rev1;
01437     CPStr rev2;
01438     bool createMissDir;
01439     bool getCleanCopy;
01440     CPStr keyword;
01441
01442     if( !queryOnly && !CompatGetUpdate(mf, toStdout, noRecurs, resetSticky,
01443         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy, keyword) )
01444         return;
01445
01446     MultiFiles::const_iterator mfi;
01447     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01448     {
01449         CvsArgs args;
01450
01451         if( queryOnly )
01452             args.add("-n");
01453
01454         args.add("update");
01455
01456         if( !keyword.empty() )
01457         {
01458             args.add(keyword);
01459         }
01460
01461         if( gCvsPrefs.PruneOption() )
01462             args.add("-P");
01463
01464         if( !queryOnly )
01465         {
01466             if( resetSticky )
01467                 args.add("-A");
01468
01469             if( createMissDir )
01470                 args.add("-d");
01471
01472             if( getCleanCopy )
01473                 args.add("-C");
01474
01475             if( !date.empty() )
01476             {
01477                 args.add("-D");
01478                 args.add(date);
01479             }
01480
01481             if( useMostRecent )
01482                 args.add("-f");
01483
01484             if( !rev1.empty() )
01485             {
01486                 CPStr tmp;
01487                 tmp = "-j";
01488                 tmp << rev1;
01489                 args.add(tmp);
01490             }
01491
01492             if( !rev2.empty() )
01493             {
01494                 CPStr tmp;
01495                 tmp = "-j";
01496                 tmp << rev2;
01497                 args.add(tmp);
01498             }
01499
01500             if( noRecurs )
01501                 args.add("-l");
01502
01503             if( toStdout )
01504                 args.add("-p");
01505
01506             if( !rev.empty() )
01507             {
01508                 args.add("-r");
01509                 args.add(rev);
01510             }
01511         }
01512
01513         const char* dir = mfi->add(args);
01514         args.print(dir);
01515         launchCVS(dir, args.Argc(), args.Argv());
01516     }
01517 }

void CvsCmdWatchers ( KiSelectionHandler & handler )

Execute cvs watchers command

Parameters:
handler Selection for the command

Definition at line 2362 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchersHandler::OnFiles(), and KoWatchersHandler::OnFolder().

02363 {
02364     MultiFiles* mf = NULL;
02365     if( !CheckSelectionHandler(handler, mf) )
02366         return;
02367
02368     MultiFiles::const_iterator mfi;
02369     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02370     {
02371         CvsArgs args;
02372         args.add("watchers");
02373
02374         const char* dir = mfi->add(args);
02375         args.print(dir);
02376         launchCVS(dir, args.Argc(), args.Argv());
02377     }
02378 }

void CvsCmdWatchOff ( KiSelectionHandler & handler )

Execute cvs watch remove command

Parameters:
handler Selection for the command

Definition at line 2281 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchOffHandler::OnFiles(), and KoWatchOffHandler::OnFolder().

02282 {
02283     MultiFiles* mf = NULL;
02284     if( !CheckSelectionHandler(handler, mf) )
02285         return;
02286
02287     MultiFiles::const_iterator mfi;
02288     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02289     {
02290         CvsArgs args;
02291         args.add("watch");
02292         args.add("remove");
02293
02294         const char* dir = mfi->add(args);
02295         args.print(dir);
02296         launchCVS(dir, args.Argc(), args.Argv());
02297     }
02298 }

void CvsCmdWatchOn ( KiSelectionHandler & handler )

Execute cvs watch add command

Parameters:
handler Selection for the command

Definition at line 2258 of file CvsCommands.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), MultiFiles::begin(), CheckSelectionHandler(), MultiFiles::end(), launchCVS(), NULL, and CvsArgs::print().

Referenced by KoWatchOnHandler::OnFiles(), and KoWatchOnHandler::OnFolder().

02259 {
02260     MultiFiles* mf = NULL;
02261     if( !CheckSelectionHandler(handler, mf) )
02262         return;
02263
02264     MultiFiles::const_iterator mfi;
02265     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02266     {
02267         CvsArgs args;
02268         args.add("watch");
02269         args.add("add");
02270
02271         const char* dir = mfi->add(args);
02272         args.print(dir);
02273         launchCVS(dir, args.Argc(), args.Argv());
02274     }
02275 }

bool GetEnvValue | ( | const char * | cmd,
 |  | const char * | key,
 |  | UStr & | value
 | ) |

Parse a command like 'user=whohost=cvs'

Parameters:
cmd | Command
key | Key
value | Return value
Returns:
true on success, false otherwise

Definition at line 314 of file CvsCommands.cpp.

References UStr::set().

Referenced by CompatGetPassword().

00315 {
00316     const char* tmp = strstr(cmd, key);
00317     if( tmp == 0L )
00318         return false;
00319
00320     tmp = strchr(tmp, '=');
00321     if( tmp == 0L )
00322         return false;
00323
00324     tmp++;
00325
00326     const char* tmp2 = strchr(tmp, '&');
00327     if( tmp2 == 0L )
00328         value = tmp;
00329     else
00330         value.set(tmp, tmp2 - tmp);
00331
00332     return true;
00333 }

void GetExtension | ( | const char * | file,
 |  | UStr & | base,
 |  | UStr & | ext
 | ) |

Extract the extension from the filename

Parameters:
file | File name to extract extension from
base | Return the base of the filename
ext | Return the file's extension

Definition at line 290 of file CvsCommands.cpp.

Referenced by CvsCmdAnnotate(), CvsCmdDiff(), getSettingName(), and CGraphView::OnQueryAnnotate().

00291 {
00292     char* tmp = strrchr(file, '.');
00293
00294     if( tmp == 0L )
00295     {
00296         ext = "";
00297         base = file;
00298     }
00299     else
00300     {
00301         ext = tmp + 1;
00302         base = file;
00303         base[tmp - file] = '\0';
00304     }
00305 }

bool LaunchDiff | ( | const char * | f1,
 |  | const char * | f2
 | ) |

Launch a diff of two files

Parameters:
f1 | First file name
f2 | Second file name
Returns:
true on success, false otherwise

Definition at line 424 of file CvsCommands.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, cvs_err(), UCvsApp::Execute(), FSSpec, UCvsApp::gApp, and NULL.

Referenced by CvsCmdDiff().

00425 {
00426 #if TARGET_RT_MAC_CFM
00427     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00428     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00429
00430     //  Resourcerer's Compare suite
00431     const   DescType    kAECompareClass = 'Comp';
00432     const   DescType    kAECompareEvent = 'Comp';
00433         const   DescType    keyNewer        = 'kNew';
00434         const   DescType    keyOlder        = 'kOld';
00435         const   DescType    keyShowDiff     = 'kShD';
00436         const   DescType    keyReturnDiff   = 'kRtD';
00437
00438     OSErr               e = noErr;
00439
00440     try {
00441         //  Convert to file specs
00442         Boolean             inShowDiffs = true;
00443         FSSpec              spec1 = GUSIFileSpec (f1);
00444         FSSpec              spec2 = GUSIFileSpec (f2);
00445
00446         //  Find the file type
00447         FInfo   info;
00448         e = ::FSpGetFInfo (&spec2, &info);
00449         ThrowIfOSErr_(e);
00450
00451         //  Decide on the application
00452         OSType              applCreator = FOUR_CHAR_CODE('????');
00453         switch (info.fdType) {
00454             case 'TEXT':
00455                 applCreator = kBBEditDiffCreatorCode;
00456                 break;
00457
00458             default:
00459                 applCreator = kResourcererCreatorCode;
00460                 break;
00461             } // switch
00462
00463         //  Try to launch it
00464         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00465         OSType              applType = FOUR_CHAR_CODE('APPL');
00466         FSSpec              applSpec;
00467         ProcessSerialNumber applPSN;
00468         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00469
00470         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00471             //  Create the parameters
00472         StAEDescriptor  newerDesc (spec1);
00473         StAEDescriptor  olderDesc (spec2);
00474         StAEDescriptor  showDesc (inShowDiffs);
00475
00476             //  Create the event
00477         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00478
00479         StAEDescriptor  diffEvent;
00480         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00481         ThrowIfOSErr_(e);
00482
00483             //  Add the parameters
00484         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00485         ThrowIfOSErr_(e);
00486         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00487         ThrowIfOSErr_(e);
00488         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00489         ThrowIfOSErr_(e);
00490
00491             //  Send the event
00492         UAppleEventsMgr::SendAppleEvent (diffEvent);
00493
00494         return true;
00495         } // try
00496
00497     catch (LException ex) {
00498         } // catch
00499 #endif
00500
00501     if( gCvsPrefs.ExtDiff() == 0L )
00502     {
00503         cvs_err(_i18n("The external diff program is not defined.\n"));
00504         cvs_err(_i18n("You need to set it in the preferences dialog.\n"));
00505         return false;
00506     }
00507
00508 #ifdef WIN32
00509     CString args;
00510     CStr program, file1, file2;
00511
00512     if( strchr(gCvsPrefs.ExtDiff(), ' ') != 0L )
00513     {
00514         program << '\"';
00515         program << gCvsPrefs.ExtDiff();
00516         program << '\"';
00517     }
00518     else
00519         program = gCvsPrefs.ExtDiff();
00520
00521     if( strchr(f1, ' ') != 0L )
00522     {
00523         file1 << '\"';
00524         file1 << f1;
00525         file1 << '\"';
00526     }
00527     else
00528         file1 = f1;
00529
00530     if( strchr(f2, ' ') != 0L )
00531     {
00532         file2 << '\"';
00533         file2 << f2;
00534         file2 << '\"';
00535     }
00536     else
00537         file2 = f2;
00538
00539     args += file1;
00540     args += " ";
00541     args += file2;
00542
00543     CWnd* pMainWnd = AfxGetMainWnd();
00544     HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00545
00546     HINSTANCE hInst = ShellExecute(hParentWnd, NULL, gCvsPrefs.ExtDiff(), args, NULL, SW_SHOWDEFAULT);
00547
00548     if( (UINT)hInst < 32 )
00549     {
00550         // ExtDiff app was not found. Let's try to execute it from
00551         // the application path. However, this is done only when ExtDiff
00552         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00553         if( strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\' )
00554         {
00555             CStr appPath;
00556
00557             ((CWincvsApp*)AfxGetApp())->GetAppPath(appPath);
00558             if( !appPath.endsWith(kPathDelimiter) )
00559                 appPath << kPathDelimiter;
00560
00561             appPath << gCvsPrefs.ExtDiff();
00562
00563             hInst = ShellExecute(hParentWnd, NULL, appPath, args, NULL, SW_SHOWDEFAULT);
00564         }
00565     }
00566
00567     if( (UINT)hInst < 32 )
00568     {
00569         LPVOID lpMsgBuf;
00570         FormatMessage(
00571             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00572             FORMAT_MESSAGE_FROM_SYSTEM |
00573             FORMAT_MESSAGE_IGNORE_INSERTS,
00574             NULL,
00575             GetLastError(),
00576             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00577             (LPTSTR)&lpMsgBuf,
00578             0,
00579             NULL
00580             );
00581
00582         cvs_err(_i18n("Unable to open '%s' (%s), using console instead\n"), (char*)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00583         // Free the buffer.
00584         LocalFree( lpMsgBuf );
00585         return false;
00586     }
00587
00588     return true;
00589 #elif qUnix
00590     CvsArgs args(false);
00591     args.add(gCvsPrefs.ExtDiff());
00592     args.add(f1);
00593     args.add(f2);
00594     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00595     return true;
00596 #elif TARGET_RT_MAC_MACHO
00597     CvsArgs args(false);
00598     args.add(gCvsPrefs.ExtDiff());
00599     args.add(f1);
00600     args.add(f2);
00601     CMacCvsApp::gApp->Execute(args.Argc(), args.Argv());
00602     return true;
00603 #endif
00604 }

bool LaunchEditor | ( | const char * | filePath,
 |  | void * | par
 | ) |

Launch an editor for a file

Parameters:
filePath | File name
par | Return data parameter to return the info about running editor process
Returns:
true on success, false otherwise

Definition at line 685 of file CvsCommands.cpp.

References _i18n, CStr, and cvs_err().

Referenced by CompatGetEditorMsg(), and LaunchViewer().

00686 {
00687     bool res = false;
00688
00689     if( gCvsPrefs.Viewer() == 0L )
00690     {
00691         cvs_err(_i18n("You need to define a default viewer in the preferences\n"));
00692         return false;
00693     }
00694
00695     CStr program, file;
00696
00697     if( strchr(gCvsPrefs.Viewer(), ' ') != 0L )
00698     {
00699         program << '\"';
00700         program << gCvsPrefs.Viewer();
00701         program << '\"';
00702     }
00703     else
00704         program = gCvsPrefs.Viewer();
00705
00706     if( strchr(filePath, ' ') != 0L )
00707     {
00708         file << '\"';
00709         file << filePath;
00710         file << '\"';
00711     }
00712     else
00713         file = filePath;
00714
00715     CStr command;
00716     command << program;
00717     command << " ";
00718     command << file;
00719
00720 #ifdef WIN32
00721     STARTUPINFO sStartupInfo = { 0 };
00722     PROCESS_INFORMATION sProcessInformation = { 0 };
00723
00724     // Execute the command with a call to the CreateProcess API call.
00725     sStartupInfo.cb = sizeof(sStartupInfo);
00726     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00727     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00728
00729     if( !CreateProcess( NULL,
00730         (char*)command,
00731         NULL,
00732         NULL,
00733         FALSE,
00734         0,
00735         NULL,
00736         NULL,
00737         &sStartupInfo,
00738         &sProcessInformation) )
00739     {
00740         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
00741         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
00742     }
00743
00744     if( sProcessInformation.hProcess != INVALID_HANDLE_VALUE )
00745     {
00746         res = true;
00747     }
00748
00749     if( par )
00750     {
00751         *((PROCESS_INFORMATION*)par) = sProcessInformation;
00752     }
00753     else if( res )
00754     {
00755         CloseHandle(sProcessInformation.hProcess);
00756         CloseHandle(sProcessInformation.hThread);
00757     }
00758
00759 #endif /* WIN32 */
00760
00761 #ifdef qMacCvsPP
00762     res = true;
00763 #endif /* qMacCvsPP */
00764
00765 #if qUnix
00766     res = true;
00767 #endif // qUnix
00768
00769     return res;
00770 }

bool LaunchViewer | ( | const char * | filePath,
 |  | bool | useDefault
 | ) |

Launch a viewer for file

Parameters:
filePath | Full path to the file
useDefault | true to use the default viewer, false to use system association
Returns:
true on success, false otherwise

Definition at line 612 of file CvsCommands.cpp.

References _i18n, CStr, cvs_err(), LaunchEditor(), NULL, and SplitPath().

Referenced by CvsCmdAnnotate(), CBrowseFileView::EditSel(), UCvsFiles::EditSel(), and CGraphView::OnQueryAnnotate().

00613 {
00614     bool res = false;
00615
00616 #ifdef WIN32
00617     if( !gCvsPrefs.UseViewerAlways() )
00618     {
00619         CStr folder, file;
00620         SplitPath(filePath, folder, file);
00621
00622         // MSS fix bug with files not being found by FindExecutable
00623         // (see Article ID: Q140724 for the problem desc of FindExecutable)
00624         if( !useDefault )
00625         {
00626             CWnd* pMainWnd = AfxGetMainWnd();
00627             HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00628
00629             HINSTANCE hInst = ShellExecute(hParentWnd, "open", filePath, 0L, folder, SW_SHOWDEFAULT);
00630             if( (long)hInst < 32 )
00631             {
00632                 // If it failed because of no valid association and file has an extension then try the "Open with..." dialog instead
00633                 if( file.rfind('.') &&
00634                     (SE_ERR_NOASSOC == (long)hInst || SE_ERR_ASSOCINCOMPLETE == (long)hInst) )
00635                 {
00636                     SHELLEXECUTEINFO seInfo = { 0 };
00637                     seInfo.cbSize = sizeof(SHELLEXECUTEINFO);
00638                     seInfo.hwnd = hParentWnd;
00639                     seInfo.lpVerb = "openas";
00640                     seInfo.lpFile = filePath;
00641                     seInfo.lpDirectory = folder;
00642
00643                     if( ShellExecuteEx(&seInfo) )
00644                     {
00645                         res = true;
00646                     }
00647                 }
00648             }
00649             else
00650             {
00651                 res = true;
00652             }
00653
00654             if( !res )
00655             {
00656                 cvs_err(_i18n("Unable to open '%s' (error %d), using default viewer instead\n"), (char*)filePath, GetLastError());
00657             }
00658         }
00659     }
00660
00661     if( !res )
00662     {
00663         res = LaunchEditor(filePath);
00664     }
00665
00666 #endif /* WIN32 */
00667
00668 #ifdef qMacCvsPP
00669     res = true;
00670 #endif /* qMacCvsPP */
00671
00672 #if qUnix
00673     res = true;
00674 #endif // qUnix
00675
00676     return res;
00677 }

bool MakeTmpFile | ( | UStr & | file,
 |  | const char * | prefix,
 |  | const char * | extension,
 |  | bool | create
 | ) |

Find a unique name for a temporary file

Parameters:
file | Return temporary file name
prefix | Prefix of the filename
extension | Extension of the filename
create | Set to true to create the file
Returns:
true on success, false otherwise

Definition at line 174 of file CvsCommands.cpp.

References _i18n, CStr, cvs_err(), err, getenv, MacGetTempFolder(), MAX_PATH, stat, and UFSSpec.

Referenced by CompatGetEditorMsg(), and launchCVS().

00175 {
00176     static int count = 0;
00177     char filename[MAX_PATH];
00178
00179     CStr tmpPath;
00180     CStr ext;
00181     CStr prf;
00182
00183     if( extension != 0L && extension[0] != '\0' )
00184     {
00185         if( extension[0] != '.' )
00186             ext = ".";
00187
00188         ext << extension;
00189     }
00190
00191     if( prefix != 0L && prefix[0] != '\0' )
00192     {
00193         prf = prefix;
00194     }
00195     else
00196     {
00197         prf = "cvsgui";
00198     }
00199
00200 #ifdef WIN32
00201     char* ptr;
00202     ptr = getenv(_T("TMP"));
00203     if( ptr != 0L && _access(ptr, 0) != -1 )
00204     {
00205         tmpPath = ptr;
00206     }
00207     else
00208     {
00209         tmpPath = ".";
00210     }
00211 #endif /* !WIN32 */
00212 #ifdef TARGET_OS_MAC
00213     UFSSpec theFolder;
00214     OSErr err;
00215
00216     if( (err = MacGetTempFolder(theFolder, tmpPath)) != noErr )
00217     {
00218         cvs_err(_i18n("Unable to locate the preferences folder (error %d) !\n"), err);
00219         return 0L;
00220     }
00221
00222 #if !TARGET_RT_MAC_MACHO  // no problems with long file names on Mac OS X...
00223     for( ; ; )
00224     {
00225         sprintf(filename, "%s%d%s", (const char*)prf, count, (const char*)ext);
00226         if( ::strlen(filename) <= 31 )
00227             break;
00228
00229         if( prf.length() == 0 )
00230         {
00231             cvs_err(_i18n("Unable to truncate temp file !\n"));
00232             return 0L;
00233         }
00234
00235         prf.set (prf, prf.length () - 1);
00236     }
00237 #endif // !TARGET_RT_MAC_MACHO
00238 #endif /* !TARGET_OS_MAC */
00239 #if qUnix
00240     tmpPath = "/tmp";
00241 #endif
00242
00243     struct stat sb;
00244     if( stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode) )
00245     {
00246         cvs_err(_i18n("Unable to access '%s' (error %d) !\n"), (const char*)tmpPath, errno);
00247         return false;
00248     }
00249
00250     if( !tmpPath.endsWith(kPathDelimiter) )
00251         tmpPath << kPathDelimiter;
00252
00253     int maxtry = 10000;
00254     while( true )
00255     {
00256         sprintf(filename, "%s%d%s", (const char*)prf, count++, (const char*)ext);
00257         file = tmpPath;
00258         file << filename;
00259
00260         if( stat(file, &sb) == -1 && errno == ENOENT )
00261         {
00262             if( create )
00263             {
00264                 FILE* stream = fopen(file, "w");
00265                 if( stream )
00266                 {
00267                     fclose(stream);
00268                 }
00269             }
00270
00271             return true;
00272         }
00273
00274         if( maxtry-- == 0 )
00275         {
00276             cvs_err(_i18n("Time out to access '%s' !\n"), (const char*)tmpPath);
00277             break;
00278         }
00279     }
00280
00281     return false;
00282 }

bool SplitPath | ( | const char * | dir,
 |  | UStr & | uppath,
 |  | UStr & | folder,
 |  | bool | dontSkipDelimiter
 | ) |

Split the path into the up-directory and the folder

Parameters:
dir | Path to be split
uppath | Return up-directory
folder | Return folder or file
dontSkipDelimiter | Set to true to prevent skipping the delimiter if the path to be split ends with one
Returns:
true on success, false otherwise
Note:
Passing NULL is considered an error, passing empty string returns true

Definition at line 124 of file CvsCommands.cpp.

References MAX_PATH.

Referenced by BrowserGetDirectory(), BrowserGetMultiFiles(), CompatGetEditorMsg(), CompatGetImport(), CvsCmdAdd(), CvsCmdRelease(), USaveSettings::DoDataExchange(), FormatMenuString(), getLoc(), CTCLBrowserEnt::GetNormalized(), getSettingName(), LaunchItemListCommand(), LaunchViewer(), CWincvsApp::LookForResourceFile(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUpone(), CGetPrefs_WINCVS::OnExtdiffsel(), CWinCvsBrowser::OnUpdateMacro(), and CHistComboBoxEx::SetIcon().

00125 {
00126     char newDir[MAX_PATH * 2] = "";
00127     char oldDir[MAX_PATH * 2] = "";
00128     char newFile[MAX_PATH] = "";
00129
00130     if( !dir )
00131     {
00132         // Null pointer
00133         return false;
00134     }
00135
00136     int dirLen = strlen(dir);
00137     if( dirLen > 0 )
00138     {
00139         strcpy(oldDir, dir);
00140
00141         if( !dontSkipDelimiter && (dir[dirLen - 1] == kPathDelimiter) )
00142         {
00143             oldDir[dirLen - 1] = '\0';
00144             --dirLen;
00145         }
00146
00147         const char* tmp = oldDir;
00148         const char* prev = oldDir;
00149
00150         while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
00151         {
00152             prev = ++tmp;
00153         }
00154
00155         strcpy(newDir, oldDir);
00156         newDir[prev - oldDir] = '\0';
00157         strcpy(newFile, prev);
00158     }
00159
00160     uppath = newDir;
00161     folder = newFile;
00162
00163     return true;
00164 }

int StringToArgv | ( | const char * | cmdLine,
 |  | char ** | argv
 | ) |

Convert a command line (possibly quoted) into regular argc, argv arguments

Parameters:
cmdLine | Command line
argv | Return argv arguments
Returns:
The count of arguments (argc)

Definition at line 341 of file CvsCommands.cpp.

References MAX_ARGS, and MAX_CMD_LEN.

Referenced by CvsCmdCommandLine().

00342 {
00343     int argc = 0;
00344
00345     char Quote = '\0';              /*  Contains the quote character if we are inside "" or '', or \0 otherwise */
00346     const char* walker1 = cmdLine;  /*  walker1 traverses the original command line */
00347     char* walker2;                  /*  walker2 traverses the parsed copy of the commandline */
00348     char theChar;                   /*  theChar is the character we are currently parsing */
00349     char arguments[MAX_CMD_LEN];    /*  Will contain a parsed copy of the command line */
00350
00351     /* Copy into arguments */
00352     walker2 = arguments;
00353
00354     /* Parse command line to \0 */
00355     while( (theChar = *walker1++) != '\0' )
00356     {
00357         /* Skip leading space before an argument */
00358         if( theChar == ' ' )
00359             continue;
00360
00361         /* Set argv to point to the space where we copy the next argument */
00362         argv [argc++] = walker2;
00363
00364         /* If we filled argv, skip the rest */
00365         if( argc > MAX_ARGS)
00366         {
00367             argc--;
00368             break;
00369         }
00370
00371         do
00372         {
00373             /* Parse an argument skip \s */
00374             if( theChar == '\\' && *walker1++ )
00375             {
00376                 theChar = *walker1++;
00377             }
00378             else
00379             {
00380                 /* When we find a quote... */
00381                 if( theChar == '"' || theChar == '\'' )
00382                 {
00383                     /* If we are not inside quotes already, */
00384                     if( Quote == '\0' )
00385                     {
00386                         /* Remember we are inside quotes now */
00387                         Quote = theChar;
00388
00389                         /* Go to the next character */
00390                         continue;
00391                     }
00392
00393                     /* If we are already inside that kind of quotes */
00394                     if( theChar == Quote )
00395                     {
00396                         /* Close quotes */
00397                         Quote = '\0';
00398
00399                         /* Go to the next character */
00400                         continue;
00401                     }
00402                 }
00403             }
00404
00405             /* Copy the character into args */
00406             *walker2++ = theChar;
00407
00408             /* Repeat until we reach the end of arguments or we reach a space that is not inside quotes */
00409         }while( (*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')) );
00410
00411         /* Null-terminate the last argument */
00412         *walker2++ = 0;
00413     }
00414
00415     return argc;
00416 }

Generated on Fri Jan 31 12:09:37 2003 for WinCvs Source by doxygen 1.3-rc2


CvsEntries.cpp File Reference

common/CvsEntries.cpp File Reference

#include "stdafx.h"
#include <stdlib.h>
#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
#include <sstream>
#include <algorithm>
#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
#define | NAMESPACE(w) ::

Functions

time_t | GetDateTime (const char *strTime)
const char * | CloneStr (const char *cp)
void | DisposeStr (const char *cp)
EntnodeData * | GetNextEntriesLine (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)

Variables

::string | gStrMonths [] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
Months table used to parse the date string.

Define Documentation

#define NAMESPACE ( w ) ::

Definition at line 72 of file CvsEntries.cpp.

Referenced by CMMenuString::GetData(), TMString< T >::GetData(), GetDateTime(), TMString< T >::Insert(), CCommit_MAIN::OnSelchangeCombo(), CCmdLine_MAIN::OnSelchangePrevcmd(), TMString< T >::Remove(), CMMenuString::SizeOf(), and TMString< T >::SizeOf().

#define NEW new

Definition at line 65 of file CvsEntries.cpp.

Referenced by Entries_SetVisited(), and GetNextEntriesLine().

Function Documentation

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

Clone the string

Parameters:
cp String to be cloned
Returns:
Pointer to the cloned string
Note:
You must release memory allocated for the string

Definition at line 147 of file CvsEntries.cpp.

References strdup().

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

00148 {
00149     if( cp && *cp )
00150     {
00151         cp = strdup(cp);
00152         if( !cp )
00153         {
00154             throw std::bad_alloc();
00155         }
00156     }
00157     else
00158     {
00159         cp = 0L;
00160     }
00161
00162     return cp;
00163 }

void DisposeStr ( const char * cp ) [static]

Dispose cloned string

Parameters:
cp Pointer to the cloned string to be released

Definition at line 169 of file CvsEntries.cpp.

References free.

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

00170 {
00171     if( cp )
00172     {
00173         free((void*)cp);
00174     }
00175 }

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

Read the entries file into a list, hashing on the file name

Parameters:
entries | Return file list
fullpath | Path to read files from
Returns:
true on success, false otherwise
Note:
UPDATE_DIR is the name of the current directory, for use in error messages, or NULL if not known (that is, no-one has gotten around to updating the caller to pass in the information)

Definition at line 498 of file CvsEntries.cpp.

References cvs_err(), CSortList< T >::Delete(), UStr::endsWith(), GetNextEntriesLine(), CSortList< T >::InsideAndInsert(), CSortList< T >::Reset(), and EntnodeData::UnRef().

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

00499 {
00500     EntnodeData* ent;
00501
00502     UStr adminPath(fullpath);
00503     if( !adminPath.endsWith(kPathDelimiter) )
00504         adminPath << kPathDelimiter;
00505
00506     adminPath << "CVS";
00507     adminPath << kPathDelimiter;
00508
00509     entries.Reset();
00510
00511     UStr filename = adminPath;
00512     filename << "Entries";
00513
00514     FILE* fpin = fopen(filename, "r");
00515     if( fpin == 0L )
00516         return false;
00517
00518     while( (ent = GetNextEntriesLine(fpin, fullpath)) != 0L )
00519     {
00520         ENTNODE newnode(ent);
00521         ent->UnRef();
00522
00523         if( entries.InsideAndInsert(newnode) )
00524         {
00525             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n", fullpath);
00526         }
00527     }
00528
00529     fclose(fpin);
00530
00531     filename = adminPath;
00532     filename << "Entries.log";
00533
00534     fpin = fopen(filename, "r");
00535     if( fpin != 0L )
00536     {
00537         char cmd;
00538
00539         while( (ent = GetNextEntriesLine(fpin, &cmd)) != 0L )
00540         {
00541             ENTNODE newnode(ent);
00542             ent->UnRef();
00543
00544             switch (cmd)
00545             {
00546             case 'A':
00547                 if(entries.InsideAndInsert(newnode))
00548                 {
00549                     // don't care
00550                 }
00551                 break;
00552             case 'R':
00553                 entries.Delete(newnode);
00554                 break;
00555             default:
00556                 /* Ignore unrecognized commands.  */
00557                 break;
00558             }
00559         }
00560
00561         fclose(fpin);
00562     }
00563
00564     return true;
00565 }

void Entries_SetMissing ( CSortList< ENTNODE > & entries )

Mark the missing entries

Parameters:
entries Entries list
Returns:
true on success, false otherwise
Note:
Called after the traversal marks the entries that didn't have "Entries_SetVisited" call associated

Definition at line 768 of file CvsEntries.cpp.

References ENTNODE::Data(), CSortList< T >::Get(), EntnodeData::IsRemoved(), EntnodeData::IsVisited(), CSortList< T >::NumOfElements(), EntnodeData::SetDesc(), and EntnodeData::SetMissing().

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

00769 {
00770     int numEntries = entries.NumOfElements();
00771     for(int i = 0; i < numEntries; i++)
00772     {
00773         const ENTNODE& theNode = entries.Get(i);
00774         EntnodeData* data = theNode.Data();
00775
00776         if( data->IsVisited() )
00777             continue;
00778
00779         data->SetMissing(true);
00780         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00781     }
00782 }

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

Fill an ENTNODE when the file appears on the disk

Parameters:
path | Path
entries | Entries list
name | Filename
finfo | File stat info
isFolder | true for folder, false otherwise
ignlist | Ignore list
Returns:
The reference to the node
Note:
It sets some flags like "visited", "unknown", "ignored" etc.

Definition at line 619 of file CvsEntries.cpp.

References CStr, cvs_err(), ENTNODE::Data(), CSortList< T >::Get(), GetWinCvsDebugMaskBit(), CSortList< T >::InsideAndInsert(), EntnodeData::IsIgnored(), EntnodeData::IsUnknown(), EntnodeFile::kOption, EntnodeFile::kTS, MatchIgnoredList(), NEW, EntnodeData::SetDesc(), EntnodeData::SetIgnored(), EntnodeData::SetUnknown(), EntnodeData::SetVisited(), stat, unmodified(), EntnodeData::UnRef(), and EntnodePath::UnRef().

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

00621 {
00622     int index;
00623     bool isCvs = false;
00624
00625     EntnodePath* thePath = new EntnodePath(path);
00626
00627     if( isFolder )
00628     {
00629         EntnodeFolder* adata = NEW EntnodeFolder(name, thePath);
00630         ENTNODE anode(adata);
00631         adata->UnRef();
00632         isCvs = entries.InsideAndInsert(anode, &index);
00633     }
00634     else
00635     {
00636         EntnodeFile* adata = NEW EntnodeFile(name, thePath);
00637         ENTNODE anode(adata);
00638         adata->UnRef();
00639         isCvs = entries.InsideAndInsert(anode, &index);
00640     }
00641
00642     thePath->UnRef();
00643
00644     const ENTNODE& theNode = entries.Get(index);
00645     EntnodeData* data = theNode.Data();
00646     data->SetVisited(true);
00647
00648     if( !isCvs )
00649     {
00650         data->SetUnknown(true);
00651         if( ignlist != 0L && MatchIgnoredList(name, *ignlist) )
00652             data->SetIgnored(true);
00653
00654         // the folder may have some cvs informations in it, despite the fact
00655         // that it is not referenced by the parent directory, so try
00656         // to figure it.
00657
00658         if( !data->IsIgnored() )
00659         {
00660             CStr cvsFile(path);
00661             if( !cvsFile.endsWith(kPathDelimiter) )
00662                 cvsFile << kPathDelimiter;
00663
00664             cvsFile << name;
00665             if( !cvsFile.endsWith(kPathDelimiter) )
00666                 cvsFile << kPathDelimiter;
00667
00668             cvsFile << "CVS";
00669             struct stat sb;
00670             if( stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode) )
00671             {
00672                 data->SetUnknown(false);
00673             }
00674         }
00675     }
00676
00677     if( isFolder )
00678     {
00679         if( data->IsIgnored() )
00680         {
00681             data->SetDesc("Ignored Folder");
00682         }
00683         else if( data->IsUnknown() )
00684         {
00685             data->SetDesc("NonCvs Folder");
00686         }
00687         else
00688         {
00689             data->SetDesc("Folder");
00690         }
00691     }
00692     else
00693     {
00694         const char* ts = (*data)[EntnodeFile::kTS];
00695         if( ts == 0L )
00696             data->SetUnmodified(true);
00697         else
00698             data->SetUnmodified(unmodified(finfo, ts));
00699
00700 #if defined(WIN32)
00701         if( GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit) )
00702         {
00703             char scratch[128];
00704
00705             /* copied from unmodified... */
00706             char* cp;
00707             struct tm* tm_p;
00708             struct tm local_tm;
00709             tm_p = gmtime(&finfo.st_mtime);
00710             if( tm_p )
00711             {
00712                 memcpy(&local_tm, tm_p, sizeof(local_tm));
00713                 cp = asctime(&local_tm);    /* copy in the modify time */
00714             }
00715             else
00716             {
00717                 cp = "NULL";
00718             }
00719
00720             _snprintf(scratch, 128,
00721                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00722                 name, ts, cp,
00723                 data->IsUnmodified() ? "unmodified" : "modified");
00724
00725             cvs_err(scratch);
00726             OutputDebugString(scratch);
00727         }
00728 #endif
00729
00730         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00731
00732         const char* info = 0L;
00733         if( data->IsIgnored() )
00734         {
00735             data->SetDesc("Ignored");
00736         }
00737         else if( data->IsUnknown() )
00738         {
00739             data->SetDesc("NonCvs file");
00740         }
00741         else if( data->GetConflict() != 0L )
00742         {
00743             data->SetDesc("Conflict");
00744         }
00745         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0 )
00746         {
00747             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00748         }
00749         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0 )
00750         {
00751             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00752         }
00753         else
00754         {
00755             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00756         }
00757     }
00758
00759     return data;
00760 }

time_t GetDateTime ( const char * strTime )

Extract the date-time information from the string

Parameters:
strTime Date-time string as returned by asctime function (CVS/Entries file format)
Returns:
The date-time as time_t value or (time_t)-1 as returned by mktime

Definition at line 87 of file CvsEntries.cpp.

References ASSERT, gStrMonths, and NAMESPACE.

Referenced by KoDateColumn::Compare(), and CItemListDlg::CompareItems().

00088 {
00089     struct tm tmTime = { 0 };
00090
00091     NAMESPACE(std) string stringTime = strTime;
00092
00093     if( stringTime.empty() )
00094     {
00095         return -1;
00096     }
00097
00098     // Replace the time separator with spaces to help with parsing
00099     replace(stringTime.begin(), stringTime.end(), ':', ' ');
00100
00101     // Parse
00102     NAMESPACE(std) stringstream parser;
00103     parser << stringTime;
00104
00105     NAMESPACE(std) string strDay;
00106     NAMESPACE(std) string strMonth;
00107
00108     parser >> strDay;
00109     parser >> strMonth;
00110     {
00111         // Find out the month
00112         tmTime.tm_mon = -1;
00113         NAMESPACE(std) string* month = find(gStrMonths, gStrMonths + 12, strMonth);
00114
00115         if( month != gStrMonths + 12 )
00116         {
00117             tmTime.tm_mon = month - gStrMonths;
00118         }
00119         else
00120         {
00121 #ifdef WIN32
00122             ASSERT(FALSE);  // unknown month
00123 #endif
00124             return -1;
00125         }
00126     }
00127
00128     parser >> tmTime.tm_mday;
00129     parser >> tmTime.tm_hour;
00130     parser >> tmTime.tm_min;
00131     parser >> tmTime.tm_sec;
00132
00133     parser >> tmTime.tm_year;
00134     tmTime.tm_year -= 1900;
00135
00136     tmTime.tm_isdst = -1;
00137
00138     return mktime(&tmTime);
00139 }

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

Get the next real Entries line

Parameters:
fpin | File
path | Path
cmd | Command
Returns:
The next real Entries line or NULL on end of file
Note:
On error, prints an error message and returns NULL

Definition at line 384 of file CvsEntries.cpp.

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

Referenced by Entries_Open().

00385 {
00386     EntnodeData* ent;
00387     char* line = 0L;
00388     size_t line_chars_allocated = 0;
00389     register char* cp;
00390     ent_type type;
00391     char* l, *user, *vn, *ts, *options;
00392     char* tag_or_date, *tag, *date, *ts_conflict;
00393     int line_length;
00394
00395     EntnodePath* thePath = new EntnodePath(path);
00396
00397     ent = 0L;
00398     while( (line_length = getline(&line, &line_chars_allocated, fpin)) > 0 )
00399     {
00400         l = line;
00401
00402         /* If CMD is not NULL, we are reading an Entries.Log file.
00403         Each line in the Entries.Log file starts with a single
00404         character command followed by a space.  For backward
00405         compatibility, the absence of a space indicates an add
00406         command.  */
00407         if( cmd != 0L )
00408         {
00409             if( l[1] != ' ' )
00410                 *cmd = 'A';
00411             else
00412             {
00413                 *cmd = l[0];
00414                 l += 2;
00415             }
00416         }
00417
00418         type = ENT_FILE;
00419
00420         if( l[0] == 'D' )
00421         {
00422             type = ENT_SUBDIR;
00423             ++l;
00424             /* An empty D line is permitted; it is a signal that this
00425             Entries file lists all known subdirectories.  */
00426         }
00427
00428         if( l[0] != '/' )
00429             continue;
00430
00431         user = l + 1;
00432         if( (cp = strchr (user, '/')) == 0L )
00433             continue;
00434
00435         *cp++ = '\0';
00436         vn = cp;
00437         if( (cp = strchr (vn, '/')) == 0L )
00438             continue;
00439
00440         *cp++ = '\0';
00441         ts = cp;
00442         if( (cp = strchr (ts, '/')) == 0L )
00443             continue;
00444
00445         *cp++ = '\0';
00446         options = cp;
00447         if( (cp = strchr (options, '/')) == 0L )
00448             continue;
00449
00450         *cp++ = '\0';
00451         tag_or_date = cp;
00452
00453         if( (cp = strchr (tag_or_date, '\n')) == 0L
00454 #ifdef TARGET_OS_MAC
00455             && (cp = strchr (tag_or_date, '\r')) == 0L
00456 #endif
00457         )
00458             continue;
00459
00460         *cp = '\0';
00461         tag = (char*) 0L;
00462         date = (char*) 0L;
00463         if( *tag_or_date == 'T' )
00464             tag = tag_or_date + 1;
00465         else if( *tag_or_date == 'D' )
00466             date = tag_or_date + 1;
00467
00468         if( (ts_conflict = strchr (ts, '+')) )
00469             *ts_conflict++ = '\0';
00470
00471         if( type == ENT_SUBDIR )
00472             ent = NEW EntnodeFolder(user, thePath);
00473         else
00474             ent = NEW EntnodeFile(user, thePath, vn, ts, options, tag, date, ts_conflict);
00475
00476         break;
00477     }
00478
00479     if( line_length < 0 && !feof(fpin) )
00480         cvs_err("Cannot read entries file (error %d)\n", errno);
00481
00482     free(line);
00483
00484     thePath->UnRef();
00485
00486     return ent;
00487 }

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

Read the tag file

Parameters:
tag | Return tag
fullpath | Path
Returns:
false if no CVS/Tag, true otherwise

Definition at line 790 of file CvsEntries.cpp.

References CStr, cvs_err(), free, and getline().

Referenced by TViewFill::OnDirectory().

00791 {
00792     tag = "";
00793     CStr tagFile(fullpath);
00794     if( !tagFile.endsWith(kPathDelimiter) )
00795         tagFile << kPathDelimiter;
00796
00797     tagFile << "Tag";
00798
00799     FILE* fpin = fopen(tagFile, "r");
00800     if( fpin == 0L )
00801         return false;
00802
00803     char* line = 0L;
00804     size_t line_chars_allocated = 0;
00805     int line_length;
00806     if( (line_length = getline(&line, &line_chars_allocated, fpin)) > 0 )
00807     {
00808         char* tmp = strchr(line, '\n');
00809         if( tmp != 0L )
00810             *tmp = '\0';
00811
00812         if( line[0] == 'T' )
00813             tag = line + 1;
00814     }
00815
00816     if( line != 0L )
00817         free(line);
00818
00819     if( line_length < 0 && !feof(fpin) )
00820     {
00821         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00822         return false;
00823     }
00824
00825     fclose(fpin);
00826
00827     return !tag.empty();
00828 }

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

Verify that file is not modified

Parameters:
sb | Stat information
ts | Timestamp
Returns:
true if file is unmodified, false otherwise
Note:
Contains the work-around for DST bug

Definition at line 574 of file CvsEntries.cpp.

Referenced by EntnodeData::EntnodeData(), and Entries_SetVisited().

00575 {
00576     char* cp;
00577     struct tm* tm_p;
00578     struct tm local_tm;
00579
00580     /* We want to use the same timestamp format as is stored in the
00581     st_mtime.  For unix (and NT I think) this *must* be universal
00582     time (UT), so that files don't appear to be modified merely
00583     because the timezone has changed.  For VMS, or hopefully other
00584     systems where gmtime returns NULL, the modification time is
00585     stored in local time, and therefore it is not possible to cause
00586     st_mtime to be out of sync by changing the timezone.  */
00587
00588     tm_p = gmtime(&sb.st_mtime);
00589     if( tm_p )
00590     {
00591         memcpy(&local_tm, tm_p, sizeof (local_tm));
00592         cp = asctime(&local_tm);    /* copy in the modify time */
00593     }
00594     else
00595         cp = ctime(&sb.st_mtime);
00596
00597     cp[24] = 0;
00598
00599     /* Deal with the differences in timestamps - POSIX uses space filled, NT uses zero filled */
00600     if( cp[8]=='0' && ts[8]==' ' )
00601         cp[8]=' ';
00602     if( cp[8]==' ' && ts[8]=='0' )
00603         cp[8]='0';
00604
00605     return strcmp(cp, ts) == 0;
00606 }

Variable Documentation

:: string gStrMonths[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}

Months table used to parse the date string.

Definition at line 80 of file CvsEntries.cpp.

Referenced by GetDateTime().

Generated on Fri Jan 31 12:09:37 2003 for WinCvs Source by doxygen 1.3-rc2


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
Allow reference of a file or a folder node. More...

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

Enumerations

enum ent_type {
ENT_FILE,
ENT_SUBDIR
}
Entry type enum. More...

Functions

time_t | GetDateTime (const char *strTime)
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

Entry type enum.

Enumeration values:
ENT_FILE | File entry
ENT_SUBDIR | Directory entry

Definition at line 36 of file CvsEntries.h.

Referenced by GetNextEntriesLine(), EntnodeFolder::GetType(), and EntnodeFile::GetType().

00037 {
00038     ENT_FILE,
00039     ENT_SUBDIR
00040 } ent_type;

Function Documentation

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

Read the entries file into a list, hashing on the file name

Parameters:
entries | Return file list
fullpath | Path to read files from
Returns:
true on success, false otherwise
Note:
UPDATE_DIR is the name of the current directory, for use in error messages, or NULL if not known (that is, no-one has gotten around to updating the caller to pass in the information)

Definition at line 498 of file CvsEntries.cpp.

References cvs_err(), CSortList< T >::Delete(), UStr::endsWith(), GetNextEntriesLine(), CSortList< T >::InsideAndInsert(), CSortList< T >::Reset(), and EntnodeData::UnRef().

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

00499 {
00500     EntnodeData* ent;
00501
00502     UStr adminPath(fullpath);
00503     if( !adminPath.endsWith(kPathDelimiter) )
00504         adminPath << kPathDelimiter;
00505
00506     adminPath << "CVS";
00507     adminPath << kPathDelimiter;
00508
00509     entries.Reset();
00510
00511     UStr filename = adminPath;
00512     filename << "Entries";
00513
00514     FILE* fpin = fopen(filename, "r");
00515     if( fpin == 0L )
00516         return false;
00517
00518     while( (ent = GetNextEntriesLine(fpin, fullpath)) != 0L )
00519     {
00520         ENTNODE newnode(ent);
00521         ent->UnRef();
00522
00523         if( entries.InsideAndInsert(newnode) )
00524         {
00525             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n", fullpath);
00526         }
00527     }
00528
00529     fclose(fpin);
00530
00531     filename = adminPath;
00532     filename << "Entries.log";
00533
00534     fpin = fopen(filename, "r");
00535     if( fpin != 0L )
00536     {
00537         char cmd;
00538
00539         while( (ent = GetNextEntriesLine(fpin, &cmd)) != 0L )
00540         {
00541             ENTNODE newnode(ent);
00542             ent->UnRef();
00543
00544             switch (cmd)
00545             {
00546             case 'A':
00547                 if(entries.InsideAndInsert(newnode))
00548                 {
00549                     // don't care
00550                 }
00551                 break;
00552             case 'R':
00553                 entries.Delete(newnode);
00554                 break;
00555             default:
00556                 /* Ignore unrecognized commands.  */
00557                 break;
00558             }
00559         }
00560
00561         fclose(fpin);
00562     }
00563
00564     return true;
00565 }

void Entries_SetMissing ( CSortList< ENTNODE > & entries )

Mark the missing entries

Parameters:
entries Entries list
Returns:
true on success, false otherwise
Note:
Called after the traversal marks the entries that didn't have "Entries_SetVisited" call associated

Definition at line 768 of file CvsEntries.cpp.

References ENTNODE::Data(), CSortList< T >::Get(), EntnodeData::IsRemoved(), EntnodeData::IsVisited(), CSortList< T >::NumOfElements(), EntnodeData::SetDesc(), and EntnodeData::SetMissing().

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

00769 {
00770     int numEntries = entries.NumOfElements();
00771     for(int i = 0; i < numEntries; i++)
00772     {
00773         const ENTNODE& theNode = entries.Get(i);
00774         EntnodeData* data = theNode.Data();
00775
00776         if( data->IsVisited() )
00777             continue;
00778
00779         data->SetMissing(true);
00780         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00781     }
00782 }

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

Fill an ENTNODE when the file appears on the disk

Parameters:
path | Path
entries | Entries list
name | Filename
finfo | File stat info
isFolder | true for folder, false otherwise
ignlist | Ignore list
Returns:
The reference to the node
Note:
It sets some flags like "visited", "unknown", "ignored" etc.

Definition at line 619 of file CvsEntries.cpp.

References CStr, cvs_err(), ENTNODE::Data(), CSortList< T >::Get(), GetWinCvsDebugMaskBit(), CSortList< T >::InsideAndInsert(), EntnodeData::IsIgnored(), EntnodeData::IsUnknown(), EntnodeFile::kOption, EntnodeFile::kTS, MatchIgnoredList(), NEW, EntnodeData::SetDesc(), EntnodeData::SetIgnored(), EntnodeData::SetUnknown(), EntnodeData::SetVisited(), stat, unmodified(), EntnodePath::UnRef(), and EntnodeData::UnRef().

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

00621 {
00622     int index;
00623     bool isCvs = false;
00624
00625     EntnodePath* thePath = new EntnodePath(path);
00626
00627     if( isFolder )
00628     {
00629         EntnodeFolder* adata = NEW EntnodeFolder(name, thePath);
00630         ENTNODE anode(adata);
00631         adata->UnRef();
00632         isCvs = entries.InsideAndInsert(anode, &index);
00633     }
00634     else
00635     {
00636         EntnodeFile* adata = NEW EntnodeFile(name, thePath);
00637         ENTNODE anode(adata);
00638         adata->UnRef();
00639         isCvs = entries.InsideAndInsert(anode, &index);
00640     }
00641
00642     thePath->UnRef();
00643
00644     const ENTNODE& theNode = entries.Get(index);
00645     EntnodeData* data = theNode.Data();
00646     data->SetVisited(true);
00647
00648     if( !isCvs )
00649     {
00650         data->SetUnknown(true);
00651         if( ignlist != 0L && MatchIgnoredList(name, *ignlist) )
00652             data->SetIgnored(true);
00653
00654         // the folder may have some cvs informations in it, despite the fact
00655         // that it is not referenced by the parent directory, so try
00656         // to figure it.
00657
00658         if( !data->IsIgnored() )
00659         {
00660             CStr cvsFile(path);
00661             if( !cvsFile.endsWith(kPathDelimiter) )
00662                 cvsFile << kPathDelimiter;
00663
00664             cvsFile << name;
00665             if( !cvsFile.endsWith(kPathDelimiter) )
00666                 cvsFile << kPathDelimiter;
00667
00668             cvsFile << "CVS";
00669             struct stat sb;
00670             if( stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode) )
00671             {
00672                 data->SetUnknown(false);
00673             }
00674         }
00675     }
00676
00677     if( isFolder )
00678     {
00679         if( data->IsIgnored() )
00680         {
00681             data->SetDesc("Ignored Folder");
00682         }
00683         else if( data->IsUnknown() )
00684         {
00685             data->SetDesc("NonCvs Folder");
00686         }
00687         else
00688         {
00689             data->SetDesc("Folder");
00690         }
00691     }
00692     else
00693     {
00694         const char* ts = (*data)[EntnodeFile::kTS];
00695         if( ts == 0L )
00696             data->SetUnmodified(true);
00697         else
00698             data->SetUnmodified(unmodified(finfo, ts));
00699
00700 #if defined(WIN32)
00701         if( GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit) )
00702         {
00703             char scratch[128];
00704
00705             /* copied from unmodified... */
00706             char* cp;
00707             struct tm* tm_p;
00708             struct tm local_tm;
00709             tm_p = gmtime(&finfo.st_mtime);
00710             if( tm_p )
00711             {
00712                 memcpy(&local_tm, tm_p, sizeof(local_tm));
00713                 cp = asctime(&local_tm);    /* copy in the modify time */
00714             }
00715             else
00716             {
00717                 cp = "NULL";
00718             }
00719
00720             _snprintf(scratch, 128,
00721                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00722                 name, ts, cp,
00723                 data->IsUnmodified() ? "unmodified" : "modified");
00724
00725             cvs_err(scratch);
00726             OutputDebugString(scratch);
00727         }
00728 #endif
00729
00730         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00731
00732         const char* info = 0L;
00733         if( data->IsIgnored() )
00734         {
00735             data->SetDesc("Ignored");
00736         }
00737         else if( data->IsUnknown() )
00738         {
00739             data->SetDesc("NonCvs file");
00740         }
00741         else if( data->GetConflict() != 0L )
00742         {
00743             data->SetDesc("Conflict");
00744         }
00745         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0 )
00746         {
00747             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00748         }
00749         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0 )
00750         {
00751             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00752         }
00753         else
00754         {
00755             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00756         }
00757     }
00758
00759     return data;
00760 }

time_t GetDateTime ( const char * strTime )

Extract the date-time information from the string

Parameters:
strTime Date-time string as returned by asctime function (CVS/Entries file format)
Returns:
The date-time as time_t value or (time_t)-1 as returned by mktime

Definition at line 87 of file CvsEntries.cpp.

References ASSERT, gStrMonths, and NAMESPACE.

Referenced by KoDateColumn::Compare(), and CItemListDlg::CompareItems().

00088 {
00089     struct tm tmTime = { 0 };
00090
00091     NAMESPACE(std) string stringTime = strTime;
00092
00093     if( stringTime.empty() )
00094     {
00095         return -1;
00096     }
00097
00098     // Replace the time separator with spaces to help with parsing
00099     replace(stringTime.begin(), stringTime.end(), ':', ' ');
00100
00101     // Parse
00102     NAMESPACE(std) stringstream parser;
00103     parser << stringTime;
00104
00105     NAMESPACE(std) string strDay;
00106     NAMESPACE(std) string strMonth;
00107
00108     parser >> strDay;
00109     parser >> strMonth;
00110     {
00111         // Find out the month
00112         tmTime.tm_mon = -1;
00113         NAMESPACE(std) string* month = find(gStrMonths, gStrMonths + 12, strMonth);
00114
00115         if( month != gStrMonths + 12 )
00116         {
00117             tmTime.tm_mon = month - gStrMonths;
00118         }
00119         else
00120         {
00121 #ifdef WIN32
00122             ASSERT(FALSE);  // unknown month
00123 #endif
00124             return -1;
00125         }
00126     }
00127
00128     parser >> tmTime.tm_mday;
00129     parser >> tmTime.tm_hour;
00130     parser >> tmTime.tm_min;
00131     parser >> tmTime.tm_sec;
00132
00133     parser >> tmTime.tm_year;
00134     tmTime.tm_year -= 1900;
00135
00136     tmTime.tm_isdst = -1;
00137
00138     return mktime(&tmTime);
00139 }

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

Read the tag file

Parameters:
tag | Return tag
fullpath | Path
Returns:
false if no CVS/Tag, true otherwise

Definition at line 790 of file CvsEntries.cpp.

References CStr, cvs_err(), free, and getline().

Referenced by TViewFill::OnDirectory().

00791 {
00792     tag = "";
00793     CStr tagFile(fullpath);
00794     if( !tagFile.endsWith(kPathDelimiter) )
00795         tagFile << kPathDelimiter;
00796
00797     tagFile << "Tag";
00798
00799     FILE* fpin = fopen(tagFile, "r");
00800     if( fpin == 0L )
00801         return false;
00802
00803     char* line = 0L;
00804     size_t line_chars_allocated = 0;
00805     int line_length;
00806     if( (line_length = getline(&line, &line_chars_allocated, fpin)) > 0 )
00807     {
00808         char* tmp = strchr(line, '\n');
00809         if( tmp != 0L )
00810             *tmp = '\0';
00811
00812         if( line[0] == 'T' )
00813             tag = line + 1;
00814     }
00815
00816     if( line != 0L )
00817         free(line);
00818
00819     if( line_length < 0 && !feof(fpin) )
00820     {
00821         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00822         return false;
00823     }
00824
00825     fclose(fpin);
00826
00827     return !tag.empty();
00828 }

Generated on Fri Jan 31 12:09:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 132 of file cvsgui.c.

References errlog, errname, outlog, and outname.

Referenced by cvsguiglue_flushconsole().

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

void cvsguiglue_exit ( int code )

Definition at line 96 of file cvsgui.c.

References _cvsgui_writefd, cvsguiglue_flushconsole(), exit, and gp_quit_write().

00097 {
00098     cvsguiglue_flushconsole(1);
00099
00100     if(_cvsgui_writefd != 0)
00101         gp_quit_write (_cvsgui_writefd, code);
00102     exit(code);
00103 }

void cvsguiglue_flushconsole ( int closeit )

Definition at line 188 of file cvsgui.c.

References close_consoles(), errlog, myflush(), and outlog.

Referenced by cvsguiglue_exit(), cvsguiglue_getenv(), cvsguiglue_getpass(), and main().

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

char* cvsguiglue_getenv ( const char * env )

Definition at line 65 of file cvsgui.c.

References _cvsgui_readfd, cvsguiglue_flushconsole(), getenv, gp_getenv_read(), and gp_getenv_write().

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 #if qCvsDebug
00080     fprintf(stderr, "%s=%s\n", env, res);
00081 #endif
00082
00083     return res;
00084 }

char* cvsguiglue_getpass ( const char * prompt )

Definition at line 86 of file cvsgui.c.

References _cvsgui_readfd, cvsguiglue_flushconsole(), cvsguiglue_getenv(), and getpass.

00087 {
00088     cvsguiglue_flushconsole(0);
00089
00090     if(_cvsgui_readfd == 0)
00091         return getpass(prompt);
00092
00093     return cvsguiglue_getenv("CVS_GETPASS");
00094 }

char* getpass ( const char * prompt )

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

Definition at line 203 of file cvsgui.c.

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

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

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

Definition at line 151 of file cvsgui.c.

References errlog, gp_console_write(), and outlog.

Referenced by cvsguiglue_flushconsole().

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

void reopen_consoles ( void ) [static]

Definition at line 105 of file cvsgui.c.

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

Referenced by main().

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

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(), and main().

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().

long errseek [static]

Definition at line 59 of file cvsgui.c.

Referenced by 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().

long outseek [static]

Definition at line 58 of file cvsgui.c.

Referenced by reopen_consoles().

Generated on Fri Jan 31 12:09:39 2003 for WinCvs Source by doxygen 1.3-rc2


cvsgui.h File Reference

common/cvsgui.h File Reference

#include <stdlib.h>
#include <process.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 59 of file cvsgui.h.

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

#define getenv cvsguiglue_getenv

Definition at line 52 of file cvsgui.h.

Referenced by _getopt_initialize(), cvsguiglue_getenv(), glue_getenv(), CvsPrefs::Home(), initialize_all(), MakeTmpFile(), AuthenRhosts::OnSetupEnv(), AuthenPserver::OnSetupEnv(), AuthenSSH::OnSetupEnv(), AuthenModel::OnSetupEnv(), and AuthenSSH::RsaIdentityFile().

#define getpass cvsguiglue_getpass

Definition at line 53 of file cvsgui.h.

Referenced by cvsguiglue_getpass().

#define getpassphrase cvsguiglue_getpass

Definition at line 56 of file cvsgui.h.

#define main cvsguiglue_main

Definition at line 58 of file cvsgui.h.

Referenced by dllglue_main().

Function Documentation

void cvsguiglue_exit ( int code )

Definition at line 96 of file cvsgui.c.

References _cvsgui_writefd, cvsguiglue_flushconsole(), exit, and gp_quit_write().

00097 {
00098     cvsguiglue_flushconsole(1);
00099
00100     if(_cvsgui_writefd != 0)
00101         gp_quit_write (_cvsgui_writefd, code);
00102     exit(code);
00103 }

void cvsguiglue_flushconsole ( int closeit )

Definition at line 188 of file cvsgui.c.

References close_consoles(), errlog, myflush(), and outlog.

Referenced by cvsguiglue_exit(), cvsguiglue_getenv(), cvsguiglue_getpass(), and main().

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

char* cvsguiglue_getenv ( const char * env )

Definition at line 65 of file cvsgui.c.

References _cvsgui_readfd, cvsguiglue_flushconsole(), getenv, gp_getenv_read(), and gp_getenv_write().

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 #if qCvsDebug
00080     fprintf(stderr, "%s=%s\n", env, res);
00081 #endif
00082
00083     return res;
00084 }

char* cvsguiglue_getpass ( const char * prompt )

Definition at line 86 of file cvsgui.c.

References _cvsgui_readfd, cvsguiglue_flushconsole(), cvsguiglue_getenv(), and getpass.

00087 {
00088     cvsguiglue_flushconsole(0);
00089
00090     if(_cvsgui_readfd == 0)
00091         return getpass(prompt);
00092
00093     return cvsguiglue_getenv("CVS_GETPASS");
00094 }

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

Referenced by main().

Generated on Fri Jan 31 12:09:39 2003 for WinCvs Source by doxygen 1.3-rc2


cvsgui_i18n.h File Reference

common/cvsgui_i18n.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 | textdomain(String) (String)
#define | gettext(String) (String)
#define | dgettext(Domain, Message) (Message)
#define | dcgettext(Domain, Message, Type) (Message)
#define | bindtextdomain(Domain, Directory) (Domain)
#define | _i18n(String) (String)
#define | N_(String) (String)

Define Documentation

#define _i18n ( String ) (String)

Definition at line 42 of file cvsgui_i18n.h.

Referenced by UCvsFrame::AskForQuitting(), AskYesNo(), CompatGetUpdate(), CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainMenubar(), CreateMainToolbar(), CvsAlert(), CvsCmdAdd(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdMoveToTrash(), CvsCmdRelease(), KiSelectionHandler::GetSelection(), glue_exit(), glue_getenv(), KoAddBinaryHandler::KoAddBinaryHandler(), KoAddHandler::KoAddHandler(), KoAddUnicodeHandler::KoAddUnicodeHandler(), KoAnnotateHandler::KoAnnotateHandler(), KoBranchTagHandler::KoBranchTagHandler(), KoCancelChangesHandler::KoCancelChangesHandler(), KoCheckoutHandler::KoCheckoutHandler(), KoCommandLineHandler::KoCommandLineHandler(), KoCommitHandler::KoCommitHandler(), KoCreateTagHandler::KoCreateTagHandler(), KoDeleteTagHandler::KoDeleteTagHandler(), KoDiffHandler::KoDiffHandler(), KoEditHandler::KoEditHandler(), KoEditorsHandler::KoEditorsHandler(), KoFileRemoveHandler::KoFileRemoveHandler(), KoForceEditHandler::KoForceEditHandler(), KoGraphDiffHandler::KoGraphDiffHandler(), KoGraphHandler::KoGraphHandler(), KoImportHandler::KoImportHandler(), KoLockHandler::KoLockHandler(), KoLogHandler::KoLogHandler(), KoMoveToTrashHandler::KoMoveToTrashHandler(), KoQueryUpdateHandler::KoQueryUpdateHandler(), KoReleaseHandler::KoReleaseHandler(), KoReservedEditHandler::KoReservedEditHandler(), KoRtagBranchHandler::KoRtagBranchHandler(), KoRtagCreateHandler::KoRtagCreateHandler(), KoRtagDeleteHandler::KoRtagDeleteHandler(), KoStatusHandler::KoStatusHandler(), KoUneditHandler::KoUneditHandler(), KoUnlockHandler::KoUnlockHandler(), KoUpdateHandler::KoUpdateHandler(), KoUpdateMoveToTrashHandler::KoUpdateMoveToTrashHandler(), KoWatchersHandler::KoWatchersHandler(), KoWatchOffHandler::KoWatchOffHandler(), KoWatchOnHandler::KoWatchOnHandler(), launchCVS(), LaunchDiff(), LaunchEditor(), LaunchViewer(), MakeTmpFile(), UCvsFrame::OnBrowserPopup(), UCvsFolders::OnCmdExplore(), UCvsFiles::OnCmdExplore(), UCvsFrame::OnCmdStopcvs(), UCvsFiles::OnCmdUIEditseldef(), UCvsFrame::OnCopyrights(), UCvsFrame::OnCredits(), UCvsFolders::SetDefaultRoot(), and stopCVS().

#define bindtextdomain | ( | Domain,
 |  | Directory | ) | (Domain)

Definition at line 41 of file cvsgui_i18n.h.

#define dcgettext | ( | Domain,
 |  | Message,
 |  | Type | ) | (Message)

Definition at line 40 of file cvsgui_i18n.h.

#define dgettext | ( | Domain,
 |  | Message | ) | (Message)

Definition at line 39 of file cvsgui_i18n.h.

#define gettext ( String ) (String)

Definition at line 38 of file cvsgui_i18n.h.

#define N_ ( String ) (String)

Definition at line 43 of file cvsgui_i18n.h.

#define textdomain ( String ) (String)

Definition at line 37 of file cvsgui_i18n.h.

Generated on Fri Jan 31 12:09:39 2003 for WinCvs Source by doxygen 1.3-rc2


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
Critical section used when destroying cvs process. More...

class | CDummyInit
Use the runtime to initialize/delete a critical section. More...

struct | CStackThreadLock
Critical section used for cvs process stack operations. More...

Defines

#define | STD_STL std::
#define | BUFFSIZE 1024
Read file buffer size.

#define | THREAD_EXIT_SUCCESS (1)
Thread return value to mark successfull completion.

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_kill (CvsProcess *cvs_process)
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)
BOOL CALLBACK | PostCloseEnum (HWND hWnd, LPARAM lParam)
bool | cvs_process_terminate (CvsProcess *cvs_process)
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 | MonitorChld (CvsProcess *process)
DWORD | ServeProtocol (CvsProcess *process)
CvsProcess * | cvs_process_run (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks, CvsProcessStartupInfo *startupInfo)
int | cvs_process_is_active (const CvsProcess *cvs_process)
void | cvs_process_stop (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
Use the runtime to initialize/delete a critical section.

Define Documentation

#define BUFFSIZE 1024

Read file buffer size.

Definition at line 646 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().

#define THREAD_EXIT_SUCCESS (1)

Thread return value to mark successfull completion.

Definition at line 649 of file cvsgui_process.cpp.

Referenced by GetChldError(), GetChldOutput(), MonitorChld(), and ServeProtocol().

Function Documentation

void _gp_console_destroy ( WireMessage * msg ) [static]

Definition at line 319 of file cvsgui_process.cpp.

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

00320 {
00321     GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
00322     free(t->str);
00323     free(t);
00324 }

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

Definition at line 287 of file cvsgui_process.cpp.

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

00288 {
00289     GPT_CONSOLE* t = (GPT_CONSOLE*)malloc(sizeof(GPT_CONSOLE));
00290     if( t == 0L )
00291         return;
00292
00293     if( !wire_read_int8(fd, &t->isStderr, 1) )
00294         return;
00295
00296     if( !wire_read_int32(fd, &t->len, 1) )
00297         return;
00298
00299     if( !wire_read_string(fd, &t->str, 1) )
00300         return;
00301
00302     msg->data = t;
00303 }

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

Definition at line 305 of file cvsgui_process.cpp.

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

00306 {
00307     GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
00308
00309     if( !wire_write_int8(fd, &t->isStderr, 1) )
00310         return;
00311
00312     if( !wire_write_int32(fd, &t->len, 1) )
00313         return;
00314
00315     if( !wire_write_string(fd, &t->str, 1) )
00316         return;
00317 }

void _gp_getenv_destroy ( WireMessage * msg ) [static]

Definition at line 280 of file cvsgui_process.cpp.

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

00281 {
00282     GPT_GETENV* t = (GPT_GETENV*)msg->data;
00283     free(t->str);
00284     free(t);
00285 }

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

Definition at line 255 of file cvsgui_process.cpp.

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

00256 {
00257     GPT_GETENV* t = (GPT_GETENV*)malloc(sizeof(GPT_GETENV));
00258     if( t == 0L )
00259         return;
00260
00261     if( !wire_read_int8(fd, &t->empty, 1) )
00262         return;
00263
00264     if( !wire_read_string(fd, &t->str, 1) )
00265         return;
00266
00267     msg->data = t;
00268 }

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

Definition at line 270 of file cvsgui_process.cpp.

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

00271 {
00272     GPT_GETENV* t = (GPT_GETENV*)msg->data;
00273     if( !wire_write_int8(fd, &t->empty, 1) )
00274         return;
00275
00276     if( !wire_write_string(fd, &t->str, 1) )
00277         return;
00278 }

void _gp_quit_destroy ( WireMessage * msg ) [static]

Definition at line 250 of file cvsgui_process.cpp.

References _WireMessage::data, and free.

00251 {
00252     free(msg->data);
00253 }

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

Definition at line 231 of file cvsgui_process.cpp.

References GPT_QUIT::code, _WireMessage::data, malloc, and wire_read_int32().

00232 {
00233     GPT_QUIT* t = (GPT_QUIT*)malloc(sizeof(GPT_QUIT));
00234     if( t == 0L )
00235         return;
00236
00237     if( !wire_read_int32(fd, (guint32*)&t->code, 1) )
00238         return;
00239
00240     msg->data = t;
00241 }

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

Definition at line 243 of file cvsgui_process.cpp.

References GPT_QUIT::code, _WireMessage::data, and wire_write_int32().

00244 {
00245     GPT_QUIT* t = (GPT_QUIT*)msg->data;
00246     if( !wire_write_int32(fd, (guint32*)&t->code, 1) )
00247         return;
00248 }

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

Given an array of arguments that one might pass to spawnv construct a command line that one might pass to CreateProcess

Parameters:
argc | Arguments count
argv | Arguments
Returns:
The built command string
Note:
Tries to quote things appropriately

Definition at line 578 of file cvsgui_process.cpp.

References malloc.

Referenced by cvs_process_run().

00579 {
00580     int len;
00581
00582     /* Compute the total length the command will have.  */
00583     {
00584         int i;
00585
00586         len = 0;
00587         for (i = 0; i < argc; i++)
00588         {
00589             char* p;
00590
00591             len += 2;  /* for the double quotes */
00592
00593             for (p = argv[i]; *p; p++)
00594             {
00595                 if( *p == '"' )
00596                     len += 2;
00597                 else
00598                     len++;
00599             }
00600
00601             len++;  /* for the space or the '\0'  */
00602         }
00603     }
00604
00605     {
00606         /* The + 10 is in case len is 0.  */
00607         char* command = (char*)malloc(len + 10);
00608         int i;
00609         char* p;
00610
00611         if( !command )
00612         {
00613             errno = ENOMEM;
00614             return command;
00615         }
00616
00617         p = command;
00618         *p = '\0';
00619         /* copy each element of argv to command, putting each command
00620         in double quotes, and backslashing any quotes that appear
00621         within an argument.  */
00622         for (i = 0; i < argc; i++)
00623         {
00624             char* a;
00625             *p++ = '"';
00626             for (a = argv[i]; *a; a++)
00627             {
00628                 if( *a == '"' )
00629                     *p++ = '\\', *p++ = '"';
00630                 else
00631                     *p++ = *a;
00632             }
00633
00634             *p++ = '"';
00635             *p++ = ' ';
00636         }
00637
00638         if( p > command )
00639             p[-1] = '\0';
00640
00641         return command;
00642     }
00643 }

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

Close cvs project

Parameters:
cvs_process | Cvs process to be closed
kill_it | Flag indicating whether to kill the process

Definition at line 1116 of file cvsgui_process.cpp.

References cvs_process_terminate(), 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().

01117 {
01118     CDestroyThreadLock locker;
01119
01120     if( cvs_process && cvs_process->open )
01121     {
01122 #ifdef WIN32
01123
01124         if( GetCurrentThreadId() != cvs_process->threadsID[0] )
01125         {
01126             // we wait for all the protocol to be over before we close
01127             // the process and the pipe.
01128             WaitForSingleObject(cvs_process->threads[0], 500);
01129             cvs_process->open = FALSE;
01130             WaitForSingleObject(cvs_process->threads[0], 500);
01131         }
01132 #endif
01133
01134         cvs_process->open = FALSE;
01135
01136 #ifndef WIN32
01137         int status;
01138
01139         /* If necessary, kill the filter. */
01140         if( kill_it && cvs_process->pid )
01141             status = kill(cvs_process->pid, SIGKILL);
01142
01143         /* Wait for the process to exit. This will happen
01144          *  immediately if it was just killed.
01145          */
01146         if( cvs_process->pid )
01147             waitpid(cvs_process->pid, &status, 0);
01148
01149         /* Close the pipes. */
01150         if( cvs_process->my_read )
01151             close(cvs_process->my_read);
01152
01153         if( cvs_process->my_write )
01154             close(cvs_process->my_write);
01155
01156         if( cvs_process->his_read )
01157             close(cvs_process->his_read);
01158
01159         if( cvs_process->his_write )
01160             close(cvs_process->his_write);
01161 #else
01162         cvs_process->starting = TRUE;
01163
01164         if( kill_it && cvs_process->pid )
01165         {
01166             cvs_process_terminate(cvs_process);
01167         }
01168
01169         if( cvs_process->pid )
01170             CloseHandle(cvs_process->pid);
01171
01172         if( cvs_process->my_read )
01173             CloseHandle(cvs_process->my_read);
01174
01175         if( cvs_process->my_write )
01176             CloseHandle(cvs_process->my_write);
01177
01178         if( cvs_process->his_read )
01179             CloseHandle(cvs_process->his_read);
01180
01181         if( cvs_process->his_write )
01182             CloseHandle(cvs_process->his_write);
01183
01184         if( cvs_process->pstdin )
01185             CloseHandle(cvs_process->pstdin);
01186
01187         if( cvs_process->pstdout )
01188             CloseHandle(cvs_process->pstdout);
01189
01190         if( cvs_process->pstderr )
01191             CloseHandle(cvs_process->pstderr);
01192 #endif
01193
01194         wire_clear_error();
01195
01196         /* Set the fields to null values.
01197          */
01198         cvs_process->pid = 0;
01199         cvs_process->my_read = 0;
01200         cvs_process->my_write = 0;
01201         cvs_process->his_read = 0;
01202         cvs_process->his_write = 0;
01203         cvs_process->pstdin = 0;
01204         cvs_process->pstdout = 0;
01205         cvs_process->pstderr = 0;
01206
01207         {
01208             CStackThreadLock locker;
01209
01210             STD_STL vector<CvsProcess*>::iterator i = STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01211             if( i != open_cvs_process.end() )
01212                 open_cvs_process.erase(i);
01213         }
01214     }
01215 }

void cvs_process_destroy ( CvsProcess * cvs_process ) [static]

Destroy cvs process object and free allocated memory

Parameters:
cvs_process Cvs process to be destroyed

Definition at line 508 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, current_cvs_process, cvs_process_close(), cvs_process_pop(), _CvsProcess::destroy, free, NULL, _CvsProcess::stopProcessEvent, _CvsProcess::threads, _CvsProcess::threadsID, and TRUE.

Referenced by cvs_process_kill(), cvs_process_recv_message(), cvs_process_run(), and MonitorChld().

00509 {
00510     if( cvs_process )
00511     {
00512         cvs_process_close(cvs_process, TRUE);
00513
00514         if( cvs_process->args != 0L )
00515         {
00516             for(int i = 0; i < cvs_process->argc; i++)
00517             {
00518                 if( cvs_process->args[i] )
00519                 {
00520                     free(cvs_process->args[i]);
00521                     cvs_process->args[i] = 0L;
00522                 }
00523             }
00524
00525             free(cvs_process->args);
00526             cvs_process->args = 0L;
00527         }
00528
00529         if( cvs_process == current_cvs_process )
00530             cvs_process_pop ();
00531
00532         if( !cvs_process->destroy )
00533         {
00534             cvs_process->destroy = TRUE;
00535 #ifdef WIN32
00536             // wait so the threads do not continue to use the pointer
00537             HANDLE WaitH[4];
00538             int cnt = 0;
00539             DWORD curT = GetCurrentThreadId();
00540
00541             for(int i = 0; i < 4; i++)
00542             {
00543                 if( cvs_process->threads[i] && curT != cvs_process->threadsID[i] )
00544                     WaitH[cnt++] = cvs_process->threads[i];
00545             }
00546
00547             WaitForMultipleObjects(cnt, WaitH, TRUE, INFINITE);
00548
00549             // Close the handles
00550             for(i = 0; i < 4; i++)
00551             {
00552                 if( cvs_process->threads[i] && CloseHandle(cvs_process->threads[i]) )
00553                 {
00554                     cvs_process->threads[i] = NULL;
00555                 }
00556             }
00557
00558             if( cvs_process->stopProcessEvent )
00559             {
00560                 CloseHandle(cvs_process->stopProcessEvent);
00561             }
00562 #endif
00563             free(cvs_process);
00564         }
00565     }
00566 }

int cvs_process_flush ( pipe_t fd ) [static]

Flush cvs process data

Parameters:
fd Pipe
Returns:
TRUE if succesfull, FALSE otherwise

Definition at line 1445 of file cvsgui_process.cpp.

References current_write_buffer_index, FALSE, TRUE, and write().

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

int cvs_process_give_time ( void )

Called by the application to answer calls from the process

Returns:
1 if a message from cvs was handled, 0 otherwise

Definition at line 1267 of file cvsgui_process.cpp.

References cvs_process_recv_message(), open_cvs_process, and STD_STL.

Referenced by launchCVS(), and UCvsApp::OnMainTimer().

01268 {
01269 #ifndef WIN32
01270
01271     fd_set rset;
01272     int ready;
01273     int maxfd = 0;
01274     int fd;
01275     struct timeval tv;
01276     int didone = 0;
01277
01278     FD_ZERO (&rset);
01279
01280     STD_STL vector<CvsProcess*>::iterator i;
01281
01282     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01283     {
01284         fd = (*i)->my_read;
01285
01286         FD_SET (fd, &rset);
01287         if( fd > maxfd )
01288             maxfd = fd;
01289     }
01290
01291     tv.tv_sec = 0;
01292     tv.tv_usec = 10000; // was 100000, but this blocks the interactive dialogs e.g. password dialog
01293     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01294
01295     STD_STL vector<CvsProcess*> toFire;
01296     if( ready > 0 )
01297     {
01298         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01299         {
01300             fd = (*i)->my_read;
01301
01302             if( FD_ISSET(fd, &rset) )
01303                 toFire.push_back(*i);
01304         }
01305     }
01306
01307     for (i = toFire.begin(); i != toFire.end(); ++i)
01308     {
01309         fd = (*i)->my_read;
01310
01311         if( FD_ISSET(fd, &rset) )
01312         {
01313             cvs_process_recv_message(*i);
01314             didone = 1;
01315         }
01316     }
01317
01318     return didone;
01319 #else
01320
01321     // we don't have to do yield since we use preemptive threads
01322     return 0;
01323 #endif
01324 }

void cvs_process_handle_message ( WireMessage * msg ) [static]

Handle message

Parameters:
msg Message to be handled

Definition at line 1365 of file cvsgui_process.cpp.

References _CvsProcess::callbacks, GPT_QUIT::code, CvsProcessCallbacks::consoleerr, CvsProcessCallbacks::consoleout, current_cvs_process, cvs_process_close(), cvs_process_pop(), cvs_process_push(), _WireMessage::data, CvsProcessCallbacks::exit, 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().

01366 {
01367     switch(msg->type)
01368     {
01369     case GP_QUIT:
01370         {
01371             GPT_QUIT* t = (GPT_QUIT*)msg->data;
01372 #ifdef WIN32
01373             // Small delay to work around problems on Win9x (we will have to find the "real" solution in the future though...)
01374             Sleep(100);
01375 #endif
01376             current_cvs_process->callbacks->exit(t->code);
01377             cvs_process_close(current_cvs_process, FALSE);
01378             break;
01379         }
01380     case GP_GETENV:
01381         {
01382             GPT_GETENV* t = (GPT_GETENV*)msg->data;
01383             cvs_process_push(current_cvs_process);
01384             gp_getenv_write(current_cvs_process->my_write, current_cvs_process->callbacks->getenv(t->str));
01385             cvs_process_pop();
01386             break;
01387         }
01388     case GP_CONSOLE:
01389         {
01390             GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
01391             if( t->isStderr )
01392                 current_cvs_process->callbacks->consoleerr(t->str, t->len);
01393             else
01394                 current_cvs_process->callbacks->consoleout(t->str, t->len);
01395
01396             break;
01397         }
01398     }
01399 }

void cvs_process_init ( void )

Initialize the protocol library (both for the process and the application)

Definition at line 433 of file cvsgui_process.cpp.

References gp_init(), wire_set_flusher(), and wire_set_writer().

Referenced by cvs_process_new(), and main().

00434 {
00435     /* initialize the gimp protocol library and set the read and
00436      *  write handlers.
00437      */
00438     gp_init();
00439     wire_set_writer(cvs_process_write);
00440     wire_set_flusher(cvs_process_flush);
00441 }

int cvs_process_is_active ( const CvsProcess * cvs_process )

Tells if the process is still alive

Parameters:
cvs_process Cvs process to be tested
Returns:
Zero if process not active, non-zero otherwise

Definition at line 1222 of file cvsgui_process.cpp.

References open_cvs_process, and STD_STL.

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

01223 {
01224     int res;
01225
01226     {
01227         CStackThreadLock locker;
01228
01229         STD_STL vector<CvsProcess*>::iterator i =
01230             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01231         res = i != open_cvs_process.end() ? 1 : 0;
01232     }
01233
01234     return res;
01235 }

void cvs_process_kill ( CvsProcess * cvs_process )

Close a process. This kills the process and releases its resources

Parameters:
cvs_process Cvs process to be killed

Definition at line 1241 of file cvsgui_process.cpp.

References cvs_process_destroy(), and cvs_process_is_active().

Referenced by cvs_process_stop(), and MonitorChld().

01242 {
01243     if( cvs_process_is_active(cvs_process) )
01244     {
01245         cvs_process_destroy(cvs_process);
01246     }
01247 }

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

Create new cvs process object and initialize it's data members

Parameters:
name | Command
argc | Arguments count
argv | Arguments
Returns:
Pointer to the newly allocated object
Note:
You must free allocated memory using cvs_process_destroy

Definition at line 451 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, NULL, _CvsProcess::open, _CvsProcess::pid, _CvsProcess::pstderr, _CvsProcess::pstdin, _CvsProcess::pstdout, _CvsProcess::starting, _CvsProcess::stopProcessEvent, strdup(), _CvsProcess::threadID, _CvsProcess::threads, _CvsProcess::threadsID, TRUE, and _CvsProcess::write_buffer_index.

Referenced by cvs_process_run().

00452 {
00453     CvsProcess* cvs_process;
00454
00455     cvs_process_init();
00456
00457     cvs_process = (CvsProcess*)malloc(sizeof(CvsProcess));
00458     if( cvs_process == 0L )
00459         return 0L;
00460
00461     cvs_process->open = FALSE;
00462     cvs_process->destroy = FALSE;
00463
00464 #ifdef WIN32
00465     cvs_process->starting = TRUE;
00466     cvs_process->threadID = 0;
00467 #endif
00468
00469     cvs_process->pid = 0;
00470
00471     cvs_process->callbacks = 0L;
00472     cvs_process->argc = argc + 4;
00473     cvs_process->args = (char**)malloc((cvs_process->argc + 1) * sizeof(char*));
00474     cvs_process->args[0] = strdup(name);
00475     cvs_process->args[1] = strdup("-cvsgui");
00476     cvs_process->args[2] = (char*)malloc(16 * sizeof(char));
00477     cvs_process->args[3] = (char*)malloc(16 * sizeof(char));
00478
00479     for(int i = 0; i < argc; i++)
00480     {
00481         cvs_process->args[4 + i] = strdup(argv[i]);
00482     }
00483
00484     cvs_process->args[cvs_process->argc] = 0L;
00485     cvs_process->my_read = 0;
00486     cvs_process->my_write = 0;
00487     cvs_process->his_read = 0;
00488     cvs_process->his_write = 0;
00489     cvs_process->write_buffer_index = 0;
00490     cvs_process->pstdin = 0;
00491     cvs_process->pstdout = 0;
00492     cvs_process->pstderr = 0;
00493
00494 #ifdef WIN32
00495     memset(cvs_process->threads, 0, sizeof(cvs_process->threads));
00496     memset(cvs_process->threadsID, 0, sizeof(cvs_process->threadsID));
00497
00498     cvs_process->stopProcessEvent = NULL;
00499 #endif
00500
00501     return cvs_process;
00502 }

void cvs_process_pop ( void ) [static]

Take cvs process from the stack

Definition at line 1498 of file cvsgui_process.cpp.

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

Referenced by cvs_process_destroy(), cvs_process_handle_message(), and cvs_process_recv_message().

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

void cvs_process_push ( CvsProcess * cvs_process ) [static]

Puts cvs process to the stack

Parameters:
cvs_process Cvs process to be put

Definition at line 1475 of file cvsgui_process.cpp.

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

Referenced by cvs_process_handle_message(), and cvs_process_recv_message().

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

void cvs_process_recv_message ( CvsProcess * cvs_process ) [static]

Receive messages

Parameters:
cvs_process Cvs process

Definition at line 1330 of file cvsgui_process.cpp.

References current_cvs_process, 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, wire_destroy(), and wire_read_msg().

Referenced by cvs_process_give_time(), and ServeProtocol().

01331 {
01332     WireMessage msg;
01333
01334     cvs_process_push(cvs_process);
01335
01336     memset(&msg, 0, sizeof(WireMessage));
01337
01338     if( !wire_read_msg(cvs_process->my_read, &msg) )
01339     {
01340         cvs_process_close(cvs_process, TRUE);
01341     }
01342     else
01343     {
01344         cvs_process_handle_message(&msg);
01345         wire_destroy(&msg);
01346     }
01347
01348     if( cvs_process_is_active(current_cvs_process) )
01349     {
01350         if( !current_cvs_process->open )
01351         {
01352 #ifndef WIN32
01353             cvs_process_destroy(current_cvs_process);
01354 #endif
01355         }
01356         else
01357             cvs_process_pop();
01358     }
01359 }

CvsProcess* cvs_process_run | ( | char * | name,
 |  | int | argc,
 |  | char ** | argv,
 |  | CvsProcessCallbacks * | callbacks,
 |  | CvsProcessStartupInfo * | startupInfo
 | ) |

Start the cvs process

Parameters:
name | Command to be started
argc | Arguments count
argv | Arguments
callbacks | Stdout/stderr redirection callbacks
startupInfo | Additional parameters to control command's execution
Returns:
Pointer to the new CvsProcess on success, NULL otherwise

Definition at line 772 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, build_command(), _CvsProcess::callbacks, _CvsProcessStartupInfo::currentDirectory, cvs_process_destroy(), cvs_process_new(), FALSE, free, GetChldError(), GetChldOutput(), _CvsProcessStartupInfo::hasTty, _CvsProcess::his_read, _CvsProcess::his_write, malloc, MonitorChld(), _CvsProcess::my_read, _CvsProcess::my_write, NULL, open_cvs_process, ServeProtocol(), strdup(), and TRUE.

Referenced by launchCVS().

00774 {
00775     if( !callbacks || !startupInfo )
00776         return 0L;
00777
00778     CvsProcess* cvs_process = cvs_process_new(name, argc, argv);
00779
00780     if( !cvs_process || !callbacks || !startupInfo )
00781         return 0L;
00782
00783     cvs_process->callbacks = callbacks;
00784
00785 #ifndef WIN32
00786
00787     int my_read[2] = { 0, 0 };
00788     int my_write[2] = { 0, 0 };
00789
00790     /* Open two pipes. (Bidirectional communication). */
00791     if( (pipe(my_read) == -1) || (pipe(my_write) == -1) )
00792     {
00793         fprintf(stderr, "unable to open pipe\n");
00794         cvs_process_destroy(cvs_process);
00795         return 0L;
00796     }
00797
00798     cvs_process->my_read = my_read[0];
00799     cvs_process->my_write = my_write[1];
00800     cvs_process->his_read = my_write[0];
00801     cvs_process->his_write = my_read[1];
00802
00803     /* Remember the file descriptors for the pipes. */
00804     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00805     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00806
00807     /* TTimo
00808     * add the relevant commands to spawn in a terminal if necessary
00809     */
00810     if( startupInfo->hasTty )
00811     {
00812         cvs_process->argc += 2;
00813         char **old_args = cvs_process->args;
00814         cvs_process->args = (char **)malloc((cvs_process->argc + 1) * sizeof(char *));
00815         cvs_process->args[0] = strdup ("xterm");
00816         cvs_process->args[1] = strdup ("-e");
00817         int i = 0;
00818         while (old_args[i])
00819         {
00820             cvs_process->args[i+2] = old_args[i];
00821             i++;
00822         }
00823
00824         cvs_process->args[cvs_process->argc] = 0L;
00825         free(old_args);
00826     }
00827
00828     /* If we are running non interactively (i.e. gcvs&), it is
00829     *  possible that the cvs process would require entering a password
00830     *  or something similar (happens in some cases for CVS_RSH=ssh)
00831     *  this would raise a SIGTTOU, which turns into a SIGSTOP if not handled
00832     */
00833     sigtt_cvs_process = cvs_process;
00834     signal(SIGTTIN, sigtt_handler); // TODO: check if necessary on Mac
00835     signal(SIGTTOU, sigtt_handler); // TODO: check if necessary on Mac
00836
00837     /* Fork another process. We'll remember the process id
00838     *  so that we can later use it to kill the filter if
00839     *  necessary.
00840     */
00841
00842     cvs_process->pid = fork ();
00843
00844     if( cvs_process->pid == 0 )
00845     {
00846         close(cvs_process->my_read);
00847         close(cvs_process->my_write);
00848         /* Execute the filter. The "_exit" call should never
00849         *  be reached, unless some strange error condition
00850         *  exists.
00851         */
00852         execvp(cvs_process->args[0], cvs_process->args);
00853         _exit(1);
00854     }
00855     else if( cvs_process->pid == -1 )
00856     {
00857         cvs_process_destroy(cvs_process);
00858         // fork failed
00859         sigtt_cvs_process = NULL;
00860         return 0L;
00861     }
00862
00863     close(cvs_process->his_read);
00864     cvs_process->his_read  = -1;
00865
00866     close(cvs_process->his_write);
00867     cvs_process->his_write = -1;
00868
00869 #else
00870
00871     SECURITY_ATTRIBUTES lsa = { 0 };
00872     STARTUPINFO si = { 0 };
00873     PROCESS_INFORMATION pi = { 0 };
00874
00875     HANDLE dupIn = 0L, dupOut = 0L;
00876     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00877     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00878     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00879     char* command = 0L;
00880     BOOL resCreate;
00881     int cnt, i;
00882     LPTHREAD_START_ROUTINE threadsFunc[4];
00883
00884     lsa.nLength = sizeof(SECURITY_ATTRIBUTES);
00885     lsa.lpSecurityDescriptor = NULL;
00886     lsa.bInheritHandle = TRUE;
00887
00888     // create the pipes used for the cvsgui protocol
00889     if( !CreatePipe(&cvs_process->his_read, &dupIn, &lsa, 0) )
00890         goto error;
00891     if( !CreatePipe(&dupOut, &cvs_process->his_write, &lsa, 0) )
00892         goto error;
00893
00894     // duplicate the App side handles so they lose the inheritance
00895     if( !DuplicateHandle(GetCurrentProcess(), dupIn,
00896         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00897         goto error;
00898
00899     CloseHandle(dupIn);
00900     dupIn = 0;
00901
00902     if( !DuplicateHandle(GetCurrentProcess(), dupOut,
00903         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00904         goto error;
00905
00906     CloseHandle(dupOut);
00907     dupOut = 0;
00908
00909     if( !startupInfo->hasTty )
00910     {
00911         // redirect stdout, stderr, stdin
00912         if( !CreatePipe(&stdChildIn, &stddupIn, &lsa, 0) )
00913             goto error;
00914
00915         if( !CreatePipe(&stddupOut, &stdChildOut, &lsa, 0) )
00916             goto error;
00917
00918         if( !CreatePipe(&stddupErr, &stdChildErr, &lsa, 0) )
00919             goto error;
00920
00921         // same thing as above
00922         if( !DuplicateHandle(GetCurrentProcess(), stddupIn,
00923             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00924             goto error;
00925
00926         CloseHandle(stddupIn);
00927         stddupIn = 0;
00928
00929         if( !DuplicateHandle(GetCurrentProcess(), stddupOut,
00930             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00931             goto error;
00932
00933         CloseHandle(stddupOut);
00934         stddupOut = 0;
00935
00936         if( !DuplicateHandle(GetCurrentProcess(), stddupErr,
00937             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00938             goto error;
00939
00940         CloseHandle(stddupErr);
00941         stddupErr = 0;
00942     }
00943
00944     // Build the arguments for cvs
00945     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00946     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00947
00948     command = build_command(cvs_process->argc, cvs_process->args);
00949     if( command == 0L )
00950         goto error;
00951
00952     // Redirect Console StdHandles and set the start options
00953     memset(&si, 0, sizeof(STARTUPINFO));
00954     si.cb = sizeof(STARTUPINFO);
00955     si.dwFlags = startupInfo->hasTty ? 0 : STARTF_USESTDHANDLES;
00956     si.hStdInput = stdChildIn;
00957     si.hStdOutput = stdChildOut;
00958     si.hStdError = stdChildErr;
00959
00960     if( !startupInfo->hasTty )
00961     {
00962         si.dwFlags |= STARTF_USESHOWWINDOW;
00963         si.wShowWindow = SW_SHOWMINNOACTIVE;
00964
00965         stdoldIn  = GetStdHandle(STD_INPUT_HANDLE);
00966         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
00967         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
00968         SetStdHandle(STD_INPUT_HANDLE,  stdChildIn);
00969         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
00970         SetStdHandle(STD_ERROR_HANDLE,  stdChildErr);
00971     }
00972
00973     // Create Child Process
00974     resCreate = CreateProcess(
00975         NULL,
00976         command,
00977         NULL,
00978         NULL,
00979         TRUE,
00980         NORMAL_PRIORITY_CLASS | CREATE_SUSPENDED,
00981         NULL,
00982         startupInfo->currentDirectory && strlen(startupInfo->currentDirectory) ? startupInfo->currentDirectory : NULL,
00983         &si,
00984         &pi);
00985
00986     if( !startupInfo->hasTty )
00987     {
00988         SetStdHandle(STD_INPUT_HANDLE,  stdoldIn);
00989         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
00990         SetStdHandle(STD_ERROR_HANDLE,  stdoldErr);
00991     }
00992
00993     if( !resCreate )
00994         goto error;
00995
00996     cvs_process->threadID = pi.dwProcessId;
00997     cvs_process->pid = pi.hProcess;
00998
00999     cnt = 0;
01000
01001     // Create a stop process event
01002     cvs_process->stopProcessEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
01003     if( !cvs_process->stopProcessEvent )
01004     {
01005         goto error;
01006     }
01007
01008     // Now open-up threads which will serve the pipes
01009     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01010     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)MonitorChld;
01011
01012     if( !startupInfo->hasTty )
01013     {
01014         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01015         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01016     }
01017
01018     for(i = 0; i < cnt; i++)
01019     {
01020         if( (cvs_process->threads[i] = ::CreateThread(
01021             (LPSECURITY_ATTRIBUTES)NULL,                    // No security attributes.
01022             (DWORD)0,                                       // Use same stack size.
01023             (LPTHREAD_START_ROUTINE)threadsFunc[i],         // Thread procedure.
01024             (LPVOID)cvs_process,                            // Parameter to pass.
01025             (DWORD)0,                                       // Run immediately.
01026             (LPDWORD)&cvs_process->threadsID[i])) == NULL )
01027         {
01028             TerminateProcess(cvs_process->pid, 0);
01029             goto error;
01030         }
01031     }
01032
01033     //Close unneccesary Handles
01034     CloseHandle(cvs_process->his_read);
01035     cvs_process->his_read = 0;
01036     CloseHandle(cvs_process->his_write);
01037     cvs_process->his_write = 0;
01038
01039     if( !startupInfo->hasTty )
01040     {
01041         CloseHandle(stdChildIn);
01042         CloseHandle(stdChildOut);
01043         CloseHandle(stdChildErr);
01044     }
01045
01046     // Resume process execution
01047     ResumeThread(pi.hThread);
01048     CloseHandle(pi.hThread);
01049
01050     // Small tactical delay to reduce problems with process termination
01051     Sleep(100);
01052
01053     free(command);
01054
01055     goto goodboy;
01056
01057 error:
01058     if(cvs_process->his_read != 0L)
01059         CloseHandle(cvs_process->his_read);
01060     if(cvs_process->his_write != 0L)
01061         CloseHandle(cvs_process->his_write);
01062     if(dupIn != 0L)
01063         CloseHandle(dupIn);
01064     if(dupOut != 0L)
01065         CloseHandle(dupOut);
01066     if(cvs_process->my_read != 0L)
01067         CloseHandle(cvs_process->my_read);
01068     if(cvs_process->my_write != 0L)
01069         CloseHandle(cvs_process->my_write);
01070     if(command != 0L)
01071         free(command);
01072     if(stdChildIn != 0L)
01073         CloseHandle(stdChildIn);
01074     if(stdChildOut != 0L)
01075         CloseHandle(stdChildOut);
01076     if(stdChildErr != 0L)
01077         CloseHandle(stdChildErr);
01078     if(stddupIn != 0L)
01079         CloseHandle(stddupIn);
01080     if(stddupOut != 0L)
01081         CloseHandle(stddupOut);
01082     if(stddupErr != 0L)
01083         CloseHandle(stddupErr);
01084     if(cvs_process->pstdin != 0L)
01085         CloseHandle(cvs_process->pstdin);
01086     if(cvs_process->pstdout != 0L)
01087         CloseHandle(cvs_process->pstdout);
01088     if(cvs_process->pstderr != 0L)
01089         CloseHandle(cvs_process->pstderr);
01090
01091     cvs_process_destroy (cvs_process);
01092     return 0L;
01093
01094 goodboy:
01095 #endif
01096
01097     {
01098         CStackThreadLock locker;
01099
01100         open_cvs_process.push_back(cvs_process);
01101     }
01102
01103     cvs_process->open = TRUE;
01104 #ifdef WIN32
01105     cvs_process->starting = FALSE;
01106 #endif
01107
01108     return cvs_process;
01109 }

void cvs_process_stop ( CvsProcess * cvs_process )

Stop a process

Parameters:
cvs_process Cvs process to be stopped

Definition at line 1253 of file cvsgui_process.cpp.

References cvs_process_kill(), and _CvsProcess::stopProcessEvent.

Referenced by launchCVS(), UCvsFrame::OnCmdStopcvs(), and stopCVS().

01254 {
01255 #ifdef WIN32
01256     // On windows we need to kill process "from within" to avoid race condition with MonitorChld thread
01257     SetEvent(cvs_process->stopProcessEvent);
01258 #else
01259     cvs_process_kill(cvs_process);
01260 #endif
01261 }

bool cvs_process_terminate ( CvsProcess * cvs_process )

Terminate cvs process

Parameters:
cvs_process Cvs process to be terminated
Returns:
true if process was terminate, false otherwise
Note:
See also Q178893 - HOWTO: Terminate an Application "Cleanly" in Win32

Definition at line 153 of file cvsgui_process.cpp.

References FALSE, _CvsProcess::pid, _CvsProcess::threadID, and TRUE.

Referenced by cvs_process_close().

00154 {
00155     bool res = FALSE;
00156
00157     EnumWindows((WNDENUMPROC)PostCloseEnum, (LPARAM)cvs_process->threadID);
00158
00159     if( WaitForSingleObject(cvs_process->pid, 300) == WAIT_OBJECT_0 )
00160     {
00161         res = TRUE;
00162     }
00163     else
00164     {
00165         res = TerminateProcess(cvs_process->pid, 0) != 0;
00166     }
00167
00168     return res;
00169 }

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

Write data to the cvs process

Parameters:
fd | Pipe
buf | Buffer
count | Buffer size
Returns:
TRUE if written, FALSE otherwise

Definition at line 1408 of file cvsgui_process.cpp.

References current_write_buffer, current_write_buffer_index, FALSE, gulong, process_write_buffer, TRUE, wire_flush(), and WRITE_BUFFER_SIZE.

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

DWORD GetChldError ( CvsProcess * process ) [static]

Worker thread to read the cvs process stderr

Parameters:
process Cvs process
Returns:
THREAD_EXIT_SUCCESS

Definition at line 675 of file cvsgui_process.cpp.

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

Referenced by cvs_process_run().

00676 {
00677     char buff[BUFFSIZE];
00678     DWORD dread;
00679
00680     while( ReadFile(process->pstderr, buff, BUFFSIZE-1, &dread, NULL) )
00681     {
00682         buff[dread] = '\0';
00683         process->callbacks->consoleerr(buff, dread);
00684     }
00685
00686     return THREAD_EXIT_SUCCESS;
00687 }

DWORD GetChldOutput ( CvsProcess * process ) [static]

Worker thread to read the cvs process stdout

Parameters:
process Cvs process
Returns:
THREAD_EXIT_SUCCESS

Definition at line 656 of file cvsgui_process.cpp.

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

Referenced by cvs_process_run().

00657 {
00658     char buff[BUFFSIZE];
00659     DWORD dread;
00660
00661     while( ReadFile(process->pstdout, buff, BUFFSIZE-1, &dread, NULL) )
00662     {
00663         buff[dread] = '\0';
00664         process->callbacks->consoleout(buff, dread);
00665     }
00666
00667     return THREAD_EXIT_SUCCESS;
00668 }

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

Definition at line 407 of file cvsgui_process.cpp.

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

Referenced by myflush().

00408 {
00409     WireMessage msg;
00410     GPT_CONSOLE* t = (GPT_CONSOLE*)malloc(sizeof(GPT_CONSOLE));
00411
00412     msg.type = GP_CONSOLE;
00413     msg.data = t;
00414
00415     t->isStderr = isStderr;
00416     t->len = len;
00417     t->str = (char*)malloc((len + 1) * sizeof(char));
00418     memcpy(t->str, str, len * sizeof(char));
00419     t->str[len] = '\0';
00420
00421     if( !wire_write_msg(fd, &msg) )
00422         return FALSE;
00423
00424     if( !wire_flush(fd) )
00425         return FALSE;
00426
00427     return TRUE;
00428 }

char* gp_getenv_read ( pipe_t fd )

Definition at line 384 of file cvsgui_process.cpp.

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

Referenced by cvsguiglue_getenv().

00385 {
00386     WireMessage msg;
00387     char* res;
00388
00389     memset(&msg, 0, sizeof(WireMessage));
00390     if( !wire_read_msg(fd, &msg) || msg.type != GP_GETENV )
00391     {
00392         fprintf(stderr, "cvsgui protocol error !\n");
00393         exit(-1);
00394     }
00395
00396     GPT_GETENV* t = (GPT_GETENV*)msg.data;
00397     res = t->empty ? 0L : strdup(t->str);
00398     wire_destroy(&msg);
00399
00400     return res;
00401 }

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

Definition at line 363 of file cvsgui_process.cpp.

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

Referenced by cvs_process_handle_message(), and cvsguiglue_getenv().

00364 {
00365     WireMessage msg;
00366     GPT_GETENV* t = (GPT_GETENV*)malloc(sizeof(GPT_GETENV));
00367
00368     msg.type = GP_GETENV;
00369     msg.data = t;
00370
00371     t->empty = env == 0L;
00372     t->str = strdup(env == 0L ? "" : env);
00373
00374     if( !wire_write_msg(fd, &msg) )
00375         return FALSE;
00376
00377     wire_destroy(&msg);
00378     if( !wire_flush (fd) )
00379         return FALSE;
00380
00381     return TRUE;
00382 }

void gp_init ( ) [static]

Definition at line 326 of file cvsgui_process.cpp.

References wire_register().

Referenced by cvs_process_init().

00327 {
00328     wire_register(GP_QUIT,
00329         _gp_quit_read,
00330         _gp_quit_write,
00331         _gp_quit_destroy);
00332
00333     wire_register(GP_GETENV,
00334         _gp_getenv_read,
00335         _gp_getenv_write,
00336         _gp_getenv_destroy);
00337
00338     wire_register(GP_CONSOLE,
00339         _gp_console_read,
00340         _gp_console_write,
00341         _gp_console_destroy);
00342 }

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

Definition at line 344 of file cvsgui_process.cpp.

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

Referenced by cvsguiglue_exit(), and main().

00345 {
00346     WireMessage msg;
00347     GPT_QUIT* t = (GPT_QUIT*)malloc(sizeof(GPT_QUIT));
00348
00349     msg.type = GP_QUIT;
00350     msg.data = t;
00351
00352     t->code = code;
00353
00354     if( !wire_write_msg(fd, &msg) )
00355         return FALSE;
00356
00357     if( !wire_flush(fd) )
00358         return FALSE;
00359
00360     return TRUE;
00361 }

DWORD MonitorChld ( CvsProcess * process ) [static]

Worker thread to monitor the cvs process operation and stop request

Parameters:
process Cvs process
Returns:
THREAD_EXIT_SUCCESS

Definition at line 694 of file cvsgui_process.cpp.

References cvs_process_destroy(), cvs_process_kill(), _CvsProcess::pid, _CvsProcess::stopProcessEvent, and THREAD_EXIT_SUCCESS.

Referenced by cvs_process_run().

00695 {
00696     HANDLE waitHandles[2] = { process->pid, process->stopProcessEvent };
00697
00698     const DWORD waitResult = WaitForMultipleObjects(2, waitHandles, FALSE, INFINITE);
00699     if( waitResult == (WAIT_OBJECT_0 + 1) )
00700     {
00701         cvs_process_kill(process);
00702     }
00703     else
00704     {
00705         cvs_process_destroy(process);
00706     }
00707
00708     return THREAD_EXIT_SUCCESS;
00709 }

BOOL CALLBACK PostCloseEnum | ( | HWND | hWnd,
 |  | LPARAM | lParam
 | ) |

Callback enumerating all top-level windows and posting the WM_CLOSE message to the process that matches given process ID

Parameters:
hWnd | Window handle
lParam | Process ID to post message to
Returns:
TRUE to continue enumerate, FALSE to stop

Definition at line 133 of file cvsgui_process.cpp.

References TRUE.

00134 {
00135     DWORD pid = 0;
00136
00137     GetWindowThreadProcessId(hWnd, &pid);
00138
00139     if( pid == (DWORD)lParam )
00140     {
00141         PostMessage(hWnd, WM_CLOSE, 0, 0);
00142     }
00143
00144     return TRUE;
00145 }

DWORD ServeProtocol ( CvsProcess * process ) [static]

Worker thread to read and process pipe communication

Parameters:
process Cvs process
Returns:
THREAD_EXIT_SUCCESS

Definition at line 716 of file cvsgui_process.cpp.

References cvs_process_is_active(), cvs_process_recv_message(), _CvsProcess::my_read, _CvsProcess::open, _CvsProcess::starting, and THREAD_EXIT_SUCCESS.

Referenced by cvs_process_run().

00717 {
00718     while( process->starting )
00719     {
00720         Sleep(20);
00721         continue;
00722     }
00723
00724     DWORD avail;
00725     while( cvs_process_is_active(process) && process->open )
00726     {
00727         if( !PeekNamedPipe(process->my_read, 0L, 0 , 0L, &avail, 0L) )
00728             break;
00729
00730         if( avail == 0 )
00731         {
00732             Sleep(20);
00733             continue;
00734         }
00735
00736         cvs_process_recv_message(process);
00737     }
00738
00739     return THREAD_EXIT_SUCCESS;
00740 }

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

Write data to a file

Parameters:
fd | File handle
buf | Data to be written
count | Buffer size
Returns:
The count of data written
Note:
Wraps ::WriteFile API

Definition at line 115 of file cvsgui_process.cpp.

References write().

Referenced by write().

00116 {
00117     DWORD write;
00118     if( !WriteFile(fd, buf, count, &write, NULL) )
00119     {
00120         errno = EINVAL;
00121         return -1;
00122     }
00123
00124     return write;
00125 }

Variable Documentation

CvsProcess* current_cvs_process = NULL [static]

Definition at line 76 of file cvsgui_process.cpp.

Referenced by cvs_process_destroy(), cvs_process_handle_message(), cvs_process_pop(), cvs_process_push(), and cvs_process_recv_message().

char* current_write_buffer = NULL [static]

Definition at line 78 of file cvsgui_process.cpp.

Referenced by 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_run().

char process_write_buffer[ 512 ] [static]

Definition at line 80 of file cvsgui_process.cpp.

Referenced by cvs_process_write().

class CDummyInit sDummyObject

Use the runtime to initialize/delete a critical section.

Generated on Fri Jan 31 12:09:40 2003 for WinCvs Source by doxygen 1.3-rc2


cvsgui_process.h File Reference

common/cvsgui_process.h File Reference

#include <stdio.h>
#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
Structure to hold the cvs process info. More...

struct | _CvsProcessStartupInfo
Structure to hold the cvs startup information. More...

struct | CvsProcessCallbacks
Structure to hold cvsgui protocol callbacks. More...

Defines

#define | WRITE_BUFFER_SIZE 512

Typedefs

typedef _CvsProcess | CvsProcess
typedef _CvsProcessStartupInfo | CvsProcessStartupInfo
Structure to hold the cvs startup information.

Functions

CvsProcess * | cvs_process_run (char *name, int argc, char **argv, CvsProcessCallbacks *callbacks, CvsProcessStartupInfo *startupInfo)
void | cvs_process_stop (CvsProcess *cvs_process)
int | cvs_process_is_active (const CvsProcess *cvs_process)
int | cvs_process_give_time (void)
void | cvs_process_init (void)

Define Documentation

#define WRITE_BUFFER_SIZE 512

Definition at line 31 of file cvsgui_process.h.

Referenced by cvs_process_write().

Typedef Documentation

typedef struct _CvsProcess CvsProcess

Definition at line 38 of file cvsgui_process.h.

typedef struct _CvsProcessStartupInfo CvsProcessStartupInfo

Structure to hold the cvs startup information.

Function Documentation

int cvs_process_give_time ( void )

Called by the application to answer calls from the process

Returns:
1 if a message from cvs was handled, 0 otherwise

Definition at line 1267 of file cvsgui_process.cpp.

References cvs_process_recv_message(), open_cvs_process, and STD_STL.

Referenced by launchCVS(), and UCvsApp::OnMainTimer().

01268 {
01269 #ifndef WIN32
01270
01271     fd_set rset;
01272     int ready;
01273     int maxfd = 0;
01274     int fd;
01275     struct timeval tv;
01276     int didone = 0;
01277
01278     FD_ZERO (&rset);
01279
01280     STD_STL vector<CvsProcess*>::iterator i;
01281
01282     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01283     {
01284         fd = (*i)->my_read;
01285
01286         FD_SET (fd, &rset);
01287         if( fd > maxfd )
01288             maxfd = fd;
01289     }
01290
01291     tv.tv_sec = 0;
01292     tv.tv_usec = 10000; // was 100000, but this blocks the interactive dialogs e.g. password dialog
01293     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01294
01295     STD_STL vector<CvsProcess*> toFire;
01296     if( ready > 0 )
01297     {
01298         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01299         {
01300             fd = (*i)->my_read;
01301
01302             if( FD_ISSET(fd, &rset) )
01303                 toFire.push_back(*i);
01304         }
01305     }
01306
01307     for (i = toFire.begin(); i != toFire.end(); ++i)
01308     {
01309         fd = (*i)->my_read;
01310
01311         if( FD_ISSET(fd, &rset) )
01312         {
01313             cvs_process_recv_message(*i);
01314             didone = 1;
01315         }
01316     }
01317
01318     return didone;
01319 #else
01320
01321     // we don't have to do yield since we use preemptive threads
01322     return 0;
01323 #endif
01324 }

void cvs_process_init ( void )

Initialize the protocol library (both for the process and the application)

Definition at line 433 of file cvsgui_process.cpp.

References gp_init(), wire_set_flusher(), and wire_set_writer().

Referenced by cvs_process_new(), and main().

00434 {
00435     /* initialize the gimp protocol library and set the read and
00436      *  write handlers.
00437      */
00438     gp_init();
00439     wire_set_writer(cvs_process_write);
00440     wire_set_flusher(cvs_process_flush);
00441 }

int cvs_process_is_active ( const CvsProcess * cvs_process )

Tells if the process is still alive

Parameters:
cvs_process Cvs process to be tested
Returns:
Zero if process not active, non-zero otherwise

Definition at line 1222 of file cvsgui_process.cpp.

References open_cvs_process, and STD_STL.

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

01223 {
01224     int res;
01225
01226     {
01227         CStackThreadLock locker;
01228
01229         STD_STL vector<CvsProcess*>::iterator i =
01230             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01231         res = i != open_cvs_process.end() ? 1 : 0;
01232     }
01233
01234     return res;
01235 }

CvsProcess* cvs_process_run | ( | char * | name,
 |  | int | argc,
 |  | char ** | argv,
 |  | CvsProcessCallbacks * | callbacks,
 |  | CvsProcessStartupInfo * | startupInfo
 | ) |

Start the cvs process

Parameters:
name | Command to be started
argc | Arguments count
argv | Arguments
callbacks | Stdout/stderr redirection callbacks
startupInfo | Additional parameters to control command's execution
Returns:
Pointer to the new CvsProcess on success, NULL otherwise

Definition at line 772 of file cvsgui_process.cpp.

References _CvsProcess::argc, _CvsProcess::args, build_command(), _CvsProcess::callbacks, _CvsProcessStartupInfo::currentDirectory, cvs_process_destroy(), cvs_process_new(), FALSE, free, GetChldError(), GetChldOutput(), _CvsProcessStartupInfo::hasTty, _CvsProcess::his_read, _CvsProcess::his_write, malloc, MonitorChld(), _CvsProcess::my_read, _CvsProcess::my_write, NULL, open_cvs_process, ServeProtocol(), strdup(), and TRUE.

Referenced by launchCVS().

00774 {
00775     if( !callbacks || !startupInfo )
00776         return 0L;
00777
00778     CvsProcess* cvs_process = cvs_process_new(name, argc, argv);
00779
00780     if( !cvs_process || !callbacks || !startupInfo )
00781         return 0L;
00782
00783     cvs_process->callbacks = callbacks;
00784
00785 #ifndef WIN32
00786
00787     int my_read[2] = { 0, 0 };
00788     int my_write[2] = { 0, 0 };
00789
00790     /* Open two pipes. (Bidirectional communication). */
00791     if( (pipe(my_read) == -1) || (pipe(my_write) == -1) )
00792     {
00793         fprintf(stderr, "unable to open pipe\n");
00794         cvs_process_destroy(cvs_process);
00795         return 0L;
00796     }
00797
00798     cvs_process->my_read = my_read[0];
00799     cvs_process->my_write = my_write[1];
00800     cvs_process->his_read = my_write[0];
00801     cvs_process->his_write = my_read[1];
00802
00803     /* Remember the file descriptors for the pipes. */
00804     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00805     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00806
00807     /* TTimo
00808     * add the relevant commands to spawn in a terminal if necessary
00809     */
00810     if( startupInfo->hasTty )
00811     {
00812         cvs_process->argc += 2;
00813         char **old_args = cvs_process->args;
00814         cvs_process->args = (char **)malloc((cvs_process->argc + 1) * sizeof(char *));
00815         cvs_process->args[0] = strdup ("xterm");
00816         cvs_process->args[1] = strdup ("-e");
00817         int i = 0;
00818         while (old_args[i])
00819         {
00820             cvs_process->args[i+2] = old_args[i];
00821             i++;
00822         }
00823
00824         cvs_process->args[cvs_process->argc] = 0L;
00825         free(old_args);
00826     }
00827
00828     /* If we are running non interactively (i.e. gcvs&), it is
00829     *  possible that the cvs process would require entering a password
00830     *  or something similar (happens in some cases for CVS_RSH=ssh)
00831     *  this would raise a SIGTTOU, which turns into a SIGSTOP if not handled
00832     */
00833     sigtt_cvs_process = cvs_process;
00834     signal(SIGTTIN, sigtt_handler); // TODO: check if necessary on Mac
00835     signal(SIGTTOU, sigtt_handler); // TODO: check if necessary on Mac
00836
00837     /* Fork another process. We'll remember the process id
00838     *  so that we can later use it to kill the filter if
00839     *  necessary.
00840     */
00841
00842     cvs_process->pid = fork ();
00843
00844     if( cvs_process->pid == 0 )
00845     {
00846         close(cvs_process->my_read);
00847         close(cvs_process->my_write);
00848         /* Execute the filter. The "_exit" call should never
00849         *  be reached, unless some strange error condition
00850         *  exists.
00851         */
00852         execvp(cvs_process->args[0], cvs_process->args);
00853         _exit(1);
00854     }
00855     else if( cvs_process->pid == -1 )
00856     {
00857         cvs_process_destroy(cvs_process);
00858         // fork failed
00859         sigtt_cvs_process = NULL;
00860         return 0L;
00861     }
00862
00863     close(cvs_process->his_read);
00864     cvs_process->his_read  = -1;
00865
00866     close(cvs_process->his_write);
00867     cvs_process->his_write = -1;
00868
00869 #else
00870
00871     SECURITY_ATTRIBUTES lsa = { 0 };
00872     STARTUPINFO si = { 0 };
00873     PROCESS_INFORMATION pi = { 0 };
00874
00875     HANDLE dupIn = 0L, dupOut = 0L;
00876     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00877     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00878     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00879     char* command = 0L;
00880     BOOL resCreate;
00881     int cnt, i;
00882     LPTHREAD_START_ROUTINE threadsFunc[4];
00883
00884     lsa.nLength = sizeof(SECURITY_ATTRIBUTES);
00885     lsa.lpSecurityDescriptor = NULL;
00886     lsa.bInheritHandle = TRUE;
00887
00888     // create the pipes used for the cvsgui protocol
00889     if( !CreatePipe(&cvs_process->his_read, &dupIn, &lsa, 0) )
00890         goto error;
00891     if( !CreatePipe(&dupOut, &cvs_process->his_write, &lsa, 0) )
00892         goto error;
00893
00894     // duplicate the App side handles so they lose the inheritance
00895     if( !DuplicateHandle(GetCurrentProcess(), dupIn,
00896         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00897         goto error;
00898
00899     CloseHandle(dupIn);
00900     dupIn = 0;
00901
00902     if( !DuplicateHandle(GetCurrentProcess(), dupOut,
00903         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00904         goto error;
00905
00906     CloseHandle(dupOut);
00907     dupOut = 0;
00908
00909     if( !startupInfo->hasTty )
00910     {
00911         // redirect stdout, stderr, stdin
00912         if( !CreatePipe(&stdChildIn, &stddupIn, &lsa, 0) )
00913             goto error;
00914
00915         if( !CreatePipe(&stddupOut, &stdChildOut, &lsa, 0) )
00916             goto error;
00917
00918         if( !CreatePipe(&stddupErr, &stdChildErr, &lsa, 0) )
00919             goto error;
00920
00921         // same thing as above
00922         if( !DuplicateHandle(GetCurrentProcess(), stddupIn,
00923             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00924             goto error;
00925
00926         CloseHandle(stddupIn);
00927         stddupIn = 0;
00928
00929         if( !DuplicateHandle(GetCurrentProcess(), stddupOut,
00930             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00931             goto error;
00932
00933         CloseHandle(stddupOut);
00934         stddupOut = 0;
00935
00936         if( !DuplicateHandle(GetCurrentProcess(), stddupErr,
00937             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00938             goto error;
00939
00940         CloseHandle(stddupErr);
00941         stddupErr = 0;
00942     }
00943
00944     // Build the arguments for cvs
00945     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00946     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00947
00948     command = build_command(cvs_process->argc, cvs_process->args);
00949     if( command == 0L )
00950         goto error;
00951
00952     // Redirect Console StdHandles and set the start options
00953     memset(&si, 0, sizeof(STARTUPINFO));
00954     si.cb = sizeof(STARTUPINFO);
00955     si.dwFlags = startupInfo->hasTty ? 0 : STARTF_USESTDHANDLES;
00956     si.hStdInput = stdChildIn;
00957     si.hStdOutput = stdChildOut;
00958     si.hStdError = stdChildErr;
00959
00960     if( !startupInfo->hasTty )
00961     {
00962         si.dwFlags |= STARTF_USESHOWWINDOW;
00963         si.wShowWindow = SW_SHOWMINNOACTIVE;
00964
00965         stdoldIn  = GetStdHandle(STD_INPUT_HANDLE);
00966         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
00967         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
00968         SetStdHandle(STD_INPUT_HANDLE,  stdChildIn);
00969         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
00970         SetStdHandle(STD_ERROR_HANDLE,  stdChildErr);
00971     }
00972
00973     // Create Child Process
00974     resCreate = CreateProcess(
00975         NULL,
00976         command,
00977         NULL,
00978         NULL,
00979         TRUE,
00980         NORMAL_PRIORITY_CLASS | CREATE_SUSPENDED,
00981         NULL,
00982         startupInfo->currentDirectory && strlen(startupInfo->currentDirectory) ? startupInfo->currentDirectory : NULL,
00983         &si,
00984         &pi);
00985
00986     if( !startupInfo->hasTty )
00987     {
00988         SetStdHandle(STD_INPUT_HANDLE,  stdoldIn);
00989         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
00990         SetStdHandle(STD_ERROR_HANDLE,  stdoldErr);
00991     }
00992
00993     if( !resCreate )
00994         goto error;
00995
00996     cvs_process->threadID = pi.dwProcessId;
00997     cvs_process->pid = pi.hProcess;
00998
00999     cnt = 0;
01000
01001     // Create a stop process event
01002     cvs_process->stopProcessEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
01003     if( !cvs_process->stopProcessEvent )
01004     {
01005         goto error;
01006     }
01007
01008     // Now open-up threads which will serve the pipes
01009     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01010     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)MonitorChld;
01011
01012     if( !startupInfo->hasTty )
01013     {
01014         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01015         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01016     }
01017
01018     for(i = 0; i < cnt; i++)
01019     {
01020         if( (cvs_process->threads[i] = ::CreateThread(
01021             (LPSECURITY_ATTRIBUTES)NULL,                    // No security attributes.
01022             (DWORD)0,                                       // Use same stack size.
01023             (LPTHREAD_START_ROUTINE)threadsFunc[i],         // Thread procedure.
01024             (LPVOID)cvs_process,                            // Parameter to pass.
01025             (DWORD)0,                                       // Run immediately.
01026             (LPDWORD)&cvs_process->threadsID[i])) == NULL )
01027         {
01028             TerminateProcess(cvs_process->pid, 0);
01029             goto error;
01030         }
01031     }
01032
01033     //Close unneccesary Handles
01034     CloseHandle(cvs_process->his_read);
01035     cvs_process->his_read = 0;
01036     CloseHandle(cvs_process->his_write);
01037     cvs_process->his_write = 0;
01038
01039     if( !startupInfo->hasTty )
01040     {
01041         CloseHandle(stdChildIn);
01042         CloseHandle(stdChildOut);
01043         CloseHandle(stdChildErr);
01044     }
01045
01046     // Resume process execution
01047     ResumeThread(pi.hThread);
01048     CloseHandle(pi.hThread);
01049
01050     // Small tactical delay to reduce problems with process termination
01051     Sleep(100);
01052
01053     free(command);
01054
01055     goto goodboy;
01056
01057 error:
01058     if(cvs_process->his_read != 0L)
01059         CloseHandle(cvs_process->his_read);
01060     if(cvs_process->his_write != 0L)
01061         CloseHandle(cvs_process->his_write);
01062     if(dupIn != 0L)
01063         CloseHandle(dupIn);
01064     if(dupOut != 0L)
01065         CloseHandle(dupOut);
01066     if(cvs_process->my_read != 0L)
01067         CloseHandle(cvs_process->my_read);
01068     if(cvs_process->my_write != 0L)
01069         CloseHandle(cvs_process->my_write);
01070     if(command != 0L)
01071         free(command);
01072     if(stdChildIn != 0L)
01073         CloseHandle(stdChildIn);
01074     if(stdChildOut != 0L)
01075         CloseHandle(stdChildOut);
01076     if(stdChildErr != 0L)
01077         CloseHandle(stdChildErr);
01078     if(stddupIn != 0L)
01079         CloseHandle(stddupIn);
01080     if(stddupOut != 0L)
01081         CloseHandle(stddupOut);
01082     if(stddupErr != 0L)
01083         CloseHandle(stddupErr);
01084     if(cvs_process->pstdin != 0L)
01085         CloseHandle(cvs_process->pstdin);
01086     if(cvs_process->pstdout != 0L)
01087         CloseHandle(cvs_process->pstdout);
01088     if(cvs_process->pstderr != 0L)
01089         CloseHandle(cvs_process->pstderr);
01090
01091     cvs_process_destroy (cvs_process);
01092     return 0L;
01093
01094 goodboy:
01095 #endif
01096
01097     {
01098         CStackThreadLock locker;
01099
01100         open_cvs_process.push_back(cvs_process);
01101     }
01102
01103     cvs_process->open = TRUE;
01104 #ifdef WIN32
01105     cvs_process->starting = FALSE;
01106 #endif
01107
01108     return cvs_process;
01109 }

void cvs_process_stop ( CvsProcess * cvs_process )

Stop a process

Parameters:
cvs_process Cvs process to be stopped

Definition at line 1253 of file cvsgui_process.cpp.

References cvs_process_kill(), and _CvsProcess::stopProcessEvent.

Referenced by launchCVS(), UCvsFrame::OnCmdStopcvs(), and stopCVS().

01254 {
01255 #ifdef WIN32
01256     // On windows we need to kill process "from within" to avoid race condition with MonitorChld thread
01257     SetEvent(cvs_process->stopProcessEvent);
01258 #else
01259     cvs_process_kill(cvs_process);
01260 #endif
01261 }

Generated on Fri Jan 31 12:09:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 407 of file cvsgui_process.cpp.

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

Referenced by myflush().

00408 {
00409     WireMessage msg;
00410     GPT_CONSOLE* t = (GPT_CONSOLE*)malloc(sizeof(GPT_CONSOLE));
00411
00412     msg.type = GP_CONSOLE;
00413     msg.data = t;
00414
00415     t->isStderr = isStderr;
00416     t->len = len;
00417     t->str = (char*)malloc((len + 1) * sizeof(char));
00418     memcpy(t->str, str, len * sizeof(char));
00419     t->str[len] = '\0';
00420
00421     if( !wire_write_msg(fd, &msg) )
00422         return FALSE;
00423
00424     if( !wire_flush(fd) )
00425         return FALSE;
00426
00427     return TRUE;
00428 }

char* gp_getenv_read ( pipe_t fd )

Definition at line 384 of file cvsgui_process.cpp.

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

Referenced by cvsguiglue_getenv().

00385 {
00386     WireMessage msg;
00387     char* res;
00388
00389     memset(&msg, 0, sizeof(WireMessage));
00390     if( !wire_read_msg(fd, &msg) || msg.type != GP_GETENV )
00391     {
00392         fprintf(stderr, "cvsgui protocol error !\n");
00393         exit(-1);
00394     }
00395
00396     GPT_GETENV* t = (GPT_GETENV*)msg.data;
00397     res = t->empty ? 0L : strdup(t->str);
00398     wire_destroy(&msg);
00399
00400     return res;
00401 }

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

Definition at line 363 of file cvsgui_process.cpp.

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

Referenced by cvs_process_handle_message(), and cvsguiglue_getenv().

00364 {
00365     WireMessage msg;
00366     GPT_GETENV* t = (GPT_GETENV*)malloc(sizeof(GPT_GETENV));
00367
00368     msg.type = GP_GETENV;
00369     msg.data = t;
00370
00371     t->empty = env == 0L;
00372     t->str = strdup(env == 0L ? "" : env);
00373
00374     if( !wire_write_msg(fd, &msg) )
00375         return FALSE;
00376
00377     wire_destroy(&msg);
00378     if( !wire_flush (fd) )
00379         return FALSE;
00380
00381     return TRUE;
00382 }

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

Definition at line 344 of file cvsgui_process.cpp.

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

Referenced by cvsguiglue_exit(), and main().

00345 {
00346     WireMessage msg;
00347     GPT_QUIT* t = (GPT_QUIT*)malloc(sizeof(GPT_QUIT));
00348
00349     msg.type = GP_QUIT;
00350     msg.data = t;
00351
00352     t->code = code;
00353
00354     if( !wire_write_msg(fd, &msg) )
00355         return FALSE;
00356
00357     if( !wire_flush(fd) )
00358         return FALSE;
00359
00360     return TRUE;
00361 }

Variable Documentation

pipe_t _cvsgui_readfd

Definition at line 62 of file cvsgui_protocol.h.

Referenced by cvsguiglue_getenv(), cvsguiglue_getpass(), and main().

pipe_t _cvsgui_writefd

Definition at line 63 of file cvsgui_protocol.h.

Referenced by cvsguiglue_exit(), and main().

Generated on Fri Jan 31 12:09:42 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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

Function Documentation

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

Definition at line 54 of file cvsgui_wire.cpp.

References err.

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, CAllHandlers::wire_ht, and WireHandler.

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.

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.

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.

References FALSE, read(), TRUE, and wire_error_val.

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.

References FALSE, free, 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, 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, TRUE, and wire_read_int8().

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.

References wire_read().

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.

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

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.

References FALSE, free, gchar, guint32, malloc, NULL, TRUE, wire_read_int32(), and wire_read_int8().

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 _WireHandler::destroy_func, malloc, _WireHandler::read_func, sHandlers, STD_STL, _WireHandler::type, CAllHandlers::wire_ht, WireHandler, and _WireHandler::write_func.

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 wire_flush_func.

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 wire_read_func.

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.

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.

References FALSE, TRUE, wire_error_val, and write().

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.

References FALSE, gchar, 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, guint16, 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, guint32, TRUE, and wire_write_int8().

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.

References wire_write().

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.

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

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.

References FALSE, guint32, TRUE, wire_write_int32(), and wire_write_int8().

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 }

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

Definition at line 66 of file cvsgui_wire.cpp.

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 Fri Jan 31 12:09:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 CCJMenu::AddBitmapToImageList(), CCJStatusBar::AddControl(), CCJStatusBar::AddIndicator(), 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(), CItemListDlg::CItemListDlg(), 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(), CCJTabCtrlBar::CreateTabView(), CRtag_OPTIONS::CRtag_OPTIONS(), CUpdateMain::CUpdateMain(), CUpdateMerge::CUpdateMerge(), CUpdateSticky::CUpdateSticky(), cvs_process_close(), cvs_process_flush(), cvs_process_new(), cvs_process_run(), cvs_process_terminate(), cvs_process_write(), CWincvsApp::CWincvsApp(), CCJFlatTabCtrl::DeleteItem(), CHistComboBoxEx::DelKeyTest(), CSmartComboBox::DelKeyTest(), CBrowseFileView::DoDrag(), CCJMenu::DrawItem(), FileTimeToUnixTime(), CCJTreeCtrl::FindItem(), GetAsSystemTime(), CCJColorPopup::GetCellRect(), CCJTabCtrlBar::GetImageIndexFromRuntimeClass(), CCJTreeCtrl::GetItemFont(), CCJFlatTabCtrl::GetItemRect(), CCJMenu::GetMenuText(), GetNextParentWindow(), CTipDlg::GetNextTipString(), CCJHtmlView::GetProperty(), CCJStatusBar::GetStatusPane(), CCJHyperLink::GotoURL(), gp_console_write(), gp_getenv_write(), gp_quit_write(), CWincvsApp::InitATL(), CMainFrame::InitializeDockingWindows(), CCJMDIFrameWnd::InitializeMenu(), CWincvsApp::InitInstance(), CLogoutThread::InitInstance(), CCJToolBar::InsertControl(), CCJSizeDockBar::IsLastControlBar(), CCJToolBar::Layout(), CCJToolBar::LoadBitmap(), CCJHtmlView::LoadFromResource(), CCJMenu::LoadFromToolBar(), CCJMenu::LoadMenu(), CCJToolBar::LoadToolBar(), CCJMenu::LoadToolbar(), CCJMenu::LoadToolbars(), CCJWindowPlacement::LoadWindowPos(), CCJControlBar::Minimize(), CCJHexEdit::Move(), CCJControlBar::Normalize(), CMainFrame::OnActivate(), CCJHtmlView::OnBeforeNavigate2(), CMainFrame::OnBroadcastCmdMsg(), CCJControlBar::OnButtonMinimize(), CCJMaskEdit::OnChar(), CGraphView::OnContextMenu(), CItemListDlg::OnInitDialog(), CAdminOptionDlg::OnInitDialog(), CMainFrame::OnInitMenu(), CCustomizeMenus::OnItemchangedMenulist(), CCJFlatComboBox::OnKillFocus(), CCJSizeDockBar::OnLButtonUp(), CCJFlatComboBox::OnLButtonUp(), CCJFlatButton::OnLButtonUp(), CCJControlBar::OnLButtonUp(), CCJMenuBar::OnMenuInput(), CCJHyperLink::OnMouseMove(), CCJToolBar::OnNcCreate(), CCJReBar::OnNcCreate(), CWincvsDoc::OnNewDocument(), CGraphDoc::OnNewDocument(), CCJHtmlView::OnNewWindow2(), CCJPagerCtrl::OnPagerCalcSize(), CCJPagerCtrl::OnPagerScroll(), CCJHexEdit::OnPaint(), CCJToolBar::OnPreserveZeroBorderHelper(), CCJColorPicker::OnSelEndCancel(), CCJColorPicker::OnSelEndOK(), CCJSizeDockBar::OnSetCursor(), CCJHyperLink::OnSetCursor(), CCJControlBar::OnSetCursor(), CCJToolBar::OnSetSizeHelper(), CCJHtmlView::OnSize(), CCJFlatComboBox::OnTimer(), CCJFlatButton::OnTimer(), CCJToolBar::OnToolBarGetButtonInfo(), CCJControlBar::OnUpdateCmdUI(), CWincvsDoc::OnUpdateCvsCmd(), CBrowseFileView::OnUpdateCvsCmd(), CGraphView::OnUpdateGraphChangelogmessage(), CGraphView::OnUpdateGraphSetdescription(), CGraphView::OnUpdateGraphSetstate(), CWincvsDoc::OnUpdatePrefs(), CGraphView::OnUpdateQueryAnnotate(), CWincvsDoc::OnUpdateStopcvs(), CBrowseFileView::OnUpdateViewAdd(), CBrowseFileView::OnUpdateViewAddB(), CBrowseFileView::OnUpdateViewAnnotate(), CBrowseFileView::OnUpdateViewEditseldef(), CBrowseFileView::OnUpdateViewExplore(), CBrowseFileView::OnUpdateViewGraph(), CBrowseFileView::OnUpdateViewRelease(), CGraphView::OnUpdateViewRetrieve(), CBrowseFileView::OnUpdateViewRmv(), CGraphView::OnUpdateViewUnlockf(), CBrowseFileView::OnUpdateViewUpdate(), CCJTreeCtrl::PreCreateWindow(), CCJToolBar::PreCreateWindow(), CCJHexEdit::PreCreateWindow(), CCJFlatTabCtrl::PreCreateWindow(), CSplashWnd::PreTranslateAppMessage(), CCJFlatSplitterWnd::ReplaceView(), CBrowseFileView::ResetView(), SaveBmpFromDDB(), SaveDIB(), CItemListDlg::SelectItem(), CCJTreeCtrl::SelectItems(), CCJToolBar::SetButtons(), CCJToolBar::SetButtonText(), CCJMonthCalCtrl::SetCurSel(), CCJComboBoxEx::SetEditSel(), CCJMonthCalCtrl::SetSelRange(), CCJDateTimeCtrl::SetTime(), CCJMenuBar::SetTrackingState(), CCJMonthCalCtrl::SizeMinReq(), CCJDockContext::StartResize(), CCJFlatSplitterWnd::SwitchView(), CCommit_MAIN::SwitchWrapEdit(), TmFromOleDate(), CCJDockContext::TrackDockBar(), CCJMenuBar::TranslateFrameMessage(), CCJMenu::UnSetBitmapBackground(), CCJMenu::UnSetDisableOldStyle(), 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 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(), CMfFileDialog::CMfFileDialog(), CNoPython::CNoPython(), CompatGetAnnotate(), CompatGetCheckout(), CompatGetCommand(), CompatGetImport(), CompatGetInit(), CompatGetLog(), CompatGetLogin(), 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_run(), cvs_process_terminate(), cvs_process_write(), CCJFlatTabCtrl::DeleteAllItems(), CCJFlatTabCtrl::DeleteItem(), CHistComboBoxEx::DelKeyTest(), CSmartComboBox::DelKeyTest(), CCJMenu::Draw3DCheckmark(), CCJCaptionButton::DrawButtonText(), CCJMenu::DrawItem(), CCJColorPicker::DrawItem(), CCJToolCmdUI::Enable(), CCJFontCombo::EnumFontProc(), CCJTreeCtrl::FindItem(), CProgressDlg::FlushDisplay(), FormatMenuString(), GetAsSystemTime(), 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(), CCJControlBar::Maximize(), CCJMenuBar::MenuInputFilter(), CCJHexEdit::Move(), CCJToolBar::OnBarStyleChange(), CMainFrame::OnBroadcastCmdMsg(), CCJControlBar::OnButtonMinimize(), CGfxGroupEdit::OnChar(), CCJColorPicker::OnClicked(), CLogFrame::OnCmdMsg(), CGraphFrame::OnCmdMsg(), CWinCvsBrowser::OnCustomize(), CBrowseFileView::OnCustomize(), 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(), CNoPython::OnInitDialog(), CCustomizeMenus::OnInitDialog(), CPseudoDlg::OnInitDialog(), CUpdateSticky::OnInitDialog(), CTag_MAIN::OnInitDialog(), CSelectionDetailsDlg::OnInitDialog(), CRtag_OPTIONS::OnInitDialog(), CRtag_MAIN::OnInitDialog(), CProgressDlg::OnInitDialog(), COptionalPropertySheet::OnInitDialog(), CCmdLine_MAIN::OnInitDialog(), CItemListDlg::OnInitDialog(), CImportFilterDlg::OnInitDialog(), CGetPrefs_GLOBALS::OnInitDialog(), GetPassword::OnInitDialog(), CEditorMonDlg::OnInitDialog(), CDiff_Options::OnInitDialog(), CDiff_MAIN::OnInitDialog(), CCommit_MAIN::OnInitDialog(), CCheckout_OPTIONS::OnInitDialog(), CAdminOptionDlg::OnInitDialog(), CMainFrame::OnInitMenu(), CCustomizeMenus::OnItemchangedMenulist(), CWinCvsBrowser::OnItemexpanding(), CCJHexEdit::OnKeyDown(), CCJFlatComboBox::OnLButtonDown(), CCJFlatButton::OnLButtonDown(), CCJControlBar::OnLButtonDown(), CCJMenuBar::OnMenuInput(), CCJMenuBar::OnMenuSelect(), CCmdLine_MAIN::OnModule(), CCJHyperLink::OnMouseMove(), CCJToolBar::OnNcCreate(), CCJReBar::OnNcCreate(), CCJSizeDockBar::OnNcLButtonDown(), CWincvsDoc::OnNewDocument(), CGraphDoc::OnNewDocument(), CCJListView::OnNotify(), CCJListCtrl::OnNotify(), CCJHexEdit::OnPaint(), CGraphView::OnPreparePrinting(), CBrowseFileView::OnPreparePrinting(), CCJColorPicker::OnSelChange(), CWinCvsBrowser::OnSelchanging(), CCJColorPicker::OnSelEndCancel(), CCJColorPicker::OnSelEndOK(), CWinCvsBrowser::OnSetCursor(), CCJHyperLink::OnSetCursor(), CCJFlatButton::OnSetCursor(), CBrowseFileView::OnSetCursor(), CCJFlatComboBox::OnSetFocus(), CCmdLine_MAIN::OnTag(), CCJFlatComboBox::OnTimer(), CCJFlatButton::OnTimer(), CCJToolBar::OnToolBarGetButtonInfo(), CCJControlBar::OnUpdateCmdUI(), CWincvsDoc::OnUpdateCvsCmd(), CBrowseFileView::OnUpdateCvsCmd(), CWincvsDoc::OnUpdateMacroAdmin(), CWincvsDoc::OnUpdatePrefs(), CWincvsDoc::OnUpdateStopcvs(), CBrowseFileView::OnUpdateViewAdd(), CBrowseFileView::OnUpdateViewAddB(), CBrowseFileView::OnUpdateViewAnnotate(), CBrowseFileView::OnUpdateViewEditseldef(), CBrowseFileView::OnUpdateViewExplore(), CBrowseFileView::OnUpdateViewGraph(), CBrowseFileView::OnUpdateViewRelease(), CBrowseFileView::OnUpdateViewRmv(), CBrowseFileView::OnUpdateViewUpdate(), CCJHexEdit::OnVScroll(), PostCloseEnum(), CProgressDlg::PostNcDestroy(), CCJTreeCtrl::PreCreateWindow(), CCJToolBar::PreCreateWindow(), CCJHexEdit::PreCreateWindow(), CCJFlatTabCtrl::PreCreateWindow(), CSplashWnd::PreTranslateAppMessage(), CWincvsApp::PreTranslateMessage(), CHistComboBoxEx::PreTranslateMessage(), CGfxGroupEdit::PreTranslateMessage(), CCJTabCtrlBar::PreTranslateMessage(), CCJFrameWnd::PreTranslateMessage(), CCJFlatComboBox::PreTranslateMessage(), CSmartComboBox::PreTranslateMessage(), CCJTabCtrlBar::RemoveAllTabs(), CCJFlatSplitterWnd::ReplaceView(), CWincvsApp::SaveAllModified(), SaveBmpFromDDB(), SaveDIB(), CCJHexEdit::SelDelete(), CCJTreeCtrl::SelectItems(), CCJHexEdit::SelInsert(), CCJFlatButton::SetAlternateColors(), CCJMenu::SetBitmapBackground(), CCJHexEdit::SetBPR(), CCJToolBar::SetButtonInfo(), CCJToolBar::SetButtons(), CCJToolBar::SetButtonStyle(), CCJCaptionButton::SetButtonStyle(), CCJToolBar::SetButtonText(), CCJHexEdit::SetData(), CCJMenu::SetDisableOldStyle(), CCJHexEdit::SetOptions(), CCJMenuBar::SetTrackingState(), CCJMonthCalCtrl::SizeMinReq(), CCJDockContext::StartDragDockBar(), CCJFlatSplitterWnd::SwitchView(), CCommit_MAIN::SwitchWrapEdit(), TestBuffer(), TmFromOleDate(), CCJDockContext::TrackDockBar(), CCJMenuBar::TranslateFrameMessage(), CCJHexEdit::UpdateScrollbars(), 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(), and CCJToolBar::WrapToolBar().

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::OnListNewRow(), UWidget::OnListSetSortDir(), wire_read_string(), and wire_write_double().

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.

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().

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.

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_write_int16().

typedef unsigned int guint32

Definition at line 41 of file cvsgui_wire.h.

Referenced by wire_read_string(), wire_write_int32(), and wire_write_string().

typedef unsigned char guint8

Definition at line 37 of file cvsgui_wire.h.

Referenced by UWidget::OnListSetSortDir().

typedef unsigned long gulong

Definition at line 51 of file cvsgui_wire.h.

Referenced by cvs_process_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.

typedef void(* WireDestroyFunc)(WireMessage *msg)

Definition at line 83 of file cvsgui_wire.h.

typedef int(* WireFlushFunc)(pipe_t fd)

Definition at line 85 of file cvsgui_wire.h.

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

Definition at line 84 of file cvsgui_wire.h.

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.

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

Definition at line 82 of file cvsgui_wire.h.

Function Documentation

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, CAllHandlers::wire_ht, and WireHandler.

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.

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.

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.

References FALSE, read(), TRUE, and wire_error_val.

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.

References FALSE, free, 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, 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, TRUE, and wire_read_int8().

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.

References wire_read().

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.

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

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.

References FALSE, free, gchar, guint32, malloc, NULL, TRUE, wire_read_int32(), and wire_read_int8().

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 _WireHandler::destroy_func, malloc, _WireHandler::read_func, sHandlers, STD_STL, _WireHandler::type, CAllHandlers::wire_ht, WireHandler, and _WireHandler::write_func.

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 wire_flush_func.

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 wire_read_func.

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.

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.

References FALSE, TRUE, wire_error_val, and write().

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.

References FALSE, gchar, 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, guint16, 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, guint32, TRUE, and wire_write_int8().

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.

References wire_write().

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.

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

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.

References FALSE, guint32, TRUE, wire_write_int32(), and wire_write_int8().

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 Fri Jan 31 12:09:43 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by CFillPyEntries::EnterDirectory(), CFillTclEntries::EnterDirectory(), TViewFill::EnterDirectory(), TBrowserFill::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 TARGET_OS_MAC
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !TARGET_OS_MAC */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !TARGET_OS_MAC */
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 || TARGET_RT_MAC_MACHO
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 .DS_Store _$* *$");
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().

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 }

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 Fri Jan 31 12:09:44 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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

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 TARGET_OS_MAC
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !TARGET_OS_MAC */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !TARGET_OS_MAC */
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 || TARGET_RT_MAC_MACHO
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 .DS_Store _$* *$");
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.

References fnmatch().

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 Fri Jan 31 12:09:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 "WinCvsBrowser.h"
#include "wincvs.h"
#include "wincvs_winutil.h"

Include dependency graph for CvsPrefs.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | MigrateCvsrootList ()
Helper method to migrate into a single CMString for cvsroot history.

Variables

CvsPrefs gCvsPrefs
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 | gDisableSplashScreen ("P_DisableSplashScreen", false)
CPersistentInt | gStatusOutputType ("P_StatusOutputType", STATUSOUTPUT_VERBOSE)
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 | gHideCommandDlgStatus ("P_HideCommandDlgStatus", false)
CPersistentBool | gHideCommandDlgUseShift ("P_HideCommandDlgUseShift", true)
CKeyString | gWhichCvs (10,"P_WhichCvs")
CPersistentBool | gUseAltCvs ("P_UseAltCvs", false, kAddSettings)
PCStr | gSettingsFolder ("P_SettingsFolder", 0L)

Function Documentation

void MigrateCvsrootList ( )

Helper method to migrate into a single CMString for cvsroot history.

Definition at line 601 of file CvsPrefs.cpp.

References CStr, TMString< UStr >::Insert(), and NUM_CVSROOT.

Referenced by CvsPrefs::load().

00602 {
00603     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00604     {
00605         CStr cvsroot;
00606 #ifdef WIN32
00607         char tmp[20];
00608         sprintf(tmp, "P_Cvsroot%d", nIndex);
00609         BYTE* ppData;
00610         UINT pBytes = 0;
00611
00612         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00613         {
00614             continue;
00615         }
00616
00617         cvsroot = (char*)ppData;
00618         delete ppData;
00619 #endif /* WIN32 */
00620
00621 #if qUnix
00622 #endif // qUnix
00623
00624 #if qMacCvsPP
00625 #endif // qMacCvsPP
00626
00627         if( !cvsroot.empty() )
00628         {
00629             gOldCvsroots.Insert(cvsroot);
00630         }
00631     }
00632 }

Variable Documentation

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

Referenced by CvsPrefs::AddControl(), and CvsPrefs::SetAddControl().

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

Referenced by CvsPrefs::AlwaysUseCvsroot(), and CvsPrefs::SetAlwaysUseCvsroot().

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

Referenced by CvsPrefs::Browser(), and CvsPrefs::SetBrowser().

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

Referenced by CvsPrefs::CheckoutRO(), and CvsPrefs::SetCheckoutRO().

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

Referenced by CvsPrefs::CvsConsole(), and CvsPrefs::SetCvsConsole().

CvsPrefs gCvsPrefs

Definition at line 78 of file CvsPrefs.cpp.

Referenced by CvsPrefs::WhichCvs().

PCPStr gCvsroot("P_Cvsroot") [static]

Referenced by CvsPrefs::empty(), CvsPrefs::length(), CvsPrefs::operator const char *(), CvsPrefs::operator const unsigned char *(), and CvsPrefs::operator=().

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

Referenced by CvsPrefs::CvsVersion(), and CvsPrefs::SetCvsVersion().

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

Referenced by CvsPrefs::DirtySupport(), and CvsPrefs::SetDirtySupport().

CPersistentBool gDisableSplashScreen("P_DisableSplashScreen", false) [static]

Referenced by CvsPrefs::DisableSplashScreen(), and CvsPrefs::SetDisableSplashScreen().

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

Referenced by CvsPrefs::EncryptCommunication(), and CvsPrefs::SetEncryptCommunication().

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

Referenced by CvsPrefs::ExtDiff(), and CvsPrefs::SetExtDiff().

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

Referenced by CvsPrefs::Helper(), and CvsPrefs::SetHelper().

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

Referenced by CvsPrefs::HideCommandDlgAnnotate(), and CvsPrefs::SetHideCommandDlgAnnotate().

CPersistentBool gHideCommandDlgDiff("P_HideCommandDlgDiff", false) [static]

Referenced by CvsPrefs::HideCommandDlgDiff(), and CvsPrefs::SetHideCommandDlgDiff().

CPersistentBool gHideCommandDlgGraph("P_HideCommandDlgGraph", false) [static]

Referenced by CvsPrefs::HideCommandDlgGraph(), and CvsPrefs::SetHideCommandDlgGraph().

CPersistentBool gHideCommandDlgLog("P_HideCommandDlgLog", false) [static]

Referenced by CvsPrefs::HideCommandDlgLog(), and CvsPrefs::SetHideCommandDlgLog().

CPersistentBool gHideCommandDlgStatus("P_HideCommandDlgStatus", false) [static]

Referenced by CvsPrefs::HideCommandDlgStatus(), and CvsPrefs::SetHideCommandDlgStatus().

CPersistentBool gHideCommandDlgUpdate("P_HideCommandDlgUpdate", false) [static]

Referenced by CvsPrefs::HideCommandDlgUpdate(), and CvsPrefs::SetHideCommandDlgUpdate().

CPersistentBool gHideCommandDlgUseShift("P_HideCommandDlgUseShift", true) [static]

Referenced by CvsPrefs::HideCommandDlgUseShift(), and CvsPrefs::SetHideCommandDlgUseShift().

PCStr gHome("P_Home", 0L, kAddSettings) [static]

Referenced by CvsPrefs::Home(), and CvsPrefs::SetHome().

CPersistentBool gICTextOption("P_ICTextOption", false, kAddSettings) [static]

Referenced by CvsPrefs::ICTextOption(), and CvsPrefs::SetICTextOption().

CPersistentInt gIsoConvert("P_NIsoConvert", ISO8559_none, kAddSettings) [static]

Referenced by CvsPrefs::IsoConvert(), and CvsPrefs::SetIsoConvert().

CPersistentInt gKserverPort("P_KserverPort", -1, kAddSettings) [static]

Referenced by CvsPrefs::KserverPort(), and CvsPrefs::SetKserverPort().

PCStr gLastWorkingDir("P_LastWorkingDir", 0L, kAddSettings) [static]

Referenced by CvsPrefs::LastWorkingDir(), and CvsPrefs::SetLastWorkingDir().

CPersistentInt gLogoutTimeOut("P_LogoutTimeOut", 0) [static]

Referenced by CvsPrefs::LogoutTimeOut(), and CvsPrefs::SetLogoutTimeOut().

CPersistentInt gMacBinEncoding("P_NMacBinEncoding", MAC_HQX, kAddSettings) [static]

Referenced by CvsPrefs::MacBinEncoding(), and CvsPrefs::SetMacBinEncoding().

CPersistentBool gMacLF("P_MacLF", false, kAddSettings) [static]

Referenced by CvsPrefs::MacLF(), and CvsPrefs::SetMacLF().

CMString gOldCvsroots(20, "P_OldCvsroots")

Definition at line 98 of file CvsPrefs.h.

CPersistentInt gPersistentShema("P_PersistentShema", SCHEMA_0) [static]

Referenced by CvsPrefs::load(), and CvsPrefs::save().

PCStr gProxyHost("P_ProxyHost", "www.mydomain", kAddSettings) [static]

Referenced by CvsPrefs::ProxyHost(), and CvsPrefs::SetProxyHost().

CPersistentInt gProxyPort("P_ProxyPort", 8888, kAddSettings) [static]

Referenced by CvsPrefs::ProxyPort(), and CvsPrefs::SetProxyPort().

CPersistentBool gPruneOption("P_PruneOption", true, kAddSettings) [static]

Referenced by CvsPrefs::PruneOption(), and CvsPrefs::SetPruneOption().

CPersistentInt gPserverPort("P_PserverPort", -1, kAddSettings) [static]

Referenced by CvsPrefs::PserverPort(), and CvsPrefs::SetPserverPort().

CPersistentBool gQuietOption("P_QuietOption", false) [static]

Referenced by CvsPrefs::QuietOption(), and CvsPrefs::SetQuietOption().

CPersistentInt gRhostPort("P_RhostPort", -1, kAddSettings) [static]

Referenced by CvsPrefs::RhostPort(), and CvsPrefs::SetRhostPort().

PCStr gRshName("P_RshName", 0L, kAddSettings) [static]

Referenced by CvsPrefs::RshName(), and CvsPrefs::SetRshName().

PCPStr gServerName("P_ServerName", 0L, kAddSettings) [static]

Referenced by CvsPrefs::ServerName(), and CvsPrefs::SetServerName().

PCStr gSettingsFolder("P_SettingsFolder", 0L) [static]

Referenced by CvsPrefs::SetSettingsFolder(), and CvsPrefs::SettingsFolder().

CPersistentInt gStatusOutputType("P_StatusOutputType", STATUSOUTPUT_VERBOSE) [static]

Referenced by CvsPrefs::SetStatusOutputType(), and CvsPrefs::StatusOutputType().

CPersistentBool gUnixLF("P_UnixLF", false, kAddSettings) [static]

Referenced by CvsPrefs::SetUnixLF(), and CvsPrefs::UnixLF().

CPersistentBool gUseAltCvs("P_UseAltCvs", false, kAddSettings) [static]

Referenced by CvsPrefs::SetUseAltCvs(), and CvsPrefs::UseAltCvs().

CPersistentBool gUseProxy("P_UseProxy", false, kAddSettings) [static]

Referenced by CvsPrefs::SetUseProxy(), and CvsPrefs::UseProxy().

CPersistentInt gUseShell("P_UseShell", SHELL_TCL) [static]

Referenced by CvsPrefs::GetUseShell(), and CvsPrefs::SetUseShell().

CPersistentBool gUseViewerAlways("P_UseViewerAlways", false, kAddSettings) [static]

Referenced by CvsPrefs::SetUseViewerAlways(), and CvsPrefs::UseViewerAlways().

PCStr gViewer("P_Viewer", "Notepad") [static]

Referenced by CvsPrefs::SetViewer(), and CvsPrefs::Viewer().

CKeyString gWhichCvs(10, "P_WhichCvs" ) [static]

Referenced by CvsPrefs::SetWhichCvs(), and CvsPrefs::WhichCvs().

CPersistentInt gWordWrapLogMsg("P_WordWrapLogMsg", 0, kAddSettings) [static]

Referenced by CvsPrefs::SetWordWrapLogMsg(), and CvsPrefs::WordWrapLogMsg().

CPersistentBool gZ9Option("P_Z9Option", false, kAddSettings) [static]

Referenced by CvsPrefs::SetZ9Option(), and CvsPrefs::Z9Option().

CPersistentInt gZLevel("P_ZLevel", 9, kAddSettings) [static]

Referenced by CvsPrefs::SetZLevel(), and CvsPrefs::ZLevel().

Generated on Fri Jan 31 12:09:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 STATUSOUTPUT_TYPE {
STATUSOUTPUT_STANDARD,
STATUSOUTPUT_QUICK,
STATUSOUTPUT_VERBOSE
}
enum kWinVersion {
kWin16,
kWinNT35,
kWinNT4,
kWin32
}

Functions

void | MigrateCvsrootList ()
Helper method to migrate into a single CMString for cvsroot history.

Variables

CMString gOldCvsroots
CvsPrefs gCvsPrefs

Define Documentation

#define MIGRATECVSROOTLIST

Definition at line 40 of file CvsPrefs.h.

#define NUM_CVSROOT 20

Definition at line 85 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().

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 88 of file CvsPrefs.h.

Referenced by CvsPrefs::WhichVersion().

00089     {
00090         kWin16,
00091         kWinNT35,
00092         kWinNT4,
00093         kWin32
00094     } kWinVersion;

enum MACENCODING

Enumeration values:
MAC_HQX
MAC_APPSINGLE

Definition at line 66 of file CvsPrefs.h.

Referenced by CvsPrefs::MacBinEncoding().

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().

00073 {
00074     SHELL_TCL,
00075     SHELL_PYTHON
00076 } SHELL_KIND;

enum STATUSOUTPUT_TYPE

Enumeration values:
STATUSOUTPUT_STANDARD
STATUSOUTPUT_QUICK
STATUSOUTPUT_VERBOSE

Definition at line 78 of file CvsPrefs.h.

Referenced by CvsCmdStatus(), and CvsPrefs::StatusOutputType().

00079 {
00080     STATUSOUTPUT_STANDARD,
00081     STATUSOUTPUT_QUICK,
00082     STATUSOUTPUT_VERBOSE
00083 } STATUSOUTPUT_TYPE;

Function Documentation

void MigrateCvsrootList ( )

Helper method to migrate into a single CMString for cvsroot history.

Definition at line 601 of file CvsPrefs.cpp.

References CStr, TMString< UStr >::Insert(), and NUM_CVSROOT.

Referenced by CvsPrefs::load().

00602 {
00603     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00604     {
00605         CStr cvsroot;
00606 #ifdef WIN32
00607         char tmp[20];
00608         sprintf(tmp, "P_Cvsroot%d", nIndex);
00609         BYTE* ppData;
00610         UINT pBytes = 0;
00611
00612         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00613         {
00614             continue;
00615         }
00616
00617         cvsroot = (char*)ppData;
00618         delete ppData;
00619 #endif /* WIN32 */
00620
00621 #if qUnix
00622 #endif // qUnix
00623
00624 #if qMacCvsPP
00625 #endif // qMacCvsPP
00626
00627         if( !cvsroot.empty() )
00628         {
00629             gOldCvsroots.Insert(cvsroot);
00630         }
00631     }
00632 }

Variable Documentation

CvsPrefs gCvsPrefs

Definition at line 267 of file CvsPrefs.h.

Referenced by CvsPrefs::WhichCvs().

CMString gOldCvsroots

Definition at line 98 of file CvsPrefs.h.

Generated on Fri Jan 31 12:09:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "UpdateDlg.h"
#include "ItemListDlg.h"
#include "CPStr.h"
#include "GetPrefs.h"

Include dependency graph for DiffDlg.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | _sDiffOptionsItem
Define the diff options list items. More...

Defines

#define | _DIFF_CPP_
#define | STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT "[%s]: %s"
#define | STR_DIFFOPT_OPT_A "-a"
#define | STR_DIFFOPT_DESC_A "Treat all files as text and compare them line-by-line, even if they do not seem to be text"
#define | STR_DIFFOPT_OPT_B "-b"
#define | STR_DIFFOPT_DESC_B "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"
#define | STR_DIFFOPT_OPT_BB "-B"
#define | STR_DIFFOPT_DESC_BB "Ignore changes that just insert or delete blank lines"
#define | STR_DIFFOPT_OPT_BINARY "--binary"
#define | STR_DIFFOPT_DESC_BINARY "Read and write data in binary mode"
#define | STR_DIFFOPT_OPT_BRIEF "--brief"
#define | STR_DIFFOPT_DESC_BRIEF "Report only whether the files differ, not the details of the differences"
#define | STR_DIFFOPT_OPT_C "-c"
#define | STR_DIFFOPT_DESC_C "Use the context output format"
#define | STR_DIFFOPT_OPT_CC "-C lines"
#define | STR_DIFFOPT_DESC_CC "Use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"
#define | STR_DIFFOPT_OPT_C_G_F "--changed-group-format=format"
#define | STR_DIFFOPT_DESC_C_G_F "Use format to output a line group containing differing lines from both files in if-then-else format. See CVS manual for line group formats"
#define | STR_DIFFOPT_OPT_D "-d"
#define | STR_DIFFOPT_DESC_D "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"
#define | STR_DIFFOPT_OPT_E "-e"
#define | STR_DIFFOPT_DESC_E "Make output that is a valid ed script"
#define | STR_DIFFOPT_OPT_E_T "--expand-tabs"
#define | STR_DIFFOPT_DESC_E_T "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"
#define | STR_DIFFOPT_OPT_F "-f"
#define | STR_DIFFOPT_DESC_F "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"
#define | STR_DIFFOPT_OPT_FF "-F regexp"
#define | STR_DIFFOPT_DESC_FF "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"
#define | STR_DIFFOPT_OPT_F_E "--forward-ed"
#define | STR_DIFFOPT_DESC_F_E "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"
#define | STR_DIFFOPT_OPT_HH "-H"
#define | STR_DIFFOPT_DESC_HH "Use heuristics to speed handling of large files that have numerous scattered small changes"
#define | STR_DIFFOPT_OPT_H_L "--horizon-lines=lines"
#define | STR_DIFFOPT_DESC_H_L "Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix"
#define | STR_DIFFOPT_OPT_I "-i"
#define | STR_DIFFOPT_DESC_I "Ignore changes in case; consider upper- and lower-case letters equivalent"
#define | STR_DIFFOPT_OPT_II "-I regexp"
#define | STR_DIFFOPT_DESC_II "Ignore changes that just insert or delete lines that match regexp"
#define | STR_DIFFOPT_OPT_IFDEF "--ifdef=name"
#define | STR_DIFFOPT_DESC_IFDEF "Make merged if-then-else output using name"
#define | STR_DIFFOPT_OPT_I_A_S "--ignore-all-space"
#define | STR_DIFFOPT_DESC_I_A_S "Ignore white space when comparing lines"
#define | STR_DIFFOPT_OPT_I_B_L "--ignore-blank-lines"
#define | STR_DIFFOPT_DESC_I_B_L "Ignore changes that just insert or delete blank lines"
#define | STR_DIFFOPT_OPT_I_C "--ignore-case"
#define | STR_DIFFOPT_DESC_I_C "Ignore changes in case; consider upper- and lower-case to be the same"
#define | STR_DIFFOPT_OPT_I_M_L "--ignore-matching-lines=regexp"
#define | STR_DIFFOPT_DESC_I_M_L "Ignore changes that just insert or delete lines that match regexp"
#define | STR_DIFFOPT_OPT_I_S_C "--ignore-space-change"
#define | STR_DIFFOPT_DESC_I_S_C "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"
#define | STR_DIFFOPT_OPT_I_T "--initial-tab"
#define | STR_DIFFOPT_DESC_I_T "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"
#define | STR_DIFFOPT_OPT_LL "-L label"
#define | STR_DIFFOPT_DESC_LL "Use label instead of the file name in the context format and unified format headers"
#define | STR_DIFFOPT_OPT_LABEL "--label=label"
#define | STR_DIFFOPT_DESC_LABEL "Use label instead of the file name in the context format and unified format headers"
#define | STR_DIFFOPT_OPT_L_C "--left-column"
#define | STR_DIFFOPT_DESC_L_C "Print only the left column of two common lines in side by side format"
#define | STR_DIFFOPT_OPT_L_F "--line-format=format"
#define | STR_DIFFOPT_DESC_L_F "Use format to output all input lines in if-then-else format. See CVS manual for line formats"
#define | STR_DIFFOPT_OPT_MINIMAL "--minimal"
#define | STR_DIFFOPT_DESC_MINIMAL "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"
#define | STR_DIFFOPT_OPT_N "-n"
#define | STR_DIFFOPT_DESC_N "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"
#define | STR_DIFFOPT_OPT_NN "-N"
#define | STR_DIFFOPT_DESC_NN "In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory"
#define | STR_DIFFOPT_OPT_N_G_F "--new-group-format=format"
#define | STR_DIFFOPT_DESC_N_G_F "Use format to output a group of lines taken from just the second file in if-then-else format. See section A.9.1.1 Line group formats"
#define | STR_DIFFOPT_OPT_N_L_F "--new-line-format=format"
#define | STR_DIFFOPT_DESC_N_L_F "Use format to output a line taken from just the second file in if-then-else format. See CVS manual for line formats"
#define | STR_DIFFOPT_OPT_O_G_F "--old-group-format=format"
#define | STR_DIFFOPT_DESC_O_G_F "Use format to output a group of lines taken from just the first file in if-then-else format. See section A.9.1.1 Line group formats"
#define | STR_DIFFOPT_OPT_O_L_F "--old-line-format=format"
#define | STR_DIFFOPT_DESC_O_L_F "Use format to output a line taken from just the first file in if-then-else format. See CVS manual for line formats"
#define | STR_DIFFOPT_OPT_P "-p"
#define | STR_DIFFOPT_DESC_PP "Show which C function each change is in"
#define | STR_DIFFOPT_OPT_RCS "--rcs"
#define | STR_DIFFOPT_DESC_RCS "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"
#define | STR_DIFFOPT_OPT_S "-s"
#define | STR_DIFFOPT_DESC_S "Report when two files are the same"
#define | STR_DIFFOPT_OPT_S_C_F "--show-c-function"
#define | STR_DIFFOPT_DESC_S_C_F "Show which C function each change is in"
#define | STR_DIFFOPT_OPT_S_F_L "--show-function-line=regexp"
#define | STR_DIFFOPT_DESC_S_F_L "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"
#define | STR_DIFFOPT_OPT_S_B_S "--side-by-side"
#define | STR_DIFFOPT_DESC_S_B_S "Use the side by side output format"
#define | STR_DIFFOPT_OPT_S_L_F "--speed-large-files"
#define | STR_DIFFOPT_DESC_S_L_F "Use heuristics to speed handling of large files that have numerous scattered small changes"
#define | STR_DIFFOPT_OPT_S_C_L "--suppress-common-lines"
#define | STR_DIFFOPT_DESC_S_C_L "Do not print common lines in side by side format"
#define | STR_DIFFOPT_OPT_T "-t"
#define | STR_DIFFOPT_DESC_T "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"
#define | STR_DIFFOPT_OPT_TT "-T"
#define | STR_DIFFOPT_DESC_TT "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"
#define | STR_DIFFOPT_OPT_TEXT "--text"
#define | STR_DIFFOPT_DESC_TEXT "Treat all files as text and compare them line-by-line, even if they do not appear to be text"
#define | STR_DIFFOPT_OPT_U "-u"
#define | STR_DIFFOPT_DESC_U "Use the unified output format"
#define | STR_DIFFOPT_OPT_U_G_F "--unchanged-group-format=format"
#define | STR_DIFFOPT_DESC_U_G_F "Use format to output a group of common lines taken from both files in if-then-else format. See section A.9.1.1 Line group formats"
#define | STR_DIFFOPT_OPT_U_L_F "--unchanged-line-format=format"
#define | STR_DIFFOPT_DESC_U_L_F "Use format to output a line common to both files in if-then-else format. See CVS manual for line formats"
#define | STR_DIFFOPT_OPT_UU "-U lines"
#define | STR_DIFFOPT_DESC_UU "Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"
#define | STR_DIFFOPT_OPT_W "-w"
#define | STR_DIFFOPT_DESC_W "Ignore white space when comparing lines"
#define | STR_DIFFOPT_OPT_WW "-W columns"
#define | STR_DIFFOPT_DESC_WW "Use an output width of columns in side by side format"
#define | STR_DIFFOPT_OPT_Y "-y"
#define | STR_DIFFOPT_DESC_Y "Use the side by side output format"

Typedefs

typedef _sDiffOptionsItem | DiffOptionsItem
Define the diff options list items.

Functions

bool | CompatGetDiff (const MultiFiles *mf, kDiffCmdType diffType, bool &noRecurs, bool &isDate1, bool &isDate2, UPStr &rev1, UPStr &rev2, bool &useExtDiff, bool &unifiedDiff, bool &noWhiteSpace, bool &noBlankLines, bool &ignoreCase, UPStr &keyword, UPStr &diffOptions, bool allowExtDiff)
Get the diff options.

Variables

CPersistentBool | gUseExtDiff ("P_DiffUseExtDiff", false)
CPersistentBool | gIgnoreCase ("P_IgnoreCase", false)
CPersistentBool | gNoWhiteSpace ("P_NoWhiteSpace", false)
CPersistentBool | gNoBlankLines ("P_NoBlankLines", false)
CPersistentBool | gUnifiedDiff ("P_UnifiedDiff", false)
CMString | gDiffOptions (20,"P_DiffOptions")
DiffOptionsItem sDiffOptions []
Command line diff options and their descriptions.

Define Documentation

#define _DIFF_CPP_

Definition at line 49 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_A "Treat all files as text and compare them line-by-line, even if they do not seem to be text"

Definition at line 71 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_B "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"

Definition at line 73 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_BB "Ignore changes that just insert or delete blank lines"

Definition at line 75 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_BINARY "Read and write data in binary mode"

Definition at line 77 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_BRIEF "Report only whether the files differ, not the details of the differences"

Definition at line 79 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_C "Use the context output format"

Definition at line 81 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_C_G_F "Use format to output a line group containing differing lines from both files in if-then-else format. See CVS manual for line group formats"

Definition at line 85 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_CC "Use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"

Definition at line 83 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_D "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"

Definition at line 87 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_E "Make output that is a valid ed script"

Definition at line 89 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_E_T "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"

Definition at line 91 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_F "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"

Definition at line 93 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_F_E "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"

Definition at line 97 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_FF "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"

Definition at line 95 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_H_L "Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix"

Definition at line 101 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_HH "Use heuristics to speed handling of large files that have numerous scattered small changes"

Definition at line 99 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I "Ignore changes in case; consider upper- and lower-case letters equivalent"

Definition at line 103 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_A_S "Ignore white space when comparing lines"

Definition at line 109 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_B_L "Ignore changes that just insert or delete blank lines"

Definition at line 111 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_C "Ignore changes in case; consider upper- and lower-case to be the same"

Definition at line 113 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_M_L "Ignore changes that just insert or delete lines that match regexp"

Definition at line 115 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_S_C "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"

Definition at line 117 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_I_T "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"

Definition at line 119 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_IFDEF "Make merged if-then-else output using name"

Definition at line 107 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_II "Ignore changes that just insert or delete lines that match regexp"

Definition at line 105 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_L_C "Print only the left column of two common lines in side by side format"

Definition at line 125 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_L_F "Use format to output all input lines in if-then-else format. See CVS manual for line formats"

Definition at line 127 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_LABEL "Use label instead of the file name in the context format and unified format headers"

Definition at line 123 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_LL "Use label instead of the file name in the context format and unified format headers"

Definition at line 121 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_MINIMAL "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"

Definition at line 129 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_N "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"

Definition at line 131 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_N_G_F "Use format to output a group of lines taken from just the second file in if-then-else format. See section A.9.1.1 Line group formats"

Definition at line 135 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_N_L_F "Use format to output a line taken from just the second file in if-then-else format. See CVS manual for line formats"

Definition at line 137 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_NN "In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory"

Definition at line 133 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_O_G_F "Use format to output a group of lines taken from just the first file in if-then-else format. See section A.9.1.1 Line group formats"

Definition at line 139 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_O_L_F "Use format to output a line taken from just the first file in if-then-else format. See CVS manual for line formats"

Definition at line 141 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_PP "Show which C function each change is in"

Definition at line 143 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_RCS "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"

Definition at line 145 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S "Report when two files are the same"

Definition at line 147 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S_B_S "Use the side by side output format"

Definition at line 153 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S_C_F "Show which C function each change is in"

Definition at line 149 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S_C_L "Do not print common lines in side by side format"

Definition at line 157 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S_F_L "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"

Definition at line 151 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_S_L_F "Use heuristics to speed handling of large files that have numerous scattered small changes"

Definition at line 155 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_T "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"

Definition at line 159 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_TEXT "Treat all files as text and compare them line-by-line, even if they do not appear to be text"

Definition at line 163 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_TT "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"

Definition at line 161 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_U "Use the unified output format"

Definition at line 165 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_U_G_F "Use format to output a group of common lines taken from both files in if-then-else format. See section A.9.1.1 Line group formats"

Definition at line 167 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_U_L_F "Use format to output a line common to both files in if-then-else format. See CVS manual for line formats"

Definition at line 169 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_UU "Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"

Definition at line 171 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_W "Ignore white space when comparing lines"

Definition at line 173 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_WW "Use an output width of columns in side by side format"

Definition at line 175 of file DiffDlg.cpp.

#define STR_DIFFOPT_DESC_Y "Use the side by side output format"

Definition at line 177 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_A "-a"

Definition at line 70 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_B "-b"

Definition at line 72 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_BB "-B"

Definition at line 74 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_BINARY "--binary"

Definition at line 76 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_BRIEF "--brief"

Definition at line 78 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_C "-c"

Definition at line 80 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_C_G_F "--changed-group-format=format"

Definition at line 84 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_CC "-C lines"

Definition at line 82 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_D "-d"

Definition at line 86 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_E "-e"

Definition at line 88 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_E_T "--expand-tabs"

Definition at line 90 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_F "-f"

Definition at line 92 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_F_E "--forward-ed"

Definition at line 96 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_FF "-F regexp"

Definition at line 94 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_H_L "--horizon-lines=lines"

Definition at line 100 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_HH "-H"

Definition at line 98 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I "-i"

Definition at line 102 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_A_S "--ignore-all-space"

Definition at line 108 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_B_L "--ignore-blank-lines"

Definition at line 110 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_C "--ignore-case"

Definition at line 112 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_M_L "--ignore-matching-lines=regexp"

Definition at line 114 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_S_C "--ignore-space-change"

Definition at line 116 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_I_T "--initial-tab"

Definition at line 118 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_IFDEF "--ifdef=name"

Definition at line 106 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_II "-I regexp"

Definition at line 104 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_L_C "--left-column"

Definition at line 124 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_L_F "--line-format=format"

Definition at line 126 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_LABEL "--label=label"

Definition at line 122 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_LL "-L label"

Definition at line 120 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_MINIMAL "--minimal"

Definition at line 128 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_N "-n"

Definition at line 130 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_N_G_F "--new-group-format=format"

Definition at line 134 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_N_L_F "--new-line-format=format"

Definition at line 136 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_NN "-N"

Definition at line 132 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_O_G_F "--old-group-format=format"

Definition at line 138 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_O_L_F "--old-line-format=format"

Definition at line 140 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_P "-p"

Definition at line 142 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_RCS "--rcs"

Definition at line 144 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S "-s"

Definition at line 146 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S_B_S "--side-by-side"

Definition at line 152 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S_C_F "--show-c-function"

Definition at line 148 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S_C_L "--suppress-common-lines"

Definition at line 156 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S_F_L "--show-function-line=regexp"

Definition at line 150 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_S_L_F "--speed-large-files"

Definition at line 154 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_T "-t"

Definition at line 158 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_TEXT "--text"

Definition at line 162 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_TT "-T"

Definition at line 160 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_U "-u"

Definition at line 164 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_U_G_F "--unchanged-group-format=format"

Definition at line 166 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_U_L_F "--unchanged-line-format=format"

Definition at line 168 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_UU "-U lines"

Definition at line 170 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_W "-w"

Definition at line 172 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_WW "-W columns"

Definition at line 174 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPT_Y "-y"

Definition at line 176 of file DiffDlg.cpp.

#define STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT "[%s]: %s"

Definition at line 67 of file DiffDlg.cpp.

Typedef Documentation

typedef struct _sDiffOptionsItem DiffOptionsItem

Define the diff options list items.

Function Documentation

bool CompatGetDiff | ( | const MultiFiles * | mf,
 |  | kDiffCmdType | diffType,
 |  | bool & | noRecurs,
 |  | bool & | isDate1,
 |  | bool & | isDate2,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | useExtDiff,
 |  | bool & | unifiedDiff,
 |  | bool & | noWhiteSpace,
 |  | bool & | noBlankLines,
 |  | bool & | ignoreCase,
 |  | UPStr & | keyword,
 |  | UPStr & | diffOptions,
 |  | bool | allowExtDiff
 | ) |

Get the diff options.

Definition at line 986 of file DiffDlg.cpp.

References ASSERT, CPStr, COptionalPropertySheet::DoModal(), EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg(), gIgnoreCase, gNoBlankLines, gNoWhiteSpace, gUnifiedDiff, gUseExtDiff, kCompareAnotherRev, kCompareSameRev, kCompareTwoRev, kDiffGraph, kUMainWidget, CDiff_MAIN::m_compareType, CDiff_MAIN::m_diffOptions, CDiff_MAIN::m_extDiff, CDiff_MAIN::m_ignoreCase, CDiff_MAIN::m_isDate1, CDiff_MAIN::m_isDate2, CDiff_MAIN::m_keyword, CDiff_MAIN::m_noRecurs, CDiff_MAIN::m_noWhiteSpace, CDiff_MAIN::m_rev1, CDiff_MAIN::m_rev2, CDiff_MAIN::m_unifiedDiff, CGetPrefs_GLOBALS::StoreValues(), UCreate_DiffDlg(), and UEventSendMessage().

Referenced by CvsCmdDiff().

00992 {
00993     bool userHitOK = false;
00994
00995     static CPStr sLastRev1;
00996     static CPStr sLastRev2;
00997     static CPStr sLastKeyword;
00998     static CPStr sLastDiffOptions;
00999
01000     bool hasRev1;
01001     bool hasRev2;
01002   CPStr initialRev1, initialRev2;
01003
01004   // Graph view diff supplies initial revisions, so don't override them
01005     if ( diffType == kDiffGraph )
01006     {
01007       initialRev1 = rev1;
01008       initialRev2 = rev2;
01009       hasRev1 = !rev1.empty();
01010       hasRev2 = !rev2.empty();
01011     }
01012     else
01013     {
01014     rev1 = "";
01015     rev2 = "";
01016       hasRev1 = false;
01017       hasRev2 = false;
01018       initialRev1 = sLastRev1;
01019       initialRev2 = sLastRev2;
01020   }
01021     noRecurs = false;
01022     isDate1 = false;
01023     isDate2 = false;
01024     useExtDiff = (bool)gUseExtDiff;
01025     noWhiteSpace = (bool)gNoWhiteSpace;
01026     noBlankLines = (bool)gNoBlankLines;
01027     ignoreCase = (bool)gIgnoreCase;
01028     unifiedDiff = (bool)gUnifiedDiff;
01029
01030
01031 //{ Win32 - Part
01032 #ifdef WIN32
01033     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
01034     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01035
01036     CDiff_MAIN page1(mf, diffType, initialRev1, initialRev2, allowExtDiff, useExtDiff, unifiedDiff, noWhiteSpace, ignoreCase, sLastKeyword, sLastDiffOptions);
01037     CGetPrefs_GLOBALS page2;
01038
01039     pages.AddPage(&page1);
01040     pages.AddPage(&page2);
01041
01042     if( pages.DoModal() == IDOK )
01043     {
01044         noRecurs = page1.m_noRecurs ? true : false;
01045
01046         sLastRev1 = page1.m_rev1;
01047         sLastRev2 = page1.m_rev2;
01048         isDate1 = page1.m_isDate1 ? true : false;
01049         isDate2 = page1.m_isDate2 ? true : false;
01050
01051         gUseExtDiff = page1.m_extDiff ? true : false;
01052
01053         switch( page1.m_compareType )
01054         {
01055         default:
01056             ASSERT(FALSE);  //unknown compare type
01057         case kCompareSameRev:
01058             hasRev1 = hasRev2 = false;
01059             break;
01060         case kCompareAnotherRev:
01061             hasRev1 = true;
01062             hasRev2 = false;
01063             break;
01064         case kCompareTwoRev:
01065             hasRev1 = true;
01066             hasRev2 = true;
01067             break;
01068         }
01069
01070         gUnifiedDiff = page1.m_unifiedDiff ? true : false;
01071         gNoWhiteSpace = page1.m_noWhiteSpace ? true : false;
01072         gIgnoreCase = page1.m_ignoreCase ? true : false;
01073
01074         sLastKeyword = page1.m_keyword;
01075         sLastDiffOptions = page1.m_diffOptions;
01076
01077         page2.StoreValues();
01078         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
01079         userHitOK = true;
01080     }
01081 #endif /* WIN32 */
01082 //} Win32 - Part
01083 //{ Mac - Part
01084 #ifdef qMacCvsPP
01085     StOptionalDialogHandler theHandler(dlg_Diff, gCvsPrefs.HideCommandDlgDiff(), LCommander::GetTopCommander());
01086     LWindow *theDialog = theHandler.GetDialog();
01087     ThrowIfNil_(theDialog);
01088     static UInt16 sRuntimePanel = 1;
01089
01090     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01091         (theDialog->FindPaneByID(item_MultiViewPrefs));
01092     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01093
01094     multiView->SwitchToPanel(2);
01095     DoDataExchange_Globals(theDialog, true);
01096     multiView->SwitchToPanel(1);
01097     DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, initialRev1, initialRev2,
01098         hasRev1, hasRev2, true);
01099     if ( diffType == kDiffGraph )
01100     {
01101       // disable label chooser view
01102       LPane   *labelOptionsGroup = theDialog->FindPaneByID(item_DiffLabelOptions);
01103       if ( labelOptionsGroup ) labelOptionsGroup->Disable();
01104     }
01105     groupView->SetValue(sRuntimePanel);
01106     // skip dialog when option key is pressed
01107   MessageT hitMessage;
01108     theHandler.ShowDialog();
01109     while (true)
01110     {       // Let DialogHandler process events
01111         hitMessage = theHandler.DoDialog();
01112
01113         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01114             break;
01115     }
01116     theDialog->Hide();
01117     sRuntimePanel = groupView->GetValue();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         multiView->SwitchToPanel(1);
01122         DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
01123             hasRev1, hasRev2, false);
01124         multiView->SwitchToPanel(2);
01125         DoDataExchange_Globals(theDialog, false);
01126         gCvsPrefs.SetHideCommandDlgDiff(theHandler.GetHideCommandDlg());
01127         userHitOK = true;
01128     }
01129 #endif /* qMacCvsPP */
01130 //} Mac - Part
01131 //{ Unix - Part
01132 #if qUnix
01133     void *wid = UCreate_DiffDlg();
01134
01135     UCvsDiff *dlg = new UCvsDiff();
01136     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff, unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase);
01137     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01138     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
01139
01140     if(dlg->DoModal())
01141     {
01142         noRecurs = tab1->m_norecurs;
01143
01144         gNoWhiteSpace   = tab1->m_noWhiteSpace != 0;
01145         gNoBlankLines   = tab1->m_noBlankLines != 0;
01146         gIgnoreCase     = tab1->m_ignoreCase != 0;
01147         gUnifiedDiff    = tab1->m_unifiedDiff != 0;
01148         gUseExtDiff     = tab1->m_extdiff;
01149
01150         sLastRev1 = tab1->m_rev1;
01151         sLastRev2 = tab1->m_rev2;
01152         isDate1 = tab1->m_check1;
01153         isDate2 = tab1->m_check2;
01154
01155         if(tab1->m_diff == 0)
01156         {
01157             hasRev1 = hasRev2 = false;
01158         }
01159         else if(tab1->m_diff == 1)
01160         {
01161             hasRev1 = true;
01162             hasRev2 = false;
01163         }
01164         else
01165         {
01166             hasRev1 = true;
01167             hasRev2 = true;
01168         }
01169
01170         userHitOK = true;
01171     }
01172
01173     delete dlg;
01174 #endif // qUnix
01175 //} Unix - Part
01176
01177     if( userHitOK )
01178     {
01179         if( hasRev1 )
01180             rev1 = sLastRev1;
01181
01182         if( hasRev2 )
01183             rev2 = sLastRev2;
01184
01185         useExtDiff     = (bool)gUseExtDiff;
01186         noWhiteSpace   = (bool)gNoWhiteSpace;
01187         noBlankLines   = (bool)gNoBlankLines;
01188         unifiedDiff    = (bool)gUnifiedDiff;
01189         ignoreCase     = (bool)gIgnoreCase;
01190
01191         if( !sLastDiffOptions.empty() )
01192         {
01193             diffOptions = sLastDiffOptions;
01194         }
01195
01196         if( !sLastKeyword.empty() )
01197         {
01198             keyword = sLastKeyword;
01199         }
01200
01201         gCvsPrefs.save();
01202     }
01203
01204     return userHitOK;
01205 }

Variable Documentation

CMString gDiffOptions(20, "P_DiffOptions")

CPersistentBool gIgnoreCase("P_IgnoreCase", false) [static]

Referenced by CompatGetDiff().

CPersistentBool gNoBlankLines("P_NoBlankLines", false) [static]

Referenced by CompatGetDiff().

CPersistentBool gNoWhiteSpace("P_NoWhiteSpace", false) [static]

Referenced by CompatGetDiff().

CPersistentBool gUnifiedDiff("P_UnifiedDiff", false) [static]

Referenced by CompatGetDiff().

CPersistentBool gUseExtDiff("P_DiffUseExtDiff", false) [static]

Referenced by CompatGetDiff().

DiffOptionsItem sDiffOptions[] [static]

Command line diff options and their descriptions.

Definition at line 186 of file DiffDlg.cpp.

Referenced by CDiff_Options::OnInitDialog().

Generated on Fri Jan 31 12:09:48 2003 for WinCvs Source by doxygen 1.3-rc2


DiffDlg.h File Reference

common/DiffDlg.h File Reference

#include "SmartComboBox.h"
#include "KeywordComboBox.h"
#include "uwidget.h"
#include "CvsCommands.h"
#include "SortHeaderCtrl.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
class | CDiff_Options
struct | CompareInfo
Structure to hold the sorting settings. More...

Defines

#define | AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Enumerations

enum {
kCompareSameRev = 0,
kCompareAnotherRev,
kCompareTwoRev
}
Compare type enum. More...

Functions

bool | CompatGetDiff (const MultiFiles *mf, kDiffCmdType diffType, bool &noRecurs, bool &isDate1, bool &isDate2, UPStr &rev1, UPStr &rev2, bool &useExtDiff, bool &useUnifiedDiff, bool &noWhiteSpace, bool &noBlankLines, bool &ignoreCase, UPStr &keyword, UPStr &diffOptions, bool allowExtDiff=false)
Get the diff options.

Define Documentation

#define AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file DiffDlg.h.

Enumeration Type Documentation

anonymous enum

Compare type enum.

Enumeration values:
kCompareSameRev | Compare local copy against the same remote revision
kCompareAnotherRev | Compare local copy against another revision/tag/branch or date
kCompareTwoRev | Compare two revisions/tags/branches or dates against each other

Definition at line 45 of file DiffDlg.h.

00046 {
00047     kCompareSameRev = 0,
00048     kCompareAnotherRev,
00049     kCompareTwoRev
00050 };

Function Documentation

bool CompatGetDiff | ( | const MultiFiles * | mf,
 |  | kDiffCmdType | diffType,
 |  | bool & | noRecurs,
 |  | bool & | isDate1,
 |  | bool & | isDate2,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | useExtDiff,
 |  | bool & | useUnifiedDiff,
 |  | bool & | noWhiteSpace,
 |  | bool & | noBlankLines,
 |  | bool & | ignoreCase,
 |  | UPStr & | keyword,
 |  | UPStr & | diffOptions,
 |  | bool | allowExtDiff = false
 | ) |

Get the diff options.

Definition at line 986 of file DiffDlg.cpp.

References ASSERT, CPStr, COptionalPropertySheet::DoModal(), EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg(), gIgnoreCase, gNoBlankLines, gNoWhiteSpace, gUnifiedDiff, gUseExtDiff, kCompareAnotherRev, kCompareSameRev, kCompareTwoRev, kDiffGraph, kUMainWidget, CDiff_MAIN::m_compareType, CDiff_MAIN::m_diffOptions, CDiff_MAIN::m_extDiff, CDiff_MAIN::m_ignoreCase, CDiff_MAIN::m_isDate1, CDiff_MAIN::m_isDate2, CDiff_MAIN::m_keyword, CDiff_MAIN::m_noRecurs, CDiff_MAIN::m_noWhiteSpace, CDiff_MAIN::m_rev1, CDiff_MAIN::m_rev2, CDiff_MAIN::m_unifiedDiff, CGetPrefs_GLOBALS::StoreValues(), UCreate_DiffDlg(), and UEventSendMessage().

Referenced by CvsCmdDiff().

00992 {
00993     bool userHitOK = false;
00994
00995     static CPStr sLastRev1;
00996     static CPStr sLastRev2;
00997     static CPStr sLastKeyword;
00998     static CPStr sLastDiffOptions;
00999
01000     bool hasRev1;
01001     bool hasRev2;
01002   CPStr initialRev1, initialRev2;
01003
01004   // Graph view diff supplies initial revisions, so don't override them
01005     if ( diffType == kDiffGraph )
01006     {
01007       initialRev1 = rev1;
01008       initialRev2 = rev2;
01009       hasRev1 = !rev1.empty();
01010       hasRev2 = !rev2.empty();
01011     }
01012     else
01013     {
01014     rev1 = "";
01015     rev2 = "";
01016       hasRev1 = false;
01017       hasRev2 = false;
01018       initialRev1 = sLastRev1;
01019       initialRev2 = sLastRev2;
01020   }
01021     noRecurs = false;
01022     isDate1 = false;
01023     isDate2 = false;
01024     useExtDiff = (bool)gUseExtDiff;
01025     noWhiteSpace = (bool)gNoWhiteSpace;
01026     noBlankLines = (bool)gNoBlankLines;
01027     ignoreCase = (bool)gIgnoreCase;
01028     unifiedDiff = (bool)gUnifiedDiff;
01029
01030
01031 //{ Win32 - Part
01032 #ifdef WIN32
01033     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
01034     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01035
01036     CDiff_MAIN page1(mf, diffType, initialRev1, initialRev2, allowExtDiff, useExtDiff, unifiedDiff, noWhiteSpace, ignoreCase, sLastKeyword, sLastDiffOptions);
01037     CGetPrefs_GLOBALS page2;
01038
01039     pages.AddPage(&page1);
01040     pages.AddPage(&page2);
01041
01042     if( pages.DoModal() == IDOK )
01043     {
01044         noRecurs = page1.m_noRecurs ? true : false;
01045
01046         sLastRev1 = page1.m_rev1;
01047         sLastRev2 = page1.m_rev2;
01048         isDate1 = page1.m_isDate1 ? true : false;
01049         isDate2 = page1.m_isDate2 ? true : false;
01050
01051         gUseExtDiff = page1.m_extDiff ? true : false;
01052
01053         switch( page1.m_compareType )
01054         {
01055         default:
01056             ASSERT(FALSE);  //unknown compare type
01057         case kCompareSameRev:
01058             hasRev1 = hasRev2 = false;
01059             break;
01060         case kCompareAnotherRev:
01061             hasRev1 = true;
01062             hasRev2 = false;
01063             break;
01064         case kCompareTwoRev:
01065             hasRev1 = true;
01066             hasRev2 = true;
01067             break;
01068         }
01069
01070         gUnifiedDiff = page1.m_unifiedDiff ? true : false;
01071         gNoWhiteSpace = page1.m_noWhiteSpace ? true : false;
01072         gIgnoreCase = page1.m_ignoreCase ? true : false;
01073
01074         sLastKeyword = page1.m_keyword;
01075         sLastDiffOptions = page1.m_diffOptions;
01076
01077         page2.StoreValues();
01078         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
01079         userHitOK = true;
01080     }
01081 #endif /* WIN32 */
01082 //} Win32 - Part
01083 //{ Mac - Part
01084 #ifdef qMacCvsPP
01085     StOptionalDialogHandler theHandler(dlg_Diff, gCvsPrefs.HideCommandDlgDiff(), LCommander::GetTopCommander());
01086     LWindow *theDialog = theHandler.GetDialog();
01087     ThrowIfNil_(theDialog);
01088     static UInt16 sRuntimePanel = 1;
01089
01090     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01091         (theDialog->FindPaneByID(item_MultiViewPrefs));
01092     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01093
01094     multiView->SwitchToPanel(2);
01095     DoDataExchange_Globals(theDialog, true);
01096     multiView->SwitchToPanel(1);
01097     DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, initialRev1, initialRev2,
01098         hasRev1, hasRev2, true);
01099     if ( diffType == kDiffGraph )
01100     {
01101       // disable label chooser view
01102       LPane   *labelOptionsGroup = theDialog->FindPaneByID(item_DiffLabelOptions);
01103       if ( labelOptionsGroup ) labelOptionsGroup->Disable();
01104     }
01105     groupView->SetValue(sRuntimePanel);
01106     // skip dialog when option key is pressed
01107   MessageT hitMessage;
01108     theHandler.ShowDialog();
01109     while (true)
01110     {       // Let DialogHandler process events
01111         hitMessage = theHandler.DoDialog();
01112
01113         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01114             break;
01115     }
01116     theDialog->Hide();
01117     sRuntimePanel = groupView->GetValue();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         multiView->SwitchToPanel(1);
01122         DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
01123             hasRev1, hasRev2, false);
01124         multiView->SwitchToPanel(2);
01125         DoDataExchange_Globals(theDialog, false);
01126         gCvsPrefs.SetHideCommandDlgDiff(theHandler.GetHideCommandDlg());
01127         userHitOK = true;
01128     }
01129 #endif /* qMacCvsPP */
01130 //} Mac - Part
01131 //{ Unix - Part
01132 #if qUnix
01133     void *wid = UCreate_DiffDlg();
01134
01135     UCvsDiff *dlg = new UCvsDiff();
01136     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff, unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase);
01137     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01138     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
01139
01140     if(dlg->DoModal())
01141     {
01142         noRecurs = tab1->m_norecurs;
01143
01144         gNoWhiteSpace   = tab1->m_noWhiteSpace != 0;
01145         gNoBlankLines   = tab1->m_noBlankLines != 0;
01146         gIgnoreCase     = tab1->m_ignoreCase != 0;
01147         gUnifiedDiff    = tab1->m_unifiedDiff != 0;
01148         gUseExtDiff     = tab1->m_extdiff;
01149
01150         sLastRev1 = tab1->m_rev1;
01151         sLastRev2 = tab1->m_rev2;
01152         isDate1 = tab1->m_check1;
01153         isDate2 = tab1->m_check2;
01154
01155         if(tab1->m_diff == 0)
01156         {
01157             hasRev1 = hasRev2 = false;
01158         }
01159         else if(tab1->m_diff == 1)
01160         {
01161             hasRev1 = true;
01162             hasRev2 = false;
01163         }
01164         else
01165         {
01166             hasRev1 = true;
01167             hasRev2 = true;
01168         }
01169
01170         userHitOK = true;
01171     }
01172
01173     delete dlg;
01174 #endif // qUnix
01175 //} Unix - Part
01176
01177     if( userHitOK )
01178     {
01179         if( hasRev1 )
01180             rev1 = sLastRev1;
01181
01182         if( hasRev2 )
01183             rev2 = sLastRev2;
01184
01185         useExtDiff     = (bool)gUseExtDiff;
01186         noWhiteSpace   = (bool)gNoWhiteSpace;
01187         noBlankLines   = (bool)gNoBlankLines;
01188         unifiedDiff    = (bool)gUnifiedDiff;
01189         ignoreCase     = (bool)gIgnoreCase;
01190
01191         if( !sLastDiffOptions.empty() )
01192         {
01193             diffOptions = sLastDiffOptions;
01194         }
01195
01196         if( !sLastKeyword.empty() )
01197         {
01198             keyword = sLastKeyword;
01199         }
01200
01201         gCvsPrefs.save();
01202     }
01203
01204     return userHitOK;
01205 }

Generated on Fri Jan 31 12:09:49 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#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

Referenced by poolAlloc(), poolFree(), and poolRemove().

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_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().

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* 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, frameRec, 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, _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, frameRec, 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 Fri Jan 31 12:09:50 2003 for WinCvs Source by doxygen 1.3-rc2


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(), closedir(), cvs_process_destroy(), cvs_process_run(), CvsLogParse(), DisposeStr(), FileTraverse(), UStr::flush(), UPStr::flush(), free_dircontents(), CBrowseFileView::GetEntriesModTime(), GetNextEntriesLine(), InitializeInterp(), IsShellType(), loadSettingsInternal(), main(), MacroTraversal::OnFile(), CWincvsView::OnKeyDown(), CCommit_MAIN::OnTemplate(), opendir(), UStr::operator<<(), ReadIgnoredFile(), CvsArgs::reset(), CCJHexEdit::SelDelete(), CCJHexEdit::SelInsert(), CCJHexEdit::SetData(), Tag_Open(), 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(), build_command(), CTCLCvsConsole::CTCLCvsConsole(), cvs_process_new(), cvs_process_run(), 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(), UStr::substr(), 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.

References exit, 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().

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.

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 }

Generated on Fri Jan 31 12:09:50 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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.

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, 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.

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.

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, 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.

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.

References __glue_consolein.

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.

References __glue_consoleout.

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 aeventdispatch )

Definition at line 239 of file dll_glue.c.

References __glue_eventdispatch.

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.

References __glue_getenv.

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 }

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, 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.

FSSpec sCvsContainerFileSpec

Definition at line 322 of file dll_glue.c.

Referenced by __cvs_initialize().

Generated on Fri Jan 31 12:09:50 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References __glue_consoleerr.

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.

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.

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, 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.

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.

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 * )

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, 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.

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.

References __glue_consolein.

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.

References __glue_consoleout.

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.

References __glue_eventdispatch.

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.

References __glue_getenv.

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 Fri Jan 31 12:09:51 2003 for WinCvs Source by doxygen 1.3-rc2


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.

00129 {
00130 #ifdef TARGET_OS_MAC
00131     ProcPtr symAddr;
00132     Str255 pname;
00133 #   if TARGET_API_MAC_OS8
00134     UniversalProcPtr proc;
00135 #   endif
00136
00137     c2pstrcpy(pname, name_func);
00138
00139     symAddr = getSymFunction(connID, pname);
00140 #   if TARGET_API_MAC_CARBON
00141     return symAddr;
00142 #   else
00143     if(symAddr == 0L)
00144         return 0L;
00145
00146     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00147     return proc;
00148 #   endif
00149 #elif defined(WIN32)
00150     return GetProcAddress(connID, name_func);
00151 #else /* !WIN32 && !TARGET_OS_MAC */
00152     return dynl_func(name_func, connID);
00153 #endif /* !WIN32 && !TARGET_OS_MAC */
00154 }

int CompatCloseLibrary ( CompatConnectID * connID )

Definition at line 103 of file dll_loader.c.

00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef TARGET_OS_MAC
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !TARGET_OS_MAC */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !TARGET_OS_MAC */
00120 }

int CompatLoadLibrary | ( | CompatConnectID * | connID,
 |  | const char * | name_dll
 | ) |

Definition at line 76 of file dll_loader.c.

References err.

Referenced by CPython_Interp::IsAvail(), and CTcl_Interp::IsAvail().

00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef TARGET_OS_MAC
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 && !TARGET_OS_MAC */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !TARGET_OS_MAC */
00100 }

Variable Documentation

void* sCompatProc

Definition at line 45 of file dll_loader.c.

Generated on Fri Jan 31 12:09:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 TARGET_OS_MAC
00131     ProcPtr symAddr;
00132     Str255 pname;
00133 #   if TARGET_API_MAC_OS8
00134     UniversalProcPtr proc;
00135 #   endif
00136
00137     c2pstrcpy(pname, name_func);
00138
00139     symAddr = getSymFunction(connID, pname);
00140 #   if TARGET_API_MAC_CARBON
00141     return symAddr;
00142 #   else
00143     if(symAddr == 0L)
00144         return 0L;
00145
00146     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00147     return proc;
00148 #   endif
00149 #elif defined(WIN32)
00150     return GetProcAddress(connID, name_func);
00151 #else /* !WIN32 && !TARGET_OS_MAC */
00152     return dynl_func(name_func, connID);
00153 #endif /* !WIN32 && !TARGET_OS_MAC */
00154 }

int CompatCloseLibrary ( CompatConnectID * connID )

Definition at line 103 of file dll_loader.c.

00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef TARGET_OS_MAC
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !TARGET_OS_MAC */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !TARGET_OS_MAC */
00120 }

int CompatLoadLibrary | ( | CompatConnectID * | connID,
 |  | const char * | name_dll
 | ) |

Definition at line 76 of file dll_loader.c.

References err.

Referenced by CTcl_Interp::IsAvail(), and CPython_Interp::IsAvail().

00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef TARGET_OS_MAC
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 && !TARGET_OS_MAC */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !TARGET_OS_MAC */
00100 }

Variable Documentation

void* sCompatProc

Definition at line 82 of file dll_loader.h.

Generated on Fri Jan 31 12:09:51 2003 for WinCvs Source by doxygen 1.3-rc2


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.

typedef long(* dllglue_consoleout_func)(char *, long)

Definition at line 85 of file dll_process.h.

typedef char*(* dllglue_getenv_func)(const char *)

Definition at line 84 of file dll_process.h.

typedef int(* dllglue_main_func)(const char *, int, char**)

Definition at line 87 of file dll_process.h.

typedef int(* dllglue_setglue_func)(void *)

Definition at line 88 of file dll_process.h.

Generated on Fri Jan 31 12:09:52 2003 for WinCvs Source by doxygen 1.3-rc2


EditorMonDlg.cpp File Reference

common/EditorMonDlg.cpp File Reference

#include "stdafx.h"
#include "CvsPrefs.h"
#include "CvsCommands.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().

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 Fri Jan 31 12:09:52 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References CStr, LaunchEditor(), CEditorMonDlg::m_hProcess, CEditorMonDlg::m_tempFile, MakeTmpFile(), and SplitPath().

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 Fri Jan 31 12:09:52 2003 for WinCvs Source by doxygen 1.3-rc2


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(), free, GetWinCvsDebugMask(), USemaphore::IsEnteredTwice(), kContinueTraversal, kSkipFile, kTraversal, NULL, TraversalReport::OnAlias(), TraversalReport::OnDirectory(), TraversalReport::OnError(), TraversalReport::OnFile(), TraversalReport::OnIdle(), opendir(), readdir(), SetWinCvsDebugMask(), stat, STRUCT_DIRENT, UFSSpec, wcvsdbg_trace_modified_checks, and wcvsdbg_verbose.

Referenced by AskCreatePersistentSettings(), cvsgui_GetCvsEntries(), GetAllPersistentSettings(), HasPersistentSettings(), list_all_types_recur(), LoadPersistentSettings(), MacrosReloadAll(), TViewFill::OnDirectory(), TBrowserFill::OnDirectory(), CWinCvsBrowser::OnItemexpanding(), UCvsFolders::OnTreeExpanding(), UCvsFolders::ResetBrowser(), CWinCvsBrowser::ResetBrowser(), UCvsFiles::ResetView(), CBrowseFileView::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         GUSIFileSpec inspec(foldermacspec);
00196         inspec += dp->d_name;
00197         UFSSpec infspec = inspec;
00198         macspec = &infspec;
00199
00200         statres = stat(fullname, &sb);
00201 #else
00202 #   if defined(WIN32)
00203         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00204         {
00205             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00206                                     | wcvsdbg_trace_stat);
00207             tracestr = "Stat(";
00208             tracestr << static_cast<const char *>(fullname);
00209             tracestr << ") ...\n";
00210             cvs_err(tracestr);
00211             OutputDebugString(tracestr);
00212         }
00213 #   endif   // defined(WIN32)
00214
00215         statres = stat(fullname, &sb);
00216 #endif
00217
00218
00219     if (statres != -1)
00220         {
00221             if(S_ISDIR(sb.st_mode))
00222             {
00223                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00224
00225         if(res == kSkipFile)
00226                     continue;
00227                 if(res != kContinueTraversal)
00228                     goto abort;
00229
00230         res = FileTraverse(fullname, report, macspec);
00231                 if(res != kContinueTraversal)
00232                     goto abort;
00233
00234             }
00235             else if(S_ISREG(sb.st_mode))
00236             {
00237                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00238                 if(res == kSkipFile)
00239                     continue;
00240                 if(res != kContinueTraversal)
00241                     goto abort;
00242             }
00243 #ifdef S_ISLNK
00244             else if(S_ISLNK(sb.st_mode))
00245             {
00246                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00247                 if(res == kSkipFile)
00248                     continue;
00249                 if(res != kContinueTraversal)
00250                     goto abort;
00251             }
00252 #endif /* S_ISLNK */
00253             else
00254             {
00255                 /* TODO : Unix devices */
00256                 errstr = "Error while accessing ";
00257                 errstr << fullname;
00258                 errstr << " (error " << errno << ')';
00259                 res = report.OnError(errstr, errno);
00260                 goto abort;
00261             }
00262         }
00263         else
00264         {
00265             errstr = "Error while accessing ";
00266             errstr << fullname;
00267             errstr << " (error " << errno << ')';
00268             res = report.OnError(errstr, errno);
00269
00270       // no abort, because all
00271       // * files not read yet will be signed as missing and all
00272       // * folder will not be displayed
00273       //goto abort;
00274         }
00275     }
00276
00277     res = report.ExitDirectory(path);
00278
00279 abort:
00280     closedir (dirp);
00281 exit:
00282     if(0L != szOriginalPath)
00283     {
00284 #if !TARGET_RT_MAC_CFM
00285         chdir(szOriginalPath);
00286 #endif
00287         free(szOriginalPath);
00288         szOriginalPath = NULL;
00289     }
00290
00291 #if defined(WIN32)
00292     SetWinCvsDebugMask(dbg_mask);
00293 #endif  // defined(WIN32)
00294
00295     return res;
00296 }

Generated on Fri Jan 31 12:09:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 CompatMakeSurePathExists(), CreateFolder(), findTcl(), CCJHyperLink::GetRegKey(), CCJHyperLink::GotoURL(), MakeTmpFile(), AuthenSSH::RsaIdentityFile(), CCJHyperLink::SetDefaultCursor(), SplitPath(), 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 CompatImportFilter(), 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 AppendWinCvsDebugMask(), closedir(), CStr, cvs_err(), TraversalReport::EnterDirectory(), TraversalReport::ExitDirectory(), free, GetWinCvsDebugMask(), USemaphore::IsEnteredTwice(), kContinueTraversal, kSkipFile, kTraversal, NULL, TraversalReport::OnAlias(), TraversalReport::OnDirectory(), TraversalReport::OnError(), TraversalReport::OnFile(), TraversalReport::OnIdle(), opendir(), readdir(), SetWinCvsDebugMask(), stat, STRUCT_DIRENT, UFSSpec, wcvsdbg_trace_modified_checks, and wcvsdbg_verbose.

Referenced by AskCreatePersistentSettings(), cvsgui_GetCvsEntries(), GetAllPersistentSettings(), HasPersistentSettings(), list_all_types_recur(), LoadPersistentSettings(), MacrosReloadAll(), TBrowserFill::OnDirectory(), TViewFill::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         GUSIFileSpec inspec(foldermacspec);
00196         inspec += dp->d_name;
00197         UFSSpec infspec = inspec;
00198         macspec = &infspec;
00199
00200         statres = stat(fullname, &sb);
00201 #else
00202 #   if defined(WIN32)
00203         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00204         {
00205             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00206                                     | wcvsdbg_trace_stat);
00207             tracestr = "Stat(";
00208             tracestr << static_cast<const char *>(fullname);
00209             tracestr << ") ...\n";
00210             cvs_err(tracestr);
00211             OutputDebugString(tracestr);
00212         }
00213 #   endif   // defined(WIN32)
00214
00215         statres = stat(fullname, &sb);
00216 #endif
00217
00218
00219     if (statres != -1)
00220         {
00221             if(S_ISDIR(sb.st_mode))
00222             {
00223                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00224
00225         if(res == kSkipFile)
00226                     continue;
00227                 if(res != kContinueTraversal)
00228                     goto abort;
00229
00230         res = FileTraverse(fullname, report, macspec);
00231                 if(res != kContinueTraversal)
00232                     goto abort;
00233
00234             }
00235             else if(S_ISREG(sb.st_mode))
00236             {
00237                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00238                 if(res == kSkipFile)
00239                     continue;
00240                 if(res != kContinueTraversal)
00241                     goto abort;
00242             }
00243 #ifdef S_ISLNK
00244             else if(S_ISLNK(sb.st_mode))
00245             {
00246                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00247                 if(res == kSkipFile)
00248                     continue;
00249                 if(res != kContinueTraversal)
00250                     goto abort;
00251             }
00252 #endif /* S_ISLNK */
00253             else
00254             {
00255                 /* TODO : Unix devices */
00256                 errstr = "Error while accessing ";
00257                 errstr << fullname;
00258                 errstr << " (error " << errno << ')';
00259                 res = report.OnError(errstr, errno);
00260                 goto abort;
00261             }
00262         }
00263         else
00264         {
00265             errstr = "Error while accessing ";
00266             errstr << fullname;
00267             errstr << " (error " << errno << ')';
00268             res = report.OnError(errstr, errno);
00269
00270       // no abort, because all
00271       // * files not read yet will be signed as missing and all
00272       // * folder will not be displayed
00273       //goto abort;
00274         }
00275     }
00276
00277     res = report.ExitDirectory(path);
00278
00279 abort:
00280     closedir (dirp);
00281 exit:
00282     if(0L != szOriginalPath)
00283     {
00284 #if !TARGET_RT_MAC_CFM
00285         chdir(szOriginalPath);
00286 #endif
00287         free(szOriginalPath);
00288         szOriginalPath = NULL;
00289     }
00290
00291 #if defined(WIN32)
00292     SetWinCvsDebugMask(dbg_mask);
00293 #endif  // defined(WIN32)
00294
00295     return res;
00296 }

Generated on Fri Jan 31 12:09:54 2003 for WinCvs Source by doxygen 1.3-rc2


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, and FOLD_FN_CHAR.

Referenced by 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 224 of file fnmatch.c.

Generated on Fri Jan 31 12:09:54 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References __FNM_FLAGS, FNM_NOESCAPE, FNM_NOMATCH, FNM_PATHNAME, FNM_PERIOD, and FOLD_FN_CHAR.

Referenced by 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 Fri Jan 31 12:09:55 2003 for WinCvs Source by doxygen 1.3-rc2


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().

Referenced by CvsLogParse(), CItemListDlg::DisplayItems(), CMfFileDialog::DoModal(), GetNextEntriesLine(), loadSettingsInternal(), MacroTraversal::OnFile(), CCommit_MAIN::OnTemplate(), CTagParserConsole::Parse(), CModuleParserConsole::Parse(), CListParserConsole::Parse(), 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.

References malloc, MIN_CHUNK, and realloc.

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 TARGET_OS_MAC
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 Fri Jan 31 12:09:55 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References getstr().

Referenced by CvsLogParse(), CItemListDlg::DisplayItems(), CMfFileDialog::DoModal(), GetNextEntriesLine(), loadSettingsInternal(), MacroTraversal::OnFile(), CCommit_MAIN::OnTemplate(), CListParserConsole::Parse(), CModuleParserConsole::Parse(), CTagParserConsole::Parse(), 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.

References malloc, MIN_CHUNK, and realloc.

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 TARGET_OS_MAC
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 Fri Jan 31 12:09:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:55 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 * | shortopts,
 |  | const struct option * | longopts,
 |  | int * | longind
 | ) |

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 }

Variable Documentation

char* optarg

Definition at line 33 of file getopt.h.

Referenced by _getopt_internal().

int opterr

Definition at line 52 of file getopt.h.

int optind

Definition at line 47 of file getopt.h.

Referenced by _getopt_initialize(), _getopt_internal(), and exchange().

int optopt

Definition at line 56 of file getopt.h.

Referenced by _getopt_internal().

Generated on Fri Jan 31 12:09:56 2003 for WinCvs Source by doxygen 1.3-rc2


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(), _CvsProcessStartupInfo::_CvsProcessStartupInfo(), _GetComCtlVersion(), _GetDropDownWidth(), _getopt_initialize(), _getopt_internal(), _LoadSysColorBitmap(), CSubclassWndMap::Add(), addAccel(), CCJReBar::AddBar(), PyMenuMgr::AddButton(), CCJMenu::AddFromToolBar(), PyMenuMgr::AddPulldown(), CCJToolBar::AddReplaceBitmap(), PyMenuMgr::AddSeparator(), PyMenuMgr::AddToggle(), CCJTabView::AddView(), CCJTabCtrlBar::AddView(), CCJMemFile::Append(), CCJMenu::AppendODMenuW(), CCJListView::AutoSaveColumns(), CCJListCtrl::AutoSaveColumns(), CCJSizeDockBar::CalcDynamicLayout(), CCJReBar::CalcFixedLayout(), CCJDockBar::CalcFixedLayout(), CCJToolBar::CalcLayout(), 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(), CKeywordComboBox::CKeywordComboBox(), CPathBuffer::Clear(), CCJTreeCtrl::ClearSelection(), CCJMemFile::Close(), CompatGetModuleListItem(), CompatGetPassword(), CompatGetValue(), CompatMoveToTrash(), Win32wstring::convert(), CopyScreenToBitmap(), PyMenuMgr::Count(), CPathBuffer::CPathBuffer(), CPython_Interp::CPython_Interp(), CSplashWnd::Create(), CCJHtmlView::Create(), CCJColorPopup::Create(), CCJCaptionPopupWnd::Create(), PyPersistent::Create(), PyCmdUI::Create(), PyMenuMgr::Create(), PyColorConsole::Create(), PyCvsEntry::Create(), CreateDIB(), CCJToolBar::CreateEx(), CCJTabCtrlBar::CreateTabView(), CRevisionConsole::CRevisionConsole(), CSubclassWnd::CSubclassWnd(), CTipDlg::CTipDlg(), cvs_err(), cvs_errstr(), cvs_out(), cvs_outstr(), cvs_process_destroy(), cvs_process_new(), cvs_process_pop(), cvs_process_push(), cvs_process_run(), CvsAlert(), CvsArgs::CvsArgs(), CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdLock(), CvsCmdLog(), CvsCmdMoveToTrash(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), 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(), DDV_CJMinMaxDateTime(), DDV_CJMinMaxMonth(), PyMenuMgr::Delete(), PyMenuMgr::DeleteByCmd(), CCJMenu::DeleteMenu(), CCJTabCtrlBar::DeleteView(), CCJMenu::DestroyMenu(), 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(), PyCmdUI::Enable(), CCJControlBar::EnableDockingOnSizeBar(), CCJMDIFrameWnd::EnableDockingSizeBar(), CCJMDIChildWnd::EnableDockingSizeBar(), CCJFrameWnd::EnableDockingSizeBar(), CCJDockContext::EndDragDockBar(), CCJMemFile::Extract(), FileTraverse(), UStr::find(), CCJToolBar::FindDropDownButton(), CCJTreeCtrl::FindItem(), FindNextChildWindow(), FindNextSiblingWindow(), FindPrevSiblingWindow(), FindPrevWindow(), findTcl(), garby_alloc(), garby_free(), garbyNew(), garbyRemove(), CWincvsApp::GetAppVersion(), GetAsSystemTime(), PyCvsEntry::GetAttr(), PyContainer::GetAttr(), CCJToolBar::GetButtonText(), CCJDockContext::GetDockBar(), CWincvsApp::GetDocument(), CBrowseFileView::GetEntriesModTime(), CWincvsApp::GetFileView(), CCJTreeCtrl::GetFirstSelectedItem(), CGfxOutBarCtrl::GetFolderChild(), CGfxOutBarCtrl::GetImageList(), CCJReBarCtrl::GetImageList(), CCJTreeCtrl::GetLastItem(), CCJMenu::GetMenuText(), CCJTreeCtrl::GetNextItem(), GetNextParentWindow(), CCJTreeCtrl::GetNextSelectedItem(), CTipDlg::GetNextTipString(), CCJStatusBar::GetPanControl(), CCJTreeCtrl::GetPrevItem(), GetPrevParentWindow(), CCJTreeCtrl::GetPrevSelectedItem(), CCJHtmlView::GetProperty(), CCJDateTimeCtrl::GetRange(), KiSelectionHandler::GetSelection(), GetSubCMenu(), CGraphDoc::GetTreeView(), PyPersistent::GetValue(), GetValue::GetValue(), CCJTabView::GetView(), CCJTabCtrlBar::GetView(), CCJTabCtrlBar::GetViewName(), glue_getenv(), CCJHyperLink::GotoURL(), CCJFlatSplitterWnd::HideColumn(), CCJFlatSplitterWnd::HideRow(), CGfxOutBarCtrl::HighlightFolder(), CGfxOutBarCtrl::HighlightItem(), CCJSizeDockBar::HitTest(), CCJControlBar::HitTest(), CSubclassWnd::HookWindow(), CCJMemFile::Import(), CRevisionConsole::init(), CWincvsApp::InitATL(), CCJColorPopup::Initialise(), initialize_all(), CCJFontCombo::InitializeFonts(), InitializeInterp(), CCJMDIFrameWnd::InitializeMenu(), CCJMemFile::Insert(), CCJToolBar::InsertControl(), CCJMenu::InsertODMenuW(), CSubclassWnd::IsHooked(), CCJSizeDockBar::IsLastControlBar(), KoFilterModel::IsMatch(), IsShellType(), IsValidHandle(), KiSelectionHandler::KiSelectionHandler(), KoTraversalContext::KoTraversalContext(), LaunchDiff(), LaunchItemListCommand(), LaunchViewer(), listAddCell(), listFree(), listNew(), CCJMemFile::Load(), CvsPrefs::load(), CCJToolBar::LoadBitmap(), CCJMenu::LoadCheckmarkBitmap(), LoadDIB(), CCJMenu::LoadMenu(), CCJMenu::LoadSysColorBitmap(), CCJToolBar::LoadToolBar(), CCJWindowPlacement::LoadWindowPos(), CSubclassWndMap::Lookup(), MakeOleVariant(), CCJMenu::MeasureItem(), CCJMenu::ModifyODMenuW(), mystrdup(), myTcl_CreateInterp(), CCJHtmlView::Navigate(), CCJHtmlView::Navigate2(), CCJMDIFrameWnd::NewMenu(), NotificationManager::Node::Node(), CCJToolBar::OnBarStyleChange(), CMainFrame::OnBroadcastCmdMsg(), CMainFrame::OnCreate(), CCJFlatTabCtrl::OnCreate(), CBrowseFileView::OnDestroy(), CGfxSplitterWnd::OnDrawSplitter(), CCJFlatSplitterWnd::OnDrawSplitter(), CWincvsView::OnDropFiles(), CMainFrame::OnDropFiles(), CCJHexEdit::OnEditPaste(), CCJHtmlView::OnFilePrint(), CCJReBar::OnHeightChange(), CTipDlg::OnInitDialog(), CMainFrame::OnInitMenu(), CGraphView::OnInitMenuPopup(), CGfxSplitterWnd::OnInvertTracker(), CCJSizeDockBar::OnInvertTracker(), CCJControlBar::OnInvertTracker(), CCJMetaFileButton::OnLButtonDblClk(), CCJFlatButton::OnLButtonDblClk(), CGfxOutBarCtrl::OnLButtonDown(), CCJTreeCtrl::OnLButtonDown(), CCJControlBar::OnLButtonDown(), CCJMenuBar::OnMenuSelect(), CCJToolBar::OnNcCreate(), CCJReBar::OnNcCreate(), CCJMiniDockFrameWnd::OnNcLButtonDblClk(), CCJMiniDockFrameWnd::OnNcLButtonDown(), CCJReBar::OnShowBand(), CCJHtmlView::OnStatusTextChange(), CCJToolBar::OnSysColorChange(), CCJToolBar::OnToolHitTest(), CCJReBar::OnToolHitTest(), CCJControlBar::OnUpdateCmdUI(), CGraphView::OnViewDiff(), CCJTabView::OnWindowPosChanged(), CCJTabCtrlBar::OnWindowPosChanged(), CCJMemFile::Open(), Authen::parse_cvsroot(), PathNameFromDirID(), PathNameFromWD(), CWincvsApp::PeekPumpAndIdle(), poolAlloc(), poolFree(), poolRemove(), CProgressDlg::PostNcDestroy(), CSplashWnd::PreTranslateAppMessage(), PyColorConsole::Print(), CvsArgs::print(), PyAutoObject< T >::PyAutoObject(), ReadDIBFile(), ReadIgnoredFile(), UToolbar::RebuildBar(), CCJSizeDockBar::RecalcAllExcept(), CCJMDIFrameWnd::RecalcAllExcept(), CCJMDIChildWnd::RecalcAllExcept(), CCJFrameWnd::RecalcAllExcept(), CGfxSplitterWnd::RecalcLayout(), PyContainer::RegisterValue(), CSubclassWndMap::RemoveAll(), CCJTabCtrlBar::RemoveAllTabs(), CCJTabCtrlBar::RemoveListItem(), CCJMenu::RemoveMenu(), CCJStatusBar::RemovePane(), CvsArgs::reset(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), UStr::rfind(), CCJMemFile::Save(), SaveBmpFromDDB(), CWincvsDoc::Serialize(), CCJTabView::SetActiveView(), CCJTabCtrlBar::SetActiveView(), CCJToolBar::SetBitmap(), CCJToolBar::SetButtons(), CCJToolBar::SetButtonText(), PyCmdUI::SetCheck(), CCJHyperLink::SetDefaultCursor(), CCJMonthCalCtrl::SetFirstDayOfWeek(), CGfxOutBarCtrl::SetFolderImageList(), CGfxOutBarCtrl::SetFolderText(), CGfxOutBarCtrl::SetImageList(), CGfxOutBarCtrl::SetItemText(), CCJHyperLink::SetLinkCursor(), CCJToolBar::SetOwner(), CCJMonthCalCtrl::SetRange(), CCJDateTimeCtrl::SetRange(), CCJFlatHeaderCtrl::SetSortImage(), PyCmdUI::SetText(), CCJDateTimeCtrl::SetTime(), CCJMonthCalCtrl::SetToday(), PyPersistent::SetValue(), CCJTabCtrlBar::SetViewToolTip(), CCJMenuData::SetWideString(), shl_calloc(), shl_free(), shl_malloc(), shl_realloc(), CSplashWnd::ShowSplashScreen(), CWincvsApp::ShowTipAtStartup(), Authen::skiptoken(), split(), CCJMenu::SynchronizeMenu(), tclGetDebugMaskProc(), tclGetFileModTimeProc(), tclSetDebugMaskProc(), CCJDockContext::ToggleDocking(), CCJDockContext::TrackDockBar(), CCJMenuBar::TrackPopup(), TrimRight(), PyAutoObject< T >::UnRef(), CWinLogData::UnselectAll(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogRevData::UpdateSelf(), CWinLogHeaderData::UpdateSelf(), updateUIMenu(), USmartCombo::USmartCombo(), UWinPseudoWindowProc(), VRef2VolName(), wire_read_string(), CCJHtmlView::~CCJHtmlView(), CCJMemFile::~CCJMemFile(), CSplashWnd::~CSplashWnd(), 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 Fri Jan 31 12:09:56 2003 for WinCvs Source by doxygen 1.3-rc2


GetPassword.cpp File Reference

common/GetPassword.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "GetPassword.h"
#include "CvsCommands.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 163 of file GetPassword.cpp.

References EV_INIT_WIDGET, GetEnvValue(), kUMainWidget, UStr::length(), GetPassword::m_passwd, NULL, UCreate_PasswdDlg(), and UEventSendMessage().

Referenced by glue_getenv().

00164 {
00165 #ifdef WIN32
00166     static char passwd[255];
00167     GetPassword gp;
00168     if(gp.DoModal() == IDOK)
00169     {
00170         strcpy(passwd, gp.m_passwd);
00171         return passwd;
00172     }
00173     return "";
00174 #endif /* WIN32 */
00175 //{ Mac-Part
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 //}
00359 #if qUnix
00360     static char passwd[255];
00361     void *wid = UCreate_PasswdDlg();
00362
00363     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00364     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00365
00366     if(dlg->DoModal())
00367     {
00368         strcpy(passwd, dlg->m_passwd);
00369     }
00370     else
00371         strcpy(passwd, "");
00372
00373     delete dlg;
00374     return passwd;
00375 #endif // qUnix
00376 }

Generated on Fri Jan 31 12:09:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 163 of file GetPassword.cpp.

References EV_INIT_WIDGET, GetEnvValue(), kUMainWidget, UStr::length(), GetPassword::m_passwd, NULL, UCreate_PasswdDlg(), and UEventSendMessage().

Referenced by glue_getenv().

00164 {
00165 #ifdef WIN32
00166     static char passwd[255];
00167     GetPassword gp;
00168     if(gp.DoModal() == IDOK)
00169     {
00170         strcpy(passwd, gp.m_passwd);
00171         return passwd;
00172     }
00173     return "";
00174 #endif /* WIN32 */
00175 //{ Mac-Part
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 //}
00359 #if qUnix
00360     static char passwd[255];
00361     void *wid = UCreate_PasswdDlg();
00362
00363     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00364     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00365
00366     if(dlg->DoModal())
00367     {
00368         strcpy(passwd, dlg->m_passwd);
00369     }
00370     else
00371         strcpy(passwd, "");
00372
00373     delete dlg;
00374     return passwd;
00375 #endif // qUnix
00376 }

Generated on Fri Jan 31 12:09:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.h"

Include dependency graph for GetPrefs.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void CompatGetPrefs (void)
Get the CVSROOT, authentication, and misc options.

Function Documentation

void CompatGetPrefs ( void )

Get the CVSROOT, authentication, and misc options.

Definition at line 1657 of file GetPrefs.cpp.

References CvsArgs::Argv(), AuthenKind, MultiFiles::begin(), BrowserGetMultiFiles(), UStr::c_str(), cvs_err(), cvs_out(), UStr::endsWith(), EV_INIT_WIDGET, kUMainWidget, MacBinMaps::LoadDefaults(), MacBinMaps::SaveDefaults(), CMacBinTable::SetCurrentMap(), CGetPrefs_CVSROOT::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), CGetPrefs_CVS::StoreValues(), CGetPrefs_WINCVS::StoreValues(), CGetPrefs_CVSCMD_DIALOGS::StoreValues(), UCreate_gcvs_Settings(), and UEventSendMessage().

Referenced by CWincvsDoc::OnAppPreferences(), and UCvsApp::SayWelcome().

01658 {
01659     bool userHitOK = false;
01660
01661     // Store current CVSROOT
01662     const UStr prevCvsroot((const char*)gCvsPrefs);
01663     const AuthenKind prevKind = gAuthen.kind();
01664
01665 #ifdef WIN32   //{ WIN32
01666     CPropertySheet pages("WinCvs Preferences");
01667     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01668
01669     CGetPrefs_CVSROOT page1;
01670     CGetPrefs_GLOBALS page2;
01671     CGetPrefs_CVS page3;
01672     CGetPrefs_WINCVS page4;
01673     CGetPrefs_CVSCMD_DIALOGS page5;
01674
01675     pages.AddPage(&page1);
01676     pages.AddPage(&page2);
01677     pages.AddPage(&page3);
01678     pages.AddPage(&page4);
01679     pages.AddPage(&page5);
01680
01681     if( pages.DoModal() == IDOK )
01682     {
01683         page1.StoreValues();
01684         page2.StoreValues();
01685         page3.StoreValues();
01686         page4.StoreValues();
01687         page5.StoreValues();
01688         userHitOK = true;
01689     }
01690 #endif //} WIN32
01691
01692 #ifdef qMacCvsPP  //{ qMacCvsPP
01693     MacBinMaps maps;
01694     maps.LoadDefaults();
01695     CMacBinTable::SetCurrentMap(&maps);
01696
01697     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01698     LWindow *theDialog = theHandler.GetDialog();
01699     ThrowIfNil_(theDialog);
01700     static UInt16 sRuntimePanel = 1;
01701
01702     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01703         (theDialog->FindPaneByID(item_MultiViewPrefs));
01704     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01705
01706     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01707     ThrowIfNil_(handler);
01708
01709     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01710
01711     multiView->SwitchToPanel(5);
01712     DoDataExchange_Fonts(theDialog, true);
01713     multiView->SwitchToPanel(4);
01714     DoDataExchange_BinFiles(theDialog, maps, true);
01715     multiView->SwitchToPanel(3);
01716     DoDataExchange_TextFiles(theDialog, true);
01717     LPushButton *diffbtn = dynamic_cast<LPushButton*>(theDialog->FindPaneByID(item_BrowseExtDiff));
01718     diffbtn->AddListener(&theHandler);
01719     multiView->SwitchToPanel(2);
01720     DoDataExchange_Globals(theDialog, true);
01721     multiView->SwitchToPanel(1);
01722     DoDataExchange_Cvsroot(handler, true);
01723
01724     groupView->SetValue(sRuntimePanel);
01725     theDialog->Show();
01726     MessageT hitMessage;
01727     SInt32    lastDiffToolValue(0);
01728     while (true)
01729     {       // Let DialogHandler process events
01730         hitMessage = theHandler.DoDialog();
01731
01732         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01733             break;
01734
01735         if (hitMessage == item_BrowseExtDiff)
01736         {
01737             MultiFiles mf;
01738             if( BrowserGetMultiFiles("Select the external diff application", mf, true, kSelectExecutable) )
01739             {
01740                 CvsArgs args(false);
01741                 const char *dir = (*mf.begin()).add(args);
01742                 char * const *argv = args.Argv();
01743                 UStr fullpath;
01744                 fullpath = dir;
01745                 if(!fullpath.endsWith(kPathDelimiter))
01746                     fullpath << kPathDelimiter;
01747                 fullpath << argv[0];
01748
01749                 LEditText *editdiff = dynamic_cast<LEditText*>
01750                     (theDialog->FindPaneByID(item_EditExtDiff));
01751                 editdiff->SetText(LStr255(fullpath.c_str()));
01752             }
01753         }
01754         else if ( hitMessage == /*item_UseExtDiff*/0 /*popup group box doesn't send value message?*/ )
01755         {
01756           LPane*  useExtDiff = theDialog->FindPaneByID(item_UseExtDiff);
01757         if ( useExtDiff  &&  useExtDiff->GetValue() != lastDiffToolValue )
01758         {
01759           lastDiffToolValue = useExtDiff->GetValue();
01760         LPane*  editField = theDialog->FindPaneByID(item_EditExtDiff);
01761         LPane*  button = theDialog->FindPaneByID(item_BrowseExtDiff);
01762           if ( lastDiffToolValue != 4 ) // %%% should better not check by item position!
01763           {
01764             if ( editField ) editField->Disable();
01765             if ( button ) button->Disable();
01766           }
01767           else
01768           {
01769             if ( editField ) editField->Enable();
01770             if ( button ) button->Enable();
01771           }
01772       }
01773         }
01774     }
01775     theDialog->Hide();
01776     sRuntimePanel = groupView->GetValue();
01777
01778     if(hitMessage == msg_OK)
01779     {
01780         userHitOK = true;
01781
01782         multiView->SwitchToPanel(1);
01783         DoDataExchange_Cvsroot(handler, false);
01784         multiView->SwitchToPanel(2);
01785         DoDataExchange_Globals(theDialog, false);
01786         multiView->SwitchToPanel(3);
01787         DoDataExchange_TextFiles(theDialog, false);
01788         multiView->SwitchToPanel(4);
01789         DoDataExchange_BinFiles(theDialog, maps, false);
01790         multiView->SwitchToPanel(5);
01791         DoDataExchange_Fonts(theDialog, false);
01792
01793         maps.SaveDefaults();
01794     }
01795 #endif //} qMacCvsPP
01796
01797 #if qUnix  //{ Unix-Part
01798     void *wid = UCreate_gcvs_Settings();
01799
01800     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01801     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01802     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01803     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01804     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01805     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01806     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01807     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01808     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01809     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01810     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01811     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01812
01813     if(dlg->DoModal())
01814     {
01815         tab1->StoreValues();
01816         tab2->StoreValues();
01817         tab3->StoreValues();
01818         tab4->StoreValues();
01819         tab5->StoreValues();
01820
01821         userHitOK = true;
01822     }
01823     delete dlg;
01824 #endif //} qUnix
01825
01826     if( userHitOK && !gCvsPrefs.empty() )
01827     {
01828         if( prevCvsroot != (const char*)gCvsPrefs || prevKind != gAuthen.kind() )
01829         {
01830             cvs_out("NEW CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01831             cvs_err("CVSROOT change will only take effect when commands are run from a non-CVS folder.\n"
01832                 "To change the CVSROOT of an existing sandbox please use the ChangeRoot macro.\n");
01833         }
01834         else
01835         {
01836             cvs_out("CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01837         }
01838
01839         gCvsPrefs.save();
01840     }
01841 }

Generated on Fri Jan 31 12:09:57 2003 for WinCvs Source by doxygen 1.3-rc2


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_CVS
CVS preferences property page. More...

class | CGetPrefs_CVSCMD_DIALOGS
Command dialogs preferences property page. More...

class | CGetPrefs_CVSROOT
General preferences property page. More...

class | CGetPrefs_GLOBALS
Global preferences property page. More...

class | CGetPrefs_WINCVS
WinCvs preferences property page. More...

Defines

#define | AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

void | CompatGetPrefs (void)
Get the CVSROOT, authentication, and misc options.

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 )

Get the CVSROOT, authentication, and misc options.

Definition at line 1657 of file GetPrefs.cpp.

References CvsArgs::Argv(), AuthenKind, MultiFiles::begin(), BrowserGetMultiFiles(), UStr::c_str(), cvs_err(), cvs_out(), UStr::endsWith(), EV_INIT_WIDGET, kUMainWidget, MacBinMaps::LoadDefaults(), MacBinMaps::SaveDefaults(), CMacBinTable::SetCurrentMap(), CGetPrefs_CVSCMD_DIALOGS::StoreValues(), CGetPrefs_WINCVS::StoreValues(), CGetPrefs_CVS::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), CGetPrefs_CVSROOT::StoreValues(), UCreate_gcvs_Settings(), and UEventSendMessage().

Referenced by CWincvsDoc::OnAppPreferences(), and UCvsApp::SayWelcome().

01658 {
01659     bool userHitOK = false;
01660
01661     // Store current CVSROOT
01662     const UStr prevCvsroot((const char*)gCvsPrefs);
01663     const AuthenKind prevKind = gAuthen.kind();
01664
01665 #ifdef WIN32   //{ WIN32
01666     CPropertySheet pages("WinCvs Preferences");
01667     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01668
01669     CGetPrefs_CVSROOT page1;
01670     CGetPrefs_GLOBALS page2;
01671     CGetPrefs_CVS page3;
01672     CGetPrefs_WINCVS page4;
01673     CGetPrefs_CVSCMD_DIALOGS page5;
01674
01675     pages.AddPage(&page1);
01676     pages.AddPage(&page2);
01677     pages.AddPage(&page3);
01678     pages.AddPage(&page4);
01679     pages.AddPage(&page5);
01680
01681     if( pages.DoModal() == IDOK )
01682     {
01683         page1.StoreValues();
01684         page2.StoreValues();
01685         page3.StoreValues();
01686         page4.StoreValues();
01687         page5.StoreValues();
01688         userHitOK = true;
01689     }
01690 #endif //} WIN32
01691
01692 #ifdef qMacCvsPP  //{ qMacCvsPP
01693     MacBinMaps maps;
01694     maps.LoadDefaults();
01695     CMacBinTable::SetCurrentMap(&maps);
01696
01697     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01698     LWindow *theDialog = theHandler.GetDialog();
01699     ThrowIfNil_(theDialog);
01700     static UInt16 sRuntimePanel = 1;
01701
01702     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01703         (theDialog->FindPaneByID(item_MultiViewPrefs));
01704     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01705
01706     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01707     ThrowIfNil_(handler);
01708
01709     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01710
01711     multiView->SwitchToPanel(5);
01712     DoDataExchange_Fonts(theDialog, true);
01713     multiView->SwitchToPanel(4);
01714     DoDataExchange_BinFiles(theDialog, maps, true);
01715     multiView->SwitchToPanel(3);
01716     DoDataExchange_TextFiles(theDialog, true);
01717     LPushButton *diffbtn = dynamic_cast<LPushButton*>(theDialog->FindPaneByID(item_BrowseExtDiff));
01718     diffbtn->AddListener(&theHandler);
01719     multiView->SwitchToPanel(2);
01720     DoDataExchange_Globals(theDialog, true);
01721     multiView->SwitchToPanel(1);
01722     DoDataExchange_Cvsroot(handler, true);
01723
01724     groupView->SetValue(sRuntimePanel);
01725     theDialog->Show();
01726     MessageT hitMessage;
01727     SInt32    lastDiffToolValue(0);
01728     while (true)
01729     {       // Let DialogHandler process events
01730         hitMessage = theHandler.DoDialog();
01731
01732         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01733             break;
01734
01735         if (hitMessage == item_BrowseExtDiff)
01736         {
01737             MultiFiles mf;
01738             if( BrowserGetMultiFiles("Select the external diff application", mf, true, kSelectExecutable) )
01739             {
01740                 CvsArgs args(false);
01741                 const char *dir = (*mf.begin()).add(args);
01742                 char * const *argv = args.Argv();
01743                 UStr fullpath;
01744                 fullpath = dir;
01745                 if(!fullpath.endsWith(kPathDelimiter))
01746                     fullpath << kPathDelimiter;
01747                 fullpath << argv[0];
01748
01749                 LEditText *editdiff = dynamic_cast<LEditText*>
01750                     (theDialog->FindPaneByID(item_EditExtDiff));
01751                 editdiff->SetText(LStr255(fullpath.c_str()));
01752             }
01753         }
01754         else if ( hitMessage == /*item_UseExtDiff*/0 /*popup group box doesn't send value message?*/ )
01755         {
01756           LPane*  useExtDiff = theDialog->FindPaneByID(item_UseExtDiff);
01757         if ( useExtDiff  &&  useExtDiff->GetValue() != lastDiffToolValue )
01758         {
01759           lastDiffToolValue = useExtDiff->GetValue();
01760         LPane*  editField = theDialog->FindPaneByID(item_EditExtDiff);
01761         LPane*  button = theDialog->FindPaneByID(item_BrowseExtDiff);
01762           if ( lastDiffToolValue != 4 ) // %%% should better not check by item position!
01763           {
01764             if ( editField ) editField->Disable();
01765             if ( button ) button->Disable();
01766           }
01767           else
01768           {
01769             if ( editField ) editField->Enable();
01770             if ( button ) button->Enable();
01771           }
01772       }
01773         }
01774     }
01775     theDialog->Hide();
01776     sRuntimePanel = groupView->GetValue();
01777
01778     if(hitMessage == msg_OK)
01779     {
01780         userHitOK = true;
01781
01782         multiView->SwitchToPanel(1);
01783         DoDataExchange_Cvsroot(handler, false);
01784         multiView->SwitchToPanel(2);
01785         DoDataExchange_Globals(theDialog, false);
01786         multiView->SwitchToPanel(3);
01787         DoDataExchange_TextFiles(theDialog, false);
01788         multiView->SwitchToPanel(4);
01789         DoDataExchange_BinFiles(theDialog, maps, false);
01790         multiView->SwitchToPanel(5);
01791         DoDataExchange_Fonts(theDialog, false);
01792
01793         maps.SaveDefaults();
01794     }
01795 #endif //} qMacCvsPP
01796
01797 #if qUnix  //{ Unix-Part
01798     void *wid = UCreate_gcvs_Settings();
01799
01800     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01801     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01802     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01803     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01804     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01805     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01806     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01807     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01808     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01809     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01810     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01811     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01812
01813     if(dlg->DoModal())
01814     {
01815         tab1->StoreValues();
01816         tab2->StoreValues();
01817         tab3->StoreValues();
01818         tab4->StoreValues();
01819         tab5->StoreValues();
01820
01821         userHitOK = true;
01822     }
01823     delete dlg;
01824 #endif //} qUnix
01825
01826     if( userHitOK && !gCvsPrefs.empty() )
01827     {
01828         if( prevCvsroot != (const char*)gCvsPrefs || prevKind != gAuthen.kind() )
01829         {
01830             cvs_out("NEW CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01831             cvs_err("CVSROOT change will only take effect when commands are run from a non-CVS folder.\n"
01832                 "To change the CVSROOT of an existing sandbox please use the ChangeRoot macro.\n");
01833         }
01834         else
01835         {
01836             cvs_out("CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01837         }
01838
01839         gCvsPrefs.save();
01840     }
01841 }

Generated on Fri Jan 31 12:09:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:59 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:09:59 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:09:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:00 2003 for WinCvs Source by doxygen 1.3-rc2


ImportDlg.cpp File Reference

common/ImportDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ImportDlg.h"
#include "CvsPrefs.h"
#include "MultiFiles.h"
#include "MultiString.h"
#include "PromptFiles.h"
#include "ItemListDlg.h"
#include "CvsCommands.h"
#include "GetPrefs.h"

Include dependency graph for ImportDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatGetImport (const MultiFiles *mf, UPStr &modname, UStr &logmsg, UPStr &vendortag, UPStr &reltag, UPStr &path, bool &useDefIgnore, bool &useFilesTime)
Get the import options.

Variables

char * | sDefReleases []
char * | sDefVendors []
char * | sDefModuleNames []
CMString | gVendorNames (10,"P_VendorNames", sDefVendors)
CMString | gReleasesNames (10,"P_ReleaseNames", sDefReleases)
CMString | gImportModuleNames (10,"P_ImportModuleNames", sDefModuleNames)

Function Documentation

bool CompatGetImport | ( | const MultiFiles * | mf,
 |  | UPStr & | modname,
 |  | UStr & | logmsg,
 |  | UPStr & | vendortag,
 |  | UPStr & | reltag,
 |  | UPStr & | path,
 |  | bool & | useDefIgnore,
 |  | bool & | useFilesTime
 | ) |

Get the import options.

Definition at line 479 of file ImportDlg.cpp.

References BrowserGetDirectory(), CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CImport_MAIN::m_logmsg, CImport_MAIN::m_moduleName, CImport_OPTIONS::m_path, CImport_MAIN::m_rtag, CImport_OPTIONS::m_useDefIgnore, CImport_OPTIONS::m_useFilesTime, CImport_MAIN::m_vtag, SplitPath(), CGetPrefs_CVSROOT::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_ImportDlg(), and UEventSendMessage().

Referenced by CvsCmdImportModule().

00483 {
00484     bool userHitOK = false;
00485     modname = "";
00486     logmsg = "";
00487     vendortag = "";
00488     reltag = "";
00489     useDefIgnore = false;
00490     useFilesTime = false;
00491
00492     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00493
00494     static CPStr sFolder;
00495     static CStr sLastMsg;
00496     static CPStr sLastVTag("avendor");
00497     static CPStr sLastRTag("arelease");
00498
00499     //dig out the folder so we can suggest the module name
00500     CStr uppath, folder;
00501     if( SplitPath(path, uppath, folder) )
00502         sFolder = folder;
00503
00504     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00505     {
00506         sLastModName = folder;
00507     }
00508 #ifdef WIN32
00509     CPropertySheet pages("Import settings");
00510     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00511     CImport_MAIN page1(mf, sLastMsg, sFolder, sLastRTag, sLastVTag);
00512     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00513     CGetPrefs_CVSROOT page3;
00514     CGetPrefs_GLOBALS page4;
00515     pages.AddPage(&page1);
00516     pages.AddPage(&page2);
00517     pages.AddPage(&page3);
00518     pages.AddPage(&page4);
00519     if(pages.DoModal() == IDOK)
00520     {
00521         sLastModName = (const char *)page1.m_moduleName;
00522         sLastMsg = (const char *)page1.m_logmsg;
00523         sLastVTag = (const char *)page1.m_vtag;
00524         sLastRTag = (const char *)page1.m_rtag;
00525         path = (const char *)page2.m_path;
00526         useDefIgnore = page2.m_useDefIgnore == TRUE;
00527         useFilesTime = page2.m_useFilesTime == TRUE;
00528
00529         page3.StoreValues();
00530         page4.StoreValues();
00531         userHitOK = true;
00532     }
00533 #endif /* WIN32 */
00534
00535 #ifdef qMacCvsPP
00536     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00537     LWindow *theDialog = theHandler.GetDialog();
00538     ThrowIfNil_(theDialog);
00539     static UInt16 sRuntimePanel = 1;
00540
00541     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00542         (theDialog->FindPaneByID(item_MultiViewPrefs));
00543     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00544
00545     multiView->SwitchToPanel(3);
00546     DoDataExchange_Globals(theDialog, true);
00547     multiView->SwitchToPanel(2);
00548     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00549     DoDataExchange (theDialog, item_EditPath, path, true);
00550     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00551
00552     multiView->SwitchToPanel(1);
00553     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00554     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00555
00556
00557     groupView->SetValue(sRuntimePanel);
00558     theDialog->Show();
00559     MessageT hitMessage;
00560     while (true)
00561     {       // Let DialogHandler process events
00562         hitMessage = theHandler.DoDialog();
00563
00564         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00565             break;
00566
00567         if(hitMessage == item_EditPath)
00568         {
00569             CStr dir;
00570             if( BrowserGetDirectory("Select a directory to import from", dir) )
00571             {
00572                 CPStr tmp(dir.c_str());
00573                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00574             }
00575         }
00576     }
00577     theDialog->Hide();
00578     sRuntimePanel = groupView->GetValue();
00579
00580     if(hitMessage == msg_OK)
00581     {
00582         multiView->SwitchToPanel(1);
00583         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00584         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00585         multiView->SwitchToPanel(2);
00586         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00587         DoDataExchange (theDialog, item_EditPath, path, false);
00588         multiView->SwitchToPanel(3);
00589         DoDataExchange_Globals(theDialog, false);
00590
00591         Assert_(sLastModName.length() != 0);
00592
00593         userHitOK = true;
00594     }
00595 #endif /* qMacCvsPP */
00596
00597 #if qUnix
00598     void *wid = UCreate_ImportDlg();
00599
00600     UCvsImport *dlg = new UCvsImport();
00601     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00602     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00603     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00604     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00605     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00606
00607     if(dlg->DoModal())
00608     {
00609         sLastModName = tab1->m_modname;
00610         sLastMsg = tab1->m_logmsg;
00611         sLastVTag = tab1->m_vtag;
00612         sLastRTag = tab1->m_rtag;
00613         path = tab2->m_path;
00614
00615         userHitOK = true;
00616     }
00617
00618     delete dlg;
00619 #endif // qUnix
00620
00621     if(userHitOK)
00622     {
00623         gCvsPrefs.save();
00624         if(sLastMsg.length() == 0)
00625             sLastMsg = "no message";
00626         if(sLastVTag.length() == 0)
00627             sLastVTag = "initial";
00628         if(sLastRTag.length() == 0)
00629             sLastRTag = "start";
00630
00631         modname = sLastModName;
00632         logmsg = sLastMsg;
00633         vendortag = sLastVTag;
00634         reltag = sLastRTag;
00635 #ifdef TARGET_OS_MAC
00636         logmsg.replace('\015', '\012');
00637 #endif /* TARGET_OS_MAC */
00638     }
00639     return userHitOK;
00640 }

Variable Documentation

CMString gImportModuleNames(10, "P_ImportModuleNames", sDefModuleNames) [static]

CMString gReleasesNames(10, "P_ReleaseNames", sDefReleases)

Definition at line 50 of file UpdateDlg.h.

CMString gVendorNames(10, "P_VendorNames", sDefVendors) [static]

char* sDefModuleNames[] [static]

Initial value:

{
    "Module",
    "Project",
    0L
}

Definition at line 69 of file ImportDlg.cpp.

char* sDefReleases[] [static]

Initial value:

{
    "V10",
    "V101",
    0L
}

Definition at line 56 of file ImportDlg.cpp.

char* sDefVendors[] [static]

Initial value:

{
    "GNU",
    0L
}

Definition at line 63 of file ImportDlg.cpp.

Generated on Fri Jan 31 12:10:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, UPStr &modname, UStr &logmsg, UPStr &vendortag, UPStr &reltag, UPStr &path, bool &useDefIgnore, bool &useFilesTime)
Get the import options.

Define Documentation

#define AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file ImportDlg.h.

Function Documentation

bool CompatGetImport | ( | const MultiFiles * | mf,
 |  | UPStr & | modname,
 |  | UStr & | logmsg,
 |  | UPStr & | vendortag,
 |  | UPStr & | reltag,
 |  | UPStr & | path,
 |  | bool & | useDefIgnore,
 |  | bool & | useFilesTime
 | ) |

Get the import options.

Definition at line 479 of file ImportDlg.cpp.

References BrowserGetDirectory(), CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CImport_MAIN::m_logmsg, CImport_MAIN::m_moduleName, 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().

Referenced by CvsCmdImportModule().

00483 {
00484     bool userHitOK = false;
00485     modname = "";
00486     logmsg = "";
00487     vendortag = "";
00488     reltag = "";
00489     useDefIgnore = false;
00490     useFilesTime = false;
00491
00492     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00493
00494     static CPStr sFolder;
00495     static CStr sLastMsg;
00496     static CPStr sLastVTag("avendor");
00497     static CPStr sLastRTag("arelease");
00498
00499     //dig out the folder so we can suggest the module name
00500     CStr uppath, folder;
00501     if( SplitPath(path, uppath, folder) )
00502         sFolder = folder;
00503
00504     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00505     {
00506         sLastModName = folder;
00507     }
00508 #ifdef WIN32
00509     CPropertySheet pages("Import settings");
00510     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00511     CImport_MAIN page1(mf, sLastMsg, sFolder, sLastRTag, sLastVTag);
00512     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00513     CGetPrefs_CVSROOT page3;
00514     CGetPrefs_GLOBALS page4;
00515     pages.AddPage(&page1);
00516     pages.AddPage(&page2);
00517     pages.AddPage(&page3);
00518     pages.AddPage(&page4);
00519     if(pages.DoModal() == IDOK)
00520     {
00521         sLastModName = (const char *)page1.m_moduleName;
00522         sLastMsg = (const char *)page1.m_logmsg;
00523         sLastVTag = (const char *)page1.m_vtag;
00524         sLastRTag = (const char *)page1.m_rtag;
00525         path = (const char *)page2.m_path;
00526         useDefIgnore = page2.m_useDefIgnore == TRUE;
00527         useFilesTime = page2.m_useFilesTime == TRUE;
00528
00529         page3.StoreValues();
00530         page4.StoreValues();
00531         userHitOK = true;
00532     }
00533 #endif /* WIN32 */
00534
00535 #ifdef qMacCvsPP
00536     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00537     LWindow *theDialog = theHandler.GetDialog();
00538     ThrowIfNil_(theDialog);
00539     static UInt16 sRuntimePanel = 1;
00540
00541     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00542         (theDialog->FindPaneByID(item_MultiViewPrefs));
00543     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00544
00545     multiView->SwitchToPanel(3);
00546     DoDataExchange_Globals(theDialog, true);
00547     multiView->SwitchToPanel(2);
00548     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00549     DoDataExchange (theDialog, item_EditPath, path, true);
00550     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00551
00552     multiView->SwitchToPanel(1);
00553     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00554     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00555
00556
00557     groupView->SetValue(sRuntimePanel);
00558     theDialog->Show();
00559     MessageT hitMessage;
00560     while (true)
00561     {       // Let DialogHandler process events
00562         hitMessage = theHandler.DoDialog();
00563
00564         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00565             break;
00566
00567         if(hitMessage == item_EditPath)
00568         {
00569             CStr dir;
00570             if( BrowserGetDirectory("Select a directory to import from", dir) )
00571             {
00572                 CPStr tmp(dir.c_str());
00573                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00574             }
00575         }
00576     }
00577     theDialog->Hide();
00578     sRuntimePanel = groupView->GetValue();
00579
00580     if(hitMessage == msg_OK)
00581     {
00582         multiView->SwitchToPanel(1);
00583         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00584         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00585         multiView->SwitchToPanel(2);
00586         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00587         DoDataExchange (theDialog, item_EditPath, path, false);
00588         multiView->SwitchToPanel(3);
00589         DoDataExchange_Globals(theDialog, false);
00590
00591         Assert_(sLastModName.length() != 0);
00592
00593         userHitOK = true;
00594     }
00595 #endif /* qMacCvsPP */
00596
00597 #if qUnix
00598     void *wid = UCreate_ImportDlg();
00599
00600     UCvsImport *dlg = new UCvsImport();
00601     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00602     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00603     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00604     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00605     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00606
00607     if(dlg->DoModal())
00608     {
00609         sLastModName = tab1->m_modname;
00610         sLastMsg = tab1->m_logmsg;
00611         sLastVTag = tab1->m_vtag;
00612         sLastRTag = tab1->m_rtag;
00613         path = tab2->m_path;
00614
00615         userHitOK = true;
00616     }
00617
00618     delete dlg;
00619 #endif // qUnix
00620
00621     if(userHitOK)
00622     {
00623         gCvsPrefs.save();
00624         if(sLastMsg.length() == 0)
00625             sLastMsg = "no message";
00626         if(sLastVTag.length() == 0)
00627             sLastVTag = "initial";
00628         if(sLastRTag.length() == 0)
00629             sLastRTag = "start";
00630
00631         modname = sLastModName;
00632         logmsg = sLastMsg;
00633         vendortag = sLastVTag;
00634         reltag = sLastRTag;
00635 #ifdef TARGET_OS_MAC
00636         logmsg.replace('\015', '\012');
00637 #endif /* TARGET_OS_MAC */
00638     }
00639     return userHitOK;
00640 }

Generated on Fri Jan 31 12:10:01 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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
 | ) |

Release memory allocated for warnings and conflicts lists

Parameters:
warnings | Warnings list
conflicts | Conflicts list

Definition at line 214 of file ImportFilter.cpp.

References ReportWarning::next, and ReportConflict::next.

Referenced by CompatImportFilter(), and CvsCmdImportModule().

00215 {
00216     ReportWarning* tmpwarn;
00217     ReportWarning* warn = warnings;
00218
00219     while( warn != 0L )
00220     {
00221         tmpwarn = warn;
00222         warn = warn->next;
00223         delete tmpwarn;
00224     }
00225
00226     ReportConflict* tmpconf;
00227     ReportConflict* conf = conflicts;
00228
00229     while( conf != 0L )
00230     {
00231         tmpconf = conf;
00232         conf = conf->next;
00233         delete tmpconf;
00234     }
00235 }

void list_add_type | ( | ImportReport * | impReport,
 |  | ReportConflict *& | conflicts,
 |  | kFileType | fileType,
 |  | const char * | sample,
 |  | const char * | fullname,
 |  | int | mac_type,
 |  | int | mac_creator
 | ) | [static]

Add file to a warning/conflict list

Parameters:
impReport | Import report
conflicts | Conflicts list
fileType | File type
sample | Sample
fullname | Full name
mac_type | Mac specific type
mac_creator | Mac specific crator
Note:
When a file is added to the list, it is also processed through ignore filter. If file should be ignored then the initial state is "IGNORE" in import dialog box.

Definition at line 132 of file ImportFilter.cpp.

References ReportConflict::AddPattern(), cvs_err(), ImportReport::GetIgnoreList(), ReportConflict::GetMacCreator(), ReportConflict::GetMacType(), ReportConflict::HasConflict(), ReportConflict::Ignore(), ReportConflict::IsBinary(), ReportConflict::IsUnicode(), kFileTypeBin, kFileTypeUnicode, ReportConflict::Match(), MatchIgnoredList(), NEW, ReportConflict::next, ReportConflict::SetConflict(), and ReportConflict::SetTypeCreatorConflict().

Referenced by ImportReport::OnFile().

00135 {
00136     // Look for a matching entry
00137     ReportConflict* entry = conflicts;
00138     while( entry != 0L )
00139     {
00140         if( entry->Match(sample) )
00141         {
00142             if( entry->HasConflict() )
00143                 return;
00144
00145             if( entry->IsBinary() ^ (kFileTypeBin == fileType) )
00146                 entry->SetConflict(fullname);
00147
00148             if( entry->IsUnicode() ^ (kFileTypeUnicode == fileType) )
00149                 entry->SetConflict(fullname);
00150
00151             // Mac only
00152             if( entry->GetMacType() != mac_type || entry->GetMacCreator() != mac_creator )
00153                 entry->SetTypeCreatorConflict(fullname);
00154
00155             // It matches perfectly
00156             return;
00157         }
00158
00159         entry = entry->next;
00160     }
00161
00162     // Find the extension
00163     const char* tmp = sample, *ext = 0L;
00164
00165     while( (tmp = strchr(tmp, '.')) != 0L )
00166     {
00167         ext = tmp++;
00168     }
00169
00170     // Add a new entry
00171     ReportConflict* newc = NEW ReportConflict(mac_type, mac_creator);
00172     if( newc == 0L )
00173     {
00174         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportConflict));
00175         return;
00176     }
00177
00178     newc->AddPattern(ext != 0L ? ext : sample, fileType, ext != 0L, fullname);
00179
00180     if( conflicts == 0L )
00181     {
00182         conflicts = newc;
00183     }
00184     else
00185     {
00186         newc->next = conflicts;
00187         conflicts = newc;
00188     }
00189
00190     // MN - Apply ignore filter. If $HOME/.cvsignore tells that
00191     // file should be ignored then set object to ignored state.
00192     if( MatchIgnoredList(sample, impReport->GetIgnoreList()) )
00193         newc->Ignore();
00194 }

void list_add_warning | ( | ReportWarning *& | warnings,
 |  | kTextBinTYPE | warn,
 |  | const char * | sample
 | ) | [static]

Add new warning to the list or add the sample to already existing warning

Parameters:
warnings | Warning list
warn | Warning type
sample | Sample

Definition at line 81 of file ImportFilter.cpp.

References ReportWarning::AddWarning(), cvs_err(), ReportWarning::Kind(), NEW, and ReportWarning::next.

Referenced by ImportReport::OnAlias(), ImportReport::OnError(), and ImportReport::OnFile().

00082 {
00083     // Find if it exists already a same kind of warning
00084     ReportWarning* tmp = warnings;
00085     while( tmp != 0L )
00086     {
00087         if( tmp->Kind() == warn )
00088             break;
00089
00090         tmp = tmp->next;
00091     }
00092
00093     if( tmp != 0L && tmp->Kind() == warn )
00094     {
00095         tmp->AddWarning(sample);
00096         return;
00097     }
00098
00099     // Insert new one
00100     tmp = NEW ReportWarning(warn);
00101     if( tmp == 0L )
00102     {
00103         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportWarning));
00104         return;
00105     }
00106
00107     tmp->AddWarning(sample);
00108
00109     if( warnings == 0L )
00110     {
00111         warnings = tmp;
00112     }
00113     else
00114     {
00115         tmp->next = warnings;
00116         warnings = tmp;
00117     }
00118 }

kTraversal list_all_types_recur | ( | const char * | path,
 |  | ReportWarning *& | warnings,
 |  | ReportConflict *& | conflicts
 | ) |

Traverse path and add files to the warning and conflict lists

Parameters:
path | Path to traverse
warnings | Warnings list
conflicts | Conflicts list
Returns:
Traverse command as kTraversal

Definition at line 203 of file ImportFilter.cpp.

References FileTraverse(), and kTraversal.

Referenced by CompatImportFilter().

00204 {
00205     ImportReport report(path, warnings, conflicts);
00206     return FileTraverse(path, report);
00207 }

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 Fri Jan 31 12:10:02 2003 for WinCvs Source by doxygen 1.3-rc2


ImportFilter.h File Reference

common/ImportFilter.h File Reference

#include <vector>
#include "CPStr.h"
#include "FileTraversal.h"
#include "ProgressDlg.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 | ImportReport
Class to traverse and detect conflicts or warnings for import. More...

class | ReportConflict
Class to represent file type and help handle possible import conflicts. More...

class | ReportWarning
Class to represent a warning (wrong line feed, escape characters etc.) and a set of files which illustrates this warning. More...

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
 | ) |

Release memory allocated for warnings and conflicts lists

Parameters:
warnings | Warnings list
conflicts | Conflicts list

Definition at line 214 of file ImportFilter.cpp.

References ReportConflict::next, and ReportWarning::next.

Referenced by CompatImportFilter(), and CvsCmdImportModule().

00215 {
00216     ReportWarning* tmpwarn;
00217     ReportWarning* warn = warnings;
00218
00219     while( warn != 0L )
00220     {
00221         tmpwarn = warn;
00222         warn = warn->next;
00223         delete tmpwarn;
00224     }
00225
00226     ReportConflict* tmpconf;
00227     ReportConflict* conf = conflicts;
00228
00229     while( conf != 0L )
00230     {
00231         tmpconf = conf;
00232         conf = conf->next;
00233         delete tmpconf;
00234     }
00235 }

kTraversal list_all_types_recur | ( | const char * | path,
 |  | ReportWarning *& | warnings,
 |  | ReportConflict *& | conflicts
 | ) |

Traverse path and add files to the warning and conflict lists

Parameters:
path | Path to traverse
warnings | Warnings list
conflicts | Conflicts list
Returns:
Traverse command as kTraversal

Definition at line 203 of file ImportFilter.cpp.

References FileTraverse(), and kTraversal.

Referenced by CompatImportFilter().

00204 {
00205     ImportReport report(path, warnings, conflicts);
00206     return FileTraverse(path, report);
00207 }

Generated on Fri Jan 31 12:10:02 2003 for WinCvs Source by doxygen 1.3-rc2


ImportFilterDlg.cpp File Reference

common/ImportFilterDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ImportFilterDlg.h"
#include "AppConsole.h"

Include dependency graph for ImportFilterDlg.cpp:

Include dependency graph

Go to the source code of this file.

Enumerations

enum {
COL_STATE = 0,
COL_DESC,
COL_KIND,
COL_NUM
}
Columns enum. More...

Functions

bool | CompatImportFilter (const char *path, ReportConflict *&entries, ReportWarning *&warnings)
Get the import filter options.

Variables

char * | _gszColumnLabel [COL_NUM]
Column labels.

int | _gnColumnWidth [COL_NUM]
Column widths.

Enumeration Type Documentation

anonymous enum

Columns enum.

Enumeration values:
COL_STATE | State
COL_DESC | Description
COL_KIND | Kind
COL_NUM | Number of columns

Definition at line 63 of file ImportFilterDlg.cpp.

00064 {
00065     COL_STATE = 0,
00066     COL_DESC,
00067     COL_KIND,
00068     COL_NUM
00069 };

Function Documentation

bool CompatImportFilter | ( | const char * | path,
 |  | ReportConflict *& | entries,
 |  | ReportWarning *& | warnings
 | ) |

Get the import filter options.

Definition at line 1047 of file ImportFilterDlg.cpp.

References cvs_err(), EV_INIT_WIDGET, free_list_types(), kContinueTraversal, kTraversal, kUMainWidget, list_all_types_recur(), UCreate_ImportFilterDlg(), and UEventSendMessage().

Referenced by CvsCmdImportModule().

01048 {
01049     bool result = false;
01050     entries = 0L;
01051     warnings = 0L;
01052
01053     const kTraversal traversalResult = list_all_types_recur(path, warnings, entries);
01054     if( traversalResult != kContinueTraversal )
01055     {
01056         cvs_err("Import aborted on user's request.\n");
01057
01058         free_list_types(warnings, entries);
01059         entries = 0L;
01060         warnings = 0L;
01061
01062         return false;
01063     }
01064
01065     if( entries == 0L && warnings == 0L )
01066     {
01067         cvs_err("Import aborted - nothing to import.\n");
01068         return false;
01069     }
01070
01071 #ifdef WIN32
01072     CImportFilterDlg pages(entries, warnings);
01073     if( pages.DoModal() == IDOK )
01074     {
01075         result = true;
01076     }
01077     else
01078     {
01079         cvs_err("Import aborted.\n");
01080     }
01081 #endif /* WIN32 */
01082 #ifdef qMacCvsPP
01083     gWarnings = warnings;
01084     gEntries = entries;
01085
01086     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01087     LWindow *theDialog = theHandler.GetDialog();
01088     ThrowIfNil_(theDialog);
01089
01090     theDialog->Show();
01091     MessageT hitMessage;
01092     while (true)
01093     {       // Let DialogHandler process events
01094         hitMessage = theHandler.DoDialog();
01095
01096         if(hitMessage == item_ImpPushEdit)
01097         {
01098             // simulate dbl click
01099             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01100                 (theDialog->FindPaneByID(item_ImpFilterList));
01101
01102             STableCell  cell = tab->GetFirstSelectedCell();
01103             if(!cell.IsNullCell())
01104             {
01105                 //TableIndexT index;
01106                 //tab->CellToIndex(cell, index);
01107                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01108                 Assert_(item != 0L);
01109                 if(item != 0L)
01110                     item->EditImportCell();
01111             }
01112         }
01113
01114         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01115             break;
01116     }
01117     theDialog->Hide();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         result = true;
01122     }
01123 #endif /* qMacCvsPP */
01124 #if qUnix
01125     void *wid = UCreate_ImportFilterDlg();
01126
01127     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01128     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01129
01130     if(dlg->DoModal())
01131     {
01132         result = true;
01133     }
01134
01135     delete dlg;
01136 #endif // qUnix
01137
01138     if( !result )
01139     {
01140         free_list_types(warnings, entries);
01141         entries = 0L;
01142         warnings = 0L;
01143     }
01144
01145     return result;
01146 }

Variable Documentation

int _gnColumnWidth[COL_NUM] [static]

Initial value:

{

    80, 270, 140

}
Column widths.

Definition at line 79 of file ImportFilterDlg.cpp.

char* _gszColumnLabel[COL_NUM] [static]

Initial value:

{
    "Entry state", "Entry description", "Entry kind"
}
Column labels.

Definition at line 73 of file ImportFilterDlg.cpp.

Generated on Fri Jan 31 12:10:03 2003 for WinCvs Source by doxygen 1.3-rc2


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)
Get the import filter options.

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
 | ) |

Get the import filter options.

Definition at line 1047 of file ImportFilterDlg.cpp.

References cvs_err(), EV_INIT_WIDGET, free_list_types(), kContinueTraversal, kTraversal, kUMainWidget, list_all_types_recur(), UCreate_ImportFilterDlg(), and UEventSendMessage().

Referenced by CvsCmdImportModule().

01048 {
01049     bool result = false;
01050     entries = 0L;
01051     warnings = 0L;
01052
01053     const kTraversal traversalResult = list_all_types_recur(path, warnings, entries);
01054     if( traversalResult != kContinueTraversal )
01055     {
01056         cvs_err("Import aborted on user's request.\n");
01057
01058         free_list_types(warnings, entries);
01059         entries = 0L;
01060         warnings = 0L;
01061
01062         return false;
01063     }
01064
01065     if( entries == 0L && warnings == 0L )
01066     {
01067         cvs_err("Import aborted - nothing to import.\n");
01068         return false;
01069     }
01070
01071 #ifdef WIN32
01072     CImportFilterDlg pages(entries, warnings);
01073     if( pages.DoModal() == IDOK )
01074     {
01075         result = true;
01076     }
01077     else
01078     {
01079         cvs_err("Import aborted.\n");
01080     }
01081 #endif /* WIN32 */
01082 #ifdef qMacCvsPP
01083     gWarnings = warnings;
01084     gEntries = entries;
01085
01086     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01087     LWindow *theDialog = theHandler.GetDialog();
01088     ThrowIfNil_(theDialog);
01089
01090     theDialog->Show();
01091     MessageT hitMessage;
01092     while (true)
01093     {       // Let DialogHandler process events
01094         hitMessage = theHandler.DoDialog();
01095
01096         if(hitMessage == item_ImpPushEdit)
01097         {
01098             // simulate dbl click
01099             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01100                 (theDialog->FindPaneByID(item_ImpFilterList));
01101
01102             STableCell  cell = tab->GetFirstSelectedCell();
01103             if(!cell.IsNullCell())
01104             {
01105                 //TableIndexT index;
01106                 //tab->CellToIndex(cell, index);
01107                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01108                 Assert_(item != 0L);
01109                 if(item != 0L)
01110                     item->EditImportCell();
01111             }
01112         }
01113
01114         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01115             break;
01116     }
01117     theDialog->Hide();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         result = true;
01122     }
01123 #endif /* qMacCvsPP */
01124 #if qUnix
01125     void *wid = UCreate_ImportFilterDlg();
01126
01127     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01128     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01129
01130     if(dlg->DoModal())
01131     {
01132         result = true;
01133     }
01134
01135     delete dlg;
01136 #endif // qUnix
01137
01138     if( !result )
01139     {
01140         free_list_types(warnings, entries);
01141         entries = 0L;
01142         warnings = 0L;
01143     }
01144
01145     return result;
01146 }

Generated on Fri Jan 31 12:10:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 78 of file InitDlg.cpp.

References CInit_MAIN::m_forceroot, CGetPrefs_CVSROOT::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), and TRUE.

Referenced by CvsCmdInit().

00079 {
00080     bool userHitOK = false;
00081
00082     forceCvsroot = true;
00083
00084 #ifdef WIN32
00085     CPropertySheet pages("Init settings");
00086     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00087     CInit_MAIN page1(forceCvsroot);
00088     CGetPrefs_CVSROOT page2;
00089     CGetPrefs_GLOBALS page3;
00090     pages.AddPage(&page1);
00091     pages.AddPage(&page2);
00092     pages.AddPage(&page3);
00093     if(pages.DoModal() == IDOK)
00094     {
00095         forceCvsroot = page1.m_forceroot == TRUE;
00096
00097         page2.StoreValues();
00098         page3.StoreValues();
00099         userHitOK = true;
00100     }
00101 #endif /* WIN32 */
00102
00103     if(userHitOK)
00104     {
00105         gCvsPrefs.save();
00106     }
00107     return userHitOK;
00108 }

Generated on Fri Jan 31 12:10:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 78 of file InitDlg.cpp.

References CInit_MAIN::m_forceroot, CGetPrefs_GLOBALS::StoreValues(), CGetPrefs_CVSROOT::StoreValues(), and TRUE.

Referenced by CvsCmdInit().

00079 {
00080     bool userHitOK = false;
00081
00082     forceCvsroot = true;
00083
00084 #ifdef WIN32
00085     CPropertySheet pages("Init settings");
00086     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00087     CInit_MAIN page1(forceCvsroot);
00088     CGetPrefs_CVSROOT page2;
00089     CGetPrefs_GLOBALS page3;
00090     pages.AddPage(&page1);
00091     pages.AddPage(&page2);
00092     pages.AddPage(&page3);
00093     if(pages.DoModal() == IDOK)
00094     {
00095         forceCvsroot = page1.m_forceroot == TRUE;
00096
00097         page2.StoreValues();
00098         page3.StoreValues();
00099         userHitOK = true;
00100     }
00101 #endif /* WIN32 */
00102
00103     if(userHitOK)
00104     {
00105         gCvsPrefs.save();
00106     }
00107     return userHitOK;
00108 }

Generated on Fri Jan 31 12:10:05 2003 for WinCvs Source by doxygen 1.3-rc2


ItemListDlg.cpp File Reference

common/ItemListDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "wincvsView.h"
#include "wincvs_winutil.h"
#include "MultiString.h"
#include "ItemListDlg.h"
#include "CvsCommands.h"
#include "CvsArgs.h"
#include "cvsgui_process.h"
#include "AppConsole.h"
#include "CvsEntries.h"
#include "SelectionDetailsDlg.h"
#include "CvsAlert.h"

Include dependency graph for ItemListDlg.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | STR_ITEMLIST_DIR "<Dir>"
#define | STR_ITEMLIST_UP_DIR ".."
#define | STR_ITEMLIST_BRANCH "Branch"
#define | STR_ITEMLIST_REVISION "Revision"

Functions

string | FormatItemDescription (const ItemDescription &itemDesc)
string | FormatListPath (const ListPath &listPath, const char pathDelimiter= '/')
CItemListConsole * | LaunchItemListCommand (kItemListDlg type, bool option, const char *readFrom, bool forceCvsroot, const char *revision, const char *date, const ListPath *listPath=NULL)
bool | CompatGetTagListItem (const MultiFiles *mf, UStr &tagName)
Get Tag item list.

bool | CompatGetModuleListItem (const MultiFiles *mf, UStr &moduleName)
Get Module item list.

Variables

CPersistentBool | gItemListTagRecurse ("P_ItemListTagRecurse", false)
Persistent recurse setting for tag/branch browse.

CPersistentBool | gItemListModuleList ("P_ItemListModuleList", false, kAddSettings)
Persistent list setting for module/directory-file browse.

CPersistentInt | gItemListAutoRefreshTag ("P_ItemListAutoRefreshTag", kAutoRefreshFirstTime)
Persistent auto refresh setting for tag/branch browse.

CPersistentInt | gItemListAutoRefreshModule ("P_ItemListAutoRefreshModule", kAutoRefreshFirstTime)
Persistent auto refresh setting for module/directory-file browse.

Define Documentation

#define STR_ITEMLIST_BRANCH "Branch"

Definition at line 73 of file ItemListDlg.cpp.

Referenced by CTagParserConsole::Parse().

#define STR_ITEMLIST_DIR "<Dir>"

Definition at line 71 of file ItemListDlg.cpp.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::OnDblclkItemlist().

#define STR_ITEMLIST_REVISION "Revision"

Definition at line 74 of file ItemListDlg.cpp.

Referenced by CTagParserConsole::Parse().

#define STR_ITEMLIST_UP_DIR ".."

Definition at line 72 of file ItemListDlg.cpp.

Referenced by CItemListDlg::CompareItems(), CItemListDlg::GetImageForItem(), CItemListDlg::OnDblclkItemlist(), and CItemListDlg::OnItemchangedItemlist().

Function Documentation

bool CompatGetModuleListItem | ( | const MultiFiles * | mf,
 |  | UStr & | moduleName
 | ) |

Get Module item list.

Definition at line 3267 of file ItemListDlg.cpp.

References CStr, EV_INIT_WIDGET, ItemList, kUMainWidget, ListPath, CItemListDlg::m_date, CItemListDlg::m_forceCvsroot, CItemListDlg::m_item, CItemListDlg::m_listPath, CItemListDlg::m_rev, NULL, UCreate_SelTagBranchDlg(), and UEventSendMessage().

Referenced by CCheckout_MAIN::OnBrowseModules(), CImport_MAIN::OnBrowseModules(), CRtag_MAIN::OnBrowseModules(), CItemListDlg::OnBrowseReadfrom(), and CCmdLine_MAIN::OnModule().

03269 {
03270     bool userHitOK = false;
03271
03272     static CStr sLastModule;
03273     static ItemList sLastModuleList;
03274     static ListPath sLastListPath;
03275     static bool sLastForceCvsroot = false;
03276     static CStr sLastRev;
03277     static CStr sLastDate;
03278
03279 #ifdef WIN32
03280     CItemListDlg itemListDlg(mf,
03281         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03282         sLastForceCvsroot, sLastRev, sLastDate);
03283
03284     if( itemListDlg.DoModal() == IDOK )
03285     {
03286         sLastModule = itemListDlg.m_item;
03287         sLastListPath = itemListDlg.m_listPath;
03288         sLastRev = itemListDlg.m_rev;
03289         sLastDate = itemListDlg.m_date;
03290         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03291
03292         userHitOK = true;
03293     }
03294 #endif /* WIN32 */
03295
03296 #if qUnix
03297     void *wid = NULL;
03298 #   if qGTK
03299     wid = UCreate_SelTagBranchDlg();
03300 #   endif
03301
03302     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03303         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03304         sLastForceCvsroot, sLastRev, sLastDate);
03305     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03306     if(dlg->DoModal())
03307     {
03308         sLastModule = dlg->m_item;
03309         sLastListPath = dlg->m_listPath;
03310         sLastRev = dlg->m_rev;
03311         sLastDate = dlg->m_date;
03312         sLastForceCvsroot = dlg->m_forceCvsroot;
03313
03314         userHitOK = true;
03315     }
03316     delete dlg;
03317
03318 #endif // qUnix
03319
03320 #ifdef qMacCvsPP
03321     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03322     LWindow *theDialog = theHandler.GetDialog();
03323     ThrowIfNil_(theDialog);
03324
03325     theDialog->Show();
03326     theDialog->SetDescriptor(LStr255("Select module"));
03327
03328     DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, true);
03329
03330     MessageT hitMessage;
03331     while (true)
03332     {       // Let DialogHandler process events
03333         hitMessage = theHandler.DoDialog();
03334
03335         if(hitMessage == 'ENDO')
03336             hitMessage = msg_OK;
03337
03338         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03339             break;
03340
03341         if(hitMessage == item_Refresh)
03342         {
03343             OnRefresh_Select(theDialog, kItemListModule);
03344         }
03345     }
03346     theDialog->Hide();
03347
03348     if(hitMessage == msg_OK)
03349     {
03350         DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, false);
03351
03352         userHitOK = true;
03353     }
03354 #endif /* qMacCvsPP */
03355
03356     if( userHitOK )
03357     {
03358         moduleName = sLastModule;
03359     }
03360
03361     return userHitOK;
03362 }

bool CompatGetTagListItem | ( | const MultiFiles * | mf,
 |  | UStr & | tagName
 | ) |

Get Tag item list.

Definition at line 3172 of file ItemListDlg.cpp.

References CStr, EV_INIT_WIDGET, ItemList, kUMainWidget, CItemListDlg::m_date, CItemListDlg::m_forceCvsroot, CItemListDlg::m_item, CItemListDlg::m_rev, UCreate_SelTagBranchDlg(), and UEventSendMessage().

Referenced by CAnnotate_MAIN::OnBrowseTag(), CCheckout_OPTIONS::OnBrowseTag(), CCommit_OPTIONS::OnBrowseTag(), CItemListDlg::OnBrowseTag(), CLogFilters::OnBrowseTag(), CRtag_MAIN::OnBrowseTag(), CRtag_OPTIONS::OnBrowseTag(), CTag_MAIN::OnBrowseTag(), CUpdateSticky::OnBrowseTag(), CDiff_MAIN::OnBrowseTag1(), CImport_MAIN::OnBrowseTag1(), CUpdateMerge::OnBrowseTag1(), CDiff_MAIN::OnBrowseTag2(), CImport_MAIN::OnBrowseTag2(), CUpdateMerge::OnBrowseTag2(), and CCmdLine_MAIN::OnTag().

03174 {
03175     bool userHitOK = false;
03176
03177     static CStr sLastTag;
03178     static ItemList sTagList;
03179     static bool sLastForceCvsroot = false;
03180     static CStr sLastRev;
03181     static CStr sLastDate;
03182
03183 #ifdef WIN32
03184     CItemListDlg itemListDlg(mf,
03185         sLastTag, kItemListTag, sTagList, NULL,
03186         sLastForceCvsroot, sLastRev, sLastDate);
03187
03188     if( itemListDlg.DoModal() == IDOK )
03189     {
03190         sLastTag = itemListDlg.m_item;
03191         sLastRev = itemListDlg.m_rev;
03192         sLastDate = itemListDlg.m_date;
03193         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03194
03195         userHitOK = true;
03196     }
03197 #endif /* WIN32 */
03198
03199 #if qUnix
03200     void *wid;
03201 #   if qGTK
03202     wid = UCreate_SelTagBranchDlg();
03203 #   endif
03204
03205     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03206         sLastTag, kItemListTag, sTagList, NULL,
03207         sLastForceCvsroot, sLastRev, sLastDate);
03208     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03209     if(dlg->DoModal())
03210     {
03211         sLastTag = dlg->m_item;
03212         sLastRev = dlg->m_rev;
03213         sLastDate = dlg->m_date;
03214         sLastForceCvsroot = dlg->m_forceCvsroot;
03215
03216         userHitOK = true;
03217     }
03218     delete dlg;
03219
03220 #endif // qUnix
03221
03222 #ifdef qMacCvsPP
03223     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03224     LWindow *theDialog = theHandler.GetDialog();
03225     ThrowIfNil_(theDialog);
03226
03227     theDialog->Show();
03228     theDialog->SetDescriptor(LStr255("Select tag/branch"));
03229
03230     DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, true);
03231
03232     MessageT hitMessage;
03233     while (true)
03234     {       // Let DialogHandler process events
03235         hitMessage = theHandler.DoDialog();
03236
03237         if(hitMessage == 'ENDO')
03238             hitMessage = msg_OK;
03239
03240         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03241             break;
03242
03243         if(hitMessage == item_Refresh)
03244         {
03245             OnRefresh_Select(theDialog, kItemListTag);
03246         }
03247     }
03248     theDialog->Hide();
03249
03250     if(hitMessage == msg_OK)
03251     {
03252         DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, false);
03253
03254         userHitOK = true;
03255     }
03256 #endif /* qMacCvsPP */
03257
03258     if( userHitOK )
03259     {
03260         tagName = sLastTag;
03261     }
03262
03263     return userHitOK;
03264 }

string FormatItemDescription ( const ItemDescription & itemDesc ) [static]

Format an item's description string given a collection of descriptions

Parameters:
itemDesc collection of descriptions
Returns:
Formatted item's description string

Definition at line 428 of file ItemListDlg.cpp.

Referenced by ItemDisplayInfo::Create().

00429 {
00430     string strRes;
00431
00432     for(ItemDescription::const_iterator it = itemDesc.begin(); it != itemDesc.end(); it++)
00433     {
00434         if( !strRes.empty() )
00435         {
00436             strRes += ", ";
00437         }
00438
00439         strRes += (*it).c_str();
00440     }
00441
00442     return strRes;
00443 }

string FormatListPath | ( | const ListPath & | listPath,
 |  | const char | pathDelimiter = '/'
 | ) | [static]

Build the path string given a list of items

Parameters:
listPath | List of items to be in the path
pathDelimiter | Optional path delimiter to be used
Returns:
The formatted path as string
Note:
Path ends with path delimiter

Definition at line 452 of file ItemListDlg.cpp.

Referenced by LaunchItemListCommand(), and CItemListDlg::OnItemchangedItemlist().

00453 {
00454     string strRes;
00455
00456     for(ListPath::const_iterator it = listPath.begin(); it != listPath.end(); it++ )
00457     {
00458         strRes += (*it).c_str();
00459         strRes += pathDelimiter;
00460     }
00461
00462     return strRes;
00463 }

CItemListConsole* LaunchItemListCommand | ( | kItemListDlg | type,
 |  | bool | option,
 |  | const char * | readFrom,
 |  | bool | forceCvsroot,
 |  | const char * | revision,
 |  | const char * | date,
 |  | const ListPath * | listPath = NULL
 | ) | [static]

Launch and parse cvs command appropriate to the type and parameters

Returns:
The pointer to item list console
Note:
You have to free the memory allocated for the item list console

Definition at line 470 of file ItemListDlg.cpp.

References CvsArgs::add(), CvsArgs::addcvsroot(), CvsArgs::Argc(), CvsArgs::Argv(), ASSERT, MultiFiles::begin(), CStr, FormatListPath(), kItemListModule, kItemListTag, launchCVS(), MultiFiles::newdir(), MultiFiles::newfile(), NULL, CItemListConsole::Parse(), CvsArgs::print(), and SplitPath().

Referenced by CItemListDlg::OnRefresh().

00474 {
00475     CItemListConsole* itemListConsole = NULL;
00476
00477     CvsArgs args;
00478     MultiFiles mf;
00479
00480     if( forceCvsroot )
00481     {
00482         args.addcvsroot();
00483     }
00484
00485     switch( type )
00486     {
00487     case kItemListTag:
00488         itemListConsole = new CTagParserConsole;
00489
00490         args.add(forceCvsroot ? "rlog" : "log");
00491         args.add("-h");
00492
00493         if( !option )
00494         {
00495             args.add("-l");
00496         }
00497
00498         if( strlen(revision) )
00499         {
00500             string strRevision;
00501
00502             strRevision += "-r";
00503             strRevision += revision;
00504
00505             args.add(strRevision.c_str());
00506         }
00507
00508         if( strlen(date) )
00509         {
00510             args.add("-d");
00511             args.add(date);
00512         }
00513
00514         {
00515             CStr uppath, file;
00516             SplitPath(readFrom, uppath, file, true);
00517
00518             mf.newdir(uppath);
00519
00520             if( !file.empty() )
00521             {
00522                 mf.newfile(file);
00523             }
00524         }
00525         break;
00526     case kItemListModule:
00527         if( option )
00528         {
00529             itemListConsole = new CListParserConsole;
00530
00531             args.add("ls");
00532             args.add("-e");
00533
00534             if( strlen(revision) )
00535             {
00536                 args.add("-r");
00537                 args.add(revision);
00538             }
00539
00540             if( strlen(date) )
00541             {
00542                 args.add("-D");
00543                 args.add(date);
00544             }
00545
00546             if( listPath )
00547             {
00548                 string strListPath = FormatListPath(*listPath);
00549                 if( !strListPath.empty() )
00550                 {
00551                     args.add(strListPath.c_str());
00552                 }
00553                 else
00554                 {
00555                     args.add("/");
00556                 }
00557             }
00558             else
00559             {
00560                 args.add("/");
00561             }
00562         }
00563         else
00564         {
00565             itemListConsole = new CModuleParserConsole;
00566
00567             args.add("checkout");
00568             args.add("-c");
00569         }
00570
00571         mf.newdir(readFrom);
00572         break;
00573     default:
00574 #ifdef WIN32
00575         ASSERT(FALSE);  // unknown option
00576 #endif
00577         break;
00578     }
00579
00580     if( itemListConsole )
00581     {
00582         const char* dir = (*mf.begin()).add(args);
00583
00584         args.print(dir);
00585         const int launchRes = launchCVS(dir, args.Argc(), args.Argv(), itemListConsole);
00586         itemListConsole->Parse(launchRes);
00587     }
00588
00589     return itemListConsole;
00590 }

Variable Documentation

CPersistentInt gItemListAutoRefreshModule("P_ItemListAutoRefreshModule", kAutoRefreshFirstTime)

Persistent auto refresh setting for module/directory-file browse.

Referenced by CItemListDlg::OnInitDialog(), and CItemListDlg::OnSelchangeAutoRefresh().

CPersistentInt gItemListAutoRefreshTag("P_ItemListAutoRefreshTag", kAutoRefreshFirstTime)

Persistent auto refresh setting for tag/branch browse.

Referenced by CItemListDlg::OnInitDialog(), and CItemListDlg::OnSelchangeAutoRefresh().

CPersistentBool gItemListModuleList("P_ItemListModuleList", false, kAddSettings)

Persistent list setting for module/directory-file browse.

Referenced by CItemListDlg::CItemListDlg(), CItemListDlg::InitOptionCtrls(), and CItemListDlg::OnOK().

CPersistentBool gItemListTagRecurse("P_ItemListTagRecurse", false)

Persistent recurse setting for tag/branch browse.

Referenced by CItemListDlg::CItemListDlg(), CItemListDlg::InitOptionCtrls(), and CItemListDlg::OnOK().

Generated on Fri Jan 31 12:10:06 2003 for WinCvs Source by doxygen 1.3-rc2


ItemListDlg.h File Reference

common/ItemListDlg.h File Reference

#include "MultiFiles.h"
#include "AppGlue.h"
#include "SmartComboBox.h"
#include "SortHeaderCtrl.h"
#include <string>
#include <sstream>
#include <set>
#include <list>
#include <map>
#include <algorithm>

Include dependency graph for ItemListDlg.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.

Namespaces

namespace | std

Compounds

class | ItemDisplayInfo
Class to hold and support data display (e.g. sorting or storing the result for next display). More...

class | CItemListConsole
Base class for item list console. More...

class | CItemListDlg
struct | ItemRowInfo
Structure to hold item's row information. More...

class | CListParserConsole
Class to parse directories/files (obtained using cvs ls). More...

class | CModuleParserConsole
Class to parse modules (obtained using cvs co -c). More...

struct | CompareInfo
Structure to hold the sorting settings. More...

class | CTagParserConsole
Class to parse tags/branches (obtained using cvs log or cvs rlog). More...

Defines

#define | AFX_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_

Typedefs

typedef std::set< string > | ItemDescription
Item's description container.

typedef std::map< string,
ItemRowInfo > 		ItemList
Item's rows container.

typedef std::list< string > | ListPath
Path to the list location.

Enumerations

enum kItemListDlg {
kItemListTag,
kItemListModule
}
Enum types of list dialog. More...

enum kItemListAutoRefreshType {
kAutoRefreshDisable,
kAutoRefreshFirstTime,
kAutoRefreshAlways
}
Enum types of item list auto refresh. More...

enum kDisplayType {
kDisplayWait,
kDisplayData,
kDisplayInfo
}
Display type enum. More...

Functions

bool | CompatGetTagListItem (const MultiFiles *mf, UStr &tagName)
Get Tag item list.

bool | CompatGetModuleListItem (const MultiFiles *mf, UStr &moduleName)
Get Module item list.

Variables

CMString gRevNames
CMString gDateNames

Define Documentation

#define AFX_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_

Definition at line 22 of file ItemListDlg.h.

Typedef Documentation

typedef std::set<string> ItemDescription

Item's description container.

Definition at line 70 of file ItemListDlg.h.

typedef std::map<string, ItemRowInfo> ItemList

Item's rows container.

Definition at line 80 of file ItemListDlg.h.

Referenced by CompatGetModuleListItem(), CompatGetTagListItem(), and CItemListConsole::GetItemList().

typedef std::list<string> ListPath

Path to the list location.

Definition at line 83 of file ItemListDlg.h.

Referenced by CompatGetModuleListItem().

Enumeration Type Documentation

enum kDisplayType

Display type enum.

Enumeration values:
kDisplayWait | Display the wait prompt while retrieving the data
kDisplayData | Display the data
kDisplayInfo | Display the information

Definition at line 142 of file ItemListDlg.h.

00143 {
00144     kDisplayWait,
00145     kDisplayData,
00146     kDisplayInfo
00147 } kDisplayType;

enum kItemListAutoRefreshType

Enum types of item list auto refresh.

Enumeration values:
kAutoRefreshDisable | Disable auto refresh
kAutoRefreshFirstTime | First time dialog opens refresh only
kAutoRefreshAlways | Always refresh

Definition at line 62 of file ItemListDlg.h.

Referenced by CItemListDlg::OnInitDialog().

00063 {
00064     kAutoRefreshDisable,
00065     kAutoRefreshFirstTime,
00066     kAutoRefreshAlways
00067 } kItemListAutoRefreshType;

enum kItemListDlg

Enum types of list dialog.

Enumeration values:
kItemListTag | List branches/tags
kItemListModule | List modules/directories & files

Definition at line 55 of file ItemListDlg.h.

00056 {
00057     kItemListTag,
00058     kItemListModule
00059 } kItemListDlg;

Function Documentation

bool CompatGetModuleListItem | ( | const MultiFiles * | mf,
 |  | UStr & | moduleName
 | ) |

Get Module item list.

Definition at line 3267 of file ItemListDlg.cpp.

References CStr, EV_INIT_WIDGET, ItemList, kUMainWidget, ListPath, CItemListDlg::m_date, CItemListDlg::m_forceCvsroot, CItemListDlg::m_item, CItemListDlg::m_listPath, CItemListDlg::m_rev, NULL, UCreate_SelTagBranchDlg(), and UEventSendMessage().

Referenced by CRtag_MAIN::OnBrowseModules(), CImport_MAIN::OnBrowseModules(), CCheckout_MAIN::OnBrowseModules(), CItemListDlg::OnBrowseReadfrom(), and CCmdLine_MAIN::OnModule().

03269 {
03270     bool userHitOK = false;
03271
03272     static CStr sLastModule;
03273     static ItemList sLastModuleList;
03274     static ListPath sLastListPath;
03275     static bool sLastForceCvsroot = false;
03276     static CStr sLastRev;
03277     static CStr sLastDate;
03278
03279 #ifdef WIN32
03280     CItemListDlg itemListDlg(mf,
03281         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03282         sLastForceCvsroot, sLastRev, sLastDate);
03283
03284     if( itemListDlg.DoModal() == IDOK )
03285     {
03286         sLastModule = itemListDlg.m_item;
03287         sLastListPath = itemListDlg.m_listPath;
03288         sLastRev = itemListDlg.m_rev;
03289         sLastDate = itemListDlg.m_date;
03290         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03291
03292         userHitOK = true;
03293     }
03294 #endif /* WIN32 */
03295
03296 #if qUnix
03297     void *wid = NULL;
03298 #   if qGTK
03299     wid = UCreate_SelTagBranchDlg();
03300 #   endif
03301
03302     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03303         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03304         sLastForceCvsroot, sLastRev, sLastDate);
03305     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03306     if(dlg->DoModal())
03307     {
03308         sLastModule = dlg->m_item;
03309         sLastListPath = dlg->m_listPath;
03310         sLastRev = dlg->m_rev;
03311         sLastDate = dlg->m_date;
03312         sLastForceCvsroot = dlg->m_forceCvsroot;
03313
03314         userHitOK = true;
03315     }
03316     delete dlg;
03317
03318 #endif // qUnix
03319
03320 #ifdef qMacCvsPP
03321     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03322     LWindow *theDialog = theHandler.GetDialog();
03323     ThrowIfNil_(theDialog);
03324
03325     theDialog->Show();
03326     theDialog->SetDescriptor(LStr255("Select module"));
03327
03328     DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, true);
03329
03330     MessageT hitMessage;
03331     while (true)
03332     {       // Let DialogHandler process events
03333         hitMessage = theHandler.DoDialog();
03334
03335         if(hitMessage == 'ENDO')
03336             hitMessage = msg_OK;
03337
03338         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03339             break;
03340
03341         if(hitMessage == item_Refresh)
03342         {
03343             OnRefresh_Select(theDialog, kItemListModule);
03344         }
03345     }
03346     theDialog->Hide();
03347
03348     if(hitMessage == msg_OK)
03349     {
03350         DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, false);
03351
03352         userHitOK = true;
03353     }
03354 #endif /* qMacCvsPP */
03355
03356     if( userHitOK )
03357     {
03358         moduleName = sLastModule;
03359     }
03360
03361     return userHitOK;
03362 }

bool CompatGetTagListItem | ( | const MultiFiles * | mf,
 |  | UStr & | tagName
 | ) |

Get Tag item list.

Definition at line 3172 of file ItemListDlg.cpp.

References CStr, EV_INIT_WIDGET, ItemList, kUMainWidget, CItemListDlg::m_date, CItemListDlg::m_forceCvsroot, CItemListDlg::m_item, CItemListDlg::m_rev, UCreate_SelTagBranchDlg(), and UEventSendMessage().

Referenced by CUpdateSticky::OnBrowseTag(), CTag_MAIN::OnBrowseTag(), CRtag_OPTIONS::OnBrowseTag(), CRtag_MAIN::OnBrowseTag(), CLogFilters::OnBrowseTag(), CItemListDlg::OnBrowseTag(), CCommit_OPTIONS::OnBrowseTag(), CCheckout_OPTIONS::OnBrowseTag(), CAnnotate_MAIN::OnBrowseTag(), CUpdateMerge::OnBrowseTag1(), CImport_MAIN::OnBrowseTag1(), CDiff_MAIN::OnBrowseTag1(), CUpdateMerge::OnBrowseTag2(), CImport_MAIN::OnBrowseTag2(), CDiff_MAIN::OnBrowseTag2(), and CCmdLine_MAIN::OnTag().

03174 {
03175     bool userHitOK = false;
03176
03177     static CStr sLastTag;
03178     static ItemList sTagList;
03179     static bool sLastForceCvsroot = false;
03180     static CStr sLastRev;
03181     static CStr sLastDate;
03182
03183 #ifdef WIN32
03184     CItemListDlg itemListDlg(mf,
03185         sLastTag, kItemListTag, sTagList, NULL,
03186         sLastForceCvsroot, sLastRev, sLastDate);
03187
03188     if( itemListDlg.DoModal() == IDOK )
03189     {
03190         sLastTag = itemListDlg.m_item;
03191         sLastRev = itemListDlg.m_rev;
03192         sLastDate = itemListDlg.m_date;
03193         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03194
03195         userHitOK = true;
03196     }
03197 #endif /* WIN32 */
03198
03199 #if qUnix
03200     void *wid;
03201 #   if qGTK
03202     wid = UCreate_SelTagBranchDlg();
03203 #   endif
03204
03205     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03206         sLastTag, kItemListTag, sTagList, NULL,
03207         sLastForceCvsroot, sLastRev, sLastDate);
03208     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03209     if(dlg->DoModal())
03210     {
03211         sLastTag = dlg->m_item;
03212         sLastRev = dlg->m_rev;
03213         sLastDate = dlg->m_date;
03214         sLastForceCvsroot = dlg->m_forceCvsroot;
03215
03216         userHitOK = true;
03217     }
03218     delete dlg;
03219
03220 #endif // qUnix
03221
03222 #ifdef qMacCvsPP
03223     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03224     LWindow *theDialog = theHandler.GetDialog();
03225     ThrowIfNil_(theDialog);
03226
03227     theDialog->Show();
03228     theDialog->SetDescriptor(LStr255("Select tag/branch"));
03229
03230     DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, true);
03231
03232     MessageT hitMessage;
03233     while (true)
03234     {       // Let DialogHandler process events
03235         hitMessage = theHandler.DoDialog();
03236
03237         if(hitMessage == 'ENDO')
03238             hitMessage = msg_OK;
03239
03240         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03241             break;
03242
03243         if(hitMessage == item_Refresh)
03244         {
03245             OnRefresh_Select(theDialog, kItemListTag);
03246         }
03247     }
03248     theDialog->Hide();
03249
03250     if(hitMessage == msg_OK)
03251     {
03252         DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, false);
03253
03254         userHitOK = true;
03255     }
03256 #endif /* qMacCvsPP */
03257
03258     if( userHitOK )
03259     {
03260         tagName = sLastTag;
03261     }
03262
03263     return userHitOK;
03264 }

Variable Documentation

CMString gDateNames

Definition at line 52 of file ItemListDlg.h.

CMString gRevNames

Definition at line 51 of file ItemListDlg.h.

Generated on Fri Jan 31 12:10:07 2003 for WinCvs Source by doxygen 1.3-rc2


KeywordComboBox.cpp File Reference

common/KeywordComboBox.cpp File Reference

#include "stdafx.h"
#include "KeywordComboBox.h"

Include dependency graph for KeywordComboBox.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | keywordMode
Structure to hold the keyword modes and their descriptions. More...

Defines

#define | KEYWORD_MODE_COUNT 8

Variables

keywordMode | gKeywordModes [8]
Global array to hold all substitution modes and descriptions.

Define Documentation

#define KEYWORD_MODE_COUNT 8

Definition at line 40 of file KeywordComboBox.cpp.

Referenced by CKeywordComboBox::PreSubclassWindow().

Variable Documentation

struct keywordMode gKeywordModes[ 8 ] [static]

Initial value:

 {
    {"",        "Current"},
    {"-kkv",    "Default"},
    {"-kkvl",   "Default with locker's name"},
    {"-kk",     "Only keyword names"},
    {"-ko",     "Disable"},
    {"-kb",     "Binary"},
    {"-ku",     "Unicode"},
    {"-kv",     "Only keyword values"}
}
Global array to hold all substitution modes and descriptions.

Definition at line 43 of file KeywordComboBox.cpp.

Referenced by CKeywordComboBox::SetDescription().

Generated on Fri Jan 31 12:10:07 2003 for WinCvs Source by doxygen 1.3-rc2


KeywordComboBox.h File Reference

common/KeywordComboBox.h File Reference

#include "SmartComboBox.h"

Include dependency graph for KeywordComboBox.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 | CKeywordComboBox

Defines

#define | AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_

Define Documentation

#define AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_

Definition at line 22 of file KeywordComboBox.h.

Generated on Fri Jan 31 12:10:08 2003 for WinCvs Source by doxygen 1.3-rc2


LineCmd.cpp File Reference

common/LineCmd.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "LineCmd.h"
#include "MultiString.h"
#include "CvsArgs.h"
#include "PromptFiles.h"
#include "CPStr.h"
#include "CvsCommands.h"
#include "MultiFiles.h"
#include "ItemListDlg.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

bool | CompatGetCommand (const MultiFiles *mf, UStr &cmd, UStr &dir, bool &addDefault, bool &addSelection, bool &forceCvsroot)
Get the command line options.

Variables

char * | sDefPrevCvsCmd []
Default previous commands.

CMString | gPrevCvsCmd (20,"P_PrevCvsCmd", sDefPrevCvsCmd)
CMString | gPrevCvsCmdDir (20,"P_PrevCvsCmdDir")

Function Documentation

bool CompatGetCommand | ( | const MultiFiles * | mf,
 |  | UStr & | cmd,
 |  | UStr & | dir,
 |  | bool & | addDefault,
 |  | bool & | addSelection,
 |  | bool & | forceCvsroot
 | ) |

Get the command line options.

Definition at line 488 of file LineCmd.cpp.

References BrowserGetDirectory(), CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CCmdLine_MAIN::m_addDefault, CCmdLine_MAIN::m_addSelection, CCmdLine_MAIN::m_checkPath, CCmdLine_MAIN::m_cmdLine, CCmdLine_MAIN::m_folderLoc, CCmdLine_MAIN::m_forceRoot, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_CmdlineDlg(), and UEventSendMessage().

Referenced by CvsCmdCommandLine().

00491 {
00492     bool userHitOK = false;
00493
00494     static CStr sLastCmdline(DEF_CVS_CMD);
00495     static CPStr sLastPath("");
00496     static bool sLastHasPath = false;
00497     static bool lastAddDefault = false;
00498     static bool lastAddSelection = false;
00499     static bool lastForceCvsroot = false;
00500
00501 #ifdef WIN32
00502     CPropertySheet pages("Command line settings");
00503     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00504
00505     CCmdLine_MAIN page1(mf, sLastCmdline, sLastHasPath, sLastPath, lastAddDefault, lastAddSelection, lastForceCvsroot);
00506     CGetPrefs_GLOBALS page2;
00507
00508     pages.AddPage(&page1);
00509     pages.AddPage(&page2);
00510
00511     if( pages.DoModal() == IDOK )
00512     {
00513         sLastCmdline = page1.m_cmdLine;
00514         sLastHasPath = page1.m_checkPath == TRUE;
00515         sLastPath = page1.m_folderLoc;
00516         lastAddDefault = page1.m_addDefault ? true : false;
00517         lastAddSelection = page1.m_addSelection ? true : false;
00518         lastForceCvsroot = page1.m_forceRoot ? true : false;
00519
00520         page2.StoreValues();
00521
00522         userHitOK = true;
00523     }
00524 #endif /* WIN32 */
00525
00526 #if qUnix
00527     void *wid = UCreate_CmdlineDlg();
00528
00529     UCvsCmdline *dlg = new UCvsCmdline();
00530     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00531     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00532     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00533
00534     if(dlg->DoModal())
00535     {
00536         sLastCmdline = tab1->m_cmdline;
00537         sLastHasPath = tab1->m_checkpath;
00538         sLastPath = tab1->m_folderloc;
00539
00540         userHitOK = true;
00541     }
00542
00543     delete dlg;
00544 #endif // qUnix
00545
00546 #ifdef qMacCvsPP
00547     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00548     LWindow *theDialog = theHandler.GetDialog();
00549     ThrowIfNil_(theDialog);
00550     static UInt16 sRuntimePanel = 1;
00551
00552     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00553         (theDialog->FindPaneByID(item_MultiViewPrefs));
00554     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00555
00556     multiView->SwitchToPanel(2);
00557     DoDataExchange_Globals(theDialog, true);
00558     multiView->SwitchToPanel(1);
00559     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00560
00561     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00562         (theDialog->FindPaneByID(item_CheckGroupPath));
00563     LPushButton *epath = dynamic_cast<LPushButton*>
00564         (theDialog->FindPaneByID(item_EditPath));
00565     epath->AddListener(&theHandler);
00566     cbox->AddListener(&theHandler);
00567
00568     groupView->SetValue(sRuntimePanel);
00569     theDialog->Show();
00570     MessageT hitMessage;
00571     while (true)
00572     {       // Let DialogHandler process events
00573         hitMessage = theHandler.DoDialog();
00574
00575         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00576             break;
00577
00578         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00579         {
00580             cbox = dynamic_cast<LCheckBoxGroupBox*>
00581                 (theDialog->FindPaneByID(item_CheckGroupPath));
00582             epath = dynamic_cast<LPushButton*>
00583                 (theDialog->FindPaneByID(item_EditPath));
00584             if(cbox->GetValue() == Button_Off)
00585             {
00586                 continue;
00587             }
00588
00589             if( BrowserGetDirectory("Select where to execute", dir) )
00590             {
00591                 CPStr tmp(dir.c_str());
00592                 epath->SetDescriptor(tmp);
00593             }
00594             else if(hitMessage == item_CheckGroupPath)
00595             {
00596                 cbox->SetValue(Button_Off);
00597             }
00598         }
00599
00600     }
00601     theDialog->Hide();
00602     sRuntimePanel = groupView->GetValue();
00603
00604     if(hitMessage == msg_OK)
00605     {
00606         multiView->SwitchToPanel(1);
00607         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00608         multiView->SwitchToPanel(2);
00609         DoDataExchange_Globals(theDialog, false);
00610         Assert_(sLastCmdline.length() != 0);
00611
00612         userHitOK = true;
00613     }
00614 #endif /* qMacCvsPP */
00615
00616     if( userHitOK )
00617     {
00618         cmd = sLastCmdline;
00619         dir = sLastHasPath ? (const char*)sLastPath : 0L;
00620
00621         addDefault = lastAddDefault;
00622         addSelection = lastAddSelection;
00623         forceCvsroot = lastForceCvsroot;
00624
00625         gCvsPrefs.save();
00626     }
00627
00628     return userHitOK;
00629 }

Variable Documentation

CMString gPrevCvsCmd(20, "P_PrevCvsCmd", sDefPrevCvsCmd) [static]

Referenced by CCmdLine_MAIN::DoDataExchange(), and CCmdLine_MAIN::OnSelchangePrevcmd().

CMString gPrevCvsCmdDir(20, "P_PrevCvsCmdDir") [static]

char* sDefPrevCvsCmd[]

Initial value:

{
    "cvs --help-options",
    "cvs --help-commands",
    "cvs --help-synonyms",
    "cvs -H <cvs_command>",
    0L
}
Default previous commands.

Definition at line 58 of file LineCmd.cpp.

Generated on Fri Jan 31 12:10:09 2003 for WinCvs Source by doxygen 1.3-rc2


LineCmd.h File Reference

common/LineCmd.h File Reference

#include "SmartComboBox.h"
#include "CPStr.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
Command line settings property page. More...

Defines

#define | AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_
#define | DEF_CVS_CMD CVS_CMD " "

Functions

bool | CompatGetCommand (const MultiFiles *mf, UStr &cmd, UStr &dir, bool &addDefault, bool &addSelection, bool &forceCvsroot)
Get the command line options.

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_CMD " "

Definition at line 33 of file LineCmd.h.

Referenced by CCmdLine_MAIN::DoDataExchange(), and CCmdLine_MAIN::OnSetfocusCmdline().

Function Documentation

bool CompatGetCommand | ( | const MultiFiles * | mf,
 |  | UStr & | cmd,
 |  | UStr & | dir,
 |  | bool & | addDefault,
 |  | bool & | addSelection,
 |  | bool & | forceCvsroot
 | ) |

Get the command line options.

Definition at line 488 of file LineCmd.cpp.

References BrowserGetDirectory(), CPStr, CStr, EV_INIT_WIDGET, kUMainWidget, CCmdLine_MAIN::m_addDefault, CCmdLine_MAIN::m_addSelection, CCmdLine_MAIN::m_checkPath, CCmdLine_MAIN::m_cmdLine, CCmdLine_MAIN::m_folderLoc, CCmdLine_MAIN::m_forceRoot, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_CmdlineDlg(), and UEventSendMessage().

Referenced by CvsCmdCommandLine().

00491 {
00492     bool userHitOK = false;
00493
00494     static CStr sLastCmdline(DEF_CVS_CMD);
00495     static CPStr sLastPath("");
00496     static bool sLastHasPath = false;
00497     static bool lastAddDefault = false;
00498     static bool lastAddSelection = false;
00499     static bool lastForceCvsroot = false;
00500
00501 #ifdef WIN32
00502     CPropertySheet pages("Command line settings");
00503     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00504
00505     CCmdLine_MAIN page1(mf, sLastCmdline, sLastHasPath, sLastPath, lastAddDefault, lastAddSelection, lastForceCvsroot);
00506     CGetPrefs_GLOBALS page2;
00507
00508     pages.AddPage(&page1);
00509     pages.AddPage(&page2);
00510
00511     if( pages.DoModal() == IDOK )
00512     {
00513         sLastCmdline = page1.m_cmdLine;
00514         sLastHasPath = page1.m_checkPath == TRUE;
00515         sLastPath = page1.m_folderLoc;
00516         lastAddDefault = page1.m_addDefault ? true : false;
00517         lastAddSelection = page1.m_addSelection ? true : false;
00518         lastForceCvsroot = page1.m_forceRoot ? true : false;
00519
00520         page2.StoreValues();
00521
00522         userHitOK = true;
00523     }
00524 #endif /* WIN32 */
00525
00526 #if qUnix
00527     void *wid = UCreate_CmdlineDlg();
00528
00529     UCvsCmdline *dlg = new UCvsCmdline();
00530     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00531     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00532     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00533
00534     if(dlg->DoModal())
00535     {
00536         sLastCmdline = tab1->m_cmdline;
00537         sLastHasPath = tab1->m_checkpath;
00538         sLastPath = tab1->m_folderloc;
00539
00540         userHitOK = true;
00541     }
00542
00543     delete dlg;
00544 #endif // qUnix
00545
00546 #ifdef qMacCvsPP
00547     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00548     LWindow *theDialog = theHandler.GetDialog();
00549     ThrowIfNil_(theDialog);
00550     static UInt16 sRuntimePanel = 1;
00551
00552     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00553         (theDialog->FindPaneByID(item_MultiViewPrefs));
00554     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00555
00556     multiView->SwitchToPanel(2);
00557     DoDataExchange_Globals(theDialog, true);
00558     multiView->SwitchToPanel(1);
00559     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00560
00561     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00562         (theDialog->FindPaneByID(item_CheckGroupPath));
00563     LPushButton *epath = dynamic_cast<LPushButton*>
00564         (theDialog->FindPaneByID(item_EditPath));
00565     epath->AddListener(&theHandler);
00566     cbox->AddListener(&theHandler);
00567
00568     groupView->SetValue(sRuntimePanel);
00569     theDialog->Show();
00570     MessageT hitMessage;
00571     while (true)
00572     {       // Let DialogHandler process events
00573         hitMessage = theHandler.DoDialog();
00574
00575         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00576             break;
00577
00578         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00579         {
00580             cbox = dynamic_cast<LCheckBoxGroupBox*>
00581                 (theDialog->FindPaneByID(item_CheckGroupPath));
00582             epath = dynamic_cast<LPushButton*>
00583                 (theDialog->FindPaneByID(item_EditPath));
00584             if(cbox->GetValue() == Button_Off)
00585             {
00586                 continue;
00587             }
00588
00589             if( BrowserGetDirectory("Select where to execute", dir) )
00590             {
00591                 CPStr tmp(dir.c_str());
00592                 epath->SetDescriptor(tmp);
00593             }
00594             else if(hitMessage == item_CheckGroupPath)
00595             {
00596                 cbox->SetValue(Button_Off);
00597             }
00598         }
00599
00600     }
00601     theDialog->Hide();
00602     sRuntimePanel = groupView->GetValue();
00603
00604     if(hitMessage == msg_OK)
00605     {
00606         multiView->SwitchToPanel(1);
00607         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00608         multiView->SwitchToPanel(2);
00609         DoDataExchange_Globals(theDialog, false);
00610         Assert_(sLastCmdline.length() != 0);
00611
00612         userHitOK = true;
00613     }
00614 #endif /* qMacCvsPP */
00615
00616     if( userHitOK )
00617     {
00618         cmd = sLastCmdline;
00619         dir = sLastHasPath ? (const char*)sLastPath : 0L;
00620
00621         addDefault = lastAddDefault;
00622         addSelection = lastAddSelection;
00623         forceCvsroot = lastForceCvsroot;
00624
00625         gCvsPrefs.save();
00626     }
00627
00628     return userHitOK;
00629 }

Generated on Fri Jan 31 12:10:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "MultiString.h"
#include "ItemListDlg.h"
#include "GetPrefs.h"

Include dependency graph for LogDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatGetLog (const MultiFiles *mf, bool &noRecurs, bool &defBranch, UPStr &date, bool &headerOnly, bool &headerDesc, bool &supress, bool &noTags, bool &onlyRCSfile, bool &hasRev, UPStr &rev, UPStr &states, bool &hasUsers, UPStr &users, bool outGraph)
Get the log options.

Variables

char * | sDefLogTagNames []
Default log tag names.

char * | sDefLogDateNames []
Default log date names.

char * | sDefLogStateNames []
Default log state names.

char * | sDefLogUserNames []
Default log user names.

CMString | gLogRevNames (10,"P_LogTagNames", sDefLogTagNames)
CMString | gLogDateNames (10,"P_LogDateNames", sDefLogDateNames)
CMString | gLogStateNames (10,"P_LogStateNames", sDefLogStateNames)
CMString | gLogUserNames (10,"P_LogUserNames", sDefLogUserNames)
CPersistentBool | gLogSupress ("P_LogSupress", false, kAddSettings)

Function Documentation

bool CompatGetLog | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | defBranch,
 |  | UPStr & | date,
 |  | bool & | headerOnly,
 |  | bool & | headerDesc,
 |  | bool & | supress,
 |  | bool & | noTags,
 |  | bool & | onlyRCSfile,
 |  | bool & | hasRev,
 |  | UPStr & | rev,
 |  | UPStr & | states,
 |  | bool & | hasUsers,
 |  | UPStr & | users,
 |  | bool | outGraph
 | ) |

Get the log options.

Definition at line 631 of file LogDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal(), EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg(), gLogSupress, kUMainWidget, CLogFilters::m_date, CLogMain::m_defBranch, CLogFilters::m_hasDate, CLogFilters::m_hasRev, CLogFilters::m_hasState, CLogFilters::m_hasUser, CLogMain::m_headerDesc, CLogMain::m_headerOnly, CLogMain::m_noRecurs, CLogMain::m_noTags, CLogMain::m_onlyRCS, CLogFilters::m_rev, CLogFilters::m_state, CLogMain::m_supress, CLogFilters::m_user, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_LogDlg(), and UEventSendMessage().

Referenced by CvsCmdLog().

00637 {
00638     bool userHitOK = false;
00639
00640     static CPStr sLastDate;
00641     static CPStr sLastRev;
00642     static CPStr sLastUsers;
00643     static CPStr sLastStates;
00644
00645     bool hasDate = false;
00646     bool hasStates = false;
00647
00648     hasRev = false;
00649     hasUsers = false;
00650     date = "";
00651     rev = "";
00652     states = "";
00653     users = "";
00654     noRecurs = false;
00655     defBranch = false;
00656     headerOnly = false;
00657     headerDesc = false;
00658     supress = (bool)gLogSupress;
00659     noTags = false;
00660     onlyRCSfile = false;
00661
00662 #ifdef WIN32
00663     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00664         outGraph ? "Graph settings" : "Log settings");
00665     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00666
00667     CLogMain page1(supress);
00668     CLogFilters page2(mf, sLastDate, sLastRev, sLastUsers, sLastStates);
00669     CGetPrefs_GLOBALS page3;
00670
00671     pages.AddPage(&page1);
00672     pages.AddPage(&page2);
00673     pages.AddPage(&page3);
00674
00675     if( pages.DoModal() == IDOK )
00676     {
00677         gLogSupress = page1.m_supress ? true : false;
00678
00679         noRecurs = page1.m_noRecurs == TRUE;
00680         defBranch = page1.m_defBranch == TRUE;
00681         headerOnly = page1.m_headerOnly == TRUE;
00682         headerDesc = page1.m_headerDesc == TRUE;
00683         noTags = page1.m_noTags == TRUE;
00684         onlyRCSfile = page1.m_onlyRCS == TRUE;
00685
00686         sLastDate = page2.m_date;
00687         sLastRev = page2.m_rev;
00688         sLastUsers = page2.m_user;
00689         sLastStates = page2.m_state;
00690
00691         hasRev = page2.m_hasRev == TRUE;
00692         hasUsers = page2.m_hasUser == TRUE;
00693         hasDate = page2.m_hasDate == TRUE;
00694         hasStates = page2.m_hasState == TRUE;
00695
00696         page3.StoreValues();
00697
00698         if( outGraph )
00699         {
00700             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00701         }
00702         else
00703         {
00704             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00705         }
00706
00707         userHitOK = true;
00708     }
00709 #endif /* WIN32 */
00710 #ifdef qMacCvsPP
00711     StOptionalDialogHandler theHandler(dlg_Log, gCvsPrefs.HideCommandDlgLog(), LCommander::GetTopCommander());
00712     LWindow *theDialog = theHandler.GetDialog();
00713     ThrowIfNil_(theDialog);
00714     static UInt16 sRuntimePanel = 1;
00715
00716     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00717         (theDialog->FindPaneByID(item_MultiViewPrefs));
00718     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00719
00720     multiView->SwitchToPanel(3);
00721     DoDataExchange_Globals(theDialog, true);
00722     multiView->SwitchToPanel(2);
00723     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00724         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00725     multiView->SwitchToPanel(1);
00726     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00727
00728     groupView->SetValue(sRuntimePanel);
00729     theHandler.ShowDialog();
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     sRuntimePanel = groupView->GetValue();
00740
00741     if(hitMessage == msg_OK)
00742     {
00743         multiView->SwitchToPanel(1);
00744         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00745         multiView->SwitchToPanel(2);
00746         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00747         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00748         multiView->SwitchToPanel(3);
00749         DoDataExchange_Globals(theDialog, false);
00750         gCvsPrefs.SetHideCommandDlgLog(theHandler.GetHideCommandDlg());
00751         userHitOK = true;
00752     }
00753 #endif /* qMacCvsPP */
00754 #if qUnix
00755     void *wid = UCreate_LogDlg();
00756
00757     UCvsLog *dlg = new UCvsLog();
00758     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00759     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00760     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00761     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00762     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00763
00764     if(dlg->DoModal())
00765     {
00766         noRecurs = tab1->m_norecurs;
00767         defBranch = tab1->m_defbranch;
00768         headerOnly = tab1->m_nousers;
00769         noTags = tab1->m_notags;
00770         onlyRCSfile = tab1->m_onlyrcs;
00771
00772         sLastDate = tab2->m_date;
00773         sLastRev = tab2->m_rev;
00774         sLastUsers = tab2->m_user;
00775         sLastStates = tab2->m_state;
00776
00777         hasRev = tab2->m_hasrev;
00778         hasUsers = tab2->m_hasuser;
00779         hasDate = tab2->m_hasdate;
00780         hasStates = tab2->m_hasstate;
00781
00782         userHitOK = true;
00783     }
00784
00785     delete dlg;
00786 #endif // qUnix
00787
00788     if( userHitOK )
00789     {
00790         supress = (bool)gLogSupress;
00791
00792         if( hasDate && !sLastDate.empty() )
00793             date = sLastDate;
00794
00795         if( hasRev )
00796             rev = sLastRev;
00797
00798         if( hasUsers )
00799             users = sLastUsers;
00800
00801         if( hasStates && !sLastStates.empty() )
00802             states = sLastStates;
00803
00804         gCvsPrefs.save();
00805     }
00806
00807     return userHitOK;
00808 }

Variable Documentation

CMString gLogDateNames(10, "P_LogDateNames", sDefLogDateNames) [static]

CMString gLogRevNames(10, "P_LogTagNames", sDefLogTagNames) [static]

CMString gLogStateNames(10, "P_LogStateNames", sDefLogStateNames) [static]

CPersistentBool gLogSupress("P_LogSupress", false, kAddSettings) [static]

Referenced by CompatGetLog().

CMString gLogUserNames(10, "P_LogUserNames", sDefLogUserNames) [static]

char* sDefLogDateNames[]

Initial value:

{
    ">1998-3-24",
    "<1998-1-24",
    "1998-1-24<1998-3-24",
    "<=3-24",
    0L
}
Default log date names.

Definition at line 75 of file LogDlg.cpp.

char* sDefLogStateNames[]

Initial value:

{
    "mystate",
    "dead",
    "exp",
    "mystate,mystate2",
    0L
}
Default log state names.

Definition at line 85 of file LogDlg.cpp.

char* sDefLogTagNames[]

Initial value:

{
    "1.32:1.35",
    "1.32:",
    ":1.35",
    "branch-release1-0",
    "HEAD",
    0L
}
Default log tag names.

Definition at line 64 of file LogDlg.cpp.

char* sDefLogUserNames[]

Initial value:

{
    "johna",
    "garyb",
    "johna,garyb",
    0L
}
Default log user names.

Definition at line 95 of file LogDlg.cpp.

Generated on Fri Jan 31 12:10:10 2003 for WinCvs Source by doxygen 1.3-rc2


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
Filters log dialog. More...

class | CLogMain
Main log dialog. More...

Defines

#define | AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Functions

bool | CompatGetLog (const MultiFiles *mf, bool &noRecurs, bool &defBranch, UPStr &date, bool &headerOnly, bool &headerDesc, bool &supress, bool &noTags, bool &onlyRCSfile, bool &hasRev, UPStr &rev, UPStr &states, bool &hasUser, UPStr &users, bool outGraph=false)
Get the log options.

Define Documentation

#define AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_

Definition at line 26 of file LogDlg.h.

Function Documentation

bool CompatGetLog | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | defBranch,
 |  | UPStr & | date,
 |  | bool & | headerOnly,
 |  | bool & | headerDesc,
 |  | bool & | supress,
 |  | bool & | noTags,
 |  | bool & | onlyRCSfile,
 |  | bool & | hasRev,
 |  | UPStr & | rev,
 |  | UPStr & | states,
 |  | bool & | hasUser,
 |  | UPStr & | users,
 |  | bool | outGraph = false
 | ) |

Get the log options.

Definition at line 631 of file LogDlg.cpp.

References CPStr, COptionalPropertySheet::DoModal(), EV_INIT_WIDGET, COptionalPropertySheet::GetHideCommandDlg(), gLogSupress, kUMainWidget, CLogFilters::m_date, CLogMain::m_defBranch, CLogFilters::m_hasDate, CLogFilters::m_hasRev, CLogFilters::m_hasState, CLogFilters::m_hasUser, CLogMain::m_headerDesc, CLogMain::m_headerOnly, CLogMain::m_noRecurs, CLogMain::m_noTags, CLogMain::m_onlyRCS, CLogFilters::m_rev, CLogFilters::m_state, CLogMain::m_supress, CLogFilters::m_user, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_LogDlg(), and UEventSendMessage().

Referenced by CvsCmdLog().

00637 {
00638     bool userHitOK = false;
00639
00640     static CPStr sLastDate;
00641     static CPStr sLastRev;
00642     static CPStr sLastUsers;
00643     static CPStr sLastStates;
00644
00645     bool hasDate = false;
00646     bool hasStates = false;
00647
00648     hasRev = false;
00649     hasUsers = false;
00650     date = "";
00651     rev = "";
00652     states = "";
00653     users = "";
00654     noRecurs = false;
00655     defBranch = false;
00656     headerOnly = false;
00657     headerDesc = false;
00658     supress = (bool)gLogSupress;
00659     noTags = false;
00660     onlyRCSfile = false;
00661
00662 #ifdef WIN32
00663     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00664         outGraph ? "Graph settings" : "Log settings");
00665     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00666
00667     CLogMain page1(supress);
00668     CLogFilters page2(mf, sLastDate, sLastRev, sLastUsers, sLastStates);
00669     CGetPrefs_GLOBALS page3;
00670
00671     pages.AddPage(&page1);
00672     pages.AddPage(&page2);
00673     pages.AddPage(&page3);
00674
00675     if( pages.DoModal() == IDOK )
00676     {
00677         gLogSupress = page1.m_supress ? true : false;
00678
00679         noRecurs = page1.m_noRecurs == TRUE;
00680         defBranch = page1.m_defBranch == TRUE;
00681         headerOnly = page1.m_headerOnly == TRUE;
00682         headerDesc = page1.m_headerDesc == TRUE;
00683         noTags = page1.m_noTags == TRUE;
00684         onlyRCSfile = page1.m_onlyRCS == TRUE;
00685
00686         sLastDate = page2.m_date;
00687         sLastRev = page2.m_rev;
00688         sLastUsers = page2.m_user;
00689         sLastStates = page2.m_state;
00690
00691         hasRev = page2.m_hasRev == TRUE;
00692         hasUsers = page2.m_hasUser == TRUE;
00693         hasDate = page2.m_hasDate == TRUE;
00694         hasStates = page2.m_hasState == TRUE;
00695
00696         page3.StoreValues();
00697
00698         if( outGraph )
00699         {
00700             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00701         }
00702         else
00703         {
00704             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00705         }
00706
00707         userHitOK = true;
00708     }
00709 #endif /* WIN32 */
00710 #ifdef qMacCvsPP
00711     StOptionalDialogHandler theHandler(dlg_Log, gCvsPrefs.HideCommandDlgLog(), LCommander::GetTopCommander());
00712     LWindow *theDialog = theHandler.GetDialog();
00713     ThrowIfNil_(theDialog);
00714     static UInt16 sRuntimePanel = 1;
00715
00716     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00717         (theDialog->FindPaneByID(item_MultiViewPrefs));
00718     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00719
00720     multiView->SwitchToPanel(3);
00721     DoDataExchange_Globals(theDialog, true);
00722     multiView->SwitchToPanel(2);
00723     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00724         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00725     multiView->SwitchToPanel(1);
00726     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00727
00728     groupView->SetValue(sRuntimePanel);
00729     theHandler.ShowDialog();
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     sRuntimePanel = groupView->GetValue();
00740
00741     if(hitMessage == msg_OK)
00742     {
00743         multiView->SwitchToPanel(1);
00744         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00745         multiView->SwitchToPanel(2);
00746         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00747         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00748         multiView->SwitchToPanel(3);
00749         DoDataExchange_Globals(theDialog, false);
00750         gCvsPrefs.SetHideCommandDlgLog(theHandler.GetHideCommandDlg());
00751         userHitOK = true;
00752     }
00753 #endif /* qMacCvsPP */
00754 #if qUnix
00755     void *wid = UCreate_LogDlg();
00756
00757     UCvsLog *dlg = new UCvsLog();
00758     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00759     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00760     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00761     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00762     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00763
00764     if(dlg->DoModal())
00765     {
00766         noRecurs = tab1->m_norecurs;
00767         defBranch = tab1->m_defbranch;
00768         headerOnly = tab1->m_nousers;
00769         noTags = tab1->m_notags;
00770         onlyRCSfile = tab1->m_onlyrcs;
00771
00772         sLastDate = tab2->m_date;
00773         sLastRev = tab2->m_rev;
00774         sLastUsers = tab2->m_user;
00775         sLastStates = tab2->m_state;
00776
00777         hasRev = tab2->m_hasrev;
00778         hasUsers = tab2->m_hasuser;
00779         hasDate = tab2->m_hasdate;
00780         hasStates = tab2->m_hasstate;
00781
00782         userHitOK = true;
00783     }
00784
00785     delete dlg;
00786 #endif // qUnix
00787
00788     if( userHitOK )
00789     {
00790         supress = (bool)gLogSupress;
00791
00792         if( hasDate && !sLastDate.empty() )
00793             date = sLastDate;
00794
00795         if( hasRev )
00796             rev = sLastRev;
00797
00798         if( hasUsers )
00799             users = sLastUsers;
00800
00801         if( hasStates && !sLastStates.empty() )
00802             states = sLastStates;
00803
00804         gCvsPrefs.save();
00805     }
00806
00807     return userHitOK;
00808 }

Generated on Fri Jan 31 12:10:11 2003 for WinCvs Source by doxygen 1.3-rc2


LoginDlg.cpp File Reference

common/LoginDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "LoginDlg.h"
#include "CvsPrefs.h"
#include "GetPrefs.h"

Include dependency graph for LoginDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetLogin (bool &forceCvsroot)
Get the login options.

Function Documentation

bool CompatGetLogin ( bool & forceCvsroot )

Get the login options.

Definition at line 91 of file LoginDlg.cpp.

References CLogin_MAIN::m_forceRoot, CGetPrefs_CVSROOT::StoreValues(), CGetPrefs_GLOBALS::StoreValues(), and TRUE.

Referenced by CvsCmdLogin().

00092 {
00093     bool userHitOK = false;
00094
00095     forceCvsroot = true;
00096
00097 #ifdef WIN32
00098     CPropertySheet pages("Login settings");
00099     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00100
00101     CLogin_MAIN page1(forceCvsroot);
00102     CGetPrefs_CVSROOT page2;
00103     CGetPrefs_GLOBALS page3;
00104     pages.AddPage(&page1);
00105     pages.AddPage(&page2);
00106     pages.AddPage(&page3);
00107
00108     if( pages.DoModal() == IDOK )
00109     {
00110         forceCvsroot = page1.m_forceRoot == TRUE;
00111
00112         page2.StoreValues();
00113         page3.StoreValues();
00114         userHitOK = true;
00115     }
00116 #else
00117   userHitOK = true;
00118 #endif /* WIN32 */
00119
00120     if( userHitOK )
00121     {
00122         gCvsPrefs.save();
00123     }
00124
00125     return userHitOK;
00126 }

Generated on Fri Jan 31 12:10:11 2003 for WinCvs Source by doxygen 1.3-rc2


LoginDlg.h File Reference

common/LoginDlg.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 | CLogin_MAIN

Defines

#define | AFX_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_

Functions

bool | CompatGetLogin (bool &forceCvsroot)
Get the login options.

Define Documentation

#define AFX_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_

Definition at line 26 of file LoginDlg.h.

Function Documentation

bool CompatGetLogin ( bool & forceCvsroot )

Get the login options.

Definition at line 91 of file LoginDlg.cpp.

References CLogin_MAIN::m_forceRoot, CGetPrefs_GLOBALS::StoreValues(), CGetPrefs_CVSROOT::StoreValues(), and TRUE.

Referenced by CvsCmdLogin().

00092 {
00093     bool userHitOK = false;
00094
00095     forceCvsroot = true;
00096
00097 #ifdef WIN32
00098     CPropertySheet pages("Login settings");
00099     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00100
00101     CLogin_MAIN page1(forceCvsroot);
00102     CGetPrefs_CVSROOT page2;
00103     CGetPrefs_GLOBALS page3;
00104     pages.AddPage(&page1);
00105     pages.AddPage(&page2);
00106     pages.AddPage(&page3);
00107
00108     if( pages.DoModal() == IDOK )
00109     {
00110         forceCvsroot = page1.m_forceRoot == TRUE;
00111
00112         page2.StoreValues();
00113         page3.StoreValues();
00114         userHitOK = true;
00115     }
00116 #else
00117   userHitOK = true;
00118 #endif /* WIN32 */
00119
00120     if( userHitOK )
00121     {
00122         gCvsPrefs.save();
00123     }
00124
00125     return userHitOK;
00126 }

Generated on Fri Jan 31 12:10:11 2003 for WinCvs Source by doxygen 1.3-rc2


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().

Referenced by UCvsGraph::OnBtnClick(), and 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,
 |  | void * | defWnd
 | ) |

Definition at line 206 of file LogParse.cpp.

References CStr, cvs_err(), cvs_outstr(), EV_INIT_WIDGET, EV_SHOW_WIDGET, free, getline(), UCmdTarget::GetWidID(), CWincvsApp::gLogGraph, kUMainWidget, launchCVS(), print(), CGraphDoc::SetNode(), UCreate_GraphWindow(), UEventSendMessage(), and UMAKEINT.

Referenced by CvsCmdLog(), cvsgui_GetHistoryAsXML(), 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 }

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 Fri Jan 31 12:10:12 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References print().

Referenced by UCvsGraph::OnBtnClick(), and 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.

References CStr, cvs_err(), cvs_outstr(), EV_INIT_WIDGET, EV_SHOW_WIDGET, free, getline(), UCmdTarget::GetWidID(), CWincvsApp::gLogGraph, kUMainWidget, launchCVS(), print(), CGraphDoc::SetNode(), UCreate_GraphWindow(), UEventSendMessage(), and UMAKEINT.

Referenced by CvsCmdLog(), cvsgui_GetHistoryAsXML(), 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 Fri Jan 31 12:10:12 2003 for WinCvs Source by doxygen 1.3-rc2


MacBinEncoding.cpp File Reference

common/MacBinEncoding.cpp File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:10:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:13 2003 for WinCvs Source by doxygen 1.3-rc2


MacBinMaps.cpp File Reference

common/MacBinMaps.cpp File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:10:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:13 2003 for WinCvs Source by doxygen 1.3-rc2


MacMisc.cpp File Reference

common/MacMisc.cpp File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:10:13 2003 for WinCvs Source by doxygen 1.3-rc2


MacMisc.h File Reference

common/MacMisc.h File Reference

#include "TextBinary.h"
#include "ustr.h"
#include <Dialogs.h>

Include dependency graph for MacMisc.h:

Include dependency graph

Go to the source code of this file.

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, bool createFolder=false)
OSErr | MacGetTempFolder (FSSpec &theFolder, UStr &thePath)
OSErr | MacGetPrefsFolder (FSSpec &theFolder, UStr &thePath)

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,
 |  | bool | createFolder = false
 | ) |

OSErr MacGetTempFolder | ( | FSSpec & | theFolder,
 |  | UStr & | thePath
 | ) |

Referenced by MakeTmpFile().

void SetDItemMenuSel | ( | DialogPtr | dlg,
 |  | SInt16 | Id,
 |  | SInt16 | sel
 | ) |

Generated on Fri Jan 31 12:10:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.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 73 of file MacrosSetup.cpp.

References CStr, UStr::empty(), UStr::endsWith(), CWincvsApp::GetAppPath(), SplitPath(), and stat.

Referenced by MacrosGetLoc(), and PythonLibGetLoc().

00074 {
00075     path = "";
00076 #ifdef WIN32
00077     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00078     pApp->GetAppPath(path);
00079
00080     CString appPath = path;
00081     // first the macro folder may be ./macro
00082     CString test = appPath;
00083     test.TrimRight('\\');
00084     test += "\\";
00085     test += subFolder;
00086
00087     struct stat sb;
00088     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00089     {
00090         path = test;
00091         return;
00092     }
00093
00094     CStr uppath, file;
00095     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00096     {
00097         test = uppath;
00098         test.TrimRight('\\');
00099         test += "\\";
00100         test += subFolder;
00101
00102         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00103         {
00104             path = test;
00105             return;
00106         }
00107         appPath = uppath;
00108     }
00109     path = test;
00110 #elif defined(qUnix)
00111     struct stat sb;
00112     path = PACKAGE_DATA_DIR;
00113     if(stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00114     {
00115         path = PACKAGE_SOURCE_DIR;
00116         CStr uppath, folder;
00117         SplitPath(path, uppath, folder);
00118         path = uppath;
00119         if(!path.endsWith(kPathDelimiter))
00120             path << kPathDelimiter;
00121         path << subFolder;
00122     }
00123 #elif qMacCvsPP
00124     UStr appPath = CMacCvsApp::GetAppPath();
00125     if(!appPath.endsWith(kPathDelimiter))
00126         appPath << kPathDelimiter;
00127     UStr test = appPath;
00128     test << subFolder;
00129
00130     struct stat sb;
00131     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00132     {
00133         path = test;
00134         return;
00135     }
00136
00137     UStr uppath, file;
00138     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00139     {
00140         test = uppath;
00141         if(!test.endsWith(kPathDelimiter))
00142             test << kPathDelimiter;
00143         test << subFolder;
00144
00145         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00146         {
00147             path = test;
00148             return;
00149         }
00150         appPath = uppath;
00151     }
00152     path = test;
00153 #else
00154     if(!path.empty() && !path.endsWith(kPathDelimiter))
00155     {
00156         path << kPathDelimiter;
00157     }
00158     path << subFolder;
00159 #endif
00160 }

void MacrosFlushAll ( void ) [static]

Definition at line 172 of file MacrosSetup.cpp.

References CMacroSet::Flush(), gMacrosAdmin, and gMacrosSel.

Referenced by MacrosReloadAll().

00173 {
00174     gMacrosAdmin.Flush();
00175     gMacrosSel.Flush();
00176 }

void MacrosGetLoc ( UStr & path )

Definition at line 162 of file MacrosSetup.cpp.

References getLoc().

Referenced by CTcl_Interp::CTcl_Interp(), MacrosReloadAll(), and PyMacrosReloadAll().

00163 {
00164     getLoc(path, MACROS_FOLDER);
00165 }

void MacrosReloadAll ( void )

Definition at line 318 of file MacrosSetup.cpp.

References CStr, FileTraverse(), MacrosFlushAll(), and MacrosGetLoc().

Referenced by UCvsApp::UCvsApp().

00319 {
00320     MacrosFlushAll();
00321
00322     // get the macro folder
00323     CStr path;
00324     MacrosGetLoc(path);
00325
00326     // traverse the macro folder
00327     MacroTraversal traverse;
00328     FileTraverse(path, traverse);
00329 }

void PythonLibGetLoc ( UStr & path )

Definition at line 167 of file MacrosSetup.cpp.

References getLoc().

Referenced by InitializeInterp().

00168 {
00169     getLoc(path, PYTHONLIB_FOLDER);
00170 }

Variable Documentation

CMacroSet gMacrosAdmin

Definition at line 70 of file MacrosSetup.cpp.

Referenced by MacrosFlushAll(), and MacroTraversal::OnFile().

CMacroSet gMacrosSel

Definition at line 71 of file MacrosSetup.cpp.

Referenced by MacrosFlushAll(), and MacroTraversal::OnFile().

Generated on Fri Jan 31 12:10:15 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#define PYTHONLIB_FOLDER "PythonLib"

Definition at line 36 of file MacrosSetup.h.

Function Documentation

void MacrosGetLoc ( UStr & path )

Definition at line 162 of file MacrosSetup.cpp.

References getLoc().

Referenced by CTcl_Interp::CTcl_Interp(), MacrosReloadAll(), and PyMacrosReloadAll().

00163 {
00164     getLoc(path, MACROS_FOLDER);
00165 }

void MacrosReloadAll ( void )

Definition at line 318 of file MacrosSetup.cpp.

References CStr, FileTraverse(), MacrosFlushAll(), and MacrosGetLoc().

Referenced by UCvsApp::UCvsApp().

00319 {
00320     MacrosFlushAll();
00321
00322     // get the macro folder
00323     CStr path;
00324     MacrosGetLoc(path);
00325
00326     // traverse the macro folder
00327     MacroTraversal traverse;
00328     FileTraverse(path, traverse);
00329 }

void PythonLibGetLoc ( UStr & path )

Definition at line 167 of file MacrosSetup.cpp.

References getLoc().

Referenced by InitializeInterp().

00168 {
00169     getLoc(path, PYTHONLIB_FOLDER);
00170 }

Variable Documentation

CMacroSet gMacrosAdmin

Definition at line 106 of file MacrosSetup.h.

Referenced by MacrosFlushAll(), and MacroTraversal::OnFile().

CMacroSet gMacrosSel

Definition at line 107 of file MacrosSetup.h.

Referenced by MacrosFlushAll(), and MacroTraversal::OnFile().

Generated on Fri Jan 31 12:10:15 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

References MAX_PATH.

Referenced by CompatMakeSurePathExists().

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 Fri Jan 31 12:10:16 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References CreateFolder(), and MAX_PATH.

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.

References MAX_PATH.

Referenced by CompatMakeSurePathExists().

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 Fri Jan 31 12:10:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 336 of file MoveToTrash.cpp.

Referenced by CvsCmdMoveToTrash(), and CvsCmdRemove().

00337 {
00338 #ifdef TARGET_OS_MAC
00339     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00340     sTrashRetainer = true;
00341 #endif
00342 }

void CompatEndMoveToTrash ( void )

Definition at line 344 of file MoveToTrash.cpp.

References cvs_err(), cvs_out(), and err.

Referenced by CvsCmdMoveToTrash(), and CvsCmdRemove().

00345 {
00346 #ifdef TARGET_OS_MAC
00347     if(sToTrash.size() > 0)
00348     {
00349         OSErr err;
00350         err = MoveToTrash(sToTrash);
00351         if(err != noErr)
00352             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00353         else
00354             cvs_out("Files has been moved successfully to the trash...\n");
00355     }
00356
00357     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00358     sTrashRetainer = false;
00359 #endif
00360 }

bool CompatMoveToTrash | ( | const char * | file,
 |  | const char * | dir,
 |  | const FSSpec * | spec
 | ) |

Definition at line 362 of file MoveToTrash.cpp.

References CStr, cvs_err(), and NULL.

Referenced by RemoveCvsArgs::addfile(), CvsCmdMoveToTrash(), and tclSafeRemove().

00363 {
00364 #ifdef TARGET_OS_MAC
00365     if(sTrashRetainer)
00366     {
00367         if(spec)
00368             sToTrash.push_back(*spec);
00369         else
00370         {
00371             CStr fullpath(dir);
00372             if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00373             {
00374                 fullpath << kPathDelimiter;
00375             }
00376             fullpath << file;
00377             GUSIFileSpec mspec(fullpath);
00378             if(mspec.Error() != noErr)
00379             {
00380                 errno = mspec.Error();
00381                 return false;
00382             }
00383             sToTrash.push_back(mspec);
00384         }
00385
00386         return true;
00387     }
00388
00389     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00390 #elif defined(WIN32)
00391     SHFILEOPSTRUCT fileop;
00392     CStr fullpath(dir);
00393     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00394     {
00395         fullpath << kPathDelimiter;
00396     }
00397     fullpath << file;
00398     fullpath << ' ';
00399     fullpath[fullpath.length() - 1] = '\0';
00400
00401     fileop.hwnd     = *AfxGetMainWnd();
00402     fileop.wFunc    = FO_DELETE;
00403     fileop.pFrom    = fullpath;
00404     fileop.pTo      = 0L;
00405     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00406
00407     if(SHFileOperation(&fileop) != 0)
00408     {
00409         if(dir != 0L && chdir(dir) != 0)
00410             return false;
00411
00412         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00413             file, GetLastError());
00414         cvs_err("Trying now to delete \'%s\' instead\n", file);
00415         return remove(file) == 0;
00416     }
00417     return true;
00418 #else /* !TARGET_OS_MAC && !WIN32 */
00419     CStr fullpath(dir);
00420     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00421     {
00422         fullpath << kPathDelimiter;
00423     }
00424     fullpath << file;
00425
00426     return remove(fullpath) == 0;
00427 #endif /* !TARGET_OS_MAC && !WIN32 */
00428 }

Generated on Fri Jan 31 12:10:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 336 of file MoveToTrash.cpp.

Referenced by CvsCmdMoveToTrash(), and CvsCmdRemove().

00337 {
00338 #ifdef TARGET_OS_MAC
00339     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00340     sTrashRetainer = true;
00341 #endif
00342 }

void CompatEndMoveToTrash ( void )

Definition at line 344 of file MoveToTrash.cpp.

References cvs_err(), cvs_out(), and err.

Referenced by CvsCmdMoveToTrash(), and CvsCmdRemove().

00345 {
00346 #ifdef TARGET_OS_MAC
00347     if(sToTrash.size() > 0)
00348     {
00349         OSErr err;
00350         err = MoveToTrash(sToTrash);
00351         if(err != noErr)
00352             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00353         else
00354             cvs_out("Files has been moved successfully to the trash...\n");
00355     }
00356
00357     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00358     sTrashRetainer = false;
00359 #endif
00360 }

bool CompatMoveToTrash | ( | const char * | file,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L
 | ) |

Definition at line 362 of file MoveToTrash.cpp.

References CStr, cvs_err(), and NULL.

Referenced by RemoveCvsArgs::addfile(), CvsCmdMoveToTrash(), and tclSafeRemove().

00363 {
00364 #ifdef TARGET_OS_MAC
00365     if(sTrashRetainer)
00366     {
00367         if(spec)
00368             sToTrash.push_back(*spec);
00369         else
00370         {
00371             CStr fullpath(dir);
00372             if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00373             {
00374                 fullpath << kPathDelimiter;
00375             }
00376             fullpath << file;
00377             GUSIFileSpec mspec(fullpath);
00378             if(mspec.Error() != noErr)
00379             {
00380                 errno = mspec.Error();
00381                 return false;
00382             }
00383             sToTrash.push_back(mspec);
00384         }
00385
00386         return true;
00387     }
00388
00389     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00390 #elif defined(WIN32)
00391     SHFILEOPSTRUCT fileop;
00392     CStr fullpath(dir);
00393     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00394     {
00395         fullpath << kPathDelimiter;
00396     }
00397     fullpath << file;
00398     fullpath << ' ';
00399     fullpath[fullpath.length() - 1] = '\0';
00400
00401     fileop.hwnd     = *AfxGetMainWnd();
00402     fileop.wFunc    = FO_DELETE;
00403     fileop.pFrom    = fullpath;
00404     fileop.pTo      = 0L;
00405     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00406
00407     if(SHFileOperation(&fileop) != 0)
00408     {
00409         if(dir != 0L && chdir(dir) != 0)
00410             return false;
00411
00412         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00413             file, GetLastError());
00414         cvs_err("Trying now to delete \'%s\' instead\n", file);
00415         return remove(file) == 0;
00416     }
00417     return true;
00418 #else /* !TARGET_OS_MAC && !WIN32 */
00419     CStr fullpath(dir);
00420     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00421     {
00422         fullpath << kPathDelimiter;
00423     }
00424     fullpath << file;
00425
00426     return remove(fullpath) == 0;
00427 #endif /* !TARGET_OS_MAC && !WIN32 */
00428 }

Generated on Fri Jan 31 12:10:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 <map>
#include <utility>
#include <algorithm>

Include dependency graph for MultiFiles.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

struct | match_dir
helper functor to compare MultiFilesEntry by directory path More...

Functions

bool | split (const UStr &inPartialPath, UStr &outPath, UStr &outName)
Split a (potentially) partial path into folder and name.

Function Documentation

bool split | ( | const UStr & | inPartialPath,
 |  | UStr & | outPath,
 |  | UStr & | outName
 | ) | [static]

Split a (potentially) partial path into folder and name.

Definition at line 202 of file MultiFiles.cpp.

References NULL.

Referenced by MultiFiles::Normalize().

00203 {
00204     int     delimiterPos(inPartialPath.rfind(kPathDelimiter));
00205     if ( delimiterPos )
00206     {
00207         inPartialPath.substr(delimiterPos+1, inPartialPath.length()-delimiterPos-1, outName);
00208         inPartialPath.substr(0, delimiterPos+1, outPath); // includes trailing delimiter
00209         return true;
00210     }
00211     else
00212     {
00213         outName = inPartialPath;
00214         outPath = (const char*)NULL;
00215         return false;
00216     }
00217 }

Generated on Fri Jan 31 12:10:19 2003 for WinCvs Source by doxygen 1.3-rc2


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
Used internally. More...

class | MultiFiles
Store multiple files by directory. More...

class | MultiFilesEntry
Used internally. More...

class | MultiFilesEntryIndex
A pair of MultiFiles::const_iterator and index allowing to identify the FileEntry. More...

Generated on Fri Jan 31 12:10:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 166 of file MultiString.cpp.

template class TMString< UStr >

Definition at line 165 of file MultiString.cpp.

Generated on Fri Jan 31 12:10:21 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Generated on Fri Jan 31 12:10:22 2003 for WinCvs Source by doxygen 1.3-rc2


OptionalPropertySheet.cpp File Reference

common/OptionalPropertySheet.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "CvsPrefs.h"
#include "wincvs_winutil.h"

Include dependency graph for OptionalPropertySheet.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Fri Jan 31 12:10:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 | IDC_OPTIONCHECK_BUTTON 4

Define Documentation

#define AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_

Definition at line 22 of file OptionalPropertySheet.h.

#define IDC_OPTIONCHECK_BUTTON 4

Definition at line 30 of file OptionalPropertySheet.h.

Generated on Fri Jan 31 12:10:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.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

Functions

int | simple_diff (const char *file1, const char *file2)
Very simple diff.

bool | FormatDefaultSettingsLoc (UStr &path)
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 97 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings(), and CPersistent::Register().

Function Documentation

bool _loadPersistentSettings | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 1110 of file Persistent.cpp.

References cvs_err(), CPersistent::Find(), CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, UObject::IsKindOf(), and URUNTIME_CLASS.

01111 {
01112     if( strcmp(token, "CVSROOT") == 0 )
01113     {
01114         gCvsPrefs = value;
01115     }
01116     else if( strcmp(token, "AUTHENTICATION") == 0 )
01117     {
01118         gAuthen.setkind(Authen::tokenToKind(value));
01119     }
01120     else if( strcmp(token, "PATH") == 0 )
01121     {
01122     }
01123     else
01124     {
01125         CPersistent::CPersistentEntry* entry = CPersistent::Find(token);
01126         if( entry == 0L )
01127         {
01128             //cvs_err("Persistent value '%s' is not registred\n", token);
01129         }
01130         else
01131         {
01132             if( entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)) )
01133             {
01134                 CPersistentBool* pbool = (CPersistentBool*)entry->fValue;
01135                 if( strcmp(value, "true") == 0 )
01136                     *pbool = true;
01137                 else if( strcmp(value, "false") == 0 )
01138                     *pbool = false;
01139                 else
01140                     cvs_err("Invalid value '%s' for persistent '%s'\n", (const char*)value, entry->fUniqueName);
01141             }
01142             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)) )
01143             {
01144                 CPersistentInt* pint = (CPersistentInt*)entry->fValue;
01145                 int aint;
01146                 int check = sscanf(value, "%d", &aint);
01147                 if( check == 1 )
01148                     *pint = aint;
01149                 else
01150                     cvs_err("Invalid value '%s' for persistent '%s'\n", (const char*)value, entry->fUniqueName);
01151             }
01152             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(PCStr)) )
01153             {
01154                 PCStr* pstr = (PCStr*)entry->fValue;
01155                 *pstr = value;
01156             }
01157             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(PCPStr)) )
01158             {
01159                 PCPStr* pstr = (PCPStr*)entry->fValue;
01160                 *pstr = value;
01161             }
01162             else
01163             {
01164                 cvs_err("Unknown persistent value '%s'\n", entry->fUniqueName);
01165             }
01166         }
01167     }
01168
01169     return false;
01170 }

void AskCreatePersistentSettings ( const char * path )

Definition at line 1210 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(), UCreate_SettingsDlg(), and UEventSendMessage().

Referenced by CWincvsDoc::OnSavesettings(), UCvsFolders::ResetBrowser(), and CWinCvsBrowser::ResetBrowser().

01211 {
01212     UStr settingsDir;
01213     if( !SettingsGetLoc(settingsDir) )
01214         return;
01215
01216     int id = 0;
01217
01218 #ifdef WIN32
01219     id = IDD_SAVESETTINGS;
01220 #endif
01221 #ifdef qMacCvsPP
01222     id = dlg_SaveSettings;
01223 #endif
01224
01225     CFindSettings finder(path);
01226     FileTraverse(settingsDir, finder);
01227
01228     UStr oldName;
01229
01230     if( !finder.m_settingsFile.empty() )
01231     {
01232         getSettingName(finder.m_settingsFile, oldName);
01233     }
01234
01235     USaveSettings* dlg = NEW USaveSettings(path, oldName);
01236
01237 #if qUnix
01238     void* wid;
01239 #   if qGTK
01240     wid = UCreate_SettingsDlg();
01241 #   endif
01242
01243     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01244 #endif
01245
01246     if( dlg->DoModal(id) )
01247     {
01248         UStr name = dlg->m_settingName;
01249         UStr fileToDelete;
01250
01251         if( !name.empty() )
01252         {
01253             if( !oldName.empty() )
01254             {
01255                 if( stricmp(oldName, name) != 0 )
01256                 {
01257                     UStr prompt("The setting '");
01258                     prompt << oldName;
01259                     prompt << "' already points on the same folder. ";
01260                     prompt << "Press 'Delete' if you want to overide this setting ";
01261                     prompt << "(two settings cannot point on the same location).";
01262
01263                     if( CvsAlert(prompt, "Cancel", "Delete") )
01264                     {
01265                         delete dlg;
01266                         return;
01267                     }
01268
01269                     fileToDelete = finder.m_settingsFile;
01270                 }
01271             }
01272
01273             if( !dlg->m_copyFromPath.empty() )
01274                 LoadPersistentSettings(dlg->m_copyFromPath);
01275
01276             SaveAsPersistentSettings(name, path);
01277
01278             if( !fileToDelete.empty() )
01279             {
01280                 if( remove(fileToDelete) != 0 )
01281                     cvs_err("Error while deleting '%s' (error %d)\n", (const char*)fileToDelete, errno);
01282             }
01283         }
01284     }
01285
01286     delete dlg;
01287 }

bool FormatDefaultSettingsLoc ( UStr & path )

Format the default settings folder string

Parameters:
path Return the formatted settings folder string
Returns:
true on success, false otherwise

Definition at line 683 of file Persistent.cpp.

References cvs_err(), CWincvsApp::GetAppPath(), and stat.

Referenced by CGetPrefs_WINCVS::OnAltsettingschk(), and SettingsGetLoc().

00684 {
00685 #ifdef WIN32
00686     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00687     if( !pApp )
00688     {
00689         return false;
00690     }
00691
00692     pApp->GetAppPath(path);
00693
00694 #elif defined(qUnix)
00695     struct stat sb;
00696
00697     path = gCvsPrefs.Home();
00698     if( !path.endsWith(kPathDelimiter) )
00699         path << kPathDelimiter;
00700
00701     path << ".gcvs";
00702
00703     if( stat(path, &sb) != -1 )
00704     {
00705         if( !S_ISDIR(sb.st_mode) )
00706         {
00707             cvs_err("The file '%s' already exists and is not a directory", (char*)path, errno);
00708             return false;
00709         }
00710     }
00711     else if( mkdir(path, 0750) != 0 )
00712     {
00713         cvs_err("Unable to create the directory '%s' (error %d)", (char*)path, errno);
00714         return false;
00715     }
00716
00717 #elif defined(qMacCvsPP)
00718     path = CMacCvsApp::GetMacCvsPrefsPath();
00719 #endif
00720
00721     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00722     {
00723         path << kPathDelimiter;
00724     }
00725
00726     path << "Settings";
00727
00728     return true;
00729 }

bool GetAllPersistentSettings ( std::map< UStr, UStr > & res ) [static]

Definition at line 1086 of file Persistent.cpp.

References FileTraverse(), and SettingsGetLoc().

Referenced by USaveSettings::DoDataExchange().

01087 {
01088     UStr settingsDir;
01089     if( !SettingsGetLoc(settingsDir) )
01090         return false;
01091
01092     CFindSettings finder(res);
01093     FileTraverse(settingsDir, finder);
01094
01095     return !res.empty();
01096 }

void getSettingName | ( | const char * | fromfile,
 |  | UStr & | res
 | ) | [static]

Definition at line 977 of file Persistent.cpp.

References CStr, GetExtension(), and SplitPath().

Referenced by AskCreatePersistentSettings(), and CFindSettings::searchAllPath().

00978 {
00979     CStr base, ext, uppath, filename;
00980     SplitPath(fromfile, uppath, filename);
00981     GetExtension(filename, base, ext);
00982
00983     if( !base.empty() && stricmp(ext, "txt") == 0 )
00984         res = base;
00985     else
00986         res = filename;
00987 }

bool HasPersistentSettings ( const char * path )

Definition at line 1098 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), CFindSettings::m_settingsFile, and SettingsGetLoc().

Referenced by UCvsFolders::ResetBrowser(), and CWinCvsBrowser::ResetBrowser().

01099 {
01100     UStr settingsDir;
01101     if( !SettingsGetLoc(settingsDir) )
01102         return false;
01103
01104     CFindSettings finder(path);
01105     FileTraverse(settingsDir, finder);
01106
01107     return !finder.m_settingsFile.empty();
01108 }

void LoadPersistentSettings | ( | const char * | path,
 |  | bool | quiet
 | ) |

Definition at line 1172 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), kBold, kNL, kNormal, kUnderline, loadSettingsInternal(), CFindSettings::m_settingsFile, and SettingsGetLoc().

Referenced by AskCreatePersistentSettings(), UCvsFolders::ResetBrowser(), and CWinCvsBrowser::ResetBrowser().

01173 {
01174     UStr settingsDir;
01175     if( !SettingsGetLoc(settingsDir) )
01176         return;
01177
01178     CFindSettings finder(path);
01179     FileTraverse(settingsDir, finder);
01180
01181     if( finder.m_settingsFile.empty() )
01182         return;
01183
01184     if( loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet )
01185     {
01186         CColorConsole out;
01187         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01188     }
01189 }

bool loadSettingsInternal | ( | const char * | fullname,
 |  | bool(* | func)(const char *token, const char *value, void *data),
 |  | void * | data
 | ) | [static]

Definition at line 904 of file Persistent.cpp.

References cvs_err(), free, getline(), and UStr::set().

Referenced by LoadPersistentSettings(), and CFindSettings::OnFile().

00906 {
00907     bool res = false;
00908     int line_length;
00909     char* line = 0L;
00910     size_t line_chars_allocated = 0;
00911     FILE* fp = fopen(fullname, "r");
00912
00913     if( fp == 0L )
00914     {
00915         cvs_err("Failed to open the setting file '%s' for reading (error %d)", fullname, errno);
00916         goto fail;
00917     }
00918
00919     while( (line_length = getline (&line, &line_chars_allocated, fp)) > 0 )
00920     {
00921         // read each token=value
00922         char* tmp = 0L;
00923
00924         if( (tmp = strchr(line, '\n')) != 0L )
00925             *tmp = '\0';
00926
00927         tmp = line;
00928         while( isspace(*tmp) && *tmp != '\0' )
00929             tmp++;
00930
00931         if( *tmp == '\0' || *tmp == '#' )
00932             continue;
00933
00934         UStr token;
00935         UStr value;
00936         const char* tmp2 = strchr(tmp, '=');
00937         if( tmp2 == 0L )
00938             continue;
00939
00940         token.set(tmp, tmp2 - tmp);
00941         value = tmp2 + 1;
00942
00943         // check version
00944         if( strcmp(token, "VERSION") == 0 )
00945         {
00946             if( atoi(value) != 1 )
00947             {
00948                 cvs_err("Newer format than expected in the setting file '%s'\n", fullname);
00949                 goto fail;
00950             }
00951
00952             continue;
00953         }
00954
00955         if( func(token, value, data) )
00956             break;
00957     }
00958
00959     if( line_length < 0 && !feof (fp) )
00960     {
00961         cvs_err("Cannot read file (error %d)\n", errno);
00962         goto fail;
00963     }
00964
00965     res = true;
00966
00967 fail:
00968     if( line != 0L )
00969         free(line);
00970
00971     if( fp!= 0L )
00972         fclose(fp);
00973
00974     return res;
00975 }

void SaveAsPersistentSettings | ( | const char * | name,
 |  | const char * | path
 | ) | [static]

Definition at line 1191 of file Persistent.cpp.

References UStr::empty(), UStr::endsWith(), kBold, kNL, kNormal, kUnderline, CPersistent::SaveAllSettings(), and SettingsGetLoc().

Referenced by AskCreatePersistentSettings().

01192 {
01193     UStr settingFileName;
01194     if( !SettingsGetLoc(settingFileName) )
01195         return;
01196
01197     if( !settingFileName.empty() && !settingFileName.endsWith(kPathDelimiter) )
01198         settingFileName << kPathDelimiter;
01199
01200     settingFileName << name;
01201     settingFileName << ".txt";
01202
01203     if( CPersistent::SaveAllSettings(settingFileName, path) )
01204     {
01205         CColorConsole out;
01206         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01207     }
01208 }

void SavePersistentSettings ( const char * path )

Definition at line 1289 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), kBold, kNL, kNormal, kUnderline, CFindSettings::m_settingsFile, CFindSettings::m_topfolder, CPersistent::SaveAllSettings(), and SettingsGetLoc().

Referenced by CvsPrefs::save().

01290 {
01291     UStr settingsDir;
01292     if( !SettingsGetLoc(settingsDir) )
01293         return;
01294
01295     CFindSettings finder(path);
01296     FileTraverse(settingsDir, finder);
01297
01298     if( finder.m_settingsFile.empty() )
01299         return;
01300
01301     if( CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder) )
01302     {
01303         CColorConsole out;
01304         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01305     }
01306 }

bool SettingsGetLoc ( UStr & path ) [static]

Get the settings folder (location)

Parameters:
path Return the settings folder
Returns:
true on success, false otherwise

Definition at line 736 of file Persistent.cpp.

References cvs_err(), FormatDefaultSettingsLoc(), and stat.

Referenced by AskCreatePersistentSettings(), GetAllPersistentSettings(), HasPersistentSettings(), LoadPersistentSettings(), SaveAsPersistentSettings(), and SavePersistentSettings().

00737 {
00738     struct stat sb;
00739
00740     path = "";
00741
00742     if( gCvsPrefs.SettingsFolder() != 0L )
00743     {
00744         path = gCvsPrefs.SettingsFolder();
00745     }
00746     else
00747     {
00748         if( !FormatDefaultSettingsLoc(path) )
00749         {
00750             return false;
00751         }
00752     }
00753
00754     if( stat(path, &sb) != -1 && S_ISDIR(sb.st_mode) )
00755         return true;
00756
00757 #if qUnix || TARGET_RT_MAC_MACHO
00758     if( mkdir(path, 0750) != 0 )
00759 #else
00760     if( mkdir(path) != 0 )
00761 #endif
00762     {
00763         cvs_err("Failed to create the setting folder '%s' (error %d)", (const char*)path, errno);
00764         return false;
00765     }
00766
00767     return true;
00768 }

int simple_diff | ( | const char * | file1,
 |  | const char * | file2
 | ) | [static]

Very simple diff.

Definition at line 165 of file Persistent.cpp.

Referenced by CPersistent::SaveAllSettings().

00166 {
00167     FILE* f1 = fopen(file1, "rb");
00168     if(f1 == 0L)
00169         return -1;
00170
00171     FILE* f2 = fopen(file2, "rb");
00172     if( f2 == 0L )
00173     {
00174         fclose(f1);
00175         return 1;
00176     }
00177
00178     int res = -1;
00179     char buf1[8000];
00180     char buf2[8000];
00181     size_t num1, num2;
00182
00183     while( !feof(f1) && !feof(f2) && !ferror(f1) && !ferror(f2) )
00184     {
00185         num1 = fread(buf1, sizeof(char), 8000, f1);
00186         num2 = fread(buf2, sizeof(char), 8000, f2);
00187         if( num1 != num2 || (res = memcmp(buf1, buf2, num1 * sizeof(char))) != 0 )
00188             goto fail;
00189     }
00190
00191     if( ferror(f1) || ferror(f2) )
00192         goto fail;
00193
00194     if( feof(f1) ^ feof(f2) )
00195         goto fail;
00196
00197     res = 0;
00198
00199 fail:
00200     fclose(f1);
00201     fclose(f2);
00202
00203     return res;
00204 }

Generated on Fri Jan 31 12:10:24 2003 for WinCvs Source by doxygen 1.3-rc2


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
Abstract class to access the persistent data to load/save. More...

struct | CPersistentEntry
class | CPersistentBool
bool type persistant specialization More...

class | CPersistentInt
int type persistant specialization More...

class | CPersistentT
Template class for persistant values. More...

Defines

#define | PROFILE_NAME "CVS settings"
CVS settings profile name.

#define | PERSISTENT_CAST(T)
Casting macro, good for most persistant values.

Enumerations

enum kClassPersistent {
kNoClass = 0x00,
kAddSettings = 0x01
}
Persistent classes enum. More...

Functions

void | LoadPersistentSettings (const char *path, bool quiet=false)
bool | HasPersistentSettings (const char *path)
void | AskCreatePersistentSettings (const char *path)
void | SavePersistentSettings (const char *path)
bool | FormatDefaultSettingsLoc (UStr &path)

Define Documentation

#define PERSISTENT_CAST ( T )

Value:

inline operator const T&() const {return fValue;} \
    inline T& operator=(const T& val) { TouchTimeStamp(); return fValue = val;} \
    inline bool operator==(const T& val) const {return fValue == val;}
Casting macro, good for most persistant values.

Definition at line 47 of file Persistent.h.

#define PROFILE_NAME "CVS settings"

CVS settings profile name.

Definition at line 43 of file Persistent.h.

Enumeration Type Documentation

enum kClassPersistent

Persistent classes enum.

Enumeration values:
kNoClass | No class
kAddSettings | Add to the saved settings

Definition at line 54 of file Persistent.h.

00055 {
00056     kNoClass = 0x00,
00057     kAddSettings = 0x01
00058 } kClassPersistent;

Function Documentation

void AskCreatePersistentSettings ( const char * path )

Definition at line 1210 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(), UCreate_SettingsDlg(), and UEventSendMessage().

Referenced by CWincvsDoc::OnSavesettings(), CWinCvsBrowser::ResetBrowser(), and UCvsFolders::ResetBrowser().

01211 {
01212     UStr settingsDir;
01213     if( !SettingsGetLoc(settingsDir) )
01214         return;
01215
01216     int id = 0;
01217
01218 #ifdef WIN32
01219     id = IDD_SAVESETTINGS;
01220 #endif
01221 #ifdef qMacCvsPP
01222     id = dlg_SaveSettings;
01223 #endif
01224
01225     CFindSettings finder(path);
01226     FileTraverse(settingsDir, finder);
01227
01228     UStr oldName;
01229
01230     if( !finder.m_settingsFile.empty() )
01231     {
01232         getSettingName(finder.m_settingsFile, oldName);
01233     }
01234
01235     USaveSettings* dlg = NEW USaveSettings(path, oldName);
01236
01237 #if qUnix
01238     void* wid;
01239 #   if qGTK
01240     wid = UCreate_SettingsDlg();
01241 #   endif
01242
01243     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01244 #endif
01245
01246     if( dlg->DoModal(id) )
01247     {
01248         UStr name = dlg->m_settingName;
01249         UStr fileToDelete;
01250
01251         if( !name.empty() )
01252         {
01253             if( !oldName.empty() )
01254             {
01255                 if( stricmp(oldName, name) != 0 )
01256                 {
01257                     UStr prompt("The setting '");
01258                     prompt << oldName;
01259                     prompt << "' already points on the same folder. ";
01260                     prompt << "Press 'Delete' if you want to overide this setting ";
01261                     prompt << "(two settings cannot point on the same location).";
01262
01263                     if( CvsAlert(prompt, "Cancel", "Delete") )
01264                     {
01265                         delete dlg;
01266                         return;
01267                     }
01268
01269                     fileToDelete = finder.m_settingsFile;
01270                 }
01271             }
01272
01273             if( !dlg->m_copyFromPath.empty() )
01274                 LoadPersistentSettings(dlg->m_copyFromPath);
01275
01276             SaveAsPersistentSettings(name, path);
01277
01278             if( !fileToDelete.empty() )
01279             {
01280                 if( remove(fileToDelete) != 0 )
01281                     cvs_err("Error while deleting '%s' (error %d)\n", (const char*)fileToDelete, errno);
01282             }
01283         }
01284     }
01285
01286     delete dlg;
01287 }

bool FormatDefaultSettingsLoc ( UStr & path )

Format the default settings folder string

Parameters:
path Return the formatted settings folder string
Returns:
true on success, false otherwise

Definition at line 683 of file Persistent.cpp.

References cvs_err(), CWincvsApp::GetAppPath(), and stat.

Referenced by CGetPrefs_WINCVS::OnAltsettingschk(), and SettingsGetLoc().

00684 {
00685 #ifdef WIN32
00686     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00687     if( !pApp )
00688     {
00689         return false;
00690     }
00691
00692     pApp->GetAppPath(path);
00693
00694 #elif defined(qUnix)
00695     struct stat sb;
00696
00697     path = gCvsPrefs.Home();
00698     if( !path.endsWith(kPathDelimiter) )
00699         path << kPathDelimiter;
00700
00701     path << ".gcvs";
00702
00703     if( stat(path, &sb) != -1 )
00704     {
00705         if( !S_ISDIR(sb.st_mode) )
00706         {
00707             cvs_err("The file '%s' already exists and is not a directory", (char*)path, errno);
00708             return false;
00709         }
00710     }
00711     else if( mkdir(path, 0750) != 0 )
00712     {
00713         cvs_err("Unable to create the directory '%s' (error %d)", (char*)path, errno);
00714         return false;
00715     }
00716
00717 #elif defined(qMacCvsPP)
00718     path = CMacCvsApp::GetMacCvsPrefsPath();
00719 #endif
00720
00721     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00722     {
00723         path << kPathDelimiter;
00724     }
00725
00726     path << "Settings";
00727
00728     return true;
00729 }

bool HasPersistentSettings ( const char * path )

Definition at line 1098 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), CFindSettings::m_settingsFile, and SettingsGetLoc().

Referenced by CWinCvsBrowser::ResetBrowser(), and UCvsFolders::ResetBrowser().

01099 {
01100     UStr settingsDir;
01101     if( !SettingsGetLoc(settingsDir) )
01102         return false;
01103
01104     CFindSettings finder(path);
01105     FileTraverse(settingsDir, finder);
01106
01107     return !finder.m_settingsFile.empty();
01108 }

void LoadPersistentSettings | ( | const char * | path,
 |  | bool | quiet = false
 | ) |

Definition at line 1172 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), kBold, kNL, kNormal, kUnderline, loadSettingsInternal(), CFindSettings::m_settingsFile, and SettingsGetLoc().

Referenced by AskCreatePersistentSettings(), CWinCvsBrowser::ResetBrowser(), and UCvsFolders::ResetBrowser().

01173 {
01174     UStr settingsDir;
01175     if( !SettingsGetLoc(settingsDir) )
01176         return;
01177
01178     CFindSettings finder(path);
01179     FileTraverse(settingsDir, finder);
01180
01181     if( finder.m_settingsFile.empty() )
01182         return;
01183
01184     if( loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet )
01185     {
01186         CColorConsole out;
01187         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01188     }
01189 }

void SavePersistentSettings ( const char * path )

Definition at line 1289 of file Persistent.cpp.

References UStr::empty(), FileTraverse(), kBold, kNL, kNormal, kUnderline, CFindSettings::m_settingsFile, CFindSettings::m_topfolder, CPersistent::SaveAllSettings(), and SettingsGetLoc().

Referenced by CvsPrefs::save().

01290 {
01291     UStr settingsDir;
01292     if( !SettingsGetLoc(settingsDir) )
01293         return;
01294
01295     CFindSettings finder(path);
01296     FileTraverse(settingsDir, finder);
01297
01298     if( finder.m_settingsFile.empty() )
01299         return;
01300
01301     if( CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder) )
01302     {
01303         CColorConsole out;
01304         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01305     }
01306 }

Generated on Fri Jan 31 12:10:26 2003 for WinCvs Source by doxygen 1.3-rc2


ProgressDlg.cpp File Reference

common/ProgressDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ProgressDlg.h"
#include "AppConsole.h"

Include dependency graph for ProgressDlg.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Fri Jan 31 12:10:27 2003 for WinCvs Source by doxygen 1.3-rc2


ProgressDlg.h File Reference

common/ProgressDlg.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
Progress indicator wrapper class. More...

class | CProgressDlg
Progress dialog, should be dynamically allocated. More...

Defines

#define | AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_

Enumerations

enum kProgressType {
kProgressBar,
kProgressText,
kProgressFile
}
Progress indicator type enum. More...

Define Documentation

#define AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_

Definition at line 22 of file ProgressDlg.h.

Enumeration Type Documentation

enum kProgressType

Progress indicator type enum.

Enumeration values:
kProgressBar | Progress bar as the progress indicator
kProgressText | Text as the progress indicator
kProgressFile | File name as the progress indicator

Definition at line 31 of file ProgressDlg.h.

00032 {
00033     kProgressBar,
00034     kProgressText,
00035     kProgressFile
00036 } kProgressType;

Generated on Fri Jan 31 12:10:27 2003 for WinCvs Source by doxygen 1.3-rc2


PromptFiles.cpp File Reference

common/PromptFiles.cpp File Reference

#include "stdafx.h"
#include "PromptFiles.h"
#include "MultiFiles.h"
#include "AppConsole.h"
#include "CvsCommands.h"
#include "CvsArgs.h"
#include "MfFileDialog.h"

Include dependency graph for PromptFiles.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define | FILTER_SEPARATOR "|"
#define | FILTER_EXECUTABLE "Executable Files (*.exe)" FILTER_SEPARATOR "*.exe"
#define | FILTER_ALL "All Files (*.*)" FILTER_SEPARATOR "*.*"
#define | FILTER_END FILTER_SEPARATOR FILTER_SEPARATOR

Functions

bool | BrowserGetDirectory (const char *prompt, UStr &dir, CWnd *pParentWnd)
bool | BrowserGetMultiFiles (const char *prompt, MultiFiles &mf, bool single, const kFilesSelectionType selectionType)

Define Documentation

#define FILTER_ALL "All Files (*.*)" FILTER_SEPARATOR "*.*"

Definition at line 79 of file PromptFiles.cpp.

Referenced by BrowserGetMultiFiles().

#define FILTER_END FILTER_SEPARATOR FILTER_SEPARATOR

Definition at line 80 of file PromptFiles.cpp.

Referenced by BrowserGetMultiFiles().

#define FILTER_EXECUTABLE "Executable Files (*.exe)" FILTER_SEPARATOR "*.exe"

Definition at line 78 of file PromptFiles.cpp.

Referenced by BrowserGetMultiFiles().

#define FILTER_SEPARATOR "|"

Definition at line 77 of file PromptFiles.cpp.

Referenced by BrowserGetMultiFiles().

Function Documentation

bool BrowserGetDirectory | ( | const char * | prompt,
 |  | UStr & | dir,
 |  | CWnd * | pParentWnd
 | ) |

Prompts the user for directory selection

Parameters:
prompt | Dialog caption
dir | Pass initial directory, return selected directory if selection done
pParentWnd | Parent for the dialog, important if you call it from within the dialog
Returns:
true if selection was done, false otherwise

Definition at line 161 of file PromptFiles.cpp.

References CStr, cvs_err(), FSSpec, SplitPath(), and stat.

00162 {
00163     bool result = false;
00164
00165 #ifdef WIN32  //{ Win32 - Part
00166     CCJShell m_shell;
00167     m_shell.m_strTitle = prompt;
00168     m_shell.m_strSelDir = dir;
00169
00170     if( m_shell.BrowseForFolder(pParentWnd != 0L ? pParentWnd : AfxGetMainWnd()) )
00171     {
00172         dir = m_shell.m_strPath;
00173         result = true;
00174     }
00175 #endif //{ WIN32
00176
00177 #ifdef TARGET_OS_MAC   //{ Mac - Part
00178
00179 #   if qMacPP
00180 #       if !qCarbon
00181     if(UConditionalDialogs::UseNavServices())
00182 #       else
00183         if(1)
00184 #       endif
00185         {
00186             UNavServicesDialogs::LFileChooser chooser;
00187
00188             FSSpec folderReply;
00189             SInt32 outFolderDirID;
00190             if( chooser.AskChooseFolder(folderReply, outFolderDirID) )
00191             {
00192                 GUSIFileSpec dirSpec(folderReply);
00193                 dir = dirSpec.FullPath();
00194                 result = true;
00195             }
00196         }
00197 #   endif
00198 #   if !qCarbon
00199         FSSpec folderReply;
00200         Point apt = {-1, -1};
00201         Str255 pprompt;
00202
00203         strcpy((char*)pprompt, prompt);
00204         c2pstr((char*)pprompt);
00205         if( SF_PromptForFolder(apt, pprompt, &folderReply) )
00206         {
00207             GUSIFileSpec spec = folderReply;
00208             if( spec.Error() == noErr )
00209             {
00210                 dir = spec.FullPath();
00211                 result = true;
00212             }
00213             else
00214             {
00215                 cvs_err("MacCvs: Unable to convert path name\n");
00216             }
00217         }
00218 #   endif
00219
00220 #endif  //{ TARGET_OS_MAC
00221
00222 #ifdef qQT  //{ QT - Part
00223     QFileDialog::Mode mode = QFileDialog::Directory;
00224     QString start(QDir::currentDirPath());
00225     QString filter("*");
00226     QString caption(prompt);
00227
00228     QFileDialog fd(start, filter, 0, 0L, TRUE);
00229     fd.setMode(mode);
00230     fd.setCaption(caption);
00231     fd.setSelection(start);
00232     if( fd.exec() == QDialog::Accepted )
00233     {
00234         dir = fd.dirPath();
00235         result = true;
00236     }
00237 #endif //} qQT
00238
00239 #ifdef qGTK  //{ GTK - Part
00240     /* Create a new file selection widget */
00241     GtkWidget* filew = gtk_file_selection_new (prompt);
00242
00243     gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00244                        GTK_SIGNAL_FUNC(gtkcancel), 0L);
00245
00246     /* Connect the ok_button to file_ok_sel function */
00247     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00248                       "clicked", (GtkSignalFunc) file_ok_sel, filew);
00249     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00250                       "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00251     //{ WORKAROUND  Bug #440874
00252     // call 'fileop_c_dir_sel' when file options selected
00253     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->fileop_c_dir),
00254                       "clicked", (GtkSignalFunc) fileop_c_dir_sel, filew);
00255     //}  WORKAROUND  Bug #440874
00256
00257     gtkModalLoop = true;
00258     gtksel = "";
00259     gtk_widget_show(filew);
00260     //{ WORKAROUND Bug 440874: blocks keyboard in create dialog if uncommented
00261     gtk_grab_add(filew);
00262     //} WORKAROUND Bug 440874
00263     while( gtkModalLoop )
00264     {
00265         gtk_main_iteration_do(TRUE);
00266     }
00267
00268     //{ WORKAROUND Bug 440874: blocks keyboard in create dialog if uncommented
00269     gtk_grab_remove (filew);
00270     //} BWORKAROUND Bug 440874
00271
00272     gtk_widget_destroy(filew);
00273
00274     if( !gtksel.empty() )
00275     {
00276         static CStr fname;
00277
00278         fname = gtksel;
00279         if( !fname.empty() )
00280         {
00281             struct stat sb;
00282             if( stat(fname, &sb) != -1 && S_ISREG(sb.st_mode) )
00283             {
00284                 CStr uppath, file;
00285                 SplitPath(fname, uppath, file);
00286                 fname = uppath;
00287             }
00288
00289             if( fname.endsWith(kPathDelimiter) )
00290                 fname[fname.length() - 1] = '\0';
00291
00292             dir = fname;
00293             result = true;
00294         }
00295     }
00296 #endif //}  qGTK
00297
00298     return result;
00299 }

bool BrowserGetMultiFiles | ( | const char * | prompt,
 |  | MultiFiles & | mf,
 |  | bool | single,
 |  | const kFilesSelectionType | selectionType
 | ) |

Get the set of files

Parameters:
prompt | Caption for the dialog
mf | Pass the initial file(single file only!) and directory, return the set of files, sorted by directory (class MultiFiles)
single | Set to true to allow the selection of a single file only, false for multi-selection
lpszFilter | Selection filter
Returns:
true on success, false otherwise

Definition at line 309 of file PromptFiles.cpp.

References MultiFiles::begin(), CStr, cvs_err(), CMfFileDialog::DoModal(), MultiFiles::end(), FILTER_ALL, FILTER_END, FILTER_EXECUTABLE, FILTER_SEPARATOR, kSelectExecutable, MultiFiles::newdir(), MultiFiles::newfile(), MultiFiles::reset(), SplitPath(), MultiFiles::TotalNumFiles(), and UFSSpec.

Referenced by CompatGetPrefs(), KiSelectionHandler::GetSelection(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), and CGetPrefs_WINCVS::OnExtdiffsel().

00311 {
00312     bool result = false;
00313
00314     // Extract the directory and file to select
00315     CStr selDir;    // Directory to be initially selected (browse starting from that directory)
00316     CStr selFile;   // File to be initially selected
00317
00318     // Check the passed file/directory
00319     if( mf.TotalNumFiles() > 0 )
00320     {
00321         MultiFiles::const_iterator mfi = mf.begin();
00322         if( mfi != mf.end() )
00323         {
00324             CvsArgs args(false);
00325             selDir = mfi->add(args);
00326
00327             // Single file passed - we can select it
00328             if( mf.TotalNumFiles() == 1 )
00329             {
00330                 CStr path;
00331                 CStr fileName;
00332                 CStr currRev;
00333
00334                 if( mfi->get(0, path, fileName, currRev) )
00335                 {
00336                     selFile = fileName;
00337                 }
00338             }
00339         }
00340     }
00341
00342     // Clear the selection object
00343     mf.reset();
00344
00345 #ifdef WIN32  //{ Win32 - Part
00346     const char* lpszFilter = FILTER_ALL FILTER_END;
00347     if( selectionType == kSelectExecutable )
00348     {
00349         lpszFilter = FILTER_EXECUTABLE FILTER_SEPARATOR FILTER_ALL FILTER_END;
00350     }
00351
00352     if( selDir.empty() )
00353     {
00354         // No selection specified, use current directory
00355         TCHAR curDir[_MAX_PATH] = { 0 };
00356         GetCurrentDirectory(_MAX_PATH-1, curDir);
00357         selDir = curDir;
00358     }
00359
00360     DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |  OFN_FILEMUSTEXIST;
00361     if( !single )
00362     {
00363         dwFlags |= OFN_ALLOWMULTISELECT;
00364     }
00365
00366     CMfFileDialog mfFileDialog(mf, NULL, selFile.c_str(), dwFlags, lpszFilter);
00367
00368     mfFileDialog.m_ofn.lpstrTitle = prompt;
00369     mfFileDialog.m_ofn.lpstrInitialDir = selDir.c_str();
00370
00371     if( mfFileDialog.DoModal() == IDOK )
00372     {
00373         result = true;
00374     }
00375 #endif //{ WIN32
00376
00377 #ifdef TARGET_OS_MAC   //{ Mac - Part
00378     Point apt = {-1, -1};
00379     Str255 pprompt;
00380
00381     c2pstrcpy(pprompt, prompt);
00382
00383     if(!SF_PromptForMFiles(apt, pprompt))
00384         return false;
00385
00386     SF_PFMF_INFO info;
00387     UFSSpec dirSpec;
00388
00389     SF_PFMF_BeginTraversal(&info);
00390     while( 1 )
00391     {
00392         if( !SF_PFMF_GetCurrentDir(&info, &dirSpec) )
00393             break;
00394
00395         char aPath[255];
00396         GUSIFileSpec spec = dirSpec;
00397         strcpy(aPath, spec.FullPath());
00398         if( spec.Error() == noErr )
00399         {
00400             mf.newdir(aPath);
00401
00402             if( SF_PFMF_DoTraversal(&info, true, (SF_PFMF_HOOK)MacEnumFiles_hook, &mf) )
00403             {
00404                 result = true;
00405             }
00406         }
00407         else
00408         {
00409             cvs_err("MacCvs: Unable to convert path name\n");
00410         }
00411
00412     }
00413     SF_PFMF_EndTraversal(&info);
00414
00415 #endif  //{ TARGET_OS_MAC
00416
00417 #ifdef qQT  //{ QT - Part
00418     QStringList s = QFileDialog::getOpenFileNames();
00419     vector<CStr> allpaths;
00420     QStringList::Iterator f;
00421     for(f = s.begin(); f != s.end(); f++)
00422     {
00423         allpaths.push_back(CStr(*f));
00424     }
00425
00426     if( allpaths.size() > 0 )
00427     {
00428         qsort(&allpaths[0], allpaths.size(), sizeof(CStr), (int(*)(const void*, const void*))compareCStr);
00429
00430         vector<CStr>::const_iterator i;
00431         CStr uppath, file, oldpath;
00432         for(i = allpaths.begin(); i != allpaths.end(); ++i)
00433         {
00434             SplitPath(*i, uppath, file);
00435             if( strcmp(uppath, oldpath) != 0 )
00436                 mf.newdir(uppath);
00437
00438             oldpath = uppath;
00439             mf.newfile(file);
00440         }
00441
00442         result = true;
00443     }
00444 #endif //} qQT
00445
00446 #ifdef qGTK  //{ GTK - Part
00447     /* Create a new file selection widget */
00448     GtkWidget* filew = gtk_file_selection_new(prompt);
00449
00450     gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00451         GTK_SIGNAL_FUNC(gtkcancel), 0L);
00452
00453     /* Connect the ok_button to file_ok_sel function */
00454     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00455         "clicked", (GtkSignalFunc) file_ok_sel, filew);
00456     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00457         "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00458
00459     gtkModalLoop = true;
00460     gtksel = "";
00461     gtk_widget_show(filew);
00462
00463     //{ WORKAROUND Bug 440874: Directory creation is not necessary in this file selection box
00464     gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filew));
00465     //{ WORKAROUND Bug 440874
00466
00467     gtk_grab_add(filew);
00468     while( gtkModalLoop )
00469     {
00470         gtk_main_iteration_do(TRUE);
00471     }
00472
00473     gtk_grab_remove (filew);
00474     gtk_widget_destroy(filew);
00475
00476     if( !gtksel.empty() )
00477     {
00478         CStr fname = gtksel;
00479         if( !fname.empty() )
00480         {
00481             CStr uppath, file;
00482             SplitPath(fname, uppath, file);
00483             mf.newdir(uppath);
00484             mf.newfile(file);
00485
00486             result = true;
00487         }
00488     }
00489 #endif //}  qGTK
00490
00491     return result;
00492 }

Generated on Fri Jan 31 12:10:28 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Enumerations

enum kFilesSelectionType {
kSelectAny,
kSelectExecutable
}
Get MultiFiles dialog type enum. More...

Functions

bool | BrowserGetDirectory (const char *prompt, CStr &dir, CWnd *pParentWnd=NULL)
bool | BrowserGetMultiFiles (const char *prompt, MultiFiles &mf, bool single, const kFilesSelectionType selectionType=kSelectAny)

Enumeration Type Documentation

enum kFilesSelectionType

Get MultiFiles dialog type enum.

Enumeration values:
kSelectAny | Any file can be selected
kSelectExecutable | Executable file can be selected

Definition at line 33 of file PromptFiles.h.

00034 {
00035     kSelectAny,
00036     kSelectExecutable
00037 } kFilesSelectionType;

Function Documentation

bool BrowserGetDirectory | ( | const char * | prompt,
 |  | CStr & | dir,
 |  | CWnd * | pParentWnd = NULL
 | ) |

Referenced by CompatGetCheckout(), CompatGetCommand(), CompatGetImport(), KiSelectionHandler::GetSelection(), glue_getenv(), CWincvsDoc::OnBrowserOpen(), UCvsFrame::OnBrowserPopup(), CGetPrefs_CVS::OnBtnhome(), CImport_OPTIONS::OnBtnpath(), CCheckout_MAIN::OnBtnPath(), CGetPrefs_WINCVS::OnBtnsettings(), and CCmdLine_MAIN::OnSelfolder().

bool BrowserGetMultiFiles | ( | const char * | prompt,
 |  | MultiFiles & | mf,
 |  | bool | single,
 |  | const kFilesSelectionType | selectionType
 | ) |

Get the set of files

Parameters:
prompt | Caption for the dialog
mf | Pass the initial file(single file only!) and directory, return the set of files, sorted by directory (class MultiFiles)
single | Set to true to allow the selection of a single file only, false for multi-selection
lpszFilter | Selection filter
Returns:
true on success, false otherwise

Definition at line 309 of file PromptFiles.cpp.

References MultiFiles::begin(), CStr, cvs_err(), CMfFileDialog::DoModal(), MultiFiles::end(), FILTER_ALL, FILTER_END, FILTER_EXECUTABLE, FILTER_SEPARATOR, kSelectExecutable, MultiFiles::newdir(), MultiFiles::newfile(), MultiFiles::reset(), SplitPath(), MultiFiles::TotalNumFiles(), and UFSSpec.

Referenced by CompatGetPrefs(), KiSelectionHandler::GetSelection(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), and CGetPrefs_WINCVS::OnExtdiffsel().

00311 {
00312     bool result = false;
00313
00314     // Extract the directory and file to select
00315     CStr selDir;    // Directory to be initially selected (browse starting from that directory)
00316     CStr selFile;   // File to be initially selected
00317
00318     // Check the passed file/directory
00319     if( mf.TotalNumFiles() > 0 )
00320     {
00321         MultiFiles::const_iterator mfi = mf.begin();
00322         if( mfi != mf.end() )
00323         {
00324             CvsArgs args(false);
00325             selDir = mfi->add(args);
00326
00327             // Single file passed - we can select it
00328             if( mf.TotalNumFiles() == 1 )
00329             {
00330                 CStr path;
00331                 CStr fileName;
00332                 CStr currRev;
00333
00334                 if( mfi->get(0, path, fileName, currRev) )
00335                 {
00336                     selFile = fileName;
00337                 }
00338             }
00339         }
00340     }
00341
00342     // Clear the selection object
00343     mf.reset();
00344
00345 #ifdef WIN32  //{ Win32 - Part
00346     const char* lpszFilter = FILTER_ALL FILTER_END;
00347     if( selectionType == kSelectExecutable )
00348     {
00349         lpszFilter = FILTER_EXECUTABLE FILTER_SEPARATOR FILTER_ALL FILTER_END;
00350     }
00351
00352     if( selDir.empty() )
00353     {
00354         // No selection specified, use current directory
00355         TCHAR curDir[_MAX_PATH] = { 0 };
00356         GetCurrentDirectory(_MAX_PATH-1, curDir);
00357         selDir = curDir;
00358     }
00359
00360     DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |  OFN_FILEMUSTEXIST;
00361     if( !single )
00362     {
00363         dwFlags |= OFN_ALLOWMULTISELECT;
00364     }
00365
00366     CMfFileDialog mfFileDialog(mf, NULL, selFile.c_str(), dwFlags, lpszFilter);
00367
00368     mfFileDialog.m_ofn.lpstrTitle = prompt;
00369     mfFileDialog.m_ofn.lpstrInitialDir = selDir.c_str();
00370
00371     if( mfFileDialog.DoModal() == IDOK )
00372     {
00373         result = true;
00374     }
00375 #endif //{ WIN32
00376
00377 #ifdef TARGET_OS_MAC   //{ Mac - Part
00378     Point apt = {-1, -1};
00379     Str255 pprompt;
00380
00381     c2pstrcpy(pprompt, prompt);
00382
00383     if(!SF_PromptForMFiles(apt, pprompt))
00384         return false;
00385
00386     SF_PFMF_INFO info;
00387     UFSSpec dirSpec;
00388
00389     SF_PFMF_BeginTraversal(&info);
00390     while( 1 )
00391     {
00392         if( !SF_PFMF_GetCurrentDir(&info, &dirSpec) )
00393             break;
00394
00395         char aPath[255];
00396         GUSIFileSpec spec = dirSpec;
00397         strcpy(aPath, spec.FullPath());
00398         if( spec.Error() == noErr )
00399         {
00400             mf.newdir(aPath);
00401
00402             if( SF_PFMF_DoTraversal(&info, true, (SF_PFMF_HOOK)MacEnumFiles_hook, &mf) )
00403             {
00404                 result = true;
00405             }
00406         }
00407         else
00408         {
00409             cvs_err("MacCvs: Unable to convert path name\n");
00410         }
00411
00412     }
00413     SF_PFMF_EndTraversal(&info);
00414
00415 #endif  //{ TARGET_OS_MAC
00416
00417 #ifdef qQT  //{ QT - Part
00418     QStringList s = QFileDialog::getOpenFileNames();
00419     vector<CStr> allpaths;
00420     QStringList::Iterator f;
00421     for(f = s.begin(); f != s.end(); f++)
00422     {
00423         allpaths.push_back(CStr(*f));
00424     }
00425
00426     if( allpaths.size() > 0 )
00427     {
00428         qsort(&allpaths[0], allpaths.size(), sizeof(CStr), (int(*)(const void*, const void*))compareCStr);
00429
00430         vector<CStr>::const_iterator i;
00431         CStr uppath, file, oldpath;
00432         for(i = allpaths.begin(); i != allpaths.end(); ++i)
00433         {
00434             SplitPath(*i, uppath, file);
00435             if( strcmp(uppath, oldpath) != 0 )
00436                 mf.newdir(uppath);
00437
00438             oldpath = uppath;
00439             mf.newfile(file);
00440         }
00441
00442         result = true;
00443     }
00444 #endif //} qQT
00445
00446 #ifdef qGTK  //{ GTK - Part
00447     /* Create a new file selection widget */
00448     GtkWidget* filew = gtk_file_selection_new(prompt);
00449
00450     gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00451         GTK_SIGNAL_FUNC(gtkcancel), 0L);
00452
00453     /* Connect the ok_button to file_ok_sel function */
00454     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00455         "clicked", (GtkSignalFunc) file_ok_sel, filew);
00456     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00457         "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00458
00459     gtkModalLoop = true;
00460     gtksel = "";
00461     gtk_widget_show(filew);
00462
00463     //{ WORKAROUND Bug 440874: Directory creation is not necessary in this file selection box
00464     gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filew));
00465     //{ WORKAROUND Bug 440874
00466
00467     gtk_grab_add(filew);
00468     while( gtkModalLoop )
00469     {
00470         gtk_main_iteration_do(TRUE);
00471     }
00472
00473     gtk_grab_remove (filew);
00474     gtk_widget_destroy(filew);
00475
00476     if( !gtksel.empty() )
00477     {
00478         CStr fname = gtksel;
00479         if( !fname.empty() )
00480         {
00481             CStr uppath, file;
00482             SplitPath(fname, uppath, file);
00483             mf.newdir(uppath);
00484             mf.newfile(file);
00485
00486             result = true;
00487         }
00488     }
00489 #endif //}  qGTK
00490
00491     return result;
00492 }

Generated on Fri Jan 31 12:10:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 PyErr_SetString.

Referenced by PyCvsEntry::Create(), PyColorConsole::Create(), PyMenuMgr::Create(), PyCmdUI::Create(), PyPersistent::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 )

Definition at line 110 of file PythonContainer.cpp.

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.

Generated on Fri Jan 31 12:10:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 30 of file PythonContainer.h.

#define USE_PYTHON 1

Definition at line 25 of file PythonContainer.h.

Typedef Documentation

typedef void(* PyRegistry_InitValues)(PyObject *d)

Definition at line 43 of file PythonContainer.h.

Variable Documentation

PyObject* gCvsguiErr

Definition at line 185 of file PythonContainer.h.

Generated on Fri Jan 31 12:10:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 <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 110 of file PythonGlue.cpp.

00111 {
00112     _stdout_style = 15,
00113     _stderr_style = 16,
00114     _trace_style = 17
00115 };

Function Documentation

PyObject* cvsgui_GetCvsEntries | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 358 of file PythonGlue.cpp.

References PyAutoObject< T >::CopyReturn(), ENTNODE::Data(), Entries_SetMissing(), FileTraverse(), CSortList< T >::Get(), PyAutoObject< T >::IsValid(), PyCvsEntry::New(), NULL, CSortList< T >::NumOfElements(), PyArg_ParseTuple, and PyTuple_New.

00359 {
00360     char *path;
00361
00362     if(!PyArg_ParseTuple(args, "s", &path))
00363         return NULL;
00364
00365     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00366     CFillPyEntries traverse(entries);
00367     /*kTraversal res = */FileTraverse(path, traverse);
00368
00369     // add the missing files
00370     Entries_SetMissing(entries);
00371
00372     int numEntries = entries.NumOfElements();
00373     PyObject *obj = PyTuple_New(numEntries);
00374     if(obj == NULL)
00375         return NULL;
00376
00377     for(int i = 0; i < numEntries; i++)
00378     {
00379         const ENTNODE & theNode = entries.Get(i);
00380         EntnodeData *data = theNode.Data();
00381
00382         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00383         if (!res.IsValid())
00384             return NULL;
00385
00386         res->m_object = new PyCvsEntry(data);
00387
00388         PyTuple_SET_ITEM(obj, i, res.CopyReturn());
00389     }
00390
00391     return obj;
00392 }

PyObject* cvsgui_GetFileModTime | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 399 of file PythonGlue.cpp.

References NULL, Py_BuildValue, PyArg_ParseTuple, PyErr_SetString, wnt_stat::st_mtime, and wnt_stat().

00400 {
00401     struct wnt_stat sb;
00402     struct tm * p_utc = NULL;
00403
00404     const char *path;
00405
00406 // PyObject_Length exists only for debugging version (ActiveState Python 2.1)
00407 #if defined(_DEBUG)
00408     int len = PyObject_Length(args);
00409     if (len < 1)
00410     {
00411         char errstr[255];
00412         sprintf(errstr, "Too few arguments (%d, expected 1)", len);
00413         PyErr_SetString(gCvsguiErr, errstr);
00414         return NULL;
00415     }
00416     else if (len > 1)
00417     {
00418         char errstr[255];
00419         sprintf(errstr, "Too many arguments (%d, expected 1)", len);
00420         PyErr_SetString(gCvsguiErr, errstr);
00421         return NULL;
00422     }
00423 #endif
00424
00425     if(!PyArg_ParseTuple(args, "s", &path))
00426         return NULL;
00427
00428     if (wnt_stat(path, &sb) != 0)
00429     {
00430         char errstr[255];
00431         sprintf(errstr, "Could not find file \"%s\"", path);
00432         PyErr_SetString(gCvsguiErr, errstr);
00433         return NULL;
00434     }
00435
00436     p_utc = gmtime(& sb.st_mtime);
00437     return Py_BuildValue("s", asctime(p_utc));
00438 }

PyObject* cvsgui_GetHistoryAsXML | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 721 of file PythonGlue.cpp.

References CvsLogParse(), GetPyFile_Type(), NULL, outputXML(), PyArg_ParseTuple, PyFile_AsFile, PyHandleCvsguiError(), and PyContainer::Void().

00722 {
00723     PyObject *logfile, *xmlfile;
00724
00725     if(!PyArg_ParseTuple(args, "O!O!", GetPyFile_Type(), &logfile,
00726         GetPyFile_Type(), &xmlfile))
00727             return NULL;
00728
00729     TRY
00730     {
00731         std::vector<CRcsFile> & allRcs = CvsLogParse(PyFile_AsFile(logfile));
00732
00733         std::vector<CRcsFile>::iterator i;
00734         FILE *xml = PyFile_AsFile(xmlfile);
00735         fputs("<ROOT>\n", xml);
00736         for(i = allRcs.begin(); i != allRcs.end(); ++i)
00737         {
00738             std::auto_ptr<CLogNode> node(CvsLogGraph(*i));
00739             outputXML(xml, node.get());
00740         }
00741         fputs("</ROOT>\n", xml);
00742
00743         CvsLogReset();
00744     }
00745     CATCH_ALL(e)
00746     {
00747         PyHandleCvsguiError(e);
00748         return NULL;
00749     }
00750     END_CATCH_ALL
00751
00752     return PyContainer::Void();
00753 }

PyObject* cvsgui_GetMainMenuWidget | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 143 of file PythonGlue.cpp.

References NULL, PyArg_ParseTuple, PyHandleCvsguiError(), and PyInt_FromLong.

00144 {
00145     int res = 0;
00146
00147     if(!PyArg_ParseTuple(args, ""))
00148         return NULL;
00149
00150     TRY
00151     {
00152     }
00153     CATCH_ALL(e)
00154     {
00155         PyHandleCvsguiError(e);
00156         return NULL;
00157     }
00158     END_CATCH_ALL
00159
00160     return PyInt_FromLong(res);
00161 }

PyObject* cvsgui_GetSelection | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 256 of file PythonGlue.cpp.

References PyAutoObject< T >::CopyReturn(), gUICache, gUICacheObj, PyAutoObject< T >::IsValid(), PyCvsEntry::New(), NULL, PyArg_ParseTuple, and PyTuple_New.

00257 {
00258     if(!PyArg_ParseTuple(args, ""))
00259         return NULL;
00260
00261     if(gUICacheObj != 0L)
00262     {
00263         Py_INCREF(gUICacheObj);
00264         return gUICacheObj;
00265     }
00266
00267     gUICacheObj = PyTuple_New(gUICache.size());
00268     if(gUICacheObj == NULL)
00269         return NULL;
00270
00271     std::vector<ENTNODE>::const_iterator i;
00272     int cnt;
00273     for(cnt = 0, i = gUICache.begin(); i != gUICache.end(); ++i, ++cnt)
00274     {
00275         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00276         if (!res.IsValid())
00277             return NULL;
00278
00279         res->m_object = new PyCvsEntry(*i);
00280
00281         PyTuple_SET_ITEM(gUICacheObj, cnt, res.CopyReturn());
00282     }
00283
00284     Py_INCREF(gUICacheObj);
00285     return gUICacheObj;
00286 }

PyObject* cvsgui_GetTopMacroAdminMenu | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 210 of file PythonGlue.cpp.

References PyAutoObject< T >::CopyReturn(), GetMenuEntry(), PyAutoObject< T >::IsValid(), PyMenuMgr::New(), NULL, PyArg_ParseTuple, PyHandleCvsguiError(), and UMENU.

00211 {
00212     static UMENU macroMenu = 0L;
00213
00214     if(!PyArg_ParseTuple(args, ""))
00215         return NULL;
00216
00217     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00218     if (!res.IsValid())
00219         return NULL;
00220
00221     TRY
00222     {
00223 #ifdef WIN32
00224         int pos;
00225         if(macroMenu == 0L)
00226         {
00227             CMenu *top = GetMenuEntry(ID_MACRO_ADMIN, pos);
00228             if(top)
00229             {
00230                 top->DeleteMenu(pos, MF_BYPOSITION);
00231                 macroMenu = (UMENU)(HMENU)*top;
00232             }
00233         }
00234 #endif
00235 #if qMacCvsPP
00236         if(macroMenu == 0L)
00237         {
00238             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00239             LMenu *menu = menuBar->FetchMenu(menu_MacroAdmin);
00240             if(menu)
00241                 macroMenu = menu->GetMenuID();
00242         }
00243 #endif
00244         res->m_object = new PyMenuMgr(macroMenu);
00245     }
00246     CATCH_ALL(e)
00247     {
00248         PyHandleCvsguiError(e);
00249         return NULL;
00250     }
00251     END_CATCH_ALL
00252
00253     return res.CopyReturn();
00254 }

PyObject* cvsgui_GetTopMacroSelectionMenu | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 163 of file PythonGlue.cpp.

References PyAutoObject< T >::CopyReturn(), GetMenuEntry(), PyAutoObject< T >::IsValid(), PyMenuMgr::New(), NULL, PyArg_ParseTuple, PyHandleCvsguiError(), and UMENU.

00164 {
00165     static UMENU macroMenu = 0L;
00166
00167     if(!PyArg_ParseTuple(args, ""))
00168         return NULL;
00169
00170     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00171     if (!res.IsValid())
00172         return NULL;
00173
00174     TRY
00175     {
00176 #ifdef WIN32
00177         int pos;
00178         if(macroMenu == 0L)
00179         {
00180             CMenu *top = GetMenuEntry(ID_MACRO_SEL, pos);
00181             if(top)
00182             {
00183                 top->DeleteMenu(pos, MF_BYPOSITION);
00184                 macroMenu = (UMENU)(HMENU)*top;
00185             }
00186         }
00187 #endif
00188 #if qMacCvsPP
00189         if(macroMenu == 0L)
00190         {
00191             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00192             LMenu *menu = menuBar->FetchMenu(menu_MacroSel);
00193             if(menu)
00194                 macroMenu = menu->GetMenuID();
00195         }
00196 #endif
00197
00198         res->m_object = new PyMenuMgr(macroMenu);
00199     }
00200     CATCH_ALL(e)
00201     {
00202         PyHandleCvsguiError(e);
00203         return NULL;
00204     }
00205     END_CATCH_ALL
00206
00207     return res.CopyReturn();
00208 }

PyObject* cvsgui_LaunchBrowser | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 590 of file PythonGlue.cpp.

References NULL, PyArg_ParseTuple, and PyContainer::Void().

00591 {
00592     char *url;
00593
00594     if(!PyArg_ParseTuple(args, "s", &url))
00595         return NULL;
00596
00597 #ifdef WIN32
00598     ShellExecute(NULL, "open", url, /*postData*/0L, NULL, SW_SHOWNORMAL);
00599 #endif
00600
00601     return PyContainer::Void();
00602 }

PyObject* cvsgui_LaunchTclMacro | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 441 of file PythonGlue.cpp.

References CStr, CTcl_Interp::DoScriptVar(), gUICache, CTcl_Interp::IsAvail(), NULL, PyArg_ParseTuple, TclBrowserAppend(), TclBrowserReset(), CTcl_Interp::Unixfy(), and PyContainer::Void().

00442 {
00443     char *macroName;
00444
00445     if(!PyArg_ParseTuple(args, "s", &macroName) || !CTcl_Interp::IsAvail())
00446         return NULL;
00447
00448     std::vector<ENTNODE>::const_iterator i;
00449     TclBrowserReset();
00450     for(i = gUICache.begin(); i != gUICache.end(); ++i)
00451     {
00452         EntnodeData *data = *i;
00453         TclBrowserAppend((*data)[EntnodeData::kPath], data);
00454     }
00455
00456     CTcl_Interp interp;
00457     CStr path = macroName;
00458     CTcl_Interp::Unixfy(path);
00459     interp.DoScriptVar("source \"%s\"", (const char *)path);
00460
00461     return PyContainer::Void();
00462 }

PyObject* cvsgui_PromptEditMessage | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 565 of file PythonGlue.cpp.

References UStr::c_str(), UStr::empty(), NULL, PromptEditMessage(), Py_BuildValue, PyArg_ParseTuple, and PyHandleCvsguiError().

00566 {
00567     char *msg, *title, *ok, *cncl, *edit;
00568
00569     if(!PyArg_ParseTuple(args, "sssss", &msg, &edit, &title, &ok, &cncl))
00570         return NULL;
00571
00572     bool res;
00573     UStr ed;
00574
00575     TRY
00576     {
00577         ed = edit;
00578         res = PromptEditMessage(msg, ed, title, ok, cncl);
00579     }
00580     CATCH_ALL(e)
00581     {
00582         PyHandleCvsguiError(e);
00583         return NULL;
00584     }
00585     END_CATCH_ALL
00586
00587     return Py_BuildValue("(is)", res ? 1 : 0, ed.empty() ? "" : ed.c_str());
00588 }

PyObject* cvsgui_PromptMessage | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 537 of file PythonGlue.cpp.

References PyContainer::False(), NULL, PromptMessage(), PyArg_ParseTuple, PyHandleCvsguiError(), and PyContainer::True().

00538 {
00539     char *msg, *title, *ok, *cncl;
00540
00541     if(!PyArg_ParseTuple(args, "ssss", &msg, &title, &ok, &cncl))
00542         return NULL;
00543
00544     bool res;
00545
00546     TRY
00547     {
00548         res = PromptMessage(msg, title, ok, cncl);
00549     }
00550     CATCH_ALL(e)
00551     {
00552         PyHandleCvsguiError(e);
00553         return NULL;
00554     }
00555     END_CATCH_ALL
00556
00557     if(res)
00558     {
00559         return PyContainer::True();
00560     }
00561
00562     return PyContainer::False();
00563 }

PyObject* cvsgui_RunCvs | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 755 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().

00756 {
00757     CvsArgs arg;
00758     PyObject *cargs;
00759     int exitOnError = 1;
00760     int exitc;
00761     CPyCvsConsole console;
00762
00763     if(!PyArg_ParseTuple(args, "O!|i", GetPyTuple_Type(), &cargs, &exitOnError))
00764         return NULL;
00765
00766     TRY
00767     {
00768         int argc = PyTuple_Size(cargs);
00769         for(int i = 0; i < argc; i++)
00770         {
00771             PyObject *o = PyTuple_GET_ITEM(cargs, i);
00772             if(!PyString_Check(o))
00773             {
00774                 PyErr_SetString(gCvsguiErr, "Wrong argument type, should be string");
00775                 return NULL;
00776             }
00777
00778             arg.add(PyString_AsString(o));
00779         }
00780
00781         exitc = launchCVS(0L, arg.Argc(), arg.Argv(), &console);
00782
00783         if(exitOnError && exitc != 0)
00784         {
00785             UStr str;
00786             str.set(console.m_err, console.m_err.size());
00787             str << "cvs returned an non-zero error code (";
00788             str << exitc;
00789             str << ")\n";
00790             PyErr_SetString(gCvsguiErr, str);
00791             return NULL;
00792         }
00793     }
00794     CATCH_ALL(e)
00795     {
00796         PyHandleCvsguiError(e);
00797         return NULL;
00798     }
00799     END_CATCH_ALL
00800
00801     return Py_BuildValue("(is#s#)", exitc, (char *)console.m_out, console.m_out.size(),
00802         (char *)console.m_err, console.m_err.size());
00803 }

PyObject* cvsgui_write | ( | PyObject * | self,
 |  | PyObject * | args
 | ) | [static]

Definition at line 117 of file PythonGlue.cpp.

References _stdout_style, cvs_errstr(), cvs_outstr(), NULL, PyArg_ParseTuple, PyHandleCvsguiError(), and PyContainer::Void().

00118 {
00119     char *str;
00120     int style;
00121     PyObject *shell;
00122
00123     if(!PyArg_ParseTuple(args, "siO", &str, &style, &shell))
00124         return NULL;
00125
00126     TRY
00127     {
00128         if(style == _stdout_style)
00129             cvs_outstr(str, strlen(str));
00130         else
00131             cvs_errstr(str, strlen(str));
00132     }
00133     CATCH_ALL(e)
00134     {
00135         PyHandleCvsguiError(e);
00136         return NULL;
00137     }
00138     END_CATCH_ALL
00139
00140     return PyContainer::Void();
00141 }

void InitializeInterp ( PyThreadState * interp ) [static]

Definition at line 827 of file PythonGlue.cpp.

References PyRegistry::CallInitValues(), CStr, cvs_err(), cvsgui_methods, free, gAllMethods, malloc, NULL, Py_GetPath, Py_InitModule4, PyDict_SetItemString, PyErr_NewException, PyModule_GetDict, PyRun_SimpleString, PyString_FromString, PySys_SetPath, PythonLibGetLoc(), and PyRegistry::RegisterAllObjects().

Referenced by CPython_Interp::CPython_Interp(), and CPython_Interp::InitPythonSupport().

00828 {
00829     CPyThreadState lock(interp);
00830
00831     // first time, create the method table for cvsgui module
00832     if(gAllMethods.empty())
00833     {
00834         PyMethodDef *tmp = cvsgui_methods;
00835         while(tmp->ml_name)
00836         {
00837             gAllMethods.push_back(*tmp);
00838             tmp++;
00839         }
00840
00841         PyRegistry::RegisterAllObjects(gAllMethods);
00842     }
00843
00844     // this module contains the glue code functions
00845     PyObject *m = Py_InitModule4("_cvsgui", &gAllMethods[0],
00846         "The cvsgui glue functions", (PyObject*)NULL,PYTHON_API_VERSION);
00847
00848     if(m == NULL)
00849     {
00850         cvs_err("Could not create the Python cvsgui module !\n");
00851         return;
00852     }
00853
00854     // this is the exception we raised when the error comes from us
00855     PyObject *d = PyModule_GetDict(m);
00856     if(gCvsguiErr == NULL)
00857         gCvsguiErr = PyErr_NewException("_cvsgui.error", NULL, NULL);
00858     if (gCvsguiErr != NULL)
00859         PyDict_SetItemString(d, "error", gCvsguiErr);
00860
00861     PyRegistry::CallInitValues(d);
00862
00863     // Ideally we need to use Jonathan's mechanism
00864     PyObject *ver = PyString_FromString("1.3");
00865     if (ver != NULL) {
00866         PyDict_SetItemString(d, "CVSGUI_VERSION", ver);
00867         Py_DECREF(ver);
00868     }
00869
00870     char *script = NULL;
00871
00872 #ifdef WIN32
00873     HINSTANCE hInst = ::AfxGetInstanceHandle();
00874     HRSRC rsrc = FindResource(hInst, "PYSHELL", "PYSCRIPT");
00875
00876     if(rsrc)
00877     {
00878         HGLOBAL h = LoadResource(hInst, rsrc);
00879         if(h)
00880         {
00881             DWORD size = SizeofResource(hInst, rsrc);
00882             script = (char *)malloc(size + 1);
00883             char *ptr = (char *)LockResource(h);
00884
00885             if(script)
00886             {
00887                 char *tmp = script;
00888                 while(size--)
00889                 {
00890                     char c = *ptr++;
00891                     if(c == '\r')
00892                         continue;
00893                     *tmp++ = c;
00894                 }
00895                 *tmp = '\0';
00896             }
00897
00898             FreeResource(h);
00899         }
00900     }
00901
00902 #endif // WIN32
00903 #if qMacCvsPP
00904     StResource rsrcH(FOUR_CHAR_CODE('PYTH'), 128);
00905     size_t size = GetHandleSize(rsrcH);
00906     script = (char *)malloc(size + 1);
00907     if(script)
00908     {
00909         char *ptr = (char *)*rsrcH;
00910         char *tmp = script;
00911         while(size--)
00912         {
00913             char c = *ptr++;
00914             if(c == '\r')
00915                 c = '\n';
00916             *tmp++ = c;
00917         }
00918         *tmp = '\0';
00919     }
00920 #endif
00921
00922     // augment the library path of python with our library
00923     CStr ourLibPath;
00924     PythonLibGetLoc(ourLibPath);
00925
00926     UStr libPath = Py_GetPath();
00927     if(!ourLibPath.empty())
00928     {
00929         libPath << DELIM;
00930         libPath << ourLibPath;
00931         PySys_SetPath((char *)(const char *)libPath);
00932     }
00933
00934     // this is the script to setup stdout/stderr and reroute it
00935     // to the console window
00936     if(script)
00937     {
00938         PyRun_SimpleString(script);
00939
00940         free(script);
00941     }
00942     else
00943     {
00944         cvs_err("Could not initialize properly the Python interpreter !\n");
00945     }
00946 }

void outputXML | ( | FILE * | out,
 |  | CLogNode * | node
 | ) | [static]

Definition at line 604 of file PythonGlue.cpp.

Referenced by cvsgui_GetHistoryAsXML().

00605 {
00606     switch(node->GetType())
00607     {
00608         case kNodeHeader :
00609         {
00610             fputs("<RCS>\n", out);
00611             const CRcsFile rcs = **(CLogNodeHeader *)node;
00612             fprintf(out, "<RCSFILE>%s</RCSFILE>\n", rcs.RcsFile().c_str());
00613             fprintf(out, "<WORKINGFILE>%s</WORKINGFILE>\n", rcs.WorkingFile().c_str());
00614             fprintf(out, "<HEADREV>%s</HEADREV>\n", rcs.HeadRev().c_str());
00615             fprintf(out, "<BRANCHREV>%s</BRANCHREV>\n", rcs.BranchRev().c_str());
00616             fprintf(out, "<KEYWORDSUBST>%s</KEYWORDSUBST>\n", rcs.KeywordSubst().c_str());
00617             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rcs.DescLog().c_str());
00618             fprintf(out, "<SELREVISIONS>%d</SELREVISIONS>\n", rcs.SelRevisions());
00619             fprintf(out, "<TOTREVISIONS>%d</TOTREVISIONS>\n", rcs.TotRevisions());
00620             fprintf(out, "<LOCKSTRICT>%d</LOCKSTRICT>\n", rcs.LockStrict() ? 1 : 0);
00621
00622             fputs("<ACCESSLIST>\n", out);
00623             const std::vector<CLogStr> & ac = rcs.AccessList();
00624             std::vector<CLogStr>::const_iterator i;
00625             for(i = ac.begin(); i != ac.end(); ++i)
00626             {
00627                 fprintf(out, "<ACCESS>%s</ACCESS>\n", (*i).c_str());
00628             }
00629             fputs("</ACCESSLIST>\n", out);
00630
00631             fputs("<SYMBOLICLIST>\n", out);
00632             const std::vector<CRevNumber> & sy = rcs.SymbolicList();
00633             std::vector<CRevNumber>::const_iterator j;
00634             for(j = sy.begin(); j != sy.end(); ++j)
00635             {
00636                 fprintf(out, "<SYMBOLIC>%s</SYMBOLIC>\n", (*j).c_str());
00637             }
00638             fputs("</SYMBOLICLIST>\n", out);
00639
00640             fputs("<LOCKLIST>\n", out);
00641             const std::vector<CRevNumber> & lo = rcs.LocksList();
00642             for(j = lo.begin(); j != lo.end(); ++j)
00643             {
00644                 fprintf(out, "<LOCK>%s</LOCK>\n", (*j).c_str());
00645             }
00646             fputs("</LOCKLIST>\n", out);
00647             break;
00648         }
00649         case kNodeRev :
00650         {
00651             const CRevFile & rev = **(CLogNodeRev *)node;
00652             fputs("<REVISION>\n", out);
00653             fprintf(out, "<NUMBER>%s</NUMBER>\n", rev.RevNum().c_str());
00654             const struct tm & tm = rev.RevTime();
00655             fprintf(out, "<DATE>%d/%d/%d %d:%d:%d</DATE>\n", (tm.tm_year + 1900),
00656                 tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
00657             fprintf(out, "<AUTHOR>%s</AUTHOR>\n", rev.Author().c_str());
00658             fprintf(out, "<STATE>%s</STATE>\n", rev.State().c_str());
00659             fprintf(out, "<CHANGES>+%d%d</CHANGES>\n", rev.ChgPos(), rev.ChgNeg());
00660             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rev.DescLog().c_str());
00661
00662             fputs("<BRANCHLIST>\n", out);
00663             const std::vector<CRevNumber> & sy = rev.BranchesList();
00664             std::vector<CRevNumber>::const_iterator j;
00665             for(j = sy.begin(); j != sy.end(); ++j)
00666             {
00667                 fprintf(out, "<REVBRANCH>%s</REVBRANCH>\n", (*j).c_str());
00668             }
00669             fputs("</BRANCHLIST>\n", out);
00670             break;
00671         }
00672         case kNodeBranch :
00673         {
00674             fputs("<BRANCH>\n", out);
00675             const CLogStr & branch = **(CLogNodeBranch *)node;
00676             fprintf(out, "<BRANCHNAME>%s</BRANCHNAME>\n", branch.c_str());
00677             break;
00678         }
00679         case kNodeTag :
00680         {
00681             fputs("<TAG>\n", out);
00682             const CLogStr & tag = **(CLogNodeTag *)node;
00683             fprintf(out, "<TAGNAME>%s</TAGNAME>\n", tag.c_str());
00684             break;
00685         }
00686     }
00687
00688     if(node->Childs().size() > 0)
00689     {
00690         fputs("<REVISIONS>\n", out);
00691         std::vector<CLogNode *>::const_iterator i;
00692         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00693         {
00694             outputXML(out, *i);
00695         }
00696         fputs("</REVISIONS>\n", out);
00697     }
00698
00699     switch(node->GetType())
00700     {
00701         case kNodeHeader :
00702             fputs("</RCS>\n", out);
00703             break;
00704         case kNodeRev :
00705             fputs("</REVISION>\n", out);
00706             break;
00707         case kNodeBranch :
00708             fputs("</BRANCH>\n", out);
00709             break;
00710         case kNodeTag :
00711             fputs("</TAG>\n", out);
00712             break;
00713     }
00714
00715     if(node->Next() != 0L)
00716     {
00717         outputXML(out, node->Next());
00718     }
00719 }

void PyAppendCache ( EntnodeData * data )

Definition at line 1266 of file PythonGlue.cpp.

References gUICache, gUICacheObj, and gUICacheValid.

Referenced by CBrowseFileView::OnUpdateMacro(), and CWinCvsBrowser::OnUpdateMacro().

01267 {
01268 #if USE_PYTHON
01269     Py_XDECREF(gUICacheObj);
01270     gUICacheObj = 0L;
01271     gUICache.push_back(ENTNODE(data));
01272     gUICacheValid = true;
01273 #endif
01274 }

void PyDoCmdUI ( UCmdUI * ucmdui )

Definition at line 1225 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar().

Referenced by CBrowseFileView::OnUpdateMacro(), and CWinCvsBrowser::OnUpdateMacro().

01226 {
01227     CPython_Interp interp;
01228     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01229         "from cvsgui.CmdUI import *; "
01230         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01231 }

void PyDoPython ( int cmd )

Definition at line 1233 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar().

Referenced by CBrowseFileView::OnMacro(), and CWinCvsBrowser::OnMacro().

01234 {
01235     CPython_Interp interp;
01236     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01237         "gMacroRegistry.DoCmd(%d)", cmd);
01238 }

void PyInvalUICache ( )

Definition at line 1256 of file PythonGlue.cpp.

References gUICache, gUICacheObj, and gUICacheValid.

Referenced by CPython_Interp::ClosePythonSupport(), CWincvsApp::PreTranslateMessage(), and CWincvsView::~CWincvsView().

01257 {
01258 #if USE_PYTHON
01259     gUICache.erase(gUICache.begin(), gUICache.end());
01260     gUICacheValid = false;
01261     Py_XDECREF(gUICacheObj);
01262     gUICacheObj = 0L;
01263 #endif
01264 }

bool PyIsUICacheValid ( )

Definition at line 1240 of file PythonGlue.cpp.

References gUICacheValid.

Referenced by CWinCvsBrowser::OnUpdateMacro(), and CBrowseFileView::OnUpdateMacro().

01241 {
01242 #if USE_PYTHON
01243     return gUICacheValid;
01244 #else
01245     return false;
01246 #endif
01247 }

void PyMacrosReloadAll ( void )

Definition at line 1208 of file PythonGlue.cpp.

References UStr::c_str(), CPython_Interp::DoScriptVar(), and MacrosGetLoc().

Referenced by CWincvsApp::InitInstance().

01209 {
01210     // get the macro folder
01211     UStr path;
01212     MacrosGetLoc(path);
01213
01214 #ifdef WIN32
01215     CString newpath(path);
01216     newpath.Replace("\\", "\\\\");
01217     path = newpath;
01218 #endif
01219
01220     CPython_Interp interp;
01221     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01222         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01223 }

void PyValidUICache ( )

Definition at line 1249 of file PythonGlue.cpp.

References gUICacheValid.

01250 {
01251 #if USE_PYTHON
01252     gUICacheValid = true;
01253 #endif
01254 }

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 805 of file PythonGlue.cpp.

Referenced by InitializeInterp().

std::vector<PyMethodDef> gAllMethods [static]

Definition at line 825 of file PythonGlue.cpp.

Referenced by InitializeInterp().

std::vector<ENTNODE> gUICache [static]

Definition at line 92 of file PythonGlue.cpp.

Referenced by cvsgui_GetSelection(), cvsgui_LaunchTclMacro(), PyAppendCache(), and PyInvalUICache().

PyObject* gUICacheObj = NULL [static]

Definition at line 93 of file PythonGlue.cpp.

Referenced by cvsgui_GetSelection(), PyAppendCache(), and PyInvalUICache().

bool gUICacheValid = false [static]

Definition at line 91 of file PythonGlue.cpp.

Referenced by PyAppendCache(), PyInvalUICache(), PyIsUICacheValid(), and PyValidUICache().

Generated on Fri Jan 31 12:10:31 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Function Documentation

void PyAppendCache ( EntnodeData * data )

Definition at line 1266 of file PythonGlue.cpp.

References gUICache, gUICacheObj, and gUICacheValid.

Referenced by CWinCvsBrowser::OnUpdateMacro(), and CBrowseFileView::OnUpdateMacro().

01267 {
01268 #if USE_PYTHON
01269     Py_XDECREF(gUICacheObj);
01270     gUICacheObj = 0L;
01271     gUICache.push_back(ENTNODE(data));
01272     gUICacheValid = true;
01273 #endif
01274 }

void PyDoCmdUI ( UCmdUI * ucmdui )

Definition at line 1225 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar().

Referenced by CWinCvsBrowser::OnUpdateMacro(), and CBrowseFileView::OnUpdateMacro().

01226 {
01227     CPython_Interp interp;
01228     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01229         "from cvsgui.CmdUI import *; "
01230         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01231 }

void PyDoPython ( int cmd )

Definition at line 1233 of file PythonGlue.cpp.

References CPython_Interp::DoScriptVar().

Referenced by CWinCvsBrowser::OnMacro(), and CBrowseFileView::OnMacro().

01234 {
01235     CPython_Interp interp;
01236     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01237         "gMacroRegistry.DoCmd(%d)", cmd);
01238 }

void PyInvalUICache ( )

Definition at line 1256 of file PythonGlue.cpp.

References gUICache, gUICacheObj, and gUICacheValid.

Referenced by CPython_Interp::ClosePythonSupport(), CWincvsApp::PreTranslateMessage(), and CWincvsView::~CWincvsView().

01257 {
01258 #if USE_PYTHON
01259     gUICache.erase(gUICache.begin(), gUICache.end());
01260     gUICacheValid = false;
01261     Py_XDECREF(gUICacheObj);
01262     gUICacheObj = 0L;
01263 #endif
01264 }

bool PyIsUICacheValid ( )

Definition at line 1240 of file PythonGlue.cpp.

References gUICacheValid.

Referenced by CBrowseFileView::OnUpdateMacro(), and CWinCvsBrowser::OnUpdateMacro().

01241 {
01242 #if USE_PYTHON
01243     return gUICacheValid;
01244 #else
01245     return false;
01246 #endif
01247 }

void PyMacrosReloadAll ( void )

Definition at line 1208 of file PythonGlue.cpp.

References UStr::c_str(), CPython_Interp::DoScriptVar(), and MacrosGetLoc().

Referenced by CWincvsApp::InitInstance().

01209 {
01210     // get the macro folder
01211     UStr path;
01212     MacrosGetLoc(path);
01213
01214 #ifdef WIN32
01215     CString newpath(path);
01216     newpath.Replace("\\", "\\\\");
01217     path = newpath;
01218 #endif
01219
01220     CPython_Interp interp;
01221     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01222         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01223 }

void PyValidUICache ( )

Definition at line 1249 of file PythonGlue.cpp.

References gUICacheValid.

01250 {
01251 #if USE_PYTHON
01252     gUICacheValid = true;
01253 #endif
01254 }

Generated on Fri Jan 31 12:10:31 2003 for WinCvs Source by doxygen 1.3-rc2


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_Free GLUE_WRAP(PyObject_Free)
#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_Free_glue )(void *)
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_New GLUE_WRAP(_PyObject_New)

Definition at line 106 of file PythonGlue.impl.h.

#define DEC_GLUE ( f ) (*f##_glue)

Definition at line 33 of file PythonGlue.impl.h.

#define GLUE_WRAP ( f ) f##_glue

Definition at line 79 of file PythonGlue.impl.h.

#define Py_BuildValue GLUE_WRAP(Py_BuildValue)

Definition at line 88 of file PythonGlue.impl.h.

Referenced by cvsgui_GetFileModTime(), cvsgui_PromptEditMessage(), and cvsgui_RunCvs().

#define Py_EndInterpreter GLUE_WRAP(Py_EndInterpreter)

Definition at line 99 of file PythonGlue.impl.h.

Referenced by CPython_Interp::~CPython_Interp().

#define Py_Finalize GLUE_WRAP(Py_Finalize)

Definition at line 96 of file PythonGlue.impl.h.

Referenced by CPython_Interp::ClosePythonSupport().

#define Py_FindMethod GLUE_WRAP(Py_FindMethod)

Definition at line 105 of file PythonGlue.impl.h.

#define Py_GetPath GLUE_WRAP(Py_GetPath)

Definition at line 113 of file PythonGlue.impl.h.

Referenced by InitializeInterp().

#define Py_Initialize GLUE_WRAP(Py_Initialize)

Definition at line 95 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport().

#define Py_InitModule4 GLUE_WRAP(Py_InitModule4)

Definition at line 103 of file PythonGlue.impl.h.

Referenced by InitializeInterp().

#define Py_IsInitialized GLUE_WRAP(Py_IsInitialized)

Definition at line 97 of file PythonGlue.impl.h.

#define Py_NewInterpreter GLUE_WRAP(Py_NewInterpreter)

Definition at line 98 of file PythonGlue.impl.h.

Referenced by CPython_Interp::CPython_Interp().

#define Py_SetProgramName GLUE_WRAP(Py_SetProgramName)

Definition at line 94 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport().

#define PyArg_ParseTuple GLUE_WRAP(PyArg_ParseTuple)

Definition at line 86 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(), PyColorConsole::Print(), PyCmdUI::SetCheck(), PyCmdUI::SetText(), and PyPersistent::SetValue().

#define PyDict_SetItemString GLUE_WRAP(PyDict_SetItemString)

Definition at line 82 of file PythonGlue.impl.h.

Referenced by InitializeInterp(), and PyContainer::RegisterValue().

#define PyErr_Clear GLUE_WRAP(PyErr_Clear)

Definition at line 83 of file PythonGlue.impl.h.

Referenced by PyColorConsole::Print(), and PyContainer::RegisterValue().

#define PyErr_NewException GLUE_WRAP(PyErr_NewException)

Definition at line 101 of file PythonGlue.impl.h.

Referenced by InitializeInterp().

#define PyErr_SetString GLUE_WRAP(PyErr_SetString)

Definition at line 85 of file PythonGlue.impl.h.

Referenced by cvsgui_GetFileModTime(), cvsgui_RunCvs(), and PyHandleCvsguiError().

#define PyEval_InitThreads GLUE_WRAP(PyEval_InitThreads)

Definition at line 104 of file PythonGlue.impl.h.

Referenced by CPython_Interp::InitPythonSupport().

#define PyFile_AsFile GLUE_WRAP(PyFile_AsFile)

Definition at line 89 of file PythonGlue.impl.h.

Referenced by cvsgui_GetHistoryAsXML().

#define PyInt_Check ( op ) ((op)->ob_type == GetPyInt_Type())

Definition at line 129 of file PythonGlue.impl.h.

#define PyInt_FromLong GLUE_WRAP(PyInt_FromLong)

Definition at line 84 of file PythonGlue.impl.h.

Referenced by PyMenuMgr::Count(), cvsgui_GetMainMenuWidget(), and PyContainer::RegisterValue().

#define PyModule_GetDict GLUE_WRAP(PyModule_GetDict)

Definition at line 102 of file PythonGlue.impl.h.

Referenced by InitializeInterp().

#define PyObject_Free GLUE_WRAP(PyObject_Free)

Definition at line 110 of file PythonGlue.impl.h.

#define PyRun_SimpleFile GLUE_WRAP(PyRun_SimpleFile)

Definition at line 93 of file PythonGlue.impl.h.

Referenced by CPython_Interp::DoFile().

#define PyRun_SimpleString GLUE_WRAP(PyRun_SimpleString)

Definition at line 92 of file PythonGlue.impl.h.

Referenced by CPython_Interp::DoScript(), and InitializeInterp().

#define PyString_AsString GLUE_WRAP(PyString_AsString)

Definition at line 90 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs().

#define PyString_Check ( op ) ((op)->ob_type == GetPyString_Type())

Definition at line 125 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs().

#define PyString_FromString GLUE_WRAP(PyString_FromString)

Definition at line 100 of file PythonGlue.impl.h.

Referenced by PyCvsEntry::GetAttr(), PyPersistent::GetValue(), and InitializeInterp().

#define PySys_SetPath GLUE_WRAP(PySys_SetPath)

Definition at line 112 of file PythonGlue.impl.h.

Referenced by InitializeInterp().

#define PYTHONGLUE_EXTERN extern

Definition at line 29 of file PythonGlue.impl.h.

#define PyThreadState_Swap GLUE_WRAP(PyThreadState_Swap)

Definition at line 81 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 127 of file PythonGlue.impl.h.

#define PyTuple_New GLUE_WRAP(PyTuple_New)

Definition at line 87 of file PythonGlue.impl.h.

Referenced by cvsgui_GetCvsEntries(), and cvsgui_GetSelection().

#define PyTuple_Size GLUE_WRAP(PyTuple_Size)

Definition at line 91 of file PythonGlue.impl.h.

Referenced by cvsgui_RunCvs().

#define VAR_GLUE ( f ) f##_glue

Definition at line 34 of file PythonGlue.impl.h.

Function Documentation

PyObject* GetPyFalse ( )

Definition at line 504 of file PythonImpl.cpp.

References _Py_ZeroStruct_glue.

Referenced by PyContainer::False().

00505 {
00506     return _Py_ZeroStruct_glue;
00507 }

PyTypeObject* GetPyFile_Type ( )

Definition at line 474 of file PythonImpl.cpp.

References PyFile_Type_glue.

Referenced by cvsgui_GetHistoryAsXML().

00475 {
00476     return PyFile_Type_glue;
00477 }

PyTypeObject* GetPyInt_Type ( )

Definition at line 489 of file PythonImpl.cpp.

References PyInt_Type_glue.

00490 {
00491     return PyInt_Type_glue;
00492 }

PyObject* GetPyNone ( )

Definition at line 494 of file PythonImpl.cpp.

References _Py_NoneStruct_glue.

Referenced by PyContainer::Void().

00495 {
00496     return _Py_NoneStruct_glue;
00497 }

PyTypeObject* GetPyString_Type ( )

Definition at line 479 of file PythonImpl.cpp.

References PyString_Type_glue.

00480 {
00481     return PyString_Type_glue;
00482 }

PyObject* GetPyTrue ( )

Definition at line 499 of file PythonImpl.cpp.

References _Py_TrueStruct_glue.

Referenced by PyContainer::True().

00500 {
00501     return _Py_TrueStruct_glue;
00502 }

PyTypeObject* GetPyTuple_Type ( )

Definition at line 484 of file PythonImpl.cpp.

References PyTuple_Type_glue.

Referenced by cvsgui_RunCvs().

00485 {
00486     return PyTuple_Type_glue;
00487 }

PyTypeObject* GetPyType_Type ( )

Definition at line 469 of file PythonImpl.cpp.

References PyType_Type_glue.

Referenced by PyRegistry::PyRegistry().

00470 {
00471     return PyType_Type_glue;
00472 }

Variable Documentation

PyObject* _Py_NoneStruct_glue

Definition at line 75 of file PythonGlue.impl.h.

Referenced by GetPyNone().

PyObject* _Py_TrueStruct_glue

Definition at line 77 of file PythonGlue.impl.h.

Referenced by GetPyTrue().

PyObject* _Py_ZeroStruct_glue

Definition at line 76 of file PythonGlue.impl.h.

Referenced by GetPyFalse().

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 68 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 71 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 74 of file PythonGlue.impl.h.

Referenced by GetPyInt_Type().

PyObject*(* PyModule_GetDict_glue)(PyObject *)

Definition at line 57 of file PythonGlue.impl.h.

void(* PyObject_Free_glue)(void *)

Definition at line 65 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 72 of file PythonGlue.impl.h.

Referenced by GetPyString_Type().

void(* PySys_SetPath_glue)(char *)

Definition at line 67 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 73 of file PythonGlue.impl.h.

Referenced by GetPyTuple_Type().

PyTypeObject* PyType_Type_glue

Definition at line 70 of file PythonGlue.impl.h.

Referenced by GetPyType_Type().

Generated on Fri Jan 31 12:10:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 466 of file PythonImpl.cpp.

Function Documentation

PyObject* GetPyFalse ( )

Definition at line 504 of file PythonImpl.cpp.

References _Py_ZeroStruct_glue.

Referenced by PyContainer::False().

00505 {
00506     return _Py_ZeroStruct_glue;
00507 }

PyTypeObject* GetPyFile_Type ( )

Definition at line 474 of file PythonImpl.cpp.

References PyFile_Type_glue.

Referenced by cvsgui_GetHistoryAsXML().

00475 {
00476     return PyFile_Type_glue;
00477 }

PyTypeObject* GetPyInt_Type ( )

Definition at line 489 of file PythonImpl.cpp.

References PyInt_Type_glue.

00490 {
00491     return PyInt_Type_glue;
00492 }

PyObject* GetPyNone ( )

Definition at line 494 of file PythonImpl.cpp.

References _Py_NoneStruct_glue.

Referenced by PyContainer::Void().

00495 {
00496     return _Py_NoneStruct_glue;
00497 }

PyTypeObject* GetPyString_Type ( )

Definition at line 479 of file PythonImpl.cpp.

References PyString_Type_glue.

00480 {
00481     return PyString_Type_glue;
00482 }

PyObject* GetPyTrue ( )

Definition at line 499 of file PythonImpl.cpp.

References _Py_TrueStruct_glue.

Referenced by PyContainer::True().

00500 {
00501     return _Py_TrueStruct_glue;
00502 }

PyTypeObject* GetPyTuple_Type ( )

Definition at line 484 of file PythonImpl.cpp.

References PyTuple_Type_glue.

Referenced by cvsgui_RunCvs().

00485 {
00486     return PyTuple_Type_glue;
00487 }

PyTypeObject* GetPyType_Type ( )

Definition at line 469 of file PythonImpl.cpp.

References PyType_Type_glue.

Referenced by PyRegistry::PyRegistry().

00470 {
00471     return PyType_Type_glue;
00472 }

int ParseUMENU | ( | PyObject * | v,
 |  | UMENU * | menu
 | ) | [static]

Definition at line 196 of file PythonImpl.cpp.

References PyMenuMgr::GetType().

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 Fri Jan 31 12:10:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 | obj_t
struct | obj_t
class | PyCmdUI
struct | obj_t
struct | obj_t
class | PyColorConsole
struct | obj_t
class | PyCvsEntry
class | PyMenuMgr
class | PyPersistent

Generated on Fri Jan 31 12:10:34 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References PyErr_SetString.

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 )

Definition at line 110 of file PythonContainer.cpp.

References 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 }

Generated on Fri Jan 31 12:10:34 2003 for WinCvs Source by doxygen 1.3-rc2


ReleaseDlg.cpp File Reference

common/ReleaseDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "ReleaseDlg.h"
#include "MultiFiles.h"
#include "GetPrefs.h"

Include dependency graph for ReleaseDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetRelease (const MultiFiles *mf, const char *dir, kReleaseDelType &removeDirectoryOption)
Get the release options.

Function Documentation

bool CompatGetRelease | ( | const MultiFiles * | mf,
 |  | const char * | dir,
 |  | kReleaseDelType & | removeDirectoryOption
 | ) |

Get the release options.

Definition at line 143 of file ReleaseDlg.cpp.

References CRelease_MAIN::GetRemoveDirectoryOption(), and CGetPrefs_GLOBALS::StoreValues().

Referenced by CvsCmdRelease().

00144 {
00145     bool userHitOK = false;
00146
00147 #ifdef WIN32
00148     CPropertySheet pages("Release settings");
00149     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00150
00151     CRelease_MAIN page1(dir);
00152     CGetPrefs_GLOBALS page2;
00153     pages.AddPage(&page1);
00154     pages.AddPage(&page2);
00155
00156     if( pages.DoModal() == IDOK )
00157     {
00158         removeDirectoryOption = page1.GetRemoveDirectoryOption();
00159
00160         page2.StoreValues();
00161         userHitOK = true;
00162     }
00163
00164 #endif /* WIN32 */
00165
00166 #ifdef qMacCvsPP
00167     userHitOK = true;
00168 #endif /* qMacCvsPP */
00169
00170 #if qUnix
00171     userHitOK = true;
00172 #endif // qUnix
00173
00174     return userHitOK;
00175 }

Generated on Fri Jan 31 12:10:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 | CRelease_MAIN

Defines

#define | AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_

Enumerations

enum kReleaseDelType {
kReleaseNoDel,
kReleaseDelDir,
kReleaseDelAll,
kReleaseDelCvsInfo
}
Release command delete option enum. More...

Functions

bool | CompatGetRelease (const MultiFiles *mf, const char *dir, kReleaseDelType &removeDirectoryOption)
Get the release options.

Define Documentation

#define AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_

Definition at line 26 of file ReleaseDlg.h.

Enumeration Type Documentation

enum kReleaseDelType

Release command delete option enum.

Enumeration values:
kReleaseNoDel | No delete
kReleaseDelDir | Delete directory (-d)
kReleaseDelAll | Delete directory and all files (even non-CVS controlled) (-f)
kReleaseDelCvsInfo | Delete CVS meta-data files (-e)

Definition at line 35 of file ReleaseDlg.h.

Referenced by CvsCmdRelease(), and CRelease_MAIN::GetRemoveDirectoryOption().

00036 {
00037     kReleaseNoDel,
00038     kReleaseDelDir,
00039     kReleaseDelAll,
00040     kReleaseDelCvsInfo
00041 } kReleaseDelType;

Function Documentation

bool CompatGetRelease | ( | const MultiFiles * | mf,
 |  | const char * | dir,
 |  | kReleaseDelType & | removeDirectoryOption
 | ) |

Get the release options.

Definition at line 143 of file ReleaseDlg.cpp.

References CRelease_MAIN::GetRemoveDirectoryOption(), and CGetPrefs_GLOBALS::StoreValues().

Referenced by CvsCmdRelease().

00144 {
00145     bool userHitOK = false;
00146
00147 #ifdef WIN32
00148     CPropertySheet pages("Release settings");
00149     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00150
00151     CRelease_MAIN page1(dir);
00152     CGetPrefs_GLOBALS page2;
00153     pages.AddPage(&page1);
00154     pages.AddPage(&page2);
00155
00156     if( pages.DoModal() == IDOK )
00157     {
00158         removeDirectoryOption = page1.GetRemoveDirectoryOption();
00159
00160         page2.StoreValues();
00161         userHitOK = true;
00162     }
00163
00164 #endif /* WIN32 */
00165
00166 #ifdef qMacCvsPP
00167     userHitOK = true;
00168 #endif /* qMacCvsPP */
00169
00170 #if qUnix
00171     userHitOK = true;
00172 #endif // qUnix
00173
00174     return userHitOK;
00175 }

Generated on Fri Jan 31 12:10:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "UpdateDlg.h"
#include "ItemListDlg.h"

Include dependency graph for RtagDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatRtagCreate (const MultiFiles *mf, bool &noRecurs, bool &overwriteExisting, UPStr &tagName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
Get the rtag create options.

bool | CompatRtagDelete (const MultiFiles *mf, bool &noRecurs, bool &lookAttic, UPStr &tagName, UPStr &modName)
Get the rtag delete options.

bool | CompatRtagBranch (const MultiFiles *mf, bool &noRecurs, UPStr &branchName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
Get the rtag branch options.

Function Documentation

bool CompatRtagBranch | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Get the rtag branch options.

Definition at line 1228 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagBranch().

01232 {
01233     bool userHitOK = false;
01234
01235     static CPStr sLastModule;
01236     static CPStr sLastBranch;
01237     static CPStr sLastDate;
01238     static CPStr sLastRev;
01239
01240     bool hasDate = false;
01241     bool hasRev = false;
01242
01243     date = "";
01244     rev = "";
01245     branchName = "";
01246     modName = "";
01247     noRecurs = false;
01248     useMostRecent = false;
01249     lookAttic = false;
01250
01251 #ifdef WIN32
01252     CPropertySheet pages("Create branch settings");
01253     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01254
01255     CRtag_MAIN page1(mf, kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01256     CRtag_OPTIONS page2(mf, kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01257     CGetPrefs_GLOBALS page3;
01258     pages.AddPage(&page1);
01259     pages.AddPage(&page2);
01260     pages.AddPage(&page3);
01261     if(pages.DoModal() == IDOK)
01262     {
01263         sLastModule = page1.m_moduleName;
01264         sLastBranch = page1.m_tagName;
01265         noRecurs = page1.m_noRecurs == TRUE;
01266         lookAttic = page1.m_lookAttic == TRUE;
01267         sLastDate = page2.m_date;
01268         sLastRev = page2.m_rev;
01269         hasDate = page2.m_hasDate == TRUE;
01270         hasRev = page2.m_hasRev == TRUE;
01271         useMostRecent = page2.m_useMostRecent == TRUE;
01272
01273         page3.StoreValues();
01274         userHitOK = true;
01275     }
01276 #endif /* WIN32 */
01277 #if qUnix
01278     void *wid = UCreate_BranchModDlg();
01279
01280     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01281     UCvsRtagBranch_MAIN *tab1 =
01282         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01283                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01284                                   lookAttic);
01285     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01286     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01287
01288     if(dlg->DoModal())
01289     {
01290         lookAttic = tab1->m_attic;
01291         sLastDate = tab1->m_date;
01292         sLastRev = tab1->m_rev;
01293         hasDate = tab1->m_hasdate;
01294         hasRev = tab1->m_hasrev;
01295         noRecurs = tab1->m_norecurs;
01296         useMostRecent = tab1->m_match;
01297         sLastModule = tab1->m_modname;
01298         sLastBranch = tab1->m_tagname;
01299
01300         userHitOK = true;
01301     }
01302
01303     delete dlg;
01304 #endif // qUnix
01305 #ifdef qMacCvsPP
01306     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01307     LWindow *theDialog = theHandler.GetDialog();
01308     ThrowIfNil_(theDialog);
01309     static UInt16 sRuntimePanel = 1;
01310
01311     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01312         (theDialog->FindPaneByID(item_MultiViewPrefs));
01313     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01314
01315     multiView->SwitchToPanel(3);
01316     DoDataExchange_Globals(theDialog, true);
01317     multiView->SwitchToPanel(2);
01318     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01319     multiView->SwitchToPanel(1);
01320     DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01321         hasDate, hasRev, sLastDate, sLastRev,
01322         useMostRecent, lookAttic, true);
01323
01324     groupView->SetValue(sRuntimePanel);
01325     theDialog->Show();
01326     MessageT hitMessage;
01327     while (true)
01328     {       // Let DialogHandler process events
01329         hitMessage = theHandler.DoDialog();
01330
01331         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01332             break;
01333     }
01334     theDialog->Hide();
01335     sRuntimePanel = groupView->GetValue();
01336
01337     if(hitMessage == msg_OK)
01338     {
01339         multiView->SwitchToPanel(1);
01340         DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01341             hasDate, hasRev, sLastDate, sLastRev,
01342             useMostRecent, lookAttic, false);
01343         multiView->SwitchToPanel(2);
01344         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01345         multiView->SwitchToPanel(3);
01346         DoDataExchange_Globals(theDialog, false);
01347         userHitOK = true;
01348     }
01349 #endif /* qMacCvsPP */
01350
01351     if(userHitOK)
01352     {
01353         if(hasDate && !sLastDate.empty())
01354             date = sLastDate;
01355         if(hasRev && !sLastRev.empty())
01356             rev = sLastRev;
01357
01358         branchName = sLastBranch;
01359         modName = sLastModule;
01360
01361         gCvsPrefs.save();
01362     }
01363
01364     return userHitOK;
01365 }

bool CompatRtagCreate | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Get the rtag create options.

Definition at line 979 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagCreate().

00983 {
00984     bool userHitOK = false;
00985
00986     static CPStr sLastModule;
00987     static CPStr sLastTag;
00988     static CPStr sLastDate;
00989     static CPStr sLastRev;
00990
00991     bool hasDate = false;
00992     bool hasRev = false;
00993
00994     date = "";
00995     rev = "";
00996     tagName = "";
00997     modName = "";
00998     noRecurs = false;
00999     overwriteExisting = false;
01000     useMostRecent = false;
01001     lookAttic = false;
01002
01003 #ifdef WIN32
01004     CPropertySheet pages("Create tag settings");
01005     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01006     CRtag_MAIN page1(mf, kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
01007     CRtag_OPTIONS page2(mf, kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01008     CGetPrefs_GLOBALS page3;
01009     pages.AddPage(&page1);
01010     pages.AddPage(&page2);
01011     pages.AddPage(&page3);
01012     if(pages.DoModal() == IDOK)
01013     {
01014         sLastModule = page1.m_moduleName;
01015         sLastTag = page1.m_tagName;
01016         noRecurs = page1.m_noRecurs == TRUE;
01017         overwriteExisting = page1.m_overwriteExisting == TRUE;
01018         lookAttic = page1.m_lookAttic == TRUE;
01019
01020         sLastDate = page2.m_date;
01021         sLastRev = page2.m_rev;
01022         hasDate = page2.m_hasDate == TRUE;
01023         hasRev = page2.m_hasRev == TRUE;
01024         useMostRecent = page2.m_useMostRecent == TRUE;
01025
01026         page3.StoreValues();
01027         userHitOK = true;
01028     }
01029 #endif /* WIN32 */
01030 #if qUnix
01031     void *wid = UCreate_TagModDlg();
01032
01033     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01034     UCvsRtagCreate_MAIN *tab1 =
01035         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01036                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01037                                 useMostRecent, lookAttic);
01038     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01039     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01040
01041     if(dlg->DoModal())
01042     {
01043         lookAttic = tab1->m_attic;
01044         sLastDate = tab1->m_date;
01045         sLastRev = tab1->m_rev;
01046         hasDate = tab1->m_hasdate;
01047         hasRev = tab1->m_hasrev;
01048         noRecurs = tab1->m_norecurs;
01049         useMostRecent = tab1->m_match;
01050         sLastModule = tab1->m_modname;
01051         sLastTag = tab1->m_tagname;
01052         overwriteExisting = tab1->m_overwrite;
01053
01054         userHitOK = true;
01055     }
01056
01057     delete dlg;
01058 #endif // qUnix
01059 #ifdef qMacCvsPP
01060     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01061     LWindow *theDialog = theHandler.GetDialog();
01062     ThrowIfNil_(theDialog);
01063     static UInt16 sRuntimePanel = 1;
01064
01065     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01066         (theDialog->FindPaneByID(item_MultiViewPrefs));
01067     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01068
01069     multiView->SwitchToPanel(3);
01070     DoDataExchange_Globals(theDialog, true);
01071     multiView->SwitchToPanel(2);
01072     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01073     multiView->SwitchToPanel(1);
01074     DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01075         hasDate, hasRev, sLastDate, sLastRev,
01076         useMostRecent, lookAttic, true);
01077
01078     groupView->SetValue(sRuntimePanel);
01079     theDialog->Show();
01080     MessageT hitMessage;
01081     while (true)
01082     {       // Let DialogHandler process events
01083         hitMessage = theHandler.DoDialog();
01084
01085         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01086             break;
01087     }
01088     theDialog->Hide();
01089     sRuntimePanel = groupView->GetValue();
01090
01091     if(hitMessage == msg_OK)
01092     {
01093         multiView->SwitchToPanel(1);
01094         DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01095             hasDate, hasRev, sLastDate, sLastRev,
01096             useMostRecent, lookAttic, false);
01097         multiView->SwitchToPanel(2);
01098         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01099         multiView->SwitchToPanel(3);
01100         DoDataExchange_Globals(theDialog, false);
01101         userHitOK = true;
01102     }
01103 #endif /* qMacCvsPP */
01104
01105     if(userHitOK)
01106     {
01107         if(hasDate && !sLastDate.empty())
01108             date = sLastDate;
01109         if(hasRev && !sLastRev.empty())
01110             rev = sLastRev;
01111
01112         tagName = sLastTag;
01113         modName = sLastModule;
01114
01115         gCvsPrefs.save();
01116     }
01117
01118     return userHitOK;
01119 }

bool CompatRtagDelete | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | lookAttic,
 |  | UPStr & | tagName,
 |  | UPStr & | modName
 | ) |

Get the rtag delete options.

Definition at line 1122 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagDelete().

01125 {
01126
01127     bool userHitOK = false;
01128
01129     static CPStr sLastModule;
01130     static CPStr sLastTag;
01131
01132     tagName = "";
01133     modName = "";
01134     noRecurs = false;
01135     lookAttic = false;
01136
01137 #ifdef WIN32
01138     CPropertySheet pages("Delete tag settings");
01139     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01140     CRtag_MAIN page1(mf, kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01141     CGetPrefs_GLOBALS page2;
01142     pages.AddPage(&page1);
01143     pages.AddPage(&page2);
01144     if(pages.DoModal() == IDOK)
01145     {
01146         lookAttic = page1.m_lookAttic == TRUE;
01147         noRecurs = page1.m_noRecurs == TRUE;
01148         sLastModule = page1.m_moduleName;
01149         sLastTag = page1.m_tagName;
01150
01151         page2.StoreValues();
01152         userHitOK = true;
01153     }
01154 #endif /* WIN32 */
01155 #if qUnix
01156     void *wid = UCreate_UntagModDlg();
01157
01158     UCvsRtagDel *dlg = new UCvsRtagDel();
01159     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01160                                                   noRecurs, lookAttic);
01161     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01162     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01163
01164     if(dlg->DoModal())
01165     {
01166         lookAttic = tab1->m_attic;
01167         noRecurs = tab1->m_norecurs;
01168         sLastModule = tab1->m_modname;
01169         sLastTag = tab1->m_tagname;
01170
01171         userHitOK = true;
01172     }
01173
01174     delete dlg;
01175 #endif // qUnix
01176 #ifdef qMacCvsPP
01177     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01178     LWindow *theDialog = theHandler.GetDialog();
01179     ThrowIfNil_(theDialog);
01180     static UInt16 sRuntimePanel = 1;
01181
01182     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01183         (theDialog->FindPaneByID(item_MultiViewPrefs));
01184     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01185
01186     multiView->SwitchToPanel(2);
01187     DoDataExchange_Globals(theDialog, true);
01188     multiView->SwitchToPanel(1);
01189     DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01190         noRecurs, lookAttic, true);
01191
01192     groupView->SetValue(sRuntimePanel);
01193     theDialog->Show();
01194     MessageT hitMessage;
01195     while (true)
01196     {       // Let DialogHandler process events
01197         hitMessage = theHandler.DoDialog();
01198
01199         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01200             break;
01201     }
01202     theDialog->Hide();
01203     sRuntimePanel = groupView->GetValue();
01204
01205     if(hitMessage == msg_OK)
01206     {
01207         multiView->SwitchToPanel(1);
01208         DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01209             noRecurs, lookAttic, false);
01210         multiView->SwitchToPanel(2);
01211         DoDataExchange_Globals(theDialog, false);
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215
01216     if(userHitOK)
01217     {
01218         tagName = sLastTag;
01219         modName = sLastModule;
01220
01221         gCvsPrefs.save();
01222     }
01223
01224     return userHitOK;
01225 }

Generated on Fri Jan 31 12:10:36 2003 for WinCvs Source by doxygen 1.3-rc2


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
}
RTag dialog type enum. More...

Functions

bool | CompatRtagCreate (const MultiFiles *mf, bool &noRecurs, bool &overwriteExisting, UPStr &tagName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
Get the rtag create options.

bool | CompatRtagDelete (const MultiFiles *mf, bool &noRecurs, bool &lookAttic, UPStr &tagName, UPStr &modName)
Get the rtag delete options.

bool | CompatRtagBranch (const MultiFiles *mf, bool &noRecurs, UPStr &branchName, UPStr &modName, UPStr &date, UPStr &rev, bool &useMostRecent, bool &lookAttic)
Get the rtag branch options.

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

RTag dialog type enum.

Enumeration values:
kRtagAdd | RTag create
kRtagDelete | RTag delete
kRtagFork | RTag branch

Definition at line 54 of file RtagDlg.h.

00055 {
00056     kRtagAdd,
00057     kRtagDelete,
00058     kRtagFork
00059 } kRtagDlgType;

Function Documentation

bool CompatRtagBranch | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Get the rtag branch options.

Definition at line 1228 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagBranch().

01232 {
01233     bool userHitOK = false;
01234
01235     static CPStr sLastModule;
01236     static CPStr sLastBranch;
01237     static CPStr sLastDate;
01238     static CPStr sLastRev;
01239
01240     bool hasDate = false;
01241     bool hasRev = false;
01242
01243     date = "";
01244     rev = "";
01245     branchName = "";
01246     modName = "";
01247     noRecurs = false;
01248     useMostRecent = false;
01249     lookAttic = false;
01250
01251 #ifdef WIN32
01252     CPropertySheet pages("Create branch settings");
01253     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01254
01255     CRtag_MAIN page1(mf, kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01256     CRtag_OPTIONS page2(mf, kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01257     CGetPrefs_GLOBALS page3;
01258     pages.AddPage(&page1);
01259     pages.AddPage(&page2);
01260     pages.AddPage(&page3);
01261     if(pages.DoModal() == IDOK)
01262     {
01263         sLastModule = page1.m_moduleName;
01264         sLastBranch = page1.m_tagName;
01265         noRecurs = page1.m_noRecurs == TRUE;
01266         lookAttic = page1.m_lookAttic == TRUE;
01267         sLastDate = page2.m_date;
01268         sLastRev = page2.m_rev;
01269         hasDate = page2.m_hasDate == TRUE;
01270         hasRev = page2.m_hasRev == TRUE;
01271         useMostRecent = page2.m_useMostRecent == TRUE;
01272
01273         page3.StoreValues();
01274         userHitOK = true;
01275     }
01276 #endif /* WIN32 */
01277 #if qUnix
01278     void *wid = UCreate_BranchModDlg();
01279
01280     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01281     UCvsRtagBranch_MAIN *tab1 =
01282         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01283                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01284                                   lookAttic);
01285     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01286     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01287
01288     if(dlg->DoModal())
01289     {
01290         lookAttic = tab1->m_attic;
01291         sLastDate = tab1->m_date;
01292         sLastRev = tab1->m_rev;
01293         hasDate = tab1->m_hasdate;
01294         hasRev = tab1->m_hasrev;
01295         noRecurs = tab1->m_norecurs;
01296         useMostRecent = tab1->m_match;
01297         sLastModule = tab1->m_modname;
01298         sLastBranch = tab1->m_tagname;
01299
01300         userHitOK = true;
01301     }
01302
01303     delete dlg;
01304 #endif // qUnix
01305 #ifdef qMacCvsPP
01306     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01307     LWindow *theDialog = theHandler.GetDialog();
01308     ThrowIfNil_(theDialog);
01309     static UInt16 sRuntimePanel = 1;
01310
01311     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01312         (theDialog->FindPaneByID(item_MultiViewPrefs));
01313     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01314
01315     multiView->SwitchToPanel(3);
01316     DoDataExchange_Globals(theDialog, true);
01317     multiView->SwitchToPanel(2);
01318     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01319     multiView->SwitchToPanel(1);
01320     DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01321         hasDate, hasRev, sLastDate, sLastRev,
01322         useMostRecent, lookAttic, true);
01323
01324     groupView->SetValue(sRuntimePanel);
01325     theDialog->Show();
01326     MessageT hitMessage;
01327     while (true)
01328     {       // Let DialogHandler process events
01329         hitMessage = theHandler.DoDialog();
01330
01331         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01332             break;
01333     }
01334     theDialog->Hide();
01335     sRuntimePanel = groupView->GetValue();
01336
01337     if(hitMessage == msg_OK)
01338     {
01339         multiView->SwitchToPanel(1);
01340         DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01341             hasDate, hasRev, sLastDate, sLastRev,
01342             useMostRecent, lookAttic, false);
01343         multiView->SwitchToPanel(2);
01344         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01345         multiView->SwitchToPanel(3);
01346         DoDataExchange_Globals(theDialog, false);
01347         userHitOK = true;
01348     }
01349 #endif /* qMacCvsPP */
01350
01351     if(userHitOK)
01352     {
01353         if(hasDate && !sLastDate.empty())
01354             date = sLastDate;
01355         if(hasRev && !sLastRev.empty())
01356             rev = sLastRev;
01357
01358         branchName = sLastBranch;
01359         modName = sLastModule;
01360
01361         gCvsPrefs.save();
01362     }
01363
01364     return userHitOK;
01365 }

bool CompatRtagCreate | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | UPStr & | modName,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | bool & | lookAttic
 | ) |

Get the rtag create options.

Definition at line 979 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagCreate().

00983 {
00984     bool userHitOK = false;
00985
00986     static CPStr sLastModule;
00987     static CPStr sLastTag;
00988     static CPStr sLastDate;
00989     static CPStr sLastRev;
00990
00991     bool hasDate = false;
00992     bool hasRev = false;
00993
00994     date = "";
00995     rev = "";
00996     tagName = "";
00997     modName = "";
00998     noRecurs = false;
00999     overwriteExisting = false;
01000     useMostRecent = false;
01001     lookAttic = false;
01002
01003 #ifdef WIN32
01004     CPropertySheet pages("Create tag settings");
01005     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01006     CRtag_MAIN page1(mf, kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
01007     CRtag_OPTIONS page2(mf, kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01008     CGetPrefs_GLOBALS page3;
01009     pages.AddPage(&page1);
01010     pages.AddPage(&page2);
01011     pages.AddPage(&page3);
01012     if(pages.DoModal() == IDOK)
01013     {
01014         sLastModule = page1.m_moduleName;
01015         sLastTag = page1.m_tagName;
01016         noRecurs = page1.m_noRecurs == TRUE;
01017         overwriteExisting = page1.m_overwriteExisting == TRUE;
01018         lookAttic = page1.m_lookAttic == TRUE;
01019
01020         sLastDate = page2.m_date;
01021         sLastRev = page2.m_rev;
01022         hasDate = page2.m_hasDate == TRUE;
01023         hasRev = page2.m_hasRev == TRUE;
01024         useMostRecent = page2.m_useMostRecent == TRUE;
01025
01026         page3.StoreValues();
01027         userHitOK = true;
01028     }
01029 #endif /* WIN32 */
01030 #if qUnix
01031     void *wid = UCreate_TagModDlg();
01032
01033     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01034     UCvsRtagCreate_MAIN *tab1 =
01035         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01036                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01037                                 useMostRecent, lookAttic);
01038     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01039     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01040
01041     if(dlg->DoModal())
01042     {
01043         lookAttic = tab1->m_attic;
01044         sLastDate = tab1->m_date;
01045         sLastRev = tab1->m_rev;
01046         hasDate = tab1->m_hasdate;
01047         hasRev = tab1->m_hasrev;
01048         noRecurs = tab1->m_norecurs;
01049         useMostRecent = tab1->m_match;
01050         sLastModule = tab1->m_modname;
01051         sLastTag = tab1->m_tagname;
01052         overwriteExisting = tab1->m_overwrite;
01053
01054         userHitOK = true;
01055     }
01056
01057     delete dlg;
01058 #endif // qUnix
01059 #ifdef qMacCvsPP
01060     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01061     LWindow *theDialog = theHandler.GetDialog();
01062     ThrowIfNil_(theDialog);
01063     static UInt16 sRuntimePanel = 1;
01064
01065     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01066         (theDialog->FindPaneByID(item_MultiViewPrefs));
01067     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01068
01069     multiView->SwitchToPanel(3);
01070     DoDataExchange_Globals(theDialog, true);
01071     multiView->SwitchToPanel(2);
01072     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01073     multiView->SwitchToPanel(1);
01074     DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01075         hasDate, hasRev, sLastDate, sLastRev,
01076         useMostRecent, lookAttic, true);
01077
01078     groupView->SetValue(sRuntimePanel);
01079     theDialog->Show();
01080     MessageT hitMessage;
01081     while (true)
01082     {       // Let DialogHandler process events
01083         hitMessage = theHandler.DoDialog();
01084
01085         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01086             break;
01087     }
01088     theDialog->Hide();
01089     sRuntimePanel = groupView->GetValue();
01090
01091     if(hitMessage == msg_OK)
01092     {
01093         multiView->SwitchToPanel(1);
01094         DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01095             hasDate, hasRev, sLastDate, sLastRev,
01096             useMostRecent, lookAttic, false);
01097         multiView->SwitchToPanel(2);
01098         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01099         multiView->SwitchToPanel(3);
01100         DoDataExchange_Globals(theDialog, false);
01101         userHitOK = true;
01102     }
01103 #endif /* qMacCvsPP */
01104
01105     if(userHitOK)
01106     {
01107         if(hasDate && !sLastDate.empty())
01108             date = sLastDate;
01109         if(hasRev && !sLastRev.empty())
01110             rev = sLastRev;
01111
01112         tagName = sLastTag;
01113         modName = sLastModule;
01114
01115         gCvsPrefs.save();
01116     }
01117
01118     return userHitOK;
01119 }

bool CompatRtagDelete | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | lookAttic,
 |  | UPStr & | tagName,
 |  | UPStr & | modName
 | ) |

Get the rtag delete options.

Definition at line 1122 of file RtagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdRtagDelete().

01125 {
01126
01127     bool userHitOK = false;
01128
01129     static CPStr sLastModule;
01130     static CPStr sLastTag;
01131
01132     tagName = "";
01133     modName = "";
01134     noRecurs = false;
01135     lookAttic = false;
01136
01137 #ifdef WIN32
01138     CPropertySheet pages("Delete tag settings");
01139     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01140     CRtag_MAIN page1(mf, kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01141     CGetPrefs_GLOBALS page2;
01142     pages.AddPage(&page1);
01143     pages.AddPage(&page2);
01144     if(pages.DoModal() == IDOK)
01145     {
01146         lookAttic = page1.m_lookAttic == TRUE;
01147         noRecurs = page1.m_noRecurs == TRUE;
01148         sLastModule = page1.m_moduleName;
01149         sLastTag = page1.m_tagName;
01150
01151         page2.StoreValues();
01152         userHitOK = true;
01153     }
01154 #endif /* WIN32 */
01155 #if qUnix
01156     void *wid = UCreate_UntagModDlg();
01157
01158     UCvsRtagDel *dlg = new UCvsRtagDel();
01159     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01160                                                   noRecurs, lookAttic);
01161     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01162     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01163
01164     if(dlg->DoModal())
01165     {
01166         lookAttic = tab1->m_attic;
01167         noRecurs = tab1->m_norecurs;
01168         sLastModule = tab1->m_modname;
01169         sLastTag = tab1->m_tagname;
01170
01171         userHitOK = true;
01172     }
01173
01174     delete dlg;
01175 #endif // qUnix
01176 #ifdef qMacCvsPP
01177     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01178     LWindow *theDialog = theHandler.GetDialog();
01179     ThrowIfNil_(theDialog);
01180     static UInt16 sRuntimePanel = 1;
01181
01182     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01183         (theDialog->FindPaneByID(item_MultiViewPrefs));
01184     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01185
01186     multiView->SwitchToPanel(2);
01187     DoDataExchange_Globals(theDialog, true);
01188     multiView->SwitchToPanel(1);
01189     DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01190         noRecurs, lookAttic, true);
01191
01192     groupView->SetValue(sRuntimePanel);
01193     theDialog->Show();
01194     MessageT hitMessage;
01195     while (true)
01196     {       // Let DialogHandler process events
01197         hitMessage = theHandler.DoDialog();
01198
01199         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01200             break;
01201     }
01202     theDialog->Hide();
01203     sRuntimePanel = groupView->GetValue();
01204
01205     if(hitMessage == msg_OK)
01206     {
01207         multiView->SwitchToPanel(1);
01208         DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01209             noRecurs, lookAttic, false);
01210         multiView->SwitchToPanel(2);
01211         DoDataExchange_Globals(theDialog, false);
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215
01216     if(userHitOK)
01217     {
01218         tagName = sLastTag;
01219         modName = sLastModule;
01220
01221         gCvsPrefs.save();
01222     }
01223
01224     return userHitOK;
01225 }

Variable Documentation

CMString gOldModules

Definition at line 51 of file RtagDlg.h.

Generated on Fri Jan 31 12:10:36 2003 for WinCvs Source by doxygen 1.3-rc2


SelectionDetailsDlg.cpp File Reference

common/SelectionDetailsDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "wincvs_winutil.h"
#include "SelectionDetailsDlg.h"

Include dependency graph for SelectionDetailsDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetSelectionDetails (const MultiFiles *mf, kSelDetType &selDetType, UStr &selection)
Get the selection details.

Function Documentation

bool CompatGetSelectionDetails | ( | const MultiFiles * | mf,
 |  | kSelDetType & | selDetType,
 |  | UStr & | selection
 | ) |

Get the selection details.

Definition at line 535 of file SelectionDetailsDlg.cpp.

References EV_INIT_WIDGET, kUMainWidget, CSelectionDetailsDlg::m_selDetType, CSelectionDetailsDlg::m_selection, UCreate_SelDetailsDlg(), and UEventSendMessage().

Referenced by CItemListDlg::OnSelection().

00536 {
00537     bool userHitOK = false;
00538
00539 #ifdef WIN32
00540     CSelectionDetailsDlg selectionDetailsDlg(mf, selDetType, selection.c_str());
00541
00542     if( selectionDetailsDlg.DoModal() == IDOK )
00543     {
00544         selection = selectionDetailsDlg.m_selection;
00545         selDetType = (kSelDetType)selectionDetailsDlg.m_selDetType;
00546
00547         userHitOK = true;
00548     }
00549 #endif /* WIN32 */
00550
00551 #if qUnix
00552     void *wid;
00553 #   if qGTK
00554     wid = UCreate_SelDetailsDlg();
00555 #   endif
00556
00557     UCvsSelectionDetailsDlg *dlg = new UCvsSelectionDetailsDlg( mf, selDetType, selection.c_str());
00558     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00559     if(dlg->DoModal())
00560     {
00561         selection = dlg->m_selection;
00562         selDetType = dlg->m_selDetType;
00563
00564         userHitOK = true;
00565     }
00566     delete dlg;
00567
00568 #endif // qUnix
00569
00570 #ifdef qMacCvsPP
00571 #endif /* qMacCvsPP */
00572
00573     return userHitOK;
00574 }

Generated on Fri Jan 31 12:10:37 2003 for WinCvs Source by doxygen 1.3-rc2


SelectionDetailsDlg.h File Reference

common/SelectionDetailsDlg.h File Reference

#include "MultiFiles.h"
#include "SortHeaderCtrl.h"

Include dependency graph for SelectionDetailsDlg.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 | CompareInfo
Structure to hold the sorting settings. More...

class | CSelectionDetailsDlg
class | SelectionDisplayInfo
Class to hold and support data display (e.g. sorting). More...

Defines

#define | AFX_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_

Enumerations

enum kSelDetType {
kSelDetFile,
kSelDetRevision,
kSelDetPath
}
Enum types of selection details dialog. More...

Functions

bool | CompatGetSelectionDetails (const MultiFiles *mf, kSelDetType &selDetType, UStr &selection)
Get the selection details.

Define Documentation

#define AFX_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_

Definition at line 22 of file SelectionDetailsDlg.h.

Enumeration Type Documentation

enum kSelDetType

Enum types of selection details dialog.

Enumeration values:
kSelDetFile | Select file
kSelDetRevision | Select revision
kSelDetPath | Select path

Definition at line 37 of file SelectionDetailsDlg.h.

Referenced by CItemListDlg::OnSelection().

00038 {
00039     kSelDetFile,
00040     kSelDetRevision,
00041     kSelDetPath
00042 } kSelDetType;

Function Documentation

bool CompatGetSelectionDetails | ( | const MultiFiles * | mf,
 |  | kSelDetType & | selDetType,
 |  | UStr & | selection
 | ) |

Get the selection details.

Definition at line 535 of file SelectionDetailsDlg.cpp.

References EV_INIT_WIDGET, kUMainWidget, CSelectionDetailsDlg::m_selDetType, CSelectionDetailsDlg::m_selection, UCreate_SelDetailsDlg(), and UEventSendMessage().

Referenced by CItemListDlg::OnSelection().

00536 {
00537     bool userHitOK = false;
00538
00539 #ifdef WIN32
00540     CSelectionDetailsDlg selectionDetailsDlg(mf, selDetType, selection.c_str());
00541
00542     if( selectionDetailsDlg.DoModal() == IDOK )
00543     {
00544         selection = selectionDetailsDlg.m_selection;
00545         selDetType = (kSelDetType)selectionDetailsDlg.m_selDetType;
00546
00547         userHitOK = true;
00548     }
00549 #endif /* WIN32 */
00550
00551 #if qUnix
00552     void *wid;
00553 #   if qGTK
00554     wid = UCreate_SelDetailsDlg();
00555 #   endif
00556
00557     UCvsSelectionDetailsDlg *dlg = new UCvsSelectionDetailsDlg( mf, selDetType, selection.c_str());
00558     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00559     if(dlg->DoModal())
00560     {
00561         selection = dlg->m_selection;
00562         selDetType = dlg->m_selDetType;
00563
00564         userHitOK = true;
00565     }
00566     delete dlg;
00567
00568 #endif // qUnix
00569
00570 #ifdef qMacCvsPP
00571 #endif /* qMacCvsPP */
00572
00573     return userHitOK;
00574 }

Generated on Fri Jan 31 12:10:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:38 2003 for WinCvs Source by doxygen 1.3-rc2


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
class | CSmartComboBox

Defines

#define | AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_

Enumerations

enum {
WM_SMCB_MIN = WM_APP + 1,
WM_SMCB_SETFEATURE,
WM_SMCB_SETITEMS,
WM_SMCB_SETREADONLY,
WM_SMCB_MAX
}
Private window messages enum. More...

Define Documentation

#define AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_

Definition at line 22 of file SmartComboBox.h.

Enumeration Type Documentation

anonymous enum

Private window messages enum.

Enumeration values:
WM_SMCB_MIN | Start marker
WM_SMCB_SETFEATURE | Set the features, see CSmartComboBox::OnSetFeature for more details
WM_SMCB_SETITEMS | Set the drop-down list items collection, see CSmartComboBox::OnSetItems for more details
WM_SMCB_SETREADONLY | Set the read-only feature, see CSmartComboBox::OnSetFeature for more details
WM_SMCB_MAX | End marker

Definition at line 83 of file SmartComboBox.h.

00083     {
00084     WM_SMCB_MIN = WM_APP + 1,
00085     WM_SMCB_SETFEATURE,
00086     WM_SMCB_SETITEMS,
00087     WM_SMCB_SETREADONLY,
00088     WM_SMCB_MAX
00089 };

Generated on Fri Jan 31 12:10:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:39 2003 for WinCvs Source by doxygen 1.3-rc2


StatusDlg.cpp File Reference

common/StatusDlg.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "OptionalPropertySheet.h"
#include "StatusDlg.h"
#include "MultiFiles.h"
#include "GetPrefs.h"

Include dependency graph for StatusDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool CompatGetStatus (const MultiFiles *mf, bool &noRecurs, STATUSOUTPUT_TYPE &outputType)
Get the status options.

Function Documentation

bool CompatGetStatus | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | STATUSOUTPUT_TYPE & | outputType
 | ) |

Get the status options.

Definition at line 98 of file StatusDlg.cpp.

References COptionalPropertySheet::DoModal(), COptionalPropertySheet::GetHideCommandDlg(), CStatus_MAIN::m_noRecurs, CStatus_MAIN::m_outputType, and CGetPrefs_GLOBALS::StoreValues().

Referenced by CvsCmdStatus().

00099 {
00100     bool userHitOK = false;
00101
00102     noRecurs = false;
00103     outputType = gCvsPrefs.StatusOutputType();
00104
00105 #ifdef WIN32
00106     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgStatus(), "Status settings");
00107     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00108     CStatus_MAIN page1(noRecurs, outputType);
00109     CGetPrefs_GLOBALS page2;
00110     pages.AddPage(&page1);
00111     pages.AddPage(&page2);
00112
00113     if( pages.DoModal() == IDOK )
00114     {
00115         noRecurs = page1.m_noRecurs ? true : false;
00116         gCvsPrefs.SetStatusOutputType((STATUSOUTPUT_TYPE)page1.m_outputType);
00117
00118         page2.StoreValues();
00119         gCvsPrefs.SetHideCommandDlgStatus(pages.GetHideCommandDlg());
00120         userHitOK = true;
00121     }
00122 #endif /* WIN32 */
00123
00124 #ifdef qMacCvsPP
00125     userHitOK = true;
00126 #endif /* qMacCvsPP */
00127
00128 #if qUnix
00129     userHitOK = true;
00130 #endif // qUnix
00131
00132     if( userHitOK )
00133     {
00134         outputType = gCvsPrefs.StatusOutputType();
00135
00136         gCvsPrefs.save();
00137     }
00138
00139     return userHitOK;
00140 }

Generated on Fri Jan 31 12:10:40 2003 for WinCvs Source by doxygen 1.3-rc2


StatusDlg.h File Reference

common/StatusDlg.h File Reference

#include "CvsPrefs.h"

Include dependency graph for StatusDlg.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 | CStatus_MAIN

Defines

#define | AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_

Functions

bool | CompatGetStatus (const MultiFiles *mf, bool &noRecurs, STATUSOUTPUT_TYPE &outputType)
Get the status options.

Define Documentation

#define AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_

Definition at line 26 of file StatusDlg.h.

Function Documentation

bool CompatGetStatus | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | STATUSOUTPUT_TYPE & | outputType
 | ) |

Get the status options.

Definition at line 98 of file StatusDlg.cpp.

References COptionalPropertySheet::DoModal(), COptionalPropertySheet::GetHideCommandDlg(), CStatus_MAIN::m_noRecurs, CStatus_MAIN::m_outputType, and CGetPrefs_GLOBALS::StoreValues().

Referenced by CvsCmdStatus().

00099 {
00100     bool userHitOK = false;
00101
00102     noRecurs = false;
00103     outputType = gCvsPrefs.StatusOutputType();
00104
00105 #ifdef WIN32
00106     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgStatus(), "Status settings");
00107     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00108     CStatus_MAIN page1(noRecurs, outputType);
00109     CGetPrefs_GLOBALS page2;
00110     pages.AddPage(&page1);
00111     pages.AddPage(&page2);
00112
00113     if( pages.DoModal() == IDOK )
00114     {
00115         noRecurs = page1.m_noRecurs ? true : false;
00116         gCvsPrefs.SetStatusOutputType((STATUSOUTPUT_TYPE)page1.m_outputType);
00117
00118         page2.StoreValues();
00119         gCvsPrefs.SetHideCommandDlgStatus(pages.GetHideCommandDlg());
00120         userHitOK = true;
00121     }
00122 #endif /* WIN32 */
00123
00124 #ifdef qMacCvsPP
00125     userHitOK = true;
00126 #endif /* qMacCvsPP */
00127
00128 #if qUnix
00129     userHitOK = true;
00130 #endif // qUnix
00131
00132     if( userHitOK )
00133     {
00134         outputType = gCvsPrefs.StatusOutputType();
00135
00136         gCvsPrefs.save();
00137     }
00138
00139     return userHitOK;
00140 }

Generated on Fri Jan 31 12:10:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "UpdateDlg.h"
#include "ItemListDlg.h"

Include dependency graph for TagDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatTagCreate (const MultiFiles *mf, bool &noRecurs, bool &overwriteExisting, UPStr &tagName, bool &checkUnmod)
Get the tag create options.

bool | CompatTagDelete (const MultiFiles *mf, bool &noRecurs, UPStr &tagName)
Get the tag delete options.

bool | CompatTagBranch (const MultiFiles *mf, bool &noRecurs, UPStr &branchName, bool &checkUnmod)
Get the branch options.

Function Documentation

bool CompatTagBranch | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | bool & | checkUnmod
 | ) |

Get the branch options.

Definition at line 814 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kUMainWidget, CTag_MAIN::m_checkUnmod, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_BranchDlg(), and UEventSendMessage().

Referenced by CvsCmdTagBranch().

00817 {
00818     bool userHitOK = false;
00819
00820     static CPStr sLastBranch;
00821
00822     branchName = "";
00823     noRecurs = false;
00824     checkUnmod = false;
00825
00826 #ifdef WIN32
00827     CPropertySheet pages("Create branch settings");
00828     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00829     CTag_MAIN page1(mf, kTagBranch, sLastBranch, noRecurs, checkUnmod);
00830     CGetPrefs_GLOBALS page2;
00831     pages.AddPage(&page1);
00832     pages.AddPage(&page2);
00833     if(pages.DoModal() == IDOK)
00834     {
00835         checkUnmod = page1.m_checkUnmod == TRUE;
00836         noRecurs = page1.m_noRecurs == TRUE;
00837         sLastBranch = page1.m_tagName;
00838
00839         page2.StoreValues();
00840         userHitOK = true;
00841     }
00842 #endif /* WIN32 */
00843 #if qUnix
00844     void *wid = UCreate_BranchDlg();
00845
00846     UCvsTagBranch *dlg = new UCvsTagBranch();
00847     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00848     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00849     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00850
00851     if(dlg->DoModal())
00852     {
00853         checkUnmod = tab1->m_checkunmod;
00854         noRecurs = tab1->m_norecurs;
00855         sLastBranch = tab1->m_tagname;
00856
00857         userHitOK = true;
00858     }
00859
00860     delete dlg;
00861 #endif // qUnix
00862 #ifdef qMacCvsPP
00863     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00864     LWindow *theDialog = theHandler.GetDialog();
00865     ThrowIfNil_(theDialog);
00866     static UInt16 sRuntimePanel = 1;
00867
00868     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00869         (theDialog->FindPaneByID(item_MultiViewPrefs));
00870     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00871
00872     multiView->SwitchToPanel(2);
00873     DoDataExchange_Globals(theDialog, true);
00874     multiView->SwitchToPanel(1);
00875     DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00876         noRecurs, checkUnmod, true);
00877
00878     groupView->SetValue(sRuntimePanel);
00879     theDialog->Show();
00880     MessageT hitMessage;
00881     while (true)
00882     {       // Let DialogHandler process events
00883         hitMessage = theHandler.DoDialog();
00884
00885         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00886             break;
00887     }
00888     theDialog->Hide();
00889     sRuntimePanel = groupView->GetValue();
00890
00891     if(hitMessage == msg_OK)
00892     {
00893         multiView->SwitchToPanel(1);
00894         DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00895             noRecurs, checkUnmod, false);
00896         multiView->SwitchToPanel(2);
00897         DoDataExchange_Globals(theDialog, false);
00898         userHitOK = true;
00899     }
00900 #endif /* qMacCvsPP */
00901
00902     if(userHitOK)
00903     {
00904         branchName = sLastBranch;
00905
00906         gCvsPrefs.save();
00907     }
00908
00909     return userHitOK;
00910 }

bool CompatTagCreate | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | bool & | checkUnmod
 | ) |

Get the tag create options.

Definition at line 617 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdTagCreate().

00620 {
00621     bool userHitOK = false;
00622
00623     static CPStr sLastTag;
00624
00625     tagName = "";
00626     noRecurs = false;
00627     overwriteExisting = false;
00628     checkUnmod = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Create tag settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CTag_MAIN page1(mf, kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00634     CGetPrefs_GLOBALS page2;
00635     pages.AddPage(&page1);
00636     pages.AddPage(&page2);
00637     if(pages.DoModal() == IDOK)
00638     {
00639         checkUnmod = page1.m_checkUnmod == TRUE;
00640         noRecurs = page1.m_noRecurs == TRUE;
00641         sLastTag = page1.m_tagName;
00642         overwriteExisting = page1.m_overwriteExisting == TRUE;
00643
00644         page2.StoreValues();
00645         userHitOK = true;
00646     }
00647 #endif /* WIN32 */
00648 #if qUnix
00649     void *wid = UCreate_TagDlg();
00650
00651     UCvsTagCreate *dlg = new UCvsTagCreate();
00652     UCvsTagCreate_MAIN *tab1 =
00653         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00654     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00655     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00656
00657     if(dlg->DoModal())
00658     {
00659         checkUnmod = tab1->m_checkunmod;
00660         noRecurs = tab1->m_norecurs;
00661         sLastTag = tab1->m_tagname;
00662         overwriteExisting = tab1->m_overwrite;
00663
00664         userHitOK = true;
00665     }
00666
00667     delete dlg;
00668 #endif // qUnix
00669 #ifdef qMacCvsPP
00670     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00671     LWindow *theDialog = theHandler.GetDialog();
00672     ThrowIfNil_(theDialog);
00673     static UInt16 sRuntimePanel = 1;
00674
00675     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00676         (theDialog->FindPaneByID(item_MultiViewPrefs));
00677     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00678
00679     multiView->SwitchToPanel(2);
00680     DoDataExchange_Globals(theDialog, true);
00681     multiView->SwitchToPanel(1);
00682     DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00683         noRecurs, overwriteExisting, checkUnmod, true);
00684
00685     groupView->SetValue(sRuntimePanel);
00686     theDialog->Show();
00687     MessageT hitMessage;
00688     while (true)
00689     {       // Let DialogHandler process events
00690         hitMessage = theHandler.DoDialog();
00691
00692         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00693             break;
00694     }
00695     theDialog->Hide();
00696     sRuntimePanel = groupView->GetValue();
00697
00698     if(hitMessage == msg_OK)
00699     {
00700         multiView->SwitchToPanel(1);
00701         DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00702             noRecurs, overwriteExisting, checkUnmod, false);
00703         multiView->SwitchToPanel(2);
00704         DoDataExchange_Globals(theDialog, false);
00705         userHitOK = true;
00706     }
00707 #endif /* qMacCvsPP */
00708
00709     if(userHitOK)
00710     {
00711         tagName = sLastTag;
00712
00713         gCvsPrefs.save();
00714     }
00715
00716     return userHitOK;
00717 }

bool CompatTagDelete | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | tagName
 | ) |

Get the tag delete options.

Definition at line 720 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kUMainWidget, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_UntagDlg(), and UEventSendMessage().

Referenced by CvsCmdTagDelete().

00722 {
00723
00724     bool userHitOK = false;
00725
00726     static CPStr sLastTag;
00727
00728     tagName = "";
00729     noRecurs = false;
00730
00731 #ifdef WIN32
00732     CPropertySheet pages("Delete tag settings");
00733     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00734     CTag_MAIN page1(mf, kTagDelete, sLastTag, noRecurs);
00735     CGetPrefs_GLOBALS page2;
00736     pages.AddPage(&page1);
00737     pages.AddPage(&page2);
00738     if(pages.DoModal() == IDOK)
00739     {
00740         noRecurs = page1.m_noRecurs == TRUE;
00741         sLastTag = page1.m_tagName;
00742
00743         page2.StoreValues();
00744         userHitOK = true;
00745     }
00746 #endif /* WIN32 */
00747 #if qUnix
00748     void *wid = UCreate_UntagDlg();
00749
00750     UCvsTagDel *dlg = new UCvsTagDel();
00751     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00752     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00753     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00754
00755     if(dlg->DoModal())
00756     {
00757         noRecurs = tab1->m_norecurs;
00758         sLastTag = tab1->m_tagname;
00759
00760         userHitOK = true;
00761     }
00762
00763     delete dlg;
00764 #endif // qUnix
00765 #ifdef qMacCvsPP
00766     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00767     LWindow *theDialog = theHandler.GetDialog();
00768     ThrowIfNil_(theDialog);
00769     static UInt16 sRuntimePanel = 1;
00770
00771     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00772         (theDialog->FindPaneByID(item_MultiViewPrefs));
00773     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00774
00775     multiView->SwitchToPanel(2);
00776     DoDataExchange_Globals(theDialog, true);
00777     multiView->SwitchToPanel(1);
00778     DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, true);
00779
00780     groupView->SetValue(sRuntimePanel);
00781     theDialog->Show();
00782     MessageT hitMessage;
00783     while (true)
00784     {       // Let DialogHandler process events
00785         hitMessage = theHandler.DoDialog();
00786
00787         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00788             break;
00789     }
00790     theDialog->Hide();
00791     sRuntimePanel = groupView->GetValue();
00792
00793     if(hitMessage == msg_OK)
00794     {
00795         multiView->SwitchToPanel(1);
00796         DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, false);
00797         multiView->SwitchToPanel(2);
00798         DoDataExchange_Globals(theDialog, false);
00799         userHitOK = true;
00800     }
00801 #endif /* qMacCvsPP */
00802
00803     if(userHitOK)
00804     {
00805         tagName = sLastTag;
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }

Generated on Fri Jan 31 12:10:41 2003 for WinCvs Source by doxygen 1.3-rc2


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,
kTagBranch
}
Tag dialog type enum. More...

Functions

bool | CompatTagCreate (const MultiFiles *mf, bool &noRecurs, bool &overwriteExisting, UPStr &tagName, bool &checkUnmod)
Get the tag create options.

bool | CompatTagDelete (const MultiFiles *mf, bool &noRecurs, UPStr &tagName)
Get the tag delete options.

bool | CompatTagBranch (const MultiFiles *mf, bool &noRecurs, UPStr &branchName, bool &checkUnmod)
Get the branch options.

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

Tag dialog type enum.

Enumeration values:
kTagAdd | Tag create
kTagDelete | Tag delete
kTagBranch | Branch

Definition at line 49 of file TagDlg.h.

00050 {
00051     kTagAdd,
00052     kTagDelete,
00053     kTagBranch
00054 } kTagDlgType;

Function Documentation

bool CompatTagBranch | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | branchName,
 |  | bool & | checkUnmod
 | ) |

Get the branch options.

Definition at line 814 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kUMainWidget, CTag_MAIN::m_checkUnmod, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_BranchDlg(), and UEventSendMessage().

Referenced by CvsCmdTagBranch().

00817 {
00818     bool userHitOK = false;
00819
00820     static CPStr sLastBranch;
00821
00822     branchName = "";
00823     noRecurs = false;
00824     checkUnmod = false;
00825
00826 #ifdef WIN32
00827     CPropertySheet pages("Create branch settings");
00828     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00829     CTag_MAIN page1(mf, kTagBranch, sLastBranch, noRecurs, checkUnmod);
00830     CGetPrefs_GLOBALS page2;
00831     pages.AddPage(&page1);
00832     pages.AddPage(&page2);
00833     if(pages.DoModal() == IDOK)
00834     {
00835         checkUnmod = page1.m_checkUnmod == TRUE;
00836         noRecurs = page1.m_noRecurs == TRUE;
00837         sLastBranch = page1.m_tagName;
00838
00839         page2.StoreValues();
00840         userHitOK = true;
00841     }
00842 #endif /* WIN32 */
00843 #if qUnix
00844     void *wid = UCreate_BranchDlg();
00845
00846     UCvsTagBranch *dlg = new UCvsTagBranch();
00847     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00848     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00849     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00850
00851     if(dlg->DoModal())
00852     {
00853         checkUnmod = tab1->m_checkunmod;
00854         noRecurs = tab1->m_norecurs;
00855         sLastBranch = tab1->m_tagname;
00856
00857         userHitOK = true;
00858     }
00859
00860     delete dlg;
00861 #endif // qUnix
00862 #ifdef qMacCvsPP
00863     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00864     LWindow *theDialog = theHandler.GetDialog();
00865     ThrowIfNil_(theDialog);
00866     static UInt16 sRuntimePanel = 1;
00867
00868     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00869         (theDialog->FindPaneByID(item_MultiViewPrefs));
00870     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00871
00872     multiView->SwitchToPanel(2);
00873     DoDataExchange_Globals(theDialog, true);
00874     multiView->SwitchToPanel(1);
00875     DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00876         noRecurs, checkUnmod, true);
00877
00878     groupView->SetValue(sRuntimePanel);
00879     theDialog->Show();
00880     MessageT hitMessage;
00881     while (true)
00882     {       // Let DialogHandler process events
00883         hitMessage = theHandler.DoDialog();
00884
00885         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00886             break;
00887     }
00888     theDialog->Hide();
00889     sRuntimePanel = groupView->GetValue();
00890
00891     if(hitMessage == msg_OK)
00892     {
00893         multiView->SwitchToPanel(1);
00894         DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00895             noRecurs, checkUnmod, false);
00896         multiView->SwitchToPanel(2);
00897         DoDataExchange_Globals(theDialog, false);
00898         userHitOK = true;
00899     }
00900 #endif /* qMacCvsPP */
00901
00902     if(userHitOK)
00903     {
00904         branchName = sLastBranch;
00905
00906         gCvsPrefs.save();
00907     }
00908
00909     return userHitOK;
00910 }

bool CompatTagCreate | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | bool & | overwriteExisting,
 |  | UPStr & | tagName,
 |  | bool & | checkUnmod
 | ) |

Get the tag create options.

Definition at line 617 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, 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().

Referenced by CvsCmdTagCreate().

00620 {
00621     bool userHitOK = false;
00622
00623     static CPStr sLastTag;
00624
00625     tagName = "";
00626     noRecurs = false;
00627     overwriteExisting = false;
00628     checkUnmod = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Create tag settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CTag_MAIN page1(mf, kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00634     CGetPrefs_GLOBALS page2;
00635     pages.AddPage(&page1);
00636     pages.AddPage(&page2);
00637     if(pages.DoModal() == IDOK)
00638     {
00639         checkUnmod = page1.m_checkUnmod == TRUE;
00640         noRecurs = page1.m_noRecurs == TRUE;
00641         sLastTag = page1.m_tagName;
00642         overwriteExisting = page1.m_overwriteExisting == TRUE;
00643
00644         page2.StoreValues();
00645         userHitOK = true;
00646     }
00647 #endif /* WIN32 */
00648 #if qUnix
00649     void *wid = UCreate_TagDlg();
00650
00651     UCvsTagCreate *dlg = new UCvsTagCreate();
00652     UCvsTagCreate_MAIN *tab1 =
00653         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00654     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00655     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00656
00657     if(dlg->DoModal())
00658     {
00659         checkUnmod = tab1->m_checkunmod;
00660         noRecurs = tab1->m_norecurs;
00661         sLastTag = tab1->m_tagname;
00662         overwriteExisting = tab1->m_overwrite;
00663
00664         userHitOK = true;
00665     }
00666
00667     delete dlg;
00668 #endif // qUnix
00669 #ifdef qMacCvsPP
00670     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00671     LWindow *theDialog = theHandler.GetDialog();
00672     ThrowIfNil_(theDialog);
00673     static UInt16 sRuntimePanel = 1;
00674
00675     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00676         (theDialog->FindPaneByID(item_MultiViewPrefs));
00677     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00678
00679     multiView->SwitchToPanel(2);
00680     DoDataExchange_Globals(theDialog, true);
00681     multiView->SwitchToPanel(1);
00682     DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00683         noRecurs, overwriteExisting, checkUnmod, true);
00684
00685     groupView->SetValue(sRuntimePanel);
00686     theDialog->Show();
00687     MessageT hitMessage;
00688     while (true)
00689     {       // Let DialogHandler process events
00690         hitMessage = theHandler.DoDialog();
00691
00692         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00693             break;
00694     }
00695     theDialog->Hide();
00696     sRuntimePanel = groupView->GetValue();
00697
00698     if(hitMessage == msg_OK)
00699     {
00700         multiView->SwitchToPanel(1);
00701         DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00702             noRecurs, overwriteExisting, checkUnmod, false);
00703         multiView->SwitchToPanel(2);
00704         DoDataExchange_Globals(theDialog, false);
00705         userHitOK = true;
00706     }
00707 #endif /* qMacCvsPP */
00708
00709     if(userHitOK)
00710     {
00711         tagName = sLastTag;
00712
00713         gCvsPrefs.save();
00714     }
00715
00716     return userHitOK;
00717 }

bool CompatTagDelete | ( | const MultiFiles * | mf,
 |  | bool & | noRecurs,
 |  | UPStr & | tagName
 | ) |

Get the tag delete options.

Definition at line 720 of file TagDlg.cpp.

References CPStr, EV_INIT_WIDGET, kUMainWidget, CTag_MAIN::m_noRecurs, CTag_MAIN::m_tagName, CGetPrefs_GLOBALS::StoreValues(), TRUE, UCreate_UntagDlg(), and UEventSendMessage().

Referenced by CvsCmdTagDelete().

00722 {
00723
00724     bool userHitOK = false;
00725
00726     static CPStr sLastTag;
00727
00728     tagName = "";
00729     noRecurs = false;
00730
00731 #ifdef WIN32
00732     CPropertySheet pages("Delete tag settings");
00733     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00734     CTag_MAIN page1(mf, kTagDelete, sLastTag, noRecurs);
00735     CGetPrefs_GLOBALS page2;
00736     pages.AddPage(&page1);
00737     pages.AddPage(&page2);
00738     if(pages.DoModal() == IDOK)
00739     {
00740         noRecurs = page1.m_noRecurs == TRUE;
00741         sLastTag = page1.m_tagName;
00742
00743         page2.StoreValues();
00744         userHitOK = true;
00745     }
00746 #endif /* WIN32 */
00747 #if qUnix
00748     void *wid = UCreate_UntagDlg();
00749
00750     UCvsTagDel *dlg = new UCvsTagDel();
00751     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00752     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00753     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00754
00755     if(dlg->DoModal())
00756     {
00757         noRecurs = tab1->m_norecurs;
00758         sLastTag = tab1->m_tagname;
00759
00760         userHitOK = true;
00761     }
00762
00763     delete dlg;
00764 #endif // qUnix
00765 #ifdef qMacCvsPP
00766     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00767     LWindow *theDialog = theHandler.GetDialog();
00768     ThrowIfNil_(theDialog);
00769     static UInt16 sRuntimePanel = 1;
00770
00771     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00772         (theDialog->FindPaneByID(item_MultiViewPrefs));
00773     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00774
00775     multiView->SwitchToPanel(2);
00776     DoDataExchange_Globals(theDialog, true);
00777     multiView->SwitchToPanel(1);
00778     DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, true);
00779
00780     groupView->SetValue(sRuntimePanel);
00781     theDialog->Show();
00782     MessageT hitMessage;
00783     while (true)
00784     {       // Let DialogHandler process events
00785         hitMessage = theHandler.DoDialog();
00786
00787         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00788             break;
00789     }
00790     theDialog->Hide();
00791     sRuntimePanel = groupView->GetValue();
00792
00793     if(hitMessage == msg_OK)
00794     {
00795         multiView->SwitchToPanel(1);
00796         DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, false);
00797         multiView->SwitchToPanel(2);
00798         DoDataExchange_Globals(theDialog, false);
00799         userHitOK = true;
00800     }
00801 #endif /* qMacCvsPP */
00802
00803     if(userHitOK)
00804     {
00805         tagName = sLastTag;
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }

Generated on Fri Jan 31 12:10:42 2003 for WinCvs Source by doxygen 1.3-rc2


TclGlue.cpp File Reference

common/TclGlue.cpp File Reference

#include "stdafx.h"
#include <stdarg.h>
#include <string.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 "CvsCommands.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 65 of file TclGlue.cpp.

#define __STDC__ 1

Definition at line 65 of file TclGlue.cpp.

#define _TCL_CALLBACK ( f ) f

Definition at line 211 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp(), and tclCvsEntriesProc().

#define DEC_GLUE ( f ) (*f##_glue)

Definition at line 115 of file TclGlue.cpp.

#define DECLC

Definition at line 109 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 162 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 103 of file TclGlue.cpp.

Referenced by tclCvsEntriesProc().

#define Tcl_Alloc GLUE_WRAP(Tcl_Alloc)

Definition at line 170 of file TclGlue.cpp.

#define Tcl_AppendResult GLUE_WRAP(Tcl_AppendResult)

Definition at line 165 of file TclGlue.cpp.

Referenced by CTCLCvsConsole::cvs_out(), LSReport::OnAnyDevice(), LSReport::OnError(), tclCvsBrowserProc(), tclCvsEntriesProc(), tclCvsExitOnErrorProc(), tclCvsLastErrorCodeProc(), tclGetDebugMaskProc(), tclGetFileModTimeProc(), tclHelpProc(), tclSafeRemove(), and tclSetDebugMaskProc().

#define Tcl_Concat GLUE_WRAP(Tcl_Concat)

Definition at line 174 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc(), tclCvsExitOnErrorProc(), tclGetDebugMaskProc(), tclGetFileModTimeProc(), and tclSetDebugMaskProc().

#define Tcl_CreateCommand GLUE_WRAP(Tcl_CreateCommand)

Definition at line 163 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp(), and tclCvsEntriesProc().

#define Tcl_CreateInterp GLUE_WRAP(Tcl_CreateInterp)

Definition at line 164 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail(), and myTcl_CreateInterp().

#define Tcl_DeleteInterp GLUE_WRAP(Tcl_DeleteInterp)

Definition at line 167 of file TclGlue.cpp.

Referenced by CTcl_Interp::IsAvail(), and CTcl_Interp::~CTcl_Interp().

#define Tcl_DStringAppendElement GLUE_WRAP(Tcl_DStringAppendElement)

Definition at line 181 of file TclGlue.cpp.

#define Tcl_DStringEndSublist GLUE_WRAP(Tcl_DStringEndSublist)

Definition at line 177 of file TclGlue.cpp.

#define Tcl_DStringFree GLUE_WRAP(Tcl_DStringFree)

Definition at line 178 of file TclGlue.cpp.

#define Tcl_DStringInit GLUE_WRAP(Tcl_DStringInit)

Definition at line 179 of file TclGlue.cpp.

#define Tcl_DStringResult GLUE_WRAP(Tcl_DStringResult)

Definition at line 180 of file TclGlue.cpp.

#define Tcl_DStringStartSublist GLUE_WRAP(Tcl_DStringStartSublist)

Definition at line 176 of file TclGlue.cpp.

#define Tcl_Eval GLUE_WRAP(Tcl_Eval)

Definition at line 168 of file TclGlue.cpp.

Referenced by CTcl_Interp::DoScript().

#define Tcl_EvalFile GLUE_WRAP(Tcl_EvalFile)

Definition at line 169 of file TclGlue.cpp.

Referenced by CTcl_Interp::DoFile().

#define Tcl_ExprLong GLUE_WRAP(Tcl_ExprLong)

Definition at line 173 of file TclGlue.cpp.

#define Tcl_FindExecutable GLUE_WRAP(Tcl_FindExecutable)

Definition at line 190 of file TclGlue.cpp.

Referenced by myTcl_CreateInterp().

#define Tcl_Free GLUE_WRAP(Tcl_Free)

Definition at line 171 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc(), tclCvsExitOnErrorProc(), tclGetDebugMaskProc(), tclGetFileModTimeProc(), and tclSetDebugMaskProc().

#define Tcl_Init GLUE_WRAP(Tcl_Init)

Definition at line 188 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp(), and CTcl_Interp::IsAvail().

#define Tcl_ListObjAppendElement GLUE_WRAP(Tcl_ListObjAppendElement)

Definition at line 186 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc().

#define Tcl_NewListObj GLUE_WRAP(Tcl_NewListObj)

Definition at line 185 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc().

#define Tcl_NewStringObj GLUE_WRAP(Tcl_NewStringObj)

Definition at line 184 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc().

#define Tcl_Realloc GLUE_WRAP(Tcl_Realloc)

Definition at line 172 of file TclGlue.cpp.

#define Tcl_SetObjResult GLUE_WRAP(Tcl_SetObjResult)

Definition at line 183 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc().

#define Tcl_SetResult GLUE_WRAP(Tcl_SetResult)

Definition at line 166 of file TclGlue.cpp.

#define Tcl_SetVar GLUE_WRAP(Tcl_SetVar)

Definition at line 189 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp().

#define Tcl_SetVar2 GLUE_WRAP(Tcl_SetVar2)

Definition at line 175 of file TclGlue.cpp.

Referenced by tclCvsBrowserProc().

#define Tcl_SourceRCFile GLUE_WRAP(Tcl_SourceRCFile)

Definition at line 187 of file TclGlue.cpp.

Referenced by CTcl_Interp::CTcl_Interp().

#define TclFreeObj GLUE_WRAP(TclFreeObj)

Definition at line 182 of file TclGlue.cpp.

#define UNDEF_STDC

Definition at line 52 of file TclGlue.cpp.

#define USE_TCL 1

Definition at line 35 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 931 of file TclGlue.cpp.

References CStr, CWincvsApp::GetAppModule(), NULL, Tcl_CreateInterp, and Tcl_FindExecutable.

Referenced by CTcl_Interp::CTcl_Interp(), and CTcl_Interp::IsAvail().

00932 {
00933 #if USE_TCL
00934 #   ifdef WIN32
00935     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00936     CStr path;
00937     app->GetAppModule(path);
00938     Tcl_FindExecutable(path);
00939 #   endif
00940 #endif
00941
00942 #   ifdef qMacCvsPP
00943     CStr appPath = CMacCvsApp::GetAppPath();
00944     Tcl_FindExecutable(appPath);
00945 #   endif
00946
00947 #   if USE_TCL
00948     Tcl_Interp *res = Tcl_CreateInterp();
00949     return res;
00950 #   else
00951     return NULL;
00952 #   endif
00953 }

void TclBrowserAppend | ( | const char * | ,
 |  | EntnodeData * | data
 | ) |

Definition at line 924 of file TclGlue.cpp.

References sTclBrowser.

Referenced by cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), and UCvsFiles::OnMacroSel().

00925 {
00926 #if USE_TCL
00927     sTclBrowser.push_back(CTCLBrowserEnt(data));
00928 #endif
00929 }

void TclBrowserReset ( void )

Definition at line 914 of file TclGlue.cpp.

References sTclBrowser.

Referenced by cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), and UCvsFiles::OnMacroSel().

00915 {
00916 #if USE_TCL
00917     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00918 #endif
00919 }

int tclCvsBrowserProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 400 of file TclGlue.cpp.

References CStr, DECLC, ENT_FILE, EntnodeData::GetType(), EntnodeFile::kConflict, EntnodeFile::kOption, EntnodeData::kStatus, EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kVN, sTclBrowser, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, Tcl_ListObjAppendElement, Tcl_NewListObj, Tcl_NewStringObj, TCL_OK, Tcl_SetObjResult, Tcl_SetVar2, and CTcl_Interp::Unixfy().

00401 {
00402     if(argc < 2)
00403     {
00404         Tcl_AppendResult(interp, argv[0], " : Missing arguments\n", 0L);
00405         return TCL_ERROR;
00406     }
00407
00408     std::vector<CTCLBrowserEnt> & browser = clientData != 0L ?
00409         *(std::vector<CTCLBrowserEnt> *)clientData : sTclBrowser;
00410     if(strcmp(argv[1], "get") == 0)
00411     {
00412         if(argc != 2)
00413         {
00414             char *str = Tcl_Concat(argc, argv);
00415             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00416             Tcl_Free(str);
00417             return TCL_ERROR;
00418         }
00419
00420         Tcl_Obj *list = Tcl_NewListObj(0, 0L);
00421         std::vector<CTCLBrowserEnt>::const_iterator i;
00422         for(i = browser.begin(); i != browser.end(); ++i)
00423         {
00424             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00425             CStr path;
00426             entry->GetData()->GetFullPathName(path);
00427             CTcl_Interp::Unixfy(path);
00428
00429             Tcl_Obj * obj = Tcl_NewStringObj(path, path.length());
00430             Tcl_ListObjAppendElement(interp, list, obj);
00431             //TclFreeObj(obj);
00432         }
00433         Tcl_SetObjResult(interp, list);
00434         //TclFreeObj(list);
00435     }
00436     else if(strcmp(argv[1], "info") == 0)
00437     {
00438         if(argc != 4)
00439         {
00440             char *str = Tcl_Concat(argc, argv);
00441             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00442             Tcl_Free(str);
00443             return TCL_ERROR;
00444         }
00445
00446         std::vector<CTCLBrowserEnt>::const_iterator i;
00447         for(i = browser.begin(); i != browser.end(); ++i)
00448         {
00449             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00450             if(entry->IsSamePath(argv[2]))
00451             {
00452                 EntnodeData* data = entry->GetData();
00453                 CStr path, fname, value;
00454                 entry->GetNormalized(path, fname);
00455                 const char *res = Tcl_SetVar2(interp, argv[3], "name", fname, 0);
00456                 if(res == 0L)
00457                     goto err1;
00458
00459                 value = data->GetType() == ENT_FILE ? "file" : "folder";
00460                 res = Tcl_SetVar2(interp, argv[3], "kind", value, 0);
00461                 if(res == 0L)
00462                     goto err1;
00463
00464                 res = Tcl_SetVar2(interp, argv[3], "path", path, 0);
00465                 if(res == 0L)
00466                     goto err1;
00467
00468                 value = (*data)[EntnodeData::kStatus];
00469                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00470                 if(res == 0L)
00471                     goto err1;
00472
00473                 value = data->IsMissing() ? "1" : "0";
00474                 res = Tcl_SetVar2(interp, argv[3], "missing", value, 0);
00475                 if(res == 0L)
00476                     goto err1;
00477
00478                 value = data->IsUnknown() ? "1" : "0";
00479                 res = Tcl_SetVar2(interp, argv[3], "unknown", value, 0);
00480                 if(res == 0L)
00481                     goto err1;
00482
00483                 value = data->IsIgnored() ? "1" : "0";
00484                 res = Tcl_SetVar2(interp, argv[3], "ignored", value, 0);
00485                 if(res == 0L)
00486                     goto err1;
00487
00488                 value = data->IsLocked() ? "1" : "0";
00489                 res = Tcl_SetVar2(interp, argv[3], "locked", value, 0);
00490                 if(res == 0L)
00491                     goto err1;
00492
00493                 value = data->IsUnmodified() ? "0" : "1";
00494                 res = Tcl_SetVar2(interp, argv[3], "modified", value, 0);
00495                 if(res == 0L)
00496                     goto err1;
00497
00498                 value = data->GetDesc();
00499                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00500                 if(res == 0L)
00501                     goto err1;
00502
00503                 if(data->GetType() == ENT_FILE)
00504                 {
00505                     value = (*data)[EntnodeFile::kVN];
00506                     res = Tcl_SetVar2(interp, argv[3], "revision", value, 0);
00507                     if(res == 0L)
00508                         goto err1;
00509
00510                     value = (*data)[EntnodeFile::kTS];
00511                     res = Tcl_SetVar2(interp, argv[3], "timestamp", value, 0);
00512                     if(res == 0L)
00513                         goto err1;
00514
00515                     value = (*data)[EntnodeFile::kOption];
00516                     res = Tcl_SetVar2(interp, argv[3], "option", value, 0);
00517                     if(res == 0L)
00518                         goto err1;
00519
00520                     value = (*data)[EntnodeFile::kTag];
00521                     res = Tcl_SetVar2(interp, argv[3], "tag", value, 0);
00522                     if(res == 0L)
00523                         goto err1;
00524
00525                     value = (*data)[EntnodeFile::kConflict];
00526                     res = Tcl_SetVar2(interp, argv[3], "conflict", value, 0);
00527                     if(res == 0L)
00528                         goto err1;
00529                 }
00530
00531                 goto ok1;
00532 err1:
00533                 Tcl_AppendResult(interp, argv[0], " : Error while creating '", argv[3], "'\n", 0L);
00534                 return TCL_ERROR;
00535 ok1:
00536                 break;
00537             }
00538         }
00539     }
00540     else
00541     {
00542         char *str = Tcl_Concat(argc, argv);
00543         Tcl_AppendResult(interp, argv[0], " : Wrong arguments : '", str, "'\n", 0L);
00544         Tcl_Free(str);
00545         return TCL_ERROR;
00546     }
00547     return TCL_OK;
00548 }

void tclCvsEntriesDeleteProc ( ClientData clientData ) [static]

Definition at line 621 of file TclGlue.cpp.

References DECLC.

00622 {
00623     if(clientData != 0L)
00624         delete (std::vector<CTCLBrowserEnt> *)clientData;
00625 }

int tclCvsEntriesProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 627 of file TclGlue.cpp.

References _TCL_CALLBACK, CStr, ENTNODE::Data(), DECLC, CTcl_Interp::Deunixfy(), Entries_SetMissing(), FileTraverse(), CSortList< T >::Get(), NEW, CSortList< T >::NumOfElements(), Tcl_AppendResult, Tcl_CreateCommand, TCL_ERROR, and TCL_OK.

00628 {
00629     if(argc != 3)
00630     {
00631         Tcl_AppendResult(interp, argv[0], " : Wrong # of arguments\n", 0L);
00632         return TCL_ERROR;
00633     }
00634
00635     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00636
00637     // refetch all items
00638     CFillTclEntries traverse(entries);
00639     CStr path(argv[1]);
00640     CTcl_Interp::Deunixfy(path);
00641     /*kTraversal res = */FileTraverse(path, traverse);
00642
00643     // add the missing files
00644     Entries_SetMissing(entries);
00645
00646     // now make the TCL entries
00647     std::vector<CTCLBrowserEnt> *browser = NEW std::vector<CTCLBrowserEnt>;
00648
00649     int numEntries = entries.NumOfElements();
00650     for(int i = 0; i < numEntries; i++)
00651     {
00652         const ENTNODE & theNode = entries.Get(i);
00653         EntnodeData *data = theNode.Data();
00654         browser->push_back(CTCLBrowserEnt(data));
00655     }
00656
00657     Tcl_Command cmd = Tcl_CreateCommand (interp, argv[2], _TCL_CALLBACK(tclCvsBrowserProc),
00658         (ClientData)browser, tclCvsEntriesDeleteProc);
00659
00660     return cmd != 0L ? TCL_OK : TCL_ERROR;
00661 }

int tclCvsErrProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 391 of file TclGlue.cpp.

References cvs_errstr(), DECLC, and TCL_OK.

00392 {
00393     for(int i = 1; i < argc; i++)
00394     {
00395         cvs_errstr(argv[i], strlen(argv[i]));
00396     }
00397     return TCL_OK;
00398 }

int tclCvsExitOnErrorProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 735 of file TclGlue.cpp.

References DECLC, CTcl_Interp::SetCvsExitOnError(), Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

00736 {
00737     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00738
00739     //
00740     // CvsExitOnError command can be used to define whether TCL macro
00741     // is automatically terminated if CVS command returned error (non zero).
00742     //
00743     // CvsExitOnError has following modes:
00744     //   false  = Do not exit automaticaly. CvsLastErrorCode constains the last error code.
00745     //   true   = Exit TCL script in error (default).
00746     //
00747     if(argc < 2)
00748     {
00749         Tcl_AppendResult(interp, argv[0], " : Missing argument (true|false)\n", 0L);
00750         return TCL_ERROR;
00751     }
00752
00753     if(strcmp(argv[1], "true") == 0)
00754         tcl_interp->SetCvsExitOnError(true);
00755     else if(strcmp(argv[1], "false") == 0)
00756         tcl_interp->SetCvsExitOnError(false);
00757     else
00758     {
00759         char *str = Tcl_Concat(argc, argv);
00760         Tcl_AppendResult(interp, argv[0], " : Wrong argument : '", str, "'\n", 0L);
00761         Tcl_Free(str);
00762
00763         return TCL_ERROR;
00764     }
00765
00766     return TCL_OK;
00767 }

int tclCvsLastErrorCodeProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 769 of file TclGlue.cpp.

References DECLC, CTcl_Interp::GetCvsLastErrorCode(), CTcl_Interp::SetCvsLastErrorCode(), Tcl_AppendResult, and TCL_OK.

00770 {
00771     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00772
00773     if(argc < 2)
00774     {
00775         char value[35];
00776
00777         // CvsLastErrorCode called without arguments, so return current value
00778         sprintf(value, "%d", tcl_interp->GetCvsLastErrorCode());
00779         Tcl_AppendResult(interp, value, 0L);
00780     }
00781     else
00782     {
00783         // Set the value of LastErrorCode variable
00784         tcl_interp->SetCvsLastErrorCode(atoi(argv[1]));
00785     }
00786
00787     return TCL_OK;
00788 }

int tclCvsOutProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 382 of file TclGlue.cpp.

References cvs_outstr(), DECLC, and TCL_OK.

00383 {
00384     for(int i = 1; i < argc; i++)
00385     {
00386         cvs_outstr(argv[i], strlen(argv[i]));
00387     }
00388     return TCL_OK;
00389 }

int tclCvsProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 338 of file TclGlue.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), DECLC, CTcl_Interp::GetCvsExitOnError(), launchCVS(), CTcl_Interp::SetCvsLastErrorCode(), TCL_ERROR, and TCL_OK.

00339 {
00340     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00341     CvsArgs args;
00342
00343     for(int i = 1; i < argc; i++)
00344     {
00345         args.add(argv[i]);
00346     }
00347
00348     CTCLCvsConsole console(interp);
00349     int exitc = launchCVS(0L, args.Argc(), args.Argv(), &console);
00350
00351     //
00352     // Set CvsLastErrorCode value. TCL script can query
00353     // this value using cvslasterrorcode command
00354     //
00355     tcl_interp->SetCvsLastErrorCode(exitc);
00356
00357     //
00358     // If command succeeded then return always TCL_OK and
00359     // proceed with script. If command failed (exitc != 0)
00360     // then exit only if CvsExitOnError is TRUE.
00361     //
00362     if(exitc == 0)
00363         return TCL_OK;
00364     else
00365         return tcl_interp->GetCvsExitOnError() ? TCL_ERROR : TCL_OK;
00366 }

int tclDirProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 704 of file TclGlue.cpp.

References DECLC, FileTraverse(), LSReport::fState, and kTraversal.

00705 {
00706     LSReport report(interp);
00707     char path[256];
00708     getcwd(path, 256);
00709     kTraversal res = FileTraverse(path, report);
00710     return report.fState;
00711 }

int tclGetDebugMaskProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 877 of file TclGlue.cpp.

References DECLC, GetWinCvsDebugMask(), GetWinCvsDebugMaskBit(), NULL, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

00878 {
00879     char retstr[32];
00880     if (argc < 2)
00881     {
00882         _snprintf(retstr,32,"%u",GetWinCvsDebugMask());
00883         Tcl_AppendResult(interp, retstr, 0L);
00884         return TCL_OK;
00885     }
00886
00887     if (argc > 3)
00888     {
00889         char * str = Tcl_Concat(argc, argv);
00890         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00891         Tcl_Free(str);
00892         return TCL_ERROR;
00893     }
00894
00895     char * endc = NULL;
00896     unsigned long n;
00897
00898     n = strtoul(argv[1], & endc, 0);
00899     if (*endc)
00900     {
00901         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00902         return TCL_ERROR;
00903     }
00904
00905     _snprintf(retstr, 32, "%u", GetWinCvsDebugMaskBit(n));
00906     Tcl_AppendResult(interp, retstr, 0L);
00907
00908     return TCL_OK;
00909 }

int tclGetFileModTimeProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 791 of file TclGlue.cpp.

References DECLC, NULL, wnt_stat::st_mtime, Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, TCL_OK, and wnt_stat().

00792 {
00793     struct wnt_stat sb;
00794     struct tm * p_utc = NULL;
00795
00796     if (argc < 2)
00797     {
00798         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00799         return TCL_ERROR;
00800     }
00801
00802     if (argc > 2)
00803     {
00804         char * str = Tcl_Concat(argc, argv);
00805         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00806         Tcl_Free(str);
00807         return TCL_ERROR;
00808     }
00809
00810     if (wnt_stat(argv[1], &sb) != 0)
00811     {
00812         Tcl_AppendResult(interp, argv[0], " : Could not find file : '", argv[1], "'\n", 0L);
00813         return TCL_ERROR;
00814     }
00815
00816     p_utc = gmtime(& sb.st_mtime);
00817     Tcl_AppendResult(interp, asctime(p_utc), 0L);
00818     return TCL_OK;
00819 }

int tclHelpProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 368 of file TclGlue.cpp.

References DECLC, Tcl_AppendResult, and TCL_OK.

00369 {
00370     Tcl_AppendResult(interp, "Help :\n", 0L);
00371     Tcl_AppendResult(interp, "   cvs  : the cvs tool.\n", 0L);
00372     Tcl_AppendResult(interp, "   help : this help.\n", 0L);
00373     Tcl_AppendResult(interp, "Others commands :\n", 0L);
00374     Tcl_AppendResult(interp, "   cd   : change directory\n", 0L);
00375     Tcl_AppendResult(interp, "   pwd  : print current directory\n", 0L);
00376     Tcl_AppendResult(interp, "   ls   : list the current directory\n", 0L);
00377     Tcl_AppendResult(interp, "   info ?  : misc. informations\n", 0L);
00378     Tcl_AppendResult(interp, "   info commands : all the TCL commands\n", 0L);
00379     return TCL_OK;
00380 }

int tclSafeRemove | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 714 of file TclGlue.cpp.

References CompatMoveToTrash(), CStr, cvs_err(), DECLC, CTcl_Interp::Deunixfy(), Tcl_AppendResult, TCL_ERROR, and TCL_OK.

00715 {
00716     if(argc < 2)
00717     {
00718         Tcl_AppendResult(interp, argv[0], " : Missing list of files\n", 0L);
00719         return TCL_ERROR;
00720     }
00721
00722     for(int i = 1; i < argc; i++)
00723     {
00724         CStr fn(argv[i]);
00725         CTcl_Interp::Deunixfy(fn);
00726         if(!CompatMoveToTrash(fn, 0))  // dir is not needed, TCL profides fully qualified file name
00727         {
00728             cvs_err("Unable to trash '%s'\n", (char *)fn);
00729         }
00730     }
00731
00732     return TCL_OK;
00733 }

int tclSetDebugMaskProc | ( | ClientData | clientData,
 |  | Tcl_Interp * | interp,
 |  | int | argc,
 |  | char * | argv[]
 | ) | [static]

Definition at line 821 of file TclGlue.cpp.

References DECLC, NULL, SetWinCvsDebugMask(), SetWinCvsDebugMaskBit(), Tcl_AppendResult, Tcl_Concat, TCL_ERROR, Tcl_Free, and TCL_OK.

00822 {
00823     if (argc < 2)
00824     {
00825         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00826         return TCL_ERROR;
00827     }
00828
00829     if (argc > 3)
00830     {
00831         char * str = Tcl_Concat(argc, argv);
00832         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00833         Tcl_Free(str);
00834         return TCL_ERROR;
00835     }
00836
00837     char * endc = NULL;
00838     unsigned long n;
00839     bool b;
00840
00841     n = strtoul(argv[1], & endc, 0);
00842     if (*endc)
00843     {
00844         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00845         return TCL_ERROR;
00846     }
00847
00848     if (argc == 2)
00849     {
00850         SetWinCvsDebugMask(n);
00851         return TCL_OK;
00852     }
00853
00854
00855     if (!stricmp(argv[2], "true"))
00856     {
00857         b = true;
00858     }
00859     else if (!stricmp(argv[2], "false"))
00860     {
00861         b = false;
00862     }
00863     else
00864     {
00865         b = strtoul(argv[2], & endc, 0) != 0;
00866         if (*endc)
00867         {
00868             Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[2], "'\n", 0L);
00869             return TCL_ERROR;
00870         }
00871     }
00872
00873     SetWinCvsDebugMaskBit(n,b);
00874     return TCL_OK;
00875 }

Variable Documentation

std::vector<CTCLBrowserEnt> sTclBrowser [static]

Definition at line 292 of file TclGlue.cpp.

Referenced by TclBrowserAppend(), TclBrowserReset(), and tclCvsBrowserProc().

Generated on Fri Jan 31 12:10:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 924 of file TclGlue.cpp.

References sTclBrowser.

Referenced by cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), and UCvsFiles::OnMacroSel().

00925 {
00926 #if USE_TCL
00927     sTclBrowser.push_back(CTCLBrowserEnt(data));
00928 #endif
00929 }

void TclBrowserReset ( void )

Definition at line 914 of file TclGlue.cpp.

References sTclBrowser.

Referenced by cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), and UCvsFiles::OnMacroSel().

00915 {
00916 #if USE_TCL
00917     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00918 #endif
00919 }

Generated on Fri Jan 31 12:10:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:44 2003 for WinCvs Source by doxygen 1.3-rc2


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)

Variables

CStaticAllocT< char > | sBuf
int | sBufSize

Define Documentation

#define MAX_TEST_SIZE 100000

Definition at line 64 of file TextBinary.cpp.

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, kTextBinTYPE, TestBuffer(), TestFileIsAlias(), and TestValidName().

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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !TARGET_OS_MAC */
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, kTextBinTYPE, sBufSize, TestBuffer(), TestFileIsAlias(), and TestValidName().

Referenced by AddCvsArgs::FileIsType(), and ImportReport::OnFile().

00342 {
00343     kTextBinTYPE state;
00344
00345 #ifdef TARGET_OS_MAC
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* TARGET_OS_MAC */
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, kTextBinTYPE, TestBuffer(), TestFileIsAlias(), and TestValidName().

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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !TARGET_OS_MAC */
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< char >::AdjustSize(), cvs_err(), kFileIsOK, kFileMissing, kTextBinTYPE, sBuf, and sBufSize.

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 }

kTextBinTYPE TestBuffer | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec,
 |  | kFileType | expectType
 | ) | [static]

Definition at line 104 of file TextBinary.cpp.

References ASSERT, kBinIsText, kBinIsUnicode, kFileIsOK, kFileTypeBin, kFileTypeText, kFileTypeUnicode, kTextBinTYPE, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, kUnicodeIsBinary, kUnicodeIsText, kWin32, sBuf, sBufSize, and TRUE.

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) == TRUE;
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 TARGET_OS_MAC
00138                 && c != (unsigned char)'Ñ' && c != (unsigned char)'¥' /* powerplant */
00139 #endif /* TARGET_OS_MAC */
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, and stat.

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, and kTextBinTYPE.

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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00315
00316     return result;
00317 }

Variable Documentation

CStaticAllocT<char> sBuf [static]

Definition at line 74 of file TextBinary.cpp.

Referenced by FillBuffer(), and TestBuffer().

int sBufSize [static]

Definition at line 75 of file TextBinary.cpp.

Referenced by FileIsText(), FillBuffer(), and TestBuffer().

Generated on Fri Jan 31 12:10:45 2003 for WinCvs Source by doxygen 1.3-rc2


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

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
}
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)

Variables

const char | kPathDelimiter = '\\'

Define Documentation

#define UFSSpec FSSpec

Definition at line 39 of file TextBinary.h.

Referenced by BrowserGetMultiFiles(), BuildIgnoredList(), FileTraverse(), glue_getenv(), MakeTmpFile(), and ImportReport::OnFile().

Typedef Documentation

typedef int FSSpec

Definition at line 38 of file TextBinary.h.

Referenced by BrowserGetDirectory(), LaunchDiff(), CvsPrefs::load(), CPersistent::LoadAll(), and CPersistent::SaveAll().

Enumeration Type Documentation

enum kFileType

File type enum.

Enumeration values:
kFileTypeText | Text type
kFileTypeBin | Binary type
kFileTypeUnicode | Unicode type

Definition at line 77 of file TextBinary.h.

Referenced by ImportReport::OnFile().

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 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(), ImportReport::OnFile(), 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.

References FillBuffer(), kBinIsText, kFileIsOK, kTextBinTYPE, TestBuffer(), TestFileIsAlias(), and TestValidName().

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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !TARGET_OS_MAC */
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.

References FillBuffer(), kFileIsOK, kTextBinTYPE, sBufSize, TestBuffer(), TestFileIsAlias(), and TestValidName().

Referenced by AddCvsArgs::FileIsType(), and ImportReport::OnFile().

00342 {
00343     kTextBinTYPE state;
00344
00345 #ifdef TARGET_OS_MAC
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* TARGET_OS_MAC */
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.

References FillBuffer(), kBinIsText, kFileIsOK, kTextBinTYPE, TestBuffer(), TestFileIsAlias(), and TestValidName().

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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !TARGET_OS_MAC */
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 }

Variable Documentation

const char kPathDelimiter = '\\' [static]

Definition at line 43 of file TextBinary.h.

Generated on Fri Jan 31 12:10:47 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsApp.cpp File Reference

common/UCvsApp.cpp File Reference

#include "stdafx.h"
#include "UCvsApp.h"
#include "UCvsCommands.h"
#include "UCvsFrame.h"
#include "UCvsFolders.h"
#include "UCvsFiles.h"
#include "TclGlue.h"
#include "GetPrefs.h"
#include "CvsArgs.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 480 of file UCvsApp.cpp.

References UWidget::GetWidget().

Referenced by UCvsFiles::OnCreate(), and UCvsFolders::OnCreate().

00481 {
00482 #if qGTK
00483     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00484     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00485 #else
00486     return 0L;
00487 #endif
00488 }

void usage ( void ) [static]

Definition at line 71 of file UCvsApp.cpp.

Referenced by UCvsApp::UCvsApp().

00072 {
00073     fprintf (stderr, "gcvs [--root=path]\n");
00074 }

Generated on Fri Jan 31 12:10:47 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsApp.h File Reference

common/UCvsApp.h File Reference

#include "uwidget.h"
#include "cvsgui_process.h"
#include "BrowseViewModel.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 Fri Jan 31 12:10:48 2003 for WinCvs Source by doxygen 1.3-rc2


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,
kUCvsBrowseToolbarID,
kUCvsFilterToolbarID,
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,
cmdFLAT,
cmdFILTERMASK,
cmdVIEW_ADDED,
cmdVIEW_REMOVED,
cmdVIEW_CHANGED,
cmdHIDE_UNKNOWN,
cmdVIEW_UNKNOWN,
cmdVIEW_MODIFIED,
cmdVIEW_MISSING,
cmdVIEW_CONFLICT,
cmdSELMACRO,
cmdSELMACROEND = cmdSELMACRO + 30,
cmdMACROADMIN,
cmdMACROADMINEND = cmdMACROADMIN + 20,
cmdCREDITS,
cmdCOPYRIGHTS
}

Enumeration Type Documentation

anonymous enum

Enumeration values:
kUCvsFrameID
kUMainConsoleID
kUCvsFoldersID
kUCvsFilesID
kUCvsToolbarID
kUCvsBrowseToolbarID
kUCvsFilterToolbarID
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     kUCvsBrowseToolbarID,       /* the browse toolbar */
00040     kUCvsFilterToolbarID,       /* the filter toolbar */
00041     kUCvsMenubarID              /* the menubar */
00042 };

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
cmdFLAT
cmdFILTERMASK
cmdVIEW_ADDED
cmdVIEW_REMOVED
cmdVIEW_CHANGED
cmdHIDE_UNKNOWN
cmdVIEW_UNKNOWN
cmdVIEW_MODIFIED
cmdVIEW_MISSING
cmdVIEW_CONFLICT
cmdSELMACRO
cmdSELMACROEND
cmdMACROADMIN
cmdMACROADMINEND
cmdCREDITS
cmdCOPYRIGHTS

Definition at line 46 of file UCvsCommands.h.

00047 {
00048     cmdSAVE = EV_COMMAND_START + 100,
00049     cmdSAVE_AS,
00050     cmdPRINT,
00051     cmdPRINT_PREVIEW,
00052     cmdPRINT_SETUP,
00053     cmdSEND_MAIL,
00054     cmdEXIT,
00055     cmdUNDO,
00056     cmdCUT,
00057     cmdCOPY,
00058     cmdPASTE,
00059     cmdSELECT_ALL,
00060     cmdCLEAR_ALL,
00061     cmdFIND,
00062     cmdREPEAT,
00063     cmdFONT,
00064     cmdTOOLBAR,
00065     cmdSTATUS_BAR,
00066     cmdBROWSER_BAR,
00067     cmdFILES_BAR,
00068     cmdMULTI_BAR,
00069     cmdTAGS_BAR,
00070     cmdCONSOLE_BAR,
00071     cmdWORKSPACE,
00072     cmdOPEN,
00073     cmdPREFERENCES,
00074     cmdCMDLINE,
00075     cmdLOGIN,
00076     cmdLOGOUT,
00077     cmdSTOPCVS,
00078     cmdINIT,
00079     cmdIMPORT,
00080     cmdCHECKOUT,
00081     cmdRTAGCREATE,
00082     cmdRTAGDELETE,
00083     cmdRTAGBRANCH,
00084     cmdUPDATE,
00085     cmdCOMMIT,
00086     cmdADD,
00087     cmdADDB,
00088     cmdRMV,
00089     cmdTRASH,
00090     cmdTAGNEW,
00091     cmdTAGDELETE,
00092     cmdTAGBRANCH,
00093     cmdEXPLORE,
00094     cmdQUERYUPDATE,
00095     cmdRELOAD,
00096     cmdEDITSEL,
00097     cmdEDITSELDEF,
00098     cmdDIFF,
00099     cmdLOG,
00100     cmdSTATUS,
00101     cmdGRAPH,
00102     cmdLOCKF,
00103     cmdUNLOCKF,
00104     cmdEDIT,
00105     cmdUNEDIT,
00106     cmdWATCHON,
00107     cmdWATCHOFF,
00108     cmdRELEASE,
00109     cmdWATCHERS,
00110     cmdEDITORS,
00111     cmdCASCADE,
00112     cmdTILE_HORZ,
00113     cmdARRANGE,
00114     cmdFINDER,
00115     cmdCVS,
00116     cmdCVSCLIENT,
00117     cmdABOUT,
00118     cmdIGNORE,
00119     cmdUPFOLDER,
00120     cmdSAVESETTINGS,
00121     cmdFLAT,
00122     cmdFILTERMASK,
00123     cmdVIEW_ADDED,
00124     cmdVIEW_REMOVED,
00125     cmdVIEW_CHANGED,
00126     cmdHIDE_UNKNOWN,
00127     cmdVIEW_UNKNOWN,
00128     cmdVIEW_MODIFIED,
00129     cmdVIEW_MISSING,
00130     cmdVIEW_CONFLICT,
00131
00132     cmdSELMACRO, // contiguous BEGIN
00133     cmdSELMACROEND = cmdSELMACRO + 30,
00134
00135     cmdMACROADMIN, // contiguous BEGIN
00136     cmdMACROADMINEND = cmdMACROADMIN + 20,
00137
00138     cmdCREDITS, // contiguous BEGIN
00139     cmdCOPYRIGHTS // END
00140 };

Generated on Fri Jan 31 12:10:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:10:50 2003 for WinCvs Source by doxygen 1.3-rc2


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)
void * | UCreate_AboutDlg (void)
void * | UCreate_SelTagBranchDlg (void)
void * | UCreate_SelDetailsDlg (void)

Function Documentation

void* UCreate_AboutDlg ( void )

Referenced by AboutDialog().

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 480 of file UCvsApp.cpp.

References UWidget::GetWidget().

Referenced by UCvsFolders::OnCreate(), and UCvsFiles::OnCreate().

00481 {
00482 #if qGTK
00483     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00484     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00485 #else
00486     return 0L;
00487 #endif
00488 }

void* UCreate_SelDetailsDlg ( void )

Referenced by CompatGetSelectionDetails().

void* UCreate_SelTagBranchDlg ( void )

Referenced by CompatGetModuleListItem(), and CompatGetTagListItem().

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 Fri Jan 31 12:10:51 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsFiles.cpp File Reference

common/UCvsFiles.cpp File Reference

#include "stdafx.h"
#include <string>
#include "BrowseViewModel.h"
#include "BrowseViewColumn.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 | KoTraversalContext
Context for traversing. More...

class | TViewFill
Fill the view. More...

Defines

#define | NAMESPACE(w) ::
#define | CBrowseFileView UCvsFiles

Enumerations

enum {
kFileIconText = 0,
kFileIconBinary,
kFileIconUnknown,
kFileIconAdded,
kFileIconConflict,
kFileIconMiss,
kFolderIcon,
kFolderIconUnknown,
kFolderIconMiss,
kFileIconTextMod,
kFileIconBinaryMod,
kFileIconIgnored,
kFolderIconIgnored,
kFileIconRemoved
}

Functions

void | onFilteringChanged (CObject *obj)
int | gtkCompareWrap (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
CPersistentInt | gFileViewSort ("P_FileViewSort", EntnodeData::kName)
CPersistentBool | gFileViewSortAsc ("P_FileViewSortAsc", true)
CSortParam * gSortParam

Define Documentation

#define CBrowseFileView UCvsFiles

Definition at line 67 of file UCvsFiles.cpp.

#define NAMESPACE ( w ) ::

Definition at line 63 of file UCvsFiles.cpp.

Enumeration Type Documentation

anonymous enum

Enumeration values:
kFileIconText
kFileIconBinary
kFileIconUnknown
kFileIconAdded
kFileIconConflict
kFileIconMiss
kFolderIcon
kFolderIconUnknown
kFolderIconMiss
kFileIconTextMod
kFileIconBinaryMod
kFileIconIgnored
kFolderIconIgnored
kFileIconRemoved

Definition at line 191 of file UCvsFiles.cpp.

00192 {
00193     kFileIconText = 0,
00194     kFileIconBinary,
00195     kFileIconUnknown,
00196     kFileIconAdded,
00197     kFileIconConflict,
00198     kFileIconMiss,
00199     kFolderIcon,
00200     kFolderIconUnknown,
00201     kFolderIconMiss,
00202     kFileIconTextMod,
00203     kFileIconBinaryMod,
00204     kFileIconIgnored,
00205     kFolderIconIgnored,
00206     kFileIconRemoved
00207 };

Function Documentation

int gtkCompareWrap | ( | UWidget * | wid,
 |  | void * | data1,
 |  | void * | data2
 | ) | [static]

Definition at line 1724 of file UCvsFiles.cpp.

References _Compare().

01725 {
01726     return _Compare(data1, data2, gSortParam);
01727 }

void onFilteringChanged ( CObject * obj ) [static]

Filtering changed notification function

Parameters:
obj Browse file view to be notified

Definition at line 541 of file UCvsFiles.cpp.

00542 {
00543         ((UCvsFiles *)obj)->OnFilteringChanged();
00544 }

Variable Documentation

CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName)

Referenced by UCvsFiles::UCvsFiles(), and UCvsFiles::~UCvsFiles().

CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", true)

Referenced by UCvsFiles::UCvsFiles(), and UCvsFiles::~UCvsFiles().

struct CSortParam* gSortParam

Definition at line 220 of file UCvsFiles.cpp.

Referenced by UCvsFiles::Resort().

void* sFileIconAddedIcon [static]

Definition at line 162 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconBinaryIcon [static]

Definition at line 160 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconBinaryModIcon [static]

Definition at line 169 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconConflictIcon [static]

Definition at line 163 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconIgnoredIcon [static]

Definition at line 170 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconMissIcon [static]

Definition at line 164 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconRemovedIcon [static]

Definition at line 172 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconTextIcon [static]

Definition at line 159 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconTextModIcon [static]

Definition at line 168 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFileIconUnknownIcon [static]

Definition at line 161 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFolderIconIcon [static]

Definition at line 165 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFolderIconIgnoredIcon [static]

Definition at line 171 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFolderIconMissIcon [static]

Definition at line 167 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

void* sFolderIconUnknownIcon [static]

Definition at line 166 of file UCvsFiles.cpp.

Referenced by UCvsFiles::GetImageForEntry(), and UCvsFiles::OnCreate().

Generated on Fri Jan 31 12:10:53 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsFiles.h File Reference

common/UCvsFiles.h File Reference

#include "uwidget.h"
#include "CvsEntries.h"
#include "BrowseViewHandlers.h"
#include "BrowseViewModel.h"
#include "BrowseViewColumn.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

Generated on Fri Jan 31 12:10:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 to create an item with all the subdirectories inside for a given path and a root item. More...

class | TBrowserFillDummy
Class to create an item with a dummy item inside if and only if the folder is not empty. More...

class | CTempToggleBool

Enumerations

enum {
kIconFolderClosed,
kIconFolderOpened,
kIconFolderCVSClosed,
kIconFolderCVSOpened,
kIconFolderIgnoreClosed,
kIconFolderIgnoreOpened,
kIconFolderIgnoreLost
}

Functions

void * | GetIcon (UCvsFolders *treeCrtl, UTREEITEM item, bool hasCvsInfos, bool expand, EntnodeData *data)
void | onIgnoreChanged (CObject *obj)

Variables

PCPStr | gOldLoc ("P_BrowserLoc","C:\\")
const char * | gDummyFile = "@@@dummy file@@@"
CMString | gHistoryLocs (100,"P_BrowserLocs")
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 169 of file UCvsFolders.cpp.

References EntnodeData::IsIgnored(), EntnodeData::IsMissing(), EntnodeData::IsUnknown(), kIconFolderClosed, kIconFolderCVSClosed, kIconFolderCVSOpened, kIconFolderIgnoreClosed, kIconFolderIgnoreLost, kIconFolderIgnoreOpened, kIconFolderOpened, sFolderIcon, sFolderIgnoredIcon, sFolderMissingIcon, and sFolderUnknownIcon.

Referenced by CCJFlatButton::DrawButtonIcon(), CCJCBarButton::DrawButtonIcon(), TBrowserFill::ExitDirectory(), TBrowserFillDummy::ExitDirectory(), TBrowserFill::OnDirectory(), and UCvsFolders::OnTreeExpanding().

00170 {
00171     int newImage;
00172     void *result = 0L;
00173
00174     if(data == 0L)
00175     {
00176         if(expand)
00177             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00178         else
00179             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00180     }
00181     else
00182     {
00183         if(expand)
00184         {
00185             if(data->IsIgnored())
00186                 newImage = kIconFolderIgnoreOpened;
00187             else if(data->IsUnknown())
00188                 newImage = kIconFolderOpened;
00189             else if(data->IsMissing())
00190                 newImage = kIconFolderIgnoreLost;
00191             else
00192                 newImage = kIconFolderCVSOpened;
00193         }
00194         else
00195         {
00196             if(data->IsIgnored())
00197                 newImage = kIconFolderIgnoreClosed;
00198             else if(data->IsUnknown())
00199                 newImage = kIconFolderClosed;
00200             else if(data->IsMissing())
00201                 newImage = kIconFolderIgnoreLost;
00202             else
00203                 newImage = kIconFolderCVSClosed;
00204         }
00205     }
00206
00207 #if qGTK
00208     void *pixmap = 0L;
00209     switch(newImage)
00210     {
00211     case kIconFolderClosed:
00212     case kIconFolderOpened:
00213         pixmap = sFolderUnknownIcon;
00214         break;
00215     case kIconFolderCVSClosed:
00216     case kIconFolderCVSOpened:
00217         pixmap = sFolderIcon;
00218         break;
00219     case kIconFolderIgnoreClosed:
00220     case kIconFolderIgnoreOpened:
00221         pixmap = sFolderIgnoredIcon;
00222         break;
00223     case kIconFolderIgnoreLost:
00224         pixmap = sFolderMissingIcon;
00225         break;
00226     }
00227     if(pixmap != 0L)
00228     {
00229         result = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00230     }
00231 #endif
00232
00233     return result;
00234 }

void onIgnoreChanged ( CObject * obj )

Ignore changed notification function

Parameters:
obj Browser view to be notified

Definition at line 482 of file UCvsFolders.cpp.

00483 {
00484     ((UCvsFolders *)obj)->OnCmdIgnore();
00485 }

Variable Documentation

const char* gDummyFile = "@@@dummy file@@@" [static]

Definition at line 59 of file UCvsFolders.cpp.

Referenced by TBrowserFillDummy::ExitDirectory().

CMString gHistoryLocs(100, "P_BrowserLocs") [static]

Referenced by UCvsFolders::ResetBrowser().

PCPStr gOldLoc("P_BrowserLoc", "C:\\") [static]

Referenced by UCvsFolders::OnCreate(), UCvsFolders::ResetBrowser(), and UCvsFolders::SetDefaultRoot().

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 145 of file UCvsFolders.cpp.

Referenced by UCvsFolders::OnTreeSelecting().

Generated on Fri Jan 31 12:10:54 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsFolders.h File Reference

common/UCvsFolders.h File Reference

#include "uwidget.h"
#include "CvsEntries.h"
#include "BrowseViewHandlers.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 Fri Jan 31 12:10:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 "BrowseViewHandlers.h"
#include "AboutDlg.h"

Include dependency graph for UCvsFrame.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool IsAppEnabled ()

Function Documentation

bool IsAppEnabled ( ) [static]

Definition at line 112 of file UCvsFrame.cpp.

References UCvsApp::gApp, and UCvsApp::IsCvsRunning().

Referenced by UCvsFrame::OnCmdUICvsCmd(), UCvsFrame::OnCmdUIFilterMask(), UCvsFrame::OnCmdUIHideUnknown(), UCvsFrame::OnCmdUIMacroAdmin(), UCvsFrame::OnCmdUIStopcvs(), UCvsFrame::OnCmdUIViewAdded(), UCvsFrame::OnCmdUIViewChanged(), UCvsFrame::OnCmdUIViewConflict(), UCvsFrame::OnCmdUIViewIgnored(), UCvsFrame::OnCmdUIViewMissing(), UCvsFrame::OnCmdUIViewModified(), UCvsFrame::OnCmdUIViewRemoved(), UCvsFrame::OnCmdUIViewUnknown(), 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().

00113 {
00114     UCvsApp *app = UCvsApp::gApp;
00115     return !app->IsCvsRunning() && !gCvsPrefs.empty();
00116 }

Generated on Fri Jan 31 12:10:56 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsFrame.h File Reference

common/UCvsFrame.h File Reference

#include "uwidget.h"
#include "UCvsCommands.h"
#include "BrowseViewModel.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 Fri Jan 31 12:10:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 "AppConsole.h"
#include "LogParse.h"

Include dependency graph for UCvsGraph.cpp:

Include dependency graph

Go to the source code of this file.

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 109 of file UCvsGraph.cpp.

References UPen::CreatePen(), UBrush::CreateSolidBrush(), UPen::DeleteObject(), UBrush::DeleteObject(), URect::OffsetRect(), UDC::Rectangle(), UDC::RoundRect(), UDC::SelectObject(), UCOLORREF, and URGB.

00112 {
00113     UPen *pOldPen = 0L;
00114     UBrush *pOldBrush = 0L;
00115     UPen pen, pen2;
00116     UBrush brush;
00117     UCOLORREF selcolor = URGB(160, 160, 160);
00118     UCOLORREF wcolor = URGB(255, 255, 255);
00119
00120     try
00121     {
00122         if(!isRounded)
00123         {
00124             if(!issel)
00125             {
00126                 brush.CreateSolidBrush(wcolor);
00127                 pOldBrush = hdc.SelectObject(&brush);
00128                 pen.CreatePen(UPS_SOLID, 1, contour);
00129                 pOldPen = hdc.SelectObject(&pen);
00130                 hdc.Rectangle(selfB);
00131             }
00132             else
00133             {
00134                 brush.CreateSolidBrush(selcolor);
00135                 pOldBrush = hdc.SelectObject(&brush);
00136                 pen.CreatePen(UPS_SOLID, 1, contour);
00137                 pOldPen = hdc.SelectObject(&pen);
00138                 hdc.Rectangle(selfB);
00139             }
00140         }
00141         else
00142         {
00143             URect shadow;
00144             if(!issel)
00145             {
00146                 brush.CreateSolidBrush(shadowc);
00147                 pOldBrush = hdc.SelectObject(&brush);
00148                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00149                 pOldPen = hdc.SelectObject(&pen);
00150                 shadow = selfB;
00151                 shadow.OffsetRect(UPoint(2, 2));
00152                 hdc.RoundRect(&shadow, UPoint(6, 6));
00153
00154                 brush.DeleteObject();
00155                 brush.CreateSolidBrush(wcolor);
00156                 hdc.SelectObject(&brush);
00157                 pen2.CreatePen(UPS_SOLID, 1, contour);
00158                 hdc.SelectObject(&pen2);
00159                 hdc.RoundRect(selfB, UPoint(6, 6));
00160             }
00161             else
00162             {
00163                 brush.CreateSolidBrush(shadowc);
00164                 pOldBrush = hdc.SelectObject(&brush);
00165                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00166                 pOldPen = hdc.SelectObject(&pen);
00167                 shadow = selfB;
00168                 shadow.OffsetRect(UPoint(2, 2));
00169                 hdc.RoundRect(&shadow, UPoint(6, 6));
00170
00171                 brush.DeleteObject();
00172                 brush.CreateSolidBrush(selcolor);
00173                 hdc.SelectObject(&brush);
00174                 pen2.CreatePen(UPS_SOLID, 1, contour);
00175                 hdc.SelectObject(&pen2);
00176                 hdc.RoundRect(selfB, UPoint(6, 6));
00177             }
00178         }
00179
00180         if (pOldPen != 0L)
00181         {
00182             hdc.SelectObject(pOldPen);
00183             pOldPen = 0L;
00184         }
00185         if (pOldBrush != 0L)
00186         {
00187             hdc.SelectObject(pOldBrush);
00188             pOldBrush = 0L;
00189         }
00190
00191         pen.DeleteObject();
00192         pen2.DeleteObject();
00193         brush.DeleteObject();
00194     }
00195     catch(...)
00196     {
00197         if (pOldPen != 0L)
00198             hdc.SelectObject(pOldPen);
00199         if (pOldBrush != 0L)
00200             hdc.SelectObject(pOldBrush);
00201     }
00202 }

Variable Documentation

const int kHChildSpace = 40

Definition at line 381 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds().

const int kInflateNodeSpace = 8

Definition at line 382 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds().

const int kVChildSpace = 8

Definition at line 380 of file UCvsGraph.cpp.

Referenced by CWinLogData::ComputeBounds().

Generated on Fri Jan 31 12:10:57 2003 for WinCvs Source by doxygen 1.3-rc2


UCvsGraph.h File Reference

common/UCvsGraph.h File Reference

#include "uwidget.h"
#include "CvsLog.h"
#include "udraw.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
class | CScrollView
class | CWinLogBranchData
Windows log branch node data. More...

class | CWinLogData
Windows log data abstract class. More...

class | CWinLogHeaderData
Windows log header node data. More...

class | CWinLogRevData
Windows log revision node data. More...

class | CWinLogTagData
Windows log tag node data. More...

Generated on Fri Jan 31 12:10:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 _i18n, UMENU, UMenuAddButton(), UMenuAddPulldown(), and UMenuAddSeparator().

00056 {
00057     std::vector<CMacroEntry>::const_iterator i;
00058     int cnt;
00059
00060     UMENU menu = UMenuAddPulldown(widid, _i18n("&File"), UMENU_NULL);
00061     UMenuAddButton(widid, _i18n("&Save\tCtrl+S"), menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, _i18n("Save &As..."), menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, _i18n("&Print...\tCtrl+P"), menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, _i18n("Print Pre&view"), menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, _i18n("P&rint Setup..."), menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, _i18n("Sen&d..."), menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, _i18n("E&xit\tCtrl+Q"), menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, _i18n("&Edit"), UMENU_NULL);
00073     UMenuAddButton(widid, _i18n("&Undo\tCtrl+Z"), menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, _i18n("Cu&t\tCtrl+X"), menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, _i18n("&Copy\tCtrl+C"), menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, _i18n("&Paste\tCtrl+V"), menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, _i18n("Select &All\tCtrl+A"), menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, _i18n("&Erase all"), menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, _i18n("&Find...\tCtrl+F"), menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, _i18n("Find next\tF3"), menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, _i18n("F&ont..."), menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, _i18n("&View"), UMENU_NULL);
00088     UMenuAddButton(widid, _i18n("&Toolbar"), menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, _i18n("&Status Bar"), menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, _i18n("&Browser Bar"), menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, _i18n("&Files Bar"), menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, _i18n("&Multi-Users Bar"), menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, _i18n("T&ags Bar"), menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, _i18n("&Console Bar"), menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, _i18n("&Workspace Bar"), menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, _i18n("Change browser &location..."), menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, _i18n("S&ave settings for location..."), menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, _i18n("&Admin"), UMENU_NULL);
00101     UMenuAddButton(widid, _i18n("Pr&eferences...\tCtrl+F1"), menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, _i18n("&Command Line..."), menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, _i18n("&Login..."), menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, _i18n("Lo&gout"), menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, _i18n("&Stop cvs"), menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Create"), UMENU_NULL);
00115     UMenuAddButton(widid, _i18n("&Create a new repository..."), menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, _i18n("Import module..."), menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, _i18n("Checkout module..."), menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, _i18n("&Create a tag by module..."), menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, _i18n("&Delete a tag by module..."), menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, _i18n("Create a &branch by module..."), menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, _i18n("&Modify"), UMENU_NULL);
00125     UMenuAddButton(widid, _i18n("&Update selection...\tCtrl+U"), menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, _i18n("Co&mmit selection...\tCtrl+M"), menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, _i18n("&Add selection"), menu, 0L, cmdADD);
00129     UMenuAddButton(widid, _i18n("Add selection binar&y"), menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, _i18n("&Remove selection"), menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, _i18n("Erase &selection\tCtrl+Backspace"), menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, _i18n("&Create a tag on selection..."), menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, _i18n("&Delete a tag on selection..."), menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, _i18n("Create a &branch on selection..."), menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, _i18n("&Query"), UMENU_NULL);
00139     UMenuAddButton(widid, _i18n("E&xplore selection\tF2"), menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, _i18n("&Query Update\tF4"), menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, _i18n("R&eload view\tF5"), menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, _i18n("View selection\tF7"), menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, _i18n("View default"), menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, _i18n("&Diff selection\tCtrl+D"), menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, _i18n("&Log selection"), menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, _i18n("Status sele&ction"), menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, _i18n("Graph selection\tCtrl+G"), menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, _i18n("&Trace"), UMENU_NULL);
00152     UMenuAddButton(widid, _i18n("Lock selection"), menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, _i18n("Unlock selection"), menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, _i18n("Edit selection"), menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, _i18n("Unedit selection"), menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, _i18n("Add a Watch on selection"), menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, _i18n("Remove a watch from selection"), menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, _i18n("Release selection"), menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, _i18n("Watchers of selection"), menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, _i18n("Editors of selection"), menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Window"), UMENU_NULL);
00171     UMenuAddButton(widid, _i18n("&Cascade"), menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, _i18n("&Tile"), menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, _i18n("&Arrange Icons"), menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, _i18n("&Help"), UMENU_NULL);
00176     UMenuAddButton(widid, _i18n("&Help Topics"), menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, _i18n("Help on cvs-1.10"), menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, _i18n("Help on cvs client"), menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, _i18n("&Credits"), menu, 0L, cmdCREDITS);
00181     UMenuAddButton(widid, _i18n("C&opyrights"), menu, 0L, cmdCOPYRIGHTS);
00182     UMenuAddSeparator(widid, menu);
00183 #ifdef WIN32
00184     UMenuAddButton(widid, _i18n("&About wincvs..."), menu, 0L, cmdABOUT);
00185 #endif
00186 #ifdef qUnix
00187     UMenuAddButton(widid, _i18n("&About gcvs..."), menu, 0L, cmdABOUT);
00188 #endif
00189 }

Generated on Fri Jan 31 12:10:58 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References _i18n, UMENU, UMenuAddButton(), UMenuAddPulldown(), and UMenuAddSeparator().

00056 {
00057     std::vector<CMacroEntry>::const_iterator i;
00058     int cnt;
00059
00060     UMENU menu = UMenuAddPulldown(widid, _i18n("&File"), UMENU_NULL);
00061     UMenuAddButton(widid, _i18n("&Save\tCtrl+S"), menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, _i18n("Save &As..."), menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, _i18n("&Print...\tCtrl+P"), menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, _i18n("Print Pre&view"), menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, _i18n("P&rint Setup..."), menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, _i18n("Sen&d..."), menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, _i18n("E&xit\tCtrl+Q"), menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, _i18n("&Edit"), UMENU_NULL);
00073     UMenuAddButton(widid, _i18n("&Undo\tCtrl+Z"), menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, _i18n("Cu&t\tCtrl+X"), menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, _i18n("&Copy\tCtrl+C"), menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, _i18n("&Paste\tCtrl+V"), menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, _i18n("Select &All\tCtrl+A"), menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, _i18n("&Erase all"), menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, _i18n("&Find...\tCtrl+F"), menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, _i18n("Find next\tF3"), menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, _i18n("F&ont..."), menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, _i18n("&View"), UMENU_NULL);
00088     UMenuAddButton(widid, _i18n("&Toolbar"), menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, _i18n("&Status Bar"), menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, _i18n("&Browser Bar"), menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, _i18n("&Files Bar"), menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, _i18n("&Multi-Users Bar"), menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, _i18n("T&ags Bar"), menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, _i18n("&Console Bar"), menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, _i18n("&Workspace Bar"), menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, _i18n("Change browser &location..."), menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, _i18n("S&ave settings for location..."), menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, _i18n("&Admin"), UMENU_NULL);
00101     UMenuAddButton(widid, _i18n("Pr&eferences...\tCtrl+F1"), menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, _i18n("&Command Line..."), menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, _i18n("&Login..."), menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, _i18n("Lo&gout"), menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, _i18n("&Stop cvs"), menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Create"), UMENU_NULL);
00115     UMenuAddButton(widid, _i18n("&Create a new repository..."), menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, _i18n("Import module..."), menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, _i18n("Checkout module..."), menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, _i18n("&Create a tag by module..."), menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, _i18n("&Delete a tag by module..."), menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, _i18n("Create a &branch by module..."), menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, _i18n("&Modify"), UMENU_NULL);
00125     UMenuAddButton(widid, _i18n("&Update selection...\tCtrl+U"), menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, _i18n("Co&mmit selection...\tCtrl+M"), menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, _i18n("&Add selection"), menu, 0L, cmdADD);
00129     UMenuAddButton(widid, _i18n("Add selection binar&y"), menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, _i18n("&Remove selection"), menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, _i18n("Erase &selection\tCtrl+Backspace"), menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, _i18n("&Create a tag on selection..."), menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, _i18n("&Delete a tag on selection..."), menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, _i18n("Create a &branch on selection..."), menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, _i18n("&Query"), UMENU_NULL);
00139     UMenuAddButton(widid, _i18n("E&xplore selection\tF2"), menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, _i18n("&Query Update\tF4"), menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, _i18n("R&eload view\tF5"), menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, _i18n("View selection\tF7"), menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, _i18n("View default"), menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, _i18n("&Diff selection\tCtrl+D"), menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, _i18n("&Log selection"), menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, _i18n("Status sele&ction"), menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, _i18n("Graph selection\tCtrl+G"), menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, _i18n("&Trace"), UMENU_NULL);
00152     UMenuAddButton(widid, _i18n("Lock selection"), menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, _i18n("Unlock selection"), menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, _i18n("Edit selection"), menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, _i18n("Unedit selection"), menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, _i18n("Add a Watch on selection"), menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, _i18n("Remove a watch from selection"), menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, _i18n("Release selection"), menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, _i18n("Watchers of selection"), menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, _i18n("Editors of selection"), menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Window"), UMENU_NULL);
00171     UMenuAddButton(widid, _i18n("&Cascade"), menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, _i18n("&Tile"), menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, _i18n("&Arrange Icons"), menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, _i18n("&Help"), UMENU_NULL);
00176     UMenuAddButton(widid, _i18n("&Help Topics"), menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, _i18n("Help on cvs-1.10"), menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, _i18n("Help on cvs client"), menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, _i18n("&Credits"), menu, 0L, cmdCREDITS);
00181     UMenuAddButton(widid, _i18n("C&opyrights"), menu, 0L, cmdCOPYRIGHTS);
00182     UMenuAddSeparator(widid, menu);
00183 #ifdef WIN32
00184     UMenuAddButton(widid, _i18n("&About wincvs..."), menu, 0L, cmdABOUT);
00185 #endif
00186 #ifdef qUnix
00187     UMenuAddButton(widid, _i18n("&About gcvs..."), menu, 0L, cmdABOUT);
00188 #endif
00189 }

Generated on Fri Jan 31 12:10:59 2003 for WinCvs Source by doxygen 1.3-rc2


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)
void | CreateBrowseToolbar (void)
void | CreateFilterToolbar (void)

Function Documentation

void CreateBrowseToolbar ( void )

Definition at line 278 of file UCvsToolbar.cpp.

References _i18n, cmdFLAT, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, UTB_INIT::title, UEventSendMessage(), and UTB_INIT::widthbtn.

00279 {
00280     UTB_INIT init;
00281     init.widthbtn = 16;
00282     init.heightbtn = 16;
00283     init.title = "Browse Toolbar";
00284     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_INIT, 0, &init);
00285
00286     UTB_BUTTON flatBtn = {
00287         "flat.xpm",
00288         cmdFLAT,
00289         DDV_NONE,
00290         DDD_NONE,
00291         _i18n("view recursive")
00292     };
00293
00294     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_CHECKBTN, 0, &flatBtn);
00295     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_END, 0, 0L);
00296 }

void CreateFilterToolbar ( void )

Definition at line 298 of file UCvsToolbar.cpp.

References _i18n, cmdHIDE_UNKNOWN, cmdIGNORE, cmdRELOAD, cmdVIEW_ADDED, cmdVIEW_CHANGED, cmdVIEW_CONFLICT, cmdVIEW_MISSING, cmdVIEW_MODIFIED, cmdVIEW_REMOVED, cmdVIEW_UNKNOWN, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, UTB_INIT::title, UEventSendMessage(), and UTB_INIT::widthbtn.

00299 {
00300     UTB_INIT init;
00301     init.widthbtn = 16;
00302     init.heightbtn = 16;
00303     init.title = "Filter Toolbar";
00304     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_INIT, 0, &init);
00305
00306     UTB_BUTTON viewModifiedBtn = {
00307         "viewModified.xpm",
00308         cmdVIEW_MODIFIED,
00309         DDV_NONE,
00310         DDD_NONE,
00311         _i18n("view modified files")
00312     };
00313
00314     UTB_BUTTON viewChangedBtn = {
00315         "viewChanged.xpm",
00316         cmdVIEW_CHANGED,
00317         DDV_NONE,
00318         DDD_NONE,
00319         _i18n("view changed files")
00320     };
00321
00322     UTB_BUTTON viewAddedBtn = {
00323         "viewAdded.xpm",
00324         cmdVIEW_ADDED,
00325         DDV_NONE,
00326         DDD_NONE,
00327         _i18n("view added files")
00328     };
00329
00330     UTB_BUTTON viewRemovedBtn = {
00331         "viewRemove.xpm",
00332         cmdVIEW_REMOVED,
00333         DDV_NONE,
00334         DDD_NONE,
00335         _i18n("view removed files")
00336     };
00337
00338     UTB_BUTTON viewConflictBtn = {
00339         "viewConflict.xpm",
00340         cmdVIEW_CONFLICT,
00341         DDV_NONE,
00342         DDD_NONE,
00343         _i18n("view conflict files")
00344     };
00345
00346     UTB_BUTTON viewUnknownBtn = {
00347         "viewUnknown.xpm",
00348         cmdVIEW_UNKNOWN,
00349         DDV_NONE,
00350         DDD_NONE,
00351         _i18n("view unknown files")
00352     };
00353
00354     UTB_BUTTON hideUnknownBtn = {
00355         "hideUnknown.xpm",
00356         cmdHIDE_UNKNOWN,
00357         DDV_NONE,
00358         DDD_NONE,
00359         _i18n("hide unknown files")
00360     };
00361
00362     UTB_BUTTON viewMissingBtn = {
00363         "viewMissing.xpm",
00364         cmdVIEW_MISSING,
00365         DDV_NONE,
00366         DDD_NONE,
00367         _i18n("view only missing files")
00368     };
00369
00370     UTB_BUTTON viewIgnoredBtn = {
00371         "viewIgnored.xpm",
00372         cmdIGNORE,
00373         DDV_NONE,
00374         DDD_NONE,
00375         _i18n("View or hide the cvs ignored files\nIgnore switch")
00376     };
00377
00378     UTB_BUTTON reloadBtn = {
00379         "reload.xpm",
00380         cmdRELOAD,
00381         DDV_NONE,
00382         DDD_NONE,
00383         _i18n("Refresh the views, updating the contents\nRefresh view")
00384     };
00385
00386     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewModifiedBtn);
00387     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewChangedBtn);
00388     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewAddedBtn);
00389     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewRemovedBtn);
00390     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewConflictBtn);
00391     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00392     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewUnknownBtn);
00393     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &hideUnknownBtn);
00394     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00395     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewMissingBtn);
00396     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewIgnoredBtn);
00397     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00398     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00399     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_END, 0, 0L);
00400 }

void CreateMainToolbar ( void )

Definition at line 54 of file UCvsToolbar.cpp.

References _i18n, cmdADD, cmdADDB, cmdCOMMIT, cmdDIFF, cmdEDIT, cmdEXPLORE, cmdGRAPH, cmdIGNORE, cmdLOCKF, cmdLOG, cmdRELEASE, cmdRMV, cmdSTATUS, cmdSTOPCVS, cmdTAGBRANCH, cmdTAGDELETE, cmdTAGNEW, cmdTRASH, cmdUNEDIT, cmdUNLOCKF, cmdUPDATE, cmdUPFOLDER, cmdWATCHOFF, cmdWATCHON, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, 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         _i18n("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         _i18n("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         _i18n("Stop when cvs is running...\nStop cvs...")
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         _i18n("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 //      _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("Edit the selected files\nEdit selection")
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         _i18n("Unedit the selected files\nUnedit selection")
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         _i18n("Release the selected files\nRelease selection")
00236     };
00237
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00248 //  UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00273     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00274
00275     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00276 }

Generated on Fri Jan 31 12:10:59 2003 for WinCvs Source by doxygen 1.3-rc2


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)
void | CreateBrowseToolbar (void)
void | CreateFilterToolbar (void)

Function Documentation

void CreateBrowseToolbar ( void )

Definition at line 278 of file UCvsToolbar.cpp.

References _i18n, cmdFLAT, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, UTB_INIT::title, UEventSendMessage(), and UTB_INIT::widthbtn.

00279 {
00280     UTB_INIT init;
00281     init.widthbtn = 16;
00282     init.heightbtn = 16;
00283     init.title = "Browse Toolbar";
00284     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_INIT, 0, &init);
00285
00286     UTB_BUTTON flatBtn = {
00287         "flat.xpm",
00288         cmdFLAT,
00289         DDV_NONE,
00290         DDD_NONE,
00291         _i18n("view recursive")
00292     };
00293
00294     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_CHECKBTN, 0, &flatBtn);
00295     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_END, 0, 0L);
00296 }

void CreateFilterToolbar ( void )

Definition at line 298 of file UCvsToolbar.cpp.

References _i18n, cmdHIDE_UNKNOWN, cmdIGNORE, cmdRELOAD, cmdVIEW_ADDED, cmdVIEW_CHANGED, cmdVIEW_CONFLICT, cmdVIEW_MISSING, cmdVIEW_MODIFIED, cmdVIEW_REMOVED, cmdVIEW_UNKNOWN, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, UTB_INIT::title, UEventSendMessage(), and UTB_INIT::widthbtn.

00299 {
00300     UTB_INIT init;
00301     init.widthbtn = 16;
00302     init.heightbtn = 16;
00303     init.title = "Filter Toolbar";
00304     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_INIT, 0, &init);
00305
00306     UTB_BUTTON viewModifiedBtn = {
00307         "viewModified.xpm",
00308         cmdVIEW_MODIFIED,
00309         DDV_NONE,
00310         DDD_NONE,
00311         _i18n("view modified files")
00312     };
00313
00314     UTB_BUTTON viewChangedBtn = {
00315         "viewChanged.xpm",
00316         cmdVIEW_CHANGED,
00317         DDV_NONE,
00318         DDD_NONE,
00319         _i18n("view changed files")
00320     };
00321
00322     UTB_BUTTON viewAddedBtn = {
00323         "viewAdded.xpm",
00324         cmdVIEW_ADDED,
00325         DDV_NONE,
00326         DDD_NONE,
00327         _i18n("view added files")
00328     };
00329
00330     UTB_BUTTON viewRemovedBtn = {
00331         "viewRemove.xpm",
00332         cmdVIEW_REMOVED,
00333         DDV_NONE,
00334         DDD_NONE,
00335         _i18n("view removed files")
00336     };
00337
00338     UTB_BUTTON viewConflictBtn = {
00339         "viewConflict.xpm",
00340         cmdVIEW_CONFLICT,
00341         DDV_NONE,
00342         DDD_NONE,
00343         _i18n("view conflict files")
00344     };
00345
00346     UTB_BUTTON viewUnknownBtn = {
00347         "viewUnknown.xpm",
00348         cmdVIEW_UNKNOWN,
00349         DDV_NONE,
00350         DDD_NONE,
00351         _i18n("view unknown files")
00352     };
00353
00354     UTB_BUTTON hideUnknownBtn = {
00355         "hideUnknown.xpm",
00356         cmdHIDE_UNKNOWN,
00357         DDV_NONE,
00358         DDD_NONE,
00359         _i18n("hide unknown files")
00360     };
00361
00362     UTB_BUTTON viewMissingBtn = {
00363         "viewMissing.xpm",
00364         cmdVIEW_MISSING,
00365         DDV_NONE,
00366         DDD_NONE,
00367         _i18n("view only missing files")
00368     };
00369
00370     UTB_BUTTON viewIgnoredBtn = {
00371         "viewIgnored.xpm",
00372         cmdIGNORE,
00373         DDV_NONE,
00374         DDD_NONE,
00375         _i18n("View or hide the cvs ignored files\nIgnore switch")
00376     };
00377
00378     UTB_BUTTON reloadBtn = {
00379         "reload.xpm",
00380         cmdRELOAD,
00381         DDV_NONE,
00382         DDD_NONE,
00383         _i18n("Refresh the views, updating the contents\nRefresh view")
00384     };
00385
00386     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewModifiedBtn);
00387     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewChangedBtn);
00388     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewAddedBtn);
00389     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewRemovedBtn);
00390     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewConflictBtn);
00391     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00392     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewUnknownBtn);
00393     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &hideUnknownBtn);
00394     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00395     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewMissingBtn);
00396     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewIgnoredBtn);
00397     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00398     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00399     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_END, 0, 0L);
00400 }

void CreateMainToolbar ( void )

Definition at line 54 of file UCvsToolbar.cpp.

References _i18n, cmdADD, cmdADDB, cmdCOMMIT, cmdDIFF, cmdEDIT, cmdEXPLORE, cmdGRAPH, cmdIGNORE, cmdLOCKF, cmdLOG, cmdRELEASE, cmdRMV, cmdSTATUS, cmdSTOPCVS, cmdTAGBRANCH, cmdTAGDELETE, cmdTAGNEW, cmdTRASH, cmdUNEDIT, cmdUNLOCKF, cmdUPDATE, cmdUPFOLDER, cmdWATCHOFF, cmdWATCHON, DDD_NONE, DDV_NONE, UTB_INIT::heightbtn, 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         _i18n("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         _i18n("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         _i18n("Stop when cvs is running...\nStop cvs...")
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         _i18n("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 //      _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("Edit the selected files\nEdit selection")
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         _i18n("Unedit the selected files\nUnedit selection")
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         _i18n("Release the selected files\nRelease selection")
00236     };
00237
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00248 //  UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00273     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00274
00275     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00276 }

Generated on Fri Jan 31 12:11:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
#include "ItemListDlg.h"
#include "GetPrefs.h"

Include dependency graph for UpdateDlg.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool | CompatGetUpdate (const MultiFiles *mf, bool &toStdout, bool &noRecurs, bool &resetSticky, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &createMissDir, bool &getCleanCopy, UPStr &keyword)
Get the update options.

Variables

char * | sDefTagNames []
char * | sDefDateNames []
char * | sDefRevDateNames []
CMString | gRevNames (10,"P_TagNames", sDefTagNames)
CMString | gDateNames (10,"P_DateNames", sDefDateNames)
CMString | gDateOrRevNames (20,"P_RebDateNames", sDefRevDateNames)

Function Documentation

bool CompatGetUpdate | ( | const MultiFiles * | mf,
 |  | bool & | toStdout,
 |  | bool & | noRecurs,
 |  | bool & | resetSticky,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | createMissDir,
 |  | bool & | getCleanCopy,
 |  | UPStr & | keyword
 | ) |

Get the update options.

Definition at line 827 of file UpdateDlg.cpp.

References _i18n, 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_keyword, 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().

Referenced by CvsCmdUpdate().

00835 {
00836     bool userHitOK = false;
00837
00838     static CPStr sLastDate;
00839     static CPStr sLastRev;
00840     static CPStr sLastRev1;
00841     static CPStr sLastRev2;
00842     static CPStr sLastDate1;
00843     static CPStr sLastDate2;
00844
00845     bool hasDate = false;
00846     bool hasRev = false;
00847     bool merge1 = false;
00848     bool merge2 = false;
00849     bool hasDate1 = false;
00850     bool hasDate2 = false;
00851
00852     date = "";
00853     rev = "";
00854     rev1 = "";
00855     rev2 = "";
00856     toStdout = false;
00857     noRecurs = false;
00858     resetSticky = false;
00859     useMostRecent = false;
00860     createMissDir = false;
00861     getCleanCopy = false;
00862     keyword = "";
00863
00864 #ifdef WIN32
00865     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), _i18n("Update settings"));
00866     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00867     CUpdateMain page1;
00868     CUpdateSticky page2(mf, sLastRev, sLastDate, keyword);
00869     CUpdateMerge page3(mf, false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00870     CGetPrefs_GLOBALS page4;
00871     pages.AddPage(&page1);
00872     pages.AddPage(&page2);
00873     pages.AddPage(&page3);
00874     pages.AddPage(&page4);
00875     if(pages.DoModal() == IDOK)
00876     {
00877         toStdout = page1.m_stdout == TRUE;
00878         noRecurs = page1.m_norecurs == TRUE;
00879         resetSticky = page1.m_delsticky == TRUE;
00880         createMissDir = page1.m_createmissdir == TRUE;
00881         getCleanCopy = page1.m_getcleancopy == TRUE;
00882
00883         sLastDate = page2.m_date;
00884         sLastRev = page2.m_rev;
00885         hasDate = page2.m_hasdate == TRUE;
00886         hasRev = page2.m_hasrev == TRUE;
00887         useMostRecent = page2.m_match == TRUE;
00888         keyword = page2.m_keyword;
00889
00890         merge1 = page3.m_merge >= 1;
00891         merge2 = page3.m_merge == 2;
00892         sLastRev1 = page3.m_rev1;
00893         sLastRev2 = page3.m_rev2;
00894         hasDate1 = page3.m_hasDate1 == TRUE;
00895         hasDate2 = page3.m_hasDate2 == TRUE;
00896         sLastDate1 = page3.m_date1;
00897         sLastDate2 = page3.m_date2;
00898
00899         page4.StoreValues();
00900         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00901         userHitOK = true;
00902     }
00903 #endif /* WIN32 */
00904 #ifdef qMacCvsPP
00905     StOptionalDialogHandler theHandler(dlg_Update, gCvsPrefs.HideCommandDlgUpdate(), LCommander::GetTopCommander());
00906     LWindow *theDialog = theHandler.GetDialog();
00907     ThrowIfNil_(theDialog);
00908     static UInt16 sRuntimePanel = 1;
00909
00910     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00911         (theDialog->FindPaneByID(item_MultiViewPrefs));
00912     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00913
00914     multiView->SwitchToPanel(4);
00915     DoDataExchange_Globals(theDialog, true);
00916     multiView->SwitchToPanel(3);
00917     DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, true);
00918     multiView->SwitchToPanel(2);
00919     DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00920     multiView->SwitchToPanel(1);
00921     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00922
00923     groupView->SetValue(sRuntimePanel);
00924
00925     theHandler.ShowDialog();
00926     MessageT hitMessage;
00927     while (true)
00928     {       // Let DialogHandler process events
00929         hitMessage = theHandler.DoDialog();
00930
00931         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00932             break;
00933     }
00934     theDialog->Hide();
00935     sRuntimePanel = groupView->GetValue();
00936
00937     if(hitMessage == msg_OK)
00938     {
00939         multiView->SwitchToPanel(1);
00940         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00941         multiView->SwitchToPanel(2);
00942         DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00943         multiView->SwitchToPanel(3);
00944         DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, false);
00945         multiView->SwitchToPanel(4);
00946         DoDataExchange_Globals(theDialog, false);
00947         gCvsPrefs.SetHideCommandDlgUpdate(theHandler.GetHideCommandDlg());
00948         userHitOK = true;
00949     }
00950 #endif /* qMacCvsPP */
00951 #if qUnix
00952     void *wid;
00953 #   if qGTK
00954     wid = UCreate_UpdateDlg();
00955 #   endif
00956
00957     UCvsUpdate *dlg = new UCvsUpdate();
00958     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00959     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00960     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00961     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00962     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00963     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00964     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00965
00966     if(dlg->DoModal())
00967     {
00968         toStdout = tab1->m_toStdout;
00969         noRecurs = tab1->m_noRecurs;
00970         resetSticky = tab1->m_resetSticky;
00971         createMissDir = tab1->m_createMissDir;
00972         getCleanCopy = tab1->m_getCleanCopy;
00973
00974         sLastDate = tab2->m_date;
00975         sLastRev = tab2->m_rev;
00976         hasDate = tab2->m_hasdate;
00977         hasRev = tab2->m_hasrev;
00978         useMostRecent = tab2->m_match;
00979
00980         merge1 = tab3->m_merge >= 1;
00981         merge2 = tab3->m_merge == 2;
00982         sLastRev1 = tab3->m_rev1;
00983         sLastRev2 = tab3->m_rev2;
00984
00985         userHitOK = true;
00986     }
00987
00988     delete dlg;
00989 #endif // qUnix
00990
00991     if( userHitOK )
00992     {
00993         if( hasDate && !sLastDate.empty() )
00994             date = sLastDate;
00995
00996         if( hasRev && !sLastRev.empty() )
00997             rev = sLastRev;
00998
00999         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
01000         {
01001             rev1 = sLastRev1;
01002             rev2 = sLastRev2;
01003
01004             if( hasDate1 )
01005                 rev1 << ":" << sLastDate1;
01006
01007             if( hasDate2 )
01008                 rev2 << ":" << sLastDate2;
01009         }
01010
01011         if( merge1 && !merge2 && !sLastRev1.empty() )
01012         {
01013             rev1 = sLastRev1;
01014
01015             if( hasDate1 )
01016                 rev1 << ":" << sLastDate1;
01017         }
01018
01019         gCvsPrefs.save();
01020     }
01021
01022     return userHitOK;
01023 }

Variable Documentation

CMString gDateNames(10, "P_DateNames", sDefDateNames)

Definition at line 40 of file AnnotateDlg.h.

CMString gDateOrRevNames(20, "P_RebDateNames", sDefRevDateNames)

Definition at line 52 of file UpdateDlg.h.

CMString gRevNames(10, "P_TagNames", sDefTagNames)

Definition at line 39 of file AnnotateDlg.h.

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 71 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 82 of file UpdateDlg.cpp.

char* sDefTagNames[]

Initial value:

{
    "1.1",
    "1.6.2.4",
    "HEAD",
    "branch-release-1-0",
    0L
}

Definition at line 62 of file UpdateDlg.cpp.

Generated on Fri Jan 31 12:11:01 2003 for WinCvs Source by doxygen 1.3-rc2


UpdateDlg.h File Reference

common/UpdateDlg.h File Reference

#include "CPStr.h"
#include "MultiString.h"
#include "SmartComboBox.h"
#include "KeywordComboBox.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 (const MultiFiles *mf, bool &toStdout, bool &noRecurs, bool &resetSticky, UPStr &date, UPStr &rev, bool &useMostRecent, UPStr &rev1, UPStr &rev2, bool &createMissDir, bool &getCleanCopy, UPStr &keyword)
Get the update options.

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 | ( | const MultiFiles * | mf,
 |  | bool & | toStdout,
 |  | bool & | noRecurs,
 |  | bool & | resetSticky,
 |  | UPStr & | date,
 |  | UPStr & | rev,
 |  | bool & | useMostRecent,
 |  | UPStr & | rev1,
 |  | UPStr & | rev2,
 |  | bool & | createMissDir,
 |  | bool & | getCleanCopy,
 |  | UPStr & | keyword
 | ) |

Get the update options.

Definition at line 827 of file UpdateDlg.cpp.

References _i18n, 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_keyword, 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().

Referenced by CvsCmdUpdate().

00835 {
00836     bool userHitOK = false;
00837
00838     static CPStr sLastDate;
00839     static CPStr sLastRev;
00840     static CPStr sLastRev1;
00841     static CPStr sLastRev2;
00842     static CPStr sLastDate1;
00843     static CPStr sLastDate2;
00844
00845     bool hasDate = false;
00846     bool hasRev = false;
00847     bool merge1 = false;
00848     bool merge2 = false;
00849     bool hasDate1 = false;
00850     bool hasDate2 = false;
00851
00852     date = "";
00853     rev = "";
00854     rev1 = "";
00855     rev2 = "";
00856     toStdout = false;
00857     noRecurs = false;
00858     resetSticky = false;
00859     useMostRecent = false;
00860     createMissDir = false;
00861     getCleanCopy = false;
00862     keyword = "";
00863
00864 #ifdef WIN32
00865     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), _i18n("Update settings"));
00866     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00867     CUpdateMain page1;
00868     CUpdateSticky page2(mf, sLastRev, sLastDate, keyword);
00869     CUpdateMerge page3(mf, false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00870     CGetPrefs_GLOBALS page4;
00871     pages.AddPage(&page1);
00872     pages.AddPage(&page2);
00873     pages.AddPage(&page3);
00874     pages.AddPage(&page4);
00875     if(pages.DoModal() == IDOK)
00876     {
00877         toStdout = page1.m_stdout == TRUE;
00878         noRecurs = page1.m_norecurs == TRUE;
00879         resetSticky = page1.m_delsticky == TRUE;
00880         createMissDir = page1.m_createmissdir == TRUE;
00881         getCleanCopy = page1.m_getcleancopy == TRUE;
00882
00883         sLastDate = page2.m_date;
00884         sLastRev = page2.m_rev;
00885         hasDate = page2.m_hasdate == TRUE;
00886         hasRev = page2.m_hasrev == TRUE;
00887         useMostRecent = page2.m_match == TRUE;
00888         keyword = page2.m_keyword;
00889
00890         merge1 = page3.m_merge >= 1;
00891         merge2 = page3.m_merge == 2;
00892         sLastRev1 = page3.m_rev1;
00893         sLastRev2 = page3.m_rev2;
00894         hasDate1 = page3.m_hasDate1 == TRUE;
00895         hasDate2 = page3.m_hasDate2 == TRUE;
00896         sLastDate1 = page3.m_date1;
00897         sLastDate2 = page3.m_date2;
00898
00899         page4.StoreValues();
00900         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00901         userHitOK = true;
00902     }
00903 #endif /* WIN32 */
00904 #ifdef qMacCvsPP
00905     StOptionalDialogHandler theHandler(dlg_Update, gCvsPrefs.HideCommandDlgUpdate(), LCommander::GetTopCommander());
00906     LWindow *theDialog = theHandler.GetDialog();
00907     ThrowIfNil_(theDialog);
00908     static UInt16 sRuntimePanel = 1;
00909
00910     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00911         (theDialog->FindPaneByID(item_MultiViewPrefs));
00912     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00913
00914     multiView->SwitchToPanel(4);
00915     DoDataExchange_Globals(theDialog, true);
00916     multiView->SwitchToPanel(3);
00917     DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, true);
00918     multiView->SwitchToPanel(2);
00919     DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00920     multiView->SwitchToPanel(1);
00921     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00922
00923     groupView->SetValue(sRuntimePanel);
00924
00925     theHandler.ShowDialog();
00926     MessageT hitMessage;
00927     while (true)
00928     {       // Let DialogHandler process events
00929         hitMessage = theHandler.DoDialog();
00930
00931         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00932             break;
00933     }
00934     theDialog->Hide();
00935     sRuntimePanel = groupView->GetValue();
00936
00937     if(hitMessage == msg_OK)
00938     {
00939         multiView->SwitchToPanel(1);
00940         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00941         multiView->SwitchToPanel(2);
00942         DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00943         multiView->SwitchToPanel(3);
00944         DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, false);
00945         multiView->SwitchToPanel(4);
00946         DoDataExchange_Globals(theDialog, false);
00947         gCvsPrefs.SetHideCommandDlgUpdate(theHandler.GetHideCommandDlg());
00948         userHitOK = true;
00949     }
00950 #endif /* qMacCvsPP */
00951 #if qUnix
00952     void *wid;
00953 #   if qGTK
00954     wid = UCreate_UpdateDlg();
00955 #   endif
00956
00957     UCvsUpdate *dlg = new UCvsUpdate();
00958     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00959     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00960     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00961     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00962     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00963     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00964     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00965
00966     if(dlg->DoModal())
00967     {
00968         toStdout = tab1->m_toStdout;
00969         noRecurs = tab1->m_noRecurs;
00970         resetSticky = tab1->m_resetSticky;
00971         createMissDir = tab1->m_createMissDir;
00972         getCleanCopy = tab1->m_getCleanCopy;
00973
00974         sLastDate = tab2->m_date;
00975         sLastRev = tab2->m_rev;
00976         hasDate = tab2->m_hasdate;
00977         hasRev = tab2->m_hasrev;
00978         useMostRecent = tab2->m_match;
00979
00980         merge1 = tab3->m_merge >= 1;
00981         merge2 = tab3->m_merge == 2;
00982         sLastRev1 = tab3->m_rev1;
00983         sLastRev2 = tab3->m_rev2;
00984
00985         userHitOK = true;
00986     }
00987
00988     delete dlg;
00989 #endif // qUnix
00990
00991     if( userHitOK )
00992     {
00993         if( hasDate && !sLastDate.empty() )
00994             date = sLastDate;
00995
00996         if( hasRev && !sLastRev.empty() )
00997             rev = sLastRev;
00998
00999         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
01000         {
01001             rev1 = sLastRev1;
01002             rev2 = sLastRev2;
01003
01004             if( hasDate1 )
01005                 rev1 << ":" << sLastDate1;
01006
01007             if( hasDate2 )
01008                 rev2 << ":" << sLastDate2;
01009         }
01010
01011         if( merge1 && !merge2 && !sLastRev1.empty() )
01012         {
01013             rev1 = sLastRev1;
01014
01015             if( hasDate1 )
01016                 rev1 << ":" << sLastDate1;
01017         }
01018
01019         gCvsPrefs.save();
01020     }
01021
01022     return userHitOK;
01023 }

Variable Documentation

CMString gDateNames

Definition at line 51 of file UpdateDlg.h.

CMString gDateOrRevNames

Definition at line 52 of file UpdateDlg.h.

CMString gReleasesNames

Definition at line 50 of file UpdateDlg.h.

CMString gRevNames

Definition at line 49 of file UpdateDlg.h.

Generated on Fri Jan 31 12:11:02 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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 Fri Jan 31 12:11:02 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References NULL.

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.

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 Fri Jan 31 12:11:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 UMakeBitmap().

Generated on Fri Jan 31 12:11:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 UASSERT.

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(), UPStr::set(), UStr::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 Fri Jan 31 12:11:19 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References UASSERT.

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 Fri Jan 31 12:11:20 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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.

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 }

bool IsRectEmpty ( const URECT * r ) [inline]

Definition at line 89 of file udraw.cpp.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

Referenced by CopyScreenToBitmap().

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.

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.

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.

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.

References URECT::bottom, URECT::left, MAX, MIN, URECT::right, and URECT::top.

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 Fri Jan 31 12:11:20 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#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 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.

References URECT::bottom, URECT::left, URECT::right, and URECT::top.

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.

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.

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 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.

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.

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.

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.

References URECT::bottom, URECT::left, MAX, MIN, URECT::right, and URECT::top.

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 Fri Jan 31 12:11:21 2003 for WinCvs Source by doxygen 1.3-rc2


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, sRetainedMsgs, STD, UEventSendMessage(), URUNTIME_CLASS, and UTickCount().

Referenced by UCvsApp::PeekPumpAndIdle().

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().

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.

References sRetainedMsgs.

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.

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.

References CAllTargets::Get(), sAllTargets, and STD.

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.

References CAllTargets::Get(), UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole(), UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage().

Referenced by AboutDialog(), UWidget::AddPage(), AskCreatePersistentSettings(), LPseudoWinAttachment::CheckWindowSize(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetDiff(), CompatGetImport(), CompatGetLog(), CompatGetModuleListItem(), CompatGetPassword(), CompatGetPrefs(), CompatGetSelectionDetails(), CompatGetTagListItem(), CompatGetUpdate(), CompatImportFilter(), CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainToolbar(), CvsAlert(), CvsLogParse(), UCvsFolders::DeleteAllItems(), UCvsFiles::DisableGeneric(), UPromptMessage::DoDataExchange(), UEditMessage::DoDataExchange(), UAuthen_SSH::DoDataExchange(), UAuthen_Pserver::DoDataExchange(), UAuthen_Rhosts::DoDataExchange(), UAuthen_Kserver::DoDataExchange(), UAuthen_Gserver::DoDataExchange(), UAuthen_Sspi::DoDataExchange(), USaveSettings::DoDataExchange(), TPseudoWinBehavior::DoEvent(), UWidget::DoModal(), UPseudoPlaceHolder::DoRotate(), UPseudoPageHider::DoRotate(), CPseudoItem::DoubleClick(), TPseudoCustomView::Draw(), LPseudoDrawAttachment::ExecuteSelf(), LMainPseudoAttachment::ExecuteSelf(), TBrowserFillDummy::ExitDirectory(), TBrowserFill::ExitDirectory(), UCvsFolders::GetItemByLocation(), UCvsFiles::HideColumns(), TViewFill::InitItem(), LPseudoWinAttachment::ListenToMessage(), macpp_fecthview(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), UAuthen_SSH::OnCheckName(), UAuthen_SSH::OnCheckOptions(), UAuthen_Pserver::OnCheckPort(), UAuthen_Rhosts::OnCheckPort(), UAuthen_Kserver::OnCheckPort(), UAuthen_Pserver::OnCheckProxy(), UAuthen_SSH::OnCheckRSA(), UAuthen_Rhosts::OnCheckRshName(), UAuthen_Rhosts::OnCheckServerName(), UCvsFiles::OnCmdEditsel(), UCvsFiles::OnCmdEditseldef(), UCvsFiles::OnCmdExplore(), UCvsFolders::OnCmdExplore(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIEditseldef(), UCvsFiles::OnCmdUIExplore(), UCvsFolders::OnCmdUIExplore(), UCvsFiles::OnCmdUIGraph(), UCvsFiles::OnCmdUIMacroSel(), UCvsFolders::OnCmdUIMacrosSel(), UCvsFiles::OnCmdUIRelease(), UCvsFiles::OnCmdUIRmv(), UCvsFiles::OnCmdUITrash(), UCvsFiles::OnCmdUIUpdate(), USaveSettings::OnCopyFrom(), UCvsFiles::OnCreate(), UCvsGraph::OnCreate(), UCvsFiles::OnDblClick(), CDynToolBar::OnDestroy(), TBrowserFill::OnDirectory(), CPseudoDlg::OnInitDialog(), UWidget::OnInitWidget(), CPseudoList::OnLButtonDblClk(), UCvsFiles::OnMacroSel(), CPseudoDraw::OnPaint(), UToolbar::OnTbButton(), UToolbar::OnTbCheckBtn(), UCvsFolders::OnTreeExpanding(), UCvsFolders::OnTreeSelecting(), UCvsFolders::OnUpdateGeneric(), UMacAppMenu::OnUpdateUI(), UMenu::OnUpdateUI(), UToolbar::OnUpdateUI(), UWidget::OnUpdateUI(), UCvsFiles::ProcessSelectionCommand(), UCvsFolders::ProcessSelectionCommand(), UCvsFolders::ResetBrowser(), UCvsFiles::ResetView(), UCvsFolders::ResetView(), UCvsFiles::Resort(), UCvsFolders::RetrievePath(), UCvsFiles::Search(), UCvsFiles::ShowColumns(), 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.

References CAllTargets::Get(), UCmdTarget::kUDispatchHandled, UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole(), UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage().

Referenced by TPseudoAppBehavior::DoMenuCommand(), LMainPseudoAttachment::ExecuteSelf(), UMenu::OnCommands(), and UToolbar::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.

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(TARGET_OS_MAC)
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.

Referenced by UEventGiveTime(), and UEventPostMessage().

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 Fri Jan 31 12:11:22 2003 for WinCvs Source by doxygen 1.3-rc2


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_SETSORTDIR(baseClass, cmdmin, cmdmax)
#define | ON_LIST_DBLCLICK(cmd, hook)
#define | ON_LIST_POPUP(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_SHOWCOLUMNS(baseClass, cmdmin, cmdmax)
#define | ON_LIST_HIDECOLUMNS(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_CLICK(cmd, hook)
#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_CUSTOM_CLICK,
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_POPUP,
EV_LIST_SELECTING,
EV_LIST_SELCOLUMN,
EV_LIST_RESORT,
EV_LIST_SETSORTDIR,
EV_LIST_DBLCLICK,
EV_LIST_RESETALL,
EV_LIST_SETFEEDBACK,
EV_LIST_ADDCOLUMNS,
EV_LIST_SHOWCOLUMNS,
EV_LIST_HIDECOLUMNS,
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 702 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 228 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 344 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 576 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 584 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 588 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 600 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 596 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 592 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 572 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 604 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 608 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 580 of file umain.h.

#define ON_CUSTOM_CLICK | ( | cmd,
 |  | hook | )

Value:

{ EV_CUSTOM_CLICK, epV_VP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void *drawInfo))&hook },

Definition at line 624 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 627 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 631 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 400 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 412 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 408 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 420 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 404 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 424 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 416 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 368 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 308 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 312 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 300 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 304 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 340 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 276 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 432 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 396 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 388 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 380 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 376 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 348 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 216 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 520 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 508 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 500 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 512 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 568 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 564 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 560 of file umain.h.

#define ON_LIST_HIDECOLUMNS | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_HIDECOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListHideColumns },

Definition at line 528 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 556 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 544 of file umain.h.

#define ON_LIST_POPUP | ( | cmd,
 |  | hook | )

Value:

{ EV_LIST_POPUP, epV_IVP, UMSG_RANGE, cmd, cmd, \
        (UPMSG)(void (UCmdTarget::*)(void))&hook },

Definition at line 504 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 516 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 492 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 552 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 548 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 488 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 484 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 536 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 540 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 532 of file umain.h.

#define ON_LIST_SETSORTDIR | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_RESORT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int column, bool dir))&baseClass::OnListSetSortDir },

Definition at line 496 of file umain.h.

#define ON_LIST_SHOWCOLUMNS | ( | baseClass,
 |  | cmdmin,
 |  | cmdmax | )

Value:

{ EV_LIST_SHOWCOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
        (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListShowColumns },

Definition at line 524 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 360 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 296 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 352 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 220 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 316 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 320 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 428 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 436 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 224 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 392 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 336 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 384 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 356 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 364 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 612 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 616 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 620 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 240 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 248 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 244 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 236 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 252 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 232 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 256 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 324 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 460 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 464 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 476 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 448 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 472 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 444 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 440 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 468 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 480 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 452 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 456 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 212 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 204 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 208 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 260 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 264 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 268 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 180 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 184 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 188 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 196 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 288 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 192 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 200 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 372 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 332 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 328 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 292 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 284 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 272 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 280 of file umain.h.

#define STD std::

Definition at line 170 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 686 of file umain.h.

#define UCMD_to_WINCMD ( cmd ) (cmd)

Definition at line 879 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 881 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 677 of file umain.h.

#define UEND_MESSAGE_MAP ( )

Value:

{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 } \
    }; \

Definition at line 698 of file umain.h.

#define UHIWORD ( l ) ((short)(((int)(l) >> 16) & 0xFFFF))

Definition at line 802 of file umain.h.

Referenced by UWidget::DoModal(), and UCmdTarget::UDispatchMessage().

#define UK_ADD 0x6B

Definition at line 846 of file umain.h.

#define UK_ALT 0x20

Definition at line 810 of file umain.h.

Referenced by addAccel(), GetMenuTitle(), and UWinToUMod().

#define UK_BACK 0x08

Definition at line 814 of file umain.h.

#define UK_CANCEL 0x03

Definition at line 813 of file umain.h.

#define UK_CLEAR 0x0C

Definition at line 816 of file umain.h.

#define UK_CONTROL 0x08

Definition at line 808 of file umain.h.

Referenced by addAccel(), GetMenuTitle(), and UWinToUMod().

#define UK_DECIMAL 0x6E

Definition at line 849 of file umain.h.

#define UK_DELETE 0x2E

Definition at line 829 of file umain.h.

#define UK_DIVIDE 0x6F

Definition at line 850 of file umain.h.

#define UK_DOWN 0x28

Definition at line 827 of file umain.h.

#define UK_END 0x23

Definition at line 822 of file umain.h.

#define UK_ESCAPE 0x1B

Definition at line 818 of file umain.h.

#define UK_F1 0x70

Definition at line 851 of file umain.h.

#define UK_F10 0x79

Definition at line 860 of file umain.h.

#define UK_F11 0x7A

Definition at line 861 of file umain.h.

#define UK_F12 0x7B

Definition at line 862 of file umain.h.

#define UK_F13 0x7C

Definition at line 863 of file umain.h.

#define UK_F14 0x7D

Definition at line 864 of file umain.h.

#define UK_F15 0x7E

Definition at line 865 of file umain.h.

#define UK_F16 0x7F

Definition at line 866 of file umain.h.

#define UK_F17 0x80

Definition at line 867 of file umain.h.

#define UK_F18 0x81

Definition at line 868 of file umain.h.

#define UK_F19 0x82

Definition at line 869 of file umain.h.

#define UK_F2 0x71

Definition at line 852 of file umain.h.

#define UK_F20 0x83

Definition at line 870 of file umain.h.

#define UK_F21 0x84

Definition at line 871 of file umain.h.

#define UK_F22 0x85

Definition at line 872 of file umain.h.

#define UK_F23 0x86

Definition at line 873 of file umain.h.

#define UK_F24 0x87

Definition at line 874 of file umain.h.

#define UK_F3 0x72

Definition at line 853 of file umain.h.

#define UK_F4 0x73

Definition at line 854 of file umain.h.

#define UK_F5 0x74

Definition at line 855 of file umain.h.

#define UK_F6 0x75

Definition at line 856 of file umain.h.

#define UK_F7 0x76

Definition at line 857 of file umain.h.

#define UK_F8 0x77

Definition at line 858 of file umain.h.

#define UK_F9 0x78

Definition at line 859 of file umain.h.

#define UK_HELP 0x2F

Definition at line 830 of file umain.h.

#define UK_HOME 0x24

Definition at line 823 of file umain.h.

#define UK_INSERT 0x2D

Definition at line 828 of file umain.h.

#define UK_LBUTTON 0x01

Definition at line 805 of file umain.h.

Referenced by UCvsGraph::OnBtnClick().

#define UK_LEFT 0x25

Definition at line 824 of file umain.h.

#define UK_MBUTTON 0x02

Definition at line 806 of file umain.h.

Referenced by UWinToUMod().

#define UK_MINUS 0x6D

Definition at line 833 of file umain.h.

#define UK_MULTIPLY 0x6A

Definition at line 845 of file umain.h.

#define UK_NEXT 0x22

Definition at line 821 of file umain.h.

#define UK_NUMPAD0 0x60

Definition at line 835 of file umain.h.

#define UK_NUMPAD1 0x61

Definition at line 836 of file umain.h.

#define UK_NUMPAD2 0x62

Definition at line 837 of file umain.h.

#define UK_NUMPAD3 0x63

Definition at line 838 of file umain.h.

#define UK_NUMPAD4 0x64

Definition at line 839 of file umain.h.

#define UK_NUMPAD5 0x65

Definition at line 840 of file umain.h.

#define UK_NUMPAD6 0x66

Definition at line 841 of file umain.h.

#define UK_NUMPAD7 0x67

Definition at line 842 of file umain.h.

#define UK_NUMPAD8 0x68

Definition at line 843 of file umain.h.

#define UK_NUMPAD9 0x69

Definition at line 844 of file umain.h.

#define UK_PLUS 0x6B

Definition at line 832 of file umain.h.

#define UK_PRIOR 0x21

Definition at line 820 of file umain.h.

#define UK_RBUTTON 0x04

Definition at line 807 of file umain.h.

Referenced by UWinToUMod().

#define UK_RETURN 0x0D

Definition at line 817 of file umain.h.

#define UK_RIGHT 0x27

Definition at line 826 of file umain.h.

#define UK_SEPARATOR 0x6C

Definition at line 847 of file umain.h.

#define UK_SHIFT 0x10

Definition at line 809 of file umain.h.

Referenced by UWinToUMod().

#define UK_SPACE 0x20

Definition at line 819 of file umain.h.

#define UK_SUBTRACT 0x6D

Definition at line 848 of file umain.h.

#define UK_TAB 0x09

Definition at line 815 of file umain.h.

#define UK_UP 0x26

Definition at line 825 of file umain.h.

#define ULOWORD ( l ) ((short)(l))

Definition at line 801 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 800 of file umain.h.

Referenced by UWidget::AddPage(), CvsLogParse(), UCvsFiles::DisableGeneric(), USaveSettings::DoDataExchange(), UAuthen_Sspi::DoDataExchange(), UAuthen_Gserver::DoDataExchange(), UAuthen_Kserver::DoDataExchange(), UAuthen_Rhosts::DoDataExchange(), UAuthen_Pserver::DoDataExchange(), UAuthen_SSH::DoDataExchange(), TPseudoWinBehavior::DoEvent(), UWidget::DoModal(), UPseudoPlaceHolder::DoRotate(), CPseudoItem::DoubleClick(), UCvsFiles::HideColumns(), TViewFill::InitItem(), LPseudoWinAttachment::ListenToMessage(), UWidget::OnBlockHandler(), 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::OnCmdEditsel(), UCvsFiles::OnCmdEditseldef(), UCvsFiles::OnCmdExplore(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIEditseldef(), UCvsFiles::OnCmdUIExplore(), UCvsFiles::OnCmdUIGraph(), UCvsFiles::OnCmdUIMacroSel(), UCvsFiles::OnCmdUIRelease(), UCvsFiles::OnCmdUIRmv(), UCvsFiles::OnCmdUITrash(), UCvsFiles::OnCmdUIUpdate(), UWidget::OnComboAppend(), USaveSettings::OnCopyFrom(), UCvsFiles::OnCreate(), UCvsFiles::OnDblClick(), UWidget::OnInitWidget(), CPseudoList::OnLButtonDblClk(), UCvsFiles::OnMacroSel(), UWidget::OnPageChanged(), UCvsFolders::OnTreeExpanding(), UWidget::OnTreeInsert(), UWidget::OnUnblockHandler(), UCvsFiles::ProcessSelectionCommand(), UCvsFolders::ResetBrowser(), UCvsFolders::ResetView(), UCvsFiles::ResetView(), UCvsFiles::Resort(), UCvsFiles::Search(), UCvsFiles::ShowColumns(), CPseudoItem::SingleClick(), UCvsFolders::StepToLocation(), UWaitCursor::UWaitCursor(), UWinPseudoWindowProc(), and UWaitCursor::~UWaitCursor().

#define UMENU_NULL ((UMENU)0L)

Definition at line 887 of file umain.h.

Referenced by UWidget::OnComboGetMenu(), UMenuAddButton(), UMenuAddPulldown(), UMenuAddSeparator(), and UMenuAddToggle().

#define UTB_SEPARATOR (-1)

Definition at line 890 of file umain.h.

#define WINCMD_DLG_END 3000

Definition at line 878 of file umain.h.

#define WINCMD_DLG_START 2000

Definition at line 877 of file umain.h.

#define WINCMD_to_UCMD ( cmd ) (cmd)

Definition at line 880 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 882 of file umain.h.

Referenced by UWinPseudoWindowProc(), and WinInitWidgets().

Typedef Documentation

typedef int(* UListSorter)(UWidget *wid, void *data1, void *data2)

Definition at line 984 of file umain.h.

typedef long UMENU

Definition at line 886 of file umain.h.

Referenced by PyMenuMgr::Create(), CreateMainMenubar(), cvsgui_GetTopMacroAdminMenu(), cvsgui_GetTopMacroSelectionMenu(), UMenuAddButton(), UMenuAddPulldown(), UMenuAddSeparator(), and UMenuAddToggle().

typedef void(UCmdTarget::* UPMSG)(void)

Definition at line 178 of file umain.h.

typedef void* UTREEITEM

Definition at line 954 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems(), UCvsFolders::GetItemByLocation(), UCvsFolders::OnCmdExplore(), UCvsFolders::OnCmdMacrosSel(), UCvsFolders::OnCmdUIExplore(), UCvsFolders::OnCmdUIMacrosSel(), UCvsFolders::OnUpdateGeneric(), UCvsFolders::ProcessSelectionCommand(), UCvsFolders::ResetView(), UCvsFolders::StepToLocation(), and UCvsFolders::StoreExpanded().

Enumeration Type Documentation

enum UCURSOR

Enumeration values:
uCursArrow
uCursWatch

Definition at line 933 of file umain.h.

00934 {
00935     uCursArrow,
00936     uCursWatch
00937 } 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 636 of file umain.h.

00637 {
00638     epNone,
00639     epV_V,      // void (void)
00640     epV_VP,     // void (arg2)
00641     epV_iVP,    // void (arg1, arg2)
00642     epV_IVP,    // void (HI(arg1), arg2)
00643     epV_i,      // void (arg1)
00644     epV_I,      // void (HI(arg1))
00645     epV_ii,     // void (LO(arg1), HI(arg1))
00646     epV_iii,    // void (LO(arg1), HI(arg1), (int)arg2)
00647     epV_iiVP,   // void (LO(arg1), HI(arg1), arg2)
00648     epi_i,      // int (arg1)
00649     epi_V,      // int (void)
00650     epi_ii,     // int (LO(arg1), HI(arg1))
00651     epi_iVP,    // int (arg1, arg2)
00652     epi_VP      // int (arg2)
00653 } 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_CUSTOM_CLICK
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_POPUP
EV_LIST_SELECTING
EV_LIST_SELCOLUMN
EV_LIST_RESORT
EV_LIST_SETSORTDIR
EV_LIST_DBLCLICK
EV_LIST_RESETALL
EV_LIST_SETFEEDBACK
EV_LIST_ADDCOLUMNS
EV_LIST_SHOWCOLUMNS
EV_LIST_HIDECOLUMNS
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     EV_CUSTOM_CLICK,    /* void OnCustimClick<Cmd>(void *drawInfo) */
00109
00110     /* tree */
00111     EV_TREE_RESETALL,   /* void OnTreeResetAll(int cmd) */
00112     EV_TREE_INSERT,     /* void OnTreeInsert(int cmd, UTREE_INSERT *data) */
00113     EV_TREE_GETINFO,    /* void OnTreeGetInfo(int cmd, UTREE_INFO *data) */
00114     EV_TREE_SETDATA,    /* void OnTreeSetData(int cmd, UTREE_INFO *data) */
00115     EV_TREE_SETICON,    /* void OnTreeSetIcon(int cmd, UTREE_INFO *data) */
00116     EV_TREE_DELETE,     /* void OnTreeDelete(int cmd, UTREEITEM item) */
00117     EV_TREE_EXPANDING,  /* void OnTreeExpanding<cmd>(int collapse, UTREEITEM item) */
00118     EV_TREE_SELECTING,  /* void OnTreeSelecting<cmd>(int deselecting, UTREEITEM item) */
00119     EV_TREE_EXPAND,     /* void OnTreeExpand(int cmd, int collapse, UTREEITEM item) */
00120     EV_TREE_SELECT,     /* void OnTreeSelect(int cmd, int deselect, UTREEITEM item) */
00121     EV_TREE_GETSEL,     /* void OnTreeGetSel(int cmd, UTREEITEM *item) */
00122
00123     /* list */
00124     EV_LIST_POPUP,          /* void OnListChange<Cmd>(int entry, const char *txt) */
00125     EV_LIST_SELECTING,      /* void OnListChange<Cmd>(int entry, const char *txt) */
00126     EV_LIST_SELCOLUMN,      /* void OnListSelColumn<Cmd>(int entry) */
00127     EV_LIST_RESORT,         /* void OnListResort(int cmd, int column, UListSorter s) */
00128     EV_LIST_SETSORTDIR,     /* void OnListSetSortDir(int cmd, int column, bool dir) */
00129     EV_LIST_DBLCLICK,       /* void OnListDblClick<Cmd>(void) */
00130     EV_LIST_RESETALL,       /* void OnListResetAll(int cmd) */
00131     EV_LIST_SETFEEDBACK,    /* void OnListSetFeedback(int cmd, int turnOn) */
00132     EV_LIST_ADDCOLUMNS,     /* void OnListAddColumns(int cmd, int num) */
00133     EV_LIST_SHOWCOLUMNS,    /* void OnListShowColumns(int cmd, int num) */
00134     EV_LIST_HIDECOLUMNS,    /* void OnListHideColumns(int cmd, int num) */
00135     EV_LIST_SETCOLTITLE,    /* void OnListSetColTitle(int cmd, int num, const char *title) */
00136     EV_LIST_SETCOLWIDTH,    /* void OnListSetColWidth(int cmd, int num, int width) */
00137     EV_LIST_NEWROW,         /* void OnListNewRow(int cmd, int *num) */
00138     EV_LIST_ROWSETDATA,     /* void OnListRowSetData(int cmd, int row, void *data) */
00139     EV_LIST_ROWGETDATA,     /* void OnListRowGetData(int cmd, int row, void **data) */
00140     EV_LIST_INSERT,         /* void OnListInsert(int cmd, ULIST_INSERT *data) */
00141     EV_LIST_ADDSEL,         /* void OnListAddSel(int cmd, int entry) */
00142     EV_LIST_DELROW,         /* void OnListDelRow(int cmd, int row) */
00143     EV_LIST_GETNEXTSEL,     /* int OnListGetNextSel(int cmd, int selectedCell) */
00144     EV_LIST_GETINFO,        /* void OnListGetInfo(int cmd, ULIST_INFO *data) */
00145     EV_LIST_GETNEXT,        /* int OnListGetNext(int cmd, int whichCell) */
00146
00147     /* combo */
00148     EV_COMBO_RESETALL,  /* void OnComboResetAll(int cmd) */
00149     EV_COMBO_APPEND,    /* void OnComboAppend(int cmd, const char *str) */
00150     EV_COMBO_SETSEL,    /* void OnComboSetPos(int cmd, int pos) */
00151     EV_COMBO_GETSEL,    /* int OnComboGetPos(int cmd, UStr *txt) */
00152     EV_COMBO_SEL,       /* void OnComboSel<Cmd>(int pos, const char *txt) */
00153     EV_COMBO_GETCOUNT,  /* int OnComboGetCount(int cmd) */
00154     EV_COMBO_DELSEL,    /* void OnComboDelSel(int cmd, int pos) */
00155     EV_COMBO_ENABLESEL, /* void OnComboEnableSel(int cmd, int pos, int state) */
00156     EV_COMBO_GETMENU,   /* void OnComboGetMenu(int cmd, UMENU *menu) */
00157
00158     /* smart combo (Win32 only at the moment)*/
00159     EV_SMARTCOMBO_SETFEATURE,   /* void OnSmartComboSetFeature(int cmd, int feature) */
00160     EV_SMARTCOMBO_SETITEMS  ,   /* void OnSmartComboSetItems(int cmd, CMString* items) */
00161     EV_SMARTCOMBO_SETREADONLY,  /* void OnSmartComboSetReadOnly(int cmd, bool readOnly) */
00162
00163     /* user defined */
00164     EV_COMMAND_START = 1000
00165 } UEventType;

enum UMSG_EXT

Enumeration values:
UMSG_NOEXT
UMSG_RANGE

Definition at line 655 of file umain.h.

00656 {
00657     UMSG_NOEXT,
00658     UMSG_RANGE
00659 } UMSG_EXT;

enum UTB_DROP

Enumeration values:
DDD_NONE

Definition at line 905 of file umain.h.

00906 {
00907     DDD_NONE = 0x00
00908 } UTB_DROP;

enum UTB_VAR

Enumeration values:
DDV_NONE

Definition at line 900 of file umain.h.

00901 {
00902     DDV_NONE
00903 } UTB_VAR;

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(), UMenu::OnCommands(), UToolbar::OnCommands(), UMacAppMenu::OnUpdateUI(), UMenu::OnUpdateUI(), and UToolbar::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, sRetainedMsgs, STD, UEventSendMessage(), URUNTIME_CLASS, and UTickCount().

Referenced by UCvsApp::PeekPumpAndIdle().

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().

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.

References sRetainedMsgs.

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.

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.

References CAllTargets::Get(), sAllTargets, and STD.

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.

References CAllTargets::Get(), UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole(), UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage().

Referenced by AboutDialog(), UWidget::AddPage(), AskCreatePersistentSettings(), LPseudoWinAttachment::CheckWindowSize(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetDiff(), CompatGetImport(), CompatGetLog(), CompatGetModuleListItem(), CompatGetPassword(), CompatGetPrefs(), CompatGetSelectionDetails(), CompatGetTagListItem(), CompatGetUpdate(), CompatImportFilter(), CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainToolbar(), CvsAlert(), CvsLogParse(), UCvsFolders::DeleteAllItems(), UCvsFiles::DisableGeneric(), USaveSettings::DoDataExchange(), UAuthen_Sspi::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(), UCvsFiles::HideColumns(), TViewFill::InitItem(), 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(), UCvsFiles::OnCmdEditsel(), UCvsFiles::OnCmdEditseldef(), UCvsFolders::OnCmdExplore(), UCvsFiles::OnCmdExplore(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIEditseldef(), UCvsFolders::OnCmdUIExplore(), UCvsFiles::OnCmdUIExplore(), UCvsFiles::OnCmdUIGraph(), UCvsFiles::OnCmdUIMacroSel(), UCvsFolders::OnCmdUIMacrosSel(), UCvsFiles::OnCmdUIRelease(), UCvsFiles::OnCmdUIRmv(), UCvsFiles::OnCmdUITrash(), UCvsFiles::OnCmdUIUpdate(), USaveSettings::OnCopyFrom(), UCvsGraph::OnCreate(), UCvsFiles::OnCreate(), UCvsFiles::OnDblClick(), CDynToolBar::OnDestroy(), TBrowserFill::OnDirectory(), 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::ProcessSelectionCommand(), UCvsFiles::ProcessSelectionCommand(), UCvsFolders::ResetBrowser(), UCvsFolders::ResetView(), UCvsFiles::ResetView(), UCvsFiles::Resort(), UCvsFolders::RetrievePath(), UCvsFiles::Search(), UCvsFiles::ShowColumns(), 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.

References CAllTargets::Get(), UCmdTarget::kUDispatchHandled, UCmdTarget::kUNoDispatchInfo, sAllTargets, STD, UAppConsole(), UASSERT, UCmdTarget::UDispatchInfo, and UCmdTarget::UDispatchMessage().

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.

References sTooltipHandler.

00669 {
00670     sTooltipHandler = handler;
00671 }

HBITMAP UMakeBitmap | ( | char ** | icon,
 |  | int & | width,
 |  | int & | height,
 |  | COLORREF | back
 | ) |

Definition at line 97 of file umenu.cpp.

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.

Referenced by UWidget::AddTimer(), and UEventGiveTime().

00744 {
00745 #ifdef WIN32
00746     return ::GetTickCount();
00747 #elif defined(TARGET_OS_MAC)
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 Fri Jan 31 12:11:28 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#define CTRL_STROKE "Ctrl+"

Definition at line 243 of file umenu.cpp.

#define CTRLALT_STROKE "Ctrl+Alt+"

Definition at line 242 of file umenu.cpp.

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 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(), GetMenuTitle(), UObject::IsKindOf(), UASSERT, UCMD_to_WINCMD, UEventQueryWidget(), UEventSendMessage(), UMakeBitmap(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References GetMenuTitle(), UWidget::GetWidget(), UObject::IsKindOf(), UEventQueryWidget(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References UASSERT, UMENU, UMENU_NULL, and VERIFY.

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.

References addAccel(), ASSERT, GetMenuTitle(), UObject::IsKindOf(), UCMD_to_WINCMD, UEventQueryWidget(), UEventSendMessage(), UMakeBitmap(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References UASSERT, and VERIFY.

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.

References UASSERT, and VERIFY.

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.

References UASSERT, and VERIFY.

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 Fri Jan 31 12:11:29 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References addAccel(), GetMenuTitle(), UObject::IsKindOf(), UASSERT, UCMD_to_WINCMD, UEventQueryWidget(), UEventSendMessage(), UMakeBitmap(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References GetMenuTitle(), UWidget::GetWidget(), UObject::IsKindOf(), UEventQueryWidget(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References UASSERT, UMENU, UMENU_NULL, and VERIFY.

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.

References addAccel(), ASSERT, GetMenuTitle(), UObject::IsKindOf(), UCMD_to_WINCMD, UEventQueryWidget(), UEventSendMessage(), UMakeBitmap(), UMENU, UMENU_NULL, URUNTIME_CLASS, and VERIFY.

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.

References UASSERT, and VERIFY.

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.

References UASSERT, and VERIFY.

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.

References UASSERT, and VERIFY.

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 Fri Jan 31 12:11:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:31 2003 for WinCvs Source by doxygen 1.3-rc2


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(), UObject::GetRuntimeClass(), UWidget::HasModal(), UCvsFolders::OnTreeSelecting(), CPersistent::SaveAllSettings(), UDC::UDC(), UEventGiveTime(), UMenuAddButton(), UMenuAddPulldown(), and UMenuAddToggle().

Generated on Fri Jan 31 12:11:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:36 2003 for WinCvs Source by doxygen 1.3-rc2


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.

00073 {
00074     tbeDropDown,
00075     tbeButton,
00076     tbeSeparator
00077 } tbeKind;

Generated on Fri Jan 31 12:11:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:37 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and UWidget::OnListNewRow().

Generated on Fri Jan 31 12:11:38 2003 for WinCvs Source by doxygen 1.3-rc2


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
kUMainWidget the command associated with the main widget.

Functions

LRESULT | UWinPseudoWindowProc (CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam)

Define Documentation

#define kUMainWidget 0

kUMainWidget the command associated with the main widget.

Definition at line 88 of file uwidget.h.

Referenced by AboutDialog(), AskCreatePersistentSettings(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetDiff(), CompatGetImport(), CompatGetLog(), CompatGetModuleListItem(), CompatGetPassword(), CompatGetPrefs(), CompatGetSelectionDetails(), CompatGetTagListItem(), CompatGetUpdate(), CompatImportFilter(), CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), CvsAlert(), CvsLogParse(), CPseudoDlg::DoDataExchange(), TBrowserFill::ExitDirectory(), TBrowserFillDummy::ExitDirectory(), TBrowserFill::OnDirectory(), UWidget::OnInitWidget(), UMenu::OnUpdateUI(), UMacAppMenu::OnUpdateUI(), and CPseudoDlg::~CPseudoDlg().

Function Documentation

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.

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 Fri Jan 31 12:11:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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=(), UPStr::operator=(), and UStr::substr().

#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 Fri Jan 31 12:11:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by awidget::awidget(), CloneStr(), cvs_process_new(), cvs_process_run(), 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 }

Variable Documentation

class CDummyClass sDummyStarter

Generated on Fri Jan 31 12:11:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 }

Generated on Fri Jan 31 12:11:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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
00147
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 > (int)m_bitmaps.size() || index > (int)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
00219
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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


rf/support/mfc/PseudoDraw.cpp Source File

rf/support/mfc/PseudoDraw.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>
00019  */
00020
00021 // PseudoDraw.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #include "PseudoDraw.h"
00027 #include "uwidget.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00036 // CPseudoDraw
00037
00038 CPseudoDraw::CPseudoDraw(UWidget *pseudo, int cmdid) : m_pseudo(pseudo), m_cmdid(cmdid)
00039 {
00040 }
00041
00042 CPseudoDraw::~CPseudoDraw()
00043 {
00044 }
00045
00046
00047 BEGIN_MESSAGE_MAP(CPseudoDraw, CStatic)
00048     //{{AFX_MSG_MAP(CPseudoDraw)
00049     ON_WM_PAINT()
00050     //}}AFX_MSG_MAP
00051 END_MESSAGE_MAP()
00052
00053
00054 // CPseudoDraw message handlers
00055
00056 void CPseudoDraw::OnPaint()
00057 {
00058     CPaintDC dc(this); // device context for painting
00059
00060     if(m_pseudo != 0L)
00061         UEventSendMessage(m_pseudo->GetWidID(), EV_CUSTOM_DRAW, m_cmdid, &dc);
00062 }
Generated on Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


rf/support/mfc/PseudoDraw.h Source File

rf/support/mfc/PseudoDraw.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>
00019  */
00020
00021 #if !defined(AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_)
00022 #define AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // PseudoDraw.h : header file
00028 //
00029
00031 // CPseudoDraw window
00032
00033 class UWidget;
00034
00035 class CPseudoDraw : public CStatic
00036 {
00037 // Construction
00038 public:
00039     CPseudoDraw(UWidget *pseudo, int cmdid);
00040
00041 // Attributes
00042 public:
00043     UWidget *m_pseudo;
00044     int m_cmdid;
00045
00046 // Operations
00047 public:
00048
00049 // Overrides
00050     // ClassWizard generated virtual function overrides
00051     //{{AFX_VIRTUAL(CPseudoDraw)
00052     //}}AFX_VIRTUAL
00053
00054 // Implementation
00055 public:
00056     virtual ~CPseudoDraw();
00057
00058     // Generated message map functions
00059 protected:
00060     //{{AFX_MSG(CPseudoDraw)
00061     afx_msg void OnPaint();
00062     //}}AFX_MSG
00063
00064     DECLARE_MESSAGE_MAP()
00065 };
00066
00068
00069 //{{AFX_INSERT_LOCATION}}
00070 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00071
00072 #endif // !defined(AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_)
Generated on Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


rf/support/mfc/PseudoList.cpp Source File

rf/support/mfc/PseudoList.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>
00019  */
00020
00021 // PseudoList.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "PseudoList.h"
00026 #include "umain.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00035 // CPseudoList
00036
00037 CPseudoList::CPseudoList(int wid, int cmd) : m_wid(wid), m_cmd(cmd)
00038 {
00039 }
00040
00041 CPseudoList::~CPseudoList()
00042 {
00043 }
00044
00045
00046 BEGIN_MESSAGE_MAP(CPseudoList, CListCtrl)
00047     //{{AFX_MSG_MAP(CPseudoList)
00048     ON_WM_LBUTTONDBLCLK()
00049     //}}AFX_MSG_MAP
00050 END_MESSAGE_MAP()
00051
00052
00053 // CPseudoList message handlers
00054
00055 void CPseudoList::OnLButtonDblClk(UINT nFlags, CPoint point)
00056 {
00057     UINT pFlags;
00058     int nItem = HitTest(point, &pFlags);
00059     if(nItem != -1)
00060     {
00061         CString s = GetItemText(nItem, 0);
00062
00063         UEventSendMessage(m_wid, EV_LIST_DBLCLICK, UMAKEINT(m_cmd, nItem),
00064             (void *)(const char *)s);
00065     }
00066
00067     CListCtrl::OnLButtonDblClk(nFlags, point);
00068 }
Generated on Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


rf/support/mfc/pseudolist.h Source File

rf/support/mfc/pseudolist.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>
00019  */
00020
00021 #if !defined(AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_)
00022 #define AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // PseudoList.h : header file
00028 //
00029
00031 // CPseudoList window
00032
00033 class CPseudoList : public CListCtrl
00034 {
00035 // Construction
00036 public:
00037     CPseudoList(int wid, int cmd);
00038
00039 // Attributes
00040 public:
00041
00042 // Operations
00043 public:
00044
00045 // Overrides
00046     // ClassWizard generated virtual function overrides
00047     //{{AFX_VIRTUAL(CPseudoList)
00048     //}}AFX_VIRTUAL
00049
00050 // Implementation
00051 public:
00052     virtual ~CPseudoList();
00053
00054     // Generated message map functions
00055 protected:
00056     int m_cmd, m_wid;
00057
00058     //{{AFX_MSG(CPseudoList)
00059     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00060     //}}AFX_MSG
00061
00062     DECLARE_MESSAGE_MAP()
00063 };
00064
00066
00067 //{{AFX_INSERT_LOCATION}}
00068 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00069
00070 #endif // !defined(AFX_PSEUDOLIST_H__49AF86B3_E6AB_4885_843C_1CE5AC8C4980__INCLUDED_)
Generated on Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


dib.c File Reference

rf/support/mfc/dib.c File Reference

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.

References IsRectEmpty(), and NULL.

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.

References NULL, PaletteSize(), and WIDTHBYTES.

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 }

VOID DibCopyPalette | ( | HBITMAP | dst,
 |  | HBITMAP | src
 | ) |

Definition at line 99 of file dib.c.

References DibGetPaletteSize(), and PaletteSize().

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.

Referenced by DibCopyPalette().

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.

Referenced by PaletteSize().

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.

References NULL, and ReadDIBFile().

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.

References DibNumColors().

Referenced by CreateDIB(), DibCopyPalette(), SaveDIB(), and 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 hFile )

Definition at line 324 of file dib.c.

References NULL.

Referenced by LoadDIB().

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.

References FALSE, NULL, and TRUE.

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.

References DIB_HEADER_MARKER, FALSE, PaletteSize(), TRUE, and WIDTHBYTES.

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.

Generated on Fri Jan 31 12:11:11 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by SaveDIB().

#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 CreateDIB(), SaveDIB(), and 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.

References IsRectEmpty(), and NULL.

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.

References NULL, PaletteSize(), and WIDTHBYTES.

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.

References DibGetPaletteSize(), and PaletteSize().

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.

Referenced by DibCopyPalette().

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.

Referenced by PaletteSize().

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.

References NULL, and ReadDIBFile().

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.

References DibNumColors().

Referenced by CreateDIB(), DibCopyPalette(), SaveDIB(), and 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.

References NULL.

Referenced by LoadDIB().

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.

References FALSE, NULL, and TRUE.

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.

References DIB_HEADER_MARKER, FALSE, PaletteSize(), TRUE, and WIDTHBYTES.

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 Fri Jan 31 12:11:12 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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 Fri Jan 31 12:11:12 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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
 | ) |

Definition at line 542 of file PseudoButton.cpp.

References UMakeBitmap().

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 = true
 | ) |

Definition at line 296 of file PseudoButton.cpp.

References ASSERT, CreateDIB(), DD_BMAP, DD_PIXMAP, DD_RGB, DIBToBitmap(), nextLine(), PaletteSize(), 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 Fri Jan 31 12:11:13 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 }

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 EV_INIT_WIDGET, UWidget::GetOverideList(), UCmdTarget::GetWidID(), IS_PSEUDO_CTL, stat, 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 Fri Jan 31 12:11:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file PseudoDraw.h.

Generated on Fri Jan 31 12:11:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file pseudolist.h.

Generated on Fri Jan 31 12:11:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References malloc.

Referenced by awidget::awidget(), CloneStr(), cvs_process_new(), cvs_process_run(), 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 Fri Jan 31 12:11:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 macpp_getcmdid(), NEW, UPseudoPageHider::SetWidID(), UPseudoPlaceHolder::SetWidID(), and UEventSendMessage().

Referenced by 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 }

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.

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 )

Definition at line 110 of file UPseudoSupport.cpp.

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.

Referenced by 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 )

Definition at line 238 of file UPseudoSupport.cpp.

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 Fri Jan 31 12:11:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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().

#define UTextTableView_SingleClick FOUR_CHAR_CODE('UTVS')

Definition at line 200 of file UPseudoSupport.h.

Referenced by LPseudoWinAttachment::ListenToMessage().

Function Documentation

void macpp_fecthview | ( | int | widid,
 |  | LPane * | view
 | ) |

Definition at line 146 of file UPseudoSupport.cpp.

References macpp_getcmdid(), NEW, UPseudoPlaceHolder::SetWidID(), UPseudoPageHider::SetWidID(), and UEventSendMessage().

Referenced by 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 )

Definition at line 110 of file UPseudoSupport.cpp.

References UWidget::GetWidget(), 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 }

void macpp_linkbroadcasters | ( | LPane * | view,
 |  | LListener * | listener
 | ) |

Definition at line 220 of file UPseudoSupport.cpp.

Referenced by 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 )

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

Definition at line 12 of file UPseudoSupport.h.

Referenced by UPseudoPlaceHolder::DoRotate().

Generated on Fri Jan 31 12:11:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 "wincvs.h"
00028
00029 #include <process.h>
00030 #include <vector>
00031 #include <IO.h>
00032
00033 #include "BrowseFileView.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
00061 static const int FILECHANGE_TIMER = 999;
00062
00064 static const int kSpc = 3;
00065
00067 static const int WM_RESETVIEW = WM_APP + 12;
00068
00069 // Persistent values
00070 CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName);
00071 CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", false);
00072
00077 static void onFilteringChanged(CObject* obj)
00078 {
00079     ((CBrowseFileView*)obj)->OnFilteringChanged();
00080 }
00081
00083 // CRecursionLock
00084
00085 CRecursionLock::CRecursionLock(bool& semaphore)
00086     : m_semaphore(semaphore)
00087 {
00088     m_semaphore = true;
00089 }
00090
00091 CRecursionLock::~CRecursionLock()
00092 {
00093     m_semaphore = false;
00094 }
00095
00097 // KoTraversalContext
00098
00099 KoTraversalContext::KoTraversalContext(CBrowseFileView* view)
00100     : m_view(view), m_filter(NULL), m_isRecursive(false), m_isShowIgnored(false)
00101 {
00102     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00103     {
00104         m_filter = app->GetFilterModel();
00105         m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00106         m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00107     }
00108 }
00109
00111 bool KoTraversalContext::IsRecursive() const
00112 {
00113     return m_isRecursive;
00114 }
00115
00117 bool KoTraversalContext::IsShowIgnored() const
00118 {
00119     return m_isShowIgnored;
00120 }
00121
00123 CBrowseFileView* KoTraversalContext::GetView() const
00124 {
00125     return m_view;
00126 }
00127
00133 bool KoTraversalContext::IsMatch(EntnodeData* data) const
00134 {
00135     return m_filter->IsMatch(data);
00136 }
00137
00139 // TViewFill
00140
00141 TViewFill::TViewFill(const KoTraversalContext* context)
00142     : m_context(context), m_entries(200, ENTNODE::Compare)
00143 {
00144 }
00145
00147 CBrowseFileView* TViewFill::GetView() const
00148 {
00149     return m_context->GetView();
00150 }
00151
00153 CListCtrl& TViewFill::GetListCtrl() const
00154 {
00155     return GetView()->GetListCtrl();
00156 }
00157
00159 bool TViewFill::IsRecursive() const
00160 {
00161     return m_context->IsRecursive();
00162 }
00163
00165 bool TViewFill::IsShowIgnored() const
00166 {
00167     return m_context->IsShowIgnored();
00168 }
00169
00170 kTraversal TViewFill::EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec)
00171 {
00172     Entries_Open (m_entries, fullpath);
00173     BuildIgnoredList(m_ignlist, fullpath);
00174     return kContinueTraversal;
00175 }
00176
00177 kTraversal TViewFill::ExitDirectory(const char* fullpath)
00178 {
00179     // add the missing files
00180     Entries_SetMissing(m_entries);
00181
00182     int numEntries = m_entries.NumOfElements();
00183     for(int i = 0; i < numEntries; i++)
00184     {
00185         const ENTNODE& theNode = m_entries.Get(i);
00186         EntnodeData* data = theNode.Data();
00187         if( data->IsMissing() && m_context->IsMatch(data) )
00188         {
00189             if( !IsRecursive() || data->GetType() == ENT_FILE )
00190             {
00191                 int iImage = data->GetType() == ENT_FILE ?
00192                     (data->IsRemoved() ? kFileIconRemoved : kFileIconMiss) : kFolderIconMiss;
00193
00194                 InitItem(data, iImage);
00195             }
00196         }
00197     }
00198
00199     m_ignlist.clear();
00200
00201     return kContinueTraversal;
00202 }
00203
00211 int TViewFill::InitItem(EntnodeData* data, int iImage, const char* tag /*= 0L*/)
00212 {
00213     CListCtrl& listCtrl = GetListCtrl();
00214     KoColumnContext context(GetView()->GetPath());
00215
00216     TCHAR buf[256];
00217     GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00218
00219     LV_ITEM lvi;
00220     lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
00221     lvi.iItem = listCtrl.GetItemCount();
00222     lvi.iSubItem = 0;
00223     lvi.pszText = buf;
00224     lvi.iImage = iImage;
00225     lvi.lParam = (LPARAM)(LPVOID)data;
00226     int pos = listCtrl.InsertItem(&lvi);
00227     if( pos >= 0 )
00228     {
00229         // Note ownership addition
00230         data->Ref();
00231
00232         // Set item text for additional columns
00233         KiColumnModel* model = GetView()->GetColumnModel();
00234         int columnCount = model->GetCount();
00235         for(int j = 1; j < columnCount; j++)
00236         {
00237             TCHAR buf[256];
00238             model->GetAt(j)->GetText(&context, data, buf, 256);
00239             listCtrl.SetItemText(pos, j, buf);
00240         }
00241
00242         if( tag != 0L && tag[0] != '\0' && !IsRecursive() )
00243             listCtrl.SetItemText(pos, EntnodeFile::kTag, tag);
00244     }
00245
00246     return pos;
00247 }
00248
00249 kTraversal TViewFill::OnError(const char* err, int errcode)
00250 {
00251     return kTraversalError;
00252 }
00253
00254 kTraversal TViewFill::OnIdle(const char* fullpath)
00255 {
00256     // Allow to stop traversing using the escape key
00257     SHORT escState = GetAsyncKeyState(VK_ESCAPE);
00258     if( escState & 0x8000 )
00259     {
00260         return kStopTraversal;
00261     }
00262
00263     return kContinueTraversal;
00264 }
00265
00266 kTraversal TViewFill::OnDirectory(const char* fullpath, const char* fullname, const char* name,
00267                                   const struct stat& dir, const FSSpec* macspec)
00268 {
00269     if( stricmp(name, "CVS") == 0 )
00270         return kSkipFile;
00271
00272     EntnodeData* data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00273     if( !IsShowIgnored() && data->IsIgnored() )
00274     {
00275         return kSkipFile;
00276     }
00277
00278     if( IsRecursive() )
00279     {
00280         if( (!data->IsIgnored() || IsShowIgnored()) && !data->IsMissing() )
00281         {
00282             TViewFill traverse(m_context);
00283             FileTraverse(fullname, traverse);
00284         }
00285
00286         return kSkipFile;
00287     }
00288
00289     // Get the tag
00290     CStr subCVS;
00291     CStr tagName;
00292     subCVS = fullname;
00293     if( !subCVS.endsWith(kPathDelimiter) )
00294         subCVS << kPathDelimiter;
00295
00296     subCVS << "CVS";
00297
00298     Tag_Open(tagName, subCVS);
00299
00300     InitItem(data, CBrowseFileView::GetImageForEntry(data), tagName);
00301
00302     return kSkipFile;
00303 }
00304
00305 kTraversal TViewFill::OnAlias(const char* fullpath, const char* fullname, const char* name,
00306                               const struct stat& dir, const FSSpec* macspec)
00307 {
00308     return OnFile(fullpath, fullname, name, dir, macspec);
00309 }
00310
00311 kTraversal TViewFill::OnFile(const char* fullpath, const char* fullname, const char* name,
00312                           const struct stat& dir, const FSSpec* macspec)
00313 {
00314     EntnodeData* data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00315     if( !IsShowIgnored() && data->IsIgnored() )
00316         return kContinueTraversal;
00317
00318     if( m_context->IsMatch(data) )
00319     {
00320         int pos = InitItem(data, CBrowseFileView::GetImageForEntry(data));
00321         if( pos >=  0 )
00322         {
00323             UINT state = data->IsLocked() ? INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00324             CListCtrl& listCtrl = GetListCtrl();
00325             listCtrl.SetItemState(pos, state, LVIS_STATEIMAGEMASK);
00326         }
00327     }
00328
00329     return kContinueTraversal;
00330 }
00331
00332
00334 // CBrowseFileView
00335
00336 CImageList CBrowseFileView::m_smallImageList;
00337 CImageList CBrowseFileView::m_stateImageList;
00338
00339 IMPLEMENT_DYNCREATE(CBrowseFileView, CListView)
00340
00341 BEGIN_MESSAGE_MAP(CBrowseFileView, CListView)
00342     //{{AFX_MSG_MAP(CBrowseFileView)
00343     ON_COMMAND(ID_VIEW_SMALLICONS, OnViewSmallIcons)
00344     ON_COMMAND(ID_VIEW_FULLLIST, OnViewList)
00345     ON_COMMAND(ID_VIEW_ROWDETAILS, OnViewFullRowDetails)
00346     ON_UPDATE_COMMAND_UI(ID_VIEW_SMALLICONS, OnUpdateViewSmallIcons)
00347     ON_UPDATE_COMMAND_UI(ID_VIEW_ADD, OnUpdateViewAdd)
00348     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDB, OnUpdateViewAddB)
00349     ON_UPDATE_COMMAND_UI(ID_VIEW_COMMIT, OnUpdateViewUpdate)
00350     ON_UPDATE_COMMAND_UI(ID_VIEW_RELEASE, OnUpdateViewRelease)
00351     ON_UPDATE_COMMAND_UI(ID_VIEW_RMV, OnUpdateViewRmv)
00352     ON_UPDATE_COMMAND_UI(ID_VIEW_GRAPH, OnUpdateViewGraph)
00353     ON_UPDATE_COMMAND_UI(ID_VIEW_FULLLIST, OnUpdateViewList)
00354     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITSELDEF, OnUpdateViewEditseldef)
00355     ON_UPDATE_COMMAND_UI(ID_VIEW_ROWDETAILS, OnUpdateViewFullRowDetails)
00356     ON_WM_LBUTTONDBLCLK()
00357     ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
00358     ON_COMMAND(ID_VIEW_ADD, OnViewAdd)
00359     ON_COMMAND(ID_VIEW_ADDB, OnViewAddb)
00360     ON_COMMAND(ID_VIEW_COMMIT, OnViewCommit)
00361     ON_COMMAND(ID_VIEW_RMV, OnViewRmv)
00362     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
00363     ON_COMMAND(ID_VIEW_QUERYUPDATE, OnViewQueryUpdate)
00364     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
00365     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
00366     ON_NOTIFY_REFLECT(LVN_KEYDOWN, OnKeydown)
00367     ON_COMMAND(ID_VIEW_UPONE, OnViewUpone)
00368     ON_UPDATE_COMMAND_UI(ID_VIEW_UPONE, OnUpdateViewUpone)
00369     ON_COMMAND(ID_VIEW_TRASH, OnViewTrash)
00370     ON_UPDATE_COMMAND_UI(ID_VIEW_TRASH, OnUpdateViewTrash)
00371     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
00372     ON_COMMAND(ID_VIEW_LOG, OnViewLog)
00373     ON_COMMAND(ID_VIEW_GRAPH, OnViewGraph)
00374     ON_COMMAND(ID_VIEW_STATUS, OnViewStatus)
00375     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlock)
00376     ON_COMMAND(ID_VIEW_WATCHON, OnViewWatchOn)
00377     ON_COMMAND(ID_VIEW_WATCHOFF, OnViewWatchOff)
00378     ON_COMMAND(ID_VIEW_EDIT, OnViewEdit)
00379     ON_COMMAND(ID_VIEW_UNEDIT, OnViewUnedit)
00380     ON_COMMAND(ID_VIEW_WATCHERS, OnViewWatchers)
00381     ON_COMMAND(ID_VIEW_EDITORS, OnViewEditors)
00382     ON_COMMAND(ID_VIEW_RELEASE, OnViewRelease)
00383     ON_COMMAND(ID_VIEW_TAGNEW, OnViewTagNew)
00384     ON_COMMAND(ID_VIEW_TAGDELETE, OnViewTagDelete)
00385     ON_COMMAND(ID_VIEW_TAGBRANCH, OnViewTagBranch)
00386     ON_COMMAND(ID_VIEW_EXPLORE, OnViewExplore)
00387     ON_UPDATE_COMMAND_UI(ID_VIEW_EXPLORE, OnUpdateViewExplore)
00388     ON_WM_TIMER()
00389     ON_COMMAND(ID_VIEW_EDITSEL, OnViewEditsel)
00390     ON_COMMAND(ID_VIEW_EDITSELDEF, OnViewEditseldef)
00391     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00392     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00393     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00394     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00395     ON_NOTIFY_REFLECT(LVN_BEGINDRAG, OnBegindrag)
00396     ON_NOTIFY_REFLECT(LVN_BEGINRDRAG, OnBeginrdrag)
00397     ON_WM_SETCURSOR()
00398     ON_NOTIFY_REFLECT(LVN_DELETEITEM, OnDeleteitem)
00399     ON_WM_DESTROY()
00400     ON_UPDATE_COMMAND_UI(ID_QUERY_ANNOTATE, OnUpdateViewAnnotate)
00401     ON_COMMAND(ID_QUERY_ANNOTATE, OnAnnotate)
00402     ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
00403     ON_COMMAND(ID_VIEW_RESERVEDEDIT, OnViewReservededit)
00404     ON_COMMAND(ID_VIEW_FORCEEDIT, OnViewForceedit)
00405     ON_COMMAND(ID_VIEW_ADDU, OnViewAddu)
00406     ON_COMMAND(ID_APP_CMDLINE, OnAppCmdline)
00407     ON_UPDATE_COMMAND_UI(ID_APP_CMDLINE, OnUpdateCvsCmd)
00408     ON_COMMAND(ID_APP_RTAGBRANCH, OnAppRtagbranch)
00409     ON_COMMAND(ID_APP_RTAGCREATE, OnAppRtagcreate)
00410     ON_COMMAND(ID_APP_RTAGDELETE, OnAppRtagdelete)
00411     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDU, OnUpdateViewAddB)
00412     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewUpdate)
00413     ON_UPDATE_COMMAND_UI(ID_VIEW_EDIT, OnUpdateViewUpdate)
00414     ON_UPDATE_COMMAND_UI(ID_VIEW_RESERVEDEDIT, OnUpdateViewUpdate)
00415     ON_UPDATE_COMMAND_UI(ID_VIEW_FORCEEDIT, OnUpdateViewUpdate)
00416     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITORS, OnUpdateViewUpdate)
00417     ON_UPDATE_COMMAND_UI(ID_VIEW_LOG, OnUpdateViewUpdate)
00418     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGNEW, OnUpdateViewUpdate)
00419     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGDELETE, OnUpdateViewUpdate)
00420     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGBRANCH, OnUpdateViewUpdate)
00421     ON_UPDATE_COMMAND_UI(ID_VIEW_STATUS, OnUpdateViewUpdate)
00422     ON_UPDATE_COMMAND_UI(ID_VIEW_UNEDIT, OnUpdateViewUpdate)
00423     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
00424     ON_UPDATE_COMMAND_UI(ID_VIEW_QUERYUPDATE, OnUpdateViewUpdate)
00425     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUpdate)
00426     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHERS, OnUpdateViewUpdate)
00427     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHON, OnUpdateViewUpdate)
00428     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHOFF, OnUpdateViewUpdate)
00429     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITSEL, OnUpdateViewTrash)
00430     ON_UPDATE_COMMAND_UI(ID_APP_RTAGBRANCH, OnUpdateCvsCmd)
00431     ON_UPDATE_COMMAND_UI(ID_APP_RTAGCREATE, OnUpdateCvsCmd)
00432     ON_UPDATE_COMMAND_UI(ID_APP_RTAGDELETE, OnUpdateCvsCmd)
00433     ON_WM_CONTEXTMENU()
00434     //}}AFX_MSG_MAP
00435     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00436     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00437     ON_UPDATE_COMMAND_UI_RANGE(ID_MACRO_START, ID_MACRO_END, OnUpdateMacro)
00438     ON_COMMAND_EX_RANGE(ID_MACRO_START, ID_MACRO_END, OnMacro)
00439     ON_UPDATE_COMMAND_UI_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnUpdateCustomize)
00440     ON_COMMAND_EX_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnCustomize)
00441     ON_MESSAGE(KoWatcher::WM_FILECHANGE, OnFileChange)
00442     ON_MESSAGE(WM_RESETVIEW, OnResetView)
00443 END_MESSAGE_MAP()
00444
00445
00446 // CBrowseFileView construction/destruction
00447
00448 CBrowseFileView::CBrowseFileView()
00449     : m_checkChanges(false), m_watch(NULL), m_isResetViewLocked(false), m_isFilesChange(false),
00450     m_isResetViewPending(false), m_uiFilechangeTimer(0)
00451 {
00452     m_sort = (int)gFileViewSort;
00453
00454     SetRecursive(false);
00455
00456     m_ascendant = (bool)gFileViewSortAsc;
00457     m_entriesMod = 0;
00458     m_entriesLogMod = 0;
00459 }
00460
00461 CBrowseFileView::~CBrowseFileView()
00462 {
00463     gFileViewSortAsc = m_ascendant;
00464     gFileViewSort = m_sort;
00465 }
00466
00468 BOOL CBrowseFileView::PreCreateWindow(CREATESTRUCT& cs)
00469 {
00470     cs.style |= WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_REPORT;
00471     cs.dwExStyle |= LVS_EX_FULLROWSELECT;
00472
00473     return CListView::PreCreateWindow(cs);
00474 }
00475
00481 int CBrowseFileView::GetImageForEntry(EntnodeData* data)
00482 {
00483     int result = -1;
00484
00485     if( data->GetType() == ENT_FILE )
00486     {
00487         const char* info = 0L;
00488         if( data->IsIgnored() )
00489         {
00490             result = kFileIconIgnored;
00491         }
00492         else if( data->IsUnknown() )
00493         {
00494             result = kFileIconUnknown;
00495         }
00496         else if( data->GetConflict() != 0L )
00497         {
00498             result = kFileIconConflict;
00499         }
00500         else if( data->IsRemoved() )
00501         {
00502             result = kFileIconRemoved;
00503         }
00504         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0 )
00505         {
00506             const char* vn = (*data)[EntnodeFile::kVN];
00507             bool isAdded = vn && (strcmp(vn, "0") == 0);
00508
00509             result = data->IsUnmodified() ? kFileIconBinary :
00510                 isAdded ? kFileIconBinaryAdded : kFileIconBinaryMod;
00511         }
00512         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0 )
00513         {
00514             const char* vn = (*data)[EntnodeFile::kVN];
00515             bool isAdded = vn && (strcmp(vn, "0") == 0);
00516
00517             result = data->IsUnmodified() ? kFileIconUnicode :
00518                 isAdded ? kFileIconUnicodeAdded : kFileIconUnicodeMod;
00519         }
00520         else
00521         {
00522             const char* vn = (*data)[EntnodeFile::kVN];
00523             bool isAdded = vn && (strcmp(vn, "0") == 0);
00524
00525             result = data->IsUnmodified() ? kFileIconText :
00526                 isAdded ? kFileIconAdded : kFileIconTextMod;
00527         }
00528     }
00529     else
00530     {
00531         if( data->IsIgnored() )
00532         {
00533             result = kFolderIconIgnored;
00534         }
00535         else if( data->IsUnknown() )
00536         {
00537             result = kFolderIconUnknown;
00538         }
00539         else
00540         {
00541             result = kFolderIcon;
00542         }
00543     }
00544
00545     return result;
00546 }
00547
00552 void CBrowseFileView::SetRecursive(bool isRecursive)
00553 {
00554     m_isRecursive = isRecursive;
00555     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
00556 }
00557
00559 void CBrowseFileView::OnInitialUpdate()
00560 {
00561     CListView::OnInitialUpdate();
00562
00563     CListCtrl& ListCtrl = GetListCtrl();
00564
00565     // Replace standard header with sort header
00566     if( HWND hWnd = ListView_GetHeader(ListCtrl.m_hWnd) )
00567     {
00568         m_ctrlHeader.SubclassWindow(hWnd);
00569     }
00570
00571     ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP);
00572
00573     // Set image lists
00574     if( m_smallImageList.m_hImageList == 0L )
00575         m_smallImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00576
00577     if( m_stateImageList.m_hImageList == 0L )
00578         m_stateImageList.Create(IDR_STATEICONS, 16, 1, RGB(255, 0, 0));
00579
00580     ListCtrl.SetImageList(&m_smallImageList, LVSIL_SMALL);
00581     ListCtrl.SetImageList(&m_stateImageList, LVSIL_STATE);
00582
00583     KoTraversalContext context(this);
00584     SetRecursive(context.IsRecursive());
00585
00586     AddColumns();
00587     SetFullRowSel(TRUE);
00588
00589     LoadColumns();
00590
00591     // Register for notifications on filter change
00592     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00593     {
00594         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00595         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00596         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00597     }
00598
00599     m_uiFilechangeTimer = SetTimer(FILECHANGE_TIMER, 200, 0L);
00600     if( 0L == m_uiFilechangeTimer )
00601     {
00602         cvs_err("Can't start the file change notification timer.\n");
00603     }
00604 }
00605
00609 void CBrowseFileView::AddColumns()
00610 {
00611     KiColumnModel* model = GetColumnModel();
00612     int columnCount = model->GetCount();
00613     CListCtrl& listCtrl = GetListCtrl();
00614     for(int i = 0; i<columnCount; i++)
00615     {
00616         LV_COLUMN lvc;
00617         model->GetAt(i)->GetSetupData(&lvc);
00618         lvc.iSubItem = i;
00619         lvc.mask |= LVCF_SUBITEM;
00620         listCtrl.InsertColumn(i,&lvc);
00621     }
00622 }
00623
00627 void CBrowseFileView::DeleteColumns()
00628 {
00629     KiColumnModel* model = GetColumnModel();
00630     const int columnCount = model->GetCount();
00631     CListCtrl& listCtrl = GetListCtrl();
00632
00633     for(int i = 0; i < columnCount; i++)
00634     {
00635         listCtrl.DeleteColumn(0);
00636     }
00637 }
00638
00644 void CBrowseFileView::GetEntriesModTime(time_t& newEntriesMod,  time_t& newEntriesLogMod)
00645 {
00646     char* szOriginalPath = getcwd(NULL, MAX_PATH);
00647
00648     newEntriesMod = 0;
00649     newEntriesLogMod = 0;
00650
00651     if( chdir(m_path) != 0 )
00652         return;
00653
00654     if( chdir("CVS") != 0 )
00655         return;
00656
00657     struct stat sb;
00658     if( stat("Entries", &sb) != -1 )
00659         newEntriesMod = sb.st_mtime;
00660
00661     if( stat("Entries.log", &sb) != -1 )
00662         newEntriesLogMod = sb.st_mtime;
00663
00664     // Restore the original path to prevent locking the folder we've been checking
00665     if( szOriginalPath )
00666     {
00667         chdir(szOriginalPath);
00668         free(szOriginalPath);
00669         szOriginalPath = NULL;
00670     }
00671 }
00672
00679 void CBrowseFileView::ResetView(bool notifyBrowser /*= false*/, const char* selectFile /*= 0L*/)
00680 {
00681     // No outstanding request to reset the view any more
00682     m_isResetViewPending = false;
00683
00684     if( m_isResetViewLocked )
00685     {
00686         // No recursion
00687         return;
00688     }
00689
00690     CRecursionLock recursionLock(m_isResetViewLocked);
00691
00692     CWndRedrawMngr redrawMngr(this);
00693
00694     // Reset dirty indicators
00695     m_isFilesChange = false;
00696     GetEntriesModTime(m_entriesMod, m_entriesLogMod);
00697
00698     CWaitCursor doWait;
00699
00700     bool bPartialOK = true;
00701
00702     CListCtrl& ListCtrl = GetListCtrl();
00703
00704     // Get the selection to later try to restore it
00705     CvsArgs selection(false);
00706
00707     if( !selectFile )
00708     {
00709         int nItem = -1;
00710         UStr buf;
00711         while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
00712         {
00713             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00714             selection.add(data->GetFullPathName(buf));
00715         }
00716     }
00717
00718     // Delete all items
00719     VERIFY(ListCtrl.DeleteAllItems());
00720
00721     // Make sure columns are ok
00722     KoTraversalContext context(this);
00723     if( (context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive) )
00724     {
00725         KiColumnModel* oldModel = GetColumnModel();
00726         int oldCount = oldModel->GetCount();
00727         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00728
00729         DeleteColumns();
00730         SetRecursive(context.IsRecursive());
00731         AddColumns();
00732
00733         if( oldColumn == NULL )
00734         {
00735             m_sort = 0;
00736         }
00737         else
00738         {
00739             KiColumnModel* newModel = GetColumnModel();
00740             int newCount = newModel->GetCount();
00741             int sort = -1;
00742             for(int pos = 0; pos < newCount && sort == -1; pos++)
00743             {
00744                 if( newModel->GetAt(pos) == oldColumn )
00745                 {
00746                     sort = pos;
00747                 }
00748             }
00749
00750             m_sort = (sort >= 0) ? sort : 0;
00751         }
00752     }
00753
00754     // Re-fetch all items
00755     TViewFill traverse(&context);
00756     kTraversal res = FileTraverse(m_path, traverse);
00757
00758     // Find the file for selection
00759     if( selectFile != 0L )
00760     {
00761         int count = ListCtrl.GetItemCount();
00762         for(int i = 0; i < count; i++)
00763         {
00764             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(i);
00765
00766             // Files only
00767             if( data->GetType() == ENT_SUBDIR )
00768                 continue;
00769
00770             UStr buf;
00771             const char* currentFile = data->GetFullPathName(buf);
00772             if( stricmp( selectFile, currentFile) == 0 )
00773             {
00774                 selection.reset(false); //we don't want any other selection
00775                 selection.add(currentFile);
00776
00777                 bPartialOK = FALSE;
00778                 break;
00779             }
00780         }
00781     }
00782
00783     Resort();
00784
00785     // Now restore the selection
00786     int argc = selection.Argc();
00787     char* const* argv = selection.Argv();
00788     bool isFirst = true;
00789     bool focusSet = false;
00790     int count = ListCtrl.GetItemCount();
00791
00792     // If there are no selections, then skip the looping
00793     if( argc )
00794     {
00795         for(int nItem = 0; nItem < count; nItem++)
00796         {
00797             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00798             UStr buf;
00799             const char* currentFile = data->GetFullPathName(buf);
00800
00801             for(int i = 0; i < argc; i++)
00802             {
00803                 const char* fn = argv[i];
00804                 if( stricmp(fn, currentFile) == 0 )
00805                 {
00806                     VERIFY(ListCtrl.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED));
00807                     if( isFirst )
00808                     {
00809                         isFirst = false;
00810                         if( !bPartialOK )
00811                         {
00812                             // Move to the bottom first, so the selection will be on top
00813                             ListCtrl.EnsureVisible(ListCtrl.GetItemCount()-1 , bPartialOK);
00814                         }
00815
00816                         // Make sure the first selected file is visible
00817                         VERIFY( ListCtrl.EnsureVisible(nItem, bPartialOK/*TRUE*/) );
00818                         VERIFY( focusSet = (ListCtrl.SetItemState(nItem, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00819                     }
00820
00821                     break;
00822                 }
00823             }
00824         }
00825     }
00826
00827     if( !focusSet && ListCtrl.GetItemCount() )
00828     {
00829         VERIFY(focusSet = (ListCtrl.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED) !=0 ));
00830     }
00831
00832     if( notifyBrowser )
00833     {
00834         // Notify the tree
00835         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00836         if( app )
00837         {
00838             app->GetBrowserView()->ResetView(true);
00839         }
00840     }
00841
00842     // Start monitoring file changes
00843     if( !m_watch )
00844     {
00845         m_watch = new KoWatcher(m_hWnd);
00846     }
00847
00848     m_watch->SignalStartWatch(m_path, m_isRecursive);
00849 }
00850
00857 void CBrowseFileView::ResetView(const char* path, bool notifyBrowser, const char* selectFile)
00858 {
00859     m_path = path;
00860     ResetView(false, selectFile);
00861     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00862     app->GetDocument()->SetTitle(m_path);
00863
00864     if( notifyBrowser )
00865     {
00866         // Notify the dir tree
00867         app->GetBrowserView()->StepToLocation(path);
00868     }
00869 }
00870
00872 // CBrowseFileView diagnostics
00873
00874 #ifdef _DEBUG
00875 void CBrowseFileView::AssertValid() const
00876 {
00877     CListView::AssertValid();
00878 }
00879
00880 void CBrowseFileView::Dump(CDumpContext& dc) const
00881 {
00882     CListView::Dump(dc);
00883 }
00884 #endif //_DEBUG
00885
00891 BOOL CBrowseFileView::SetViewType(DWORD dwViewType)
00892 {
00893     return ModifyStyle(LVS_TYPEMASK, dwViewType & LVS_TYPEMASK);
00894 }
00895
00900 DWORD CBrowseFileView::GetViewType() const
00901 {
00902     return GetStyle() & LVS_TYPEMASK;
00903 }
00904
00908 void CBrowseFileView::OnViewSmallIcons()
00909 {
00910     if( GetViewType() != LVS_SMALLICON )
00911         SetViewType(LVS_SMALLICON);
00912 }
00913
00917 void CBrowseFileView::OnViewList()
00918 {
00919     if( GetViewType() != LVS_LIST )
00920         SetViewType(LVS_LIST);
00921 }
00922
00926 void CBrowseFileView::OnViewFullRowDetails()
00927 {
00928     if( GetViewType() != LVS_REPORT )
00929         SetViewType(LVS_REPORT);
00930 }
00931
00933 void CBrowseFileView::OnUpdateViewSmallIcons(CCmdUI* pCmdUI)
00934 {
00935     pCmdUI->SetCheck(GetViewType() == LVS_SMALLICON);
00936 }
00937
00939 void CBrowseFileView::OnUpdateViewList(CCmdUI* pCmdUI)
00940 {
00941     pCmdUI->SetCheck(GetViewType() == LVS_LIST);
00942 }
00943
00945 void CBrowseFileView::OnUpdateViewFullRowDetails(CCmdUI* pCmdUI)
00946 {
00947     pCmdUI->SetCheck(GetViewType() == LVS_REPORT);
00948 }
00949
00955 void CBrowseFileView::EditSel(EntnodeData* data, bool useDefault /*= false*/)
00956 {
00957     UStr buf;
00958     const char* fullpath = data->GetFullPathName(buf);
00959     if( data->GetType() == ENT_SUBDIR )
00960     {
00961         struct stat st;
00962         if( stat(fullpath, &st) != 0 && errno == ENOENT )
00963         {
00964             // Assume we're looking at directory previously in CVS,
00965             // but not currently in the file system.
00966             // If we ever run across another case (permissions perhaps)
00967             // then you might want to add code here.
00968             cvs_err("'%s' is not accessible\n", (char*)fullpath);
00969         }
00970         else
00971         {
00972             ResetView(fullpath, true);
00973             gCvsPrefs.SetLastWorkingDir(fullpath);
00974         }
00975     }
00976     else
00977     {
00978         LaunchViewer(fullpath, useDefault);
00979     }
00980 }
00981
00983 void CBrowseFileView::OnLButtonDblClk(UINT nFlags, CPoint point)
00984 {
00985     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00986     if( app->IsCvsRunning() )
00987         return;
00988
00989     CListCtrl& ListCtrl = GetListCtrl();
00990
00991     UINT pFlags;
00992     int nItem = ListCtrl.HitTest(point, &pFlags);
00993     if( nItem != -1 )
00994     {
00995         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00996         EditSel(data);
00997     }
00998
00999     CListView::OnLButtonDblClk(nFlags, point);
01000 }
01001
01007 bool CBrowseFileView::DisableCommon(bool bCheckSelection /*= true*/)
01008 {
01009     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01010     CListCtrl& ListCtrl = GetListCtrl();
01011     bool bCommon = app->IsCvsRunning() || gCvsPrefs.empty();
01012     bool bSelection = ListCtrl.GetSelectedCount() == 0 || this != CWnd::GetFocus();
01013
01014     return bCheckSelection ? bCommon || bSelection : bCommon;
01015 }
01016
01018 void CBrowseFileView::OnUpdateViewRelease(CCmdUI* pCmdUI)
01019 {
01020     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01021     CListCtrl& ListCtrl = GetListCtrl();
01022
01023     if( DisableCommon() )
01024     {
01025         pCmdUI->Enable(FALSE);
01026         return;
01027     }
01028
01029     int nItem = -1;
01030     BOOL res = TRUE;
01031     int numFiles = 0;
01032     int numFolders = 0;
01033
01034     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01035     {
01036         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01037         if( data->IsUnknown() || data->GetType() != ENT_SUBDIR )
01038         {
01039             res = FALSE;
01040             break;
01041         }
01042
01043         numFolders++;
01044
01045         if( numFolders > 1 )
01046         {
01047             res = FALSE;
01048             break;
01049         }
01050     }
01051
01052     pCmdUI->Enable(res);
01053 }
01054
01056 void CBrowseFileView::OnUpdateViewAdd(CCmdUI* pCmdUI)
01057 {
01058     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01059     CListCtrl& ListCtrl = GetListCtrl();
01060
01061     if( DisableCommon() )
01062     {
01063         pCmdUI->Enable(FALSE);
01064         return;
01065     }
01066
01067     int nItem = -1;
01068     BOOL res = TRUE;
01069     int numFiles = 0;
01070     int numFolders = 0;
01071
01072     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01073     {
01074         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01075         if( !(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())) )
01076         {
01077             res = FALSE;
01078             break;
01079         }
01080
01081         if( data->GetType() == ENT_FILE )
01082         {
01083             numFiles++;
01084         }
01085         else
01086             numFolders++;
01087
01088         if( (numFiles != 0 && numFolders != 0) || numFolders > 1 )
01089         {
01090             res = FALSE;
01091             break;
01092         }
01093     }
01094
01095     pCmdUI->Enable(res);
01096 }
01097
01099 void CBrowseFileView::OnUpdateViewAddB(CCmdUI* pCmdUI)
01100 {
01101     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01102     CListCtrl& ListCtrl = GetListCtrl();
01103
01104     if( DisableCommon() )
01105     {
01106         pCmdUI->Enable(FALSE);
01107         return;
01108     }
01109
01110     int nItem = -1;
01111     BOOL res = TRUE;
01112
01113     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01114     {
01115         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01116         if( data->GetType() != ENT_FILE )
01117         {
01118             res = FALSE;
01119             break;
01120         }
01121
01122         if( !(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())) )
01123         {
01124             res = FALSE;
01125             break;
01126         }
01127     }
01128
01129     pCmdUI->Enable(res);
01130 }
01131
01133 void CBrowseFileView::OnUpdateViewUpdate(CCmdUI* pCmdUI)
01134 {
01135     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01136     CListCtrl& ListCtrl = GetListCtrl();
01137
01138     if( DisableCommon() )
01139     {
01140         pCmdUI->Enable(FALSE);
01141         return;
01142     }
01143
01144     int nItem = -1;
01145     BOOL res = TRUE;
01146     int numFiles = 0;
01147     int numFolders = 0;
01148
01149     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01150     {
01151         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01152         if( data->IsUnknown() )
01153         {
01154             res = FALSE;
01155             break;
01156         }
01157
01158         if( data->GetType() == ENT_FILE )
01159             numFiles++;
01160         else
01161             numFolders++;
01162
01163         if( (numFiles != 0 && numFolders != 0) || numFolders > 1 )
01164         {
01165             res = FALSE;
01166             break;
01167         }
01168     }
01169
01170     pCmdUI->Enable(res);
01171 }
01172
01174 void CBrowseFileView::OnUpdateViewGraph(CCmdUI* pCmdUI)
01175 {
01176     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01177     CListCtrl& ListCtrl = GetListCtrl();
01178
01179     if( DisableCommon() )
01180     {
01181         pCmdUI->Enable(FALSE);
01182         return;
01183     }
01184
01185     int nItem = -1;
01186     BOOL res = TRUE;
01187
01188     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01189     {
01190         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01191         if( data->IsUnknown() || data->GetType() == ENT_SUBDIR )
01192         {
01193             res = FALSE;
01194             break;
01195         }
01196     }
01197
01198     pCmdUI->Enable(res);
01199 }
01200
01202 void CBrowseFileView::OnUpdateViewRmv(CCmdUI* pCmdUI)
01203 {
01204     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01205     CListCtrl& ListCtrl = GetListCtrl();
01206
01207     if( DisableCommon() )
01208     {
01209         pCmdUI->Enable(FALSE);
01210         return;
01211     }
01212
01213     int nItem = -1;
01214     BOOL res = TRUE;
01215
01216     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01217     {
01218         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01219         if( data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR )
01220         {
01221             res = FALSE;
01222             break;
01223         }
01224     }
01225
01226     pCmdUI->Enable(res);
01227 }
01228
01232 void CBrowseFileView::Resort(void)
01233 {
01234     CListCtrl& ListCtrl = GetListCtrl();
01235     KoColumnContext context(GetPath());
01236     KiColumnModel* model = GetColumnModel();
01237
01238     CSortParam sortParam(m_ascendant, true, model->GetAt(m_sort), model->GetAt(0), &context);
01239     m_ctrlHeader.SetSortImage(m_sort, m_ascendant);
01240
01241     ListCtrl.SortItems(_Compare, (LPARAM)&sortParam);
01242 }
01243
01245 void CBrowseFileView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
01246 {
01247     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01248     CListCtrl& ListCtrl = GetListCtrl();
01249
01250     if( pNMListView->iSubItem == m_sort )
01251     {
01252         m_ascendant = !m_ascendant;
01253     }
01254     else
01255     {
01256         m_ascendant = true;
01257         m_sort = pNMListView->iSubItem;
01258         KiColumnModel* model = GetColumnModel();
01259         m_ascendant = model->GetAt(m_sort)->IsDefaultAscending();
01260     }
01261
01262     Resort();
01263     *pResult = 0;
01264 }
01265
01271 bool CBrowseFileView::ProcessSelectionCommand(KiSelectionHandler* handler)
01272 {
01273     bool res = false;
01274
01275     CListCtrl& ListCtrl = GetListCtrl();
01276     int nItem = -1;
01277     int pathLen = GetPath().length();
01278
01279     MultiFiles mf;
01280
01281     // First add the folders
01282     mf.newdir(GetPath());
01283
01284     // Process selection
01285     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01286     {
01287         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01288         UStr buf;
01289         const char* fullpath = data->GetFullPathName(buf);
01290
01291         if( data->GetType() == ENT_SUBDIR )
01292         {
01293             handler->OnFolder(fullpath);
01294             res = true;
01295
01296             break;
01297         }
01298         else
01299         {
01300             const char* fn = data->GetFullPathName(buf) + pathLen;
01301             if( *fn == '\\' )
01302             {
01303                 fn++;
01304             }
01305
01306             mf.newfile(fn, 0, (*data)[EntnodeFile::kVN]);
01307         }
01308     }
01309
01310     if( mf.TotalNumFiles() != 0 )
01311     {
01312         handler->OnFiles(&mf);
01313         res = true;
01314     }
01315
01316     return res;
01317 }
01318
01320 void CBrowseFileView::OnViewAdd()
01321 {
01322     KoAddHandler handler;
01323     ProcessSelectionCommand(&handler);
01324 }
01325
01327 void CBrowseFileView::OnViewAddb()
01328 {
01329     KoAddBinaryHandler handler;
01330     ProcessSelectionCommand(&handler);
01331 }
01332
01334 void CBrowseFileView::OnViewAddu()
01335 {
01336     KoAddUnicodeHandler handler;
01337     ProcessSelectionCommand(&handler);
01338 }
01339
01341 void CBrowseFileView::OnViewCommit()
01342 {
01343     KoCommitHandler handler;
01344     ProcessSelectionCommand(&handler);
01345 }
01346
01348 void CBrowseFileView::OnViewRmv()
01349 {
01350     KoFileRemoveHandler handler;
01351     ProcessSelectionCommand(&handler);
01352 }
01353
01355 void CBrowseFileView::OnViewUpdate()
01356 {
01357     KoUpdateHandler handler;
01358     ProcessSelectionCommand(&handler);
01359 }
01360
01362 void CBrowseFileView::OnViewQueryUpdate()
01363 {
01364     KoQueryUpdateHandler handler;
01365     ProcessSelectionCommand(&handler);
01366 }
01367
01369 void CBrowseFileView::OnUpdateViewReload(CCmdUI* pCmdUI)
01370 {
01371     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01372     pCmdUI->Enable(!app->IsCvsRunning());
01373 }
01374
01376 void CBrowseFileView::OnViewReload()
01377 {
01378     ResetView(true);
01379 }
01380
01382 void CBrowseFileView::OnKeydown(NMHDR* pNMHDR, LRESULT* pResult)
01383 {
01384     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01385     if( app->IsCvsRunning() )
01386         return;
01387
01388     CListCtrl& ListCtrl = GetListCtrl();
01389     LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
01390
01391     if( pLVKeyDow->wVKey == VK_BACK )
01392     {
01393         OnViewUpone();
01394     }
01395     else if( pLVKeyDow->wVKey == VK_RETURN && ListCtrl.GetSelectedCount() == 1 )
01396     {
01397         int nItem = -1;
01398         if( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01399         {
01400             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01401             if( data->GetType() == ENT_SUBDIR )
01402             {
01403                 UStr buf;
01404                 const char* fullpath = data->GetFullPathName(buf);
01405                 ResetView(fullpath, true);
01406             }
01407             else
01408             {
01409                 EditSel(data);
01410             }
01411         }
01412     }
01413
01414     *pResult = 0;
01415 }
01416
01423 int CBrowseFileView::GetPathLength(LPCTSTR path)
01424 {
01425     int len = _tcslen(path);
01426     return (len > 0 && path[len - 1] == kPathDelimiter) ? (len - 1) : len;
01427 }
01428
01435 bool CBrowseFileView::IsSamePath(LPCTSTR path1, LPCTSTR path2)
01436 {
01437     int len1 = GetPathLength(path1);
01438     int len2 = GetPathLength(path2);
01439     return len1 == len2 && _tcsicmp(path1, path2) == 0;
01440 }
01441
01443 void CBrowseFileView::OnViewUpone()
01444 {
01445     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01446     if( !IsSamePath(m_path, app->GetRoot()) && chdir(m_path) == 0 && chdir("..") == 0 )
01447     {
01448         char newpath[1024];
01449         getcwd(newpath, 1023);
01450
01451         ResetView(newpath, true);
01452     }
01453     else
01454     {
01455         MessageBeep(MB_ICONHAND);
01456     }
01457 }
01458
01460 void CBrowseFileView::OnUpdateViewUpone(CCmdUI* pCmdUI)
01461 {
01462     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01463     pCmdUI->Enable(!app->IsCvsRunning() && !IsSamePath(m_path, app->GetRoot()));
01464 }
01465
01467 void CBrowseFileView::OnViewTrash()
01468 {
01469     KoMoveToTrashHandler handler;
01470     ProcessSelectionCommand(&handler);
01471 }
01472
01474 void CBrowseFileView::OnUpdateViewTrash(CCmdUI* pCmdUI)
01475 {
01476     bool enabled = !DisableCommon();
01477     if( enabled )
01478     {
01479         KoUpdateMoveToTrashHandler handler;
01480         ProcessSelectionCommand(&handler);
01481         enabled = handler.IsEnabled();
01482     }
01483
01484     pCmdUI->Enable(enabled);
01485 }
01486
01488 void CBrowseFileView::OnViewDiff()
01489 {
01490     KoDiffHandler handler;
01491     ProcessSelectionCommand(&handler);
01492 }
01493
01495 void CBrowseFileView::OnViewLog()
01496 {
01497     KoLogHandler handler;
01498     ProcessSelectionCommand(&handler);
01499 }
01500
01502 void CBrowseFileView::OnViewGraph()
01503 {
01504     KoGraphHandler handler;
01505     ProcessSelectionCommand(&handler);
01506 }
01507
01509 void CBrowseFileView::OnViewStatus()
01510 {
01511     KoStatusHandler handler;
01512     ProcessSelectionCommand(&handler);
01513 }
01514
01516 void CBrowseFileView::OnViewUnlock()
01517 {
01518     KoUnlockHandler handler;
01519     ProcessSelectionCommand(&handler);
01520 }
01521
01523 void CBrowseFileView::OnViewWatchOn()
01524 {
01525     KoWatchOnHandler handler;
01526     ProcessSelectionCommand(&handler);
01527 }
01528
01530 void CBrowseFileView::OnViewWatchOff()
01531 {
01532     KoWatchOffHandler handler;
01533     ProcessSelectionCommand(&handler);
01534 }
01535
01537 void CBrowseFileView::OnViewEdit()
01538 {
01539     KoEditHandler handler;
01540     ProcessSelectionCommand(&handler);
01541 }
01542
01544 void CBrowseFileView::OnViewReservededit()
01545 {
01546     KoReservedEditHandler handler;
01547     ProcessSelectionCommand(&handler);
01548 }
01549
01551 void CBrowseFileView::OnViewForceedit()
01552 {
01553     KoForceEditHandler handler;
01554     ProcessSelectionCommand(&handler);
01555 }
01556
01558 void CBrowseFileView::OnViewUnedit()
01559 {
01560     KoUneditHandler handler;
01561     ProcessSelectionCommand(&handler);
01562 }
01563
01565 void CBrowseFileView::OnViewRelease()
01566 {
01567     KoReleaseHandler handler;
01568     ProcessSelectionCommand(&handler);
01569 }
01570
01572 void CBrowseFileView::OnViewWatchers()
01573 {
01574     KoWatchersHandler handler;
01575     ProcessSelectionCommand(&handler);
01576 }
01577
01579 void CBrowseFileView::OnViewEditors()
01580 {
01581     KoEditorsHandler handler;
01582     ProcessSelectionCommand(&handler);
01583 }
01584
01586 void CBrowseFileView::OnContextMenu(CWnd* pWnd, CPoint point)
01587 {
01588     if( DisableCommon() )
01589     {
01590         return;
01591     }
01592
01593     CListCtrl& listCtrl = GetListCtrl();
01594     if( listCtrl.GetSelectedCount() > 0 )
01595     {
01596         // Try to find a selected and focused item
01597         int item = listCtrl.GetNextItem(-1, LVNI_SELECTED | LVNI_FOCUSED);
01598         if( item == -1 )
01599         {
01600             // Get the first selected item then
01601             item = listCtrl.GetNextItem(-1, LVNI_SELECTED);
01602         }
01603
01604         if( item > -1 )
01605         {
01606             // Set the track point in case it's not the mouse click
01607             if( -1 == point.x && -1 == point.y )
01608             {
01609                 // Get the icon's rectangle
01610                 CRect rectItem;
01611                 if( listCtrl.GetItemRect(item, &rectItem, LVIR_ICON) )
01612                 {
01613                     point = rectItem.CenterPoint();
01614                     ClientToScreen(&point);
01615                 }
01616             }
01617
01618             // Display the pop-up menu
01619             std::auto_ptr<CMenu> pCustomMenu(::GetCustomMenu(kCustomFilesMenu, this));
01620             if( pCustomMenu.get() )
01621             {
01622                 pCustomMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
01623             }
01624         }
01625     }
01626 }
01627
01629 void CBrowseFileView::OnViewTagNew()
01630 {
01631     KoCreateTagHandler handler;
01632     ProcessSelectionCommand(&handler);
01633 }
01634
01636 void CBrowseFileView::OnViewTagDelete()
01637 {
01638     KoDeleteTagHandler handler;
01639     ProcessSelectionCommand(&handler);
01640 }
01641
01643 void CBrowseFileView::OnViewTagBranch()
01644 {
01645     KoBranchTagHandler handler;
01646     ProcessSelectionCommand(&handler);
01647 }
01648
01650 BOOL CBrowseFileView::OnCustomize(UINT nID)
01651 {
01652     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01653     return TRUE;
01654 }
01655
01657 void CBrowseFileView::OnUpdateCustomize(CCmdUI* pCmdUI)
01658 {
01659     pCmdUI->Enable(TRUE);
01660 }
01661
01663 BOOL CBrowseFileView::OnMacro(UINT nID)
01664 {
01665     PyDoPython(WINCMD_to_UCMD(nID));
01666
01667     return 1;
01668 }
01669
01671 void CBrowseFileView::OnUpdateMacro(CCmdUI* pCmdUI)
01672 {
01673     if( DisableCommon(false) )
01674     {
01675         pCmdUI->Enable(FALSE);
01676         return;
01677     }
01678
01679     // Fill the cache with current selection
01680     if( !PyIsUICacheValid() )
01681     {
01682         CListCtrl& ListCtrl = GetListCtrl();
01683         int nItem = -1;
01684         while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01685         {
01686             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01687             PyAppendCache(data);
01688         }
01689     }
01690
01691     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01692     ucmdui.pCmdUI = pCmdUI;
01693     PyDoCmdUI(&ucmdui);
01694 }
01695
01697 void CBrowseFileView::OnViewExplore()
01698 {
01699     const char* fullpath = m_path;
01700
01701     CListCtrl& ListCtrl = GetListCtrl();
01702     int nItem = -1;
01703
01704     // first add the folders
01705     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01706     {
01707         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01708         if( data->GetType() == ENT_SUBDIR )
01709         {
01710             UStr buf;
01711             fullpath = data->GetFullPathName(buf);
01712             break;
01713         }
01714     }
01715
01716     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath, 0L, 0L, SW_SHOWDEFAULT);
01717     if( (long)hInst < 32 )
01718     {
01719         cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01720     }
01721 }
01722
01724 void CBrowseFileView::OnUpdateViewExplore(CCmdUI* pCmdUI)
01725 {
01726     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01727     CListCtrl& ListCtrl = GetListCtrl();
01728     if( DisableCommon() )
01729     {
01730         pCmdUI->Enable(FALSE);
01731         return;
01732     }
01733
01734     int nItem = -1;
01735     int numItem = 0;
01736     BOOL res = TRUE;
01737
01738     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01739     {
01740         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01741         if( data->IsMissing() || ++numItem > 1 )
01742         {
01743             res = FALSE;
01744             break;
01745         }
01746     }
01747
01748     pCmdUI->Enable(res);
01749 }
01750
01752 void CBrowseFileView::OnTimer(UINT nIDEvent)
01753 {
01754     if( nIDEvent == m_uiFilechangeTimer )
01755     {
01756         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01757         if( !app->IsCvsRunning() )
01758         {
01759             // cvs command finished
01760             if( m_checkChanges )
01761             {
01762                 // Refresh the directory tree and file view
01763                 m_checkChanges = false;
01764                 ResetView(true);
01765
01766                 return;
01767             }
01768
01769             // file change
01770             if( m_isFilesChange )
01771             {
01772                 ResetView();
01773             }
01774
01775             // check if we need to reload
01776             time_t newEntriesMod;
01777             time_t newEntriesLogMod;
01778             GetEntriesModTime(newEntriesMod, newEntriesLogMod);
01779
01780             if( m_entriesMod != newEntriesMod || m_entriesLogMod != newEntriesLogMod )
01781             {
01782                 ResetView();
01783             }
01784         }
01785
01786         return;
01787     }
01788
01789     CListView::OnTimer(nIDEvent);
01790 }
01791
01793 LRESULT CBrowseFileView::OnFileChange(WPARAM, LPARAM)
01794 {
01795     m_isFilesChange = true;
01796     return 0;
01797 }
01798
01803 void CBrowseFileView::SetFullRowSel(BOOL bFullRowSel)
01804 {
01805     CListCtrl& ListCtrl = GetListCtrl();
01806     DWORD dwExStyle = ListView_GetExtendedListViewStyle(ListCtrl.m_hWnd);
01807     if( bFullRowSel )
01808         dwExStyle |= LVS_EX_FULLROWSELECT;
01809     else
01810         dwExStyle &= ~LVS_EX_FULLROWSELECT;
01811
01812     ListView_SetExtendedListViewStyle(ListCtrl.m_hWnd, dwExStyle);
01813 }
01814
01816 void CBrowseFileView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
01817 {
01818     CListView::OnBeginPrinting(pDC, pInfo);
01819
01820     int nPageHeight = pDC->GetDeviceCaps(VERTRES);
01821     TEXTMETRIC tm;
01822     pDC->GetTextMetrics(&tm);
01823
01824     // compute the bounds
01825     CListCtrl& ListCtrl = GetListCtrl();
01826     m_numberOfLines = ListCtrl.GetItemCount();
01827     m_heightOfLines = 2 * tm.tmHeight;
01828     m_numberByPages = nPageHeight / m_heightOfLines;
01829     m_numberOfPages = m_numberOfLines / m_numberByPages + 1;
01830
01831     pInfo->SetMaxPage(m_numberOfPages);
01832 }
01833
01835 BOOL CBrowseFileView::OnPreparePrinting(CPrintInfo* pInfo)
01836 {
01837     BOOL res = DoPreparePrinting(pInfo);
01838     if( !res )
01839         return res;
01840
01841     return TRUE;
01842 }
01843
01845 void CBrowseFileView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
01846 {
01847     if( !pDC->IsPrinting() )
01848         return;
01849
01850     // Now compute the first item to draw
01851     CListCtrl& ListCtrl = GetListCtrl();
01852     int nFirstItem = -1;
01853     int numToIgnore = m_numberByPages * (pInfo->m_nCurPage - 1);
01854
01855     while( numToIgnore-- && (nFirstItem = ListCtrl.GetNextItem(nFirstItem, LVNI_ALL)) != -1 )
01856     {
01857     }
01858
01859     TEXTMETRIC tm;
01860     pDC->GetTextMetrics(&tm);
01861
01862     int nItem = nFirstItem, n = 0;
01863     int horz = pInfo->m_rectDraw.Width();
01864     int vert = pInfo->m_rectDraw.Height();
01865
01866     // Measure for each column
01867     KiColumnModel* model = GetColumnModel();
01868     int columnCount = model->GetCount();
01869     std::vector<int> widths(columnCount, 0);
01870     int totalwidth = 0;
01871     int j;
01872
01873     KoColumnContext context(GetPath());
01874     while( n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1 )
01875     {
01876         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01877         for(j = 0; j < columnCount; j++)
01878         {
01879             TCHAR buffer[256];
01880             model->GetAt(j)->GetText(&context, data, buffer, 256);
01881             int width = pDC->GetTextExtent(buffer, _tcslen(buffer)).cx + kSpc;
01882             widths[j] = max(widths[j], width);
01883         }
01884     }
01885
01886     for(j = 0; j < columnCount; j++)
01887     {
01888         totalwidth += widths[j];
01889     }
01890
01891     for(j = 0; j < columnCount; j++)
01892     {
01893         widths[j] += (horz - totalwidth) / columnCount;
01894     }
01895
01896     // Compute the margins
01897     for(j = columnCount - 1; j >= 0; j--)
01898     {
01899         int margin = 0;
01900         for(int i = j - 1; i >= 0; i--)
01901         {
01902             margin += widths[i];
01903         }
01904
01905         widths[j] = margin;
01906     }
01907
01908     // Now print
01909     nItem = nFirstItem;
01910     n = 0;
01911     CPoint off = pInfo->m_rectDraw.TopLeft();
01912
01913     while( n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1 )
01914     {
01915         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01916         for(j = 0; j < columnCount; j++)
01917         {
01918             const char* info = (*data)[j];
01919             if( info == 0L )
01920                 continue;
01921
01922             CPoint where = off;
01923             where.x += widths[j];
01924             CString s(info);
01925             CRect r(0,0,0,0);
01926
01927             pDC->DrawText(s, -1, &r, DT_CALCRECT);
01928             r.OffsetRect(where);
01929
01930             pDC->DrawText(s, -1, &r, DT_CENTER);
01931         }
01932
01933         off += CPoint(0, m_heightOfLines);
01934     }
01935
01936     //CListView::OnPrint(pDC, pInfo);
01937 }
01938
01940 void CBrowseFileView::OnViewEditsel()
01941 {
01942     CListCtrl& ListCtrl = GetListCtrl();
01943     int nItem = -1;
01944
01945     // First add the folders
01946     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01947     {
01948         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01949         EditSel(data);
01950     }
01951 }
01952
01954 void CBrowseFileView::OnViewEditseldef()
01955 {
01956     CListCtrl& ListCtrl = GetListCtrl();
01957     int nItem = -1;
01958
01959     // first add the folders
01960     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01961     {
01962         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01963         EditSel(data, true);
01964     }
01965 }
01966
01968 void CBrowseFileView::OnUpdateViewEditseldef(CCmdUI* pCmdUI)
01969 {
01970     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01971     CListCtrl& ListCtrl = GetListCtrl();
01972     if( DisableCommon() )
01973     {
01974         pCmdUI->Enable(FALSE);
01975         return;
01976     }
01977
01978     int nItem = -1;
01979     BOOL res = TRUE;
01980
01981     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01982     {
01983         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01984         if( data->GetType() == ENT_SUBDIR || data->IsMissing() )
01985         {
01986             res = FALSE;
01987             break;
01988         }
01989     }
01990
01991     CString str;
01992     if( FormatMenuString(pCmdUI->m_nID, str) && pCmdUI->m_pParentMenu )
01993     {
01994         pCmdUI->SetText(str);
01995     }
01996
01997     pCmdUI->Enable(res);
01998 }
01999
02001 void CBrowseFileView::OnViewCheckout()
02002 {
02003     KoCheckoutHandler handler;
02004
02005     if( !ProcessSelectionCommand(&handler) )
02006     {
02007         handler.OnFolder(m_path);
02008     }
02009 }
02010
02012 void CBrowseFileView::OnUpdateViewCheckout(CCmdUI* pCmdUI)
02013 {
02014     if( DisableCommon(false) )
02015     {
02016         pCmdUI->Enable(FALSE);
02017         return;
02018     }
02019
02020     pCmdUI->Enable(TRUE);
02021     pCmdUI->SetText("Chec&kout module...");
02022 }
02023
02025 void CBrowseFileView::OnViewImport()
02026 {
02027     KoImportHandler handler;
02028
02029     if( !ProcessSelectionCommand(&handler) )
02030     {
02031         handler.OnFolder(m_path);
02032     }
02033 }
02034
02036 void CBrowseFileView::OnUpdateViewImport(CCmdUI* pCmdUI)
02037 {
02038     if( DisableCommon(false) )
02039     {
02040         pCmdUI->Enable(FALSE);
02041         return;
02042     }
02043
02044     pCmdUI->Enable(TRUE);
02045     pCmdUI->SetText("&Import module...");
02046 }
02047
02054 void CBrowseFileView::DoDrag()
02055 {
02056     CListCtrl& ListCtrl = GetListCtrl();
02057     int nItem=-1;
02058     int nSize = 0;
02059
02060     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02061     {
02062         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02063         if( data->GetType() != ENT_SUBDIR )
02064         {
02065             UStr buf;
02066             const char* fullpath = data->GetFullPathName(buf);
02067             nSize += strlen(fullpath) + 1;
02068         }
02069     }
02070
02071     if( nSize > 0 )
02072     {
02073         HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, sizeof(DROPFILES)+nSize+1);
02074         if( hMem != NULL )
02075         {
02076             DROPFILES& df = *reinterpret_cast<DROPFILES*>(hMem);
02077             df.pFiles = sizeof(DROPFILES);
02078             df.fNC = FALSE;
02079             df.pt.x = df.pt.y = 0;
02080             df.fWide = FALSE;
02081
02082             nItem=-1;
02083             int Offset = sizeof(DROPFILES);
02084             while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02085             {
02086                 EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02087                 if( data->GetType() != ENT_SUBDIR)
02088                 {
02089                     UStr buf;
02090                     const char* fullpath = data->GetFullPathName(buf);
02091                     int len = strlen(fullpath) + 1;
02092                     memcpy(reinterpret_cast<BYTE*>(hMem)+Offset, fullpath, len);
02093                     Offset+=len;
02094                 }
02095             }
02096
02097             reinterpret_cast<BYTE*>(hMem)[Offset]=0;
02098
02099             COleDataSource ds;
02100             ds.CacheGlobalData( CF_HDROP, hMem );
02101             ds.DoDragDrop( DROPEFFECT_COPY );
02102         }
02103     }
02104 }
02105
02107 void CBrowseFileView::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult)
02108 {
02109     DoDrag();
02110     *pResult = 0;
02111 }
02112
02114 void CBrowseFileView::OnBeginrdrag(NMHDR* pNMHDR, LRESULT* pResult)
02115 {
02116     DoDrag();
02117     *pResult = 0;
02118 }
02119
02121 void CBrowseFileView::OnDestroy()
02122 {
02123     SaveColumns();
02124
02125     if( m_watch )
02126     {
02127         m_watch->SignalTerminate();
02128         m_watch = NULL;
02129     }
02130
02131     // Unregister notifications
02132     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
02133     {
02134         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
02135         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
02136         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
02137     }
02138
02139     // Kill the timer
02140     if( m_uiFilechangeTimer )
02141     {
02142         KillTimer(m_uiFilechangeTimer);
02143     }
02144
02145     CListView::OnDestroy();
02146 }
02147
02151 void CBrowseFileView::SaveColumns()
02152 {
02153     AfxGetApp()->WriteProfileString("FileDetailView", NULL, NULL);
02154
02155     char buffer[2048];
02156     char* cp = buffer;
02157     int count = m_ctrlHeader.GetItemCount();
02158
02159     for(int i = 0; i < count; ++i)
02160     {
02161         int width = GetListCtrl().GetColumnWidth(i);
02162         cp += sprintf(cp, "%d ", width);
02163     }
02164
02165     AfxGetApp()->WriteProfileString("FileDetailView", "Column Widths", buffer);
02166
02167     int order[128];
02168     if( m_ctrlHeader.GetOrderArray(order, count) )
02169     {
02170         cp = buffer;
02171         for(int i = 0; i < count; ++i)
02172         {
02173             cp += sprintf(cp, "%d ", order[i]);
02174         }
02175
02176         AfxGetApp()->WriteProfileString("FileDetailView", "Column Order", buffer);
02177     }
02178 }
02179
02184 bool CBrowseFileView::LoadColumns()
02185 {
02186     CString widths = AfxGetApp()->GetProfileString("FileDetailView", "Column Widths");
02187     CString orders  = AfxGetApp()->GetProfileString("FileDetailView", "Column Order");
02188
02189     if( widths.IsEmpty() || orders.IsEmpty() )
02190     {
02191         return false;
02192     }
02193
02194     int count = m_ctrlHeader.GetItemCount();
02195     int order[128];
02196     for(int i = 0; i < count; ++i)
02197     {
02198         CString strSubString;
02199         AfxExtractSubString(strSubString, widths, i, _T(' '));
02200
02201         const int width = _ttoi(strSubString);
02202         GetListCtrl().SetColumnWidth(i, width);
02203
02204         AfxExtractSubString(strSubString, orders, i, _T(' '));
02205         order[i] = _ttoi(strSubString);
02206     }
02207
02208     m_ctrlHeader.SetOrderArray(count, order);
02209
02210     return true;
02211 }
02212
02214 BOOL CBrowseFileView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
02215 {
02216     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02217     if( app->IsCvsRunning() )
02218     {
02219         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
02220         return TRUE;
02221     }
02222
02223     return CListView::OnSetCursor(pWnd, nHitTest, message);
02224 }
02225
02229 void CBrowseFileView::OnFilteringChanged()
02230 {
02231     if( !m_isResetViewPending )
02232     {
02233         m_isResetViewPending = true;
02234         PostMessage(WM_RESETVIEW);
02235     }
02236 }
02237
02239 void CBrowseFileView::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
02240 {
02241     NM_LISTVIEW* p = (NM_LISTVIEW*)pNMHDR;
02242     if( p->lParam )
02243     {
02244         EntnodeData* data = (EntnodeData*)(LPVOID)p->lParam;
02245         data->UnRef();
02246     }
02247
02248     *pResult = 0;
02249 }
02250
02252 LRESULT CBrowseFileView::OnResetView(WPARAM, LPARAM)
02253 {
02254     ResetView(false, NULL);
02255     return 0;
02256 }
02257
02259 void CBrowseFileView::OnUpdateViewAnnotate(CCmdUI* pCmdUI)
02260 {
02261     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02262     CListCtrl& ListCtrl = GetListCtrl();
02263
02264     if( DisableCommon() )
02265     {
02266         pCmdUI->Enable(FALSE);
02267         return;
02268     }
02269
02270     int nItem = -1;
02271     BOOL res = TRUE;
02272
02273     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02274     {
02275         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02276         if( data->IsUnknown() || data->GetType() == ENT_SUBDIR )
02277         {
02278             res = FALSE;
02279             break;
02280         }
02281     }
02282
02283     pCmdUI->Enable(res);
02284 }
02285
02287 void CBrowseFileView::OnAnnotate()
02288 {
02289     KoAnnotateHandler handler;
02290     ProcessSelectionCommand(&handler);
02291 }
02292
02294 void CBrowseFileView::OnEditSelectAll()
02295 {
02296     CListCtrl& ListCtrl = GetListCtrl();
02297
02298     for( int nIndex = 0; nIndex < ListCtrl.GetItemCount(); nIndex++ )
02299     {
02300         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nIndex);
02301         if( data->GetType() == ENT_FILE )
02302         {
02303             ListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
02304         }
02305     }
02306
02307     if( ListCtrl.GetSelectedCount() )
02308     {
02309         ListCtrl.SetFocus();
02310     }
02311 }
02312
02314 void CBrowseFileView::OnAppCmdline()
02315 {
02316     KoCommandLineHandler handler;
02317
02318     if( !ProcessSelectionCommand(&handler) )
02319     {
02320         handler.OnFolder(m_path);
02321     }
02322 }
02323
02325 void CBrowseFileView::OnUpdateCvsCmd(CCmdUI* pCmdUI)
02326 {
02327     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02328     pCmdUI->Enable(app->IsCvsRunning() || gCvsPrefs.empty() ? FALSE : TRUE);
02329 }
02330
02332 void CBrowseFileView::OnAppRtagbranch()
02333 {
02334     KoRtagBranchHandler handler;
02335
02336     if( !ProcessSelectionCommand(&handler) )
02337     {
02338         handler.OnFolder(m_path);
02339     }
02340 }
02341
02343 void CBrowseFileView::OnAppRtagcreate()
02344 {
02345     KoRtagCreateHandler handler;
02346
02347     if( !ProcessSelectionCommand(&handler) )
02348     {
02349         handler.OnFolder(m_path);
02350     }
02351 }
02352
02354 void CBrowseFileView::OnAppRtagdelete()
02355 {
02356     KoRtagDeleteHandler handler;
02357
02358     if( !ProcessSelectionCommand(&handler) )
02359     {
02360         handler.OnFolder(m_path);
02361     }
02362 }
Generated on Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "FileTraversal.h"
00038
00039 class MultiFiles;
00040 class KoWatcher;
00041 class KiSelectionHandler;
00042 class KiColumnModel;
00043 class KiFilterModel;
00044 class CBrowseFileView;
00045
00047 enum
00048 {
00049     kFileIconText = 0,
00050     kFileIconBinary,
00051     kFileIconUnknown,
00052     kFileIconAdded,
00053     kFileIconConflict,
00054     kFileIconMiss,
00055     kFolderIcon,
00056     kFolderIconUnknown,
00057     kFolderIconMiss,
00058     kFileIconTextMod,
00059     kFileIconBinaryMod,
00060     kFileIconIgnored,
00061     kFolderIconIgnored,
00062     kFileIconRemoved,
00063     kFileIconBinaryAdded,
00064     kFileIconUnicode,
00065     kFileIconUnicodeMod,
00066     kFileIconUnicodeAdded
00067 };
00068
00070 // CRecursionLock
00071
00073 class CRecursionLock
00074 {
00075 public:
00076     // Construction
00077     CRecursionLock(bool& semaphore) ;
00078     virtual ~CRecursionLock();
00079
00080 private:
00081     // Data members
00082     bool& m_semaphore;
00083 };
00084
00086 // KoTraversalContext
00087
00089 class KoTraversalContext
00090 {
00091 public:
00092     // Construction
00093     KoTraversalContext(CBrowseFileView* view);
00094
00095 private:
00096     // Data members
00097     bool m_isRecursive;
00098     bool m_isShowIgnored;
00099     KiFilterModel* m_filter;
00101     CBrowseFileView* m_view;
00103 public:
00104     // Interface
00105     bool IsRecursive() const;
00106     bool IsShowIgnored() const;
00107     CBrowseFileView* GetView() const;
00108
00109     bool IsMatch(EntnodeData* data) const;
00110 };
00111
00113 // TViewFill
00114
00116 class TViewFill : public TraversalReport
00117 {
00118 public:
00119     // Construction
00120     TViewFill(const KoTraversalContext* context);
00121
00122 private:
00123     // Data members
00124     CSortList<ENTNODE> m_entries;
00125     vector<CStr> m_ignlist;
00126     const KoTraversalContext* m_context;
00128 public:
00129     // Interface
00130     int InitItem(EntnodeData* data, int iImage, const char* tag = 0L);
00131
00132     CBrowseFileView* GetView() const ;
00133     CListCtrl& GetListCtrl() const;
00134     bool IsRecursive() const;
00135     bool IsShowIgnored() const;
00136
00137     virtual kTraversal EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec);
00138     virtual kTraversal ExitDirectory(const char* fullpath);
00139     virtual kTraversal OnError(const char* err, int errcode);
00140     virtual kTraversal OnIdle(const char* fullpath);
00141     virtual kTraversal OnDirectory(const char* fullpath, const char* fullname, const char* name,
00142         const struct stat& dir, const FSSpec* macspec);
00143
00144     virtual kTraversal OnAlias(const char* fullpath, const char* fullname, const char* name,
00145         const struct stat& dir, const FSSpec* macspec);
00146
00147     virtual kTraversal OnFile(const char* fullpath, const char* fullname, const char* name,
00148         const struct stat& dir, const FSSpec* macspec);
00149 };
00150
00151
00153 // CBrowseFileView
00154
00155 class CBrowseFileView : public CListView
00156 {
00157 protected: // create from serialization only
00158     CBrowseFileView();
00159     DECLARE_DYNCREATE(CBrowseFileView)
00160
00161 // Operations
00162 public:
00163
00164 // Overrides
00165     // ClassWizard generated virtual function overrides
00166     //{{AFX_VIRTUAL(CBrowseFileView)
00167     public:
00168     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00169     protected:
00170     virtual void OnInitialUpdate(); // called first time after construct
00171     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00172     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00173     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00174     //}}AFX_VIRTUAL
00175
00176 // Implementation
00177 public:
00178     virtual ~CBrowseFileView();
00179 #ifdef _DEBUG
00180     virtual void AssertValid() const;
00181     virtual void Dump(CDumpContext& dc) const;
00182 #endif
00183
00184 // Generated message map functions
00185 protected:
00186     //{{AFX_MSG(CBrowseFileView)
00187     afx_msg void OnViewSmallIcons();
00188     afx_msg void OnViewList();
00189     afx_msg void OnViewFullRowDetails();
00190     afx_msg void OnUpdateViewSmallIcons(CCmdUI* pCmdUI);
00191     afx_msg void OnUpdateViewAdd(CCmdUI* pCmdUI);
00192     afx_msg void OnUpdateViewAddB(CCmdUI* pCmdUI);
00193     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00194     afx_msg void OnUpdateViewRelease(CCmdUI* pCmdUI);
00195     afx_msg void OnUpdateViewRmv(CCmdUI* pCmdUI);
00196     afx_msg void OnUpdateViewGraph(CCmdUI* pCmdUI);
00197     afx_msg void OnUpdateViewList(CCmdUI* pCmdUI);
00198     afx_msg void OnUpdateViewEditseldef(CCmdUI* pCmdUI);
00199     afx_msg void OnUpdateViewFullRowDetails(CCmdUI* pCmdUI);
00200     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00201     afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
00202     afx_msg void OnViewAdd();
00203     afx_msg void OnViewAddb();
00204     afx_msg void OnViewCommit();
00205     afx_msg void OnViewRmv();
00206     afx_msg void OnViewUpdate();
00207     afx_msg void OnViewQueryUpdate();
00208     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00209     afx_msg void OnViewReload();
00210     afx_msg void OnKeydown(NMHDR* pNMHDR, LRESULT* pResult);
00211     afx_msg void OnViewUpone();
00212     afx_msg void OnUpdateViewUpone(CCmdUI* pCmdUI);
00213     afx_msg void OnViewTrash();
00214     afx_msg void OnUpdateViewTrash(CCmdUI* pCmdUI);
00215     afx_msg void OnViewDiff();
00216     afx_msg void OnViewLog();
00217     afx_msg void OnViewGraph();
00218     afx_msg void OnViewStatus();
00219     afx_msg void OnViewUnlock();
00220     afx_msg void OnViewWatchOn();
00221     afx_msg void OnViewWatchOff();
00222     afx_msg void OnViewEdit();
00223     afx_msg void OnViewUnedit();
00224     afx_msg void OnViewWatchers();
00225     afx_msg void OnViewEditors();
00226     afx_msg void OnViewRelease();
00227     afx_msg void OnViewTagNew();
00228     afx_msg void OnViewTagDelete();
00229     afx_msg void OnViewTagBranch();
00230     afx_msg void OnViewExplore();
00231     afx_msg void OnUpdateViewExplore(CCmdUI* pCmdUI);
00232     afx_msg void OnTimer(UINT nIDEvent);
00233     afx_msg void OnViewEditsel();
00234     afx_msg void OnViewEditseldef();
00235     afx_msg void OnViewCheckout();
00236     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00237     afx_msg void OnViewImport();
00238     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00239     afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
00240     afx_msg void OnBeginrdrag(NMHDR* pNMHDR, LRESULT* pResult);
00241     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00242     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00243     afx_msg void OnDestroy();
00244     afx_msg void OnUpdateViewAnnotate(CCmdUI* pCmdUI);
00245     afx_msg void OnAnnotate();
00246     afx_msg void OnEditSelectAll();
00247     afx_msg void OnViewReservededit();
00248     afx_msg void OnViewForceedit();
00249     afx_msg void OnViewAddu();
00250     afx_msg void OnAppCmdline();
00251     afx_msg void OnUpdateCvsCmd(CCmdUI* pCmdUI);
00252     afx_msg void OnAppRtagbranch();
00253     afx_msg void OnAppRtagcreate();
00254     afx_msg void OnAppRtagdelete();
00255     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00256     //}}AFX_MSG
00257     afx_msg void OnUpdateMacro(CCmdUI* pCmdUI);
00258     afx_msg BOOL OnMacro(UINT nID);
00259     afx_msg void OnUpdateCustomize(CCmdUI* pCmdUI);
00260     afx_msg BOOL OnCustomize(UINT nID);
00261     afx_msg LRESULT OnFileChange(WPARAM, LPARAM);
00262     afx_msg LRESULT OnResetView(WPARAM, LPARAM);
00263
00264     DECLARE_MESSAGE_MAP()
00265 private:
00266     // Data members
00267     CStr m_path;
00269     int m_numberOfLines;
00270     int m_numberByPages;
00271     int m_numberOfPages;
00272     int m_heightOfLines;
00274     bool m_isRecursive;
00275     bool m_isResetViewLocked;
00276     bool m_isResetViewPending;
00278     bool m_checkChanges;
00279     KoWatcher* m_watch;
00280     time_t m_entriesMod;
00281     time_t m_entriesLogMod;
00282     bool m_isFilesChange;
00283     UINT m_uiFilechangeTimer;
00285     CSortHeaderCtrl m_ctrlHeader;
00286     int m_sort;
00287     bool m_ascendant;
00289     KiColumnModel* m_modelColumns;
00290     static CImageList m_smallImageList;
00291     static CImageList m_stateImageList;
00293     // Methods
00294     void SetFullRowSel(BOOL bFullRowSel);
00295     void Resort(void);
00296
00297     BOOL SetViewType(DWORD dwViewType);
00298     DWORD GetViewType() const;
00299
00300     void GetEntriesModTime(time_t& newEntriesMod, time_t& newEntriesLogMod);
00301
00302     void EditSel(EntnodeData* data, bool useDefault = false);
00303     void DoDrag();
00304     void SetRecursive(bool isRecursive);
00305
00307     inline CFrameWnd* GetMainFrame() { return GetRoutingFrame(); }
00308
00309     bool ProcessSelectionCommand(KiSelectionHandler* handler);
00310
00311     bool DisableCommon(bool bCheckSelection = true);
00312
00313     void SaveColumns();
00314     bool LoadColumns();
00315     void AddColumns();
00316     void DeleteColumns();
00317
00318     int GetPathLength(LPCTSTR path);
00319     bool IsSamePath(LPCTSTR path1, LPCTSTR path2);
00320
00321 public:
00322     // Interface
00323
00325     const CStr& GetPath() const { return m_path; };
00326
00328     inline KiColumnModel* GetColumnModel() const { return m_modelColumns; }
00329
00331     inline void CheckChanges(void) { m_checkChanges = true; }
00332
00333     void OnFilteringChanged();
00334     void ResetView(bool notifyBrowser = false, const char* selectFile = 0L);
00335     void ResetView(const char* path, bool notifyBrowser = false, const char* selectFile = 0L);
00336
00337     static int GetImageForEntry(EntnodeData* data);
00338 };
00339
00340 #endif // !defined(AFX_BROWSEFILEVIEW_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/BrowserBar.cpp Source File

WinCvs/BrowserBar.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>
00019  */
00020
00021 // BrowserBar.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "BrowserBar.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00035 // CBrowserBar
00036
00037 IMPLEMENT_DYNCREATE(CBrowserBar, CView)
00038
00039 CBrowserBar::CBrowserBar() : m_browser(0L)
00040 {
00041 }
00042
00043 CBrowserBar::~CBrowserBar()
00044 {
00045 }
00046
00047
00048 BEGIN_MESSAGE_MAP(CBrowserBar, CView)
00049     //{{AFX_MSG_MAP(CBrowserBar)
00050     ON_WM_WINDOWPOSCHANGED()
00051     ON_WM_DESTROY()
00052     ON_WM_PAINT()
00053     //}}AFX_MSG_MAP
00054 END_MESSAGE_MAP()
00055
00056
00057 // CBrowserBar drawing
00058
00059
00060 // CBrowserBar diagnostics
00061
00062 #ifdef _DEBUG
00063 void CBrowserBar::AssertValid() const
00064 {
00065     CView::AssertValid();
00066 }
00067
00068 void CBrowserBar::Dump(CDumpContext& dc) const
00069 {
00070     CView::Dump(dc);
00071 }
00072 #endif //_DEBUG
00073
00075 // CBrowserBar message handlers
00076
00077 void CBrowserBar::OnDraw(CDC* pDC)
00078 {
00079     CDocument* pDoc = GetDocument();
00080 }
00081
00082 BOOL CBrowserBar::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00083 {
00084     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00085     if(!res)
00086         return FALSE;
00087
00088     m_browser = (CWinCvsBrowser *)RUNTIME_CLASS(CWinCvsBrowser)->CreateObject();
00089     VERIFY(m_browser->Create(0L, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP, CRect(0,0,0,0), this, 0));
00090
00091     return TRUE;
00092 }
00093
00094 void CBrowserBar::OnWindowPosChanged(WINDOWPOS FAR* wp)
00095 {
00096     CView::OnWindowPosChanged(wp);
00097
00098     //m_browser->SetWindowPos(NULL, wp->x, wp->y, wp->cx, wp->cy, SWP_NOZORDER);
00099     CRect r;
00100     GetClientRect(&r);
00101     if(m_browser != 0L)
00102         m_browser->SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00103 }
00104
00105 void CBrowserBar::OnDestroy()
00106 {
00107     if(m_browser)
00108         m_browser->DestroyWindow();
00109
00110     CView::OnDestroy();
00111 }
00112
00113 void CBrowserBar::OnPaint()
00114 {
00115     CPaintDC dc(this); // device context for painting
00116
00117     CRect r;
00118     GetClientRect(&r);
00119     CBrush brush(GetSysColor(COLOR_WINDOW));
00120     dc.FillRect(r, &brush);
00121 }
Generated on Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/BrowserBar.h Source File

WinCvs/BrowserBar.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>
00019  */
00020
00021 #if !defined(AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_)
00022 #define AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // BrowserBar.h : header file
00028 //
00029
00030 #include "WinCvsBrowser.h"
00031
00033 // CBrowserBar view
00034
00035 class CBrowserBar : public CView
00036 {
00037 public:
00038     virtual ~CBrowserBar();
00039
00040 protected:
00041     CBrowserBar();           // protected constructor used by dynamic creation
00042     DECLARE_DYNCREATE(CBrowserBar)
00043
00044 // Attributes
00045 public:
00046
00047 // Operations
00048 public:
00049     inline CWinCvsBrowser *GetBrowserView() { return m_browser; }
00050
00051 // Overrides
00052     // ClassWizard generated virtual function overrides
00053     //{{AFX_VIRTUAL(CBrowserBar)
00054     public:
00055     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00056     protected:
00057     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00058     //}}AFX_VIRTUAL
00059
00060 // Implementation
00061 protected:
00062 #ifdef _DEBUG
00063     virtual void AssertValid() const;
00064     virtual void Dump(CDumpContext& dc) const;
00065 #endif
00066
00067     CWinCvsBrowser *m_browser;
00068
00069     // Generated message map functions
00070 protected:
00071     //{{AFX_MSG(CBrowserBar)
00072     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00073     afx_msg void OnDestroy();
00074     afx_msg void OnPaint();
00075     //}}AFX_MSG
00076     DECLARE_MESSAGE_MAP()
00077 };
00078
00080
00081 //{{AFX_INSERT_LOCATION}}
00082 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00083
00084 #endif // !defined(AFX_BROWSERBAR_H__64721953_F9A8_11D2_BDEC_000000000000__INCLUDED_)
Generated on Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


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
00054
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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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
00055
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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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\tCtrl+D", 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
00242
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[0]);
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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/CvsStatusBar.cpp Source File

WinCvs/CvsStatusBar.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>
00019  */
00020
00021 // CvsStatusBar.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "CvsStatusBar.h"
00027 #include "CvsPrefs.h"
00028
00029 #ifdef _DEBUG
00030 #define new DEBUG_NEW
00031 #undef THIS_FILE
00032 static char THIS_FILE[] = __FILE__;
00033 #endif
00034
00036 // CCvsStatusBar
00037
00038 CCvsStatusBar::CCvsStatusBar() : m_step(-1), m_settimer(false)
00039 {
00040     m_indic.LoadBitmap(IDB_IDLE);
00041 }
00042
00043 CCvsStatusBar::~CCvsStatusBar()
00044 {
00045 }
00046
00047 void CCvsStatusBar::DrawItem(LPDRAWITEMSTRUCT p)
00048 {
00049     if( !m_settimer )
00050     {
00051         SetTimer(999, 100, 0L);
00052         m_settimer = true;
00053     }
00054
00055     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00056     if( !app->IsCvsRunning() && !gCvsPrefs.IsTclFileRunning() )
00057         return;
00058
00059     static int tab[12] = {
00060         -2, -1, 1, 4, 8, 11, 13, 11,
00061         8, 4, 1, -1};
00062     CDC hdc;
00063     CBrush b(RGB(0, 0, 0xFF));
00064
00065     hdc.Attach(p->hDC);
00066     CRect r(p->rcItem);
00067     hdc.FillRect(r, &b);
00068     CPoint off(r.TopLeft());
00069     off.x -= m_step;
00070     int cnt = 0;
00071     while(off.x < r.right)
00072     {
00073         CPoint offy(off);
00074         offy.y += tab[(m_step + cnt) % 12];
00075         hdc.DrawState(offy, CSize(16,16), m_indic, DSS_NORMAL);
00076         off.x += 24;
00077         cnt++;
00078     }
00079
00080     hdc.Detach();
00081 }
00082
00083 void CCvsStatusBar::OnTimer(UINT nIDEvent)
00084 {
00085     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00086     if( app->IsCvsRunning() || gCvsPrefs.IsTclFileRunning() )
00087     {
00088         if( m_step-- <= 0 )
00089             m_step = 23;
00090
00091         CRect r;
00092         GetItemRect(1, r);
00093         InvalidateRect(r, FALSE);
00094     }
00095     else if( m_step != -1 )
00096     {
00097         m_step = -1;
00098         CRect r;
00099         GetItemRect(1, r);
00100         InvalidateRect(r, FALSE);
00101     }
00102 }
00103
00104 BEGIN_MESSAGE_MAP(CCvsStatusBar, CStatusBar)
00105     //{{AFX_MSG_MAP(CCvsStatusBar)
00106     ON_WM_TIMER()
00107     //}}AFX_MSG_MAP
00108 END_MESSAGE_MAP()
00109
00110
00111 // CCvsStatusBar message handlers
Generated on Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/CvsStatusBar.h Source File

WinCvs/CvsStatusBar.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>
00019  */
00020
00021 #if !defined(AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_)
00022 #define AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // CvsStatusBar.h : header file
00028 //
00029
00031 // CCvsStatusBar window
00032
00033 class CCvsStatusBar : public CStatusBar
00034 {
00035 // Construction
00036 public:
00037     CCvsStatusBar();
00038
00039 // Attributes
00040 public:
00041
00042 // Operations
00043 public:
00044     virtual void DrawItem(LPDRAWITEMSTRUCT);
00045
00046 // Overrides
00047     // ClassWizard generated virtual function overrides
00048     //{{AFX_VIRTUAL(CCvsStatusBar)
00049     //}}AFX_VIRTUAL
00050
00051 // Implementation
00052 public:
00053     virtual ~CCvsStatusBar();
00054
00055     // Generated message map functions
00056 protected:
00057     CBitmap m_indic;
00058     int m_step;
00059     bool m_settimer;
00060     //{{AFX_MSG(CCvsStatusBar)
00061     afx_msg void OnTimer(UINT nIDEvent);
00062     //}}AFX_MSG
00063
00064     DECLARE_MESSAGE_MAP()
00065 };
00066
00068
00069 //{{AFX_INSERT_LOCATION}}
00070 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00071
00072 #endif // !defined(AFX_CVSSTATUSBAR_H__F549ACF2_ECFE_4933_A05D_5FC8248C3CD4__INCLUDED_)
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/ExploreBar.cpp Source File

WinCvs/ExploreBar.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>
00019  */
00020
00021 // ExploreBar.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "MainFrm.h"
00027 #include "ExploreBar.h"
00028 #include "BrowseFileView.h"
00029 #include "FileTraversal.h"
00030 #include "CvsCommands.h"
00031 #include "CvsPrefs.h"
00032 #include "BrowseViewHandlers.h"
00033
00034 #ifdef _DEBUG
00035 #define new DEBUG_NEW
00036 #undef THIS_FILE
00037 static char THIS_FILE[] = __FILE__;
00038 #endif
00039
00040 IMPLEMENT_DYNAMIC(CMyShellTree, CCJShellTree)
00041
00042 BEGIN_MESSAGE_MAP(CMyShellTree, CCJShellTree)
00043     //{{AFX_MSG_MAP(CMyShellTree)
00044     ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
00045     ON_NOTIFY_REFLECT(TVN_DELETEITEM, OnDeleteitem)
00046     ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
00047     ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
00048     //}}AFX_MSG_MAP
00049 END_MESSAGE_MAP()
00050
00051 bool CMyShellTree::DisableCommon()
00052 {
00053     CWincvsApp *app = (CWincvsApp*)AfxGetApp();
00054     return app->IsCvsRunning() || gCvsPrefs.empty();
00055 }
00056
00057 void CMyShellTree::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
00058 {
00059     if(DisableCommon())
00060     {
00061         *pResult = 1;
00062         return;
00063     }
00064
00065     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00066     CCJShellTree::OnItemexpanding(pNMHDR,pResult);
00067     CCJShellTree::Invalidate();
00068     *pResult = 0;
00069 }
00070
00071 void CMyShellTree::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
00072 {
00073     if(DisableCommon())
00074     {
00075         *pResult = 1;
00076         return;
00077     }
00078
00079     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00080
00081     CString szPath;
00082     CCJShellTree::OnSelchanged(pNMHDR,pResult);
00083
00084     if(CCJShellTree::GetSelectedFolderPath(szPath))
00085     {
00086         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00087         CBrowseFileView *view = app->GetFileView();
00088         if(view != 0L)
00089             view->ResetView(szPath);
00090     }
00091
00092     *pResult = 0;
00093 }
00094
00095 void CMyShellTree::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
00096 {
00097     if(DisableCommon())
00098     {
00099         *pResult = 1;
00100         return;
00101     }
00102
00103     // TODO: Add your control notification handler code here
00104     CCJShellTree::OnRclick(pNMHDR,pResult);
00105     *pResult = 0;
00106 }
00107
00108 void CMyShellTree::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult)
00109 {
00110     if(DisableCommon())
00111     {
00112         *pResult = 1;
00113         return;
00114     }
00115
00116     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00117     // TODO: Add your control notification handler code here
00118     CCJShellTree::OnDeleteitem(pNMHDR,pResult);
00119     *pResult = 0;
00120 }
00121
00123 // CExploreBar
00124
00125 IMPLEMENT_DYNCREATE(CExploreBar, CView)
00126
00127 CExploreBar::CExploreBar()
00128 {
00129 }
00130
00131 CExploreBar::~CExploreBar()
00132 {
00133 }
00134
00135
00136 BEGIN_MESSAGE_MAP(CExploreBar, CView)
00137     //{{AFX_MSG_MAP(CExploreBar)
00138     ON_WM_WINDOWPOSCHANGED()
00139     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00140     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00141     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00142     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00143     //}}AFX_MSG_MAP
00144 END_MESSAGE_MAP()
00145
00146
00147 // CExploreBar drawing
00148
00149 void CExploreBar::OnDraw(CDC* pDC)
00150 {
00151     CDocument* pDoc = GetDocument();
00152 }
00153
00155 // CExploreBar diagnostics
00156
00157 #ifdef _DEBUG
00158 void CExploreBar::AssertValid() const
00159 {
00160     CView::AssertValid();
00161 }
00162
00163 void CExploreBar::Dump(CDumpContext& dc) const
00164 {
00165     CView::Dump(dc);
00166 }
00167 #endif //_DEBUG
00168
00170 // CExploreBar message handlers
00171
00172 BOOL CExploreBar::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00173 {
00174     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00175
00176     if(res)
00177     {
00178         if (!m_TreeCtrl.Create(
00179             WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
00180             CRect(0,0,0,0), this, IDC_BAR_TREE))
00181         {
00182             TRACE0("Unable to create caption button.\n");
00183             return FALSE;
00184         }
00185     }
00186
00187     //m_TreeCtrl.EnableImages();
00188     //m_TreeCtrl.PopulateTree();
00189
00190     //SetChild(&m_TreeCtrl);
00191
00192     return res;
00193 }
00194
00195 void CExploreBar::OnWindowPosChanged(WINDOWPOS FAR* wp)
00196 {
00197     CView::OnWindowPosChanged(wp);
00198
00199     CRect r;
00200     GetClientRect(&r);
00201     m_TreeCtrl.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00202 }
00203
00204 void CExploreBar::OnUpdateCmd(CCmdUI* pCmdUI)
00205 {
00206     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00207     if(DisableCommon())
00208     {
00209         pCmdUI->Enable(FALSE);
00210         return;
00211     }
00212     CString folderPath;
00213     if(!m_TreeCtrl.GetSelectedFolderPath(folderPath) || folderPath.IsEmpty())
00214     {
00215         pCmdUI->Enable(FALSE);
00216         return;
00217     }
00218
00219     pCmdUI->Enable(TRUE);
00220 }
00221
00222 bool CExploreBar::DisableCommon()
00223 {
00224     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00225     return app->IsCvsRunning() || gCvsPrefs.empty();
00226 }
00227
00228 void CExploreBar::OnViewCheckout()
00229 {
00230     CString folderPath;
00231     if( m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty() )
00232     {
00233         KoCheckoutHandler handler;
00234         handler.OnFolder(folderPath);
00235     }
00236 }
00237
00238 void CExploreBar::OnUpdateViewCheckout(CCmdUI* pCmdUI)
00239 {
00240     OnUpdateCmd(pCmdUI);
00241     pCmdUI->SetText("Chec&kout module to selection...");
00242 }
00243
00244 void CExploreBar::OnViewImport()
00245 {
00246     CString folderPath;
00247     if( m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty() )
00248     {
00249         KoImportHandler handler;
00250         handler.OnFolder(folderPath);
00251     }
00252 }
00253
00254 void CExploreBar::OnUpdateViewImport(CCmdUI* pCmdUI)
00255 {
00256     OnUpdateCmd(pCmdUI);
00257     pCmdUI->SetText("&Import module from selection...");
00258 }
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/ExploreBar.h Source File

WinCvs/ExploreBar.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>
00019  */
00020
00021 #if !defined(AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_)
00022 #define AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // ExploreBar.h : header file
00028 //
00029
00030 #include "CJShellTree.h"
00031
00033 // CExploreBar view
00034
00035 class CMyShellTree : public CCJShellTree
00036 {
00037     DECLARE_DYNAMIC(CMyShellTree)
00038
00039 protected:
00040     bool DisableCommon();
00041
00042     //{{AFX_MSG(CMyShellTree)
00043     afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
00044     afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
00045     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
00046     afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
00047     //}}AFX_MSG
00048
00049     DECLARE_MESSAGE_MAP()
00050 };
00051
00052 class CExploreBar : public CView
00053 {
00054 protected:
00055     CExploreBar();           // protected constructor used by dynamic creation
00056     DECLARE_DYNCREATE(CExploreBar)
00057
00058 // Attributes
00059 public:
00060     CMyShellTree  m_TreeCtrl;
00061
00062 // Operations
00063 public:
00064
00065 // Overrides
00066     // ClassWizard generated virtual function overrides
00067     //{{AFX_VIRTUAL(CExploreBar)
00068     public:
00069     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00070     protected:
00071     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00072     //}}AFX_VIRTUAL
00073
00074 // Implementation
00075 protected:
00076     virtual ~CExploreBar();
00077     void OnUpdateCmd(CCmdUI* pCmdUI);
00078     bool DisableCommon();
00079
00080 #ifdef _DEBUG
00081     virtual void AssertValid() const;
00082     virtual void Dump(CDumpContext& dc) const;
00083 #endif
00084
00085     // Generated message map functions
00086 protected:
00087     //{{AFX_MSG(CExploreBar)
00088     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
00089     afx_msg void OnViewCheckout();
00090     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00091     afx_msg void OnViewImport();
00092     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00093     //}}AFX_MSG
00094     DECLARE_MESSAGE_MAP()
00095 };
00096
00098
00099 //{{AFX_INSERT_LOCATION}}
00100 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00101
00102 #endif // !defined(AFX_EXPLOREBAR_H__A132A164_1A90_11D3_B1A1_004095463819__INCLUDED_)
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/findtcl.cpp Source File

WinCvs/findtcl.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>
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #pragma warning(push)
00024 #pragma warning(disable : 4786)
00025 #pragma warning(disable : 4146)
00026
00027 #include <string>
00028 #include <deque>
00029 #include <algorithm>
00030
00031 #pragma warning(pop)
00032
00033 #include <windows.h>
00034
00035 // local protos
00036 static void buildTail (char *, const char *, int);
00037 static void buildWildTail (char *, char *, int);
00038 static bool verRemove (std::string &);
00039 static bool verLess (std::string, std::string);
00040 static bool fileRemove (std::string &);
00041 static bool fileLess (std::string, std::string);
00042
00043 // locally shared variables restricted to this module
00044 static char *minVer;
00045 static int exact;
00046 static int dbgOnly;
00047
00048 char *
00049 findTcl (char *_minVer, int _exact, int _dbgOnly)
00050 {
00051     //char *tclRootPath = NULL;
00052     static char tclLibFullPath[MAX_PATH];
00053     char *savedPos;
00054     char *pos1, *pos2;
00055     char *prefix = "\\bin\\tcl";
00056     WIN32_FIND_DATA hFFData;
00057     HANDLE hFind;
00058     int i = 0;
00059     std::deque<std::string> vers;
00060     std::deque<std::string>::iterator versNewLast;
00061
00062
00063     minVer = _minVer;
00064     exact = _exact;
00065     dbgOnly = _dbgOnly;
00066
00067
00068     // Look in the current path on the assumption if it's there, you want to use
00069     // it instead of any others if it passes the version test.
00070
00071     // Append the beginning
00072     pos1 = tclLibFullPath;
00073     pos2 = ".\\tcl";
00074     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00075     savedPos = pos1;
00076
00077     if (exact != 0)
00078     {
00079         // build the end of the filename from the parameter given
00080         buildTail(savedPos, minVer, dbgOnly);
00081
00082         // See if it *really* exists
00083         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00084
00085         if (hFind != INVALID_HANDLE_VALUE)
00086         {
00087             // gotcha.
00088             ::FindClose(hFind);
00089             return tclLibFullPath;
00090         }
00091         // no success..  fall through for registry search
00092
00093     }
00094     else
00095     {
00096
00097         // Try a range of filenames
00098         buildWildTail(savedPos, minVer, dbgOnly);
00099
00100         // See if we got some
00101         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00102
00103         if (hFind != INVALID_HANDLE_VALUE)
00104         {
00105             BOOL rtn;
00106
00107             do
00108             {
00109                 vers.push_back(std::string(hFFData.cFileName));
00110                 rtn = ::FindNextFile(hFind, &hFFData);
00111             } while (rtn != 0);   // got more?
00112
00113             ::FindClose(hFind);
00114
00115             // sort filename strings
00116             std::sort(vers.begin(), vers.end(), fileLess);
00117
00118             // remove all invalid entries based on flags.
00119             versNewLast = std::remove_if(vers.begin(), vers.end(), fileRemove);
00120
00121             if (vers.begin() != versNewLast) {
00122                 // using copy itself doesn't terminate the string...  how odd..
00123                 tclLibFullPath [(versNewLast - 1)->copy(tclLibFullPath, MAX_PATH)] = '\0';
00124                 return tclLibFullPath;
00125             }
00126         }
00127
00128         // no success..  fall through for registry search
00129     }
00130
00131
00132     // Do a registry search.
00133     HKEY topTclKey = NULL, subTclVer = NULL;
00134     DWORD max_path = MAX_PATH;
00135     LONG result;
00136     char sSubKey[MAX_PATH];
00137     const char *verTarget;
00138
00139     result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00140         "SOFTWARE\\Scriptics\\Tcl",
00141         0,
00142         KEY_ENUMERATE_SUB_KEYS,
00143         &topTclKey);
00144
00145     if (result != ERROR_SUCCESS)
00146     {
00147         // active TCL
00148         //HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TclScript\DefaultIcon
00149         result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00150             "SOFTWARE\\Classes\\TclScript\\DefaultIcon",
00151             0,
00152             KEY_QUERY_VALUE,
00153             &topTclKey);
00154
00155         if (result == ERROR_SUCCESS)
00156         {
00157             result = RegQueryValueEx(topTclKey,
00158                 "",
00159                 NULL,
00160                 NULL,
00161                 reinterpret_cast<PUCHAR>(tclLibFullPath),
00162                 &max_path);
00163
00164             RegCloseKey(topTclKey);
00165
00166             if (result == ERROR_SUCCESS)
00167             {
00168                 CString s(tclLibFullPath);
00169                 s.Replace("tk", "tcl");
00170                 strcpy(tclLibFullPath, s);
00171                 char *tmp = strrchr(tclLibFullPath, ',');
00172                 if(tmp != 0L)
00173                     *tmp = '\0';
00174                 return tclLibFullPath;
00175             }
00176         }
00177
00178         if (result != ERROR_SUCCESS)
00179         {
00180             std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) does not exist.");
00181             err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00182             throw err;
00183         }
00184     }
00185
00186     // Read all SubKey names
00187  enumAgain:
00188     result = RegEnumKey(topTclKey, i, sSubKey, MAX_PATH);
00189     if (result != ERROR_NO_MORE_ITEMS) {
00190         vers.push_back(std::string(sSubKey));
00191         i++; goto enumAgain;
00192     }
00193     else if (i == 0)
00194     {
00195         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) has no SubKeys.");
00196         err.append("  Reinstall Tcl to fix this or hand edit your registry.");
00197         RegCloseKey(topTclKey);
00198         throw err;
00199     }
00200
00201     // sort version strings
00202     std::sort(vers.begin(), vers.end(), verLess);
00203
00204     // remove all invalid entries based on flags.
00205     versNewLast = std::remove_if(vers.begin(), vers.end(), verRemove);
00206
00207     if (vers.begin() != versNewLast)
00208         verTarget = (versNewLast - 1)->c_str();
00209     else
00210     {
00211         std::string err("Unable to locate a proper Tcl core in the registry for version ");
00212         err.append(minVer);
00213         if (exact != 0)
00214             err.append(".");
00215         else
00216             err.append(" or greater.");
00217         RegCloseKey(topTclKey);
00218         throw err;
00219     }
00220
00221     result = RegOpenKeyEx(topTclKey,
00222         verTarget,
00223         0,
00224         KEY_READ,
00225         &subTclVer);
00226
00227     if (result != ERROR_SUCCESS)
00228     {
00229         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl<target>) does not exist.");
00230         err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00231         RegCloseKey(topTclKey);
00232         throw err;
00233     }
00234
00235     result = RegQueryValueEx(subTclVer,
00236         "Root",
00237         NULL,
00238         NULL,
00239         reinterpret_cast<PUCHAR>(tclLibFullPath),
00240         &max_path);
00241
00242     if (result != ERROR_SUCCESS)
00243     {
00244         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00245         err.append(verTarget);
00246         err.append(") did not have a \"Root\" SubKey.");
00247         RegCloseKey(topTclKey);
00248         RegCloseKey(subTclVer);
00249         throw err;
00250     };
00251
00252     pos1 = tclLibFullPath;
00253     while (*pos1 != '\0') { pos1++; }
00254
00255     // Append the bin directory and prefix
00256     pos2 = prefix;
00257     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00258     savedPos = pos1;
00259
00260     // Build the end of the filename
00261     buildTail(savedPos, verTarget, dbgOnly);
00262
00263     // See if it *really* exists
00264     hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00265
00266     if (hFind != INVALID_HANDLE_VALUE) {
00267         // gotcha.
00268         ::FindClose(hFind);
00269         RegCloseKey(topTclKey);
00270         RegCloseKey(subTclVer);
00271         return tclLibFullPath;
00272     }
00273     else
00274     {
00275         ::FindClose(hFind);
00276         std::string err("The registry key (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00277         err.append(minVer);
00278         err.append("\\Root) said a core was located at (");
00279         err.append(tclLibFullPath);
00280         err.append(").  This was found to be false.");
00281         RegCloseKey(topTclKey);
00282         RegCloseKey(subTclVer);
00283         throw err;
00284     }
00285
00286     RegCloseKey(topTclKey);
00287     RegCloseKey(subTclVer);
00288     throw std::string("A proper Tcl core could not be found anywhere.");
00289     return NULL;
00290 }
00291
00292 static void
00293 buildTail(char *pos, const char *ver, int dbgOnly)
00294 {
00295     const char *pos2;
00296     char *shLibExt = ".dll";
00297
00298     /* append version w/o decimal */
00299     pos2 = ver;
00300     while (*pos2 != '\0') {
00301         if (*pos2 != '.') *pos++ = *pos2++;
00302         else pos2++;
00303     };
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
00319 static void
00320 buildWildTail(char *pos, char *ver, int dbgOnly)
00321 {
00322     char *pos2;
00323     char *shLibExt = ".dll";
00324
00325     /* just append the major version */
00326     *pos++ = *ver;
00327     *pos++ = '?';
00328
00329     /* if asked, add the debug suffix */
00330     if (dbgOnly != 0) *pos++ = 'd';
00331
00332     /* append the extension */
00333     pos2 = shLibExt;
00334     while (*pos2 != '\0') {
00335         *pos++ = *pos2++;
00336     };
00337
00338     /* terminate it */
00339     *pos = '\0';
00340 };
00341
00342 static bool verRemove (std::string &s)
00343 {
00344     double fa, fb;
00345     fa = atof(s.c_str());
00346     fb = atof(minVer);
00347
00348     if (exact == 0)
00349     {
00350         // remove when major version is different.
00351         if ((int)fa != (int)fb)
00352             return true;
00353         // remove when less than minor version
00354         return (fa - (int)fa < fb - (int)fb);
00355     }
00356     else
00357         // remove when not identical for an exact match
00358         return (fa != fb);
00359 };
00360
00361 static bool verLess(std::string a, std::string b) {
00362     double fa, fb;
00363     fa = atof(a.c_str());
00364     fb = atof(b.c_str());
00365     return (fa < fb);
00366 };
00367
00368 static bool
00369 fileRemove (std::string &f)
00370 {
00371     // strip off 'tcl' and '.dll'
00372     return verRemove(f.substr(3,1) + "." + f.substr(4,1));
00373 }
00374
00375 static bool
00376 fileLess (std::string a, std::string b)
00377 {
00378   return verLess(
00379       a.substr(3,1) + "." + a.substr(4,1),
00380       b.substr(3,1) + "." + b.substr(4,1)
00381       );
00382 }
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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
00050 static void NormalizeFn(const char* folder, const char* fn, char* dir, char* name)
00051 {
00052     char buffer[_MAX_PATH];
00053     char dirBuffer[_MAX_PATH];
00054     char nameBuffer[_MAX_PATH];
00055     char drive[_MAX_PATH];
00056     char ext[_MAX_EXT];
00057
00058     _makepath(buffer, NULL, folder, fn, NULL);
00059     _splitpath(buffer, drive, dirBuffer, nameBuffer, ext);
00060     _makepath(dir, drive, dirBuffer, NULL, NULL);
00061     _makepath(name, NULL, NULL, nameBuffer, ext);
00062 }
00063
00065 // CGraphDoc
00066
00067 IMPLEMENT_DYNCREATE(CGraphDoc, CDocument)
00068
00069 BEGIN_MESSAGE_MAP(CGraphDoc, CDocument)
00070     //{{AFX_MSG_MAP(CGraphDoc)
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     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00075     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00076 END_MESSAGE_MAP()
00077
00078 BEGIN_DISPATCH_MAP(CGraphDoc, CDocument)
00079     //{{AFX_DISPATCH_MAP(CGraphDoc)
00080     DISP_FUNCTION(CGraphDoc, "NumNodes", NumNodes, VT_I4, VTS_NONE)
00081     //}}AFX_DISPATCH_MAP
00082 END_DISPATCH_MAP()
00083
00084 // Note: we add support for IID_ITest to support typesafe binding
00085 //  from VBA.  This IID must match the GUID that is attached to the
00086 //  dispinterface in the .ODL file.
00087
00088 // {09F456B5-0018-11D2-BCAA-000000000000}
00089 static const IID IID_ITest =
00090 { 0x9f456b5, 0x18, 0x11d2, { 0xbc, 0xaa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } };
00091
00092 BEGIN_INTERFACE_MAP(CGraphDoc, CDocument)
00093     INTERFACE_PART(CGraphDoc, IID_ITest, Dispatch)
00094 END_INTERFACE_MAP()
00095
00096
00097 // CGraphDoc construction/destruction
00098
00099 CGraphDoc::CGraphDoc()
00100 {
00101     EnableAutomation();
00102
00103     AfxOleLockApp();
00104
00105     m_fNode = 0L;
00106     m_fData = 0L;
00107 }
00108
00109 CGraphDoc::~CGraphDoc()
00110 {
00111     AfxOleUnlockApp();
00112
00113     Clear();
00114 }
00115
00119 void CGraphDoc::Clear(void)
00120 {
00121     if( m_fNode != 0L )
00122     {
00123         delete m_fNode;
00124         m_fNode = 0L;
00125     }
00126
00127     if( m_fData != 0L )
00128     {
00129         m_fData->UnRef();
00130         m_fData = 0L;
00131     }
00132
00133     m_fDir.Empty();
00134     m_fName.Empty();
00135 }
00136
00138 BOOL CGraphDoc::OnNewDocument()
00139 {
00140     Clear();
00141
00142     if( !CDocument::OnNewDocument() )
00143         return FALSE;
00144
00145     return TRUE;
00146 }
00147
00153 void CGraphDoc::SetNode(CLogNode* node, const char* folder)
00154 {
00155     Clear();
00156
00157     // Normalize folder/fname
00158     const char* fn = (**(CLogNodeHeader*)node).WorkingFile();
00159     char dir[_MAX_PATH];
00160     char name[_MAX_PATH];
00161     NormalizeFn(folder, fn, dir, name);
00162
00163     m_fNode = node;
00164     m_fDir = dir;
00165
00166     // Get the CVS/Entries infos for this file
00167     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00168     if( !Entries_Open(entries, dir) )
00169     {
00170         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00171     }
00172     else
00173     {
00174         if( node->GetType() != kNodeHeader )
00175         {
00176             cvs_err("Warning : Top node is not a RCS file description !\n");
00177         }
00178         else
00179         {
00180             CStr fullPath;
00181
00182             fullPath << m_fDir;
00183             fullPath << fn;
00184
00185             struct stat sb;
00186             if( stat(fullPath, &sb) == -1 )
00187             {
00188                 cvs_err("Warning : Unknown file '%s'\n", name);
00189             }
00190             else
00191             {
00192                 m_fData = Entries_SetVisited(dir, entries, name, sb, false);
00193                 m_fData->Ref();
00194                 m_fName = name;
00195             }
00196         }
00197     }
00198
00199     // Create the graph and redraw
00200     CGraphView* view = GetTreeView();
00201     if( view != 0L )
00202     {
00203         view->CalcImageSize();
00204         view->Invalidate();
00205         SetTitle(m_fName);
00206     }
00207 }
00208
00209
00211 // CGraphDoc serialization
00212
00213 void CGraphDoc::Serialize(CArchive& ar)
00214 {
00215     if (ar.IsStoring())
00216     {
00217         // TODO: add storing code here
00218     }
00219     else
00220     {
00221         // TODO: add loading code here
00222     }
00223 }
00224
00229 CGraphView* CGraphDoc::GetTreeView(void)
00230 {
00231     CView* view;
00232
00233     POSITION posv = GetFirstViewPosition();
00234     while( posv != NULL )
00235     {
00236         view = GetNextView(posv);
00237         if( view->IsKindOf(RUNTIME_CLASS(CGraphView)) )
00238             return (CGraphView*)view;
00239     }
00240
00241     return NULL;
00242 }
00243
00245 // CGraphDoc diagnostics
00246
00247 #ifdef _DEBUG
00248 void CGraphDoc::AssertValid() const
00249 {
00250     CDocument::AssertValid();
00251 }
00252
00253 void CGraphDoc::Dump(CDumpContext& dc) const
00254 {
00255     CDocument::Dump(dc);
00256 }
00257 #endif //_DEBUG
00258
00260 // CGraphDoc commands
00261
00266 long CGraphDoc::NumNodes()
00267 {
00268     return 0;
00269 }
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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
00038 class CGraphDoc : public CDocument
00039 {
00040 protected: // create from serialization only
00041     // Construction
00042     CGraphDoc();
00043     DECLARE_DYNCREATE(CGraphDoc)
00044 public:
00045     virtual ~CGraphDoc();
00046
00047 // Attributes
00048 public:
00049
00050     // Operations
00051 public:
00052
00053 // Overrides
00054     // ClassWizard generated virtual function overrides
00055     //{{AFX_VIRTUAL(CGraphDoc)
00056     public:
00057     virtual BOOL OnNewDocument();
00058     virtual void Serialize(CArchive& ar);
00059     //}}AFX_VIRTUAL
00060
00061 // Implementation
00062 public:
00063 #ifdef _DEBUG
00064     virtual void AssertValid() const;
00065     virtual void Dump(CDumpContext& dc) const;
00066 #endif
00067
00068 protected:
00069
00070 // Generated message map functions
00071 protected:
00072     //{{AFX_MSG(CGraphDoc)
00073         // NOTE - the ClassWizard will add and remove member functions here.
00074         //    DO NOT EDIT what you see in these blocks of generated code !
00075     //}}AFX_MSG
00076     DECLARE_MESSAGE_MAP()
00077
00078     // Generated OLE dispatch map functions
00079     //{{AFX_DISPATCH(CGraphDoc)
00080     afx_msg long NumNodes();
00081     //}}AFX_DISPATCH
00082     DECLARE_DISPATCH_MAP()
00083     DECLARE_INTERFACE_MAP()
00084 private:
00085     // Data members
00086     CLogNode* m_fNode;
00087     CString m_fDir;
00088     CString m_fName;
00089     EntnodeData* m_fData;
00091     // Methods
00092     void Clear(void);
00093
00094 public:
00095     // Interface
00096     void SetNode(CLogNode* node, const char* dir);
00097
00098     inline CLogNode* GetNode(void);
00099     inline EntnodeData* GetEntryInfo(void);
00100     inline const char* GetDir(void) const;
00101     inline const char* GetName(void) const;
00102
00103     CGraphView* GetTreeView(void);
00104 };
00105
00107 CLogNode* CGraphDoc::GetNode(void)
00108 {
00109     return m_fNode;
00110 }
00111
00113 EntnodeData* CGraphDoc::GetEntryInfo(void)
00114 {
00115     return m_fData;
00116 }
00117
00119 const char* CGraphDoc::GetDir(void) const
00120 {
00121     return m_fDir;
00122 }
00123
00125 const char* CGraphDoc::GetName(void) const
00126 {
00127     return m_fName;
00128 }
00129
00131
00132 //{{AFX_INSERT_LOCATION}}
00133 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00134
00135 #endif // !defined(AFX_GRAPHDOC_H__09F456C1_0018_11D2_BCAA_000000000000__INCLUDED_)
Generated on Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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
00050
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 Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 "WincvsView.h"
00031 #include "CvsPrefs.h"
00032 #include "FileTraversal.h"
00033 #include "ProgressDlg.h"
00034 #include "GraphOptDlg.h"
00035 #include "AdminOptionDlg.h"
00036 #include "CvsAlert.h"
00037 #include "CvsCommands.h"
00038 #include "MultiFiles.h"
00039 #include "BrowseViewHandlers.h"
00040
00041 #ifdef _DEBUG
00042 #define new DEBUG_NEW
00043 #undef THIS_FILE
00044 static char THIS_FILE[] = __FILE__;
00045 #endif
00046
00047 // Persistent settings
00048 CPersistentInt gGraphSelColor("P_GraphSelColor", RGB_DEF_SEL);
00049 CPersistentInt gGraphShadowColor("P_GraphShadowColor", RGB_DEF_SHADOW);
00050 CPersistentInt gGraphHeaderColor("P_GraphHeaderColor", RGB_DEF_HEADER);
00051 CPersistentInt gGraphTagColor("P_GraphTagColor", RGB_DEF_TAG);
00052 CPersistentInt gGraphBranchColor("P_GraphBranchColor", RGB_DEF_BRANCH);
00053 CPersistentInt gGraphNodeColor("P_GraphNodeColor", RGB_DEF_NODE);
00054 CPersistentInt gGraphDeadNodeColor("P_GraphDeadNodeColor", RGB_DEF_DEADNODE);
00055 CPersistentInt gGraphUserStateNodeColor("P_GraphUserStateNodeColor", RGB_DEF_USERSTATENODE);
00056
00058 const int kVChildSpace = 8;
00060 const int kHChildSpace = 40;
00062 const int kInflateNodeSpace = 8;
00063
00069 static void DrawOctangle(CDC& dc, const CRect& selfB)
00070 {
00071     int cutLen = selfB.Height() / 4;
00072     CPoint point1(selfB.left, selfB.top + cutLen);
00073     CPoint point2(selfB.left + cutLen, selfB.top);
00074     CPoint point3(selfB.right - cutLen, selfB.top);
00075     CPoint point4(selfB.right, selfB.top + cutLen);
00076     CPoint point5(selfB.right, selfB.bottom - cutLen);
00077     CPoint point6(selfB.right - cutLen, selfB.bottom);
00078     CPoint point7(selfB.left + cutLen, selfB.bottom);
00079     CPoint point8(selfB.left, selfB.bottom - cutLen);
00080     CPoint arrPoints[OCTANGLE_COUNT] = {
00081         point1,
00082         point2,
00083         point3,
00084         point4,
00085         point5,
00086         point6,
00087         point7,
00088         point8};
00089
00090     dc.Polygon(arrPoints, OCTANGLE_COUNT);
00091 }
00092
00102 static void DrawNode(CDC& dc, const CRect& selfB,
00103                      COLORREF contour,
00104                      kNodeShape shape, bool isSel, int penStyle = PS_SOLID)
00105 {
00106     CPen* pOldPen = 0L;
00107     CBrush* pOldBrush = 0L;
00108     CPen pen, pen2;
00109     CBrush brush;
00110     COLORREF selcolor = gGraphSelColor;
00111     COLORREF shadowc = gGraphShadowColor;
00112
00113     TRY
00114     {
00115         // Prepare the shadow
00116         CRect shadow = selfB;
00117         shadow.OffsetRect(SHADOW_OFFSET_PT);
00118
00119         brush.CreateSolidBrush(shadowc);
00120         pOldBrush = dc.SelectObject(&brush);
00121         pen.CreatePen(penStyle, 1, shadowc);
00122         pOldPen = dc.SelectObject(&pen);
00123
00124         // Draw the shadow
00125         switch( shape )
00126         {
00127         case kRectangle:
00128             dc.Rectangle(shadow);
00129             break;
00130         case kRoundRect:
00131             dc.RoundRect(shadow, ROUND_RECT_PT);
00132             break;
00133         case kOctangle:
00134             DrawOctangle(dc, shadow);
00135             break;
00136         default:
00137             ASSERT(FALSE);  //unknown type
00138             return;
00139         }
00140
00141         // Prepare selection
00142         if( isSel )
00143         {
00144             brush.DeleteObject();
00145             brush.CreateSolidBrush(selcolor);
00146             dc.SelectObject(&brush);
00147         }
00148         else
00149         {
00150             dc.SelectObject(pOldBrush);
00151             pOldBrush = 0L;
00152         }
00153
00154         pen2.CreatePen(penStyle, 1, contour);
00155         dc.SelectObject(&pen2);
00156
00157         // Draw the main shape
00158         switch( shape )
00159         {
00160         case kRectangle:
00161             dc.Rectangle(selfB);
00162             break;
00163         case kRoundRect:
00164             dc.RoundRect(selfB, ROUND_RECT_PT);
00165             break;
00166         case kOctangle:
00167             DrawOctangle(dc, selfB);
00168             break;
00169         default:
00170             ASSERT(FALSE);  //unknown type
00171             return;
00172         }
00173
00174         // Cleanup
00175         if( pOldPen != 0L )
00176         {
00177             dc.SelectObject(pOldPen);
00178             pOldPen = 0L;
00179         }
00180
00181         if( pOldBrush != 0L )
00182         {
00183             dc.SelectObject(pOldBrush);
00184             pOldBrush = 0L;
00185         }
00186
00187         pen.DeleteObject();
00188         pen2.DeleteObject();
00189         brush.DeleteObject();
00190     }
00191     CATCH_ALL(e)
00192     {
00193         if( pOldPen != 0L )
00194             dc.SelectObject(pOldPen);
00195
00196         if( pOldBrush != 0L )
00197             dc.SelectObject(pOldBrush);
00198     }
00199     END_CATCH_ALL
00200 }
00201
00203 // CWinLogData
00204
00205 CWinLogData::CWinLogData(CLogNode* node) : CLogNodeData(node)
00206 {
00207     selfB.SetRectEmpty();
00208     totB.SetRectEmpty();
00209     sel = false;
00210 }
00211
00212 CWinLogData::~CWinLogData()
00213 {
00214 }
00215
00221 CWinLogData* CWinLogData::GetData(CLogNode* node)
00222 {
00223     return (CWinLogData*)node->GetUserData();
00224 }
00225
00230 kLogNode CWinLogData::GetType(void) const
00231 {
00232     return fNode->GetType();
00233 }
00234
00239 const char* CWinLogData::GetStr(void)
00240 {
00241     switch(GetType())
00242     {
00243     case kNodeHeader:
00244         {
00245             CLogNodeHeader& header = *(CLogNodeHeader*)fNode;
00246             return (*header).WorkingFile();
00247             break;
00248         }
00249     case kNodeBranch:
00250         {
00251             CLogNodeBranch& branch = *(CLogNodeBranch*)fNode;
00252             return *branch;
00253             break;
00254         }
00255     case kNodeRev:
00256         {
00257             CLogNodeRev& rev = *(CLogNodeRev*)fNode;
00258             return (*rev).RevNum().c_str();
00259             break;
00260         }
00261     case kNodeTag:
00262         {
00263             CLogNodeTag& tag = *(CLogNodeTag*)fNode;
00264             return *tag;
00265             break;
00266         }
00267     }
00268
00269     return 0L;
00270 }
00271
00276 CRect& CWinLogData::Bounds(void)
00277 {
00278     return totB;
00279 }
00280
00285 CRect& CWinLogData::SelfBounds(void)
00286 {
00287     return selfB;
00288 }
00289
00295 CWinLogData* CWinLogData::CreateNewData(CLogNode* node)
00296 {
00297     if( node->GetUserData() != 0L )
00298         return (CWinLogData*)node->GetUserData();
00299
00300     CWinLogData* res = 0L;
00301     switch(node->GetType())
00302     {
00303     case kNodeHeader :
00304         res = new CWinLogHeaderData(node);
00305         break;
00306     case kNodeBranch :
00307         res = new CWinLogBranchData(node);
00308         break;
00309     case kNodeRev :
00310         res = new CWinLogRevData(node);
00311         break;
00312     case kNodeTag :
00313         res = new CWinLogTagData(node);
00314         break;
00315     }
00316
00317     node->SetUserData(res);
00318     return res;
00319 }
00320
00325 bool CWinLogData::IsDiskNode(EntnodeData* entryInfo)
00326 {
00327     if( entryInfo == 0L || GetType() != kNodeRev )
00328         return false;
00329
00330     const char* vn = (*entryInfo)[EntnodeFile::kVN];
00331     if( vn == 0L )
00332         return false;
00333
00334     return strcmp(vn, (**(CLogNodeRev*)fNode).RevNum().c_str()) == 0;
00335 }
00336
00341 bool CWinLogData::IsDeadNode()
00342 {
00343     if( GetType() != kNodeRev )
00344         return false;
00345
00346     return strcmp("dead", (**(CLogNodeRev*)fNode).State()) == 0;
00347 }
00348
00353 bool CWinLogData::IsUserState()
00354 {
00355     if( GetType() != kNodeRev )
00356         return false;
00357
00358     return !(strcmp("dead", (**(CLogNodeRev*)fNode).State()) == 0 ||
00359         strcmp("Exp", (**(CLogNodeRev*)fNode).State()) == 0);
00360 }
00361
00366 void CWinLogData::Offset(CPoint offset)
00367 {
00368     selfB.OffsetRect(offset);
00369     totB.OffsetRect(offset);
00370
00371     vector<CLogNode*>::iterator i;
00372     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00373     {
00374         CLogNode* subNode = *i;
00375         GetData(subNode)->Offset(offset);
00376     }
00377
00378     if( fNode->Next() != 0L )
00379     {
00380         GetData(fNode->Next())->Offset(offset);
00381     }
00382 }
00383
00388 bool CWinLogData::Selected(void) const
00389 {
00390     return sel;
00391 }
00392
00398 void CWinLogData::SetSelected(CScrollView* view, bool state)
00399 {
00400     sel = state;
00401
00402     CRect invalR = selfB;
00403     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00404     view->InvalidateRect(invalR);
00405 }
00406
00411 void CWinLogData::UnselectAll(CScrollView* view)
00412 {
00413     if( sel )
00414     {
00415         SetSelected(view, false);
00416     }
00417
00418     vector<CLogNode*>::iterator i;
00419     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00420     {
00421         CLogNode* subNode = *i;
00422         GetData(subNode)->UnselectAll(view);
00423     }
00424
00425     if( fNode->Next() != 0L )
00426         GetData(fNode->Next())->UnselectAll(view);
00427 }
00428
00434 CWinLogData* CWinLogData::HitTest(CPoint point)
00435 {
00436     if( !totB.PtInRect(point) )
00437         return 0L;
00438
00439     if( selfB.PtInRect(point) )
00440         return this;
00441
00442     CWinLogData* result;
00443     vector<CLogNode*>::iterator i;
00444     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00445     {
00446         CLogNode* subNode = *i;
00447         result = GetData(subNode)->HitTest(point);
00448         if( result != 0L )
00449             return result;
00450     }
00451
00452     if( fNode->Next() != 0L )
00453     {
00454         result = GetData(fNode->Next())->HitTest(point);
00455         if( result != 0L )
00456             return result;
00457     }
00458
00459     return 0L;
00460 }
00461
00467 void CWinLogData::Update(CDC& dc, EntnodeData* entryInfo)
00468 {
00469     CLogNode* subNode;
00470     CLogNode* nextNode = fNode->Next();
00471     CPen* pOldPen = 0L;
00472     CBrush* pOldBrush = 0L;
00473     CPen pen, pen2;
00474     CBrush brush;
00475
00476     UpdateSelf(dc, entryInfo);
00477
00478     TRY
00479     {
00480         pen.CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
00481         pen2.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
00482         pOldPen = dc.SelectObject(&pen);
00483
00484         int topY = selfB.TopLeft().y + 2;
00485         int botY = selfB.BottomRight().y - 2;
00486         int lefX = selfB.BottomRight().x + 4;
00487
00488         int count = 1;
00489         int tot = fNode->Childs().size() + 1;
00490
00491         // Draw the children
00492         vector<CLogNode*>::iterator i;
00493         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00494         {
00495             subNode = *i;
00496
00497             // Draw the link
00498             CRect& cb = GetData(subNode)->SelfBounds();
00499
00500             if( subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch )
00501                 dc.SelectObject(&pen);
00502             else
00503                 dc.SelectObject(&pen2);
00504
00505             float y = (float)topY + (float)(botY - topY) * (float)count / (float)tot;
00506             int rigX = cb.TopLeft().x - 4;
00507             float x = (float)rigX - (float)(rigX - lefX) * (float)count / (float)tot;
00508
00509             // Special drawing for the header node
00510             if( count == 1 && fNode->GetType() == kNodeHeader )
00511             {
00512                 dc.MoveTo(selfB.TopLeft().x + kHChildSpace/2, selfB.BottomRight().y);
00513                 dc.LineTo(selfB.TopLeft().x + kHChildSpace/2, cb.CenterPoint().y);
00514                 dc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00515             }
00516             else
00517             {
00518                 //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00519                 dc.MoveTo(selfB.BottomRight().x, (int)y);
00520                 dc.LineTo((int)x, (int)y);
00521                 dc.LineTo((int)x, cb.CenterPoint().y);
00522                 dc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00523             }
00524
00525             // Draw the sub-node
00526             GetData(subNode)->Update(dc, entryInfo);
00527         }
00528
00529         // Draw the next node
00530         if( nextNode != 0L )
00531         {
00532             // Draw the link
00533             CRect& nb = GetData(nextNode)->SelfBounds();
00534             if( nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch )
00535                 dc.SelectObject(&pen);
00536             else
00537                 dc.SelectObject(&pen2);
00538             int centerX = selfB.Width() < nb.Width() ?
00539                 selfB.CenterPoint().x : nb.CenterPoint().x;
00540
00541             dc.MoveTo(centerX, selfB.BottomRight().y);
00542             dc.LineTo(centerX, nb.TopLeft().y);
00543
00544             // Draw the next node
00545             GetData(nextNode)->Update(dc, entryInfo);
00546         }
00547
00548         if( pOldPen != 0L )
00549         {
00550             dc.SelectObject(pOldPen);
00551             pOldPen = 0L;
00552         }
00553
00554         if( pOldBrush != 0L )
00555         {
00556             dc.SelectObject(pOldBrush);
00557             pOldBrush = 0L;
00558         }
00559
00560         pen.DeleteObject();
00561         pen2.DeleteObject();
00562     }
00563     CATCH_ALL(e)
00564     {
00565         if( pOldPen != 0L )
00566             dc.SelectObject(pOldPen);
00567
00568         if( pOldBrush != 0L )
00569             dc.SelectObject(pOldBrush);
00570     }
00571     END_CATCH_ALL
00572 }
00573
00580 void CWinLogData::ComputeBounds(const CPoint& topLeft, CDC& dc, EntnodeData* entryInfo)
00581 {
00582     CLogNode* subNode;
00583     CLogNode* nextNode = fNode->Next();
00584
00585     // First compute childrens bounds
00586     vector<CLogNode*>::iterator i;
00587     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00588     {
00589         subNode = *i;
00590         CWinLogData::CreateNewData(subNode);
00591         GetData(subNode)->ComputeBounds(topLeft, dc, entryInfo);
00592     }
00593
00594     if( nextNode != 0L )
00595         CWinLogData::CreateNewData(nextNode);
00596
00597     // Compute self place
00598     selfB.SetRectEmpty();
00599     CSize size = GetBoundsSelf(dc, entryInfo);
00600     size.cx += kInflateNodeSpace;
00601     size.cy += kInflateNodeSpace;
00602     selfB.SetRect(0, 0, size.cx, size.cy);
00603
00604     // Offset to the place assigned to this node
00605     selfB.OffsetRect(topLeft - selfB.TopLeft());
00606
00607     // Calculate the total height of the childrens
00608     int vSize = 0;
00609     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00610     {
00611         subNode = *i;
00612         CRect& b = GetData(subNode)->Bounds();
00613         vSize += b.Height();
00614     }
00615
00616     if( !fNode->Childs().empty() )
00617         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00618
00619     // Offset the children relative to self
00620     CPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00621         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00622
00623     // Place the first child at the bottom of the header node so it won't take so much space for long filenames
00624     if( fNode->GetType() == kNodeHeader )
00625     {
00626         startChilds = CPoint(topLeft.x + kHChildSpace, topLeft.y + selfB.Height() + kVChildSpace);
00627     }
00628
00629     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00630     {
00631         subNode = *i;
00632         CRect curPos = GetData(subNode)->Bounds();
00633         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00634         startChilds.y += curPos.Height() + kVChildSpace;
00635     }
00636
00637     // Calculate the total bounds of the childrens
00638     CRect bc;
00639     bc.SetRectEmpty();
00640     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00641     {
00642         subNode = *i;
00643         CRect& b = GetData(subNode)->Bounds();
00644         bc.UnionRect(bc, b);
00645     }
00646
00647     // Now we got the complete size
00648     totB.UnionRect(selfB, bc);
00649
00650     if( nextNode != 0L )
00651     {
00652         CPoint nextTopLeft;
00653         nextTopLeft.x = totB.TopLeft().x;
00654         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00655         GetData(nextNode)->ComputeBounds(nextTopLeft, dc, entryInfo);
00656
00657         totB.UnionRect(totB, GetData(nextNode)->Bounds());
00658     }
00659 }
00660
00662 // CWinLogHeaderData
00663
00664 CSize CWinLogHeaderData::GetBoundsSelf(CDC& dc, EntnodeData* entryInfo)
00665 {
00666     CLogNodeHeader& header = *(CLogNodeHeader*)fNode;
00667     return dc.GetTextExtent((*header).WorkingFile(),
00668         (*header).WorkingFile().length());
00669 }
00670
00671 void CWinLogHeaderData::UpdateSelf(CDC& dc, EntnodeData* entryInfo)
00672 {
00673     // Draw the node
00674     ::DrawNode(dc, SelfBounds(), gGraphHeaderColor, kRoundRect, Selected());
00675
00676     // Draw the content of the node
00677     TEXTMETRIC tm;
00678     dc.GetTextMetrics(&tm);
00679
00680     CPoint center = SelfBounds().CenterPoint();
00681     int nCenterX = center.x;
00682     int nCenterY = center.y - tm.tmHeight/2;
00683
00684     CLogNodeHeader& header = *(CLogNodeHeader*)fNode;
00685     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(),
00686         (*header).WorkingFile(), (*header).WorkingFile().length(), NULL);
00687 }
00688
00690 // CWinLogRevData
00691
00692 CSize CWinLogRevData::GetBoundsSelf(CDC& dc, EntnodeData* entryInfo)
00693 {
00694     CLogNodeRev& rev = *(CLogNodeRev*)fNode;
00695     CSize size = dc.GetTextExtent((*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00696
00697     if( IsDiskNode(entryInfo) )
00698     {
00699         size.cx += 2 + 16 + 2;
00700         size.cy = max(16, size.cy);
00701     }
00702
00703     return size;
00704 }
00705
00706 void CWinLogRevData::UpdateSelf(CDC& dc, EntnodeData* entryInfo)
00707 {
00708     CRect txtRect = SelfBounds();
00709
00710     if( IsDiskNode(entryInfo) )
00711     {
00712         txtRect.left += 2 + 16 + 2;
00713     }
00714
00715     // Draw the node
00716     COLORREF contour = gGraphNodeColor;
00717     int penStyle = PS_SOLID;
00718
00719     if( IsDeadNode() )
00720     {
00721         contour = (COLORREF)gGraphDeadNodeColor;
00722         penStyle = STYLE_DEADNODE;
00723     }
00724     else if( IsUserState() )
00725     {
00726         contour = (COLORREF)gGraphUserStateNodeColor;
00727         penStyle = STYLE_USERSTATENODE;
00728     }
00729
00730     ::DrawNode(dc, SelfBounds(), contour, kRectangle, Selected(), penStyle);
00731
00732     // Draw the state icon if it is the rev. of the disk
00733     if( IsDiskNode(entryInfo) )
00734     {
00735         CImageList& list = CGraphView::GetImgList();
00736         CPoint w(SelfBounds().TopLeft());
00737         w.x += 2;
00738         w.y += (SelfBounds().Height() - 16) / 2;
00739
00740         list.Draw(&dc, CBrowseFileView::GetImageForEntry(entryInfo), w, ILD_TRANSPARENT);
00741     }
00742
00743     // Draw the content of the node
00744     TEXTMETRIC tm;
00745     dc.GetTextMetrics(&tm);
00746     CPoint center = txtRect.CenterPoint();
00747     int nCenterX = center.x;
00748     int nCenterY = center.y - tm.tmHeight/2;
00749     CLogNodeRev& rev = *(CLogNodeRev*)fNode;
00750     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, txtRect,
00751         (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()), NULL);
00752 }
00753
00755 // CWinLogTagData
00756
00757 CSize CWinLogTagData::GetBoundsSelf(CDC& dc, EntnodeData* entryInfo)
00758 {
00759     CLogNodeTag& tag = *(CLogNodeTag*)fNode;
00760     return dc.GetTextExtent(*tag, (*tag).length());
00761 }
00762
00763 void CWinLogTagData::UpdateSelf(CDC& dc, EntnodeData* entryInfo)
00764 {
00765     // Draw the node
00766     ::DrawNode(dc, SelfBounds(), gGraphTagColor, kRoundRect, Selected());
00767
00768     // Draw the content of the node
00769     TEXTMETRIC tm;
00770     dc.GetTextMetrics(&tm);
00771     CPoint center = SelfBounds().CenterPoint();
00772     int nCenterX = center.x;
00773     int nCenterY = center.y - tm.tmHeight/2;
00774
00775     CLogNodeTag& tag = *(CLogNodeTag*)fNode;
00776     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(), *tag, (*tag).length(), NULL);
00777 }
00778
00780 // CWinLogBranchData
00781
00782 CSize CWinLogBranchData::GetBoundsSelf(CDC& dc, EntnodeData* entryInfo)
00783 {
00784     CLogNodeBranch& branch = *(CLogNodeBranch*)fNode;
00785     return dc.GetTextExtent(*branch, (*branch).length());
00786 }
00787
00788 void CWinLogBranchData::UpdateSelf(CDC& dc, EntnodeData* entryInfo)
00789 {
00790     // Draw the node
00791     ::DrawNode(dc, SelfBounds(), gGraphBranchColor, kOctangle, Selected());
00792
00793     // Draw the content of the node
00794     TEXTMETRIC tm;
00795     dc.GetTextMetrics(&tm);
00796     CPoint center = SelfBounds().CenterPoint();
00797     int nCenterX = center.x;
00798     int nCenterY = center.y - tm.tmHeight/2;
00799     CLogNodeBranch& branch = *(CLogNodeBranch*)fNode;
00800     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(), *branch, (*branch).length(), NULL);
00801 }
00802
00805
00807 void CGraphRectTracker::OnChangedRect(const CRect& rectOld)
00808 {
00809 #if 0 // :-< doesn't work...
00810     CRect r;
00811     m_view->GetClientRect(&r);
00812     CPoint rb = m_rect.BottomRight();
00813
00814     if( !r.PtInRect(rb) )
00815     {
00816         CPoint orig = m_view->GetDeviceScrollPosition();
00817         CPoint offset;
00818         if( rb.x >= r.right )
00819             offset.x += 10;
00820
00821         if( rb.y >= r.bottom )
00822             offset.y += 10;
00823
00824         orig += offset;
00825         m_rect -= offset;
00826         m_view->ScrollToPosition(orig);
00827     }
00828 #endif
00829 }
00830
00832 // TGraph
00833
00839 kTGraph TGraph::TraverseGraph(CLogNode* node)
00840 {
00841     kTGraph res = TraverseNode(node);
00842     if( res == kTStop )
00843         return kTStop;
00844
00845     if( res == kTGetDown )
00846     {
00847         vector<CLogNode*>::iterator i;
00848         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00849         {
00850             res = TraverseGraph(*i);
00851             if( res == kTStop )
00852                 return kTStop;
00853         }
00854     }
00855
00856     if( node->Next() != 0L )
00857     {
00858         res = TraverseGraph(node->Next());
00859         if( res == kTStop )
00860             return kTStop;
00861     }
00862
00863     return kTContinue;
00864 };
00865
00867 // TGraphRectSelect
00868
00869 TGraphRectSelect::TGraphRectSelect(bool shiftOn, CGraphView* view, CRect& rect)
00870     : m_shiftOn(shiftOn), m_view(view), m_rect(rect)
00871 {
00872 }
00873
00874 kTGraph TGraphRectSelect::TraverseNode(CLogNode* node)
00875 {
00876     CWinLogData* data = (CWinLogData*)node->GetUserData();
00877
00878     // No need to go further
00879     CRect inter;
00880     if( !inter.IntersectRect(m_rect, data->Bounds()) )
00881     {
00882         return kTContinue;
00883     }
00884
00885     // Self enclosed in the tracker ?
00886     CRect& boundsRect = data->SelfBounds();
00887     if( m_rect.PtInRect(boundsRect.TopLeft()) && m_rect.PtInRect(boundsRect.BottomRight()) )
00888     {
00889         if( !m_shiftOn )
00890         {
00891             if( !data->Selected() )
00892                 data->SetSelected(m_view, true);
00893         }
00894         else
00895             data->SetSelected(m_view, !data->Selected());
00896     }
00897
00898     // Traverse childrens
00899     return kTGetDown;
00900 }
00901
00903 // TGraphCmdStatus
00904
00905 TGraphCmdStatus::TGraphCmdStatus()
00906     : m_fSel1(0L), m_fSel2(0L), m_selCount(0)
00907 {
00908 }
00909
00910 kTGraph TGraphCmdStatus::TraverseNode(CLogNode* node)
00911 {
00912     CWinLogData* data = (CWinLogData*)node->GetUserData();
00913
00914     if( data->Selected() )
00915     {
00916         if( m_fSel1 == 0L )
00917             m_fSel1 = data;
00918         else if( m_fSel2 == 0L )
00919             m_fSel2 = data;
00920
00921         m_selCount++;
00922     }
00923
00924     return kTGetDown;
00925 }
00926
00931 int TGraphCmdStatus::GetSelCount() const
00932 {
00933     return m_selCount;
00934 }
00935
00940 CWinLogData* TGraphCmdStatus::GetSel1() const
00941 {
00942     return m_fSel1;
00943 }
00944
00949 CWinLogData* TGraphCmdStatus::GetSel2() const
00950 {
00951     return m_fSel2;
00952 }
00953
00955 // CGraphConsole
00956
00957 CGraphConsole::CGraphConsole()
00958 {
00959     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00960     m_view = app->GetConsoleView();
00961 }
00962
00963 long CGraphConsole::cvs_out(char* txt, long len)
00964 {
00965     if( m_view != 0L )
00966         m_view->OutConsole(txt, len);
00967
00968     return len;
00969 }
00970
00971 long CGraphConsole::cvs_err(char* txt, long len)
00972 {
00973     if( m_view != 0L )
00974         m_view->OutConsole(txt, len, true);
00975
00976     return len;
00977 }
00978
00980 // TGraphDelCmd
00981
00982 TGraphDelCmd::TGraphDelCmd()
00983     : m_countSel(0), m_onlyRev(true)
00984 {
00985 }
00986
00987 kTGraph TGraphDelCmd::TraverseNode(CLogNode* node)
00988 {
00989     CWinLogData* data = (CWinLogData*)node->GetUserData();
00990
00991     if( data->Selected() )
00992     {
00993         if( data->GetType() != kNodeRev )
00994             m_onlyRev = false;
00995         else
00996             m_allRevs.push_back(CStr(data->GetStr()));
00997
00998         m_countSel++;
00999     }
01000
01001     return kTGetDown;
01002 }
01003
01008 int TGraphDelCmd::GetCountSel() const
01009 {
01010     return m_countSel;
01011 }
01012
01017 bool TGraphDelCmd::GetOnlyRev() const
01018 {
01019     return m_onlyRev;
01020 }
01021
01026 std::vector<CStr>& TGraphDelCmd::GetAllRevs()
01027 {
01028     return m_allRevs;
01029 }
01030
01032 // TGraphSelNonSig
01033
01034 TGraphSelNonSig::TGraphSelNonSig(CGraphView* view)
01035     : m_view(view)
01036 {
01037 }
01038
01039 kTGraph TGraphSelNonSig::TraverseNode(CLogNode* node)
01040 {
01041     CWinLogData* data = (CWinLogData*)node->GetUserData();
01042
01043     if( data->GetType() == kNodeRev )
01044     {
01045         if( node->Next() != 0L && node->Childs().size() == 0 )
01046             data->SetSelected(m_view, true);
01047     }
01048
01049     return kTGetDown;
01050 }
01051
01053 // CRevisionConsole
01054
01055 CRevisionConsole::CRevisionConsole()
01056     : m_fOut(NULL)
01057 {
01058 }
01059
01060 CRevisionConsole::~CRevisionConsole()
01061 {
01062     if(m_fOut)
01063     {
01064         fclose(m_fOut);
01065     }
01066 }
01067
01074 bool CRevisionConsole::init(LPCTSTR path, LPCTSTR fname)
01075 {
01076     TCHAR buf[_MAX_PATH];
01077     _tmakepath(buf, NULL, path, fname, NULL);
01078     m_fOut = fopen(buf, "w+");
01079
01080     return m_fOut != NULL;
01081 }
01082
01083 long CRevisionConsole::cvs_out(char *txt, long len)
01084 {
01085     fwrite(txt, sizeof(char), len, m_fOut);
01086     return len;
01087 }
01088
01089 long CRevisionConsole::cvs_err(char *txt, long len)
01090 {
01091     cvs_errstr(txt, len);
01092     return len;
01093 }
01094
01096 // CGraphView
01097
01098 CImageList CGraphView::m_imageList;
01099
01100 IMPLEMENT_DYNCREATE(CGraphView, CScrollView)
01101
01102 CGraphView::CGraphView()
01103 {
01104     if( m_imageList.m_hImageList == 0L )
01105         m_imageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
01106 }
01107
01108 CGraphView::~CGraphView()
01109 {
01110 }
01111
01112
01113 BEGIN_MESSAGE_MAP(CGraphView, CScrollView)
01114     //{{AFX_MSG_MAP(CGraphView)
01115     ON_WM_LBUTTONDOWN()
01116     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
01117     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
01118     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
01119     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewDiff)
01120     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
01121     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
01122     ON_COMMAND(ID_VIEW_TAG, OnViewTag)
01123     ON_UPDATE_COMMAND_UI(ID_VIEW_TAG, OnUpdateViewTag)
01124     ON_COMMAND(ID_VIEW_DELREV, OnViewDelrev)
01125     ON_UPDATE_COMMAND_UI(ID_VIEW_DELREV, OnUpdateViewDelrev)
01126     ON_COMMAND(ID_VIEW_SELNONSIG, OnViewSelnonsig)
01127     ON_UPDATE_COMMAND_UI(ID_VIEW_SELNONSIG, OnUpdateViewSelnonsig)
01128     ON_COMMAND(ID_VIEW_RETRIEVE, OnViewRetrieve)
01129     ON_UPDATE_COMMAND_UI(ID_VIEW_RETRIEVE, OnUpdateViewRetrieve)
01130     ON_UPDATE_COMMAND_UI(ID_VIEW_RECURSIVE, DisableUpdate)
01131     ON_WM_CONTEXTMENU()
01132     ON_COMMAND(ID_QUERY_ANNOTATE, OnQueryAnnotate)
01133     ON_UPDATE_COMMAND_UI(ID_QUERY_ANNOTATE, OnUpdateQueryAnnotate)
01134     ON_COMMAND(ID_GRAPH_GRAPHOPTIONS, OnGraphGraphoptions)
01135     ON_UPDATE_COMMAND_UI(ID_GRAPH_CHANGELOGMESSAGE, OnUpdateGraphChangelogmessage)
01136     ON_COMMAND(ID_GRAPH_CHANGELOGMESSAGE, OnGraphChangelogmessage)
01137     ON_UPDATE_COMMAND_UI(ID_GRAPH_SETDESCRIPTION, OnUpdateGraphSetdescription)
01138     ON_COMMAND(ID_GRAPH_SETDESCRIPTION, OnGraphSetdescription)
01139     ON_COMMAND(ID_GRAPH_SETSTATE, OnGraphSetstate)
01140     ON_UPDATE_COMMAND_UI(ID_GRAPH_SETSTATE, OnUpdateGraphSetstate)
01141     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlockf)
01142     ON_UPDATE_COMMAND_UI(ID_VIEW_MISSING, DisableUpdate)
01143     ON_UPDATE_COMMAND_UI(ID_VIEW_MODIFIED, DisableUpdate)
01144     ON_UPDATE_COMMAND_UI(ID_VIEW_CONFLICT, DisableUpdate)
01145     ON_UPDATE_COMMAND_UI(ID_VIEW_UNKNOWN, DisableUpdate)
01146     ON_UPDATE_COMMAND_UI(ID_VIEW_HIDEUNKNOWN, DisableUpdate)
01147     ON_UPDATE_COMMAND_UI(ID_VIEW_IGNORE, DisableUpdate)
01148     ON_UPDATE_COMMAND_UI(ID_VIEW_ADDED, DisableUpdate)
01149     ON_UPDATE_COMMAND_UI(ID_VIEW_REMOVED, DisableUpdate)
01150     ON_UPDATE_COMMAND_UI(ID_VIEW_CHANGED, DisableUpdate)
01151     ON_UPDATE_COMMAND_UI(ID_FILTERMASK, DisableUpdate)
01152     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUnlockf)
01153     //}}AFX_MSG_MAP
01154     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
01155     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
01156     ON_WM_INITMENUPOPUP()
01157 END_MESSAGE_MAP()
01158
01159
01160 // CGraphView drawing
01161
01162
01163 void CGraphView::CalcImageSize(void)
01164 {
01165     const CPoint startPoint(STARTPOINT_PT);
01166     CWindowDC dc(this);
01167     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01168
01169     CLogNode* root = pDoc->GetNode();
01170     if( root == 0L )
01171         return;
01172
01173     // Set all the bounds locations
01174     CWinLogData* data = CWinLogData::CreateNewData(root);
01175     root->SetUserData(data);
01176     data->ComputeBounds(startPoint, dc, pDoc->GetEntryInfo());
01177
01178     // Re-offset from (0, 0)
01179     CRect bounds = data->Bounds();
01180     data->Offset(startPoint - bounds.TopLeft());
01181     bounds = data->Bounds();
01182
01183     // Set the scroll size, we add the margin of the start point offset on each side
01184     SetScrollSizes(MM_TEXT, bounds.Size() + CSize(startPoint)+CSize(startPoint)+CSize(SHADOW_OFFSET_PT));
01185 }
01186
01188 void CGraphView::OnInitialUpdate()
01189 {
01190     CScrollView::OnInitialUpdate();
01191
01192     SetScrollSizes(MM_TEXT, CSize(200, 100));
01193     //CalcImageSize();
01194 }
01195
01197 void CGraphView::OnDraw(CDC* pDC)
01198 {
01199     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01200     CLogNode* root = pDoc->GetNode();
01201     if( root == 0L || root->GetUserData() == 0L )
01202         return;
01203
01204     CWinLogData* data = (CWinLogData*)root->GetUserData();
01205
01206     pDC->SetTextAlign(TA_CENTER);
01207     pDC->SetBkMode(TRANSPARENT);
01208     data->Update(*pDC, pDoc->GetEntryInfo());
01209 }
01210
01212 // CGraphView diagnostics
01213
01214 #ifdef _DEBUG
01215 void CGraphView::AssertValid() const
01216 {
01217     CScrollView::AssertValid();
01218 }
01219
01220 void CGraphView::Dump(CDumpContext& dc) const
01221 {
01222     CScrollView::Dump(dc);
01223 }
01224 #endif //_DEBUG
01225
01227 // CGraphView message handlers
01228
01230 void CGraphView::OnLButtonDown(UINT nFlags, CPoint point)
01231 {
01232     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01233     CLogNode* root = pDoc->GetNode();
01234     if( root == 0L || root->GetUserData() == 0L )
01235         return;
01236
01237     CWinLogData* data = (CWinLogData*)root->GetUserData();
01238
01239     if( nFlags & MK_LBUTTON )
01240     {
01241         if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01242             data->UnselectAll(this);
01243
01244         point += GetDeviceScrollPosition();
01245
01246         CWinLogData* hit = data->HitTest(point);
01247         if( hit != 0L )
01248         {
01249             if( (nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0 )
01250             {
01251                 if( !hit->Selected() )
01252                 {
01253                     hit->SetSelected(this, true);
01254                     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01255                     CWincvsView* view = app->GetConsoleView();
01256
01257                     if( view != 0L )
01258                     {
01259                         CColorConsole out(view);
01260                         CvsLogOutput(out, hit->Node());
01261                     }
01262                 }
01263             }
01264             else
01265             {
01266                 hit->SetSelected(this, !hit->Selected());
01267             }
01268         }
01269         else
01270         {
01271             CGraphRectTracker track(this);
01272             point -= GetDeviceScrollPosition();
01273             if( track.TrackRubberBand(this, point, true) )
01274             {
01275                 // Traverse and mark
01276                 track.m_rect.OffsetRect(GetDeviceScrollPosition());
01277                 track.m_rect.NormalizeRect();
01278
01279                 TGraphRectSelect traversal((nFlags & MK_CONTROL) != 0, this, track.m_rect);
01280                 traversal.TraverseGraph(root);
01281             }
01282         }
01283     }
01284     else if( nFlags & MK_RBUTTON )
01285     {
01286     }
01287
01288     CScrollView::OnLButtonDown(nFlags, point);
01289 }
01290
01292 void CGraphView::OnViewReload()
01293 {
01294     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01295     CLogNode* root = pDoc->GetNode();
01296     if( root == 0L || root->GetUserData() == 0L )
01297         return;
01298
01299     CvsArgs args;
01300     args.add("log");
01301     args.add(pDoc->GetName());
01302     args.print(pDoc->GetDir());
01303     CStr dir(pDoc->GetDir());
01304     CvsLogParse(dir, args, true, pDoc);
01305 }
01306
01308 void CGraphView::OnUpdateViewReload(CCmdUI* pCmdUI)
01309 {
01310     if( DisableCommon() )
01311         pCmdUI->Enable(FALSE);
01312     else
01313         pCmdUI->Enable(TRUE);
01314 }
01315
01317 void CGraphView::OnViewDiff()
01318 {
01319     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01320     CLogNode* root = pDoc->GetNode();
01321     if( root == NULL || root->GetUserData() == NULL || pDoc == NULL )
01322         return;
01323
01324     TGraphCmdStatus trav;
01325     trav.TraverseGraph(root);
01326
01327     MultiFiles mf;
01328
01329     mf.newdir(pDoc->GetDir());
01330     mf.newfile(pDoc->GetName(), 0L, trav.GetSel1()->GetStr());
01331
01332     if( trav.GetSelCount() == 2 )
01333     {
01334         mf.newfile(pDoc->GetName(), 0L, trav.GetSel2()->GetStr());
01335     }
01336
01337     KoGraphDiffHandler handler;
01338     handler.OnFiles(&mf);
01339 }
01340
01342 void CGraphView::OnUpdateViewDiff(CCmdUI* pCmdUI)
01343 {
01344     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01345     CLogNode* root = pDoc->GetNode();
01346     if( DisableCommon() )
01347     {
01348         pCmdUI->Enable(FALSE);
01349         return;
01350     }
01351
01352     TGraphCmdStatus trav;
01353     trav.TraverseGraph(root);
01354
01355     const BOOL outEnabled = (trav.GetSelCount() == 2 && trav.GetSel1()->GetType() != kNodeHeader &&
01356         trav.GetSel2()->GetType() != kNodeHeader) ||
01357         (trav.GetSelCount() == 1 && trav.GetSel1()->GetType() != kNodeHeader);
01358
01359     pCmdUI->Enable(outEnabled);
01360 }
01361
01363 void CGraphView::OnViewUpdate()
01364 {
01365     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01366     CLogNode* root = pDoc->GetNode();
01367     if(root == 0L || root->GetUserData() == 0L)
01368         return;
01369
01370     CvsArgs args;
01371     args.add("update");
01372     args.add("-A");
01373     args.add(pDoc->GetName());
01374     args.print(pDoc->GetDir());
01375     CGraphConsole cons;
01376     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01377
01378     OnViewReload();
01379 }
01380
01382 void CGraphView::OnUpdateViewUpdate(CCmdUI* pCmdUI)
01383 {
01384     if( DisableCommon() )
01385         pCmdUI->Enable(FALSE);
01386     else
01387         pCmdUI->Enable(TRUE);
01388 }
01389
01391 void CGraphView::OnViewTag()
01392 {
01393     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01394     CLogNode* root = pDoc->GetNode();
01395
01396     if( root == 0L || root->GetUserData() == 0L )
01397         return;
01398
01399     TGraphCmdStatus trav;
01400     trav.TraverseGraph(root);
01401
01402     CvsArgs args;
01403     args.add("update");
01404
01405     CLogNode* node = trav.GetSel1()->Node();
01406     switch(node->GetType())
01407     {
01408     case kNodeHeader:
01409         {
01410             args.add("-A");
01411             break;
01412         }
01413     case kNodeRev:
01414     case kNodeBranch:
01415     case kNodeTag:
01416         {
01417             args.add("-r");
01418             args.add(trav.GetSel1()->GetStr());
01419             break;
01420         }
01421     }
01422
01423     args.add(pDoc->GetName());
01424     args.print(pDoc->GetDir());
01425
01426     CGraphConsole cons;
01427     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01428
01429     OnViewReload();
01430 }
01431
01433 void CGraphView::OnUpdateViewTag(CCmdUI* pCmdUI)
01434 {
01435     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01436     CLogNode* root = pDoc->GetNode();
01437
01438     if( DisableCommon() )
01439     {
01440         pCmdUI->Enable(FALSE);
01441         return;
01442     }
01443
01444     TGraphCmdStatus trav;
01445     trav.TraverseGraph(root);
01446
01447     const BOOL outEnabled = trav.GetSelCount() == 1;
01448     pCmdUI->Enable(outEnabled);
01449 }
01450
01452 void CGraphView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
01453 {
01454     CScrollView::OnBeginPrinting(pDC, pInfo);
01455
01456     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01457     CLogNode* root = pDoc->GetNode();
01458     if( root == 0L )
01459         return;
01460
01461     // set all the bounds locations
01462     CWinLogData* data = CWinLogData::CreateNewData(root);
01463     root->SetUserData(data);
01464     CPoint start(0, 0);
01465     data->ComputeBounds(start, *pDC, pDoc->GetEntryInfo());
01466
01467     // compute the number of pages
01468     CRect bounds = data->Bounds();
01469     m_pageHeight = pDC->GetDeviceCaps(VERTRES);
01470     m_numberOfPages = bounds.Height() / m_pageHeight + 1;
01471
01472     pInfo->SetMaxPage(m_numberOfPages);
01473 }
01474
01476 void CGraphView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
01477 {
01478     CScrollView::OnEndPrinting(pDC, pInfo);
01479
01480     CalcImageSize();
01481     Invalidate();
01482 }
01483
01485 BOOL CGraphView::OnPreparePrinting(CPrintInfo* pInfo)
01486 {
01487     BOOL res = DoPreparePrinting(pInfo);
01488     if( !res )
01489         return res;
01490
01491     return TRUE;
01492 }
01493
01495 void CGraphView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
01496 {
01497     if( !pDC->IsPrinting() )
01498         return;
01499
01500     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01501     CLogNode* root = pDoc->GetNode();
01502     if( root == 0L || root->GetUserData() == 0L )
01503         return;
01504
01505     CWinLogData* data = (CWinLogData*)root->GetUserData();
01506
01507     // Orient the viewport so that the first row to be printed
01508     // has a viewport coordinate of (0,0).
01509     int yTopOfPage = (pInfo->m_nCurPage -1) * m_pageHeight;
01510     pDC->SetViewportOrg(0, -yTopOfPage);
01511     pDC->SetTextAlign(TA_CENTER);
01512     pDC->SetBkMode(TRANSPARENT);
01513     data->Update(*pDC, pDoc->GetEntryInfo());
01514
01515     //  CScrollView::OnPrint(pDC, pInfo);
01516 }
01517
01522 bool CGraphView::DisableCommon()
01523 {
01524     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01525     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01526     CLogNode* root = pDoc->GetNode();
01527
01528     return root == 0L || root->GetUserData() == 0L || app->IsCvsRunning() || this != CWnd::GetFocus() || gCvsPrefs.empty();
01529 }
01530
01537 bool CGraphView::IsSelSingleNode(kLogNode type, bool equal /*= true*/)
01538 {
01539     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01540     CLogNode* root = pDoc->GetNode();
01541
01542     TGraphCmdStatus trav;
01543     trav.TraverseGraph(root);
01544
01545     return (trav.GetSelCount() == 1 &&
01546         (equal ? trav.GetSel1()->GetType() == type : trav.GetSel1()->GetType() != type));
01547 }
01548
01550 void CGraphView::OnViewDelrev()
01551 {
01552     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01553     CLogNode* root = pDoc->GetNode();
01554     if( root == 0L || root->GetUserData() == 0L )
01555         return;
01556
01557     if( AfxMessageBox("Are you really sure you want to do that ? This will permanently remove the revisions on the server.",
01558         MB_OKCANCEL|MB_DEFBUTTON2|MB_ICONSTOP) != IDOK )
01559     {
01560         return;
01561     }
01562
01563     TGraphDelCmd trav;
01564     trav.TraverseGraph(root);
01565
01566     CProgress progress(true, "Deleting revisions...");
01567
01568     std::vector<CStr>::const_iterator i;
01569     int count = 0;
01570     for(i = trav.GetAllRevs().begin(); i != trav.GetAllRevs().end(); ++i, ++count)
01571     {
01572         progress.SetProgress((int)(((float)count / (float)trav.GetAllRevs().size()) * 100.0 + .5));
01573         if( progress.HasAborted() )
01574             break;
01575
01576         CvsArgs args;
01577         args.add("admin");
01578         args.add("-o");
01579         args.add(*i);
01580         args.add(pDoc->GetName());
01581         args.print(pDoc->GetDir());
01582
01583         CGraphConsole cons;
01584         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01585     }
01586
01587     if( !progress.HasAborted() )
01588         progress.SetProgress(100);
01589
01590     OnViewReload();
01591 }
01592
01594 void CGraphView::OnUpdateViewDelrev(CCmdUI* pCmdUI)
01595 {
01596     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01597     CLogNode* root = pDoc->GetNode();
01598     if( DisableCommon() )
01599     {
01600         pCmdUI->Enable(FALSE);
01601         return;
01602     }
01603
01604     TGraphDelCmd trav;
01605     trav.TraverseGraph(root);
01606     BOOL outEnabled = trav.GetCountSel() >= 1 && trav.GetOnlyRev();
01607     pCmdUI->Enable(outEnabled);
01608 }
01609
01611 void CGraphView::OnViewSelnonsig()
01612 {
01613     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01614     CLogNode* root = pDoc->GetNode();
01615     if( root == 0L || root->GetUserData() == 0L )
01616         return;
01617
01618     CWinLogData* data = (CWinLogData*)root->GetUserData();
01619     data->UnselectAll(this);
01620
01621     TGraphSelNonSig trav(this);
01622     trav.TraverseGraph(root);
01623 }
01624
01626 void CGraphView::OnUpdateViewSelnonsig(CCmdUI* pCmdUI)
01627 {
01628     if( DisableCommon() )
01629         pCmdUI->Enable(FALSE);
01630     else
01631         pCmdUI->Enable(TRUE);
01632 }
01633
01635 void CGraphView::OnViewRetrieve()
01636 {
01637     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01638     CLogNode* root = pDoc->GetNode();
01639     if( root == 0L || root->GetUserData() == 0L )
01640         return;
01641
01642     TGraphCmdStatus trav;
01643     trav.TraverseGraph(root);
01644
01645     CStr f1, prf1;
01646     CvsArgs args;
01647
01648     prf1 = pDoc->GetName();
01649     prf1 << ".#.";
01650     prf1 << trav.GetSel1()->GetStr();
01651     args.add("update");
01652     args.add("-p");
01653     args.add("-r");
01654     args.add(trav.GetSel1()->GetStr());
01655     args.add(pDoc->GetName());
01656     args.print(pDoc->GetDir());
01657
01658     CRevisionConsole console;
01659     console.init(pDoc->GetDir(), prf1);
01660
01661     int code = launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &console);
01662 }
01663
01665 void CGraphView::OnUpdateViewRetrieve(CCmdUI* pCmdUI)
01666 {
01667     BOOL enabled = FALSE;
01668     if( !DisableCommon() )
01669     {
01670         enabled = IsSelSingleNode(kNodeHeader, false);
01671     }
01672
01673     pCmdUI->Enable(enabled);
01674 }
01675
01677 void CGraphView::DisableUpdate(CCmdUI* pCmdUI)
01678 {
01679     pCmdUI->Enable(false);
01680 }
01681
01687 void CGraphView::OnContextMenu(CWnd* pWnd, CPoint point)
01688 {
01689     // Comply with windows UI standard (Windows Explorer file view used as a reference),
01690     // change selections according to the state of Control and Shift keys
01691     BYTE abKeyboardState[256];
01692     BOOL bControlState = FALSE;
01693     BOOL bShiftState = FALSE;
01694     memset( abKeyboardState, 0, 256 );
01695
01696     if( GetKeyboardState(abKeyboardState) )
01697     {
01698         bControlState = abKeyboardState[VK_CONTROL] & 0x80;
01699         bShiftState = abKeyboardState[VK_SHIFT] & 0x80;
01700     }
01701
01702     if( (!bControlState || (bControlState && bShiftState)) && !DisableCommon() )
01703     {
01704         CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01705         CLogNode* root = pDoc->GetNode();
01706
01707         TGraphCmdStatus trav;
01708         trav.TraverseGraph(root);
01709
01710         CWinLogData* data = (CWinLogData*)root->GetUserData();
01711         CPoint hitPoint(point);
01712         ScreenToClient(&hitPoint);
01713         hitPoint += GetDeviceScrollPosition();
01714         CWinLogData* hit = data->HitTest(hitPoint);
01715
01716         if( hit != 0L )
01717         {
01718             if( trav.GetSelCount() == 0 )
01719             {
01720                 hit->SetSelected(this, true);
01721             }
01722             else if( trav.GetSelCount() >= 1 && trav.GetSel1()->GetType() != kNodeHeader )
01723             {
01724                 if( !(hit->Selected() && bShiftState) && !(bControlState && bShiftState && hit->Selected()) )
01725                 {
01726                     data->UnselectAll(this);
01727                 }
01728
01729                 hit->SetSelected(this, true);
01730             }
01731         }
01732     }
01733
01734     // Get the menu to display from the main app window, which for graph view
01735     // will be IDR_GRAPH,  The submenu to display is the menu under "Graph".
01736     // Note that if the position of this menu changes, the index under
01737     // GetSubMenu must also change.
01738     CMenu* pMenu    = ::AfxGetMainWnd()->GetMenu();
01739     CMenu* pSubMenu = pMenu->GetSubMenu(5);
01740
01741     pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
01742 }
01743
01745 void CGraphView::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
01746 {
01747     ASSERT(pPopupMenu != NULL);
01748     // Check the enabled state of various menu items.
01749
01750     CCmdUI state;
01751     state.m_pMenu = pPopupMenu;
01752     ASSERT(state.m_pOther == NULL);
01753     ASSERT(state.m_pParentMenu == NULL);
01754
01755     // Determine if menu is popup in top-level menu and set m_pOther to
01756     // it if so (m_pParentMenu == NULL indicates that it is secondary popup).
01757     HMENU hParentMenu;
01758     if( AfxGetThreadState()->m_hTrackingMenu == pPopupMenu->m_hMenu )
01759         state.m_pParentMenu = pPopupMenu;    // Parent == child for tracking popup.
01760     else if( (hParentMenu = ::GetMenu(m_hWnd)) != NULL )
01761     {
01762         CWnd* pParent = this;
01763         // Child windows don't have menus--need to go to the top!
01764         if( pParent != NULL &&
01765             (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL )
01766         {
01767             int nIndexMax = ::GetMenuItemCount(hParentMenu);
01768             for(int nIndex = 0; nIndex < nIndexMax; nIndex++)
01769             {
01770                 if( ::GetSubMenu(hParentMenu, nIndex) == pPopupMenu->m_hMenu )
01771                 {
01772                     // When popup is found, m_pParentMenu is containing menu.
01773                     state.m_pParentMenu = CMenu::FromHandle(hParentMenu);
01774                     break;
01775                 }
01776             }
01777         }
01778     }
01779
01780     state.m_nIndexMax = pPopupMenu->GetMenuItemCount();
01781     for(state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; state.m_nIndex++)
01782     {
01783         state.m_nID = pPopupMenu->GetMenuItemID(state.m_nIndex);
01784         if( state.m_nID == 0 )
01785             continue; // Menu separator or invalid cmd - ignore it.
01786
01787         ASSERT(state.m_pOther == NULL);
01788         ASSERT(state.m_pMenu != NULL);
01789         if( state.m_nID == (UINT)-1 )
01790         {
01791             // Possibly a popup menu, route to first item of that popup.
01792             state.m_pSubMenu = pPopupMenu->GetSubMenu(state.m_nIndex);
01793             if( state.m_pSubMenu == NULL ||
01794                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
01795                 state.m_nID == (UINT)-1 )
01796             {
01797                 continue;       // First item of popup can't be routed to.
01798             }
01799
01800             state.DoUpdate(this, TRUE);   // Popups are never auto disabled.
01801         }
01802         else
01803         {
01804             // Normal menu item.
01805             // Auto enable/disable if frame window has m_bAutoMenuEnable
01806             // set and command is _not_ a system command.
01807             state.m_pSubMenu = NULL;
01808             state.DoUpdate(this, FALSE);
01809         }
01810
01811         // Adjust for menu deletions and additions.
01812         UINT nCount = pPopupMenu->GetMenuItemCount();
01813         if( nCount < state.m_nIndexMax )
01814         {
01815             state.m_nIndex -= (state.m_nIndexMax - nCount);
01816             while( state.m_nIndex < nCount &&
01817                 pPopupMenu->GetMenuItemID(state.m_nIndex) == state.m_nID )
01818             {
01819                 state.m_nIndex++;
01820             }
01821         }
01822
01823         state.m_nIndexMax = nCount;
01824     }
01825 }
01826
01828 void CGraphView::OnUpdateQueryAnnotate(CCmdUI* pCmdUI)
01829 {
01830     BOOL enabled = FALSE;
01831     if( !DisableCommon() )
01832     {
01833         enabled = IsSelSingleNode(kNodeHeader, false);
01834     }
01835
01836     pCmdUI->Enable(enabled);
01837 }
01838
01840 void CGraphView::OnQueryAnnotate()
01841 {
01842     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01843     CLogNode* root = pDoc->GetNode();
01844     if( root == 0L || root->GetUserData() == 0L )
01845         return;
01846
01847     TGraphCmdStatus trav;
01848     trav.TraverseGraph(root);
01849
01850     if( gCvsPrefs.ExtDiff() != 0L )
01851     {
01852         CStr file, prf, ext, base;
01853         CvsArgs args;
01854
01855         GetExtension(pDoc->GetName(), base, ext);
01856
01857         prf = base;
01858         prf << "_ann_";
01859         prf << trav.GetSel1()->GetStr();
01860         prf << '_';
01861         args.add("annotate");
01862         args.add("-r");
01863         args.add(trav.GetSel1()->GetStr());
01864         args.add(pDoc->GetName());
01865         args.print(pDoc->GetDir());
01866         file = launchCVS(pDoc->GetDir(), args, prf.c_str(), ext);
01867
01868         if( file.empty() )
01869             return;
01870
01871         LaunchViewer(file);
01872     }
01873 }
01874
01876 void CGraphView::OnGraphGraphoptions()
01877 {
01878     if( CompatGetGraphOptions(gGraphSelColor, gGraphShadowColor,
01879         gGraphHeaderColor, gGraphTagColor, gGraphBranchColor,
01880         gGraphNodeColor, gGraphDeadNodeColor, gGraphUserStateNodeColor) )
01881     {
01882         // add any additional processing here
01883     }
01884
01885     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
01886     if( pApp )
01887     {
01888         pApp->UpdateAllDocsView();
01889     }
01890 }
01891
01893 void CGraphView::OnUpdateGraphChangelogmessage(CCmdUI* pCmdUI)
01894 {
01895     BOOL enabled = FALSE;
01896     if( !DisableCommon() )
01897     {
01898         enabled = IsSelSingleNode(kNodeRev);
01899     }
01900
01901     pCmdUI->Enable(enabled);
01902 }
01903
01905 void CGraphView::OnGraphChangelogmessage()
01906 {
01907     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01908     CLogNode* root = pDoc->GetNode();
01909     if( root == 0L || root->GetUserData() == 0L )
01910         return;
01911
01912     TGraphCmdStatus trav;
01913     trav.TraverseGraph(root);
01914
01915     CLogNode* node = trav.GetSel1()->Node();
01916     ASSERT(node->GetType() == kNodeRev);
01917     CRevFile& rev = **(CLogNodeRev*)node;
01918
01919     CPStr msg = (const char*)rev.DescLog();
01920
01921     if( CompatGetAdminOptions(kChangeLog, msg) )
01922     {
01923         CvsArgs args;
01924         args.add("admin");
01925         args.add(CStr("-m") + trav.GetSel1()->GetStr() + CStr(":") + CleanupLogMsg(msg));
01926
01927         args.add(pDoc->GetName());
01928         args.print(pDoc->GetDir());
01929
01930         CGraphConsole cons;
01931         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01932         OnViewReload();
01933     }
01934 }
01935
01937 void CGraphView::OnUpdateGraphSetdescription(CCmdUI* pCmdUI)
01938 {
01939     BOOL enabled = FALSE;
01940     if( !DisableCommon() )
01941     {
01942         enabled = IsSelSingleNode(kNodeHeader);
01943     }
01944
01945     pCmdUI->Enable(enabled);
01946 }
01947
01949 void CGraphView::OnGraphSetdescription()
01950 {
01951     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01952     CLogNode* root = pDoc->GetNode();
01953     if( root == 0L || root->GetUserData() == 0L )
01954         return;
01955
01956     TGraphCmdStatus trav;
01957     trav.TraverseGraph(root);
01958
01959     CLogNode* node = trav.GetSel1()->Node();
01960     ASSERT(node->GetType() == kNodeHeader);
01961     CRcsFile& rev = **(CLogNodeHeader*)node;
01962
01963     CPStr msg = (const char*)rev.DescLog();
01964
01965     if( CompatGetAdminOptions(kSetDescription, msg) )
01966     {
01967         CvsArgs args;
01968         args.add("admin");
01969         args.add(CStr("-t-") + CleanupLogMsg(msg));
01970
01971         args.add(pDoc->GetName());
01972         args.print(pDoc->GetDir());
01973
01974         CGraphConsole cons;
01975         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01976         OnViewReload();
01977     }
01978 }
01979
01981 void CGraphView::OnUpdateGraphSetstate(CCmdUI* pCmdUI)
01982 {
01983     BOOL enabled = FALSE;
01984     if( !DisableCommon() )
01985     {
01986         enabled = IsSelSingleNode(kNodeRev);
01987     }
01988
01989     pCmdUI->Enable(enabled);
01990 }
01991
01993 void CGraphView::OnGraphSetstate()
01994 {
01995     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01996     CLogNode* root = pDoc->GetNode();
01997     if( root == 0L || root->GetUserData() == 0L )
01998         return;
01999
02000     TGraphCmdStatus trav;
02001     trav.TraverseGraph(root);
02002
02003     CLogNode* node = trav.GetSel1()->Node();
02004     ASSERT(node->GetType() == kNodeRev);
02005     CRevFile& rev = **(CLogNodeRev*)node;
02006
02007     CPStr state = (const char*)rev.State();
02008
02009     if( strcmp("dead", (const char*)state ) == 0 &&
02010         CvsAlert("The revision state is: \"dead\". You should not alter it manually.\nAre you sure you want to continue?", "Cancel", "Continue") )
02011     {
02012         return;
02013     }
02014
02015     if( CompatGetAdminOptions(kSetState, state) )
02016     {
02017         CvsArgs args;
02018         args.add("admin");
02019         args.add("-s");
02020         args.add(CleanupLogMsg(state) + CStr(":") + trav.GetSel1()->GetStr());
02021
02022         args.add(pDoc->GetName());
02023         args.print(pDoc->GetDir());
02024
02025         CGraphConsole cons;
02026         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
02027         OnViewReload();
02028     }
02029 }
02030
02032 void CGraphView::OnUpdateViewUnlockf(CCmdUI* pCmdUI)
02033 {
02034     BOOL enabled = FALSE;
02035     if( !DisableCommon() )
02036     {
02037         enabled = IsSelSingleNode(kNodeRev);
02038     }
02039
02040     pCmdUI->Enable(enabled);
02041 }
02042
02044 void CGraphView::OnViewUnlockf()
02045 {
02046     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
02047     CLogNode* root = pDoc->GetNode();
02048     if( root == 0L || root->GetUserData() == 0L )
02049         return;
02050
02051     TGraphCmdStatus trav;
02052     trav.TraverseGraph(root);
02053
02054     CvsArgs args;
02055     args.add("admin");
02056     args.add(CStr("-u") + trav.GetSel1()->GetStr());
02057
02058     args.add(pDoc->GetName());
02059     args.print(pDoc->GetDir());
02060
02061     CGraphConsole cons;
02062     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
02063     OnViewReload();
02064 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "AppGlue.h"
00028
00029 #define STARTPOINT_PT       (CPoint(5, 5))
00030 #define SHADOW_OFFSET_PT    (CPoint(4, 4))
00031 #define ROUND_RECT_PT       (CPoint(6, 6))
00032
00033 #define OCTANGLE_COUNT      8
00034
00035 #define RGB_DEF_SEL             RGB(160, 160, 160)
00036 #define RGB_DEF_SHADOW          RGB(128, 128, 128)
00037 #define RGB_DEF_HEADER          RGB(255, 0, 0)
00038 #define RGB_DEF_TAG             RGB(0, 0, 0)
00039 #define RGB_DEF_BRANCH          RGB(0, 0, 255)
00040 #define RGB_DEF_NODE            RGB(0, 0, 255)
00041 #define RGB_DEF_DEADNODE        RGB(255, 0, 0)
00042 #define RGB_DEF_USERSTATENODE   RGB(0, 128, 64)
00043 #define STYLE_DEADNODE          PS_DOT
00044 #define STYLE_USERSTATENODE     PS_DASH
00045
00047 typedef enum
00048 {
00049     kRectangle,
00050     kRoundRect,
00051     kOctangle
00052 } kNodeShape;
00053
00055 typedef enum
00056 {
00057     kTContinue,
00058     kTGetDown,
00059     kTStop
00060 } kTGraph;
00061
00062 // Forward declarations
00063 class EntnodeData;
00064 class CGraphView;
00065
00067 class CWinLogData : public CLogNodeData
00068 {
00069 public:
00070     // Construction
00071     CWinLogData(CLogNode* node);
00072     virtual ~CWinLogData();
00073
00074 private:
00075     // Data members
00076     CRect selfB;
00077     CRect totB;
00078     bool sel;
00080 protected:
00081     // Methods
00082     inline CWinLogData* GetData(CLogNode* node);
00083
00089     virtual void UpdateSelf(CDC& dc, EntnodeData* entryInfo) = 0;
00090
00097     virtual CSize GetBoundsSelf(CDC& dc, EntnodeData* entryInfo) = 0;
00098
00099 public:
00100     // Interface
00101     inline kLogNode GetType(void) const;
00102     const char* GetStr(void);
00103
00104     inline CRect& Bounds(void);
00105     inline CRect& SelfBounds(void);
00106
00107     void ComputeBounds(const CPoint& topLeft, CDC& dc, EntnodeData* entryInfo = 0L);
00108     void Offset(CPoint offset);
00109     void Update(CDC& dc, EntnodeData* entryInfo = 0L);
00110
00111     inline bool Selected(void) const;
00112     void SetSelected(CScrollView* view, bool state);
00113     void UnselectAll(CScrollView* view);
00114     CWinLogData* HitTest(CPoint point);
00115
00116     static CWinLogData* CreateNewData(CLogNode* node);
00117
00118     bool IsDiskNode(EntnodeData* entryInfo);
00119     bool IsDeadNode();
00120     bool IsUserState();
00121 };
00122
00124 class CWinLogHeaderData : public CWinLogData
00125 {
00126 public:
00127     // Construction
00128     CWinLogHeaderData(CLogNode* node) : CWinLogData(node) {}
00129     virtual ~CWinLogHeaderData() {}
00130
00131 protected:
00132     // Methods
00133     virtual void UpdateSelf(CDC& dc, EntnodeData* entryInfo);
00134     virtual CSize GetBoundsSelf(CDC& dc, EntnodeData* entryInfo);
00135 };
00136
00138 class CWinLogRevData : public CWinLogData
00139 {
00140 public:
00141     // Construction
00142     CWinLogRevData(CLogNode* node) : CWinLogData(node) {}
00143     virtual ~CWinLogRevData() {}
00144
00145 protected:
00146     // Methods
00147     virtual void UpdateSelf(CDC& dc, EntnodeData* entryInfo);
00148     virtual CSize GetBoundsSelf(CDC& dc, EntnodeData* entryInfo);
00149 };
00150
00152 class CWinLogTagData : public CWinLogData
00153 {
00154 public:
00155     // Construction
00156     CWinLogTagData(CLogNode* node) : CWinLogData(node) {}
00157     virtual ~CWinLogTagData() {}
00158
00159 protected:
00160     // Methods
00161     virtual void UpdateSelf(CDC& dc, EntnodeData* entryInfo);
00162     virtual CSize GetBoundsSelf(CDC& dc, EntnodeData* entryInfo);
00163 };
00164
00166 class CWinLogBranchData : public CWinLogData
00167 {
00168 public:
00169     // Construction
00170     CWinLogBranchData(CLogNode* node) : CWinLogData(node) {}
00171     virtual ~CWinLogBranchData() {}
00172
00173 protected:
00174     // Methods
00175     virtual void UpdateSelf(CDC& dc, EntnodeData* entryInfo);
00176     virtual CSize GetBoundsSelf(CDC& dc, EntnodeData* entryInfo);
00177 };
00178
00180 class TGraph
00181 {
00182 public:
00183     // Interface
00184     kTGraph TraverseGraph(CLogNode* node);
00185     virtual kTGraph TraverseNode(CLogNode* node) = 0;
00186 };
00187
00189 class TGraphRectSelect : public TGraph
00190 {
00191 public:
00192     // Construction
00193     TGraphRectSelect(bool shiftOn, CGraphView* view, CRect& rect);
00194
00195 protected:
00196     // Data members
00197     bool m_shiftOn;
00198     CGraphView* m_view;
00199     CRect& m_rect;
00201 public:
00202     // Interface
00203     virtual kTGraph TraverseNode(CLogNode* node);
00204 };
00205
00207 class TGraphCmdStatus : public TGraph
00208 {
00209 public:
00211     TGraphCmdStatus();
00212
00213 private:
00214     // Data members
00215     CWinLogData* m_fSel1;
00216     CWinLogData* m_fSel2;
00217     int m_selCount;
00219 public:
00220     // Interface
00221     virtual kTGraph TraverseNode(CLogNode* node);
00222
00223     int GetSelCount() const;
00224     CWinLogData* GetSel1() const;
00225     CWinLogData* GetSel2() const;
00226 };
00227
00229 class CGraphConsole : public CCvsConsole
00230 {
00231 public:
00232     // Construction
00233     CGraphConsole();
00234
00235 private:
00236     // Data members
00237     CWincvsView* m_view;
00239 public:
00240     // Interface
00241     virtual long cvs_out(char* txt, long len);
00242     virtual long cvs_err(char* txt, long len);
00243 };
00244
00246 class TGraphDelCmd : public TGraph
00247 {
00248 public:
00249     // Construction
00250     TGraphDelCmd();
00251
00252 private:
00253     // Data members
00254     int m_countSel;
00255     bool m_onlyRev;
00256     std::vector<CStr> m_allRevs;
00257
00258 public:
00259     // Interface
00260     virtual kTGraph TraverseNode(CLogNode* node);
00261
00262     int GetCountSel() const;
00263     bool GetOnlyRev() const;
00264     std::vector<CStr>& GetAllRevs();
00265 };
00266
00268 class TGraphSelNonSig : public TGraph
00269 {
00270 public:
00271     // Construction
00272     TGraphSelNonSig(CGraphView* view);
00273
00274 private:
00275     // Data members
00276     CGraphView* m_view;
00278 public:
00279     // Interface
00280     virtual kTGraph TraverseNode(CLogNode* node);
00281 };
00282
00284 class CRevisionConsole : public CCvsConsole
00285 {
00286 public:
00287     // Construction
00288     CRevisionConsole();
00289     virtual ~CRevisionConsole();
00290
00291 protected:
00292     // Data members
00293     FILE* m_fOut;
00294
00295 public:
00296     // Interface
00297     bool init(LPCTSTR path, LPCTSTR fname);
00298
00299     virtual long cvs_out(char *txt, long len);
00300     virtual long cvs_err(char *txt, long len);
00301 };
00302
00304 class CGraphRectTracker : public CRectTracker
00305 {
00306 public:
00307     CGraphRectTracker(CGraphView* view) : m_view(view) {}
00308
00309     virtual void OnChangedRect(const CRect& rectOld);
00310 protected:
00311     CGraphView* m_view;
00312 };
00313
00315 // CGraphView view
00316
00318 class CGraphView : public CScrollView
00319 {
00320     DECLARE_DYNCREATE(CGraphView)
00321 protected:
00322     CGraphView();           // protected constructor used by dynamic creation
00323     virtual ~CGraphView();
00324
00325 // Attributes
00326 public:
00327
00328     // Operations
00329 public:
00330
00331 // Overrides
00332     // ClassWizard generated virtual function overrides
00333     //{{AFX_VIRTUAL(CGraphView)
00334     protected:
00335     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00336     virtual void OnInitialUpdate();     // first time after construct
00337     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00338     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00339     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00340     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00341     //}}AFX_VIRTUAL
00342
00343 // Implementation
00344 protected:
00345
00346 #ifdef _DEBUG
00347     virtual void AssertValid() const;
00348     virtual void Dump(CDumpContext& dc) const;
00349 #endif
00350
00351     // Generated message map functions
00352     //{{AFX_MSG(CGraphView)
00353     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00354     afx_msg void OnViewReload();
00355     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00356     afx_msg void OnViewDiff();
00357     afx_msg void OnUpdateViewDiff(CCmdUI* pCmdUI);
00358     afx_msg void OnViewUpdate();
00359     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00360     afx_msg void OnViewTag();
00361     afx_msg void OnUpdateViewTag(CCmdUI* pCmdUI);
00362     afx_msg void OnViewDelrev();
00363     afx_msg void OnUpdateViewDelrev(CCmdUI* pCmdUI);
00364     afx_msg void OnViewSelnonsig();
00365     afx_msg void OnUpdateViewSelnonsig(CCmdUI* pCmdUI);
00366     afx_msg void OnViewRetrieve();
00367     afx_msg void OnUpdateViewRetrieve(CCmdUI* pCmdUI);
00368     afx_msg void DisableUpdate(CCmdUI* pCmdUI);
00369     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00370     afx_msg void OnQueryAnnotate();
00371     afx_msg void OnUpdateQueryAnnotate(CCmdUI* pCmdUI);
00372     afx_msg void OnGraphGraphoptions();
00373     afx_msg void OnUpdateGraphChangelogmessage(CCmdUI* pCmdUI);
00374     afx_msg void OnGraphChangelogmessage();
00375     afx_msg void OnUpdateGraphSetdescription(CCmdUI* pCmdUI);
00376     afx_msg void OnGraphSetdescription();
00377     afx_msg void OnGraphSetstate();
00378     afx_msg void OnUpdateGraphSetstate(CCmdUI* pCmdUI);
00379     afx_msg void OnViewUnlockf();
00380     afx_msg void OnUpdateViewUnlockf(CCmdUI* pCmdUI);
00381     //}}AFX_MSG
00382     DECLARE_MESSAGE_MAP()
00383 private:
00384     // Data members
00385     static CImageList m_imageList;
00387         // For printing
00388     int m_numberOfPages;
00389     int m_pageHeight;
00391     // Methods
00392     bool DisableCommon();
00393     bool IsSelSingleNode(kLogNode type, bool equal = true);
00394
00395     void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
00396
00397 public:
00398     // Interface
00399     void CalcImageSize(void);
00400
00402     static inline CImageList& GetImgList(void) { return m_imageList; }
00403 };
00404
00406
00407 //{{AFX_INSERT_LOCATION}}
00408 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00409
00410 #endif // !defined(AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_)
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CvsCommands.h"
00033
00034 #ifdef _DEBUG
00035 #define new DEBUG_NEW
00036 #undef THIS_FILE
00037 static char THIS_FILE[] = __FILE__;
00038 #endif
00039
00040 static PCPStr gOldLoc("P_BrowserLoc", "C:\\");
00041
00042 int TraverseHistory(CHistComboBoxEx& browseHist)
00043 {
00044     char szPath[MAX_PATH] = "";
00045     for( int nIndex = 0; nIndex < browseHist.GetCount(); nIndex++ )
00046     {
00047         COMBOBOXEXITEM cbi;
00048         cbi.mask = CBEIF_TEXT;
00049         cbi.iItem = nIndex;
00050         cbi.pszText = szPath;
00051         cbi.cchTextMax = MAX_PATH;
00052
00053         browseHist.GetItem(&cbi);
00054         browseHist.SetIcon(cbi);
00055     }
00056
00057     return nIndex;
00058 }
00059
00061 // CHistComboBoxEx
00062
00063 CHistComboBoxEx::CHistComboBoxEx(int feature /*= USmartCombo::DefaultFeature*/)
00064     : USmartCombo(feature)
00065 {
00066 }
00067
00068 CHistComboBoxEx::~CHistComboBoxEx()
00069 {
00070 }
00071
00072
00073 BEGIN_MESSAGE_MAP(CHistComboBoxEx, CComboBoxEx)
00074     //{{AFX_MSG_MAP(CHistComboBoxEx)
00075     ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
00076     //}}AFX_MSG_MAP
00077 END_MESSAGE_MAP()
00078
00079
00080 // CHistComboBoxEx message handlers
00081
00082 const char* CHistComboBoxEx::GetOldLoc()
00083 {
00084     return gOldLoc;
00085 }
00086
00087 int CHistComboBoxEx::NewRoot(const char* root)
00088 {
00089     if(stricmp(gOldLoc, root) != 0)
00090         gOldLoc = root;
00091
00092     CMString* pstrItems = GetItems();
00093     ASSERT(pstrItems != NULL);
00094
00095     // update the history combo
00096     pstrItems->Insert(root);
00097     ResetContent();
00098     const std::vector<CStr> & list = pstrItems->GetList();
00099     std::vector<CStr>::const_iterator i;
00100     for(i = list.begin(); i != list.end(); ++i)
00101     {
00102         InsertString(-1, *i);
00103     }
00104     SetCurSel(0);
00105     TRACE("Browse History has %d items\n", GetCount());
00106
00107     return GetCount();
00108 }
00109
00111 CString CHistComboBoxEx::FindBestRoot(CMString& strItems, const char* path, bool mustExist /*= false*/)
00112 {
00113     CString normPath(path);
00114     CString bestRoot;
00115     normPath.TrimRight("\\/");
00116     normPath.MakeLower();
00117
00118     const std::vector<CStr> & list = strItems.GetList();
00119     std::vector<CStr>::const_iterator i;
00120     for(i = list.begin(); i != list.end(); ++i)
00121     {
00122         CString root = *i;
00123         root.TrimRight("\\/");
00124         root.MakeLower();
00125
00126         if( normPath.Find(root) != -1 )
00127         {
00128             //we want the longest root so it's near the file
00129             if( root.GetLength() > bestRoot.GetLength() )
00130             {
00131                 bestRoot = *i;
00132             }
00133         }
00134     }
00135
00136     if( !mustExist && bestRoot.IsEmpty() )
00137     {
00138         bestRoot = path;
00139         bestRoot.TrimRight("\\/");
00140     }
00141
00142     //handle the drive root
00143     if( bestRoot.GetAllocLength() &&
00144         ':' == bestRoot[bestRoot.GetLength()-1])
00145     {
00146         bestRoot += kPathDelimiter;
00147     }
00148
00149     return bestRoot;
00150 }
00151
00152 int CHistComboBoxEx::InsertString(int nIndex, LPCTSTR lpszString)
00153 {
00154     int nRes = -1;
00155
00156     COMBOBOXEXITEM cbi;
00157     cbi.mask = CBEIF_TEXT;
00158     cbi.iItem = 0 > nIndex ? GetCount() : nIndex;
00159     cbi.pszText = (LPTSTR)lpszString;   //this cast is safe because we are Inserting item only
00160     cbi.cchTextMax = 0;
00161
00162     nRes = InsertItem(&cbi);
00163     SetIcon(cbi);
00164
00165     return nRes;
00166 }
00167
00168 int CHistComboBoxEx::AddString(LPCTSTR lpszString)
00169 {
00170     return InsertString(-1, lpszString);
00171 }
00172
00173 BOOL CHistComboBoxEx::SetIcon(COMBOBOXEXITEM cbi)
00174 {
00175     //initialize the image list if neccessary
00176     if( m_ImageList.m_hImageList == 0L )
00177     {
00178         m_ImageList.Create(IDB_HISTLOC, HISTLOC_IMAGE_CX, 1, RGB(255, 255, 255));
00179         SetImageList(&m_ImageList);
00180     }
00181
00182     cbi.mask = CBEIF_IMAGE | /*CBEIF_OVERLAY |*/ CBEIF_SELECTEDIMAGE;
00183     cbi.iImage = cbi.iSelectedImage = kLocationIconUnknown;
00184     //cbi.iOverlay = ;
00185
00186     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00187     vector<CStr> ignlist;
00188     struct stat sb;
00189     const char *fullpath = cbi.pszText;
00190
00191     int statres = stat(fullpath, &sb);
00192     if( statres != -1 )
00193     {
00194         if( S_ISDIR(sb.st_mode) )
00195         {
00196             CStr uppath, folder;
00197             if( !SplitPath(fullpath, uppath, folder) || uppath.empty() )
00198             {
00199                 uppath = fullpath;
00200                 folder = ".";
00201             }
00202
00203             BuildIgnoredList(ignlist, uppath);
00204
00205             EntnodeData *data = Entries_SetVisited(uppath, entries, folder, sb, true, &ignlist);
00206             if( !data->IsUnknown() )
00207             {
00208                 cbi.iImage = cbi.iSelectedImage = kLocationIcon;
00209             }
00210             if( data->IsIgnored() )
00211             {
00212                 cbi.iImage = cbi.iSelectedImage = kLocationIconIgnored;
00213             }
00214             if( data->IsMissing() )
00215             {
00216                 cbi.iImage = cbi.iSelectedImage = kLocationIconMissing;
00217             }
00218         }
00219     }
00220     else
00221     {
00222         cbi.iImage = cbi.iSelectedImage = kLocationIconErased;
00223     }
00224
00225     return SetItem(&cbi);
00226 }
00227
00232 BOOL CHistComboBoxEx::PreTranslateMessage(MSG* pMsg)
00233 {
00234     if( HasFeature(USmartCombo::RemoveItems) )
00235     {
00236         if( DelKeyTest(pMsg) )
00237         {
00238             return TRUE;
00239         }
00240     }
00241
00242     return CComboBoxEx::PreTranslateMessage(pMsg);
00243 }
00244
00250 void CHistComboBoxEx::OnDropdown()
00251 {
00252     TraverseHistory(*this);
00253     if( HasFeature(USmartCombo::AutoDropWidth) )
00254     {
00255         SetDroppedWidth(CalcDroppedWidth());
00256     }
00257 }
00258
00264 int CHistComboBoxEx::CalcDroppedWidth()
00265 {
00266     int maxSize = 0;
00267
00268     CClientDC ClientDC(this);
00269     int savedDc = ClientDC.SaveDC();
00270     ClientDC.SelectObject(GetFont());
00271
00272     CString strLBText;
00273     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00274     {
00275         GetLBText( nIndex, strLBText );
00276         CSize size = ClientDC.GetTextExtent(strLBText);
00277
00278         if( size.cx > maxSize )
00279         {
00280             maxSize = size.cx;
00281         }
00282     }
00283     ClientDC.RestoreDC(savedDc);
00284
00285     maxSize += ::GetSystemMetrics(SM_CXVSCROLL)     //vertical scroll bar
00286         + 4*::GetSystemMetrics(SM_CXEDGE)           //the border aroung the text and icon: Edge-Icon-Edge - Edge-Text-Edge
00287         + HISTLOC_IMAGE_CX                          //the icon width
00288         + 2;                                        //the focus frame width
00289
00290     CRect rect;
00291     GetWindowRect(rect);
00292     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00293
00294     return maxSize;
00295 }
00296
00303 BOOL CHistComboBoxEx::DelKeyTest(MSG* pMsg)
00304 {
00305     CMString* pstrItems = GetItems();
00306     ASSERT(pstrItems != NULL);
00307
00308     BOOL bRes = FALSE;
00309
00310     if( WM_KEYDOWN == pMsg->message &&
00311         VK_DELETE == (int)pMsg->wParam &&
00312         pstrItems &&
00313         GetDroppedState() )
00314     {
00315         int sel = GetCurSel();
00316         if( CB_ERR < sel && GetCount() > 1 )
00317         {
00318             CString strItem;
00319             GetLBText(sel, strItem);
00320
00321             if( RemoveItem(strItem) )
00322             {
00323                 DeleteString(sel);
00324
00325                 if( GetCount() )
00326                 {
00327                     int nNewSel = (0 == sel ? sel : (GetCount() ? 0 : -1));
00328                     if( 0 != nNewSel || 0 == sel )
00329                     {
00330                         SetCurSel(nNewSel);
00331
00332                         //trigger the location change for all views
00333                         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00334                         CMainFrame* mainFrm = app->GetMainFrame();
00335                         mainFrm->ChangeLocation();
00336                     }
00337                 }
00338             }
00339         }
00340         else if( GetCount() == 1 )
00341         {
00342             AfxMessageBox("Can't remove the last item from the history.\n"
00343                 "Please add a new location first and then remove the current one.", MB_OK | MB_ICONSTOP);
00344         }
00345
00346         //we have to prevent it going to another window
00347         bRes = TRUE;
00348     }
00349
00350     return bRes;
00351 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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
00063
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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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->IsCvsRunning() && !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->IsCvsRunning() )
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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/MainFrm.h Source File

WinCvs/MainFrm.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>
00019  */
00020
00021 // MainFrm.h : interface of the CMainFrame class
00022 //
00024
00025 #if !defined(AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_)
00026 #define AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_
00027
00028 #if _MSC_VER >= 1000
00029 #pragma once
00030 #endif // _MSC_VER >= 1000
00031
00032 #include "ConsoleBar.h"
00033 #include "CvsStatusBar.h"
00034 #include "BrowseViewModel.h"
00035 #include "ToolbarCombo.h"
00036 #include "HistComboBoxEx.h"
00037
00038 class CMainFrame : public CCJMDIFrameWnd
00039 {
00040     DECLARE_DYNAMIC(CMainFrame)
00041 public:
00042     CMainFrame();
00043 #if 0
00044 protected: // create from serialization only
00045     CMainFrame();
00046     DECLARE_DYNCREATE(CMainFrame)
00047 #endif
00048
00049 // Attributes
00050 protected:
00051      KoFilterModel m_filter;
00052      KoRecursionModel m_recursion;
00053      KoIgnoreModel m_ignore;
00054
00055 // Operations
00056 public:
00057
00058 // Overrides
00059     // ClassWizard generated virtual function overrides
00060     //{{AFX_VIRTUAL(CMainFrame)
00061     public:
00062     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00063     //}}AFX_VIRTUAL
00064
00065 // Implementation
00066 public:
00067     void DropFiles(HDROP hDropInfo);
00068     void InitialShowWindow(int nCmdShow);
00069     virtual ~CMainFrame();
00070
00071     CWinCvsBrowser *GetBrowserView();
00072     CCJShellTree *GetExplorerView();
00073     inline CCJTabCtrlBar *GetWorkspace() { return &m_wndWorkspace; }
00074     inline CMDIMenuList & GetMenuList(void) { return m_menuList; }
00075
00076     inline CWincvsView *GetConsoleView() { return m_consolebar.m_view; }
00077     inline CHistComboBoxEx & GetBrowseHistory(void) { return m_browseHist; }
00078     inline CStatusBar *GetStatusBar() { return &m_wndStatusBar; }
00079
00080     BOOL OnBroadcastCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
00081         // take care about the cmd msg routing on the dock bars
00082
00083     char *GetEnvMainThread(const char *name);
00084
00085     // KiFilterModel implementation
00086     KiFilterModel* GetFilterModel()
00087     {
00088         return &m_filter;
00089     }
00090
00091     // KiRecursionModel implementation
00092     KiRecursionModel* GetRecursionModel()
00093     {
00094         return &m_recursion;
00095     }
00096
00097     // KiRecursionModel implementation
00098     KiIgnoreModel* GetIgnoreModel()
00099     {
00100         return &m_ignore;
00101     }
00102
00103     void OnFilterMaskEntered();
00104
00105     void ChangeLocation();
00106
00107 #ifdef _DEBUG
00108     virtual void AssertValid() const;
00109     virtual void Dump(CDumpContext& dc) const;
00110 #endif
00111
00112 protected:  // control bar embedded members
00113     CCvsStatusBar  m_wndStatusBar;
00114     CToolBar    m_wndToolBar;
00115     CToolBar    m_wndBrowser;
00116     CToolBar    m_wndMultiUser;
00117     CToolBar    m_wndTags;
00118     CToolBar    m_wndList;
00119     CToolBar    m_wndFilter;
00120     CHistComboBoxEx m_browseHist;
00121     CToolbarCombo m_comboFilterMask;
00122     CFont       m_fontNormal;
00123     CBarConsole m_consolebar;
00124     CCJTabCtrlBar   m_wndWorkspace;
00125     CImageList  m_TabImages;
00126     CCJWindowPlacement  m_state;
00127
00128     BOOL InitializeDockingWindows();
00129
00130 // Generated message map functions
00131 protected:
00132     afx_msg void OnInitMenu(CMenu* pMenu);
00133     void DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf);
00134     bool FreshenFileMask();
00135
00136     //{{AFX_MSG(CMainFrame)
00137     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00138     afx_msg void OnClose();
00139     afx_msg void OnDropFiles(HDROP hDropInfo);
00140     afx_msg void OnHistorySelect();
00141     afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
00142     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
00143     afx_msg void OnViewRecursive();
00144     afx_msg void OnViewModified();
00145     afx_msg void OnUpdateViewModified(CCmdUI* pCmdUI);
00146     afx_msg void OnUpdateViewRecursive(CCmdUI* pCmdUI);
00147     afx_msg void OnViewConflict();
00148     afx_msg void OnUpdateViewConflict(CCmdUI* pCmdUI);
00149     afx_msg void OnViewUnknown();
00150     afx_msg void OnUpdateViewUnknown(CCmdUI* pCmdUI);
00151     afx_msg void OnViewMissing();
00152     afx_msg void OnUpdateViewMissing(CCmdUI* pCmdUI);
00153     afx_msg void OnViewIgnore();
00154     afx_msg void OnUpdateViewIgnore(CCmdUI* pCmdUI);
00155     afx_msg void OnUpdateFilterMask(CCmdUI* pCmdUI);
00156     afx_msg void OnUpdateHistory(CCmdUI* pCmdUI);
00157     afx_msg void OnViewAdded();
00158     afx_msg void OnUpdateViewAdded(CCmdUI* pCmdUI);
00159     afx_msg void OnUpdateViewRemoved(CCmdUI* pCmdUI);
00160     afx_msg void OnViewRemoved();
00161     afx_msg void OnViewChanged();
00162     afx_msg void OnUpdateViewChanged(CCmdUI* pCmdUI);
00163     afx_msg void OnViewHideunknown();
00164     afx_msg void OnUpdateViewHideunknown(CCmdUI* pCmdUI);
00165     afx_msg void OnTimer(UINT nIDEvent);
00166     //}}AFX_MSG
00167     DECLARE_MESSAGE_MAP()
00168 private:
00169     BOOL m_bRestoreFocus;
00170 };
00171
00173
00174 //{{AFX_INSERT_LOCATION}}
00175 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00176
00177 #endif // !defined(AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/MfFileDialog.cpp Source File

WinCvs/MfFileDialog.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 2002
00019  */
00020
00021 /*
00022  * MfFileDialog.cpp --- class to pick set of files
00023  */
00024
00025 // MfFileDialog.cpp : implementation file
00026 //
00027
00028 #include "stdafx.h"
00029 #include "MfFileDialog.h"
00030 #include <cderr.h>
00031
00032 #include "MultiFiles.h"
00033 #include <sstream>
00034
00035 #ifdef _DEBUG
00036 #define new DEBUG_NEW
00037 #undef THIS_FILE
00038 static char THIS_FILE[] = __FILE__;
00039 #endif
00040
00042 // CPathBuffer
00043
00044 CPathBuffer::CPathBuffer()
00045 {
00046     m_bufferSize = 0;
00047     m_buffer = NULL;
00048 }
00049
00050 CPathBuffer::~CPathBuffer()
00051 {
00052     Clear();
00053 }
00054
00056 void CPathBuffer::Clear()
00057 {
00058     m_bufferSize = 0;
00059     delete [] m_buffer;
00060     m_buffer = NULL;
00061 }
00062
00068 TCHAR* CPathBuffer::GetBuffer(int size /*= 0*/)
00069 {
00070     if( size > m_bufferSize )
00071     {
00072         Clear();
00073
00074         m_bufferSize = size;
00075         m_buffer = new TCHAR[size];
00076     }
00077
00078     return m_buffer;
00079 }
00080
00081
00083 // CMfFileDialog
00084
00085 IMPLEMENT_DYNAMIC(CMfFileDialog, CFileDialog)
00086
00087 CMfFileDialog::CMfFileDialog(MultiFiles& mf, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
00088         DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) : m_mf(mf),
00089         CFileDialog(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
00090 {
00091 }
00092
00093 BEGIN_MESSAGE_MAP(CMfFileDialog, CFileDialog)
00094     //{{AFX_MSG_MAP(CMfFileDialog)
00095     //}}AFX_MSG_MAP
00096 END_MESSAGE_MAP()
00097
00098
00099 int CMfFileDialog::DoModal()
00100 {
00101     m_filesBuffer.Clear();
00102     m_folderBuffer.Clear();
00103
00104     int modalResult = CFileDialog::DoModal();
00105     if( IDCANCEL == modalResult )
00106     {
00107         // Override the "buffer too small" error since we provide our own buffer
00108         if( CommDlgExtendedError() == FNERR_BUFFERTOOSMALL )
00109         {
00110             modalResult = IDOK;
00111         }
00112     }
00113
00114     if( IDOK == modalResult && m_filesBuffer.GetBuffer() && m_folderBuffer.GetBuffer() )
00115     {
00116         m_mf.newdir(m_folderBuffer.GetBuffer());
00117
00118         // Fill the selection
00119         string selFile;
00120         stringstream filesStream;
00121         filesStream << m_filesBuffer.GetBuffer();
00122
00123         while( getline(filesStream, selFile, '\"') )
00124         {
00125             if( selFile.size() > 0 && !isspace(selFile.c_str()[0]) )
00126             {
00127                 m_mf.newfile(selFile.c_str());
00128             }
00129         }
00130     }
00131
00132     return modalResult;
00133 }
00134
00136 void CMfFileDialog::OnFileNameChange()
00137 {
00138     const CWnd* pParent = GetParent();
00139     if( pParent )
00140     {
00141         const HWND hParent = pParent->m_hWnd;
00142
00143         // Get the buffer size required
00144         const int filesBufferSize = CommDlg_OpenSave_GetSpec(hParent, NULL, 0);
00145         const int folderBufferSize = CommDlg_OpenSave_GetFolderPath(hParent, NULL, 0);
00146
00147         CommDlg_OpenSave_GetSpec(hParent, m_filesBuffer.GetBuffer(filesBufferSize), filesBufferSize);
00148         CommDlg_OpenSave_GetFolderPath(hParent, m_folderBuffer.GetBuffer(folderBufferSize), folderBufferSize);
00149     }
00150 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/MfFileDialog.h Source File

WinCvs/MfFileDialog.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 2002
00019  */
00020
00021 /*
00022  * MfFileDialog.h --- class to pick set of files
00023  */
00024
00025 #if !defined(AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_)
00026 #define AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031 // MfFileDialog.h : header file
00032 //
00033
00035 class CPathBuffer
00036 {
00037 public:
00038     // Construction
00039     CPathBuffer();
00040     virtual ~CPathBuffer();
00041
00042 private:
00043     // Data members
00044     int m_bufferSize;
00045     TCHAR* m_buffer;
00047 public:
00048     // Interface
00049     inline void Clear();
00050     inline TCHAR* GetBuffer(int size = 0);
00051 };
00052
00053 class MultiFiles;
00054
00056 // CMfFileDialog dialog
00057
00059 class CMfFileDialog : public CFileDialog
00060 {
00061     DECLARE_DYNAMIC(CMfFileDialog)
00062
00063 public:
00064     CMfFileDialog(MultiFiles& mf,
00065         LPCTSTR lpszDefExt = NULL,
00066         LPCTSTR lpszFileName = NULL,
00067         DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
00068         LPCTSTR lpszFilter = NULL,
00069         CWnd* pParentWnd = NULL);
00070
00071 protected:
00072     //{{AFX_MSG(CMfFileDialog)
00073     //}}AFX_MSG
00074     DECLARE_MESSAGE_MAP()
00075 private:
00076     // Data members
00077     CPathBuffer m_filesBuffer;
00078     CPathBuffer m_folderBuffer;
00080     MultiFiles& m_mf;
00082     // Methods
00083     virtual void OnFileNameChange();
00084
00086     POSITION GetStartPosition () const;
00088     CString GetNextPathName (POSITION& pos) const;
00089
00090 public:
00091     // Interface
00092     virtual int DoModal();
00093 };
00094
00095 //{{AFX_INSERT_LOCATION}}
00096 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00097
00098 #endif // !defined(AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_)
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/NoPython.cpp Source File

WinCvs/NoPython.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>
00019  */
00020
00021 // NoPython.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "NoPython.h"
00027 #include "Persistent.h"
00028 #include "Splash.h"
00029
00030 #ifdef _DEBUG
00031 #define new DEBUG_NEW
00032 #undef THIS_FILE
00033 static char THIS_FILE[] = __FILE__;
00034 #endif
00035
00036 static CPersistentBool gWarnPython("P_WarnPython", true);
00037
00039 // CNoPython dialog
00040
00041
00042 CNoPython::CNoPython(CWnd* pParent /*=NULL*/)
00043     : CDialog(CNoPython::IDD, pParent)
00044 {
00045     //{{AFX_DATA_INIT(CNoPython)
00046     m_remind = TRUE;
00047     //}}AFX_DATA_INIT
00048 }
00049
00050
00051 void CNoPython::DoDataExchange(CDataExchange* pDX)
00052 {
00053     CDialog::DoDataExchange(pDX);
00054     //{{AFX_DATA_MAP(CNoPython)
00055     DDX_Control(pDX, IDC_PYTHONURL, m_url);
00056     DDX_Check(pDX, IDC_REMIND, m_remind);
00057     //}}AFX_DATA_MAP
00058 }
00059
00060
00061 BEGIN_MESSAGE_MAP(CNoPython, CDialog)
00062     //{{AFX_MSG_MAP(CNoPython)
00063     //}}AFX_MSG_MAP
00064 END_MESSAGE_MAP()
00065
00066
00067 // CNoPython message handlers
00068
00069 BOOL CNoPython::OnInitDialog()
00070 {
00071     CDialog::OnInitDialog();
00072
00073     m_url.SetURL(_T("http://www.python.org"));
00074
00075     return TRUE;  // return TRUE unless you set the focus to a control
00076                   // EXCEPTION: OCX Property Pages should return FALSE
00077 }
00078
00079 void WarnNoPython(void)
00080 {
00081     if((bool)gWarnPython)
00082     {
00083         CNoPython dlg;
00084         dlg.DoModal();
00085         if(!dlg.m_remind)
00086             gWarnPython = false;
00087     }
00088 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/NoPython.h Source File

WinCvs/NoPython.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>
00019  */
00020
00021 #if !defined(AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_)
00022 #define AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // NoPython.h : header file
00028 //
00029
00030 void WarnNoPython(void);
00031
00033 // CNoPython dialog
00034
00035 class CNoPython : public CDialog
00036 {
00037 // Construction
00038 public:
00039     CNoPython(CWnd* pParent = NULL);   // standard constructor
00040
00041 // Dialog Data
00042     //{{AFX_DATA(CNoPython)
00043     enum { IDD = IDD_NOPYTHON };
00044     CCJHyperLink m_url;
00045     BOOL    m_remind;
00046     //}}AFX_DATA
00047
00048
00049 // Overrides
00050     // ClassWizard generated virtual function overrides
00051     //{{AFX_VIRTUAL(CNoPython)
00052     protected:
00053     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00054     //}}AFX_VIRTUAL
00055
00056 // Implementation
00057 protected:
00058
00059     // Generated message map functions
00060     //{{AFX_MSG(CNoPython)
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_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_)
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 IDD_WARNINGDESC                 145
00039 #define IDD_ENTRYDESC                   146
00040 #define IDD_UPDATE_MAIN                 147
00041 #define IDD_UPDATE_STICKY               148
00042 #define IDD_UPDATE_MERGE                149
00043 #define IDD_LOG_MAIN                    150
00044 #define IDD_LOG_FILTERS                 152
00045 #define IDB_SMALLICONS                  152
00046 #define IDD_DIFF_OPTIONS                153
00047 #define IDD_DIFF_MAIN                   154
00048 #define IDD_CHECKOUT_OPTIONS            155
00049 #define IDD_PREFS_WINCVS                156
00050 #define IDR_FILELIST                    157
00051 #define IDD_YESNO                       157
00052 #define IDR_MULTIUSER                   158
00053 #define IDR_GRAPH                       161
00054 #define IDR_STATEICONS                  164
00055 #define IDR_TAGS                        165
00056 #define IDD_INIT_MAIN                   165
00057 #define IDR_WORKSPACE                   173
00058 #define IDB_LOCATE                      176
00059 #define IDD_PROGRESS                    177
00060 #define IDR_MENUICONS                   178
00061 #define IDB_ABOUT                       180
00062 #define IDD_CUSTOMIZE                   181
00063 #define IDR_CUSTMENUS                   182
00064 #define IDB_PYTHON                      183
00065 #define IDD_SAVESETTINGS                184
00066 #define IDB_IDLE                        185
00067 #define IDR_FILTER                      186
00068 #define IDD_COMMIT_OPTIONS              186
00069 #define IDB_HISTLOC                     187
00070 #define IDD_RSH                         188
00071 #define IDD_PSERVER                     189
00072 #define IDD_SSH                         190
00073 #define IDD_PREFS_CVSCMD_DIALOGS        191
00074 #define IDD_ANNOTATE_MAIN               192
00075 #define IDD_GRAPH_OPTIONS               193
00076 #define IDD_PROMPTMESSAGE               194
00077 #define IDD_EDITMESSAGE                 195
00078 #define IDD_ADMINOPTION                 196
00079 #define IDD_EDITORMON                   197
00080 #define IDD_NOPYTHON                    198
00081 #define IDD_TAG_MAIN                    199
00082 #define IDD_RTAG_MAIN                   200
00083 #define IDD_RTAG_OPTIONS                201
00084 #define IDD_GSERVER                     202
00085 #define IDD_STATUS_MAIN                 203
00086 #define IDD_SSPI                        204
00087 #define IDD_ITEM_LIST                   205
00088 #define IDD_LOGIN_MAIN                  206
00089 #define IDR_ITEMLIST                    207
00090 #define IDD_PREFS_CVS                   207
00091 #define IDB_MODULES                     208
00092 #define IDD_RELEASE_MAIN                208
00093 #define IDB_IMPORT                      209
00094 #define IDD_SELECTION_DETAILS           209
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_DISABLESPLASHSCREEN         1006
00109 #define IDC_QUIET                       1007
00110 #define IDC_CTNLADD                     1008
00111 #define IDC_PROMPTEDIT                  1009
00112 #define IDC_ALWAYSROOT                  1009
00113 #define IDC_PASSWD                      1010
00114 #define IDC_LOGOUT                      1010
00115 #define IDC_CMDLINE                     1011
00116 #define IDC_SELFOLDER                   1012
00117 #define IDC_FOLDERLOC                   1013
00118 #define IDC_BTNPATH2                    1014
00119 #define IDC_ALERTCAPTION                1015
00120 #define IDC_ALRTMSG                     1016
00121 #define IDC_CVSVERS                     1017
00122 #define IDC_AUTHEN                      1018
00123 #define IDC_STDOUT                      1019
00124 #define IDC_MODNAME                     1020
00125 #define IDC_BTNPATH                     1021
00126 #define IDC_TAGNAME                     1021
00127 #define IDC_NORECURS                    1022
00128 #define IDC_PATH                        1023
00129 #define IDC_FORCE                       1023
00130 #define IDC_LOGMSG                      1024
00131 #define IDC_OVERWRITE                   1024
00132 #define IDC_SPECIFY_REV                 1024
00133 #define IDC_DELSTICKY                   1025
00134 #define IDC_LOGMSG_WRAP                 1025
00135 #define IDC_VTAG                        1026
00136 #define IDC_CREATEMISSDIR               1026
00137 #define IDC_RHOSTPORT                   1027
00138 #define IDC_CLEANCOPY                   1027
00139 #define IDC_CHECKRHOSTPORT              1028
00140 #define IDC_CHECKPSERVERPORT            1029
00141 #define IDC_PSERVERPORT                 1030
00142 #define IDC_CHECKKSERVERPORT            1031
00143 #define IDC_KSERVERPORT                 1032
00144 #define IDC_CHECKSERVERNAME             1033
00145 #define IDC_SERVERNAME                  1034
00146 #define IDC_COMBOROOT                   1035
00147 #define IDC_CHECKRSHNAME                1035
00148 #define IDC_LISTENTRIES                 1036
00149 #define IDC_SERVERNAME2                 1036
00150 #define IDC_RSHNAME                     1036
00151 #define IDC_COMBORSAIDENTITY            1036
00152 #define IDC_EDITENTRY                   1037
00153 #define IDC_WARNINGDESC                 1038
00154 #define IDC_ENTRYSTATE                  1039
00155 #define IDC_DATE                        1040
00156 #define IDC_ENTRYSTATE3                 1041
00157 #define IDC_ENTRYSTATE4                 1042
00158 #define IDC_COMBOREV                    1043
00159 #define IDC_ENTRYSTATE5                 1043
00160 #define IDC_REV                         1044
00161 #define IDC_COMBODATE1                  1044
00162 #define IDC_MERGE2                      1045
00163 #define IDC_COMBOSTATE                  1046
00164 #define IDC_COMBODATE2                  1046
00165 #define IDC_COMBOREV2                   1047
00166 #define IDC_MERGE                       1048
00167 #define IDC_USER                        1049
00168 #define IDC_NOTAGS                      1050
00169 #define IDC_NOUSERS                     1051
00170 #define IDC_HEADERS                     1051
00171 #define IDC_RTAG                        1052
00172 #define IDC_SUPRESS                     1052
00173 #define IDC_CHECKPATH                   1053
00174 #define IDC_HEADERSDESC                 1053
00175 #define IDC_BTNHOME                     1054
00176 #define IDC_ADD_SELECTION               1054
00177 #define IDC_HOME                        1055
00178 #define IDC_ADD_DEFAULT                 1055
00179 #define IDC_ENTRYSTATE2                 1056
00180 #define IDC_COMBODATE                   1057
00181 #define IDC_ENTRYSTATE6                 1057
00182 #define IDC_MATCH                       1058
00183 #define IDC_MERGE1                      1059
00184 #define IDC_COMBOUSER                   1060
00185 #define IDC_DEFBRANCH                   1061
00186 #define IDC_STATE                       1062
00187 #define IDC_ONLYRCS                     1063
00188 #define IDC_ISDATE1                     1064
00189 #define IDC_ISDATE2                     1065
00190 #define IDC_COMBOREV1                   1069
00191 #define IDC_BTNPROGRAM                  1070
00192 #define IDC_COMBORTAG                   1070
00193 #define IDC_PROGRAM                     1071
00194 #define IDC_BAR_TREE                    1072
00195 #define IDC_BTNSETTINGS                 1073
00196 #define IDC_ATTIC                       1075
00197 #define IDC_EXTDIFF                     1076
00198 #define IDC_EXTDIFFSEL                  1077
00199 #define IDC_DIFFPROG                    1078
00200 #define IDC_CHECKUNMOD                  1079
00201 #define IDC_EDIT_POSITION               1079
00202 #define IDC_ALTCVSCHK                   1079
00203 #define IDC_ALTCVSPROG                  1080
00204 #define IDC_COMBO                       1081
00205 #define IDC_ALTCVSSEL                   1081
00206 #define IDC_WINCVSVER                   1082
00207 #define IDC_SPINLOGOUT                  1083
00208 #define IDC_EDITLOGOUT                  1084
00209 #define IDC_CHECKPROXY                  1085
00210 #define IDC_EDITHOST                    1086
00211 #define IDC_EDITPORT                    1087
00212 #define IDC_FORCEROOT                   1088
00213 #define IDC_EXPORT                      1089
00214 #define IDC_HELPINIT                    1090
00215 #define IDC_LOCATE                      1091
00216 #define IDC_PROGRESS                    1093
00217 #define IDC_ZLEVEL                      1095
00218 #define IDC_ZSPIN                       1096
00219 #define IDC_RSAIDENTITYSEL              1097
00220 #define IDC_WINCVSURL                   1097
00221 #define IDC_RSAIDENTITY                 1098
00222 #define IDC_ALLCMDS                     1098
00223 #define IDC_CVSGUISFURL                 1098
00224 #define IDC_CMDMENU                     1099
00225 #define IDC_ADD                         1101
00226 #define IDC_REMOVE                      1102
00227 #define IDC_UP                          1103
00228 #define IDC_DELALL                      1103
00229 #define IDC_DOWN                        1104
00230 #define IDC_DELCVSINFO                  1104
00231 #define IDC_MENULIST                    1106
00232 #define IDC_LAUNCHEDITOR                1109
00233 #define IDC_WORDWRAP                    1110
00234 #define IDC_TEMPLATE                    1111
00235 #define IDC_DELETED                     1113
00236 #define IDC_IGNOREWHITESPACE            1118
00237 #define IDC_IGNORECASE                  1119
00238 #define IDC_DIRECTORY                   1120
00239 #define IDC_UNIFIEDDIFF                 1120
00240 #define IDC_EDIT_CHECKOUTDIR            1121
00241 #define IDC_CHECK_OVERRIDECHECKOUTDIR   1122
00242 #define IDC_USE_VIEWER_ALWAYS           1125
00243 #define IDC_USEDEFIGNORE                1127
00244 #define IDC_FORCECOMMIT                 1128
00245 #define IDC_USEFILESTIME                1128
00246 #define IDC_FORCERECURSE                1129
00247 #define IDC_FORCEREVISION               1130
00248 #define IDC_NOMODULEPROGRAM             1131
00249 #define IDC_COMBOVTAG                   1132
00250 #define IDC_CHECKVALIDEDITS             1132
00251 #define IDC_COMBOMODNAME                1133
00252 #define IDC_HOST                        1135
00253 #define IDC_LOGIN                       1136
00254 #define IDC_SETTINGS                    1137
00255 #define IDC_AUTHENDESC                  1138
00256 #define IDC_CHECKUPDATE                 1139
00257 #define IDC_CHECKDIFF                   1140
00258 #define IDC_CHECKGRAPH                  1141
00259 #define IDC_CHECKLOG                    1142
00260 #define IDC_RADIOSHIFT                  1143
00261 #define IDC_RADIOCONTROL                1144
00262 #define IDC_CONSOLE                     1144
00263 #define IDC_ISDATE                      1145
00264 #define IDC_CHECKANNOTATE               1145
00265 #define IDC_COMBO_REV                   1146
00266 #define IDC_CHECKSTATUS                 1146
00267 #define IDC_DIFF                        1147
00268 #define IDC_FILETODIFF                  1148
00269 #define IDC_APPLY                       1149
00270 #define IDC_RESET                       1150
00271 #define IDC_HEADER                      1152
00272 #define IDC_TAG                         1153
00273 #define IDC_RGBHEADER                   1154
00274 #define IDC_RGBTAG                      1155
00275 #define IDC_RGBBRANCH                   1156
00276 #define IDC_RGBNODE                     1157
00277 #define IDC_RGBDEAD                     1158
00278 #define IDC_RGBSTATE                    1159
00279 #define IDC_BRANCH                      1160
00280 #define IDC_NODE                        1161
00281 #define IDC_SELECTION                   1162
00282 #define IDC_SHADOW                      1163
00283 #define IDC_DEAD                        1164
00284 #define IDC_RGBSELECTION                1165
00285 #define IDC_RGBSHADOW                   1166
00286 #define IDC_OPTIONSTRING                1167
00287 #define IDC_OPTIONDESC                  1168
00288 #define IDC_OPTIONSTRING_SL             1169
00289 #define IDC_TEMPFILE                    1170
00290 #define IDC_REMIND                      1171
00291 #define IDC_PYTHONURL                   1172
00292 #define IDC_PREVIEWINFO                 1173
00293 #define IDC_PREVCMD                     1175
00294 #define IDC_CHECKDATE1                  1177
00295 #define IDC_CHECKDATE2                  1178
00296 #define IDC_GRPBOX_TEXT                 1179
00297 #define IDC_TAGDESC_TEXT                1180
00298 #define IDC_MODULEDESC_TEXT             1181
00299 #define IDC_OUTPUT_QUICK                1182
00300 #define IDC_OUTPUT_VERBOSE              1183
00301 #define IDC_BROWSE_TAG                  1183
00302 #define IDC_OUTPUT_STANDARD             1184
00303 #define IDC_TAG_LIST                    1184
00304 #define IDC_BROWSE_READFROM             1184
00305 #define IDC_BROWSE_TAG1                 1185
00306 #define IDC_BROWSE_TAG2                 1186
00307 #define IDC_MODULE_LIST                 1186
00308 #define IDC_BROWSE_MODULES              1187
00309 #define IDC_ITEMLIST                    1191
00310 #define IDC_REFRESH                     1192
00311 #define IDC_READFROM                    1193
00312 #define IDC_ITEM                        1195
00313 #define IDC_ITEMLABEL                   1196
00314 #define IDC_OPTION                      1197
00315 #define IDC_CHECKDATE                   1198
00316 #define IDC_CHECKREV                    1199
00317 #define IDC_GROUP_OPTIONS               1200
00318 #define IDC_HELPLOGIN                   1201
00319 #define IDC_COMPARE_TYPE                1202
00320 #define IDC_KEYWORDSUBSTITUTION         1203
00321 #define IDC_KEYWORDDESC                 1204
00322 #define IDC_DIFFOPTIONS                 1205
00323 #define IDC_OPTIONSMENU                 1206
00324 #define IDC_ALTSETTINGSCHK              1207
00325 #define IDC_MODULE                      1209
00326 #define IDC_DELDIR                      1209
00327 #define IDC_PROGRESS_TEXT               1210
00328 #define IDC_SELECTIONLIST               1212
00329 #define IDC_FILENAME                    1214
00330 #define IDC_REVISION_SPIN               1215
00331 #define IDC_REVISION                    1216
00332 #define IDC_AUTO_REFRESH                1216
00333 #define IDC_CURRENT_OPTIONS             1386
00334 #define IDC_OPTIONSLIST                 1388
00335 #define IDC_OPTIONDETAILS               1390
00336 #define IDC_STATICGROUP_SELECTOPTIONS   1417
00337 #define IDC_STATIC_CURRENTOPTIONS       1418
00338 #define IDC_STATIC_OPTDESC              1419
00339 #define ID_CANCEL_EDIT_CNTR             32768
00340 #define ID_APP_PREFERENCES              32775
00341 #define ID_APP_CMDLINE                  32776
00342 #define ID_APP_LOGIN                    32779
00343 #define ID_STOPCVS                      32795
00344 #define ID_BROWSER_OPEN                 32797
00345 #define ID_VIEW_BROWSER_BAR             32798
00346 #define ID_UPDATEBF                     32799
00347 #define ID_COMMITBF                     32800
00348 #define ID_ADDBF                        32801
00349 #define ID_VIEW_SMALLICONS              32802
00350 #define ID_VIEW_FULLLIST                32803
00351 #define ID_VIEW_ROWDETAILS              32804
00352 #define ID_VIEW_FILES_BAR               32805
00353 #define ID_VIEW_UPDATE                  32806
00354 #define ID_VIEW_COMMIT                  32807
00355 #define ID_VIEW_ADD                     32808
00356 #define ID_VIEW_WORKSPACE               32809
00357 #define ID_MENUBAR                      32810
00358 #define ID_VIEW_ADDB                    32811
00359 #define ID_VIEW_RMV                     32812
00360 #define IDS_COMBOBROWSER                32813
00361 #define ID_VIEW_RELOAD                  32814
00362 #define ID_VIEW_UPONE                   32826
00363 #define ID_VIEW_TRASH                   32830
00364 #define ID_VIEW_DIFF                    32833
00365 #define ID_VIEW_LOG                     32834
00366 #define ID_VIEW_STATUS                  32835
00367 #define ID_VIEW_LOCKF                   32836
00368 #define ID_VIEW_UNLOCKF                 32837
00369 #define ID_VIEW_MULTI_BAR               32838
00370 #define ID_MENUITEM32840                32840
00371 #define ID_VIEW_WATCHON                 32843
00372 #define ID_VIEW_WATCHOFF                32844
00373 #define ID_VIEW_EDIT                    32845
00374 #define ID_VIEW_UNEDIT                  32846
00375 #define ID_VIEW_RELEASE                 32847
00376 #define ID_VIEW_WATCHERS                32857
00377 #define ID_VIEW_EDITORS                 32858
00378 #define ID_CUST_FILES_MENU              32859
00379 #define ID_CUST_FOLDER_MENU             32860
00380 #define ID_APP_CREDITS                  32872
00381 #define ID_APP_COPYRIGHTS               32873
00382 #define ID_GRAPH_CLOSE                  32874
00383 #define ID_VIEW_GRAPH                   32875
00384 #define ID_APP_RTAGCREATE               32881
00385 #define ID_APP_RTAGDELETE               32882
00386 #define ID_APP_RTAGBRANCH               32883
00387 #define ID_VIEW_TAG                     32884
00388 #define ID_VIEW_TAGNEW                  32886
00389 #define ID_VIEW_TAGDELETE               32887
00390 #define ID_VIEW_TAGBRANCH               32888
00391 #define ID_VIEW_TAGS_BAR                32889
00392 #define ID_VIEW_CONSOLE_BAR             32898
00393 #define ID_VIEW_EXPLORE                 32899
00394 #define ID_HISTORYBROWSE                32900
00395 #define ID_VIEW_QUERYUPDATE             32901
00396 #define ID_VIEW_IGNORE                  32902
00397 #define ID_HELP_CVS                     32903
00398 #define ID_HELP_CVSCLIENT               32904
00399 #define ID_APP_LOGOUT                   32906
00400 #define ID_VIEW_EDITSEL                 32908
00401 #define ID_VIEW_EDITSELDEF              32909
00402 #define ID_ACCEL32911                   32911
00403 #define ID_VIEWW_INIT                   32912
00404 #define ID_VIEW_IMPORT                  32913
00405 #define ID_VIEW_INIT                    32914
00406 #define ID_VIEW_CHECKOUT                32915
00407 #define ID_VIEW_DELREV                  32916
00408 #define ID_VIEW_SELNONSIG               32917
00409 #define ID_BUTTON32918                  32918
00410 #define ID_BUTTON32919                  32919
00411 #define ID_BUTTON32920                  32920
00412 #define ID_BUTTON32921                  32921
00413 #define ID_SAVESETTINGS                 32922
00414 #define ID_VIEW_RETRIEVE                32923
00415 #define ID_VIEW_RECURSIVE               32924
00416 #define ID_VIEW_FILTER_BAR              32925
00417 #define ID_VIEW_MODIFIED                32927
00418 #define ID_FILTERMASK                   32928
00419 #define ID_VIEW_CONFLICT                32929
00420 #define ID_VIEW_UNKNOWN                 32931
00421 #define ID_VIEW_MISSING                 32932
00422 #define ID_VIEW_ADDED                   32935
00423 #define ID_VIEW_REMOVED                 32936
00424 #define ID_VIEW_CHANGED                 32937
00425 #define ID_VIEW_HIDEUNKNOWN             32938
00426 #define ID_BUTTON32940                  32940
00427 #define ID_QUERY_ANNOTATE               32941
00428 #define ID_VIEW_BROWSELOCATION_REMOVEUNWANTED 32943
00429 #define ID_USE_TCLSHELL                 32944
00430 #define ID_USE_PYSHELL                  32945
00431 #define ID_GRAPH_GRAPHOPTIONS           32946
00432 #define ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE 32950
00433 #define ID_GRAPH_ADMINOPTIONS_SETSTATE  32951
00434 #define ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION 32952
00435 #define ID_GRAPH_CHANGELOGMESSAGE       32954
00436 #define ID_GRAPH_SETSTATE               32955
00437 #define ID_GRAPH_SETDESCRIPTION         32956
00438 #define ID_VIEW_RESERVEDEDIT            32957
00439 #define ID_VIEW_FORCEEDIT               32958
00440 #define ID_VIEW_ADDU                    32960
00441 #define ID_MACRO_START                  34000
00442 #define ID_MACRO_SEL                    34100
00443 #define ID_MACRO_ADMIN                  34200
00444 #define ID_MACRO_END                    34200
00445
00446 // Next default values for new objects
00447 //
00448 #ifdef APSTUDIO_INVOKED
00449 #ifndef APSTUDIO_READONLY_SYMBOLS
00450 #define _APS_3D_CONTROLS                     1
00451 #define _APS_NEXT_RESOURCE_VALUE        210
00452 #define _APS_NEXT_COMMAND_VALUE         32973
00453 #define _APS_NEXT_CONTROL_VALUE         1217
00454 #define _APS_NEXT_SYMED_VALUE           113
00455 #endif
00456 #endif
Generated on Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/SortHeaderCtrl.cpp Source File

WinCvs/SortHeaderCtrl.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>
00019  */
00020
00021 #include "stdafx.h"
00022 #include "SortHeaderCtrl.h"
00023
00025 // CSortHeaderCtrl
00026
00027 IMPLEMENT_DYNAMIC(CSortHeaderCtrl, CHeaderCtrl)
00028
00029 BEGIN_MESSAGE_MAP(CSortHeaderCtrl, CHeaderCtrl)
00030     //{{AFX_MSG_MAP(CSortHeaderCtrl)
00031     //}}AFX_MSG_MAP
00032 END_MESSAGE_MAP()
00033
00034 CSortHeaderCtrl::CSortHeaderCtrl()
00035 {
00036     m_bSortAsc  = TRUE;
00037     m_nSortCol  = -1;
00038 }
00039
00040 CSortHeaderCtrl::~CSortHeaderCtrl()
00041 {
00042 }
00043
00044 int CSortHeaderCtrl::SetSortImage(int nCol, BOOL bAsc)
00045 {
00046     int nPrevCol = m_nSortCol;
00047
00048     m_nSortCol = nCol;
00049     m_bSortAsc = bAsc;
00050
00051     // Change the item to ownder drawn
00052     HD_ITEM hditem;
00053
00054     hditem.mask = HDI_FORMAT;
00055     GetItem( nCol, &hditem );
00056     hditem.fmt |= HDF_OWNERDRAW;
00057     SetItem( nCol, &hditem );
00058
00059     // Invalidate header control so that it gets redrawn
00060     Invalidate();
00061
00062     return nPrevCol;
00063 }
00064
00065 void CSortHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
00066 {
00067     CDC dc;
00068
00069     dc.Attach( lpDrawItemStruct->hDC );
00070
00071     // Get the column rect
00072     CRect rcLabel( lpDrawItemStruct->rcItem );
00073
00074     // Save DC
00075     int nSavedDC = dc.SaveDC();
00076
00077     // Set clipping region to limit drawing within column
00078     CRgn rgn;
00079     rgn.CreateRectRgnIndirect( &rcLabel );
00080     dc.SelectObject( &rgn );
00081     rgn.DeleteObject();
00082
00083     // Draw the background
00084     dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
00085
00086     // Labels are offset by a certain amount
00087     // This offset is related to the width of a space character
00088     int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2;
00089
00090     // Get the column text and format
00091     TCHAR buf[256];
00092     HD_ITEM hditem;
00093
00094     hditem.mask = HDI_TEXT | HDI_FORMAT;
00095     hditem.pszText = buf;
00096     hditem.cchTextMax = 255;
00097
00098     GetItem( lpDrawItemStruct->itemID, &hditem );
00099
00100     // Determine format for drawing column label
00101     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00102                         | DT_VCENTER | DT_END_ELLIPSIS ;
00103
00104     if( hditem.fmt & HDF_CENTER)
00105         uFormat |= DT_CENTER;
00106     else if( hditem.fmt & HDF_RIGHT)
00107         uFormat |= DT_RIGHT;
00108     else
00109         uFormat |= DT_LEFT;
00110
00111     // Adjust the rect if the mouse button is pressed on it
00112     if( lpDrawItemStruct->itemState == ODS_SELECTED )
00113     {
00114         rcLabel.left++;
00115         rcLabel.top += 2;
00116         rcLabel.right++;
00117     }
00118
00119     // Adjust the rect further if Sort arrow is to be displayed
00120     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00121     {
00122         rcLabel.right -= 3 * offset;
00123     }
00124
00125     rcLabel.left += offset;
00126     rcLabel.right -= offset;
00127
00128     // Draw column label
00129     if( rcLabel.left < rcLabel.right )
00130         dc.DrawText(buf,-1,rcLabel, uFormat);
00131
00132     // Draw the Sort arrow
00133     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00134     {
00135         CRect rcIcon( lpDrawItemStruct->rcItem );
00136
00137         // Set up pens to use for drawing the triangle
00138         CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00139         CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00140         CPen *pOldPen = dc.SelectObject( &penLight );
00141
00142         offset = (rcIcon.bottom - rcIcon.top) / 4;
00143         if (m_bSortAsc)
00144         {
00145             // Draw triangle pointing upwards
00146             dc.MoveTo( rcIcon.right - 2* offset, offset);
00147             dc.LineTo( rcIcon.right - offset, rcIcon.bottom - offset-1 );
00148             dc.LineTo( rcIcon.right - 3*offset-2, rcIcon.bottom - offset-1 );
00149             dc.MoveTo( rcIcon.right - 3*offset-1, rcIcon.bottom - offset-1 );
00150             dc.SelectObject( &penShadow );
00151             dc.LineTo( rcIcon.right - 2*offset, offset-1);
00152         }
00153         else
00154         {
00155             // Draw triangle pointing downwards
00156             dc.MoveTo( rcIcon.right - offset-1, offset);
00157             dc.LineTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset );
00158             dc.MoveTo( rcIcon.right - 2*offset-2, rcIcon.bottom - offset );
00159             dc.SelectObject( &penShadow );
00160             dc.LineTo( rcIcon.right - 3*offset-1, offset );
00161             dc.LineTo( rcIcon.right - offset-1, offset);
00162         }
00163
00164         // Restore the pen
00165         dc.SelectObject( pOldPen );
00166     }
00167
00168     // Restore dc
00169     dc.RestoreDC( nSavedDC );
00170
00171     // Detach the dc before returning
00172     dc.Detach();
00173 }
00174
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/SortHeaderCtrl.h Source File

WinCvs/SortHeaderCtrl.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>
00019  */
00020
00021 #ifndef __SORTHEADERCTRL_H__
00022 #define __SORTHEADERCTRL_H__
00023
00024
00026 // CSortHeaderCtrl
00027
00028 class CSortHeaderCtrl : public CHeaderCtrl
00029 {
00030     DECLARE_DYNAMIC(CSortHeaderCtrl)
00031
00032 // Construction
00033 public:
00034     CSortHeaderCtrl();
00035
00036 // Attributes
00037 protected:
00038     int     m_nSortCol;
00039     BOOL    m_bSortAsc;
00040
00041 // Operations
00042 public:
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CSortHeaderCtrl)
00047     //}}AFX_VIRTUAL
00048
00049     virtual void    DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00050     virtual int     SetSortImage(int nCol, BOOL bAsc);
00051
00052 // Implementation
00053 public:
00054     virtual ~CSortHeaderCtrl();
00055
00056 // Generated message map functions
00057 protected:
00058     //{{AFX_MSG(CSortHeaderCtrl)
00059     //}}AFX_MSG
00060
00061     DECLARE_MESSAGE_MAP()
00062 };
00063
00064 #endif
00065 // __SORTHEADERCTRL_H__
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/Splash.cpp Source File

WinCvs/Splash.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>
00019  */
00020
00021 // CG: This file was added by the Splash Screen component.
00022 // Splash.cpp : implementation file
00023 //
00024
00025 #include "stdafx.h"  // e. g. stdafx.h
00026 #include "resource.h"  // e.g. resource.h
00027
00028 #include "Splash.h"  // e.g. splash.h
00029 #include "wincvs.h"  // e.g. splash.h
00030 #include "CPStr.h"  // e.g. splash.h
00031
00032 #ifdef _DEBUG
00033 #define new DEBUG_NEW
00034 #undef THIS_FILE
00035 static char BASED_CODE THIS_FILE[] = __FILE__;
00036 #endif
00037
00038 // right margin of the bitmap
00039 namespace
00040 {
00041 const int gc_nBitmapRightMargin(519 - 491);
00042 }
00043
00045 //   Splash Screen class
00046
00047 BOOL CSplashWnd::c_bShowSplashWnd;
00048 CSplashWnd* CSplashWnd::c_pSplashWnd;
00049 CSplashWnd::CSplashWnd()
00050 {
00051 }
00052
00053 CSplashWnd::~CSplashWnd()
00054 {
00055     // Clear the static window pointer.
00056     ASSERT(c_pSplashWnd == this);
00057     c_pSplashWnd = NULL;
00058 }
00059
00060 BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
00061     //{{AFX_MSG_MAP(CSplashWnd)
00062     ON_WM_CREATE()
00063     ON_WM_PAINT()
00064     ON_WM_TIMER()
00065     //}}AFX_MSG_MAP
00066 END_MESSAGE_MAP()
00067
00068 void CSplashWnd::EnableSplashScreen(BOOL bEnable /*= TRUE*/)
00069 {
00070     c_bShowSplashWnd = bEnable;
00071 }
00072
00073 void CSplashWnd::ShowSplashScreen(CWnd* pParentWnd /*= NULL*/)
00074 {
00075     if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
00076         return;
00077
00078     // Allocate a new splash screen, and create the window.
00079     c_pSplashWnd = new CSplashWnd;
00080     if (!c_pSplashWnd->Create(pParentWnd))
00081         delete c_pSplashWnd;
00082     else
00083         c_pSplashWnd->UpdateWindow();
00084 }
00085
00086 BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg)
00087 {
00088     if (c_pSplashWnd == NULL)
00089         return FALSE;
00090
00091     // If we get a keyboard or mouse message, hide the splash screen.
00092     if (pMsg->message == WM_KEYDOWN ||
00093         pMsg->message == WM_SYSKEYDOWN ||
00094         pMsg->message == WM_LBUTTONDOWN ||
00095         pMsg->message == WM_RBUTTONDOWN ||
00096         pMsg->message == WM_MBUTTONDOWN ||
00097         pMsg->message == WM_NCLBUTTONDOWN ||
00098         pMsg->message == WM_NCRBUTTONDOWN ||
00099         pMsg->message == WM_NCMBUTTONDOWN)
00100     {
00101         c_pSplashWnd->HideSplashScreen();
00102         return TRUE;    // message handled here
00103     }
00104
00105     return FALSE;   // message not handled
00106 }
00107
00108 BOOL CSplashWnd::Create(CWnd* pParentWnd /*= NULL*/)
00109 {
00110     if (!m_bitmap.LoadBitmap(IDB_SPLASH))
00111         return FALSE;
00112
00113     BITMAP bm;
00114     m_bitmap.GetBitmap(&bm);
00115
00116     return CreateEx(0,
00117         AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
00118         NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
00119 }
00120
00121 void CSplashWnd::HideSplashScreen()
00122 {
00123     // Destroy the window, and update the mainframe.
00124     DestroyWindow();
00125     AfxGetMainWnd()->UpdateWindow();
00126 }
00127
00128 void CSplashWnd::PostNcDestroy()
00129 {
00130     // Free the C++ class.
00131     delete this;
00132 }
00133
00134 int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
00135 {
00136     if (CWnd::OnCreate(lpCreateStruct) == -1)
00137         return -1;
00138
00139     // Center the window.
00140     CenterWindow();
00141
00142     // Set a timer to destroy the splash screen.
00143     SetTimer(1, 750, NULL);
00144
00145     return 0;
00146 }
00147
00148 void CSplashWnd::OnPaint()
00149 {
00150     CPaintDC dc(this);
00151
00152     CDC dcImage;
00153     if (!dcImage.CreateCompatibleDC(&dc))
00154         return;
00155
00156     BITMAP bm;
00157     m_bitmap.GetBitmap(&bm);
00158
00159     // Paint the image.
00160     CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
00161     dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
00162     dcImage.SelectObject(pOldBitmap);
00163
00164     // Get version information from the application
00165     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00166     CStr vers;
00167
00168     if(app->GetAppVersion(vers))
00169     {
00170         dc.SetBkMode(TRANSPARENT);
00171         dc.SetTextAlign(TA_RIGHT | TA_TOP);
00172         dc.TextOut(bm.bmWidth - gc_nBitmapRightMargin - 10, 219, vers, vers.length());
00173     }
00174 }
00175
00176 void CSplashWnd::OnTimer(UINT nIDEvent)
00177 {
00178     // Destroy the splash screen window.
00179     HideSplashScreen();
00180 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/Splash.h Source File

WinCvs/Splash.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>
00019  */
00020
00021 // CG: This file was added by the Splash Screen component.
00022
00023 #ifndef _SPLASH_SCRN_
00024 #define _SPLASH_SCRN_
00025
00026 // Splash.h : header file
00027 //
00028
00030 //   Splash Screen class
00031
00032 class CSplashWnd : public CWnd
00033 {
00034 // Construction
00035 protected:
00036     CSplashWnd();
00037
00038 // Attributes:
00039 public:
00040     CBitmap m_bitmap;
00041
00042 // Operations
00043 public:
00044     static void EnableSplashScreen(BOOL bEnable = TRUE);
00045     static void ShowSplashScreen(CWnd* pParentWnd = NULL);
00046     static BOOL PreTranslateAppMessage(MSG* pMsg);
00047
00048 // Overrides
00049     // ClassWizard generated virtual function overrides
00050     //{{AFX_VIRTUAL(CSplashWnd)
00051     //}}AFX_VIRTUAL
00052
00053 // Implementation
00054 public:
00055     ~CSplashWnd();
00056     virtual void PostNcDestroy();
00057
00058 protected:
00059     BOOL Create(CWnd* pParentWnd = NULL);
00060     void HideSplashScreen();
00061     static BOOL c_bShowSplashWnd;
00062     static CSplashWnd* c_pSplashWnd;
00063
00064 // Generated message map functions
00065 protected:
00066     //{{AFX_MSG(CSplashWnd)
00067     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00068     afx_msg void OnPaint();
00069     afx_msg void OnTimer(UINT nIDEvent);
00070     //}}AFX_MSG
00071     DECLARE_MESSAGE_MAP()
00072 };
00073
00074
00075 #endif
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/Stat.cpp Source File

WinCvs/Stat.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>
00019  */
00020
00021 #include <stdafx.h>
00022 #include <errno.h>
00023 #include <io.h>
00024 #include "AppConsole.h"
00025 #include "wincvsdebug.h"
00026
00027 static struct { DWORD err; int dos;} errors[] =
00028 {
00029         {  ERROR_INVALID_FUNCTION,       EINVAL    },  /* 1 */
00030         {  ERROR_FILE_NOT_FOUND,         ENOENT    },  /* 2 */
00031         {  ERROR_PATH_NOT_FOUND,         ENOENT    },  /* 3 */
00032         {  ERROR_TOO_MANY_OPEN_FILES,    EMFILE    },  /* 4 */
00033         {  ERROR_ACCESS_DENIED,          EACCES    },  /* 5 */
00034         {  ERROR_INVALID_HANDLE,         EBADF     },  /* 6 */
00035         {  ERROR_ARENA_TRASHED,          ENOMEM    },  /* 7 */
00036         {  ERROR_NOT_ENOUGH_MEMORY,      ENOMEM    },  /* 8 */
00037         {  ERROR_INVALID_BLOCK,          ENOMEM    },  /* 9 */
00038         {  ERROR_BAD_ENVIRONMENT,        E2BIG     },  /* 10 */
00039         {  ERROR_BAD_FORMAT,             ENOEXEC   },  /* 11 */
00040         {  ERROR_INVALID_ACCESS,         EINVAL    },  /* 12 */
00041         {  ERROR_INVALID_DATA,           EINVAL    },  /* 13 */
00042         {  ERROR_INVALID_DRIVE,          ENOENT    },  /* 15 */
00043         {  ERROR_CURRENT_DIRECTORY,      EACCES    },  /* 16 */
00044         {  ERROR_NOT_SAME_DEVICE,        EXDEV     },  /* 17 */
00045         {  ERROR_NO_MORE_FILES,          ENOENT    },  /* 18 */
00046         {  ERROR_LOCK_VIOLATION,         EACCES    },  /* 33 */
00047         {  ERROR_BAD_NETPATH,            ENOENT    },  /* 53 */
00048         {  ERROR_NETWORK_ACCESS_DENIED,  EACCES    },  /* 65 */
00049         {  ERROR_BAD_NET_NAME,           ENOENT    },  /* 67 */
00050         {  ERROR_FILE_EXISTS,            EEXIST    },  /* 80 */
00051         {  ERROR_CANNOT_MAKE,            EACCES    },  /* 82 */
00052         {  ERROR_FAIL_I24,               EACCES    },  /* 83 */
00053         {  ERROR_INVALID_PARAMETER,      EINVAL    },  /* 87 */
00054         {  ERROR_NO_PROC_SLOTS,          EAGAIN    },  /* 89 */
00055         {  ERROR_DRIVE_LOCKED,           EACCES    },  /* 108 */
00056         {  ERROR_BROKEN_PIPE,            EPIPE     },  /* 109 */
00057         {  ERROR_DISK_FULL,              ENOSPC    },  /* 112 */
00058         {  ERROR_INVALID_TARGET_HANDLE,  EBADF     },  /* 114 */
00059         {  ERROR_INVALID_HANDLE,         EINVAL    },  /* 124 */
00060         {  ERROR_WAIT_NO_CHILDREN,       ECHILD    },  /* 128 */
00061         {  ERROR_CHILD_NOT_COMPLETE,     ECHILD    },  /* 129 */
00062         {  ERROR_DIRECT_ACCESS_HANDLE,   EBADF     },  /* 130 */
00063         {  ERROR_NEGATIVE_SEEK,          EINVAL    },  /* 131 */
00064         {  ERROR_SEEK_ON_DEVICE,         EACCES    },  /* 132 */
00065         {  ERROR_DIR_NOT_EMPTY,          ENOTEMPTY },  /* 145 */
00066         {  ERROR_NOT_LOCKED,             EACCES    },  /* 158 */
00067         {  ERROR_BAD_PATHNAME,           ENOENT    },  /* 161 */
00068         {  ERROR_MAX_THRDS_REACHED,      EAGAIN    },  /* 164 */
00069         {  ERROR_LOCK_FAILED,            EACCES    },  /* 167 */
00070         {  ERROR_ALREADY_EXISTS,         EEXIST    },  /* 183 */
00071         {  ERROR_FILENAME_EXCED_RANGE,   ENOENT    },  /* 206 */
00072         {  ERROR_NESTING_NOT_ALLOWED,    EAGAIN    },  /* 215 */
00073         {  ERROR_NOT_ENOUGH_QUOTA,       ENOMEM    }    /* 1816 */
00074 };
00075
00076 static const WORD month_len [12] =
00077 {
00078     31, /* Jan */
00079     28, /* Feb */
00080     31, /* Mar */
00081     30, /* Apr */
00082     31, /* May */
00083     30, /* Jun */
00084     31, /* Jul */
00085     31, /* Aug */
00086     30, /* Sep */
00087     31, /* Oct */
00088     30, /* Nov */
00089     31  /* Dec */
00090 };
00091
00092 static const char * month_names[12] =
00093 {
00094     "Jan", "Feb", "Mar", "Apr",
00095     "May", "Jun", "Jul", "Aug",
00096     "Sep", "Oct", "Nov", "Dec"
00097 };
00098
00099 /* One second = 10,000,000 * 100 nsec */
00100     static const ULONGLONG systemtime_second = 10000000L;
00101
00102
00103 static void _dosmaperr(DWORD dwErr)
00104 {
00105     int n;
00106     for(n=0; n<sizeof(errors)/sizeof(errors[0]); n++)
00107     {
00108         if(errors[n].err==dwErr)
00109         {
00110             errno=errors[n].dos;
00111             return;
00112         }
00113     }
00114     errno=EFAULT;
00115 }
00116
00117 /* Is the year a leap year?
00118  *
00119  * Use standard Gregorian: every year divisible by 4
00120  * except centuries indivisible by 400.
00121  *
00122  * INPUTS: WORD year the year (AD)
00123  *
00124  * OUTPUTS: TRUE if it's a leap year.
00125  */
00126 BOOL IsLeapYear ( WORD year )
00127 {
00128     return ( (year & 3u == 0)
00129             && ( (year % 100u == 0)
00130                 || (year % 400u == 0) ));
00131 }
00132
00133 /* A fairly complicated comparison:
00134  *
00135  * Compares a test date against a target date.
00136  * If the test date is earlier, return a negative number
00137  * If the test date is later, return a positive number
00138  * If the two dates are equal, return zero.
00139  *
00140  * The comparison is complicated by the way we specify
00141  * TargetDate.
00142  *
00143  * TargetDate is assumed to be the kind of date used in
00144  * TIME_ZONE_INFORMATION.DaylightDate: If wYear is 0,
00145  * then it's a kind of code for things like 1st Sunday
00146  * of the month. As described in the Windows API docs,
00147  * wDay is an index of week:
00148  *      1 = first of month
00149  *      2 = second of month
00150  *      3 = third of month
00151  *      4 = fourth of month
00152  *      5 = last of month (even if there are only four such days).
00153  *
00154  * Thus, if wYear = 0, wMonth = 4, wDay = 2, wDayOfWeek = 4
00155  * it specifies the second Thursday of April.
00156  *
00157  * INPUTS: SYSTEMTIME * p_test_date     The date to be tested
00158  *
00159  *         SYSTEMTIME * p_target_date   The target date. This should be in
00160  *                                      the format for a TIME_ZONE_INFORMATION
00161  *                                      DaylightDate or StandardDate.
00162  *
00163  * OUTPUT:  -4/+4 if test month is less/greater than target month
00164  *          -2/+2 if test day is less/greater than target day
00165  *          -1/+2 if test hour:minute:seconds.milliseconds less/greater than target
00166  *          0     if both dates/times are equal.
00167  *
00168  */
00169 static int CompareTargetDate (
00170     const SYSTEMTIME * p_test_date,
00171     const SYSTEMTIME * p_target_date
00172     )
00173 {
00174     WORD first_day_of_month; /* day of week of the first. Sunday = 0 */
00175     WORD end_of_month;       /* last day of month */
00176     WORD temp_date;
00177     int test_milliseconds, target_milliseconds;
00178
00179     /* Check that p_target_date is in the correct foramt: */
00180     ASSERT(p_target_date->wYear==0 && p_test_date->wYear != 0);
00181     if (p_target_date->wYear != 0 || p_test_date->wYear == 0)
00182         return 0;
00183
00184     /* Don't waste time calculating if we can shortcut the comparison... */
00185     if (p_test_date->wMonth != p_target_date->wMonth)
00186     {
00187         return (p_test_date->wMonth > p_target_date->wMonth) ? 4 : -4;
00188     }
00189
00190     /* Months equal. Now we neet to do some calculation.
00191      * If we know that y is the day of the week for some arbitrary date x,
00192      * then the day of the week of the first of the month is given by
00193      * (1 + y - x) mod 7.
00194      *
00195      * For instance, if the 19th is a Wednesday (day of week = 3), then
00196      * the date of the first Wednesday of the month is (19 mod 7) = 5.
00197      * If the 5th is a Wednesday (3), then the first of the month is
00198      * four days earlier (it's the first, not the zeroth):
00199      * (3 - 4) = -1; -1 mod 7 = 6. The first is a Saturday.
00200      *
00201      * Check ourselves: The 19th falls on a (6 + 19 - 1) mod 7
00202      * = 24 mod 7 = 3: Wednesday, as it should be.
00203      */
00204     first_day_of_month = (WORD)( (1u + p_test_date->wDayOfWeek - p_test_date->wDay) % 7u);
00205
00206     /* If the first of the month comes on day y, then the first day of week z falls on
00207      * (z - y + 1) mod 7.
00208      *
00209      * For instance, if the first is a Saturday (6), then the first Tuesday (2) falls on a
00210      * (2 - 6 + 1) mod 7 = -3 mod 7 = 4: The fourth. This is correct (see above).
00211      *
00212      * temp_date gets the first <target day of week> in the month.
00213      */
00214     temp_date = (WORD)( (1u + p_target_date->wDayOfWeek - first_day_of_month) % 7u);
00215     /* If we're looking for the third Tuesday in the month, find the date of the first
00216      * Tuesday and add (3 - 1) * 7. In the example, it's the 4 + 14 = 18th.
00217      *
00218      * temp_date now should hold the date for the wDay'th wDayOfWeek of the month.
00219      * we only need to handle the special case of the last <DayOfWeek> of the month.
00220      */
00221     temp_date = (WORD)( temp_date + 7 * p_target_date->wDay );
00222
00223     /* what's the last day of the month? */
00224     end_of_month = month_len [p_target_date->wMonth - 1];
00225     /* Correct if it's February of a leap year? */
00226     if ( p_test_date->wMonth == 2 && IsLeapYear(p_test_date->wYear) )
00227     {
00228         ++ end_of_month;
00229     }
00230
00231     /* if we tried to calculate the fifth Tuesday of the month
00232      * we may well have overshot. Correct for that case.
00233      */
00234     while ( temp_date > end_of_month)
00235         temp_date -= 7;
00236
00237     /* At long last, we're ready to do the comparison. */
00238     if ( p_test_date->wDay != temp_date )
00239     {
00240         return (p_test_date->wDay > temp_date) ? 2 : -2;
00241     }
00242     else
00243     {
00244         test_milliseconds = ((p_test_date->wHour * 60 + p_test_date->wMinute) * 60
00245                                 + p_test_date->wSecond) * 1000 + p_test_date->wMilliseconds;
00246         target_milliseconds = ((p_target_date->wHour * 60 + p_target_date->wMinute) * 60
00247                                 + p_target_date->wSecond) * 1000 + p_target_date->wMilliseconds;
00248         test_milliseconds -= target_milliseconds;
00249         return (test_milliseconds > 0) ? 1 : (test_milliseconds < 0) ? -1 : 0;
00250     }
00251
00252 }
00253
00254 //
00255 //  Get time zone bias for local time *pst.
00256 //
00257 //  UTC time = *pst + bias.
00258 //
00259 static int GetTimeZoneBias( const SYSTEMTIME * pst )
00260 {
00261     TIME_ZONE_INFORMATION tz;
00262     int n, bias;
00263
00264     GetTimeZoneInformation ( &tz );
00265
00266     /*  I only deal with cases where we look at
00267      *  a "last sunday" kind of thing.
00268      */
00269     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00270
00271     bias = tz.Bias;
00272
00273     n = CompareTargetDate ( pst, & tz.DaylightDate );
00274     if (n < 0)
00275         bias += tz.StandardBias;
00276     else
00277     {
00278         n = CompareTargetDate ( pst, & tz.StandardDate );
00279         if (n < 0)
00280             bias += tz.DaylightBias;
00281         else
00282             bias += tz.StandardBias;
00283     }
00284     return bias;
00285 }
00286
00287 //
00288 //  Is the (local) time in DST?
00289 //
00290 static bool IsDST( const SYSTEMTIME * pst )
00291 {
00292     TIME_ZONE_INFORMATION tz;
00293
00294     GetTimeZoneInformation ( &tz );
00295
00296     /*  I only deal with cases where we look at
00297      *  a "last sunday" kind of thing.
00298      */
00299     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00300
00301     return (CompareTargetDate ( pst, & tz.DaylightDate ) >= 0)
00302             && (CompareTargetDate ( pst, & tz.StandardDate ) < 0);
00303 }
00304
00305 /* Convert a system time from local time to UTC time, correctly
00306  * taking DST into account (sort of).
00307  *
00308  * INPUTS:
00309  *      const SYSTEMTIME * p_local:
00310  *              A file time. It may be in UTC or in local
00311  *              time (see local_time, below, for details).
00312  *
00313  *      SYSTEMTIME * p_utc:
00314  *              The destination for the converted time.
00315  *
00316  * OUTPUTS:
00317  *      SYSTEMTIME * p_utc:
00318  *              The destination for the converted time.
00319  */
00320
00321 void LocalSystemTimeToUtcSystemTime( const SYSTEMTIME * p_local, SYSTEMTIME * p_utc)
00322 {
00323     FILETIME ft;
00324     ULARGE_INTEGER itime, delta;
00325     int bias = GetTimeZoneBias(p_local);
00326
00327     // delta = bias correction: bias minutes.
00328     SystemTimeToFileTime(p_local, & ft);
00329     itime.QuadPart = ((ULARGE_INTEGER *) &ft)->QuadPart;
00330     delta.QuadPart = systemtime_second * 60 * bias;   // bias in minutes...
00331     itime.QuadPart += delta.QuadPart;
00332
00333     ((ULARGE_INTEGER *) & ft)->QuadPart = itime.QuadPart;
00334     FileTimeToSystemTime(& ft, p_utc);
00335 }
00336
00337
00338 /* Convert a file time to a Unix time_t structure. This function is as
00339  * complicated as it is because it needs to ask what time system the
00340  * filetime describes.
00341  *
00342  * INPUTS:
00343  *      const FILETIME * ft: A file time. It may be in UTC or in local
00344  *                           time (see local_time, below, for details).
00345  *
00346  *      time_t * ut:         The destination for the converted time.
00347  *
00348  *      BOOL local_time:     TRUE if the time in *ft is in local time
00349  *                           and I need to convert to a real UTC time.
00350  *
00351  * OUTPUTS:
00352  *      time_t * ut:         Store the result in *ut.
00353  */
00354 static BOOL FileTimeToUnixTime ( const FILETIME* pft, time_t* put, BOOL local_time )
00355 {
00356     BOOL success = FALSE;
00357
00358    /* FILETIME = number of 100-nanosecond ticks since midnight
00359     * 1 Jan 1601 UTC. time_t = number of 1-second ticks since
00360     * midnight 1 Jan 1970 UTC. To translate, we subtract a
00361     * FILETIME representation of midnight, 1 Jan 1970 from the
00362     * time in question and divide by the number of 100-ns ticks
00363     * in one second.
00364     */
00365
00366
00367     SYSTEMTIME base_st =
00368     {
00369         1970,   /* wYear            */
00370         1,      /* wMonth           */
00371         0,      /* wDayOfWeek       */
00372         1,      /* wDay             */
00373         0,      /* wHour            */
00374         0,      /* wMinute          */
00375         0,      /* wSecond          */
00376         0       /* wMilliseconds    */
00377     };
00378
00379     ULARGE_INTEGER itime;
00380     FILETIME base_ft;
00381     int bias = 0;
00382
00383     if (local_time)
00384     {
00385         SYSTEMTIME temp_st;
00386         success = FileTimeToSystemTime(pft, & temp_st);
00387         bias =  GetTimeZoneBias(& temp_st);
00388     }
00389
00390     success = SystemTimeToFileTime ( &base_st, &base_ft );
00391     if (success)
00392     {
00393         itime.QuadPart = ((ULARGE_INTEGER *)pft)->QuadPart;
00394
00395         itime.QuadPart -= ((ULARGE_INTEGER *)&base_ft)->QuadPart;
00396         itime.QuadPart /= systemtime_second;    // itime is now in seconds.
00397         itime.QuadPart += bias * 60;    // bias is in minutes.
00398
00399         *put = itime.LowPart;
00400     }
00401
00402     if (!success)
00403     {
00404         *put = -1;   /* error value used by mktime() */
00405     }
00406
00407     if (GetWinCvsDebugMaskBit(wcvsdbg_trace_stat_bit))
00408     {
00409             char scratch[128];
00410             SYSTEMTIME temp_st;
00411             struct tm gmt;
00412             bool bDst;
00413             FileTimeToSystemTime(pft, &temp_st);
00414             bDst = IsDST(& temp_st);
00415             gmt = *gmtime(put);
00416             _snprintf(scratch, 128,
00417                 "Converting file time (%s, bias = %d): %s %02d %02d:%02d:%02d.%03d %4d --> %s\n",
00418                 local_time ? (bDst ? "Daylight" : "Standard") : "UTC", bias,
00419                 month_names[temp_st.wMonth - 1], temp_st.wDay,
00420                 temp_st.wHour, temp_st.wMinute, temp_st.wSecond, temp_st.wMilliseconds,
00421                 temp_st.wYear,
00422                 asctime(& gmt) );
00423
00424             cvs_err(scratch);
00425             OutputDebugString(scratch);
00426     }
00427
00428     return success;
00429 }
00430
00431 static int _statcore(HANDLE hFile, const char *filename, struct stat *buf)
00432 {
00433     BY_HANDLE_FILE_INFORMATION bhfi;
00434     int isdev;
00435     char szFs[32];
00436     int is_gmt_fs = -1;
00437
00438     if(hFile)
00439     {
00440         /* Find out what kind of handle underlies filedes
00441         */
00442         isdev = GetFileType(hFile) & ~FILE_TYPE_REMOTE;
00443
00444         if ( isdev != FILE_TYPE_DISK )
00445         {
00446             /* not a disk file. probably a device or pipe
00447              */
00448             if ( (isdev == FILE_TYPE_CHAR) || (isdev == FILE_TYPE_PIPE) )
00449             {
00450                 /* treat pipes and devices similarly. no further info is
00451                  * available from any API, so set the fields as reasonably
00452                  * as possible and return.
00453                  */
00454                 if ( isdev == FILE_TYPE_CHAR )
00455                     buf->st_mode = _S_IFCHR;
00456                 else
00457                     buf->st_mode = _S_IFIFO;
00458
00459                 buf->st_rdev = buf->st_dev = (_dev_t)hFile;
00460                 buf->st_nlink = 1;
00461                 buf->st_uid = buf->st_gid = buf->st_ino = 0;
00462                 buf->st_atime = buf->st_mtime = buf->st_ctime = 0;
00463                 if ( isdev == FILE_TYPE_CHAR )
00464                     buf->st_size = 0;
00465                 else
00466                 {
00467                     unsigned long ulAvail;
00468                     int rc;
00469                     rc = PeekNamedPipe(hFile,NULL,0,NULL,&ulAvail,NULL);
00470                     if (rc)
00471                         buf->st_size = (_off_t)ulAvail;
00472                     else
00473                         buf->st_size = (_off_t)0;
00474                 }
00475
00476                 return 0;
00477             }
00478             else if ( isdev == FILE_TYPE_UNKNOWN )
00479             {
00480                 // Network device
00481                 errno = EBADF;
00482                 return -1;
00483             }
00484         }
00485     }
00486
00487     /* set the common fields
00488      */
00489     buf->st_ino = buf->st_uid = buf->st_gid = buf->st_mode = 0;
00490     buf->st_nlink = 1;
00491
00492     if(hFile)
00493     {
00494         /* use the file handle to get all the info about the file
00495          */
00496         if ( !GetFileInformationByHandle(hFile, &bhfi) )
00497         {
00498             _dosmaperr(GetLastError());
00499             return -1;
00500         }
00501     }
00502     else
00503     {
00504         WIN32_FIND_DATA fd;
00505         HANDLE hFind;
00506
00507         if(strlen(filename)==3 && !stricmp(filename+1,":\\"))
00508         {
00509             // Can't do anything about the root directory...
00510             // Win2k and Win98 can return info, but Win95 can't, so
00511             // it's best to do nothing.
00512             memset(&bhfi,0,sizeof(bhfi));
00513             bhfi.dwFileAttributes=GetFileAttributes(filename);
00514             if(bhfi.dwFileAttributes==0xFFFFFFFF)
00515             {
00516                 _dosmaperr(GetLastError());
00517                 return -1;
00518             }
00519             bhfi.nNumberOfLinks=1;
00520         }
00521         else
00522         {
00523             hFind=FindFirstFile(filename,&fd);
00524             if(hFind==INVALID_HANDLE_VALUE)
00525             {
00526                 _dosmaperr(GetLastError());
00527                 return -1;
00528             }
00529             FindClose(hFind);
00530             memset(&bhfi,0,sizeof(bhfi));
00531             bhfi.dwFileAttributes=fd.dwFileAttributes;
00532             bhfi.ftCreationTime=fd.ftCreationTime;
00533             bhfi.ftLastAccessTime=fd.ftLastAccessTime;
00534             bhfi.ftLastWriteTime=fd.ftLastWriteTime;
00535             bhfi.nFileSizeLow=fd.nFileSizeLow;
00536             bhfi.nFileSizeHigh=fd.nFileSizeHigh;
00537             bhfi.nNumberOfLinks=1;
00538         }
00539     }
00540
00541     if ( bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY )
00542         buf->st_mode |= (_S_IREAD + (_S_IREAD >> 3) + (_S_IREAD >> 6));
00543     else
00544         buf->st_mode |= ((_S_IREAD|_S_IWRITE) + ((_S_IREAD|_S_IWRITE) >> 3)
00545           + ((_S_IREAD|_S_IWRITE) >> 6));
00546     if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
00547         buf->st_mode |= (_S_IEXEC + (_S_IEXEC >> 3) + (_S_IEXEC >> 6));
00548
00549     // Potential, but unlikely problem... casting DWORD to short.
00550     // Reported by Jerzy Kaczorowski, addressed by Jonathan Gilligan
00551     // if the number of links is greater than 0x7FFF
00552     // there would be an overflow problem.
00553     // This is a problem inherent in the struct stat, and hence
00554     // in the design of the C library.
00555     ASSERT(bhfi.nNumberOfLinks <= SHRT_MAX);
00556     if (bhfi.nNumberOfLinks > SHRT_MAX) {
00557         buf->st_nlink = SHRT_MAX;
00558         }
00559     else {
00560         buf->st_nlink= static_cast<short>(bhfi.nNumberOfLinks);
00561         }
00562
00563     if(!filename)
00564     {
00565         // We have to assume here that the repository doesn't span drives, so the
00566         // current directory is correct.
00567         *szFs='\0';
00568         GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,32);
00569         if(!stricmp(szFs,"NTFS"))
00570             is_gmt_fs = 1;
00571         else
00572             is_gmt_fs = 0;
00573     }
00574     else
00575     {
00576         if(filename[1]!=':')
00577         {
00578             if((filename[0]=='\\' || filename[0]=='/') && (filename[1]=='\\' || filename[1]=='/'))
00579             {
00580                 // UNC pathname, assumed to be on an NTFS server.  No way to
00581                 // check, actually (GVI doesn't return anything useful).
00582                 is_gmt_fs = 1;
00583             }
00584             else
00585             {
00586                 // Relative path, treat as local
00587                 GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00588                 if(!stricmp(szFs,"NTFS"))
00589                     is_gmt_fs = 1;
00590                 else
00591                     is_gmt_fs = 0;
00592             }
00593         }
00594         else
00595         {
00596             // Drive specified...
00597             char szRootPath[4] = "?:\\";
00598             szRootPath[0]=filename[0];
00599             *szFs='\0';
00600             GetVolumeInformation(szRootPath,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00601             if(!stricmp(szFs,"NTFS") || !stricmp(szFs,"HPFS"))
00602                 is_gmt_fs = 1;
00603             else
00604                 is_gmt_fs = 0;
00605         }
00606     }
00607
00608     if(is_gmt_fs) // NTFS - everything is in GMT already
00609     {
00610         FileTimeToUnixTime ( &bhfi.ftLastAccessTime, &buf->st_atime, FALSE );
00611         FileTimeToUnixTime ( &bhfi.ftLastWriteTime, &buf->st_mtime, FALSE );
00612         FileTimeToUnixTime ( &bhfi.ftCreationTime, &buf->st_ctime, FALSE );
00613     }
00614     else
00615     {
00616         // FAT - timestamps are in incorrectly translated local time.
00617         // translate them back and let FileTimeToUnixTime() do the
00618         // job properly.
00619
00620         FILETIME At,Wt,Ct;
00621
00622         FileTimeToLocalFileTime ( &bhfi.ftLastAccessTime, &At );
00623         FileTimeToLocalFileTime ( &bhfi.ftLastWriteTime, &Wt );
00624         FileTimeToLocalFileTime ( &bhfi.ftCreationTime, &Ct );
00625         FileTimeToUnixTime ( &At, &buf->st_atime, TRUE );
00626         FileTimeToUnixTime ( &Wt, &buf->st_mtime, TRUE );
00627         FileTimeToUnixTime ( &Ct, &buf->st_ctime, TRUE );
00628     }
00629
00630     buf->st_size = bhfi.nFileSizeLow;
00631     if(bhfi.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00632         buf->st_mode |= _S_IFDIR;
00633     else
00634         buf->st_mode |= _S_IFREG;
00635
00636     /* On DOS, this field contains the drive number, but
00637      * the drive number is not available on this platform.
00638      * Also, for UNC network names, there is no drive number.
00639      */
00640     buf->st_rdev = buf->st_dev = 0;
00641     return 0;
00642 }
00643
00644 int wnt_stat(const char *name, struct stat *buf)
00645 {
00646     if(stricmp(name,"Entries") && stricmp(name,"Entries.log"))
00647         name=name;
00648     return _statcore(NULL,name,buf);
00649 }
00650
00651 int wnt_fstat (int fildes, struct stat *buf)
00652 {
00653     return _statcore((HANDLE)_get_osfhandle(fildes),NULL,buf);
00654 }
00655
00656 int wnt_lstat (const char *name, struct stat *buf)
00657 {
00658     return _statcore(NULL,name,buf);
00659 }
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


BrowseFileView.cpp File Reference

WinCvs/BrowseFileView.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include <process.h>
#include <vector>
#include <IO.h>
#include "BrowseFileView.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.

Functions

void | onFilteringChanged (CObject *obj)

Variables

const int | FILECHANGE_TIMER = 999
Default value for file change detection timer.

const int | kSpc = 3
Extra space for printed text.

const int | WM_RESETVIEW = WM_APP + 12
Application message to reset the view.

CPersistentInt | gFileViewSort ("P_FileViewSort", EntnodeData::kName)
CPersistentBool | gFileViewSortAsc ("P_FileViewSortAsc", false)

Function Documentation

void onFilteringChanged ( CObject * obj ) [static]

Filtering changed notification function

Parameters:
obj Browse file view to be notified

Definition at line 77 of file BrowseFileView.cpp.

00078 {
00079     ((CBrowseFileView*)obj)->OnFilteringChanged();
00080 }

Variable Documentation

const int FILECHANGE_TIMER = 999 [static]

Default value for file change detection timer.

Definition at line 61 of file BrowseFileView.cpp.

CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName)

Referenced by CBrowseFileView::CBrowseFileView(), and CBrowseFileView::~CBrowseFileView().

CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", false)

Referenced by CBrowseFileView::CBrowseFileView(), and CBrowseFileView::~CBrowseFileView().

const int kSpc = 3 [static]

Extra space for printed text.

Definition at line 64 of file BrowseFileView.cpp.

Referenced by CBrowseFileView::OnPrint().

const int WM_RESETVIEW = WM_APP + 12 [static]

Application message to reset the view.

Definition at line 67 of file BrowseFileView.cpp.

Generated on Fri Jan 31 12:11:40 2003 for WinCvs Source by doxygen 1.3-rc2


BrowseFileView.h File Reference

WinCvs/BrowseFileView.h File Reference

#include "CvsEntries.h"
#include "CPStr.h"
#include "SortHeaderCtrl.h"
#include "FileTraversal.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
class | KoTraversalContext
Context for traversing. More...

class | CRecursionLock
Class to prevent the recursive calls. More...

class | TViewFill
Fill the view. More...

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
}
File/folder icons enum. More...

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

File/folder icons enum.

Enumeration values:
kFileIconText | Text file
kFileIconBinary | Binary file
kFileIconUnknown | Unknown file
kFileIconAdded | Added file
kFileIconConflict | Conflict file
kFileIconMiss | Missing file
kFolderIcon | Folder
kFolderIconUnknown | Unknown folder
kFolderIconMiss | Missing folder
kFileIconTextMod | Modified text file
kFileIconBinaryMod | Modified binary file
kFileIconIgnored | Ignored file
kFolderIconIgnored | Ignored folder
kFileIconRemoved | Removed file
kFileIconBinaryAdded | Added binary file
kFileIconUnicode | Unicode file
kFileIconUnicodeMod | Modified unicode file
kFileIconUnicodeAdded | Added unicode file

Definition at line 47 of file BrowseFileView.h.

00048 {
00049     kFileIconText = 0,
00050     kFileIconBinary,
00051     kFileIconUnknown,
00052     kFileIconAdded,
00053     kFileIconConflict,
00054     kFileIconMiss,
00055     kFolderIcon,
00056     kFolderIconUnknown,
00057     kFolderIconMiss,
00058     kFileIconTextMod,
00059     kFileIconBinaryMod,
00060     kFileIconIgnored,
00061     kFolderIconIgnored,
00062     kFileIconRemoved,
00063     kFileIconBinaryAdded,
00064     kFileIconUnicode,
00065     kFileIconUnicodeMod,
00066     kFileIconUnicodeAdded
00067 };

Generated on Fri Jan 31 12:11:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file BrowserBar.h.

Generated on Fri Jan 31 12:11:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:36 2003 for WinCvs Source by doxygen 1.3-rc2


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().

Referenced by gtkCompareWrap().

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.

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 }

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.

Referenced by CCustInvertTable::CCustInvertTable().

CCustInvertTable sInvTable

Referenced by CustGetByKey(), and CCustomizeMenus::OnInitDialog().

Generated on Fri Jan 31 12:12:50 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References CCustInvertTable::Initialize(), and sInvTable.

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 Fri Jan 31 12:12:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file CvsStatusBar.h.

Generated on Fri Jan 31 12:12:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 "BrowseViewHandlers.h"

Include dependency graph for ExploreBar.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Fri Jan 31 12:12:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file ExploreBar.h.

Generated on Fri Jan 31 12:12:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 293 of file findtcl.cpp.

References dbgOnly.

Referenced by findTcl().

00294 {
00295     const char *pos2;
00296     char *shLibExt = ".dll";
00297
00298     /* append version w/o decimal */
00299     pos2 = ver;
00300     while (*pos2 != '\0') {
00301         if (*pos2 != '.') *pos++ = *pos2++;
00302         else pos2++;
00303     };
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 };

void buildWildTail | ( | char * | ,
 |  | char * | ,
 |  | int |
 | ) | [static]

Definition at line 320 of file findtcl.cpp.

References dbgOnly.

Referenced by findTcl().

00321 {
00322     char *pos2;
00323     char *shLibExt = ".dll";
00324
00325     /* just append the major version */
00326     *pos++ = *ver;
00327     *pos++ = '?';
00328
00329     /* if asked, add the debug suffix */
00330     if (dbgOnly != 0) *pos++ = 'd';
00331
00332     /* append the extension */
00333     pos2 = shLibExt;
00334     while (*pos2 != '\0') {
00335         *pos++ = *pos2++;
00336     };
00337
00338     /* terminate it */
00339     *pos = '\0';
00340 };

bool fileLess | ( | std::string | ,
 |  | std::string |
 | ) | [static]

Definition at line 376 of file findtcl.cpp.

References verLess().

Referenced by findTcl().

00377 {
00378   return verLess(
00379       a.substr(3,1) + "." + a.substr(4,1),
00380       b.substr(3,1) + "." + b.substr(4,1)
00381       );
00382 }

bool fileRemove ( std::string & ) [static]

Definition at line 369 of file findtcl.cpp.

References verRemove().

Referenced by findTcl().

00370 {
00371     // strip off 'tcl' and '.dll'
00372     return verRemove(f.substr(3,1) + "." + f.substr(4,1));
00373 }

char* findTcl | ( | char * | _minVer,
 |  | int | _exact,
 |  | int | _dbgOnly
 | ) |

Definition at line 49 of file findtcl.cpp.

References buildTail(), buildWildTail(), dbgOnly, err, exact, fileLess(), fileRemove(), MAX_PATH, minVer, NULL, verLess(), and verRemove().

Referenced by CTcl_Interp::IsAvail().

00050 {
00051     //char *tclRootPath = NULL;
00052     static char tclLibFullPath[MAX_PATH];
00053     char *savedPos;
00054     char *pos1, *pos2;
00055     char *prefix = "\\bin\\tcl";
00056     WIN32_FIND_DATA hFFData;
00057     HANDLE hFind;
00058     int i = 0;
00059     std::deque<std::string> vers;
00060     std::deque<std::string>::iterator versNewLast;
00061
00062
00063     minVer = _minVer;
00064     exact = _exact;
00065     dbgOnly = _dbgOnly;
00066
00067
00068     // Look in the current path on the assumption if it's there, you want to use
00069     // it instead of any others if it passes the version test.
00070
00071     // Append the beginning
00072     pos1 = tclLibFullPath;
00073     pos2 = ".\\tcl";
00074     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00075     savedPos = pos1;
00076
00077     if (exact != 0)
00078     {
00079         // build the end of the filename from the parameter given
00080         buildTail(savedPos, minVer, dbgOnly);
00081
00082         // See if it *really* exists
00083         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00084
00085         if (hFind != INVALID_HANDLE_VALUE)
00086         {
00087             // gotcha.
00088             ::FindClose(hFind);
00089             return tclLibFullPath;
00090         }
00091         // no success..  fall through for registry search
00092
00093     }
00094     else
00095     {
00096
00097         // Try a range of filenames
00098         buildWildTail(savedPos, minVer, dbgOnly);
00099
00100         // See if we got some
00101         hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00102
00103         if (hFind != INVALID_HANDLE_VALUE)
00104         {
00105             BOOL rtn;
00106
00107             do
00108             {
00109                 vers.push_back(std::string(hFFData.cFileName));
00110                 rtn = ::FindNextFile(hFind, &hFFData);
00111             } while (rtn != 0);   // got more?
00112
00113             ::FindClose(hFind);
00114
00115             // sort filename strings
00116             std::sort(vers.begin(), vers.end(), fileLess);
00117
00118             // remove all invalid entries based on flags.
00119             versNewLast = std::remove_if(vers.begin(), vers.end(), fileRemove);
00120
00121             if (vers.begin() != versNewLast) {
00122                 // using copy itself doesn't terminate the string...  how odd..
00123                 tclLibFullPath [(versNewLast - 1)->copy(tclLibFullPath, MAX_PATH)] = '\0';
00124                 return tclLibFullPath;
00125             }
00126         }
00127
00128         // no success..  fall through for registry search
00129     }
00130
00131
00132     // Do a registry search.
00133     HKEY topTclKey = NULL, subTclVer = NULL;
00134     DWORD max_path = MAX_PATH;
00135     LONG result;
00136     char sSubKey[MAX_PATH];
00137     const char *verTarget;
00138
00139     result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00140         "SOFTWARE\\Scriptics\\Tcl",
00141         0,
00142         KEY_ENUMERATE_SUB_KEYS,
00143         &topTclKey);
00144
00145     if (result != ERROR_SUCCESS)
00146     {
00147         // active TCL
00148         //HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TclScript\DefaultIcon
00149         result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00150             "SOFTWARE\\Classes\\TclScript\\DefaultIcon",
00151             0,
00152             KEY_QUERY_VALUE,
00153             &topTclKey);
00154
00155         if (result == ERROR_SUCCESS)
00156         {
00157             result = RegQueryValueEx(topTclKey,
00158                 "",
00159                 NULL,
00160                 NULL,
00161                 reinterpret_cast<PUCHAR>(tclLibFullPath),
00162                 &max_path);
00163
00164             RegCloseKey(topTclKey);
00165
00166             if (result == ERROR_SUCCESS)
00167             {
00168                 CString s(tclLibFullPath);
00169                 s.Replace("tk", "tcl");
00170                 strcpy(tclLibFullPath, s);
00171                 char *tmp = strrchr(tclLibFullPath, ',');
00172                 if(tmp != 0L)
00173                     *tmp = '\0';
00174                 return tclLibFullPath;
00175             }
00176         }
00177
00178         if (result != ERROR_SUCCESS)
00179         {
00180             std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) does not exist.");
00181             err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00182             throw err;
00183         }
00184     }
00185
00186     // Read all SubKey names
00187  enumAgain:
00188     result = RegEnumKey(topTclKey, i, sSubKey, MAX_PATH);
00189     if (result != ERROR_NO_MORE_ITEMS) {
00190         vers.push_back(std::string(sSubKey));
00191         i++; goto enumAgain;
00192     }
00193     else if (i == 0)
00194     {
00195         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl) has no SubKeys.");
00196         err.append("  Reinstall Tcl to fix this or hand edit your registry.");
00197         RegCloseKey(topTclKey);
00198         throw err;
00199     }
00200
00201     // sort version strings
00202     std::sort(vers.begin(), vers.end(), verLess);
00203
00204     // remove all invalid entries based on flags.
00205     versNewLast = std::remove_if(vers.begin(), vers.end(), verRemove);
00206
00207     if (vers.begin() != versNewLast)
00208         verTarget = (versNewLast - 1)->c_str();
00209     else
00210     {
00211         std::string err("Unable to locate a proper Tcl core in the registry for version ");
00212         err.append(minVer);
00213         if (exact != 0)
00214             err.append(".");
00215         else
00216             err.append(" or greater.");
00217         RegCloseKey(topTclKey);
00218         throw err;
00219     }
00220
00221     result = RegOpenKeyEx(topTclKey,
00222         verTarget,
00223         0,
00224         KEY_READ,
00225         &subTclVer);
00226
00227     if (result != ERROR_SUCCESS)
00228     {
00229         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl<target>) does not exist.");
00230         err.append("  Redo your Tcl install or, assuming you compiled your own core, read /win/README from the source distribution.");
00231         RegCloseKey(topTclKey);
00232         throw err;
00233     }
00234
00235     result = RegQueryValueEx(subTclVer,
00236         "Root",
00237         NULL,
00238         NULL,
00239         reinterpret_cast<PUCHAR>(tclLibFullPath),
00240         &max_path);
00241
00242     if (result != ERROR_SUCCESS)
00243     {
00244         std::string err("The registry path (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00245         err.append(verTarget);
00246         err.append(") did not have a \"Root\" SubKey.");
00247         RegCloseKey(topTclKey);
00248         RegCloseKey(subTclVer);
00249         throw err;
00250     };
00251
00252     pos1 = tclLibFullPath;
00253     while (*pos1 != '\0') { pos1++; }
00254
00255     // Append the bin directory and prefix
00256     pos2 = prefix;
00257     while (*pos2 != '\0') { *pos1++ = *pos2++; };
00258     savedPos = pos1;
00259
00260     // Build the end of the filename
00261     buildTail(savedPos, verTarget, dbgOnly);
00262
00263     // See if it *really* exists
00264     hFind = ::FindFirstFile(tclLibFullPath, &hFFData);
00265
00266     if (hFind != INVALID_HANDLE_VALUE) {
00267         // gotcha.
00268         ::FindClose(hFind);
00269         RegCloseKey(topTclKey);
00270         RegCloseKey(subTclVer);
00271         return tclLibFullPath;
00272     }
00273     else
00274     {
00275         ::FindClose(hFind);
00276         std::string err("The registry key (HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\");
00277         err.append(minVer);
00278         err.append("\\Root) said a core was located at (");
00279         err.append(tclLibFullPath);
00280         err.append(").  This was found to be false.");
00281         RegCloseKey(topTclKey);
00282         RegCloseKey(subTclVer);
00283         throw err;
00284     }
00285
00286     RegCloseKey(topTclKey);
00287     RegCloseKey(subTclVer);
00288     throw std::string("A proper Tcl core could not be found anywhere.");
00289     return NULL;
00290 }

bool verLess | ( | std::string | ,
 |  | std::string |
 | ) | [static]

Definition at line 361 of file findtcl.cpp.

Referenced by fileLess(), and findTcl().

00361                                               {
00362     double fa, fb;
00363     fa = atof(a.c_str());
00364     fb = atof(b.c_str());
00365     return (fa < fb);
00366 };

bool verRemove ( std::string & ) [static]

Definition at line 342 of file findtcl.cpp.

References exact.

Referenced by fileRemove(), and findTcl().

00343 {
00344     double fa, fb;
00345     fa = atof(s.c_str());
00346     fb = atof(minVer);
00347
00348     if (exact == 0)
00349     {
00350         // remove when major version is different.
00351         if ((int)fa != (int)fb)
00352             return true;
00353         // remove when less than minor version
00354         return (fa - (int)fa < fb - (int)fb);
00355     }
00356     else
00357         // remove when not identical for an exact match
00358         return (fa != fb);
00359 };

Variable Documentation

int dbgOnly [static]

Definition at line 46 of file findtcl.cpp.

Referenced by buildTail(), buildWildTail(), and findTcl().

int exact [static]

Definition at line 45 of file findtcl.cpp.

Referenced by findTcl(), and verRemove().

char* minVer [static]

Definition at line 44 of file findtcl.cpp.

Referenced by findTcl().

Generated on Fri Jan 31 12:12:53 2003 for WinCvs Source by doxygen 1.3-rc2


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]

Normalize folder/fname since the latter can be a path relative to folder

Parameters:
folder | Input folder
fn | Input file name
dir | Normalized folder
name | Normalized file name

Definition at line 50 of file GraphDoc.cpp.

Referenced by CGraphDoc::SetNode().

00051 {
00052     char buffer[_MAX_PATH];
00053     char dirBuffer[_MAX_PATH];
00054     char nameBuffer[_MAX_PATH];
00055     char drive[_MAX_PATH];
00056     char ext[_MAX_EXT];
00057
00058     _makepath(buffer, NULL, folder, fn, NULL);
00059     _splitpath(buffer, drive, dirBuffer, nameBuffer, ext);
00060     _makepath(dir, drive, dirBuffer, NULL, NULL);
00061     _makepath(name, NULL, NULL, nameBuffer, ext);
00062 }

Variable Documentation

const IID IID_ITest [static]

Initial value:

{ 0x9f456b5, 0x18, 0x11d2, { 0xbc, 0xaa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }

Definition at line 89 of file GraphDoc.cpp.

Generated on Fri Jan 31 12:12:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
Graph document class. More...

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 Fri Jan 31 12:12:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 "WincvsView.h"
#include "CvsPrefs.h"
#include "FileTraversal.h"
#include "ProgressDlg.h"
#include "GraphOptDlg.h"
#include "AdminOptionDlg.h"
#include "CvsAlert.h"
#include "CvsCommands.h"
#include "MultiFiles.h"
#include "BrowseViewHandlers.h"

Include dependency graph for GraphView.cpp:

Include dependency graph

Go to the source code of this file.

Functions

void | DrawOctangle (CDC &dc, const CRect &selfB)
void | DrawNode (CDC &dc, const CRect &selfB, COLORREF contour, kNodeShape shape, bool isSel, int penStyle=PS_SOLID)

Variables

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))
const int | kVChildSpace = 8
Vertical child spacing.

const int | kHChildSpace = 40
Horizontal child spacing.

const int | kInflateNodeSpace = 8
Inflate node spacing.

Function Documentation

void DrawNode | ( | CDC & | dc,
 |  | const CRect & | selfB,
 |  | COLORREF | contour,
 |  | kNodeShape | shape,
 |  | bool | isSel,
 |  | int | penStyle = PS_SOLID
 | ) | [static]

Helper function used to draw the node

Parameters:
dc | Device context
selfB | Bounds
contour | Contour color
shape | Shape
isSel | true if it's selected, false if not selected
penStyle | Pen style

Definition at line 102 of file GraphView.cpp.

References ASSERT, DrawOctangle(), gGraphSelColor, gGraphShadowColor, kOctangle, kRectangle, and kRoundRect.

00105 {
00106     CPen* pOldPen = 0L;
00107     CBrush* pOldBrush = 0L;
00108     CPen pen, pen2;
00109     CBrush brush;
00110     COLORREF selcolor = gGraphSelColor;
00111     COLORREF shadowc = gGraphShadowColor;
00112
00113     TRY
00114     {
00115         // Prepare the shadow
00116         CRect shadow = selfB;
00117         shadow.OffsetRect(SHADOW_OFFSET_PT);
00118
00119         brush.CreateSolidBrush(shadowc);
00120         pOldBrush = dc.SelectObject(&brush);
00121         pen.CreatePen(penStyle, 1, shadowc);
00122         pOldPen = dc.SelectObject(&pen);
00123
00124         // Draw the shadow
00125         switch( shape )
00126         {
00127         case kRectangle:
00128             dc.Rectangle(shadow);
00129             break;
00130         case kRoundRect:
00131             dc.RoundRect(shadow, ROUND_RECT_PT);
00132             break;
00133         case kOctangle:
00134             DrawOctangle(dc, shadow);
00135             break;
00136         default:
00137             ASSERT(FALSE);  //unknown type
00138             return;
00139         }
00140
00141         // Prepare selection
00142         if( isSel )
00143         {
00144             brush.DeleteObject();
00145             brush.CreateSolidBrush(selcolor);
00146             dc.SelectObject(&brush);
00147         }
00148         else
00149         {
00150             dc.SelectObject(pOldBrush);
00151             pOldBrush = 0L;
00152         }
00153
00154         pen2.CreatePen(penStyle, 1, contour);
00155         dc.SelectObject(&pen2);
00156
00157         // Draw the main shape
00158         switch( shape )
00159         {
00160         case kRectangle:
00161             dc.Rectangle(selfB);
00162             break;
00163         case kRoundRect:
00164             dc.RoundRect(selfB, ROUND_RECT_PT);
00165             break;
00166         case kOctangle:
00167             DrawOctangle(dc, selfB);
00168             break;
00169         default:
00170             ASSERT(FALSE);  //unknown type
00171             return;
00172         }
00173
00174         // Cleanup
00175         if( pOldPen != 0L )
00176         {
00177             dc.SelectObject(pOldPen);
00178             pOldPen = 0L;
00179         }
00180
00181         if( pOldBrush != 0L )
00182         {
00183             dc.SelectObject(pOldBrush);
00184             pOldBrush = 0L;
00185         }
00186
00187         pen.DeleteObject();
00188         pen2.DeleteObject();
00189         brush.DeleteObject();
00190     }
00191     CATCH_ALL(e)
00192     {
00193         if( pOldPen != 0L )
00194             dc.SelectObject(pOldPen);
00195
00196         if( pOldBrush != 0L )
00197             dc.SelectObject(pOldBrush);
00198     }
00199     END_CATCH_ALL
00200 }

void DrawOctangle | ( | CDC & | dc,
 |  | const CRect & | selfB
 | ) | [static]

Helper function to draw the figure used for branch tag representation

Parameters:
dc | Device context
selfB | Bounds

Definition at line 69 of file GraphView.cpp.

References OCTANGLE_COUNT.

Referenced by DrawNode().

00070 {
00071     int cutLen = selfB.Height() / 4;
00072     CPoint point1(selfB.left, selfB.top + cutLen);
00073     CPoint point2(selfB.left + cutLen, selfB.top);
00074     CPoint point3(selfB.right - cutLen, selfB.top);
00075     CPoint point4(selfB.right, selfB.top + cutLen);
00076     CPoint point5(selfB.right, selfB.bottom - cutLen);
00077     CPoint point6(selfB.right - cutLen, selfB.bottom);
00078     CPoint point7(selfB.left + cutLen, selfB.bottom);
00079     CPoint point8(selfB.left, selfB.bottom - cutLen);
00080     CPoint arrPoints[OCTANGLE_COUNT] = {
00081         point1,
00082         point2,
00083         point3,
00084         point4,
00085         point5,
00086         point6,
00087         point7,
00088         point8};
00089
00090     dc.Polygon(arrPoints, OCTANGLE_COUNT);
00091 }

Variable Documentation

CPersistentInt gGraphBranchColor("P_GraphBranchColor", RGB(0, 0, 255) )

Referenced by CWinLogBranchData::UpdateSelf().

CPersistentInt gGraphDeadNodeColor("P_GraphDeadNodeColor", RGB(255, 0, 0) )

Referenced by CWinLogRevData::UpdateSelf().

CPersistentInt gGraphHeaderColor("P_GraphHeaderColor", RGB(255, 0, 0) )

Referenced by CWinLogHeaderData::UpdateSelf().

CPersistentInt gGraphNodeColor("P_GraphNodeColor", RGB(0, 0, 255) )

Referenced by CWinLogRevData::UpdateSelf().

CPersistentInt gGraphSelColor("P_GraphSelColor", RGB(160, 160, 160) )

Referenced by DrawNode().

CPersistentInt gGraphShadowColor("P_GraphShadowColor", RGB(128, 128, 128) )

Referenced by DrawNode().

CPersistentInt gGraphTagColor("P_GraphTagColor", RGB(0, 0, 0) )

Referenced by CWinLogTagData::UpdateSelf().

CPersistentInt gGraphUserStateNodeColor("P_GraphUserStateNodeColor", RGB(0, 128, 64) )

Referenced by CWinLogRevData::UpdateSelf().

const int kHChildSpace = 40

Horizontal child spacing.

Definition at line 60 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds(), and CWinLogData::Update().

const int kInflateNodeSpace = 8

Inflate node spacing.

Definition at line 62 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds().

const int kVChildSpace = 8

Vertical child spacing.

Definition at line 58 of file GraphView.cpp.

Referenced by CWinLogData::ComputeBounds().

Generated on Fri Jan 31 12:12:56 2003 for WinCvs Source by doxygen 1.3-rc2


GraphView.h File Reference

WinCvs/GraphView.h File Reference

#include "CvsLog.h"
#include "AppGlue.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 | CGraphConsole
Graph console. More...

class | CGraphRectTracker
Graph rectangle tracker. More...

class | CGraphView
Graph view class. More...

class | CRevisionConsole
Console used to retrieve a specific revision. More...

class | TGraph
Base traverse class. More...

class | TGraphCmdStatus
Graph command status class. More...

class | TGraphDelCmd
Graph command delete revisions class. More...

class | TGraphRectSelect
Graph traverse class. More...

class | TGraphSelNonSig
Select non-significant revisions. More...

class | CWinLogBranchData
Windows log branch node data. More...

class | CWinLogData
Windows log data abstract class. More...

class | CWinLogHeaderData
Windows log header node data. More...

class | CWinLogRevData
Windows log revision node data. More...

class | CWinLogTagData
Windows log tag node data. More...

Defines

#define | AFX_GRAPHVIEW_H__7A07C311_03F9_11D2_BCB2_000000000000__INCLUDED_
#define | STARTPOINT_PT (CPoint(5, 5))
#define | SHADOW_OFFSET_PT (CPoint(4, 4))
#define | ROUND_RECT_PT (CPoint(6, 6))
#define | OCTANGLE_COUNT 8
#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
}
Node shape type enum. More...

enum kTGraph {
kTContinue,
kTGetDown,
kTStop
}
Traverse result enum. More...

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 33 of file GraphView.h.

Referenced by DrawOctangle().

#define RGB_DEF_BRANCH RGB(0, 0, 255)

Definition at line 39 of file GraphView.h.

#define RGB_DEF_DEADNODE RGB(255, 0, 0)

Definition at line 41 of file GraphView.h.

#define RGB_DEF_HEADER RGB(255, 0, 0)

Definition at line 37 of file GraphView.h.

#define RGB_DEF_NODE RGB(0, 0, 255)

Definition at line 40 of file GraphView.h.

#define RGB_DEF_SEL RGB(160, 160, 160)

Definition at line 35 of file GraphView.h.

#define RGB_DEF_SHADOW RGB(128, 128, 128)

Definition at line 36 of file GraphView.h.

#define RGB_DEF_TAG RGB(0, 0, 0)

Definition at line 38 of file GraphView.h.

#define RGB_DEF_USERSTATENODE RGB(0, 128, 64)

Definition at line 42 of file GraphView.h.

#define ROUND_RECT_PT (CPoint(6, 6))

Definition at line 31 of file GraphView.h.

#define SHADOW_OFFSET_PT (CPoint(4, 4))

Definition at line 30 of file GraphView.h.

#define STARTPOINT_PT (CPoint(5, 5))

Definition at line 29 of file GraphView.h.

#define STYLE_DEADNODE PS_DOT

Definition at line 43 of file GraphView.h.

Referenced by CWinLogRevData::UpdateSelf().

#define STYLE_USERSTATENODE PS_DASH

Definition at line 44 of file GraphView.h.

Referenced by CWinLogRevData::UpdateSelf().

Enumeration Type Documentation

enum kNodeShape

Node shape type enum.

Enumeration values:
kRectangle | Rectangle
kRoundRect | Rectangle with round corners
kOctangle | Octal

Definition at line 47 of file GraphView.h.

00048 {
00049     kRectangle,
00050     kRoundRect,
00051     kOctangle
00052 } kNodeShape;

enum kTGraph

Traverse result enum.

Enumeration values:
kTContinue | Continue traverse
kTGetDown | Get down
kTStop | Stop

Definition at line 55 of file GraphView.h.

Referenced by TGraph::TraverseGraph(), TGraphSelNonSig::TraverseNode(), TGraphDelCmd::TraverseNode(), TGraphCmdStatus::TraverseNode(), and TGraphRectSelect::TraverseNode().

00056 {
00057     kTContinue,
00058     kTGetDown,
00059     kTStop
00060 } kTGraph;

Generated on Fri Jan 31 12:12:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.h"

Include dependency graph for HistComboBoxEx.cpp:

Include dependency graph

Go to the source code of this file.

Functions

int | TraverseHistory (CHistComboBoxEx &browseHist)

Variables

PCPStr | gOldLoc ("P_BrowserLoc","C:\\")

Function Documentation

int TraverseHistory ( CHistComboBoxEx & browseHist )

Definition at line 42 of file HistComboBoxEx.cpp.

References MAX_PATH, and CHistComboBoxEx::SetIcon().

Referenced by CHistComboBoxEx::OnDropdown().

00043 {
00044     char szPath[MAX_PATH] = "";
00045     for( int nIndex = 0; nIndex < browseHist.GetCount(); nIndex++ )
00046     {
00047         COMBOBOXEXITEM cbi;
00048         cbi.mask = CBEIF_TEXT;
00049         cbi.iItem = nIndex;
00050         cbi.pszText = szPath;
00051         cbi.cchTextMax = MAX_PATH;
00052
00053         browseHist.GetItem(&cbi);
00054         browseHist.SetIcon(cbi);
00055     }
00056
00057     return nIndex;
00058 }

Variable Documentation

PCPStr gOldLoc("P_BrowserLoc", "C:\\") [static]

Referenced by CHistComboBoxEx::GetOldLoc(), and CHistComboBoxEx::NewRoot().

Generated on Fri Jan 31 12:12:57 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and CMainFrame::OnCreate().

#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 Fri Jan 31 12:12:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:59 2003 for WinCvs Source by doxygen 1.3-rc2


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

bool | IsAppEnabled ()
void | onFilterMaskEntered (CObject *obj)
CSemaphore | sGetEnv (0)

Variables

CMString | gHistoryLocs (100,"P_BrowserLocs")
CWinPlacement | gMainPlacement ("P_MainPlacement")
UINT | indicators []
bool | sAskingMainThread
UStr sGetEnvResult

Function Documentation

bool IsAppEnabled ( ) [static]

Definition at line 52 of file MainFrm.cpp.

References CWincvsApp::IsCvsRunning().

00053 {
00054     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00055     return !app->IsCvsRunning() && !gCvsPrefs.empty();
00056 }

void onFilterMaskEntered ( CObject * obj ) [static]

Definition at line 222 of file MainFrm.cpp.

00223 {
00224     ((CMainFrame *)obj)->OnFilterMaskEntered();
00225 }

CSemaphore sGetEnv ( 0 ) [static]

Referenced by CMainFrame::GetEnvMainThread(), and CMainFrame::OnTimer().

Variable Documentation

CMString gHistoryLocs(100, "P_BrowserLocs")

CWinPlacement gMainPlacement("P_MainPlacement") [static]

Referenced by CMainFrame::InitialShowWindow(), and CMainFrame::OnClose().

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.

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.

Referenced by CMainFrame::GetEnvMainThread(), and CMainFrame::OnTimer().

Generated on Fri Jan 31 12:12:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 26 of file MainFrm.h.

Generated on Fri Jan 31 12:13:00 2003 for WinCvs Source by doxygen 1.3-rc2


MfFileDialog.cpp File Reference

WinCvs/MfFileDialog.cpp File Reference

#include "stdafx.h"
#include "MfFileDialog.h"
#include <cderr.h>
#include "MultiFiles.h"
#include <sstream>

Include dependency graph for MfFileDialog.cpp:

Include dependency graph

Go to the source code of this file.

Generated on Fri Jan 31 12:13:00 2003 for WinCvs Source by doxygen 1.3-rc2


MfFileDialog.h File Reference

WinCvs/MfFileDialog.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 | CMfFileDialog
Multi-selection file dialog wrapper class. More...

class | CPathBuffer
Support class to handle the selection buffer. More...

Defines

#define | AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_

Define Documentation

#define AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_

Definition at line 26 of file MfFileDialog.h.

Generated on Fri Jan 31 12:13:01 2003 for WinCvs Source by doxygen 1.3-rc2


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().

Referenced by FileTraverse().

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.

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 * dirp )

Definition at line 124 of file ndir.c.

References direct::d_ino, direct::d_name, direct::d_namlen, direct::d_reclen, DIR, and readdir().

Referenced by FileTraverse(), and readdir().

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 Fri Jan 31 12:13:01 2003 for WinCvs Source by doxygen 1.3-rc2


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

Referenced by readdir().

Function Documentation

void closedir ( DIR * )

Definition at line 116 of file ndir.c.

References _dirdesc::dd_contents, free, and free_dircontents().

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 _dircontents::_d_entry, _dircontents::_d_next, free, free_dircontents(), and malloc.

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.

References direct::d_ino, direct::d_name, direct::d_namlen, direct::d_reclen, DIR, and readdir().

Referenced by FileTraverse(), and readdir().

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.

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 * )

Definition at line 159 of file ndir.c.

References _dirdesc::dd_loc.

00160 {
00161   return dirp->dd_loc;
00162 }

Generated on Fri Jan 31 12:13:02 2003 for WinCvs Source by doxygen 1.3-rc2


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

void | WarnNoPython (void)

Variables

CPersistentBool | gWarnPython ("P_WarnPython", true)

Function Documentation

void WarnNoPython ( void )

Definition at line 79 of file NoPython.cpp.

References gWarnPython, and CNoPython::m_remind.

Referenced by CPython_Interp::IsAvail().

00080 {
00081     if((bool)gWarnPython)
00082     {
00083         CNoPython dlg;
00084         dlg.DoModal();
00085         if(!dlg.m_remind)
00086             gWarnPython = false;
00087     }
00088 }

Variable Documentation

CPersistentBool gWarnPython("P_WarnPython", true) [static]

Referenced by WarnNoPython().

Generated on Fri Jan 31 12:13:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file NoPython.h.

Function Documentation

void WarnNoPython ( void )

Definition at line 79 of file NoPython.cpp.

References gWarnPython, and CNoPython::m_remind.

Referenced by CPython_Interp::IsAvail().

00080 {
00081     if((bool)gWarnPython)
00082     {
00083         CNoPython dlg;
00084         dlg.DoModal();
00085         if(!dlg.m_remind)
00086             gWarnPython = false;
00087     }
00088 }

Generated on Fri Jan 31 12:13:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 | IDD_WARNINGDESC 145
#define | IDD_ENTRYDESC 146
#define | IDD_UPDATE_MAIN 147
#define | IDD_UPDATE_STICKY 148
#define | IDD_UPDATE_MERGE 149
#define | IDD_LOG_MAIN 150
#define | IDD_LOG_FILTERS 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 | IDR_STATEICONS 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 | 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 | IDD_STATUS_MAIN 203
#define | IDD_SSPI 204
#define | IDD_ITEM_LIST 205
#define | IDD_LOGIN_MAIN 206
#define | IDR_ITEMLIST 207
#define | IDD_PREFS_CVS 207
#define | IDB_MODULES 208
#define | IDD_RELEASE_MAIN 208
#define | IDB_IMPORT 209
#define | IDD_SELECTION_DETAILS 209
#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_DISABLESPLASHSCREEN 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_NOTAGS 1050
#define | IDC_NOUSERS 1051
#define | IDC_HEADERS 1051
#define | IDC_RTAG 1052
#define | IDC_SUPRESS 1052
#define | IDC_CHECKPATH 1053
#define | IDC_HEADERSDESC 1053
#define | IDC_BTNHOME 1054
#define | IDC_ADD_SELECTION 1054
#define | IDC_HOME 1055
#define | IDC_ADD_DEFAULT 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_ISDATE1 1064
#define | IDC_ISDATE2 1065
#define | IDC_COMBOREV1 1069
#define | IDC_BTNPROGRAM 1070
#define | IDC_COMBORTAG 1070
#define | IDC_PROGRAM 1071
#define | IDC_BAR_TREE 1072
#define | IDC_BTNSETTINGS 1073
#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_CVSGUISFURL 1098
#define | IDC_CMDMENU 1099
#define | IDC_ADD 1101
#define | IDC_REMOVE 1102
#define | IDC_UP 1103
#define | IDC_DELALL 1103
#define | IDC_DOWN 1104
#define | IDC_DELCVSINFO 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_UNIFIEDDIFF 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_CHECKSTATUS 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 | IDC_OUTPUT_QUICK 1182
#define | IDC_OUTPUT_VERBOSE 1183
#define | IDC_BROWSE_TAG 1183
#define | IDC_OUTPUT_STANDARD 1184
#define | IDC_TAG_LIST 1184
#define | IDC_BROWSE_READFROM 1184
#define | IDC_BROWSE_TAG1 1185
#define | IDC_BROWSE_TAG2 1186
#define | IDC_MODULE_LIST 1186
#define | IDC_BROWSE_MODULES 1187
#define | IDC_ITEMLIST 1191
#define | IDC_REFRESH 1192
#define | IDC_READFROM 1193
#define | IDC_ITEM 1195
#define | IDC_ITEMLABEL 1196
#define | IDC_OPTION 1197
#define | IDC_CHECKDATE 1198
#define | IDC_CHECKREV 1199
#define | IDC_GROUP_OPTIONS 1200
#define | IDC_HELPLOGIN 1201
#define | IDC_COMPARE_TYPE 1202
#define | IDC_KEYWORDSUBSTITUTION 1203
#define | IDC_KEYWORDDESC 1204
#define | IDC_DIFFOPTIONS 1205
#define | IDC_OPTIONSMENU 1206
#define | IDC_ALTSETTINGSCHK 1207
#define | IDC_MODULE 1209
#define | IDC_DELDIR 1209
#define | IDC_PROGRESS_TEXT 1210
#define | IDC_SELECTIONLIST 1212
#define | IDC_FILENAME 1214
#define | IDC_REVISION_SPIN 1215
#define | IDC_REVISION 1216
#define | IDC_AUTO_REFRESH 1216
#define | IDC_CURRENT_OPTIONS 1386
#define | IDC_OPTIONSLIST 1388
#define | IDC_OPTIONDETAILS 1390
#define | IDC_STATICGROUP_SELECTOPTIONS 1417
#define | IDC_STATIC_CURRENTOPTIONS 1418
#define | IDC_STATIC_OPTDESC 1419
#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.

#define CG_IDS_DIDYOUKNOW 108

Definition at line 14 of file resource.h.

#define CG_IDS_FILE_ABSENT 109

Definition at line 15 of file resource.h.

#define CG_IDS_TIPOFTHEDAY 106

Definition at line 12 of file resource.h.

#define CG_IDS_TIPOFTHEDAYHELP 111

Definition at line 17 of file resource.h.

#define CG_IDS_TIPOFTHEDAYMENU 107

Definition at line 13 of file resource.h.

#define ID_ACCEL32911 32911

Definition at line 402 of file resource.h.

#define ID_ADDBF 32801

Definition at line 348 of file resource.h.

#define ID_APP_CMDLINE 32776

Definition at line 341 of file resource.h.

#define ID_APP_COPYRIGHTS 32873

Definition at line 381 of file resource.h.

#define ID_APP_CREDITS 32872

Definition at line 380 of file resource.h.

#define ID_APP_LOGIN 32779

Definition at line 342 of file resource.h.

#define ID_APP_LOGOUT 32906

Definition at line 399 of file resource.h.

#define ID_APP_PREFERENCES 32775

Definition at line 340 of file resource.h.

#define ID_APP_RTAGBRANCH 32883

Definition at line 386 of file resource.h.

#define ID_APP_RTAGCREATE 32881

Definition at line 384 of file resource.h.

#define ID_APP_RTAGDELETE 32882

Definition at line 385 of file resource.h.

#define ID_BROWSER_OPEN 32797

Definition at line 344 of file resource.h.

#define ID_BUTTON32918 32918

Definition at line 409 of file resource.h.

#define ID_BUTTON32919 32919

Definition at line 410 of file resource.h.

#define ID_BUTTON32920 32920

Definition at line 411 of file resource.h.

#define ID_BUTTON32921 32921

Definition at line 412 of file resource.h.

#define ID_BUTTON32940 32940

Definition at line 426 of file resource.h.

#define ID_CANCEL_EDIT_CNTR 32768

Definition at line 339 of file resource.h.

#define ID_COMMITBF 32800

Definition at line 347 of file resource.h.

#define ID_CUST_FILES_MENU 32859

Definition at line 378 of file resource.h.

#define ID_CUST_FOLDER_MENU 32860

Definition at line 379 of file resource.h.

#define ID_FILTERMASK 32928

Definition at line 418 of file resource.h.

#define ID_GRAPH_ADMINOPTIONS_CHANGELOGMESSAGE 32950

Definition at line 432 of file resource.h.

#define ID_GRAPH_ADMINOPTIONS_SETDESCRIPTION 32952

Definition at line 434 of file resource.h.

#define ID_GRAPH_ADMINOPTIONS_SETSTATE 32951

Definition at line 433 of file resource.h.

#define ID_GRAPH_CHANGELOGMESSAGE 32954

Definition at line 435 of file resource.h.

#define ID_GRAPH_CLOSE 32874

Definition at line 382 of file resource.h.

#define ID_GRAPH_GRAPHOPTIONS 32946

Definition at line 431 of file resource.h.

#define ID_GRAPH_SETDESCRIPTION 32956

Definition at line 437 of file resource.h.

#define ID_GRAPH_SETSTATE 32955

Definition at line 436 of file resource.h.

#define ID_HELP_CVS 32903

Definition at line 397 of file resource.h.

#define ID_HELP_CVSCLIENT 32904

Definition at line 398 of file resource.h.

#define ID_HISTORYBROWSE 32900

Definition at line 394 of file resource.h.

#define ID_MACRO_ADMIN 34200

Definition at line 443 of file resource.h.

Referenced by CCustomizeMenus::GetIcon(), CCustInvertTable::Initialize(), and CWincvsDoc::OnMacroAdmin().

#define ID_MACRO_END 34200

Definition at line 444 of file resource.h.

#define ID_MACRO_SEL 34100

Definition at line 442 of file resource.h.

Referenced by CCustomizeMenus::GetIcon(), and CCustInvertTable::Initialize().

#define ID_MACRO_START 34000

Definition at line 441 of file resource.h.

#define ID_MENUBAR 32810

Definition at line 357 of file resource.h.

#define ID_MENUITEM32840 32840

Definition at line 370 of file resource.h.

#define ID_QUERY_ANNOTATE 32941

Definition at line 427 of file resource.h.

#define ID_SAVESETTINGS 32922

Definition at line 413 of file resource.h.

#define ID_STOPCVS 32795

Definition at line 343 of file resource.h.

#define ID_UPDATEBF 32799

Definition at line 346 of file resource.h.

#define ID_USE_PYSHELL 32945

Definition at line 430 of file resource.h.

#define ID_USE_TCLSHELL 32944

Definition at line 429 of file resource.h.

#define ID_VIEW_ADD 32808

Definition at line 355 of file resource.h.

#define ID_VIEW_ADDB 32811

Definition at line 358 of file resource.h.

#define ID_VIEW_ADDED 32935

Definition at line 422 of file resource.h.

#define ID_VIEW_ADDU 32960

Definition at line 440 of file resource.h.

#define ID_VIEW_BROWSELOCATION_REMOVEUNWANTED 32943

Definition at line 428 of file resource.h.

#define ID_VIEW_BROWSER_BAR 32798

Definition at line 345 of file resource.h.

#define ID_VIEW_CHANGED 32937

Definition at line 424 of file resource.h.

#define ID_VIEW_CHECKOUT 32915

Definition at line 406 of file resource.h.

#define ID_VIEW_COMMIT 32807

Definition at line 354 of file resource.h.

#define ID_VIEW_CONFLICT 32929

Definition at line 419 of file resource.h.

#define ID_VIEW_CONSOLE_BAR 32898

Definition at line 392 of file resource.h.

#define ID_VIEW_DELREV 32916

Definition at line 407 of file resource.h.

#define ID_VIEW_DIFF 32833

Definition at line 364 of file resource.h.

#define ID_VIEW_EDIT 32845

Definition at line 373 of file resource.h.

#define ID_VIEW_EDITORS 32858

Definition at line 377 of file resource.h.

#define ID_VIEW_EDITSEL 32908

Definition at line 400 of file resource.h.

#define ID_VIEW_EDITSELDEF 32909

Definition at line 401 of file resource.h.

Referenced by FormatMenuString().

#define ID_VIEW_EXPLORE 32899

Definition at line 393 of file resource.h.

#define ID_VIEW_FILES_BAR 32805

Definition at line 352 of file resource.h.

#define ID_VIEW_FILTER_BAR 32925

Definition at line 416 of file resource.h.

#define ID_VIEW_FORCEEDIT 32958

Definition at line 439 of file resource.h.

#define ID_VIEW_FULLLIST 32803

Definition at line 350 of file resource.h.

#define ID_VIEW_GRAPH 32875

Definition at line 383 of file resource.h.

#define ID_VIEW_HIDEUNKNOWN 32938

Definition at line 425 of file resource.h.

#define ID_VIEW_IGNORE 32902

Definition at line 396 of file resource.h.

#define ID_VIEW_IMPORT 32913

Definition at line 404 of file resource.h.

#define ID_VIEW_INIT 32914

Definition at line 405 of file resource.h.

#define ID_VIEW_LOCKF 32836

Definition at line 367 of file resource.h.

#define ID_VIEW_LOG 32834

Definition at line 365 of file resource.h.

#define ID_VIEW_MISSING 32932

Definition at line 421 of file resource.h.

#define ID_VIEW_MODIFIED 32927

Definition at line 417 of file resource.h.

#define ID_VIEW_MULTI_BAR 32838

Definition at line 369 of file resource.h.

#define ID_VIEW_QUERYUPDATE 32901

Definition at line 395 of file resource.h.

#define ID_VIEW_RECURSIVE 32924

Definition at line 415 of file resource.h.

#define ID_VIEW_RELEASE 32847

Definition at line 375 of file resource.h.

#define ID_VIEW_RELOAD 32814

Definition at line 361 of file resource.h.

#define ID_VIEW_REMOVED 32936

Definition at line 423 of file resource.h.

#define ID_VIEW_RESERVEDEDIT 32957

Definition at line 438 of file resource.h.

#define ID_VIEW_RETRIEVE 32923

Definition at line 414 of file resource.h.

#define ID_VIEW_RMV 32812

Definition at line 359 of file resource.h.

#define ID_VIEW_ROWDETAILS 32804

Definition at line 351 of file resource.h.

#define ID_VIEW_SELNONSIG 32917

Definition at line 408 of file resource.h.

#define ID_VIEW_SMALLICONS 32802

Definition at line 349 of file resource.h.

#define ID_VIEW_STATUS 32835

Definition at line 366 of file resource.h.

#define ID_VIEW_TAG 32884

Definition at line 387 of file resource.h.

#define ID_VIEW_TAGBRANCH 32888

Definition at line 390 of file resource.h.

#define ID_VIEW_TAGDELETE 32887

Definition at line 389 of file resource.h.

#define ID_VIEW_TAGNEW 32886

Definition at line 388 of file resource.h.

#define ID_VIEW_TAGS_BAR 32889

Definition at line 391 of file resource.h.

#define ID_VIEW_TRASH 32830

Definition at line 363 of file resource.h.

#define ID_VIEW_UNEDIT 32846

Definition at line 374 of file resource.h.

#define ID_VIEW_UNKNOWN 32931

Definition at line 420 of file resource.h.

#define ID_VIEW_UNLOCKF 32837

Definition at line 368 of file resource.h.

#define ID_VIEW_UPDATE 32806

Definition at line 353 of file resource.h.

#define ID_VIEW_UPONE 32826

Definition at line 362 of file resource.h.

#define ID_VIEW_WATCHERS 32857

Definition at line 376 of file resource.h.

#define ID_VIEW_WATCHOFF 32844

Definition at line 372 of file resource.h.

#define ID_VIEW_WATCHON 32843

Definition at line 371 of file resource.h.

#define ID_VIEW_WORKSPACE 32809

Definition at line 356 of file resource.h.

#define ID_VIEWW_INIT 32912

Definition at line 403 of file resource.h.

#define IDB_ABOUT 180

Definition at line 61 of file resource.h.

#define IDB_HISTLOC 187

Definition at line 69 of file resource.h.

#define IDB_IDLE 185

Definition at line 66 of file resource.h.

#define IDB_IMPORT 209

Definition at line 93 of file resource.h.

#define IDB_LIGHTBULB 103

Definition at line 9 of file resource.h.

#define IDB_LOCATE 176

Definition at line 58 of file resource.h.

#define IDB_MODULES 208

Definition at line 91 of file resource.h.

#define IDB_PYTHON 183

Definition at line 64 of file resource.h.

#define IDB_SMALLICONS 152

Definition at line 45 of file resource.h.

#define IDB_SPLASH 112

Definition at line 18 of file resource.h.

#define IDC_ADD 1101

Definition at line 225 of file resource.h.

#define IDC_ADD_DEFAULT 1055

Definition at line 178 of file resource.h.

#define IDC_ADD_SELECTION 1054

Definition at line 176 of file resource.h.

#define IDC_ALERTCAPTION 1015

Definition at line 119 of file resource.h.

#define IDC_ALLCMDS 1098

Definition at line 222 of file resource.h.

#define IDC_ALRTMSG 1016

Definition at line 120 of file resource.h.

#define IDC_ALTCVSCHK 1079

Definition at line 202 of file resource.h.

#define IDC_ALTCVSPROG 1080

Definition at line 203 of file resource.h.

#define IDC_ALTCVSSEL 1081

Definition at line 205 of file resource.h.

#define IDC_ALTSETTINGSCHK 1207

Definition at line 324 of file resource.h.

#define IDC_ALWAYSROOT 1009

Definition at line 112 of file resource.h.

#define IDC_APPLY 1149

Definition at line 269 of file resource.h.

#define IDC_ATTIC 1075

Definition at line 196 of file resource.h.

#define IDC_AUTHEN 1018

Definition at line 122 of file resource.h.

#define IDC_AUTHENDESC 1138

Definition at line 255 of file resource.h.

#define IDC_AUTO_REFRESH 1216

Definition at line 332 of file resource.h.

#define IDC_BAR_TREE 1072

Definition at line 194 of file resource.h.

#define IDC_BRANCH 1160

Definition at line 279 of file resource.h.

#define IDC_BROWSE_MODULES 1187

Definition at line 308 of file resource.h.

#define IDC_BROWSE_READFROM 1184

Definition at line 304 of file resource.h.

#define IDC_BROWSE_TAG 1183

Definition at line 301 of file resource.h.

#define IDC_BROWSE_TAG1 1185

Definition at line 305 of file resource.h.

#define IDC_BROWSE_TAG2 1186

Definition at line 306 of file resource.h.

#define IDC_BTNHOME 1054

Definition at line 175 of file resource.h.

#define IDC_BTNPATH 1021

Definition at line 125 of file resource.h.

#define IDC_BTNPATH2 1014

Definition at line 118 of file resource.h.

#define IDC_BTNPROGRAM 1070

Definition at line 191 of file resource.h.

#define IDC_BTNSETTINGS 1073

Definition at line 195 of file resource.h.

#define IDC_BULB 1000

Definition at line 96 of file resource.h.

#define IDC_CHECK_OVERRIDECHECKOUTDIR 1122

Definition at line 241 of file resource.h.

#define IDC_CHECKANNOTATE 1145

Definition at line 264 of file resource.h.

#define IDC_CHECKDATE 1198

Definition at line 315 of file resource.h.

#define IDC_CHECKDATE1 1177

Definition at line 294 of file resource.h.

#define IDC_CHECKDATE2 1178

Definition at line 295 of file resource.h.

#define IDC_CHECKDIFF 1140

Definition at line 257 of file resource.h.

#define IDC_CHECKGRAPH 1141

Definition at line 258 of file resource.h.

#define IDC_CHECKKSERVERPORT 1031

Definition at line 142 of file resource.h.

#define IDC_CHECKLOG 1142

Definition at line 259 of file resource.h.

#define IDC_CHECKOUTRO 1001

Definition at line 97 of file resource.h.

#define IDC_CHECKPATH 1053

Definition at line 173 of file resource.h.

#define IDC_CHECKPROXY 1085

Definition at line 209 of file resource.h.

#define IDC_CHECKPSERVERPORT 1029

Definition at line 140 of file resource.h.

#define IDC_CHECKREV 1199

Definition at line 316 of file resource.h.

#define IDC_CHECKRHOSTPORT 1028

Definition at line 139 of file resource.h.

#define IDC_CHECKRSHNAME 1035

Definition at line 147 of file resource.h.

#define IDC_CHECKSERVERNAME 1033

Definition at line 144 of file resource.h.

#define IDC_CHECKSTATUS 1146

Definition at line 266 of file resource.h.

#define IDC_CHECKUNIXLF 1005

Definition at line 106 of file resource.h.

#define IDC_CHECKUNMOD 1079

Definition at line 200 of file resource.h.

#define IDC_CHECKUPDATE 1139

Definition at line 256 of file resource.h.

#define IDC_CHECKVALIDEDITS 1132

Definition at line 250 of file resource.h.

#define IDC_CLEANCOPY 1027

Definition at line 138 of file resource.h.

#define IDC_CMDLINE 1011

Definition at line 115 of file resource.h.

#define IDC_CMDMENU 1099

Definition at line 224 of file resource.h.

#define IDC_COMBO 1081

Definition at line 204 of file resource.h.

#define IDC_COMBO_REV 1146

Definition at line 265 of file resource.h.

#define IDC_COMBODATE 1057

Definition at line 180 of file resource.h.

#define IDC_COMBODATE1 1044

Definition at line 161 of file resource.h.

#define IDC_COMBODATE2 1046

Definition at line 164 of file resource.h.

#define IDC_COMBOMODNAME 1133

Definition at line 251 of file resource.h.

#define IDC_COMBOREV 1043

Definition at line 158 of file resource.h.

#define IDC_COMBOREV1 1069

Definition at line 190 of file resource.h.

#define IDC_COMBOREV2 1047

Definition at line 165 of file resource.h.

#define IDC_COMBOROOT 1035

Definition at line 146 of file resource.h.

#define IDC_COMBORSAIDENTITY 1036

Definition at line 151 of file resource.h.

#define IDC_COMBORTAG 1070

Definition at line 192 of file resource.h.

#define IDC_COMBOSTATE 1046

Definition at line 163 of file resource.h.

#define IDC_COMBOUSER 1060

Definition at line 184 of file resource.h.

#define IDC_COMBOVTAG 1132

Definition at line 249 of file resource.h.

#define IDC_COMPARE_TYPE 1202

Definition at line 319 of file resource.h.

#define IDC_CONSOLE 1144

Definition at line 262 of file resource.h.

#define IDC_CREATEMISSDIR 1026

Definition at line 136 of file resource.h.

#define IDC_CTNLADD 1008

Definition at line 110 of file resource.h.

#define IDC_CURRENT_OPTIONS 1386

Definition at line 333 of file resource.h.

#define IDC_CVSGUISFURL 1098

Definition at line 223 of file resource.h.

#define IDC_CVSROOT 1000

Definition at line 95 of file resource.h.

#define IDC_CVSVERS 1017

Definition at line 121 of file resource.h.

#define IDC_DATE 1040

Definition at line 155 of file resource.h.

#define IDC_DEAD 1164

Definition at line 283 of file resource.h.

#define IDC_DEFBRANCH 1061

Definition at line 185 of file resource.h.

#define IDC_DELALL 1103

Definition at line 228 of file resource.h.

#define IDC_DELCVSINFO 1104

Definition at line 230 of file resource.h.

#define IDC_DELDIR 1209

Definition at line 326 of file resource.h.

#define IDC_DELETED 1113

Definition at line 235 of file resource.h.

#define IDC_DELSTICKY 1025

Definition at line 133 of file resource.h.

#define IDC_DIFF 1147

Definition at line 267 of file resource.h.

#define IDC_DIFFOPTIONS 1205

Definition at line 322 of file resource.h.

#define IDC_DIFFPROG 1078

Definition at line 199 of file resource.h.

#define IDC_DIRECTORY 1120

Definition at line 238 of file resource.h.

#define IDC_DIRTYSUPPORT 1004

Definition at line 103 of file resource.h.

#define IDC_DISABLESPLASHSCREEN 1006

Definition at line 108 of file resource.h.

#define IDC_DOWN 1104

Definition at line 229 of file resource.h.

#define IDC_EDIT_CHECKOUTDIR 1121

Definition at line 240 of file resource.h.

#define IDC_EDIT_POSITION 1079

Definition at line 201 of file resource.h.

#define IDC_EDITENTRY 1037

Definition at line 152 of file resource.h.

#define IDC_EDITHOST 1086

Definition at line 210 of file resource.h.

#define IDC_EDITLOGOUT 1084

Definition at line 208 of file resource.h.

#define IDC_EDITPORT 1087

Definition at line 211 of file resource.h.

#define IDC_ENTRYSTATE 1039

Definition at line 154 of file resource.h.

#define IDC_ENTRYSTATE2 1056

Definition at line 179 of file resource.h.

#define IDC_ENTRYSTATE3 1041

Definition at line 156 of file resource.h.

#define IDC_ENTRYSTATE4 1042

Definition at line 157 of file resource.h.

#define IDC_ENTRYSTATE5 1043

Definition at line 159 of file resource.h.

#define IDC_ENTRYSTATE6 1057

Definition at line 181 of file resource.h.

#define IDC_EXPORT 1089

Definition at line 213 of file resource.h.

#define IDC_EXTDIFF 1076

Definition at line 197 of file resource.h.

#define IDC_EXTDIFFSEL 1077

Definition at line 198 of file resource.h.

#define IDC_FILENAME 1214

Definition at line 329 of file resource.h.

#define IDC_FILETODIFF 1148

Definition at line 268 of file resource.h.

#define IDC_FOLDERLOC 1013

Definition at line 117 of file resource.h.

#define IDC_FORCE 1023

Definition at line 129 of file resource.h.

#define IDC_FORCECOMMIT 1128

Definition at line 244 of file resource.h.

#define IDC_FORCERECURSE 1129

Definition at line 246 of file resource.h.

#define IDC_FORCEREVISION 1130

Definition at line 247 of file resource.h.

#define IDC_FORCEROOT 1088

Definition at line 212 of file resource.h.

#define IDC_GROUP_OPTIONS 1200

Definition at line 317 of file resource.h.

#define IDC_GRPBOX_TEXT 1179

Definition at line 296 of file resource.h.

#define IDC_HEADER 1152

Definition at line 271 of file resource.h.

#define IDC_HEADERS 1051

Definition at line 170 of file resource.h.

#define IDC_HEADERSDESC 1053

Definition at line 174 of file resource.h.

#define IDC_HELPINIT 1090

Definition at line 214 of file resource.h.

#define IDC_HELPLOGIN 1201

Definition at line 318 of file resource.h.

#define IDC_HOME 1055

Definition at line 177 of file resource.h.

#define IDC_HOST 1135

Definition at line 252 of file resource.h.

#define IDC_IGNORECASE 1119

Definition at line 237 of file resource.h.

#define IDC_IGNOREWHITESPACE 1118

Definition at line 236 of file resource.h.

#define IDC_ISDATE 1145

Definition at line 263 of file resource.h.

#define IDC_ISDATE1 1064

Definition at line 188 of file resource.h.

#define IDC_ISDATE2 1065

Definition at line 189 of file resource.h.

#define IDC_ITEM 1195

Definition at line 312 of file resource.h.

#define IDC_ITEMLABEL 1196

Definition at line 313 of file resource.h.

#define IDC_ITEMLIST 1191

Definition at line 309 of file resource.h.

#define IDC_KEYWORDDESC 1204

Definition at line 321 of file resource.h.

#define IDC_KEYWORDSUBSTITUTION 1203

Definition at line 320 of file resource.h.

#define IDC_KSERVER 1006

Definition at line 107 of file resource.h.

#define IDC_KSERVERPORT 1032

Definition at line 143 of file resource.h.

#define IDC_LAUNCHEDITOR 1109

Definition at line 232 of file resource.h.

#define IDC_LISTENTRIES 1036

Definition at line 148 of file resource.h.

#define IDC_LOCATE 1091

Definition at line 215 of file resource.h.

#define IDC_LOGIN 1136

Definition at line 253 of file resource.h.

#define IDC_LOGMSG 1024

Definition at line 130 of file resource.h.

Referenced by CCommit_MAIN::GetLogMsgID().

#define IDC_LOGMSG_WRAP 1025

Definition at line 134 of file resource.h.

Referenced by CCommit_MAIN::GetLogMsgID().

#define IDC_LOGOUT 1010

Definition at line 114 of file resource.h.

#define IDC_MATCH 1058

Definition at line 182 of file resource.h.

#define IDC_MENULIST 1106

Definition at line 231 of file resource.h.

#define IDC_MERGE 1048

Definition at line 166 of file resource.h.

#define IDC_MERGE1 1059

Definition at line 183 of file resource.h.

#define IDC_MERGE2 1045

Definition at line 162 of file resource.h.

#define IDC_MODNAME 1020

Definition at line 124 of file resource.h.

#define IDC_MODULE 1209

Definition at line 325 of file resource.h.

#define IDC_MODULE_LIST 1186

Definition at line 307 of file resource.h.

#define IDC_MODULEDESC_TEXT 1181

Definition at line 298 of file resource.h.

#define IDC_NEXTTIP 1002

Definition at line 100 of file resource.h.

#define IDC_NODE 1161

Definition at line 280 of file resource.h.

#define IDC_NOMODULEPROGRAM 1131

Definition at line 248 of file resource.h.

#define IDC_NORECURS 1022

Definition at line 127 of file resource.h.

#define IDC_NOTAGS 1050

Definition at line 168 of file resource.h.

#define IDC_NOUSERS 1051

Definition at line 169 of file resource.h.

#define IDC_ONLYRCS 1063

Definition at line 187 of file resource.h.

#define IDC_OPTION 1197

Definition at line 314 of file resource.h.

#define IDC_OPTIONDESC 1168

Definition at line 287 of file resource.h.

#define IDC_OPTIONDETAILS 1390

Definition at line 335 of file resource.h.

#define IDC_OPTIONSLIST 1388

Definition at line 334 of file resource.h.

#define IDC_OPTIONSMENU 1206

Definition at line 323 of file resource.h.

#define IDC_OPTIONSTRING 1167

Definition at line 286 of file resource.h.

#define IDC_OPTIONSTRING_SL 1169

Definition at line 288 of file resource.h.

#define IDC_OUTPUT_QUICK 1182

Definition at line 299 of file resource.h.

#define IDC_OUTPUT_STANDARD 1184

Definition at line 302 of file resource.h.

#define IDC_OUTPUT_VERBOSE 1183

Definition at line 300 of file resource.h.

#define IDC_OVERWRITE 1024

Definition at line 131 of file resource.h.

#define IDC_PASSWD 1010

Definition at line 113 of file resource.h.

#define IDC_PATH 1023

Definition at line 128 of file resource.h.

#define IDC_PREVCMD 1175

Definition at line 293 of file resource.h.

#define IDC_PREVIEWINFO 1173

Definition at line 292 of file resource.h.

#define IDC_PROGRAM 1071

Definition at line 193 of file resource.h.

#define IDC_PROGRESS 1093

Definition at line 216 of file resource.h.

#define IDC_PROGRESS_TEXT 1210

Definition at line 327 of file resource.h.

#define IDC_PROMPTEDIT 1009

Definition at line 111 of file resource.h.

#define IDC_PRUNE 1003

Definition at line 101 of file resource.h.

#define IDC_PSERVER 1005

Definition at line 105 of file resource.h.

#define IDC_PSERVERPORT 1030

Definition at line 141 of file resource.h.

#define IDC_PYTHONURL 1172

Definition at line 291 of file resource.h.

#define IDC_QUIET 1007

Definition at line 109 of file resource.h.

#define IDC_RADIOCONTROL 1144

Definition at line 261 of file resource.h.

#define IDC_RADIOSHIFT 1143

Definition at line 260 of file resource.h.

#define IDC_READFROM 1193

Definition at line 311 of file resource.h.

#define IDC_REFRESH 1192

Definition at line 310 of file resource.h.

#define IDC_REMIND 1171

Definition at line 290 of file resource.h.

#define IDC_REMOVE 1102

Definition at line 226 of file resource.h.

#define IDC_RESET 1150

Definition at line 270 of file resource.h.

#define IDC_REV 1044

Definition at line 160 of file resource.h.

#define IDC_REVISION 1216

Definition at line 331 of file resource.h.

#define IDC_REVISION_SPIN 1215

Definition at line 330 of file resource.h.

#define IDC_RGBBRANCH 1156

Definition at line 275 of file resource.h.

#define IDC_RGBDEAD 1158

Definition at line 277 of file resource.h.

#define IDC_RGBHEADER 1154

Definition at line 273 of file resource.h.

#define IDC_RGBNODE 1157

Definition at line 276 of file resource.h.

#define IDC_RGBSELECTION 1165

Definition at line 284 of file resource.h.

#define IDC_RGBSHADOW 1166

Definition at line 285 of file resource.h.

#define IDC_RGBSTATE 1159

Definition at line 278 of file resource.h.

#define IDC_RGBTAG 1155

Definition at line 274 of file resource.h.

#define IDC_RHOSTPORT 1027

Definition at line 137 of file resource.h.

#define IDC_RHOSTS 1004

Definition at line 102 of file resource.h.

#define IDC_RSAIDENTITY 1098

Definition at line 221 of file resource.h.

#define IDC_RSAIDENTITYSEL 1097

Definition at line 219 of file resource.h.

#define IDC_RSHNAME 1036

Definition at line 150 of file resource.h.

#define IDC_RTAG 1052

Definition at line 171 of file resource.h.

#define IDC_SELECTION 1162

Definition at line 281 of file resource.h.

#define IDC_SELECTIONLIST 1212

Definition at line 328 of file resource.h.

#define IDC_SELFOLDER 1012

Definition at line 116 of file resource.h.

#define IDC_SERVERNAME 1034

Definition at line 145 of file resource.h.

#define IDC_SERVERNAME2 1036

Definition at line 149 of file resource.h.

#define IDC_SETTINGS 1137

Definition at line 254 of file resource.h.

#define IDC_SHADOW 1163

Definition at line 282 of file resource.h.

#define IDC_SPECIFY_REV 1024

Definition at line 132 of file resource.h.

#define IDC_SPINLOGOUT 1083

Definition at line 207 of file resource.h.

#define IDC_STARTUP 1001

Definition at line 98 of file resource.h.

#define IDC_STATE 1062

Definition at line 186 of file resource.h.

#define IDC_STATIC_CURRENTOPTIONS 1418

Definition at line 337 of file resource.h.

#define IDC_STATIC_OPTDESC 1419

Definition at line 338 of file resource.h.

#define IDC_STATICGROUP_SELECTOPTIONS 1417

Definition at line 336 of file resource.h.

#define IDC_STDOUT 1019

Definition at line 123 of file resource.h.

#define IDC_SUPRESS 1052

Definition at line 172 of file resource.h.

#define IDC_TAG 1153

Definition at line 272 of file resource.h.

#define IDC_TAG_LIST 1184

Definition at line 303 of file resource.h.

#define IDC_TAGDESC_TEXT 1180

Definition at line 297 of file resource.h.

#define IDC_TAGNAME 1021

Definition at line 126 of file resource.h.

#define IDC_TCPIP 1002

Definition at line 99 of file resource.h.

#define IDC_TEMPFILE 1170

Definition at line 289 of file resource.h.

#define IDC_TEMPLATE 1111

Definition at line 234 of file resource.h.

#define IDC_TIPSTRING 1004

Definition at line 104 of file resource.h.

Referenced by CTipDlg::OnCtlColor().

#define IDC_UNIFIEDDIFF 1120

Definition at line 239 of file resource.h.

#define IDC_UP 1103

Definition at line 227 of file resource.h.

#define IDC_USE_VIEWER_ALWAYS 1125

Definition at line 242 of file resource.h.

#define IDC_USEDEFIGNORE 1127

Definition at line 243 of file resource.h.

#define IDC_USEFILESTIME 1128

Definition at line 245 of file resource.h.

#define IDC_USER 1049

Definition at line 167 of file resource.h.

#define IDC_VTAG 1026

Definition at line 135 of file resource.h.

#define IDC_WARNINGDESC 1038

Definition at line 153 of file resource.h.

#define IDC_WINCVSURL 1097

Definition at line 220 of file resource.h.

#define IDC_WINCVSVER 1082

Definition at line 206 of file resource.h.

#define IDC_WORDWRAP 1110

Definition at line 233 of file resource.h.

#define IDC_ZLEVEL 1095

Definition at line 217 of file resource.h.

#define IDC_ZSPIN 1096

Definition at line 218 of file resource.h.

#define IDD_ABOUTBOX 100

Definition at line 6 of file resource.h.

#define IDD_ADMINOPTION 196

Definition at line 78 of file resource.h.

#define IDD_ALERT 134

Definition at line 29 of file resource.h.

#define IDD_ANNOTATE_MAIN 192

Definition at line 74 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 48 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.

#define IDD_COMMIT_OPTIONS 186

Definition at line 68 of file resource.h.

#define IDD_CUSTOMIZE 181

Definition at line 62 of file resource.h.

#define IDD_DIFF_MAIN 154

Definition at line 47 of file resource.h.

#define IDD_DIFF_OPTIONS 153

Definition at line 46 of file resource.h.

#define IDD_EDITMESSAGE 195

Definition at line 77 of file resource.h.

#define IDD_EDITORMON 197

Definition at line 79 of file resource.h.

#define IDD_ENTRYDESC 146

Definition at line 39 of file resource.h.

#define IDD_GRAPH_OPTIONS 193

Definition at line 75 of file resource.h.

#define IDD_GSERVER 202

Definition at line 84 of file resource.h.

#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 56 of file resource.h.

#define IDD_ITEM_LIST 205

Definition at line 87 of file resource.h.

#define IDD_LOG_FILTERS 152

Definition at line 44 of file resource.h.

#define IDD_LOG_MAIN 150

Definition at line 43 of file resource.h.

#define IDD_LOGIN_MAIN 206

Definition at line 88 of file resource.h.

#define IDD_NOPYTHON 198

Definition at line 80 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_CVS 207

Definition at line 90 of file resource.h.

#define IDD_PREFS_CVSCMD_DIALOGS 191

Definition at line 73 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 49 of file resource.h.

#define IDD_PROGRESS 177

Definition at line 59 of file resource.h.

#define IDD_PROMPTMESSAGE 194

Definition at line 76 of file resource.h.

#define IDD_PSERVER 189

Definition at line 71 of file resource.h.

#define IDD_RELEASE_MAIN 208

Definition at line 92 of file resource.h.

#define IDD_RSH 188

Definition at line 70 of file resource.h.

#define IDD_RTAG_MAIN 200

Definition at line 82 of file resource.h.

#define IDD_RTAG_OPTIONS 201

Definition at line 83 of file resource.h.

#define IDD_SAVESETTINGS 184

Definition at line 65 of file resource.h.

Referenced by AskCreatePersistentSettings().

#define IDD_SELECTION_DETAILS 209

Definition at line 94 of file resource.h.

#define IDD_SSH 190

Definition at line 72 of file resource.h.

#define IDD_SSPI 204

Definition at line 86 of file resource.h.

#define IDD_STATUS_MAIN 203

Definition at line 85 of file resource.h.

#define IDD_TAG_MAIN 199

Definition at line 81 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 40 of file resource.h.

#define IDD_UPDATE_MERGE 149

Definition at line 42 of file resource.h.

#define IDD_UPDATE_STICKY 148

Definition at line 41 of file resource.h.

#define IDD_WARNINGDESC 145

Definition at line 38 of file resource.h.

#define IDD_YESNO 157

Definition at line 51 of file resource.h.

#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.

#define IDP_SOCKETS_INIT_FAILED 104

Definition at line 10 of file resource.h.

#define IDR_BROWSER 129

Definition at line 25 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_CNTR_INPLACE 6

Definition at line 5 of file resource.h.

#define IDR_CUSTMENUS 182

Definition at line 63 of file resource.h.

#define IDR_CVS_COWORKER 113

Definition at line 19 of file resource.h.

#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 50 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_FILTER 186

Definition at line 67 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_GRAPH 161

Definition at line 53 of file resource.h.

#define IDR_ITEMLIST 207

Definition at line 89 of file resource.h.

#define IDR_MAINFRAME 128

Definition at line 22 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_MENUICONS 178

Definition at line 60 of file resource.h.

#define IDR_MULTIUSER 158

Definition at line 52 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_STATEICONS 164

Definition at line 54 of file resource.h.

#define IDR_TAGS 165

Definition at line 55 of file resource.h.

Referenced by CWincvsApp::InitInstance().

#define IDR_WINCVSTYPE 129

Definition at line 23 of file resource.h.

#define IDR_WORKSPACE 173

Definition at line 57 of file resource.h.

#define IDS_COMBOBROWSER 32813

Definition at line 360 of file resource.h.

#define IDS_DEFFONT 129

Definition at line 24 of file resource.h.

Generated on Fri Jan 31 12:12:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:03 2003 for WinCvs Source by doxygen 1.3-rc2


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]

Generated on Fri Jan 31 12:13:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 103 of file Stat.cpp.

References errors.

Referenced by _statcore().

00104 {
00105     int n;
00106     for(n=0; n<sizeof(errors)/sizeof(errors[0]); n++)
00107     {
00108         if(errors[n].err==dwErr)
00109         {
00110             errno=errors[n].dos;
00111             return;
00112         }
00113     }
00114     errno=EFAULT;
00115 }

int _statcore | ( | HANDLE | hFile,
 |  | const char * | filename,
 |  | struct stat * | buf
 | ) | [static]

Definition at line 431 of file Stat.cpp.

References _dosmaperr(), ASSERT, and FileTimeToUnixTime().

Referenced by wnt_fstat(), wnt_lstat(), and wnt_stat().

00432 {
00433     BY_HANDLE_FILE_INFORMATION bhfi;
00434     int isdev;
00435     char szFs[32];
00436     int is_gmt_fs = -1;
00437
00438     if(hFile)
00439     {
00440         /* Find out what kind of handle underlies filedes
00441         */
00442         isdev = GetFileType(hFile) & ~FILE_TYPE_REMOTE;
00443
00444         if ( isdev != FILE_TYPE_DISK )
00445         {
00446             /* not a disk file. probably a device or pipe
00447              */
00448             if ( (isdev == FILE_TYPE_CHAR) || (isdev == FILE_TYPE_PIPE) )
00449             {
00450                 /* treat pipes and devices similarly. no further info is
00451                  * available from any API, so set the fields as reasonably
00452                  * as possible and return.
00453                  */
00454                 if ( isdev == FILE_TYPE_CHAR )
00455                     buf->st_mode = _S_IFCHR;
00456                 else
00457                     buf->st_mode = _S_IFIFO;
00458
00459                 buf->st_rdev = buf->st_dev = (_dev_t)hFile;
00460                 buf->st_nlink = 1;
00461                 buf->st_uid = buf->st_gid = buf->st_ino = 0;
00462                 buf->st_atime = buf->st_mtime = buf->st_ctime = 0;
00463                 if ( isdev == FILE_TYPE_CHAR )
00464                     buf->st_size = 0;
00465                 else
00466                 {
00467                     unsigned long ulAvail;
00468                     int rc;
00469                     rc = PeekNamedPipe(hFile,NULL,0,NULL,&ulAvail,NULL);
00470                     if (rc)
00471                         buf->st_size = (_off_t)ulAvail;
00472                     else
00473                         buf->st_size = (_off_t)0;
00474                 }
00475
00476                 return 0;
00477             }
00478             else if ( isdev == FILE_TYPE_UNKNOWN )
00479             {
00480                 // Network device
00481                 errno = EBADF;
00482                 return -1;
00483             }
00484         }
00485     }
00486
00487     /* set the common fields
00488      */
00489     buf->st_ino = buf->st_uid = buf->st_gid = buf->st_mode = 0;
00490     buf->st_nlink = 1;
00491
00492     if(hFile)
00493     {
00494         /* use the file handle to get all the info about the file
00495          */
00496         if ( !GetFileInformationByHandle(hFile, &bhfi) )
00497         {
00498             _dosmaperr(GetLastError());
00499             return -1;
00500         }
00501     }
00502     else
00503     {
00504         WIN32_FIND_DATA fd;
00505         HANDLE hFind;
00506
00507         if(strlen(filename)==3 && !stricmp(filename+1,":\\"))
00508         {
00509             // Can't do anything about the root directory...
00510             // Win2k and Win98 can return info, but Win95 can't, so
00511             // it's best to do nothing.
00512             memset(&bhfi,0,sizeof(bhfi));
00513             bhfi.dwFileAttributes=GetFileAttributes(filename);
00514             if(bhfi.dwFileAttributes==0xFFFFFFFF)
00515             {
00516                 _dosmaperr(GetLastError());
00517                 return -1;
00518             }
00519             bhfi.nNumberOfLinks=1;
00520         }
00521         else
00522         {
00523             hFind=FindFirstFile(filename,&fd);
00524             if(hFind==INVALID_HANDLE_VALUE)
00525             {
00526                 _dosmaperr(GetLastError());
00527                 return -1;
00528             }
00529             FindClose(hFind);
00530             memset(&bhfi,0,sizeof(bhfi));
00531             bhfi.dwFileAttributes=fd.dwFileAttributes;
00532             bhfi.ftCreationTime=fd.ftCreationTime;
00533             bhfi.ftLastAccessTime=fd.ftLastAccessTime;
00534             bhfi.ftLastWriteTime=fd.ftLastWriteTime;
00535             bhfi.nFileSizeLow=fd.nFileSizeLow;
00536             bhfi.nFileSizeHigh=fd.nFileSizeHigh;
00537             bhfi.nNumberOfLinks=1;
00538         }
00539     }
00540
00541     if ( bhfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY )
00542         buf->st_mode |= (_S_IREAD + (_S_IREAD >> 3) + (_S_IREAD >> 6));
00543     else
00544         buf->st_mode |= ((_S_IREAD|_S_IWRITE) + ((_S_IREAD|_S_IWRITE) >> 3)
00545           + ((_S_IREAD|_S_IWRITE) >> 6));
00546     if (bhfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
00547         buf->st_mode |= (_S_IEXEC + (_S_IEXEC >> 3) + (_S_IEXEC >> 6));
00548
00549     // Potential, but unlikely problem... casting DWORD to short.
00550     // Reported by Jerzy Kaczorowski, addressed by Jonathan Gilligan
00551     // if the number of links is greater than 0x7FFF
00552     // there would be an overflow problem.
00553     // This is a problem inherent in the struct stat, and hence
00554     // in the design of the C library.
00555     ASSERT(bhfi.nNumberOfLinks <= SHRT_MAX);
00556     if (bhfi.nNumberOfLinks > SHRT_MAX) {
00557         buf->st_nlink = SHRT_MAX;
00558         }
00559     else {
00560         buf->st_nlink= static_cast<short>(bhfi.nNumberOfLinks);
00561         }
00562
00563     if(!filename)
00564     {
00565         // We have to assume here that the repository doesn't span drives, so the
00566         // current directory is correct.
00567         *szFs='\0';
00568         GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,32);
00569         if(!stricmp(szFs,"NTFS"))
00570             is_gmt_fs = 1;
00571         else
00572             is_gmt_fs = 0;
00573     }
00574     else
00575     {
00576         if(filename[1]!=':')
00577         {
00578             if((filename[0]=='\\' || filename[0]=='/') && (filename[1]=='\\' || filename[1]=='/'))
00579             {
00580                 // UNC pathname, assumed to be on an NTFS server.  No way to
00581                 // check, actually (GVI doesn't return anything useful).
00582                 is_gmt_fs = 1;
00583             }
00584             else
00585             {
00586                 // Relative path, treat as local
00587                 GetVolumeInformation(NULL,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00588                 if(!stricmp(szFs,"NTFS"))
00589                     is_gmt_fs = 1;
00590                 else
00591                     is_gmt_fs = 0;
00592             }
00593         }
00594         else
00595         {
00596             // Drive specified...
00597             char szRootPath[4] = "?:\\";
00598             szRootPath[0]=filename[0];
00599             *szFs='\0';
00600             GetVolumeInformation(szRootPath,NULL,0,NULL,NULL,NULL,szFs,sizeof(szFs));
00601             if(!stricmp(szFs,"NTFS") || !stricmp(szFs,"HPFS"))
00602                 is_gmt_fs = 1;
00603             else
00604                 is_gmt_fs = 0;
00605         }
00606     }
00607
00608     if(is_gmt_fs) // NTFS - everything is in GMT already
00609     {
00610         FileTimeToUnixTime ( &bhfi.ftLastAccessTime, &buf->st_atime, FALSE );
00611         FileTimeToUnixTime ( &bhfi.ftLastWriteTime, &buf->st_mtime, FALSE );
00612         FileTimeToUnixTime ( &bhfi.ftCreationTime, &buf->st_ctime, FALSE );
00613     }
00614     else
00615     {
00616         // FAT - timestamps are in incorrectly translated local time.
00617         // translate them back and let FileTimeToUnixTime() do the
00618         // job properly.
00619
00620         FILETIME At,Wt,Ct;
00621
00622         FileTimeToLocalFileTime ( &bhfi.ftLastAccessTime, &At );
00623         FileTimeToLocalFileTime ( &bhfi.ftLastWriteTime, &Wt );
00624         FileTimeToLocalFileTime ( &bhfi.ftCreationTime, &Ct );
00625         FileTimeToUnixTime ( &At, &buf->st_atime, TRUE );
00626         FileTimeToUnixTime ( &Wt, &buf->st_mtime, TRUE );
00627         FileTimeToUnixTime ( &Ct, &buf->st_ctime, TRUE );
00628     }
00629
00630     buf->st_size = bhfi.nFileSizeLow;
00631     if(bhfi.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
00632         buf->st_mode |= _S_IFDIR;
00633     else
00634         buf->st_mode |= _S_IFREG;
00635
00636     /* On DOS, this field contains the drive number, but
00637      * the drive number is not available on this platform.
00638      * Also, for UNC network names, there is no drive number.
00639      */
00640     buf->st_rdev = buf->st_dev = 0;
00641     return 0;
00642 }

int CompareTargetDate | ( | const SYSTEMTIME * | p_test_date,
 |  | const SYSTEMTIME * | p_target_date
 | ) | [static]

Definition at line 169 of file Stat.cpp.

References ASSERT, IsLeapYear(), and month_len.

Referenced by GetTimeZoneBias(), and IsDST().

00173 {
00174     WORD first_day_of_month; /* day of week of the first. Sunday = 0 */
00175     WORD end_of_month;       /* last day of month */
00176     WORD temp_date;
00177     int test_milliseconds, target_milliseconds;
00178
00179     /* Check that p_target_date is in the correct foramt: */
00180     ASSERT(p_target_date->wYear==0 && p_test_date->wYear != 0);
00181     if (p_target_date->wYear != 0 || p_test_date->wYear == 0)
00182         return 0;
00183
00184     /* Don't waste time calculating if we can shortcut the comparison... */
00185     if (p_test_date->wMonth != p_target_date->wMonth)
00186     {
00187         return (p_test_date->wMonth > p_target_date->wMonth) ? 4 : -4;
00188     }
00189
00190     /* Months equal. Now we neet to do some calculation.
00191      * If we know that y is the day of the week for some arbitrary date x,
00192      * then the day of the week of the first of the month is given by
00193      * (1 + y - x) mod 7.
00194      *
00195      * For instance, if the 19th is a Wednesday (day of week = 3), then
00196      * the date of the first Wednesday of the month is (19 mod 7) = 5.
00197      * If the 5th is a Wednesday (3), then the first of the month is
00198      * four days earlier (it's the first, not the zeroth):
00199      * (3 - 4) = -1; -1 mod 7 = 6. The first is a Saturday.
00200      *
00201      * Check ourselves: The 19th falls on a (6 + 19 - 1) mod 7
00202      * = 24 mod 7 = 3: Wednesday, as it should be.
00203      */
00204     first_day_of_month = (WORD)( (1u + p_test_date->wDayOfWeek - p_test_date->wDay) % 7u);
00205
00206     /* If the first of the month comes on day y, then the first day of week z falls on
00207      * (z - y + 1) mod 7.
00208      *
00209      * For instance, if the first is a Saturday (6), then the first Tuesday (2) falls on a
00210      * (2 - 6 + 1) mod 7 = -3 mod 7 = 4: The fourth. This is correct (see above).
00211      *
00212      * temp_date gets the first <target day of week> in the month.
00213      */
00214     temp_date = (WORD)( (1u + p_target_date->wDayOfWeek - first_day_of_month) % 7u);
00215     /* If we're looking for the third Tuesday in the month, find the date of the first
00216      * Tuesday and add (3 - 1) * 7. In the example, it's the 4 + 14 = 18th.
00217      *
00218      * temp_date now should hold the date for the wDay'th wDayOfWeek of the month.
00219      * we only need to handle the special case of the last <DayOfWeek> of the month.
00220      */
00221     temp_date = (WORD)( temp_date + 7 * p_target_date->wDay );
00222
00223     /* what's the last day of the month? */
00224     end_of_month = month_len [p_target_date->wMonth - 1];
00225     /* Correct if it's February of a leap year? */
00226     if ( p_test_date->wMonth == 2 && IsLeapYear(p_test_date->wYear) )
00227     {
00228         ++ end_of_month;
00229     }
00230
00231     /* if we tried to calculate the fifth Tuesday of the month
00232      * we may well have overshot. Correct for that case.
00233      */
00234     while ( temp_date > end_of_month)
00235         temp_date -= 7;
00236
00237     /* At long last, we're ready to do the comparison. */
00238     if ( p_test_date->wDay != temp_date )
00239     {
00240         return (p_test_date->wDay > temp_date) ? 2 : -2;
00241     }
00242     else
00243     {
00244         test_milliseconds = ((p_test_date->wHour * 60 + p_test_date->wMinute) * 60
00245                                 + p_test_date->wSecond) * 1000 + p_test_date->wMilliseconds;
00246         target_milliseconds = ((p_target_date->wHour * 60 + p_target_date->wMinute) * 60
00247                                 + p_target_date->wSecond) * 1000 + p_target_date->wMilliseconds;
00248         test_milliseconds -= target_milliseconds;
00249         return (test_milliseconds > 0) ? 1 : (test_milliseconds < 0) ? -1 : 0;
00250     }
00251
00252 }

BOOL FileTimeToUnixTime | ( | const FILETIME * | pft,
 |  | time_t * | put,
 |  | BOOL | local_time
 | ) | [static]

Definition at line 354 of file Stat.cpp.

References cvs_err(), FALSE, GetTimeZoneBias(), GetWinCvsDebugMaskBit(), IsDST(), and systemtime_second.

Referenced by _statcore().

00355 {
00356     BOOL success = FALSE;
00357
00358    /* FILETIME = number of 100-nanosecond ticks since midnight
00359     * 1 Jan 1601 UTC. time_t = number of 1-second ticks since
00360     * midnight 1 Jan 1970 UTC. To translate, we subtract a
00361     * FILETIME representation of midnight, 1 Jan 1970 from the
00362     * time in question and divide by the number of 100-ns ticks
00363     * in one second.
00364     */
00365
00366
00367     SYSTEMTIME base_st =
00368     {
00369         1970,   /* wYear            */
00370         1,      /* wMonth           */
00371         0,      /* wDayOfWeek       */
00372         1,      /* wDay             */
00373         0,      /* wHour            */
00374         0,      /* wMinute          */
00375         0,      /* wSecond          */
00376         0       /* wMilliseconds    */
00377     };
00378
00379     ULARGE_INTEGER itime;
00380     FILETIME base_ft;
00381     int bias = 0;
00382
00383     if (local_time)
00384     {
00385         SYSTEMTIME temp_st;
00386         success = FileTimeToSystemTime(pft, & temp_st);
00387         bias =  GetTimeZoneBias(& temp_st);
00388     }
00389
00390     success = SystemTimeToFileTime ( &base_st, &base_ft );
00391     if (success)
00392     {
00393         itime.QuadPart = ((ULARGE_INTEGER *)pft)->QuadPart;
00394
00395         itime.QuadPart -= ((ULARGE_INTEGER *)&base_ft)->QuadPart;
00396         itime.QuadPart /= systemtime_second;    // itime is now in seconds.
00397         itime.QuadPart += bias * 60;    // bias is in minutes.
00398
00399         *put = itime.LowPart;
00400     }
00401
00402     if (!success)
00403     {
00404         *put = -1;   /* error value used by mktime() */
00405     }
00406
00407     if (GetWinCvsDebugMaskBit(wcvsdbg_trace_stat_bit))
00408     {
00409             char scratch[128];
00410             SYSTEMTIME temp_st;
00411             struct tm gmt;
00412             bool bDst;
00413             FileTimeToSystemTime(pft, &temp_st);
00414             bDst = IsDST(& temp_st);
00415             gmt = *gmtime(put);
00416             _snprintf(scratch, 128,
00417                 "Converting file time (%s, bias = %d): %s %02d %02d:%02d:%02d.%03d %4d --> %s\n",
00418                 local_time ? (bDst ? "Daylight" : "Standard") : "UTC", bias,
00419                 month_names[temp_st.wMonth - 1], temp_st.wDay,
00420                 temp_st.wHour, temp_st.wMinute, temp_st.wSecond, temp_st.wMilliseconds,
00421                 temp_st.wYear,
00422                 asctime(& gmt) );
00423
00424             cvs_err(scratch);
00425             OutputDebugString(scratch);
00426     }
00427
00428     return success;
00429 }

int GetTimeZoneBias ( const SYSTEMTIME * pst ) [static]

Definition at line 259 of file Stat.cpp.

References ASSERT, and CompareTargetDate().

Referenced by FileTimeToUnixTime(), and LocalSystemTimeToUtcSystemTime().

00260 {
00261     TIME_ZONE_INFORMATION tz;
00262     int n, bias;
00263
00264     GetTimeZoneInformation ( &tz );
00265
00266     /*  I only deal with cases where we look at
00267      *  a "last sunday" kind of thing.
00268      */
00269     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00270
00271     bias = tz.Bias;
00272
00273     n = CompareTargetDate ( pst, & tz.DaylightDate );
00274     if (n < 0)
00275         bias += tz.StandardBias;
00276     else
00277     {
00278         n = CompareTargetDate ( pst, & tz.StandardDate );
00279         if (n < 0)
00280             bias += tz.DaylightBias;
00281         else
00282             bias += tz.StandardBias;
00283     }
00284     return bias;
00285 }

bool IsDST ( const SYSTEMTIME * pst ) [static]

Definition at line 290 of file Stat.cpp.

References ASSERT, and CompareTargetDate().

Referenced by FileTimeToUnixTime().

00291 {
00292     TIME_ZONE_INFORMATION tz;
00293
00294     GetTimeZoneInformation ( &tz );
00295
00296     /*  I only deal with cases where we look at
00297      *  a "last sunday" kind of thing.
00298      */
00299     ASSERT(tz.DaylightDate.wYear == 0 && tz.StandardDate.wYear == 0);
00300
00301     return (CompareTargetDate ( pst, & tz.DaylightDate ) >= 0)
00302             && (CompareTargetDate ( pst, & tz.StandardDate ) < 0);
00303 }

BOOL IsLeapYear ( WORD year )

Definition at line 126 of file Stat.cpp.

Referenced by CompareTargetDate().

00127 {
00128     return ( (year & 3u == 0)
00129             && ( (year % 100u == 0)
00130                 || (year % 400u == 0) ));
00131 }

void LocalSystemTimeToUtcSystemTime | ( | const SYSTEMTIME * | p_local,
 |  | SYSTEMTIME * | p_utc
 | ) |

Definition at line 321 of file Stat.cpp.

References GetTimeZoneBias(), and systemtime_second.

00322 {
00323     FILETIME ft;
00324     ULARGE_INTEGER itime, delta;
00325     int bias = GetTimeZoneBias(p_local);
00326
00327     // delta = bias correction: bias minutes.
00328     SystemTimeToFileTime(p_local, & ft);
00329     itime.QuadPart = ((ULARGE_INTEGER *) &ft)->QuadPart;
00330     delta.QuadPart = systemtime_second * 60 * bias;   // bias in minutes...
00331     itime.QuadPart += delta.QuadPart;
00332
00333     ((ULARGE_INTEGER *) & ft)->QuadPart = itime.QuadPart;
00334     FileTimeToSystemTime(& ft, p_utc);
00335 }

int wnt_fstat | ( | int | fildes,
 |  | struct stat * | buf
 | ) |

Definition at line 651 of file Stat.cpp.

References _statcore().

00652 {
00653     return _statcore((HANDLE)_get_osfhandle(fildes),NULL,buf);
00654 }

int wnt_lstat | ( | const char * | name,
 |  | struct stat * | buf
 | ) |

Definition at line 656 of file Stat.cpp.

References _statcore().

00657 {
00658     return _statcore(NULL,name,buf);
00659 }

int wnt_stat | ( | const char * | name,
 |  | struct stat * | buf
 | ) |

Definition at line 644 of file Stat.cpp.

References _statcore().

00645 {
00646     if(stricmp(name,"Entries") && stricmp(name,"Entries.log"))
00647         name=name;
00648     return _statcore(NULL,name,buf);
00649 }

Variable Documentation

int dos

Definition at line 27 of file Stat.cpp.

DWORD err

Definition at line 27 of file Stat.cpp.

Referenced by CompatEndMoveToTrash(), CompatLoadLibrary(), findTcl(), CvsPrefs::load(), CPersistent::LoadAll(), MakeTmpFile(), 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 76 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 92 of file Stat.cpp.

const ULONGLONG systemtime_second = 10000000L [static]

Definition at line 100 of file Stat.cpp.

Referenced by FileTimeToUnixTime(), and LocalSystemTimeToUtcSystemTime().

Generated on Fri Jan 31 12:13:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 "cvsgui_i18n.h"
#include "CJLibrary.h"
#include <atlbase.h>
#include <atlcom.h>
#include "TipDlg.h"
#include <vector>
#include <map>
#include <string>
#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 42 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 104 of file StdAfx.h.

#define lstat wnt_lstat

Definition at line 105 of file StdAfx.h.

#define qCvsDebug 0

Definition at line 36 of file StdAfx.h.

#define stat wnt_stat

Definition at line 106 of file StdAfx.h.

Referenced by RemoveCvsArgs::addfile(), BrowserGetDirectory(), BuildIgnoredList(), CBrowseFileView::EditSel(), Entries_SetVisited(), FileTraverse(), FormatDefaultSettingsLoc(), CBrowseFileView::GetEntriesModTime(), UCvsFiles::GetEntriesModTime(), getLoc(), launchCVS(), CWincvsApp::LookForResourceFile(), MakeTmpFile(), 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(), TestFileIsAlias(), UCvsGraph::UCvsGraph(), CvsPrefs::WhichCvs(), and WinInitWidgets().

#define UASSERT ASSERT

Definition at line 39 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 54 of file StdAfx.h.

Referenced by CWincvsApp::ExitInstance(), and CWincvsApp::InitATL().

Generated on Fri Jan 31 12:11:08 2003 for WinCvs Source by doxygen 1.3-rc2


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
00027 // CvsGui stuff
00028
00029 #include "cvsgui_i18n.h"
00030
00031 #include "CJLibrary.h"      // CJLibrary
00032
00033 #ifdef _DEBUG
00034 #   define qCvsDebug 1
00035 #else
00036 #   define qCvsDebug 0
00037 #endif
00038
00039 #define UASSERT ASSERT
00040 // for the pseudo-interface
00041
00042 #define _ATL_APARTMENT_THREADED
00043 #include <atlbase.h>
00044 //You may derive a class from CComModule and use it if you want to override
00045 //something, but do not change the name of _Module
00046 class CCVS_CoworkerModule : public CComModule
00047 {
00048 public:
00049     LONG Unlock();
00050     LONG Lock();
00051     LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2);
00052     DWORD dwThreadID;
00053 };
00054 extern CCVS_CoworkerModule _Module;
00055 #include <atlcom.h>
00056
00057 #include "TipDlg.h"         // Tip of the Day
00058
00060 // STL
00061
00062 #pragma warning(push)
00063 #pragma warning(disable : 4786)
00064
00065 #include <vector>
00066 #include <map>
00067 #include <string>
00068
00069 #pragma warning(pop)
00070
00071 #include <afxrich.h>        // Rich edit
00072 #include <afxcview.h>       // Common control classes
00073
00074
00075 #ifdef _DEBUG
00076 #   include <malloc.h>
00077 #   include <stdlib.h>
00078 #   include <crtdbg.h>
00079 #   define   malloc(s)         _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
00080 #   define   calloc(c, s)      _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
00081 #   define   realloc(p, s)     _realloc_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__)
00082 #   define   free(p)           _free_dbg(p, _NORMAL_BLOCK)
00083 #endif
00084
00085 #include <sys/stat.h>
00086 // Replacement stat() routine
00087 struct wnt_stat {
00088         _dev_t st_dev;
00089         _ino_t st_ino;
00090         unsigned short st_mode;
00091         short st_nlink;
00092         short st_uid;
00093         short st_gid;
00094         _dev_t st_rdev;
00095         _off_t st_size;
00096         time_t st_atime;
00097         time_t st_mtime;
00098         time_t st_ctime;
00099         };
00100 int wnt_stat(const char *name, struct wnt_stat *buf);
00101 int wnt_fstat (int fildes, struct wnt_stat *buf);
00102 int wnt_lstat (const char *name, struct wnt_stat *buf);
00103
00104 #define fstat wnt_fstat
00105 #define lstat wnt_lstat
00106 #define stat wnt_stat
00107
00108 //{{AFX_INSERT_LOCATION}}
00109 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00110
00111 #endif // !defined(AFX_STDAFX_H__D2D77DCA_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/TbEdit.cpp Source File

WinCvs/TbEdit.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>
00019  */
00020
00021 // TbEdit.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "TbEdit.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00035 // CTbEdit
00036
00037 CTbEdit::CTbEdit()
00038 {
00039 }
00040
00041 CTbEdit::~CTbEdit()
00042 {
00043 }
00044
00045
00046 BEGIN_MESSAGE_MAP(CTbEdit, CEdit)
00047     //{{AFX_MSG_MAP(CTbEdit)
00048     //}}AFX_MSG_MAP
00049 END_MESSAGE_MAP()
00050
00051
00052 // CTbEdit message handlers
00053
00054
00055 BOOL CTbEdit::PreTranslateMessage(MSG* pMsg)
00056 {
00057     if (pMsg->message == WM_KEYDOWN)
00058     {
00059         int nVirtKey = (int) pMsg->wParam;
00060         switch (nVirtKey)
00061         {
00062             case VK_ESCAPE:
00063                 GetOwner()->PostMessage(WM_CONTENTCHANGE, FALSE);
00064                 break;
00065             case VK_RETURN:
00066                 GetOwner()->PostMessage(WM_CONTENTCHANGE, TRUE);
00067                 break;
00068         }
00069     }
00070     return CEdit::PreTranslateMessage(pMsg);
00071 }
00072
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/TbEdit.h Source File

WinCvs/TbEdit.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>
00019  */
00020
00021 #if !defined(AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_)
00022 #define AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // TbEdit.h : header file
00028 //
00029
00031 // CTbEdit window
00032
00033 class CTbEdit : public CEdit
00034 {
00035 // Construction
00036 public:
00037     CTbEdit();
00038
00039 // Attributes
00040 public:
00041     enum { WM_CONTENTCHANGE = WM_APP + 56};
00042 // Operations
00043 public:
00044
00045 // Overrides
00046     // ClassWizard generated virtual function overrides
00047     //{{AFX_VIRTUAL(CTbEdit)
00048     public:
00049     virtual BOOL PreTranslateMessage(MSG* pMsg);
00050     //}}AFX_VIRTUAL
00051
00052 // Implementation
00053 public:
00054     virtual ~CTbEdit();
00055
00056     // Generated message map functions
00057 protected:
00058     //{{AFX_MSG(CTbEdit)
00059     //}}AFX_MSG
00060
00061     DECLARE_MESSAGE_MAP()
00062 };
00063
00065
00066 //{{AFX_INSERT_LOCATION}}
00067 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00068
00069 #endif // !defined(AFX_TBEDIT_H__AEA5EC19_1292_4A30_93EA_E209A6BAE000__INCLUDED_)
Generated on Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/TipDlg.cpp Source File

WinCvs/TipDlg.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>
00019  */
00020
00021 #include "stdafx.h"
00022 #include "resource.h"
00023 // CG: This file added by 'Tip of the Day' component.
00024
00025 #include <winreg.h>
00026 #include <sys\stat.h>
00027 #include <sys\types.h>
00028
00029 #include "wincvs.h"
00030 #include "CPStr.h"
00031 #include "TextBinary.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00040 // CTipDlg dialog
00041
00042 #define MAX_BUFLEN 1000
00043
00044 static const TCHAR szSection[] = _T("Tip");
00045 static const TCHAR szIntFilePos[] = _T("FilePos");
00046 static const TCHAR szTimeStamp[] = _T("TimeStamp");
00047 static const TCHAR szIntStartup[] = _T("StartUp");
00048
00049 CTipDlg::CTipDlg(CWnd* pParent /*=NULL*/)
00050     : CDialog(IDD_TIP, pParent)
00051 {
00052     //{{AFX_DATA_INIT(CTipDlg)
00053     m_bStartup = TRUE;
00054     //}}AFX_DATA_INIT
00055
00056     // We need to find out what the startup and file position parameters are
00057     // If startup does not exist, we assume that the Tips on startup is checked TRUE.
00058     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00059     m_bStartup = !pApp->GetProfileInt(szSection, szIntStartup, 0);
00060     UINT iFilePos = pApp->GetProfileInt(szSection, szIntFilePos, 0);
00061     CStr tips;
00062     pApp->GetAppPath(tips);
00063     if(!tips.empty() && !tips.endsWith(kPathDelimiter))
00064     {
00065         tips << kPathDelimiter;
00066     }
00067     tips << "tips.txt";
00068
00069     // Now try to open the tips file
00070     m_pStream = fopen(tips, "r");
00071 #if qCvsDebug
00072     if(m_pStream == 0L)
00073         m_pStream = fopen("c:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00074     if(m_pStream == 0L)
00075         m_pStream = fopen("d:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00076     if(m_pStream == 0L)
00077         m_pStream = fopen("e:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00078     if(m_pStream == 0L)
00079         m_pStream = fopen("f:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00080 #endif
00081     if (m_pStream == NULL)
00082     {
00083         m_strTip.LoadString(CG_IDS_FILE_ABSENT);
00084         return;
00085     }
00086
00087     // If the timestamp in the INI file is different from the timestamp of
00088     // the tips file, then we know that the tips file has been modified
00089     // Reset the file position to 0 and write the latest timestamp to the
00090     // ini file
00091     struct _stat buf;
00092     _fstat(_fileno(m_pStream), &buf);
00093     CString strCurrentTime = ctime(&buf.st_ctime);
00094     strCurrentTime.TrimRight();
00095     CString strStoredTime =
00096         pApp->GetProfileString(szSection, szTimeStamp, NULL);
00097     if (strCurrentTime != strStoredTime)
00098     {
00099         iFilePos = 0;
00100         pApp->WriteProfileString(szSection, szTimeStamp, strCurrentTime);
00101     }
00102
00103     if (fseek(m_pStream, iFilePos, SEEK_SET) != 0)
00104     {
00105         AfxMessageBox(CG_IDP_FILE_CORRUPT);
00106     }
00107     else
00108     {
00109         GetNextTipString(m_strTip);
00110     }
00111 }
00112
00113 CTipDlg::~CTipDlg()
00114 {
00115     // This destructor is executed whether the user had pressed the escape key
00116     // or clicked on the close button. If the user had pressed the escape key,
00117     // it is still required to update the filepos in the ini file with the
00118     // latest position so that we don't repeat the tips!
00119
00120     // But make sure the tips file existed in the first place....
00121     if (m_pStream != NULL)
00122     {
00123         CWinApp* pApp = AfxGetApp();
00124         pApp->WriteProfileInt(szSection, szIntFilePos, ftell(m_pStream));
00125         fclose(m_pStream);
00126     }
00127 }
00128
00129 void CTipDlg::DoDataExchange(CDataExchange* pDX)
00130 {
00131     CDialog::DoDataExchange(pDX);
00132     //{{AFX_DATA_MAP(CTipDlg)
00133     DDX_Check(pDX, IDC_STARTUP, m_bStartup);
00134     DDX_Text(pDX, IDC_TIPSTRING, m_strTip);
00135     //}}AFX_DATA_MAP
00136 }
00137
00138 BEGIN_MESSAGE_MAP(CTipDlg, CDialog)
00139     //{{AFX_MSG_MAP(CTipDlg)
00140     ON_BN_CLICKED(IDC_NEXTTIP, OnNextTip)
00141     ON_WM_CTLCOLOR()
00142     ON_WM_PAINT()
00143     //}}AFX_MSG_MAP
00144 END_MESSAGE_MAP()
00145
00146
00147 // CTipDlg message handlers
00148
00149 void CTipDlg::OnNextTip()
00150 {
00151     GetNextTipString(m_strTip);
00152     UpdateData(FALSE);
00153 }
00154
00155 void CTipDlg::GetNextTipString(CString& strNext)
00156 {
00157     LPTSTR lpsz = strNext.GetBuffer(MAX_BUFLEN);
00158
00159     // This routine identifies the next string that needs to be
00160     // read from the tips file
00161     BOOL bStop = FALSE;
00162     while (!bStop)
00163     {
00164         if (_fgetts(lpsz, MAX_BUFLEN, m_pStream) == NULL)
00165         {
00166             // We have either reached EOF or enocuntered some problem
00167             // In both cases reset the pointer to the beginning of the file
00168             // This behavior is same as VC++ Tips file
00169             if (fseek(m_pStream, 0, SEEK_SET) != 0)
00170                 AfxMessageBox(CG_IDP_FILE_CORRUPT);
00171         }
00172         else
00173         {
00174             if (*lpsz != ' ' && *lpsz != '\t' &&
00175                 *lpsz != '\n' && *lpsz != ';')
00176             {
00177                 // There should be no space at the beginning of the tip
00178                 // This behavior is same as VC++ Tips file
00179                 // Comment lines are ignored and they start with a semicolon
00180                 bStop = TRUE;
00181             }
00182         }
00183     }
00184     strNext.ReleaseBuffer();
00185 }
00186
00187 HBRUSH CTipDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
00188 {
00189     if (pWnd->GetDlgCtrlID() == IDC_TIPSTRING)
00190         return (HBRUSH)GetStockObject(WHITE_BRUSH);
00191
00192     return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
00193 }
00194
00195 void CTipDlg::OnOK()
00196 {
00197     CDialog::OnOK();
00198
00199     // Update the startup information stored in the INI file
00200     CWinApp* pApp = AfxGetApp();
00201     pApp->WriteProfileInt(szSection, szIntStartup, !m_bStartup);
00202 }
00203
00204 BOOL CTipDlg::OnInitDialog()
00205 {
00206     CDialog::OnInitDialog();
00207
00208     // If Tips file does not exist then disable NextTip
00209     if (m_pStream == NULL)
00210         GetDlgItem(IDC_NEXTTIP)->EnableWindow(FALSE);
00211
00212     return TRUE;  // return TRUE unless you set the focus to a control
00213 }
00214
00215 void CTipDlg::OnPaint()
00216 {
00217     CPaintDC dc(this); // device context for painting
00218
00219     // Get paint area for the big static control
00220     CWnd* pStatic = GetDlgItem(IDC_BULB);
00221     CRect rect;
00222     pStatic->GetWindowRect(&rect);
00223     ScreenToClient(&rect);
00224
00225     // Paint the background white.
00226     CBrush brush;
00227     brush.CreateStockObject(WHITE_BRUSH);
00228     dc.FillRect(rect, &brush);
00229
00230     // Load bitmap and get dimensions of the bitmap
00231     CBitmap bmp;
00232     bmp.LoadBitmap(IDB_LIGHTBULB);
00233     BITMAP bmpInfo;
00234     bmp.GetBitmap(&bmpInfo);
00235
00236     // Draw bitmap in top corner and validate only top portion of window
00237     CDC dcTmp;
00238     dcTmp.CreateCompatibleDC(&dc);
00239     dcTmp.SelectObject(&bmp);
00240     rect.bottom = bmpInfo.bmHeight + rect.top;
00241     dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(),
00242         &dcTmp, 0, 0, SRCCOPY);
00243
00244     // Draw out "Did you know..." message next to the bitmap
00245     CString strMessage;
00246     strMessage.LoadString(CG_IDS_DIDYOUKNOW);
00247     rect.left += bmpInfo.bmWidth;
00248     dc.DrawText(strMessage, rect, DT_VCENTER | DT_SINGLELINE);
00249
00250     // Do not call CDialog::OnPaint() for painting messages
00251 }
00252
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/TipDlg.h Source File

WinCvs/TipDlg.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>
00019  */
00020
00021 #if !defined(TIPDLG_H_INCLUDED_)
00022 #define TIPDLG_H_INCLUDED_
00023
00024 // CG: This file added by 'Tip of the Day' component.
00025
00027 // CTipDlg dialog
00028
00029 class CTipDlg : public CDialog
00030 {
00031 // Construction
00032 public:
00033     CTipDlg(CWnd* pParent = NULL);   // standard constructor
00034
00035 // Dialog Data
00036     //{{AFX_DATA(CTipDlg)
00037     // enum { IDD = IDD_TIP };
00038     BOOL    m_bStartup;
00039     CString m_strTip;
00040     //}}AFX_DATA
00041
00042     FILE* m_pStream;
00043
00044 // Overrides
00045     // ClassWizard generated virtual function overrides
00046     //{{AFX_VIRTUAL(CTipDlg)
00047     protected:
00048     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00049     //}}AFX_VIRTUAL
00050
00051 // Implementation
00052 public:
00053     virtual ~CTipDlg();
00054
00055 protected:
00056     // Generated message map functions
00057     //{{AFX_MSG(CTipDlg)
00058     afx_msg void OnNextTip();
00059     afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
00060     virtual void OnOK();
00061     virtual BOOL OnInitDialog();
00062     afx_msg void OnPaint();
00063     //}}AFX_MSG
00064     DECLARE_MESSAGE_MAP()
00065
00066     void GetNextTipString(CString& strNext);
00067 };
00068
00069 #endif // !defined(TIPDLG_H_INCLUDED_)
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/ToolbarCombo.cpp Source File

WinCvs/ToolbarCombo.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>
00019  */
00020
00021 // ToolbarCombo.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "ToolbarCombo.h"
00027
00028 #ifdef _DEBUG
00029 #define new DEBUG_NEW
00030 #undef THIS_FILE
00031 static char THIS_FILE[] = __FILE__;
00032 #endif
00033
00034 BEGIN_MESSAGE_MAP(CToolbarCombo, CComboBoxEx)
00035     //{{AFX_MSG_MAP(CToolbarCombo)
00036     ON_CONTROL_REFLECT(CBN_SELENDOK, OnSelendok)
00037     ON_CONTROL_REFLECT(CBN_SELENDCANCEL, OnSelendcancel)
00038     //}}AFX_MSG_MAP
00039     ON_MESSAGE(CTbEdit::WM_CONTENTCHANGE, OnContentChange)
00040 END_MESSAGE_MAP()
00041
00042
00043
00044 // CToolbarCombo
00045
00046 CToolbarCombo::CToolbarCombo()
00047 {
00048 }
00049
00050 CToolbarCombo::~CToolbarCombo()
00051 {
00052 }
00053
00054 BOOL CToolbarCombo::Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID )
00055 {
00056     if (!CComboBoxEx::Create(dwStyle, rect, pParentWnd, nID))
00057     {
00058         return FALSE;
00059     }
00060     SetExtendedStyle(CBES_EX_CASESENSITIVE, CBES_EX_CASESENSITIVE);
00061     m_edit.SubclassWindow(GetEditCtrl()->m_hWnd);
00062     m_edit.SetOwner(this);
00063     return TRUE;
00064 }
00065
00066 LRESULT CToolbarCombo::OnContentChange(WPARAM wp, LPARAM lp)
00067 {
00068     bool complete = wp != 0;
00069     if (complete)
00070     {
00071         CString text;
00072         m_edit.GetWindowText(text);
00073         SetText(text);
00074     }
00075     else
00076     {
00077         // restore previous text
00078         ResetText();
00079     }
00080     return 0;
00081 }
00082
00083 void CToolbarCombo::ResetText()
00084 {
00085     m_edit.SetWindowText(m_text);
00086 }
00087
00088 void CToolbarCombo::SetText(const CString& text)
00089 {
00090     if (m_text.Compare(text) != 0)
00091     {
00092         m_text = text;
00093
00094         // append selection to combo box
00095         int count = GetCount();
00096         for (int i = count - 1; i >= 0 ; i--)
00097         {
00098             TCHAR buffer[256];
00099             GetItemText(i, buffer, 256);
00100             if (text.Compare(buffer) == 0)
00101             {
00102                 DeleteItem(i);
00103             }
00104         }
00105         COMBOBOXEXITEM item;
00106         item.mask = CBEIF_TEXT;
00107         item.iItem = 0;
00108         item.pszText = (LPTSTR)(LPCTSTR)text;
00109         InsertItem(&item);
00110         count = GetCount();
00111         while (count > 8)
00112         {
00113             count--;
00114             DeleteItem(count);
00115         }
00116
00117         m_manager.NotifyAll();
00118     }
00119 }
00120
00121 void CToolbarCombo::GetItemText(int pos, LPTSTR buffer, int count)
00122 {
00123     COMBOBOXEXITEM item;
00124     item.mask = CBEIF_TEXT;
00125     item.pszText = buffer;
00126     item.cchTextMax = count;
00127     item.iItem = pos;
00128     VERIFY(GetItem(&item));
00129 }
00130
00131 void CToolbarCombo::OnSelendok()
00132 {
00133     CComboBox* combo = GetComboBoxCtrl();
00134     int pos = combo->GetCurSel();
00135     if (pos >= 0)
00136     {
00137         TCHAR buffer[256];
00138         GetItemText(pos, buffer, 256);
00139         SetText(buffer);
00140         ResetText();
00141     }
00142 }
00143
00144 void CToolbarCombo::OnSelendcancel()
00145 {
00146     ResetText();
00147 }
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/ToolbarCombo.h Source File

WinCvs/ToolbarCombo.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>
00019  */
00020
00021 #if !defined(AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_)
00022 #define AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // ToolbarCombo.h : header file
00028 //
00029
00030 #include "BrowseViewModel.h"
00031 #include "tbedit.h"
00032
00034 // CToolbarCombo window
00035
00036 class CToolbarCombo : public CComboBoxEx
00037 {
00038 // Construction
00039 public:
00040     CToolbarCombo();
00041
00042 // Attributes
00043 private:
00044     CTbEdit m_edit;
00045     NotificationManager m_manager;
00046     CString m_text;
00047
00048 // Operations
00049 public:
00050     BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
00051
00052     NotificationManager* GetManager()
00053     {
00054         return &m_manager;
00055     }
00056
00057     const CString& GetText()
00058     {
00059         return m_text;
00060     }
00061
00062
00063     // retrieves text of an item
00064     // parameters
00065     //   pos - item index
00066     //   buffer - buffer to receive the text
00067     //   count - count of characters in the buffer
00068     void GetItemText(int pos, LPTSTR buffer, int count);
00069
00070
00071 // Overrides
00072     // ClassWizard generated virtual function overrides
00073     //{{AFX_VIRTUAL(CToolbarCombo)
00074     //}}AFX_VIRTUAL
00075
00076 // Implementation
00077 public:
00078     virtual ~CToolbarCombo();
00079
00080     // Generated message map functions
00081 protected:
00082     void SetText(const CString& text);
00083     void ResetText();
00084
00085     //{{AFX_MSG(CToolbarCombo)
00086     afx_msg void OnSelendok();
00087     afx_msg void OnSelendcancel();
00088     //}}AFX_MSG
00089     afx_msg LRESULT OnContentChange(WPARAM wp, LPARAM lp);
00090     DECLARE_MESSAGE_MAP()
00091 };
00092
00094
00095 //{{AFX_INSERT_LOCATION}}
00096 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00097
00098 #endif // !defined(AFX_TOOLBARCOMBO_H__3AE857F3_B4BD_11D4_8200_005004D6EF6C__INCLUDED_)
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 //                      wincvs.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 Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 11
00029 #define WINCVS_PRODUCT_MAJOR        1
00030 #define WINCVS_PRODUCT_MINOR        3
00031 #define WINCVS_PRODUCT_PATCHLEVEL   11
00032
00033 #define WINCVS_FILE_MAJOR           WINCVS_PRODUCT_MAJOR
00034 #define WINCVS_FILE_MINOR           WINCVS_PRODUCT_MINOR
00035 #define WINCVS_FILE_PATCHLEVEL      WINCVS_PRODUCT_PATCHLEVEL
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 //                      wincvs.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 Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 "GraphView.h"
00033 #include "WinCvsBrowser.h"
00034 #include "BrowseFileView.h"
00035 #include "AppGlue.h"
00036 #include "CvsPrefs.h"
00037 #include "AppConsole.h"
00038 #include "Splash.h"
00039 #include "MacrosSetup.h"
00040 #include "MultiString.h"
00041 #include "CvsCommands.h"
00042 #include "Authen.h"
00043 #include "TclGlue.h"
00044 #include "PythonGlue.h"
00045 #include "BrowserBar.h"
00046 #include "FileTraversal.h"
00047 #include "MakeSurePathExists.h"
00048 #include "cvsgui_process.h"
00049 #include "wincvs_winutil.h"
00050
00051 #ifdef SCC_COWORKER
00052 #include "CVSTrace.h"
00053
00054 #include "CVS_Coworker_i.h"
00055 #include "CVS_Coworker_i.c"
00056 #include "CVSCoworker.h"
00057 #endif
00058
00059 #ifdef _DEBUG
00060 #define new DEBUG_NEW
00061 #undef THIS_FILE
00062 static char THIS_FILE[] = __FILE__;
00063 #endif
00064
00066 #define AUTHORS_COUNT           3
00067
00069 #define AUTHORS_PERMUTATIONS    6
00070
00072 const char* gAuthors[AUTHORS_COUNT] =
00073 {
00074     "\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n",
00075     "\t* Jerzy Kaczorowski <kaczoroj@hotmail.com>\n",
00076     "\t* Karl-Heinz Bruenen <gcvs@bruenen-net.de>\n"
00077 };
00078
00080 const int gAuthorsPermutations[AUTHORS_PERMUTATIONS][AUTHORS_COUNT] =
00081 {
00082     0, 1, 2,
00083     0, 2, 1,
00084     1, 0, 2,
00085     1, 2, 0,
00086     2, 0, 1,
00087     2, 1, 0
00088 };
00089
00090 #ifdef SCC_COWORKER
00091 CCVS_CoworkerModule _Module;
00092
00093 BEGIN_OBJECT_MAP(ObjectMap)
00094 OBJECT_ENTRY(CLSID_CvsCoworker, CvsCoworker)
00095 END_OBJECT_MAP()
00096
00097 LONG CCVS_CoworkerModule::Unlock()
00098 {
00099     AfxOleUnlockApp();
00100     return 0;
00101 }
00102
00103 LONG CCVS_CoworkerModule::Lock()
00104 {
00105     AfxOleLockApp();
00106     return 1;
00107 }
00108 LPCTSTR CCVS_CoworkerModule::FindOneOf(LPCTSTR p1, LPCTSTR p2)
00109 {
00110     while (*p1 != NULL)
00111     {
00112         LPCTSTR p = p2;
00113         while (*p != NULL)
00114         {
00115             if (*p1 == *p)
00116                 return CharNext(p1);
00117             p = CharNext(p);
00118         }
00119         p1++;
00120     }
00121     return NULL;
00122 }
00123 #endif
00124
00126 class CLogoutThread : public CWinThread
00127 {
00128 public:
00129     DECLARE_DYNAMIC(CLogoutThread)
00130
00131     CLogoutThread();
00132     virtual ~CLogoutThread();
00133     virtual void Delete();
00134
00135     void KillThread(void) { m_term = true; }
00136         // terminate
00137
00138 // Overrides
00139     // ClassWizard generated virtual function overrides
00140     //{{AFX_VIRTUAL(CLogoutThread)
00141     //}}AFX_VIRTUAL
00142
00143 protected:
00144     bool m_term;
00145
00146     virtual BOOL InitInstance();
00147
00148     // Generated message map functions
00149     //{{AFX_MSG(CLogoutThread)
00150         // NOTE - the ClassWizard will add and remove member functions here.
00151     //}}AFX_MSG
00152
00153     DECLARE_MESSAGE_MAP()
00154 };
00155
00156 CLogoutThread::CLogoutThread() : m_term(false)
00157 {
00158 }
00159
00160 CLogoutThread::~CLogoutThread()
00161 {
00162 }
00163
00164 void CLogoutThread::Delete()
00165 {
00166     CWinThread::Delete();
00167 }
00168
00169 BOOL CLogoutThread::InitInstance()
00170 {
00171     for(;;)
00172     {
00173         Sleep(1000);
00174
00175         if(m_term)
00176             return FALSE;
00177
00178         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00179         AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00180
00181         if( !curModel->HasLogin() || !gCvsPrefs.HasLoogedIn() ||
00182             gCvsPrefs.LogoutTimeOut() <= 0 || app->IsCvsRunning() )
00183         {
00184             continue;
00185         }
00186
00187         DWORD time = ::GetTickCount();
00188         if( app->GetIdleTime() != 0 &&
00189             (int)(time - app->GetIdleTime()) >= (gCvsPrefs.LogoutTimeOut() * 60 * 1000) )
00190         {
00191             app->ResetIdleTime();
00192             cvs_err("Making automatic logout after %d minute(s):\n", gCvsPrefs.LogoutTimeOut());
00193             CvsCmdLogout();
00194         }
00195     }
00196
00197     return FALSE;
00198 }
00199
00200 IMPLEMENT_DYNAMIC(CLogoutThread, CWinThread);
00201
00202 BEGIN_MESSAGE_MAP(CLogoutThread, CWinThread)
00203     //{{AFX_MSG_MAP(CLogoutThread)
00204         // NOTE - the ClassWizard will add and remove mapping macros here.
00205     //}}AFX_MSG_MAP
00206 END_MESSAGE_MAP()
00207
00208 static CLogoutThread *sLogout = 0L;
00209
00211 // CWincvsApp
00212
00213 BEGIN_MESSAGE_MAP(CWincvsApp, CWinApp)
00214     ON_COMMAND(CG_IDS_TIPOFTHEDAY, ShowTipOfTheDay)
00215     //{{AFX_MSG_MAP(CWincvsApp)
00216     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00217     ON_COMMAND(ID_APP_COPYRIGHTS, OnAppCopyrights)
00218     ON_COMMAND(ID_APP_CREDITS, OnAppCredits)
00219     ON_UPDATE_COMMAND_UI(ID_APP_COPYRIGHTS, OnLogWindowIsPresent)
00220     ON_UPDATE_COMMAND_UI(ID_APP_CREDITS, OnLogWindowIsPresent)
00221     ON_COMMAND(ID_HELP_CVS, OnHelpCvs)
00222     ON_COMMAND(ID_HELP_CVSCLIENT, OnHelpCvsclient)
00223     //}}AFX_MSG_MAP
00224     // Standard file based document commands
00225     ON_COMMAND(ID_FILE_NEW, OnFileNew)
00226     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00227     // Standard print setup command
00228     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00229 END_MESSAGE_MAP()
00230
00231
00232 // CWincvsApp construction
00233
00234 CWincvsApp::CWincvsApp() : m_isBackgroundProcess(false)
00235 {
00236     m_CvsRunning = false;
00237     m_CvsStopping = false;
00238     m_LastCvsResult = 0;
00239     m_idletime = 0;
00240     m_bATLInited = FALSE;
00241     m_CvsProcess = 0L;
00242 }
00243
00244 void CWincvsApp::OnLogWindowIsPresent(CCmdUI* pCmdUI)
00245 {
00246     pCmdUI->Enable(GetConsoleView() != 0L);
00247 }
00248
00249 void CWincvsApp::OnFileNew()
00250 {
00251     gLogTempl->OpenDocumentFile(NULL);
00252 }
00253
00255 // The one and only CWincvsApp object
00256
00257 CWincvsApp theApp;
00258
00259 // This identifier was generated to be statistically unique for your app.
00260 // You may change it if you prefer to choose a specific identifier.
00261
00262 // {D2D77DC2-8299-11D1-8949-444553540000}
00263 static const CLSID clsid =
00264 { 0xd2d77dc2, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
00265
00267 // CWincvsApp initialization
00268
00269 /*
00270  * The handle is of an unknown type.  Test the validity of this OS
00271  * handle by duplicating it, then closing the dupe.  The Win32 API
00272  * doesn't provide an IsValidHandle() function, so we have to emulate
00273  * it here.  This test will not work on a console handle reliably,
00274  * which is why we can't test every handle that comes into this
00275  * function in this way.
00276  */
00277 bool IsValidHandle( HANDLE handle )
00278 {
00279     HANDLE dupedHandle = NULL;
00280
00281     /*
00282      * GetFileType() returns FILE_TYPE_UNKNOWN for invalid handles.
00283      */
00284
00285     if( GetFileType(handle) == FILE_TYPE_UNKNOWN )
00286     {
00287         if( !DuplicateHandle(GetCurrentProcess(),
00288             handle,
00289             GetCurrentProcess(),
00290             &dupedHandle,
00291             0,
00292             FALSE,
00293             DUPLICATE_SAME_ACCESS) )
00294         {
00295             /*
00296             * Unable to make a duplicate. It's definately invalid at this point
00297             */
00298
00299             return false;
00300         }
00301
00302         /*
00303         * Use structured exception handling (Win32 SEH) to protect the close
00304         * of this duped handle which might throw EXCEPTION_INVALID_HANDLE.
00305         */
00306         __try
00307         {
00308             CloseHandle(dupedHandle);
00309         }
00310         __except (EXCEPTION_EXECUTE_HANDLER)
00311         {
00312             /*
00313             * Definately an invalid handle.  So, therefore, the original
00314             * is invalid also.
00315             */
00316
00317             return false;
00318         }
00319     }
00320
00321     return true;
00322 }
00323
00324 BOOL CWincvsApp::InitInstance()
00325 {
00326 #if qCvsDebug
00327     int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
00328     tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
00329     _CrtSetDbgFlag(tmpDbgFlag);
00330 #endif
00331     CStr lastWorkingDir;
00332
00333     // David Gravereaux <davygrvy@interwoven.com> suggests this might
00334     // be a work around to the bug #42 (I love the bug number,
00335     // really fits the bug description ;-))
00336 #if 0
00337     if (!IsValidHandle(GetStdHandle(STD_OUTPUT_HANDLE)))
00338     {
00339         SetStdHandle(STD_OUTPUT_HANDLE, 0L);
00340     }
00341 #endif
00342
00343     // CG: The following block was added by the Splash Screen component.
00344     {
00345         CCommandLineInfo cmdInfo;
00346         ParseCommandLine(cmdInfo);
00347
00348         CSplashWnd::EnableSplashScreen(
00349             (!(m_nCmdShow & SW_SHOWMINIMIZED)) && cmdInfo.m_bShowSplash);
00350     }
00351
00352     if (!AfxSocketInit())
00353     {
00354         AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
00355         return FALSE;
00356     }
00357
00358 #ifdef SCC_COWORKER
00359     if (!InitATL())
00360         return FALSE;
00361 #endif
00362
00363     // Initialize OLE libraries
00364     if (!AfxOleInit())
00365     {
00366         AfxMessageBox(IDP_OLE_INIT_FAILED);
00367         return FALSE;
00368     }
00369
00370     AfxEnableControlContainer();
00371
00372     // Standard initialization
00373     // If you are not using these features and wish to reduce the size
00374     //  of your final executable, you should remove from the following
00375     //  the specific initialization routines you do not need.
00376
00377 #if _MFC_VER < 0x700
00378 #ifdef _AFXDLL
00379     Enable3dControls();         // Call this when using MFC in a shared DLL
00380 #else
00381     Enable3dControlsStatic();   // Call this when linking to MFC statically
00382 #endif
00383 #endif
00384
00385     CCvsThreadLock::Initialize();
00386
00387     // Change the registry key under which our settings are stored.
00388     // You should modify this string to be something appropriate
00389     // such as the name of your company or organization.
00390     SetRegistryKey(_T("WinCvs"));
00391
00392     LoadStdProfileSettings(5);  // Load standard INI file options (including MRU)
00393     gCvsPrefs.load();
00394
00395     CSplashWnd::EnableSplashScreen(!gCvsPrefs.DisableSplashScreen());
00396
00397     CStr strVersion;
00398     GetAppVersion(strVersion);
00399     WriteProfileString(_T(""), _T("Current Version"), strVersion);
00400
00401     //
00402     // We need to make a temp local copy of LastWorkingDir property here,
00403     // because CWinCvsBrowser::OnSelchanging event would override
00404     // LastWorkingDir preference when browser window is created.
00405     //
00406     lastWorkingDir = gCvsPrefs.LastWorkingDir();
00407
00408     // Register the application's document templates.  Document templates
00409     //  serve as the connection between documents, frame windows and views.
00410
00411     gLogTempl = new CMultiDocTemplate(
00412         IDR_MAINFRAME,
00413         RUNTIME_CLASS(CWincvsDoc),
00414         RUNTIME_CLASS(CLogFrame),
00415         RUNTIME_CLASS(CBrowseFileView));
00416     AddDocTemplate(gLogTempl);
00417
00418     gLogGraph = new CMultiDocTemplate(
00419         IDR_GRAPH,
00420         RUNTIME_CLASS(CGraphDoc),
00421         RUNTIME_CLASS(CGraphFrame),
00422         RUNTIME_CLASS(CGraphView));
00423     AddDocTemplate(gLogGraph);
00424
00425     /*gLogHtml = new CMultiDocTemplate(
00426         IDR_GRAPH,
00427         RUNTIME_CLASS(CDocument),
00428         RUNTIME_CLASS(CMDIChildWnd),
00429         RUNTIME_CLASS(CGraphView));
00430     AddDocTemplate(gLogGraph);*/
00431
00432     // Connect the COleTemplateServer to the document template.
00433     //  The COleTemplateServer creates new documents on behalf
00434     //  of requesting OLE containers by using information
00435     //  specified in the document template.
00436     m_server.ConnectTemplate(clsid, gLogTempl, TRUE);
00437         // Note: SDI applications register server objects only if /Embedding
00438         //   or /Automation is present on the command line.
00439
00440     // Register all OLE server factories as running.  This enables the
00441     //  OLE libraries to create objects from other applications.
00442     COleTemplateServer::RegisterAll();
00443         // Note: MDI applications register all server objects without regard
00444         //  to the /Embedding or /Automation on the command line.
00445
00446     // create main MDI Frame window
00447     m_mainFrame = new CMainFrame;
00448     if (!m_mainFrame->LoadFrame(IDR_CNTR_INPLACE))
00449         return FALSE;
00450     m_pMainWnd = m_mainFrame;
00451
00452     // Initialize the cool menus...
00453 #if 0
00454     UINT barIds[] = {IDR_BROWSER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, IDR_FILELIST, IDR_FILTER};
00455     m_mainFrame->InitializeMenu(gLogTempl,
00456         IDR_MAINFRAME, barIds, _countof(barIds), IDR_MAINFRAME);
00457     m_mainFrame->InitializeMenu(gLogGraph,
00458         IDR_GRAPH, barIds, _countof(barIds), IDR_GRAPH);
00459 #endif
00460
00461     // Parse command line for standard shell commands, DDE, file open
00462     CCommandLineInfo cmdInfo;
00463     ParseCommandLine(cmdInfo);
00464
00465     // Check to see if launched as OLE server
00466     if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
00467     {
00468 #if 0
00469         // Register all OLE server (factories) as running.  This enables the
00470         //  OLE libraries to create objects from other applications.
00471         COleTemplateServer::RegisterAll();
00472 #endif
00473
00474         // Application was run with /Embedding or /Automation.  Don't show the
00475         //  main window in this case.
00476         return TRUE;
00477     }
00478
00479     // When a server application is launched stand-alone, it is a good idea
00480     //  to update the system registry in case it has been damaged.
00481     m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
00482     COleObjectFactory::UpdateRegistryAll();
00483
00484     //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)
00485     if( -1 != cmdInfo.m_strFileName.Find('~') )
00486     {
00487         CString strLongFileName;
00488         CString strTempTileName = cmdInfo.m_strFileName;
00489
00490         SHFILEINFO sFileInfo;
00491         int nSlashPos = -1;
00492
00493         BOOL bError = FALSE;
00494
00495         while( -1 != (nSlashPos = strTempTileName.ReverseFind(kPathDelimiter)) )
00496         {
00497             if( SHGetFileInfo((LPCTSTR)strTempTileName, 0, &sFileInfo, sizeof(sFileInfo), SHGFI_DISPLAYNAME) )
00498             {
00499                 CString strFileNameBit = strTempTileName.Mid(nSlashPos + 1);
00500
00501                 strLongFileName = sFileInfo.szDisplayName + strLongFileName;
00502                 strLongFileName = kPathDelimiter + strLongFileName;
00503                 strTempTileName = strTempTileName.Left(nSlashPos);
00504             }
00505             else
00506             {
00507                 bError = TRUE;
00508                 break;  //we need it or we get the dead loop
00509             }
00510         }//end while
00511
00512         if( !bError )
00513         {
00514             cmdInfo.m_strFileName = strTempTileName + strLongFileName;
00515         }
00516     }
00517
00518     //JK - open in the directory, so remove the file
00519     CString strOpenDirectory;
00520     CString strSelectFile;
00521     if( !cmdInfo.m_strFileName.IsEmpty() )
00522     {
00523         TCHAR fullpath[_MAX_PATH];
00524         _tfullpath(fullpath, cmdInfo.m_strFileName, _MAX_PATH);
00525         if( GetFileAttributes(cmdInfo.m_strFileName) != 0xFFFFFFFF )
00526         {
00527             cmdInfo.m_strFileName.Replace('/', kPathDelimiter); //normalize path
00528             TCHAR drive[_MAX_DRIVE];
00529             TCHAR dir[_MAX_DIR];
00530             _tsplitpath(fullpath, drive, dir, NULL, NULL);
00531             strSelectFile = fullpath;
00532             _tmakepath(fullpath, drive, dir, NULL, NULL);
00533             strOpenDirectory = fullpath;
00534         }
00535     }
00536
00537     // Dispatch commands specified on the command line
00538     //JK - we need to trick the ProcessShellCommand a bit
00539     //because we might get a directory as a parameter we don't want it to check after the file...
00540     cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
00541     if (!ProcessShellCommand(cmdInfo))
00542         return FALSE;
00543
00544     // The one and only window has been initialized, so show and update it.
00545     m_mainFrame/*m_pMainWnd*/->InitialShowWindow(m_nCmdShow);
00546     m_mainFrame/*m_pMainWnd*/->UpdateWindow();
00547
00548     m_mainFrame/*m_pMainWnd*/->DragAcceptFiles();
00549     //CWincvsView *cons = GetConsoleView();
00550     //if(cons != 0L)
00551     //  cons->DragAcceptFiles();
00552
00553
00554     CWinCvsBrowser *browser = GetBrowserView();
00555     CWincvsDoc *doc = (CWincvsDoc *)GetDocument();
00556     if(doc != 0L && browser != 0L)
00557         doc->SetTitle(browser->GetRoot());
00558     CBrowseFileView *fileView = GetFileView();
00559     if(fileView != 0L)
00560     {
00561         if( strOpenDirectory.IsEmpty() )
00562         {
00563             // Goto the last working directory, which was selected
00564             // when WinCVS was closed
00565             if( !lastWorkingDir.empty() && browser->StepToLocation(lastWorkingDir) )
00566             {
00567                 fileView->ResetView(lastWorkingDir, false, (LPCTSTR) 0L);
00568                 gCvsPrefs.SetLastWorkingDir(lastWorkingDir);
00569             }
00570             else
00571                 fileView->ResetView(browser->GetRoot());
00572         }
00573         else
00574         {
00575             CColorConsole out;
00576             out << kBold << "Locating: " << kNormal << kUnderline << cmdInfo.m_strFileName << kNormal <<  kNormal << kNL;
00577
00578             //search the browse location (will create a new location if not found)
00579             extern CMString gHistoryLocs;
00580             CString bestRoot = CHistComboBoxEx::FindBestRoot(gHistoryLocs, strOpenDirectory);
00581             if( !bestRoot.IsEmpty() )
00582             {
00583                 browser->ResetBrowser((LPCTSTR)bestRoot);
00584             }
00585
00586             if( browser->StepToLocation((LPCTSTR)strOpenDirectory) )
00587             {
00588                 fileView->ResetView( (LPCTSTR)strOpenDirectory, false, (LPCTSTR)strSelectFile );
00589             }
00590             else
00591             {
00592                 fileView->ResetView( browser->GetRoot() );
00593             }
00594         }
00595     }
00596
00597     CPython_Interp::InitPythonSupport();
00598
00599     //MacrosReloadAll();
00600     PyMacrosReloadAll();
00601
00602     //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
00603     if( strOpenDirectory.IsEmpty() )
00604     {
00605         // CG: This line inserted by 'Tip of the Day' component.
00606         ShowTipAtStartup();
00607     }
00608
00609     // auto-logout thread
00610     sLogout = new CLogoutThread();
00611     if (sLogout == 0L)
00612     {
00613         cvs_err("Impossible to create the auto-logout thread !\n");
00614     }
00615     else
00616     {
00617         ASSERT_VALID(sLogout);
00618
00619         // Create Thread in a suspended state so we can set the Priority
00620         // before it starts getting away from us
00621         if (!sLogout->CreateThread(CREATE_SUSPENDED))
00622         {
00623             cvs_err("Impossible to start the auto-logout thread (error %d)!\n", GetLastError());
00624             delete sLogout;
00625             sLogout = 0L;
00626         }
00627
00628         if(sLogout != 0L)
00629         {
00630             // If you want to make the sample more sprightly, set the thread priority here
00631             // a little higher. It has been set at idle priority to keep from bogging down
00632             // other apps that may also be running.
00633             VERIFY(sLogout->SetThreadPriority(THREAD_PRIORITY_NORMAL));
00634             // Now the thread can run wild
00635             sLogout->ResumeThread();
00636         }
00637     }
00638
00639     // load preferences. If CVSROOT is not defined
00640     // then prompt first preferences dialog.
00641     if(gCvsPrefs.empty())
00642         SendMessage(*m_mainFrame, WM_COMMAND, ID_APP_PREFERENCES, 0L);
00643         //doc->OnAppPreferences();
00644     else
00645         cvs_out("CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
00646
00647     bool hasTCL = CTcl_Interp::IsAvail();
00648     bool hasPY = CPython_Interp::IsAvail();
00649
00650     if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && !hasPY && hasTCL)
00651     {
00652         gCvsPrefs.SetUseShell(SHELL_TCL);
00653     }
00654     else if(gCvsPrefs.GetUseShell() == SHELL_TCL && hasPY && !hasTCL)
00655     {
00656         gCvsPrefs.SetUseShell(SHELL_PYTHON);
00657     }
00658
00659     if(gCvsPrefs.GetUseShell() == SHELL_TCL)
00660     {
00661         cvs_out("TCL is available, shell is enabled : help (select and press enter)\n");
00662     }
00663
00664     if(!hasTCL && !hasPY)
00665     {
00666         cvs_err("TCL or Python are *not* available, shell is disabled\n");
00667     }
00668
00669     //make sure the current directory is properly setup
00670     if( 0L != fileView )
00671     {
00672         chdir( fileView->GetPath() );
00673     }
00674
00675     return TRUE;
00676 }
00677
00679 // CAboutDlg dialog used for App About
00680
00681 class CAboutDlg : public CDialog
00682 {
00683 public:
00684     CAboutDlg();
00685
00686 // Dialog Data
00687     //{{AFX_DATA(CAboutDlg)
00688     enum { IDD = IDD_ABOUTBOX };
00689     CCJHyperLink    m_CvsGuiSfUrl;
00690     CCJHyperLink    m_WinCvsUrl;
00691     CString m_vers;
00692     //}}AFX_DATA
00693
00694     // ClassWizard generated virtual function overrides
00695     //{{AFX_VIRTUAL(CAboutDlg)
00696     protected:
00697     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00698     //}}AFX_VIRTUAL
00699
00700 // Implementation
00701 protected:
00702     //{{AFX_MSG(CAboutDlg)
00703     virtual BOOL OnInitDialog();
00704     //}}AFX_MSG
00705     DECLARE_MESSAGE_MAP()
00706 };
00707
00708 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00709 {
00710     //{{AFX_DATA_INIT(CAboutDlg)
00711     m_vers = _T("WinCvs ");
00712     //}}AFX_DATA_INIT
00713
00714     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00715     CStr vers;
00716
00717     if(app->GetAppVersion(vers))
00718     {
00719         m_vers = vers;
00720     }
00721 }
00722
00723 BOOL CAboutDlg::OnInitDialog()
00724 {
00725     CDialog::OnInitDialog();
00726
00727     m_WinCvsUrl.SetURL(_T("http://www.wincvs.org"));
00728     m_CvsGuiSfUrl.SetURL(_T("http://cvsgui.sourceforge.net/"));
00729
00730     return TRUE;  // return TRUE unless you set the focus to a control
00731                   // EXCEPTION: OCX Property Pages should return FALSE
00732 }
00733
00734 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00735 {
00736     CDialog::DoDataExchange(pDX);
00737     //{{AFX_DATA_MAP(CAboutDlg)
00738     DDX_Control(pDX, IDC_CVSGUISFURL, m_CvsGuiSfUrl);
00739     DDX_Control(pDX, IDC_WINCVSURL, m_WinCvsUrl);
00740     DDX_Text(pDX, IDC_WINCVSVER, m_vers);
00741     //}}AFX_DATA_MAP
00742 }
00743
00744 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00745     //{{AFX_MSG_MAP(CAboutDlg)
00746     //}}AFX_MSG_MAP
00747 END_MESSAGE_MAP()
00748
00749 // App command to run the dialog
00750 void CWincvsApp::OnAppAbout()
00751 {
00752     CAboutDlg aboutDlg;
00753     aboutDlg.DoModal();
00754 }
00755
00756 CWincvsView *CWincvsApp::GetConsoleView(void)
00757 {
00758     if(m_mainFrame == 0L)
00759         return 0L;
00760
00761     return m_mainFrame->GetConsoleView();
00762 }
00763
00764 CStatusBar *CWincvsApp::GetStatusBar()
00765 {
00766     if(m_mainFrame == 0L)
00767         return 0L;
00768
00769     return m_mainFrame->GetStatusBar();
00770 }
00771
00772 CWinCvsBrowser *CWincvsApp::GetBrowserView(void)
00773 {
00774     if(m_mainFrame == 0L)
00775         return 0L;
00776
00777     return m_mainFrame->GetBrowserView();
00778 }
00779
00780 CString CWincvsApp::GetRoot()
00781 {
00782     CString root;
00783     CWinCvsBrowser* view = GetBrowserView();
00784     if (view)
00785     {
00786         root = view->GetRoot();
00787     }
00788     return root;
00789 }
00790
00791 void CWincvsApp::ActivateBrowserView(void)
00792 {
00793     if(m_mainFrame == 0L)
00794         return;
00795
00796     m_mainFrame->GetWorkspace()->SetActiveView(RUNTIME_CLASS(CBrowserBar));
00797 }
00798
00799 CCJShellTree *CWincvsApp::GetExplorerView(void)
00800 {
00801     if(m_mainFrame == 0L)
00802         return 0L;
00803
00804     return m_mainFrame->GetExplorerView();
00805 }
00806
00807 CBrowseFileView *CWincvsApp::GetFileView(void)
00808 {
00809     POSITION post = GetFirstDocTemplatePosition();
00810     CDocTemplate* tmpl;
00811     while(post != NULL)
00812     {
00813         tmpl = GetNextDocTemplate(post);
00814         if(!tmpl->IsKindOf(RUNTIME_CLASS(CMultiDocTemplate)))
00815             continue;
00816         POSITION posd = tmpl->GetFirstDocPosition();
00817         CDocument* doc;
00818         while(posd != NULL)
00819         {
00820             doc = tmpl->GetNextDoc(posd);
00821             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00822                 continue;
00823             POSITION posv = doc->GetFirstViewPosition();
00824             CView* view;
00825             while(posv != NULL)
00826             {
00827                 view = doc->GetNextView(posv);
00828                 if(view->IsKindOf(RUNTIME_CLASS(CBrowseFileView)))
00829                     return (CBrowseFileView *)view;
00830             }
00831         }
00832     }
00833     return NULL;
00834 }
00835
00836 CDocument *CWincvsApp::GetDocument(void)
00837 {
00838     CWinApp *app = AfxGetApp();
00839     POSITION post = app->GetFirstDocTemplatePosition();
00840     CDocTemplate* tmpl;
00841     while(post != NULL)
00842     {
00843         tmpl = app->GetNextDocTemplate(post);
00844         POSITION posd = tmpl->GetFirstDocPosition();
00845         CDocument* doc;
00846         while(posd != NULL)
00847         {
00848             doc = tmpl->GetNextDoc(posd);
00849             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00850                 continue;
00851             return doc;
00852         }
00853     }
00854     ASSERT(0);
00855     return 0L;
00856 }
00857
00859 // CWincvsApp commands
00860
00864 bool TrimRight( char* szValue, bool bTest = false )
00865 {
00866     bool bRes = false;
00867
00868     char* pszPos = szValue;
00869     char* pszLastSpacePos = NULL;
00870
00871     //locate last white space
00872     while( *pszPos != '\0' )
00873     {
00874         if( isspace(*pszPos) )
00875         {
00876             if( pszLastSpacePos == NULL )
00877             {
00878                 pszLastSpacePos = pszPos;
00879             }
00880         }
00881         else
00882         {
00883             pszLastSpacePos = NULL;
00884         }
00885
00886         pszPos++;
00887     }
00888
00889     //and cut it off
00890     if( pszLastSpacePos )
00891     {
00892         if( !bTest )
00893         {
00894             *pszLastSpacePos = '\0';
00895         }
00896         bRes = true;
00897     }
00898
00899     return bRes;
00900 }
00901
00903 void AFXAPI DDV_CheckPathExists(CDataExchange* pDX, int nIDC, CString& value, bool promptForCreation /*= true*/)
00904 {
00905     if( pDX->m_bSaveAndValidate )
00906     {
00907         if( !CompatMakeSurePathExists(value, false) )
00908         {
00909             if( CStr(value).endsWith(kPathDelimiter) )
00910             {
00911                 value.TrimRight(kPathDelimiter);
00912             }
00913
00914             if( !CompatMakeSurePathExists(value, promptForCreation) )
00915             {
00916                 AfxMessageBox("Cannot find folder: " + value);
00917                 pDX->PrepareEditCtrl(nIDC);
00918                 pDX->Fail();
00919             }
00920         }
00921     }
00922 }
00923
00925 void AFXAPI DDV_CheckCVSROOT(CDataExchange* pDX, CString& value)
00926 {
00927     //check after the trailing white spaces - often an unwanted result of copy-paste
00928     if( pDX->m_bSaveAndValidate &&
00929         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00930     {
00931         value.ReleaseBuffer();
00932
00933         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00934         {
00935             TrimRight(value.GetBuffer(value.GetLength()+1));
00936             value.ReleaseBuffer();
00937         }
00938     }
00939 }
00940
00942 void AFXAPI DDX_ComboMString(CDataExchange* pDX, int nIDC, CSmartComboBox& combo)
00943 {
00944     CMString* mstr = combo.GetItems();
00945     ASSERT(mstr != NULL);
00946
00947     if( mstr )
00948     {
00949         if( !pDX || !pDX->m_bSaveAndValidate )
00950         {
00951             CString strOldText;
00952             combo.GetWindowText(strOldText);
00953
00954             combo.ResetContent();
00955
00956             const vector<CStr> & list = mstr->GetList();
00957             vector<CStr>::const_iterator i;
00958             for(i = list.begin(); i != list.end(); ++i)
00959             {
00960                 combo.AddString(*i);
00961             }
00962
00963             combo.SetWindowText(strOldText);
00964         }
00965         else
00966         {
00967             CString value;
00968             DDX_CBString(pDX, nIDC, value);
00969             if( !value.IsEmpty() )
00970             {
00971                 mstr->Insert(value);
00972             }
00973         }
00974     }
00975 }
00976
00978 void AFXAPI DDV_MinChars(CDataExchange* pDX, CString const& value, int nChars)
00979 {
00980     ASSERT(nChars > 0);        // allow them something
00981     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00982     {
00983         TCHAR szT[255];
00984         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00985         CString prompt;
00986         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00987         prompt.Empty(); // exception prep
00988         pDX->Fail();
00989     }
00990 }
00991
00992 int CWincvsApp::ExitInstance()
00993 {
00994     // Save existing preferences. This will save, for example,
00995     // the current working directory as "LastWorkingDir" property.
00996     gCvsPrefs.save();
00997
00998     CCvsThreadLock::Delete();
00999
01000     if (m_bATLInited)
01001     {
01002 #ifdef SCC_COWORKER
01003         LogCleanup();
01004         _Module.RevokeClassObjects();
01005         _Module.Term();
01006 #endif
01007         CoUninitialize();
01008     }
01009
01010     return CWinApp::ExitInstance();
01011 }
01012
01013 void CWincvsApp::OnAppCopyrights()
01014 {
01015     cvs_out("\nBoth WinCVS and CVS are distributed under the terms of\n");
01016     cvs_out("the GNU General Public Licence (GPL).\n\n");
01017     cvs_out("* MacCVS/WinCvs : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n");
01018     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
01019     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
01020     cvs_out("        Jeff Polk, and other authors\n");
01021     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
01022     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
01023     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
01024     cvs_out("* Python : Copyright © Guido van Rossum\n");
01025     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
01026     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
01027 }
01028
01029 void CWincvsApp::OnAppCredits()
01030 {
01031     // WinCvs version
01032     CStr vers;
01033
01034     if( GetAppVersion(vers) )
01035         cvs_out("\n%s - Client/Local\n", (const char*)vers);
01036     else
01037         cvs_out("\nWinCvs 1.3 - Client/Local\n");
01038
01039     // Authors in random order
01040     cvs_out("- WinCvs is developed by:\n");
01041
01042     srand((unsigned)time(NULL));
01043     const int option = rand() % AUTHORS_PERMUTATIONS;
01044
01045     for(int index = 0; index < AUTHORS_COUNT; index++)
01046     {
01047         cvs_out(gAuthors[gAuthorsPermutations[option][index]]);
01048     }
01049
01050     cvs_out("\t* Other contributors (see the ChangeLog)\n");
01051
01052     // More info
01053     cvs_out("- WinCvs page : http://www.wincvs.org or http://cvsgui.sourceforge.net/\n");
01054     cvs_out("- cvs page : http://www.cvshome.org\n");
01055     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
01056     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
01057
01058     cvs_out("- Special thanks to :\n");
01059     cvs_out("\t* The Strata Inc. developpers who are so patients with WinCvs\n");
01060     cvs_out("\t  and help to identify a lot of problems.\n");
01061     cvs_out("\t* All the people who are submitting bugs, patches and\n");
01062     cvs_out("\t  answer the cvsgui mailing list.\n");
01063
01064     cvs_out("- Bug reports, suggestions :\n");
01065     cvs_out("\t* Richard Wesley, Alain Aslag Roy, Eric Aubourg and many others\n");
01066     cvs_out("- Cvs contributors :\n");
01067     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
01068 }
01069
01070 void CWincvsApp::ShowTipAtStartup(void)
01071 {
01072     // CG: This function added by 'Tip of the Day' component.
01073
01074     CCommandLineInfo cmdInfo;
01075     ParseCommandLine(cmdInfo);
01076     if (cmdInfo.m_bShowSplash)
01077     {
01078         CTipDlg dlg( IsWindow(m_pMainWnd->GetSafeHwnd()) ? m_pMainWnd : NULL );
01079         if (dlg.m_bStartup)
01080             dlg.DoModal();
01081     }
01082 }
01083
01084 void CWincvsApp::ShowTipOfTheDay(void)
01085 {
01086     // CG: This function added by 'Tip of the Day' component.
01087
01088     CTipDlg dlg;
01089     dlg.DoModal();
01090 }
01091
01092 BOOL CWincvsApp::PreTranslateMessage(MSG* pMsg)
01093 {
01094     // CG: The following lines were added by the Splash Screen component.
01095     if (CSplashWnd::PreTranslateAppMessage(pMsg))
01096         return TRUE;
01097
01098     DWORD time = ::GetTickCount();
01099     if (m_idletime == 0 ||
01100         pMsg->message == WM_KEYDOWN ||
01101         pMsg->message == WM_SYSKEYDOWN ||
01102         pMsg->message == WM_LBUTTONDOWN ||
01103         pMsg->message == WM_RBUTTONDOWN ||
01104         pMsg->message == WM_MBUTTONDOWN ||
01105         pMsg->message == WM_NCLBUTTONDOWN ||
01106         pMsg->message == WM_NCRBUTTONDOWN ||
01107         pMsg->message == WM_NCMBUTTONDOWN)
01108     {
01109         m_idletime = time;
01110         PyInvalUICache();
01111     }
01112
01113     IdleCvsProgress();
01114
01115     return CWinApp::PreTranslateMessage(pMsg);
01116 }
01117
01118 void CWincvsApp::GetAppPath(CStr & path) const
01119 {
01120     path = "";
01121     HINSTANCE hInst = ::AfxGetInstanceHandle();
01122     if(hInst != 0L)
01123     {
01124         char apath[512];
01125         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01126         CStr uppath;
01127         CStr exefile;
01128         if(len > 0 && ::SplitPath(apath, uppath, exefile))
01129         {
01130             path = uppath;
01131         }
01132     }
01133 }
01134
01135 void CWincvsApp::GetAppModule(CStr & module) const
01136 {
01137     module = "";
01138     HINSTANCE hInst = ::AfxGetInstanceHandle();
01139     if(hInst != 0L)
01140     {
01141         char apath[512];
01142         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01143         if(len > 0)
01144         {
01145             module = apath;
01146         }
01147     }
01148 }
01149
01150 void CWincvsApp::LookForResourceFile(const char *what, CStr & path)
01151 {
01152     path = "";
01153     GetAppPath(path);
01154
01155     CString appPath = path;
01156     // first the macro folder may be ./macro
01157     CString test = appPath;
01158     test.TrimRight('\\');
01159     test += "\\";
01160     test += what;
01161
01162     struct stat sb;
01163     if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01164     {
01165         path = test;
01166         return;
01167     }
01168
01169     CStr uppath, file;
01170     while(SplitPath(appPath, uppath, file) && !uppath.empty())
01171     {
01172         test = uppath;
01173         test.TrimRight('\\');
01174         test += "\\";
01175         test += what;
01176
01177         if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01178         {
01179             path = test;
01180             return;
01181         }
01182         appPath = uppath;
01183     }
01184     path = test;
01185 }
01186
01187
01188 void CWincvsApp::OnHelpCvs()
01189 {
01190     CStr hlp;
01191     LookForResourceFile("cvs.hlp", hlp);
01192     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01193 }
01194
01195 void CWincvsApp::OnHelpCvsclient()
01196 {
01197     CStr hlp;
01198     LookForResourceFile("cvscli.hlp", hlp);
01199     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01200 }
01201
01202 bool CWincvsApp::GetAppVersion(CStr & vers) const
01203 {
01204     bool bRet=false;
01205     char  szFullPath[_MAX_PATH];
01206     DWORD len = ::GetModuleFileName(AfxGetInstanceHandle(), szFullPath, sizeof(szFullPath));
01207     DWORD dwVerHnd;
01208     DWORD dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
01209     if (dwVerInfoSize && len)
01210     {
01211         // If we were able to get the information, process it:
01212         HANDLE  hMem;
01213         LPVOID  lpvMem;
01214         char    szGetName[256];
01215         int     cchRoot;
01216
01217         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
01218         lpvMem = GlobalLock(hMem);
01219         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);
01220         lstrcpy(szGetName, "\\StringFileInfo\\040904b0\\");
01221         cchRoot = lstrlen(szGetName);
01222
01223         BOOL  fRet;
01224         UINT  cchVer = 0;
01225         LPVOID lszVer = NULL;
01226
01227         lstrcpy(&szGetName[cchRoot], "ProductVersion");
01228         fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer);
01229
01230         if (fRet && cchVer && lszVer)
01231         {
01232             vers = (char *)lszVer;
01233             bRet = true;
01234         }
01235         GlobalUnlock(hMem);
01236         GlobalFree(hMem);
01237     }
01238     return bRet;
01239 }
01240
01241 BOOL CWincvsApp::SaveAllModified()
01242 {
01243     // prevent from exiting when cvs is running
01244     if( m_CvsRunning )
01245     {
01246         m_CvsStopping = true;
01247         return TRUE;
01248     }
01249
01250     if( sLogout != 0L )
01251     {
01252         HANDLE hdl = sLogout->m_hThread;
01253         sLogout->KillThread();
01254         WaitForSingleObject(hdl, INFINITE);
01255         //delete sLogout;
01256         sLogout = 0L;
01257     }
01258
01259     // auto-logout
01260     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
01261
01262     if( curModel->HasLogin() && gCvsPrefs.HasLoogedIn() &&
01263         gCvsPrefs.LogoutTimeOut() > 0 )
01264     {
01265         cvs_err("Making automatic logout before quitting:\n");
01266         CvsCmdLogout();
01267         WaitForCvs();
01268     }
01269
01270     return CWinApp::SaveAllModified();
01271 }
01272
01273 char *CWincvsApp::GetEnvMainThread(const char *name)
01274 {
01275     return m_mainFrame->GetEnvMainThread(name);
01276 }
01277
01278 void CWincvsApp::IdleCvsProgress(void)
01279 {
01280     static bool bWasCvsRunning = false; //to restore the idle message once CVS has stoped
01281
01282     if( !m_CvsRunning )
01283     {
01284         if( bWasCvsRunning )
01285         {
01286             bWasCvsRunning = false;
01287
01288             CString strIdleString;
01289             strIdleString.LoadString(AFX_IDS_IDLEMESSAGE);
01290
01291             CStatusBar *bar = GetStatusBar();
01292             if(bar != 0L)
01293                 bar->SetWindowText(strIdleString);
01294         }
01295
01296         return;
01297     }
01298
01299     if( m_CvsProcess != 0L )
01300     {
01301         if( !cvs_process_is_active(m_CvsProcess) )
01302         {
01303             m_CvsRunning = false;
01304             m_CvsStopping = false;
01305             m_CvsProcess = 0L;
01306             GetFileView()->CheckChanges();
01307         }
01308     }
01309
01310     bWasCvsRunning = true;
01311
01312     DWORD whatTimeIsIt = ::GetTickCount();
01313     static DWORD lastTime = 0;
01314     // let's make some stuff every second while cvs is idling
01315     if( (whatTimeIsIt - lastTime) < 1000 )
01316         return;
01317
01318     lastTime = whatTimeIsIt;
01319     char path[_MAX_PATH];
01320     getcwd(path, _MAX_PATH);
01321     CStatusBar* bar = GetStatusBar();
01322
01323     if( bar != 0L )
01324         bar->SetWindowText(path);
01325 }
01326
01327 static inline bool MatchToken(LPCTSTR sLine,LPCTSTR sToken)
01328 {
01329     int n = _tcslen(sToken);
01330     if (0 != _tcsnicmp(sLine,sToken,n)) {
01331         return false;
01332     }
01333     LPCTSTR p = sLine + n;
01334     return ((!*p) || (0 != _tcschr(_T(" \t"),*p)));
01335 }
01336
01337 #ifdef _DEBUG
01338 static inline void DEBUG_MESSAGE(LPCTSTR sMessage)
01339 {
01340     if (::getenv("NOCVSDEBUG")) return;
01341     TCHAR s[256];
01342     ::wsprintf(s,_T("\n[PID %u THREAD %u] CVS_Coworker %s\n"),
01343         (unsigned) GetCurrentProcessId(),
01344         (unsigned) GetCurrentThreadId(),
01345         sMessage
01346         );
01347     ::MessageBox(0,s,_T("DEBUG"),MB_OK);
01348 }
01349 #else
01350 #define DEBUG_MESSAGE(S) 0
01351 #endif
01352
01353 BOOL CWincvsApp::InitATL()
01354 {
01355     m_bATLInited = TRUE;
01356
01357 #if _WIN32_WINNT >= 0x0400
01358     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
01359 #else
01360     HRESULT hRes = CoInitialize(NULL);
01361 #endif
01362
01363     if (FAILED(hRes))
01364     {
01365         m_bATLInited = FALSE;
01366         return FALSE;
01367     }
01368
01369 #ifdef SCC_COWORKER
01370     _Module.Init(ObjectMap, AfxGetInstanceHandle());
01371     _Module.dwThreadID = GetCurrentThreadId();
01372
01373     LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
01374     TCHAR szTokens[] = _T("-/");
01375     BOOL bRun = TRUE;
01376
01377     LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens);
01378     while (lpszToken != NULL)
01379     {
01380         if (MatchToken(lpszToken,_T("UnregServer"))) {
01381             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, FALSE);
01382             _Module.UnregisterServer(TRUE); //TRUE means typelib is unreg'd
01383             bRun = FALSE;
01384             DEBUG_MESSAGE(_T("Now UNREGISTERED"));
01385             break;
01386         }
01387         if (MatchToken(lpszToken,_T("RegServer"))) {
01388             //RegisterLogging();  // specific to CVS_Coworker
01389             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, TRUE);
01390             _Module.RegisterServer(TRUE);
01391             bRun = FALSE;
01392             DEBUG_MESSAGE(_T("REGISTERED"));
01393             break;
01394         }
01395         lpszToken = _Module.FindOneOf(lpszToken, szTokens);
01396     }
01397
01398     if (!bRun)
01399     {
01400         m_bATLInited = FALSE;
01401         _Module.Term();
01402         CoUninitialize();
01403         return FALSE;
01404     }
01405
01406     //StartLogging();         // specific to CVS_Coworker
01407     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,REGCLS_MULTIPLEUSE);
01408     if (FAILED(hRes))
01409     {
01410         m_bATLInited = FALSE;
01411         CoUninitialize();
01412         return FALSE;
01413     }
01414 #endif
01415
01416     return TRUE;
01417 }
01418
01419 // retrieve filtering model to use
01420 KiFilterModel* CWincvsApp::GetFilterModel() const
01421 {
01422     return m_mainFrame->GetFilterModel();
01423 }
01424
01425 // retrieve recursion model to use
01426 KiRecursionModel* CWincvsApp::GetRecursionModel() const
01427 {
01428     return m_mainFrame->GetRecursionModel();
01429 }
01430
01431 KiIgnoreModel* CWincvsApp::GetIgnoreModel() const
01432 {
01433     return m_mainFrame->GetIgnoreModel();
01434 }
01435
01436 void CWincvsApp::UpdateAllDocsView()
01437 {
01438     POSITION pos = GetFirstDocTemplatePosition();
01439     while( pos )
01440     {
01441         CDocTemplate* pTemplate = GetNextDocTemplate(pos);
01442         POSITION pos2 = pTemplate->GetFirstDocPosition();
01443         while(pos2)
01444         {
01445             CDocument* pDocument;
01446             if(pDocument = pTemplate->GetNextDoc(pos2))
01447             {
01448                 pDocument->UpdateAllViews(NULL);
01449             }
01450         }
01451     }
01452 }
01453
01454 void CWincvsApp::PeekPumpAndIdle(bool doIdle)
01455 {
01456     MSG Msg;
01457     while( ::PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE) )
01458     {
01459         PumpMessage();
01460     }
01461
01462     if( doIdle )
01463     {
01464         LONG lIdle = 0;
01465         while( OnIdle(lIdle++) )
01466             ;
01467     }
01468 }
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "cvsgui_process.h"
00039
00041 // CWincvsApp:
00042 // See wincvs.cpp for the implementation of this class
00043 //
00044
00045 class CWincvsView;
00046 class CWinCvsBrowser;
00047 class CBrowseFileView;
00048 class CStr;
00049 class CMainFrame;
00050 class CStatusBar;
00051 class KiFilterModel;
00052 class KiRecursionModel;
00053 class KiIgnoreModel;
00054
00055 class CWincvsApp : public CWinApp
00056 {
00057 public:
00058     CWincvsApp();
00059
00060     CWincvsView *GetConsoleView(void);
00061         // get the top console
00062
00063     CWinCvsBrowser *GetBrowserView(void);
00064     void ActivateBrowserView(void);
00065         // get the left directory browser
00066
00067     CCJShellTree *GetExplorerView(void);
00068         // get the left directory explorer
00069
00070     CBrowseFileView *GetFileView(void);
00071         // get the right files browser
00072
00073     CDocument *GetDocument(void);
00074         // get the document
00075
00076     CStatusBar *GetStatusBar();
00077         // get the mainframe status bar
00078
00079     CString GetRoot();
00080         // returns currently selected root
00081
00082     inline CMainFrame *GetMainFrame(void) { return m_mainFrame; }
00083         // get the document
00084
00085     void PeekPumpAndIdle(bool doIdle);
00086         // peek and pump application messages and perform the idle processsing
00087
00088     void SetCvsProcess(CvsProcess* proc) { m_CvsProcess = proc; };
00089     CvsProcess* GetCvsProcess(void) { return m_CvsProcess; }
00090
00091     void SetCvsRunning(bool state) { m_CvsRunning = state; };
00092     bool IsCvsRunning(void) { return m_CvsRunning; }
00093
00094     void SetCvsStopping(bool state) { m_CvsStopping = state; };
00095     bool IsCvsStopping(void) { return m_CvsStopping; }
00096
00097     CMultiDocTemplate* gLogTempl;
00098     CMultiDocTemplate* gLogGraph;
00099     CMultiDocTemplate* gLogHtml;
00100
00101     void UpdateAllDocsView();
00102         // call UpdateAllViews for all documents
00103
00104     void GetAppPath(CStr & path) const;
00105         // return the application path
00106
00107     void GetAppModule(CStr & module) const;
00108         // return the application module
00109
00110     bool GetAppVersion(CStr & vers) const;
00111         // return false if an error occured
00112
00113     inline DWORD GetIdleTime(void) const { return m_idletime; }
00114     inline void ResetIdleTime(void) { m_idletime = 0; }
00115
00116     // in order to get an idea of where is cvs
00117     void IdleCvsProgress(void);
00118
00119     // retrieve filtering model to use
00120     KiFilterModel* GetFilterModel() const;
00121
00122     // retrieve recursion model to use
00123     KiRecursionModel* GetRecursionModel() const;
00124
00125     // ignore model in use
00126     KiIgnoreModel* GetIgnoreModel() const;
00127
00128     // ask a GetEnv value from the main thread for those
00129     // which require interaction (ex: CVS_GETPASS)
00130     char* GetEnvMainThread(const char *name);
00131
00132 // Overrides
00133     // ClassWizard generated virtual function overrides
00134     //{{AFX_VIRTUAL(CWincvsApp)
00135     public:
00136     virtual BOOL InitInstance();
00137     virtual int ExitInstance();
00138     virtual BOOL SaveAllModified();
00139     virtual BOOL PreTranslateMessage(MSG* pMsg);
00140     //}}AFX_VIRTUAL
00141
00142     bool m_isBackgroundProcess;
00143         // tells if the app is in background
00144
00145 protected:
00146     BOOL InitATL();
00147     void LookForResourceFile(const char *what, CStr & path);
00148
00149     afx_msg void OnFileNew();
00150
00151     DWORD m_idletime;
00152     CMainFrame* m_mainFrame;
00153     BOOL m_bATLInited;
00154
00155 // Implementation
00156     COleTemplateServer m_server;
00157         // Server object for document creation
00158
00159     //{{AFX_MSG(CWincvsApp)
00160     afx_msg void OnAppAbout();
00161     afx_msg void OnAppCopyrights();
00162     afx_msg void OnAppCredits();
00163     afx_msg void OnLogWindowIsPresent(CCmdUI* pCmdUI);
00164     afx_msg void OnHelpCvs();
00165     afx_msg void OnHelpCvsclient();
00166     //}}AFX_MSG
00167     DECLARE_MESSAGE_MAP()
00168 private:
00169     void ShowTipAtStartup(void);
00170     void ShowTipOfTheDay(void);
00171
00172     struct _CvsProcess* m_CvsProcess;
00173     bool m_CvsRunning;
00174     bool m_CvsStopping;
00175     int m_LastCvsResult;
00176 };
00177
00178
00180
00181 //{{AFX_INSERT_LOCATION}}
00182 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00183
00184 void AFXAPI DDV_CheckPathExists(CDataExchange* pDX, int nIDC, CString& value, bool promptForCreation = true);
00185 void AFXAPI DDV_MinChars(CDataExchange* pDX, CString const& value, int nChars);
00186 void AFXAPI DDV_CheckCVSROOT(CDataExchange* pDX, CString& value);
00187 void AFXAPI DDX_ComboMString(CDataExchange* pDX, int nIDC, CSmartComboBox& combo);
00188
00189 #endif // !defined(AFX_WINCVS_H__D2D77DC7_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/wincvs_winutil.cpp Source File

WinCvs/wincvs_winutil.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>
00019  */
00020
00021 #include "stdafx.h"
00022
00023 #include "wincvs_winutil.h"
00024 #include "MultiString.h"
00025 #include "wincvs.h"
00026 #include "MainFrm.h"
00027 #include "CustomizeMenus.h"
00028 #include "CvsPrefs.h"
00029 #include "CvsCommands.h"
00030
00032 // helper functions declaration
00033
00034 CWnd* FindNextSiblingWindow(CWnd* pWnd, BOOL CheckTabStop);
00035 CWnd* FindNextChildWindow(CWnd* pWnd, BOOL CheckTabStop);
00036 CWnd* GetNextParentWindow(CWnd* pWnd);
00037
00038 CWnd* FindPrevSiblingWindow(CWnd* pWnd, BOOL CheckTabStop);
00039 CWnd* GetPrevParentWindow(CWnd* pWnd);
00040 CWnd* GetEndOfDecendantWindow(CWnd* pWnd);
00041
00042
00044 // inline function(s)
00045
00046 inline BOOL IsTargetWindow(CWnd* pWnd, BOOL CheckTabStop)
00047 {
00048     return ((!CheckTabStop) || (WS_TABSTOP & pWnd->GetStyle()));
00049 }
00050
00052 // implementation
00053
00054 CWnd* FindNextWindow(CWnd* pWnd, BOOL CheckTabStop)
00055 {
00056     ASSERT_VALID(pWnd);
00057     if (pWnd)
00058     {
00059         CWnd* pNextWnd;
00060         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00061         if (pNextWnd)
00062             return pNextWnd;
00063
00064         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00065         if (pNextWnd)
00066             return pNextWnd;
00067
00068         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00069         while ((pParentWnd) && (pNextWnd != pWnd))
00070         {
00071             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00072             if (pNextWnd)
00073                 return pNextWnd;
00074             pParentWnd = GetNextParentWindow(pParentWnd);
00075         }
00076     }
00077     return pWnd;
00078 }
00079
00080 CWnd* GetNextParentWindow(CWnd* pWnd)
00081 {
00082     if (pWnd)
00083     {
00084         if (pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00085             return pWnd->GetTopWindow();
00086
00087         CFrameWnd* pFrameWnd = pWnd->GetParentFrame();
00088         ASSERT_VALID(pFrameWnd);
00089         CWnd* pParentWnd = pWnd->GetParent();
00090         ASSERT_VALID(pParentWnd);
00091
00092         CWnd* pCrntWnd;
00093         BOOL bFound = FALSE;
00094         while ((!bFound) && (pParentWnd != pFrameWnd))
00095         {
00096             pCrntWnd = pParentWnd->GetNextWindow();
00097             if (pCrntWnd)
00098                 bFound = TRUE;
00099             else
00100                 pParentWnd = pParentWnd->GetParent();
00101         }
00102         return (bFound) ? pCrntWnd : pParentWnd->GetTopWindow();
00103     }
00104     return NULL;
00105 }
00106
00107 CWnd* FindNextSiblingWindow(CWnd* pWnd, BOOL CheckTabStop)
00108 {
00109     if (pWnd)
00110     {
00111         CWnd* pSiblingWnd = pWnd->GetNextWindow();
00112         while (pSiblingWnd)
00113         {
00114             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00115                 return pSiblingWnd;
00116             CWnd* pChildWnd = FindNextChildWindow(pSiblingWnd, CheckTabStop);
00117             if (pChildWnd)
00118                 return pChildWnd;
00119             pSiblingWnd = pSiblingWnd->GetNextWindow();
00120         }
00121     }
00122     return NULL;
00123 }
00124
00125 CWnd* FindNextChildWindow(CWnd* pWnd, BOOL CheckTabStop)
00126 {
00127     if (pWnd)
00128     {
00129         CWnd* pChildWnd = pWnd->GetTopWindow();
00130         while (pChildWnd)
00131         {
00132             if (IsTargetWindow(pChildWnd, CheckTabStop))
00133                 return pChildWnd;
00134             CWnd* pSiblingWnd = FindNextSiblingWindow(pChildWnd, CheckTabStop);
00135             if (pSiblingWnd)
00136                 return pSiblingWnd;
00137             pChildWnd = pChildWnd->GetTopWindow();
00138         }
00139     }
00140     return NULL;
00141 }
00142
00143 CWnd* FindPrevWindow(CWnd* pWnd, BOOL CheckTabStop)
00144 {
00145     ASSERT_VALID(pWnd);
00146     if (pWnd)
00147     {
00148         CWnd* pWndCrntLevel = pWnd;
00149         while (TRUE)
00150         {
00151             CWnd* pFoundWnd;
00152             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00153             if (pFoundWnd)
00154                 return pFoundWnd;
00155             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00156             if (!pWndCrntLevel)
00157             {
00158                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00159                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00160                     return pFoundWnd;
00161                 pWndCrntLevel = pFoundWnd;
00162             }
00163         }
00164     }
00165     return NULL;
00166 }
00167
00168 CWnd* GetPrevParentWindow(CWnd* pWnd)
00169 {
00170     if (pWnd)
00171     {
00172         if (!pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00173         {
00174             CWnd* pParentWnd = pWnd->GetParent();
00175             ASSERT_VALID(pParentWnd);
00176             return pParentWnd;
00177         }
00178     }
00179     return NULL;
00180 }
00181
00182 CWnd* FindPrevSiblingWindow(CWnd* pWnd, BOOL CheckTabStop)
00183 {
00184     if (pWnd)
00185     {
00186         CWnd* pSiblingWnd = pWnd->GetWindow(GW_HWNDPREV);
00187         while (pSiblingWnd)
00188         {
00189             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00190                 return pSiblingWnd;
00191             pSiblingWnd = pSiblingWnd->GetWindow(GW_HWNDPREV);
00192         }
00193     }
00194     return NULL;
00195 }
00196
00197 CWnd* GetEndOfDecendantWindow(CWnd* pWnd)
00198 {
00199     CWnd* pTmpWnd = pWnd;
00200     CWnd* pPreTmpWnd;
00201     while (pTmpWnd)
00202     {
00203         pPreTmpWnd = pTmpWnd;
00204         pTmpWnd = pTmpWnd->GetWindow(GW_CHILD);
00205         if (pTmpWnd)
00206         {
00207             pPreTmpWnd = pTmpWnd;
00208             pTmpWnd = pTmpWnd->GetWindow(GW_HWNDLAST);
00209         }
00210     }
00211     return pPreTmpWnd;
00212 }
00213
00214 static void updateUIMenu(CMenu *pMyMenu, CView* pThis)
00215 {
00216     CCmdUI state;
00217     state.m_pMenu = pMyMenu;
00218
00219     state.m_nIndexMax = pMyMenu->GetMenuItemCount();
00220     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
00221       state.m_nIndex++)
00222     {
00223         state.m_nID = pMyMenu->GetMenuItemID(state.m_nIndex);
00224         if (state.m_nID == 0)
00225             continue; // menu separator or invalid cmd - ignore it
00226
00227         ASSERT(state.m_pOther == NULL);
00228         ASSERT(state.m_pMenu != NULL);
00229         if (state.m_nID == (UINT)-1)
00230         {
00231             // possibly a popup menu, route to first item of that popup
00232             state.m_pSubMenu = pMyMenu->GetSubMenu(state.m_nIndex);
00233             if (state.m_pSubMenu == NULL ||
00234                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
00235                 state.m_nID == (UINT)-1)
00236             {
00237                 continue;       // first item of popup can't be routed to
00238             }
00239             state.DoUpdate(pThis, FALSE);    // popups are never auto disabled
00240         }
00241         else
00242         {
00243             // normal menu item
00244             // Auto enable/disable if frame window has 'm_bAutoMenuEnable'
00245             //    set and command is _not_ a system command.
00246             state.m_pSubMenu = NULL;
00247             state.DoUpdate(pThis, TRUE);
00248         }
00249
00250 #   if 0 /* ??? */
00251         // adjust for menu deletions and additions
00252         UINT nCount = pMyMenu->GetMenuItemCount();
00253         if (nCount < state.m_nIndexMax)
00254         {
00255             state.m_nIndex -= (state.m_nIndexMax - nCount);
00256             while (state.m_nIndex < nCount &&
00257                 pMyMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
00258             {
00259                 state.m_nIndex++;
00260             }
00261         }
00262         state.m_nIndexMax = nCount;
00263 #   endif
00264     }
00265 }
00266
00268 CMenu* GetSubCMenu(int nStartId, CView* pThis)
00269 {
00270     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00271     ASSERT(pTopMenu != 0L);
00272     if( pTopMenu == 0L )
00273         return NULL;
00274
00275     CMenu* pMyMenu=NULL;
00276     for(int iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00277     {
00278         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00279         if( pMenu && pMenu->GetMenuItemID(0) == (UINT)nStartId )
00280         {
00281             pMyMenu = pMenu;
00282             break;
00283         }
00284     }
00285
00286     ASSERT(pMyMenu != 0L);
00287     if( pMyMenu == 0L )
00288         return NULL;
00289
00290     updateUIMenu(pMyMenu, pThis);
00291
00292     return pMyMenu;
00293 }
00294
00295 CMenu* _GetMenuEntryRecurs(CMenu* menu, int nStartId, int& pos)
00296 {
00297     if( menu == 0L )
00298         return 0l;
00299
00300     for(UINT iPos = 0; iPos < menu->GetMenuItemCount(); iPos++)
00301     {
00302         UINT id = menu->GetMenuItemID(iPos);
00303         if( id == (UINT)nStartId )
00304         {
00305             pos = iPos;
00306             return menu;
00307         }
00308
00309         if( id == (UINT)-1 )
00310         {
00311             CMenu* res = _GetMenuEntryRecurs(menu->GetSubMenu(iPos), nStartId, pos);
00312             if( res != 0L )
00313                 return res;
00314         }
00315     }
00316
00317     return 0L;
00318 }
00319
00321 CMenu* GetMenuEntry(int nStartId, int & pos)
00322 {
00323     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00324     ASSERT(pTopMenu != 0L);
00325
00326     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00327 }
00328
00329 CMMenuString::CMMenuString(unsigned int maxstr, const char* uniqueName, char * const *defaultStr) :
00330     CPersistent(uniqueName, kNoClass), fMaxStr(maxstr)
00331 {
00332     if(defaultStr != 0L)
00333     {
00334         int i = 0;
00335         while(defaultStr[i] != 0L)
00336         {
00337             Insert(defaultStr[i++]);
00338         }
00339     }
00340 }
00341
00342 CMMenuString::~CMMenuString()
00343 {
00344 }
00345
00346 unsigned int CMMenuString::SizeOf(void) const
00347 {
00348     NAMESPACE(std) vector<UStr>::const_iterator i;
00349     unsigned int thesize = sizeof(int);
00350
00351     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00352     {
00353         thesize += (*i).length() + 1;
00354     }
00355     return thesize;
00356 }
00357
00358 const void *CMMenuString::GetData(void) const
00359 {
00360     unsigned int thesize = SizeOf(), tmpsize;
00361     ((CMMenuString *)this)->fBuf.AdjustSize(thesize);
00362     char *tmp = ((CMMenuString *)this)->fBuf;
00363     *(int *)tmp = fAllStrs.size();
00364     tmp += sizeof(int) / sizeof(char);
00365
00366     NAMESPACE(std) vector<UStr>::const_iterator i;
00367     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00368     {
00369         tmpsize = (*i).length() + 1;
00370         memcpy(tmp, (const char*)(*i), tmpsize * sizeof(char));
00371         tmp += tmpsize;
00372     }
00373
00374     return (char *)fBuf;
00375 }
00376
00377 void CMMenuString::SetData(const void *ptr, unsigned int size)
00378 {
00379     const char* tmp = (char *)ptr;
00380     unsigned int thesize;
00381     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00382     thesize = *(int *)tmp;
00383     tmp += sizeof(int) / sizeof(char);
00384     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00385     {
00386         fAllStrs.push_back(UStr(tmp));
00387         tmp += strlen(tmp) + 1;
00388     }
00389 }
00390
00391 void CMMenuString::Insert(const char* newstr)
00392 {
00393     TouchTimeStamp();
00394     fAllStrs.push_back(UStr(newstr));
00395 }
00396
00397 char *sDefBrowserMenu[] =
00398 {
00399     "ID_VIEW_UPDATE",
00400     "ID_VIEW_COMMIT",
00401     "ID_SEPARATOR",
00402     "ID_VIEW_EXPLORE",
00403     "ID_VIEW_QUERYUPDATE",
00404     "ID_VIEW_RELOAD",
00405     "ID_SEPARATOR",
00406     "ID_VIEW_IMPORT",
00407     "ID_VIEW_CHECKOUT",
00408     0L
00409 };
00410
00411 char *sDefFilesMenu[] =
00412 {
00413     "ID_VIEW_UPDATE",
00414     "ID_VIEW_COMMIT",
00415     "ID_SEPARATOR",
00416     "ID_VIEW_EXPLORE",
00417     "ID_VIEW_QUERYUPDATE",
00418     "ID_VIEW_RELOAD",
00419     "ID_SEPARATOR",
00420     "ID_VIEW_EDITSEL",
00421     "ID_VIEW_EDITSELDEF",
00422     "ID_SEPARATOR",
00423     "ID_VIEW_DIFF",
00424     "ID_VIEW_LOG",
00425     "ID_VIEW_STATUS",
00426     "ID_VIEW_GRAPH",
00427     "ID_QUERY_ANNOTATE",
00428     0L
00429 };
00430
00431 static CMMenuString gFilesMenu(99, "P_FilesMenu", sDefFilesMenu);
00432 static CMMenuString gBrowserMenu(99, "P_BrowserMenu", sDefBrowserMenu);
00433
00435 CMenu* GetCustomMenu(int whichmenu, CView* pThis)
00436 {
00437     CMMenuString* multiMenu;
00438
00439     switch(whichmenu)
00440     {
00441     case kCustomBrowserMenu:
00442         multiMenu = &gBrowserMenu;
00443         break;
00444     case kCustomFilesMenu:
00445         multiMenu = &gFilesMenu;
00446         break;
00447     default:
00448         ASSERT(0);
00449         return 0L;
00450     }
00451
00452     CMenu* res = new CMenu;
00453     VERIFY(res->CreatePopupMenu());
00454
00455     std::vector<UStr>& list = multiMenu->GetList();
00456     std::vector<UStr>::iterator i = list.begin();
00457
00458     while( i != list.end() )
00459     {
00460         const CustInvertTable* tab = CustGetByKey(*i);
00461         if( tab == 0L )
00462         {
00463             TRACE1("Removing old command(%s)\n", (const char*)*i);
00464
00465             list.erase(i);
00466             i = list.begin();
00467             continue;
00468         }
00469
00470         i++;
00471     }
00472
00473     for(i = list.begin(); i != list.end(); ++i)
00474     {
00475         const CustInvertTable* tab = CustGetByKey(*i);
00476         if( tab )
00477         {
00478             if( tab->cmd == ID_SEPARATOR )
00479             {
00480                 res->AppendMenu(MF_SEPARATOR);
00481             }
00482             else
00483             {
00484                 CString str = tab->title;
00485                 FormatMenuString(tab->cmd, str);
00486                 res->AppendMenu(MF_STRING, tab->cmd, str);
00487             }
00488         }
00489     }
00490
00491     res->AppendMenu(MF_SEPARATOR);
00492     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00493         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00494         CString("Customize this menu..."));
00495
00496     updateUIMenu(res, pThis);
00497
00498     return res;
00499 }
00500
00502 void CustomizeMenus(int whichmenu)
00503 {
00504     CMMenuString *multiMenu;
00505
00506     switch(whichmenu)
00507     {
00508     case kCustomBrowserMenu:
00509         multiMenu = &gBrowserMenu;
00510         break;
00511     case kCustomFilesMenu:
00512         multiMenu = &gFilesMenu;
00513         break;
00514     default:
00515         ASSERT(0);
00516         return;
00517     }
00518
00519     CCustomizeMenus custom(multiMenu);
00520     if(custom.DoModal() == IDOK)
00521     {
00522         gCvsPrefs.save();
00523     }
00524 }
00525
00532 bool FormatMenuString(int cmd, CString& str)
00533 {
00534     bool res = false;
00535
00536     switch(cmd)
00537     {
00538     case ID_VIEW_EDITSELDEF:
00539         {
00540             CString viever("default viewer");
00541             if( gCvsPrefs.Viewer() != 0L )
00542             {
00543                 CStr uppath, folder;
00544                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00545
00546                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00547                 if( viever.Find(" ") > -1 )
00548                 {
00549                     viever = "\"" + viever + "\"";
00550                 }
00551             }
00552             str = "View &with " + viever;
00553
00554         }
00555         res = TRUE;
00556         break;
00557
00558     default:
00559         break;
00560     }
00561
00562     return res;
00563 }
00564
00571 bool IsLargeFonts()
00572 {
00573     static bool bLargeFonts = false;
00574     static bool defined = false;
00575
00576     if( !defined )
00577     {
00578         defined = true;
00579
00580         HWND hDesktop = ::GetDesktopWindow();
00581         HDC hDesktopDC = ::GetDC(hDesktop);
00582         short nLogPixels = ::GetDeviceCaps(hDesktopDC, LOGPIXELSX);
00583
00584         ::ReleaseDC(hDesktop, hDesktopDC);
00585
00586         bLargeFonts = (nLogPixels > 96);
00587     }
00588
00589     return bLargeFonts;
00590 }
00591
00597 bool IsHideCommandKeyPressed()
00598 {
00599     return ::GetKeyState(gCvsPrefs.HideCommandDlgUseShift() ? VK_SHIFT : VK_CONTROL) < 0;
00600 }
00601
00608 DWORD SetListCtrlExtendedStyle(CListCtrl* pListCtrl, const DWORD dwExtendedStyle)
00609 {
00610     if( !pListCtrl )
00611     {
00612         ASSERT(FALSE);  // bad pointer
00613         return 0;
00614     }
00615
00616     return pListCtrl->SetExtendedStyle(pListCtrl->GetExtendedStyle() | dwExtendedStyle);
00617 }
00618
00620 // CWndRedrawManager
00621
00623 CWndRedrawMngr::CWndRedrawMngr(CWnd* pWnd, BOOL bRedraw /*= FALSE*/)
00624 {
00625     ASSERT(pWnd != NULL);
00626     m_pWnd = pWnd;
00627
00628     if( m_pWnd )
00629     {
00630         m_pWnd->SetRedraw(bRedraw);
00631     }
00632 }
00633
00635 CWndRedrawMngr::~CWndRedrawMngr()
00636 {
00637     if( m_pWnd )
00638     {
00639         m_pWnd->SetRedraw(TRUE);
00640     }
00641 }
00642
00647 void CWndRedrawMngr::SetRedraw(BOOL bRedraw)
00648 {
00649     if( m_pWnd )
00650     {
00651         m_pWnd->SetRedraw(bRedraw);
00652     }
00653 }
00654
00656 // CCvsThreadLock
00657
00658 CRITICAL_SECTION CCvsThreadLock::m_lock;
00659 bool CCvsThreadLock::m_initialized = false;
00660
00661 CCvsThreadLock::CCvsThreadLock()
00662 {
00663     EnterCriticalSection(&m_lock);
00664 }
00665
00666 CCvsThreadLock::~CCvsThreadLock()
00667 {
00668     LeaveCriticalSection(&m_lock);
00669 }
00670
00674 void CCvsThreadLock::Initialize()
00675 {
00676     if( !m_initialized )
00677     {
00678         m_initialized = true;
00679         InitializeCriticalSection(&m_lock);
00680     }
00681 }
00682
00686 void CCvsThreadLock::Delete()
00687 {
00688     if( m_initialized )
00689     {
00690         DeleteCriticalSection(&m_lock);
00691         m_initialized = false;
00692     }
00693 }
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/wincvs_winutil.h Source File

WinCvs/wincvs_winutil.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>
00019  */
00020
00021 #ifndef WINCVS_WINUTIL_H
00022 #define WINCVS_WINUTIL_H
00023
00024 enum
00025 {
00026     kCustomBrowserMenu,
00027     kCustomFilesMenu
00028 };
00029
00030 CWnd* FindNextWindow(CWnd* pWnd, BOOL CheckTabStop = TRUE);
00031 CWnd* FindPrevWindow(CWnd* pWnd, BOOL CheckTabStop = TRUE);
00032
00033 CMenu* GetSubCMenu(int nStartId, CView* pThis);
00034 CMenu* GetMenuEntry(int nStartId, int& pos);
00035 CMenu* GetCustomMenu(int whichmenu, CView* pThis);
00036 void CustomizeMenus(int whichmenu);
00037 bool FormatMenuString(int cmd, CString& str);
00038
00039 bool IsLargeFonts();
00040 bool IsHideCommandKeyPressed();
00041
00042 DWORD SetListCtrlExtendedStyle(CListCtrl* pListCtrl, const DWORD dwExtendedStyle);
00043
00045 class CWndRedrawMngr
00046 {
00047 private:
00048     CWnd* m_pWnd;
00050 public:
00051     CWndRedrawMngr(CWnd* pWnd, BOOL bRedraw = FALSE);
00052     virtual ~CWndRedrawMngr();
00053
00054     void SetRedraw(BOOL bRedraw);
00055 };
00056
00058 class CCvsThreadLock
00059 {
00060 public:
00061     // Construction
00062     CCvsThreadLock();
00063     virtual ~CCvsThreadLock();
00064
00065 private:
00066     // Data members
00067     static CRITICAL_SECTION m_lock;
00068     static bool m_initialized;
00070 public:
00071     // Interface
00072     static void Initialize();
00073     static void Delete();
00074 };
00075
00076 #endif  /*WINCVS_WINUTIL_H*/
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/WinCvsBrowser.cpp Source File

WinCvs/WinCvsBrowser.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>
00019  */
00020
00021 // WinCvsBrowser.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "wincvs.h"
00026 #include "MainFrm.h"
00027 #include "WinCvsBrowser.h"
00028 #include "AppConsole.h"
00029 #include "CvsPrefs.h"
00030 #include "CvsCommands.h"
00031 #include "TclGlue.h"
00032 #include "MacrosSetup.h"
00033 #include "wincvs_winutil.h"
00034 #include "PythonGlue.h"
00035 #include "BrowseViewHandlers.h"
00036
00037 #include "umain.h"
00038
00039 #ifdef WIN32
00040 #   include "resource.h"
00041 #endif /* WIN32 */
00042
00043 #ifdef _DEBUG
00044 #define new DEBUG_NEW
00045 #undef THIS_FILE
00046 static char THIS_FILE[] = __FILE__;
00047 #endif
00048
00050 enum
00051 {
00052     kIconFolderClosed,
00053     kIconFolderOpened,
00054     kIconFolderCVSClosed,
00055     kIconFolderCVSOpened,
00056     kIconFolderIgnoreClosed,
00057     kIconFolderIgnoreOpened,
00058     kIconFolderLost
00059 };
00060
00062 static const int WM_RESETVIEW = WM_APP + 12;
00063
00065 static const char* gDummyFile = "@@@dummy file@@@";
00066
00076 static void SetIcon(CTreeCtrl& treeCtrl, HTREEITEM item,
00077                     bool hasCvsInfos, bool expand, EntnodeData* data = 0L)
00078 {
00079     TV_ITEM pItem;
00080     pItem.hItem = item;
00081     pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00082     VERIFY(treeCtrl.GetItem(&pItem));
00083
00084     int newImage;
00085     if( data == 0L )
00086     {
00087         if( expand )
00088             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00089         else
00090             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00091     }
00092     else
00093     {
00094         if( expand )
00095         {
00096             if( data->IsIgnored() )
00097                 newImage = kIconFolderIgnoreOpened;
00098             else if( data->IsUnknown() )
00099                 newImage = kIconFolderOpened;
00100             else
00101                 newImage = kIconFolderCVSOpened;
00102         }
00103         else
00104         {
00105             if( data->IsIgnored() )
00106                 newImage = kIconFolderIgnoreClosed;
00107             else if( data->IsUnknown() )
00108                 newImage = kIconFolderClosed;
00109             else
00110                 newImage = kIconFolderCVSClosed;
00111         }
00112     }
00113
00114     if( pItem.iImage != newImage )
00115     {
00116         pItem.iImage = newImage;
00117         pItem.iSelectedImage = newImage;
00118         pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00119         treeCtrl.SetItem(&pItem);
00120     }
00121 }
00122
00127 static void onIgnoreChanged(CObject* obj)
00128 {
00129     ((CWinCvsBrowser*)obj)->OnIgnoreChanged();
00130 }
00131
00133 // CSelectionChangeNotifier
00134
00135 CSelectionChangeNotifier::CSelectionChangeNotifier(CWinCvsBrowser* view, bool notify)
00136     : m_notify(notify), m_view(view), m_wasLocked(view->GetSelectionNotificationLocked())
00137 {
00138     if( !m_wasLocked )
00139     {
00140         m_view->SetSelectionChanged(false);
00141         m_view->SetSelectionNotificationLocked(true);
00142     }
00143 }
00144
00145 CSelectionChangeNotifier::~CSelectionChangeNotifier()
00146 {
00147     m_view->SetSelectionNotificationLocked(m_wasLocked);
00148     if( !m_wasLocked )
00149     {
00150         if( m_notify )
00151         {
00152             m_view->NotifySelectionChange();
00153         }
00154
00155         m_view->SetSelectionChanged(false);
00156     }
00157 }
00158
00160 // TBrowserFillDummy
00161
00162 TBrowserFillDummy::TBrowserFillDummy(CTreeCtrl& treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData* data)
00163     : m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true), m_data(data), m_hascvs(false)
00164 {
00165 }
00166
00167 kTraversal TBrowserFillDummy::EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec)
00168 {
00169     if( m_item == 0L )
00170     {
00171         TV_INSERTSTRUCT tvstruct;
00172         tvstruct.hParent = m_root;
00173         tvstruct.hInsertAfter = TVI_SORT;
00174         tvstruct.item.iImage = kIconFolderClosed;
00175         tvstruct.item.iSelectedImage = kIconFolderClosed;
00176         tvstruct.item.pszText = (char*)dirname;
00177         tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
00178         m_item = m_treeCtrl.InsertItem(&tvstruct);
00179     }
00180
00181     // Assign the entries to this item
00182     if( m_data != 0L )
00183     {
00184         EntnodeData* data = (EntnodeData*)m_treeCtrl.GetItemData(m_item);
00185
00186         if( m_data != 0L )
00187             m_data->Ref();
00188
00189         m_treeCtrl.SetItemData(m_item, (long)m_data);
00190
00191         if( data != 0L )
00192             data->UnRef();
00193     }
00194     else
00195         m_data = (EntnodeData*)m_treeCtrl.GetItemData(m_item);
00196
00197     return kContinueTraversal;
00198 }
00199
00200 kTraversal TBrowserFillDummy::ExitDirectory(const char* fullpath)
00201 {
00202     SetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00203
00204     if( m_empty )
00205         return kContinueTraversal;
00206
00207     // Add a dum': vc*1fg ;lm   my item to simulate the folder
00208     // is not empty. This dummy item will be
00209     // replaced by a complete listing when the
00210     // node is expanding...
00211     TV_INSERTSTRUCT tvstruct;
00212     tvstruct.hParent = m_item;
00213     tvstruct.hInsertAfter = TVI_SORT;
00214     tvstruct.item.pszText = (char*)gDummyFile;
00215     tvstruct.item.mask = TVIF_TEXT;
00216     m_treeCtrl.InsertItem(&tvstruct);
00217
00218     return kContinueTraversal;
00219 }
00220
00221 kTraversal TBrowserFillDummy::OnError(const char* err, int errcode)
00222 {
00223     return kTraversalError;
00224 }
00225
00226 kTraversal TBrowserFillDummy::OnIdle(const char* fullpath)
00227 {
00228     return kContinueTraversal;
00229 }
00230
00231 kTraversal TBrowserFillDummy::OnDirectory(const char* fullpath, const char* fullname, const char* name,
00232                                const struct stat& dir, const FSSpec* macspec)
00233 {
00234     if( stricmp(name, "cvs") == 0 )
00235         m_hascvs = true;
00236     else
00237         m_empty = false;
00238
00239     return kSkipFile;
00240 }
00241
00243 // TBrowserFill
00244
00245 TBrowserFill::TBrowserFill(CTreeCtrl& treeCtrl, HTREEITEM root, HTREEITEM item, CSortList<ENTNODE>& entries)
00246     : m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_hascvs(false), m_entries(entries), m_isShowIgnored(false)
00247 {
00248     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00249     {
00250         m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00251     }
00252 }
00253
00254 kTraversal TBrowserFill::EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec)
00255 {
00256     ASSERT(m_item != 0L);
00257
00258     Entries_Open (m_entries, fullpath);
00259     BuildIgnoredList(m_ignlist, fullpath);
00260
00261     return kContinueTraversal;
00262 }
00263
00264 kTraversal TBrowserFill::ExitDirectory(const char* fullpath)
00265 {
00266     m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00267     SetIcon(m_treeCtrl, m_item, m_hascvs, true, (EntnodeData*)m_treeCtrl.GetItemData(m_item));
00268
00269     return kContinueTraversal;
00270 }
00271
00272 kTraversal TBrowserFill::OnError(const char* err, int errcode)
00273 {
00274     return kTraversalError;
00275 }
00276
00277 kTraversal TBrowserFill::OnIdle(const char* fullpath)
00278 {
00279     return kContinueTraversal;
00280 }
00281
00282 kTraversal TBrowserFill::OnDirectory(const char* fullpath, const char* fullname, const char* name,
00283                                const struct stat& dir, const FSSpec* macspec)
00284 {
00285     if( stricmp(name, "cvs") == 0 )
00286     {
00287         m_hascvs = true;
00288         return kSkipFile;
00289     }
00290
00291     // Is the sub-directory ignored ?
00292     EntnodeData* data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00293     if( !m_isShowIgnored && data->IsIgnored() )
00294         return kSkipFile;
00295
00296     // Create the item for the sub-directory
00297     TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00298     kTraversal res = FileTraverse(fullname, traverse);
00299
00300     // Assign the icon regarding our Entries info
00301     if( traverse.GetItem() != 0L )
00302     {
00303         SetIcon(m_treeCtrl, traverse.GetItem(), m_hascvs, false, data);
00304     }
00305
00306     return kSkipFile;
00307 }
00308
00310 // CWinCvsBrowser
00311
00312 CImageList CWinCvsBrowser::m_imageList;
00313
00314 IMPLEMENT_DYNCREATE(CWinCvsBrowser, CTreeView)
00315
00316 BEGIN_MESSAGE_MAP(CWinCvsBrowser, CTreeView)
00317     //{{AFX_MSG_MAP(CWinCvsBrowser)
00318     ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
00319     ON_NOTIFY_REFLECT(TVN_SELCHANGING, OnSelchanging)
00320     ON_UPDATE_COMMAND_UI(ID_VIEW_ADD, OnUpdateViewAdd)
00321     ON_UPDATE_COMMAND_UI(ID_VIEW_COMMIT, OnUpdateViewUpdate)
00322     ON_COMMAND(ID_VIEW_ADD, OnViewAdd)
00323     ON_COMMAND(ID_VIEW_COMMIT, OnViewCommit)
00324     ON_COMMAND(ID_VIEW_UPDATE, OnViewUpdate)
00325     ON_COMMAND(ID_VIEW_QUERYUPDATE, OnViewQueryUpdate)
00326     ON_COMMAND(ID_VIEW_DIFF, OnViewDiff)
00327     ON_COMMAND(ID_VIEW_LOG, OnViewLog)
00328     ON_COMMAND(ID_VIEW_STATUS, OnViewStatus)
00329     ON_COMMAND(ID_VIEW_UNLOCKF, OnViewUnlock)
00330     ON_COMMAND(ID_VIEW_WATCHON, OnViewWatchOn)
00331     ON_COMMAND(ID_VIEW_WATCHOFF, OnViewWatchOff)
00332     ON_COMMAND(ID_VIEW_EDIT, OnViewEdit)
00333     ON_COMMAND(ID_VIEW_UNEDIT, OnViewUnedit)
00334     ON_COMMAND(ID_VIEW_WATCHERS, OnViewWatchers)
00335     ON_COMMAND(ID_VIEW_EDITORS, OnViewEditors)
00336     ON_COMMAND(ID_VIEW_RELEASE, OnViewRelease)
00337     ON_COMMAND(ID_VIEW_TAGNEW, OnViewTagNew)
00338     ON_COMMAND(ID_VIEW_TAGDELETE, OnViewTagDelete)
00339     ON_COMMAND(ID_VIEW_TAGBRANCH, OnViewTagBranch)
00340     ON_COMMAND(ID_VIEW_EXPLORE, OnViewExplore)
00341     ON_UPDATE_COMMAND_UI(ID_VIEW_EXPLORE, OnUpdateViewExplore)
00342     ON_UPDATE_COMMAND_UI(ID_VIEW_RELOAD, OnUpdateViewReload)
00343     ON_COMMAND(ID_VIEW_RELOAD, OnViewReload)
00344     ON_COMMAND(ID_VIEW_CHECKOUT, OnViewCheckout)
00345     ON_UPDATE_COMMAND_UI(ID_VIEW_CHECKOUT, OnUpdateViewCheckout)
00346     ON_COMMAND(ID_VIEW_IMPORT, OnViewImport)
00347     ON_UPDATE_COMMAND_UI(ID_VIEW_IMPORT, OnUpdateViewImport)
00348     ON_WM_SETCURSOR()
00349     ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
00350     ON_WM_DESTROY()
00351     ON_COMMAND(ID_VIEW_RESERVEDEDIT, OnViewReservededit)
00352     ON_COMMAND(ID_VIEW_FORCEEDIT, OnViewForceedit)
00353     ON_COMMAND(ID_APP_CMDLINE, OnAppCmdline)
00354     ON_COMMAND(ID_APP_RTAGBRANCH, OnAppRtagbranch)
00355     ON_COMMAND(ID_APP_RTAGCREATE, OnAppRtagcreate)
00356     ON_COMMAND(ID_APP_RTAGDELETE, OnAppRtagdelete)
00357     ON_UPDATE_COMMAND_UI(ID_APP_CMDLINE, OnUpdateAppCmdline)
00358     ON_WM_CONTEXTMENU()
00359     ON_UPDATE_COMMAND_UI(ID_VIEW_DIFF, OnUpdateViewUpdate)
00360     ON_UPDATE_COMMAND_UI(ID_VIEW_EDIT, OnUpdateViewUpdate)
00361     ON_UPDATE_COMMAND_UI(ID_VIEW_RESERVEDEDIT, OnUpdateViewUpdate)
00362     ON_UPDATE_COMMAND_UI(ID_VIEW_FORCEEDIT, OnUpdateViewUpdate)
00363     ON_UPDATE_COMMAND_UI(ID_VIEW_EDITORS, OnUpdateViewUpdate)
00364     ON_UPDATE_COMMAND_UI(ID_VIEW_LOG, OnUpdateViewUpdate)
00365     ON_UPDATE_COMMAND_UI(ID_VIEW_RELEASE, OnUpdateViewUpdate)
00366     ON_UPDATE_COMMAND_UI(ID_VIEW_STATUS, OnUpdateViewUpdate)
00367     ON_UPDATE_COMMAND_UI(ID_VIEW_UNEDIT, OnUpdateViewUpdate)
00368     ON_UPDATE_COMMAND_UI(ID_VIEW_UPDATE, OnUpdateViewUpdate)
00369     ON_UPDATE_COMMAND_UI(ID_VIEW_QUERYUPDATE, OnUpdateViewUpdate)
00370     ON_UPDATE_COMMAND_UI(ID_VIEW_UNLOCKF, OnUpdateViewUpdate)
00371     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHERS, OnUpdateViewUpdate)
00372     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHON, OnUpdateViewUpdate)
00373     ON_UPDATE_COMMAND_UI(ID_VIEW_WATCHOFF, OnUpdateViewUpdate)
00374     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGNEW, OnUpdateViewUpdate)
00375     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGDELETE, OnUpdateViewUpdate)
00376     ON_UPDATE_COMMAND_UI(ID_VIEW_TAGBRANCH, OnUpdateViewUpdate)
00377     ON_UPDATE_COMMAND_UI(ID_APP_RTAGBRANCH, OnUpdateViewUpdate)
00378     ON_UPDATE_COMMAND_UI(ID_APP_RTAGCREATE, OnUpdateViewUpdate)
00379     ON_UPDATE_COMMAND_UI(ID_APP_RTAGDELETE, OnUpdateViewUpdate)
00380     ON_WM_RBUTTONDOWN()
00381     //}}AFX_MSG_MAP
00382     ON_UPDATE_COMMAND_UI_RANGE(ID_MACRO_START, ID_MACRO_END, OnUpdateMacro)
00383     ON_COMMAND_EX_RANGE(ID_MACRO_START, ID_MACRO_END, OnMacro)
00384     ON_UPDATE_COMMAND_UI_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnUpdateCustomize)
00385     ON_COMMAND_EX_RANGE(ID_CUST_FILES_MENU, ID_CUST_FOLDER_MENU, OnCustomize)
00386     ON_MESSAGE(WM_RESETVIEW, OnResetView)
00387 END_MESSAGE_MAP()
00388
00389 CWinCvsBrowser::CWinCvsBrowser()
00390     : m_selectionNotificationLocked(false), m_selectionChanged(false), m_resetViewPending(false)
00391 {
00392 }
00393
00394 CWinCvsBrowser::~CWinCvsBrowser()
00395 {
00396 }
00397
00399 // CWinCvsBrowser drawing
00400
00402 void CWinCvsBrowser::OnDraw(CDC* pDC)
00403 {
00404     // No draw code
00405 }
00406
00408 // CWinCvsBrowser diagnostics
00409
00410 #ifdef _DEBUG
00411 void CWinCvsBrowser::AssertValid() const
00412 {
00413     CTreeView::AssertValid();
00414 }
00415
00416 void CWinCvsBrowser::Dump(CDumpContext& dc) const
00417 {
00418     CTreeView::Dump(dc);
00419 }
00420 #endif //_DEBUG
00421
00423 // CWinCvsBrowser message handlers
00424
00426 BOOL CWinCvsBrowser::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
00427 {
00428     if( !CTreeView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext) )
00429     {
00430         return FALSE;
00431     }
00432
00433     if( m_imageList.m_hImageList == 0L )
00434         m_imageList.Create(IDB_MODULES, 16, 1, RGB(255, 255, 255));
00435
00436     CTreeCtrl& treeCtrl = GetTreeCtrl();
00437     treeCtrl.SetImageList(&m_imageList, TVSIL_NORMAL);
00438
00439     // Set the initial root
00440     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00441     CMainFrame* mainFrm = app->GetMainFrame();
00442     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00443     CStr newpath((const char*)hist.GetOldLoc());
00444     ResetBrowser(newpath, true);
00445
00446     SetNewStyle(TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, TRUE);
00447
00448     return TRUE;
00449 }
00450
00455 void CWinCvsBrowser::DeleteAllItems(HTREEITEM root /*= 0L*/)
00456 {
00457     // We don't want the file view to be notified when things get deleted
00458     // process selection after we are done with all that jazz below
00459     CSelectionChangeNotifier notifier(this, true);
00460
00461     CTreeCtrl& treeCtrl = GetTreeCtrl();
00462     bool eraseRoot = false;
00463     if( root == 0L )
00464     {
00465         root = treeCtrl.GetRootItem( );
00466         eraseRoot = true;
00467     }
00468
00469     if( root == 0L )
00470         return;
00471
00472     HTREEITEM childItem = treeCtrl.GetNextItem(root, TVGN_CHILD);
00473
00474     // Erase all the childs
00475     while( childItem != 0L )
00476     {
00477         EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
00478         if( data != 0L )
00479         {
00480             treeCtrl.SetItemData(childItem,0L); //So that subsequent references after UnRef() won't SEGV
00481             data->UnRef();  //Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00482         }
00483
00484         DeleteAllItems(childItem);
00485
00486         HTREEITEM nextItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
00487         VERIFY(treeCtrl.DeleteItem(childItem));
00488         childItem = nextItem;
00489     }
00490
00491     // Erase the root only if initially root was 0L
00492     if( eraseRoot )
00493     {
00494         EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(root);
00495         ASSERT(data == 0L);
00496
00497         VERIFY(treeCtrl.DeleteItem(root));
00498     }
00499 }
00500
00507 void CWinCvsBrowser::ResetBrowser(const char* path, bool notifyView)
00508 {
00509     CWaitCursor doWait;
00510
00511     // Must make a copy of 'path' before calling DeleteAllItems(), since
00512     // this function may have been called with 'm_root' passed as the first
00513     // parameter (in fact it is in several places in the code) whose value
00514     // gets deleted by the call to DeleteAllItems() below, making 'path'
00515     // point to an invalid memory location
00516     CStr pathCopy(path);
00517     DeleteAllItems();
00518     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00519
00520     m_root = pathCopy;
00521
00522     if( pathCopy.empty() )
00523         return;
00524
00525     if( !isReload )
00526     {
00527         if( HasPersistentSettings(m_root) )
00528             LoadPersistentSettings(m_root);
00529         else
00530         {
00531             // Check if the path has a CVS folder. If not,
00532             // we don't want the user to be prompted (like when
00533             // WinCvs is starting for the first time).
00534             UStr cvsFolder(m_root);
00535             if( !cvsFolder.endsWith(kPathDelimiter) )
00536                 cvsFolder << kPathDelimiter;
00537
00538             cvsFolder << "CVS";
00539             struct stat sb;
00540             if( stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode) )
00541                 AskCreatePersistentSettings(m_root);
00542         }
00543     }
00544
00545     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00546     CMainFrame* mainFrm = app->GetMainFrame();
00547     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00548     hist.NewRoot(m_root);
00549
00550     CTreeCtrl& treeCtrl = GetTreeCtrl();
00551     TBrowserFillDummy traverse(treeCtrl, 0L, 0L, 0L);
00552     kTraversal res = FileTraverse(m_root, traverse);
00553
00554     CBrowseFileView* fileView = app->GetFileView();
00555     if( fileView != 0L )
00556     {
00557         HTREEITEM root = treeCtrl.GetRootItem();
00558         if( root != 0L )
00559         {
00560             treeCtrl.Expand(root, TVE_EXPAND);
00561             if( notifyView )
00562             {
00563                 VERIFY(treeCtrl.Select(root, TVGN_CARET));
00564             }
00565         }
00566     }
00567 }
00568
00574 void CWinCvsBrowser::SetNewStyle(long lStyleMask, BOOL bSetBits)
00575 {
00576     long lStyleOld;
00577
00578     lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
00579     lStyleOld &= ~lStyleMask;
00580     if( bSetBits )
00581         lStyleOld |= lStyleMask;
00582
00583     SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld);
00584     SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00585 }
00586
00592 void CWinCvsBrowser::RetrievePath(HTREEITEM item, CStr& path)
00593 {
00594     CTreeCtrl& treeCtrl = GetTreeCtrl();
00595
00596     CStr tmp, newPath;
00597     path = "";
00598     TV_ITEM pItem;
00599     char name[512];
00600
00601     do
00602     {
00603         pItem.hItem = item;
00604         pItem.pszText = name;
00605         pItem.cchTextMax = 512;
00606         pItem.mask = TVIF_HANDLE | TVIF_TEXT;
00607
00608         VERIFY(treeCtrl.GetItem(&pItem));
00609         item = treeCtrl.GetParentItem(item);
00610
00611         tmp = path;
00612         newPath = item == 0L ? (const char*)m_root : pItem.pszText;
00613         if( !newPath.endsWith(kPathDelimiter) )
00614             newPath << kPathDelimiter;
00615
00616         newPath << path;
00617         path = newPath;
00618     } while(item != 0L);
00619 }
00620
00622 void CWinCvsBrowser::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
00623 {
00624     // Prevent from changing directory if cvs is running
00625     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00626     if( app->IsCvsRunning() )
00627     {
00628         *pResult = TRUE;
00629         return;
00630     }
00631
00632     CTreeCtrl& treeCtrl = GetTreeCtrl();
00633     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00634
00635     HTREEITEM item = pNMTreeView->itemNew.hItem;
00636
00637     EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(item);
00638     if( data != 0L && data->IsMissing() )
00639     {
00640         *pResult = TRUE;
00641         return;
00642     }
00643
00644     // Erase all the childs
00645     DeleteAllItems(item);
00646
00647     CStr path;
00648     RetrievePath(item, path);
00649
00650     if( pNMTreeView->action & TVE_COLLAPSE )
00651     {
00652         TBrowserFillDummy traverse(treeCtrl, 0L, item, 0L);
00653         kTraversal res = FileTraverse(path, traverse);
00654     }
00655     else if( pNMTreeView->action & TVE_EXPAND )
00656     {
00657         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00658         TBrowserFill traverse(treeCtrl, 0L, item, entries);
00659         kTraversal res = FileTraverse(path, traverse);
00660
00661         // Add the missing folders
00662         Entries_SetMissing(entries);
00663         int numEntries = entries.NumOfElements();
00664         for(int i = 0; i < numEntries; i++)
00665         {
00666             const ENTNODE & theNode = entries.Get(i);
00667             EntnodeData* data = theNode.Data();
00668             if( !data->IsMissing() || data->GetType() != ENT_SUBDIR )
00669                 continue;
00670
00671             TV_INSERTSTRUCT tvstruct;
00672             tvstruct.hParent = item;
00673             tvstruct.hInsertAfter = TVI_SORT;
00674             tvstruct.item.iImage = kIconFolderLost;
00675             tvstruct.item.iSelectedImage = kIconFolderLost;
00676             tvstruct.item.pszText = (char*)(*data)[EntnodeData::kName];
00677             tvstruct.item.lParam = (long)data->Ref();
00678             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
00679             treeCtrl.InsertItem(&tvstruct);
00680         }
00681     }
00682
00683     *pResult = 0;
00684 }
00685
00691 void CWinCvsBrowser::OnUpdateCmd(CCmdUI* pCmdUI, BOOL needCvsInfos)
00692 {
00693     if( DisableCommon() )
00694     {
00695         pCmdUI->Enable(FALSE);
00696         return;
00697     }
00698
00699     CTreeCtrl& treeCtrl = GetTreeCtrl();
00700     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00701     if( selItem == 0L )
00702     {
00703         pCmdUI->Enable(FALSE);
00704         return;
00705     }
00706
00707     CStr path;
00708     RetrievePath(selItem, path);
00709     if( !path.endsWith(kPathDelimiter) )
00710         path << kPathDelimiter;
00711
00712     path << "CVS";
00713
00714     struct stat sb;
00715     if( stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode) )
00716         pCmdUI->Enable(!needCvsInfos);
00717     else
00718         pCmdUI->Enable(needCvsInfos);
00719 }
00720
00723 void CWinCvsBrowser::OnRButtonDown(UINT nFlags, CPoint point)
00724 {
00725     // Prevent from changing directory if cvs is running
00726     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00727     if( app->IsCvsRunning() )
00728         return;
00729
00730     CTreeCtrl& treeCtrl = GetTreeCtrl();
00731
00732     UINT pFlags;
00733     HTREEITEM testItem = treeCtrl.HitTest(point, &pFlags);
00734
00735     if( testItem != 0L && (pFlags & (TVHT_ONITEM | TVHT_ONITEMBUTTON | TVHT_ONITEMRIGHT)) != 0 )
00736     {
00737         treeCtrl.SelectItem(testItem);
00738     }
00739
00740     //CTreeView::OnRButtonDown(nFlags, point);
00741 }
00742
00744 void CWinCvsBrowser::OnContextMenu(CWnd* pWnd, CPoint point)
00745 {
00746     // Prevent from changing directory if cvs is running
00747     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00748     if( app->IsCvsRunning() )
00749     {
00750         return;
00751     }
00752
00753     CTreeCtrl& treeCtrl = GetTreeCtrl();
00754     const HTREEITEM item = treeCtrl.GetSelectedItem();
00755     if( item )
00756     {
00757         // Set the track point in case it's not the mouse click
00758         if( -1 == point.x && -1 == point.y )
00759         {
00760             // Get the icon's rectangle
00761             CRect rectItem;
00762             if( treeCtrl.GetItemRect(item, &rectItem, TRUE) )
00763             {
00764                 point = rectItem.CenterPoint();
00765                 ClientToScreen(&point);
00766             }
00767         }
00768
00769         treeCtrl.SelectItem(item);
00770
00771         // Locate the submenu after item selection
00772         std::auto_ptr<CMenu> pCustomMenu(::GetCustomMenu(kCustomBrowserMenu, this));
00773         if( pCustomMenu.get() )
00774         {
00775             pCustomMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
00776         }
00777     }
00778 }
00779
00781 void CWinCvsBrowser::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
00782 {
00783     // Prevent from changing directory if cvs is running
00784     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00785     if( app->IsCvsRunning() )
00786     {
00787         *pResult = TRUE;
00788         return;
00789     }
00790
00791     CTreeCtrl& treeCtrl = GetTreeCtrl();
00792     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00793     HTREEITEM item = pNMTreeView->itemNew.hItem;
00794
00795     EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(item);
00796     if( data != 0L && data->IsMissing() )
00797     {
00798         *pResult = TRUE;
00799         return;
00800     }
00801
00802     *pResult = 0;
00803 }
00804
00806 void CWinCvsBrowser::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
00807 {
00808     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00809
00810     m_selectionChanged = true;
00811     NotifySelectionChange();
00812
00813     *pResult = 0;
00814 }
00815
00819 void CWinCvsBrowser::NotifySelectionChange()
00820 {
00821     if( !m_selectionNotificationLocked )
00822     {
00823         if( m_selectionChanged )
00824         {
00825             CStr path;
00826             HTREEITEM item = GetTreeCtrl().GetSelectedItem();
00827             if( item )
00828             {
00829                 RetrievePath(item, path);
00830                 CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00831                 CBrowseFileView* fileView = app->GetFileView();
00832                 if( fileView )
00833                 {
00834                     fileView->ResetView(path);
00835                 }
00836
00837                 gCvsPrefs.SetLastWorkingDir(path);
00838             }
00839         }
00840     }
00841 }
00842
00848 bool CWinCvsBrowser::ProcessSelectionCommand(KiSelectionHandler* handler)
00849 {
00850     bool res = false;
00851
00852     CTreeCtrl& treeCtrl = GetTreeCtrl();
00853     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00854
00855     if( selItem )
00856     {
00857         CStr path;
00858
00859         RetrievePath(selItem, path);
00860         handler->OnFolder(path);
00861
00862         res = true;
00863     }
00864
00865     return res;
00866 }
00867
00869 void CWinCvsBrowser::OnUpdateViewAdd(CCmdUI* pCmdUI)
00870 {
00871     OnUpdateCmd(pCmdUI, FALSE);
00872 }
00873
00875 void CWinCvsBrowser::OnUpdateAppCmdline(CCmdUI* pCmdUI)
00876 {
00877     pCmdUI->Enable(!DisableCommon());
00878 }
00879
00881 void CWinCvsBrowser::OnUpdateViewUpdate(CCmdUI* pCmdUI)
00882 {
00883     OnUpdateCmd(pCmdUI, TRUE);
00884 }
00885
00887 void CWinCvsBrowser::OnViewAdd()
00888 {
00889     KoAddHandler handler;
00890     ProcessSelectionCommand(&handler);
00891 }
00892
00894 void CWinCvsBrowser::OnViewCommit()
00895 {
00896     KoCommitHandler handler;
00897     ProcessSelectionCommand(&handler);
00898 }
00899
00901 void CWinCvsBrowser::OnViewUpdate()
00902 {
00903     KoUpdateHandler handler;
00904     ProcessSelectionCommand(&handler);
00905 }
00906
00908 void CWinCvsBrowser::OnViewQueryUpdate()
00909 {
00910     KoQueryUpdateHandler handler;
00911     ProcessSelectionCommand(&handler);
00912 }
00913
00915 void CWinCvsBrowser::OnViewDiff()
00916 {
00917     KoDiffHandler handler;
00918     ProcessSelectionCommand(&handler);
00919 }
00920
00922 void CWinCvsBrowser::OnViewLog()
00923 {
00924     KoLogHandler handler;
00925     ProcessSelectionCommand(&handler);
00926 }
00927
00929 void CWinCvsBrowser::OnViewStatus()
00930 {
00931     KoStatusHandler handler;
00932     ProcessSelectionCommand(&handler);
00933 }
00934
00936 void CWinCvsBrowser::OnViewUnlock()
00937 {
00938     KoUnlockHandler handler;
00939     ProcessSelectionCommand(&handler);
00940 }
00941
00943 void CWinCvsBrowser::OnViewWatchOn()
00944 {
00945     KoWatchOnHandler handler;
00946     ProcessSelectionCommand(&handler);
00947 }
00948
00950 void CWinCvsBrowser::OnViewWatchOff()
00951 {
00952     KoWatchOffHandler handler;
00953     ProcessSelectionCommand(&handler);
00954 }
00955
00957 void CWinCvsBrowser::OnViewEdit()
00958 {
00959     KoEditHandler handler;
00960     ProcessSelectionCommand(&handler);
00961 }
00962
00964 void CWinCvsBrowser::OnViewReservededit()
00965 {
00966     KoReservedEditHandler handler;
00967     ProcessSelectionCommand(&handler);
00968 }
00969
00971 void CWinCvsBrowser::OnViewForceedit()
00972 {
00973     KoForceEditHandler handler;
00974     ProcessSelectionCommand(&handler);
00975 }
00976
00978 void CWinCvsBrowser::OnViewUnedit()
00979 {
00980     KoUneditHandler handler;
00981     ProcessSelectionCommand(&handler);
00982 }
00983
00985 void CWinCvsBrowser::OnViewWatchers()
00986 {
00987     KoWatchersHandler handler;
00988     ProcessSelectionCommand(&handler);
00989 }
00990
00992 void CWinCvsBrowser::OnViewEditors()
00993 {
00994     KoEditorsHandler handler;
00995     ProcessSelectionCommand(&handler);
00996 }
00997
00999 void CWinCvsBrowser::OnViewRelease()
01000 {
01001     KoReleaseHandler handler;
01002     ProcessSelectionCommand(&handler);
01003 }
01004
01006 void CWinCvsBrowser::OnViewTagNew()
01007 {
01008     KoCreateTagHandler handler;
01009     ProcessSelectionCommand(&handler);
01010 }
01011
01013 void CWinCvsBrowser::OnViewTagDelete()
01014 {
01015     KoDeleteTagHandler handler;
01016     ProcessSelectionCommand(&handler);
01017 }
01018
01020 void CWinCvsBrowser::OnViewTagBranch()
01021 {
01022     KoBranchTagHandler handler;
01023     ProcessSelectionCommand(&handler);
01024 }
01025
01027 void CWinCvsBrowser::OnInitialUpdate()
01028 {
01029     CTreeView::OnInitialUpdate();
01030
01031     CTreeCtrl& treeCtrl = GetTreeCtrl();
01032     HTREEITEM root = treeCtrl.GetRootItem();
01033     if( root != 0L )
01034     {
01035         treeCtrl.Expand(root, TVE_EXPAND);
01036         VERIFY(treeCtrl.Select(root, TVGN_CARET));
01037     }
01038
01039     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
01040     {
01041         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onIgnoreChanged);
01042     }
01043 }
01044
01046 void CWinCvsBrowser::OnViewExplore()
01047 {
01048     CTreeCtrl& treeCtrl = GetTreeCtrl();
01049     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01050
01051     CStr path;
01052     RetrievePath(selItem, path);
01053     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path, 0L, 0L, SW_SHOWDEFAULT);
01054     if( (long)hInst < 32 )
01055     {
01056         cvs_err("Unable to explore '%s' (error %d)\n", (char*)path, GetLastError());
01057     }
01058 }
01059
01061 void CWinCvsBrowser::OnUpdateViewExplore(CCmdUI* pCmdUI)
01062 {
01063     if( DisableCommon() )
01064     {
01065         pCmdUI->Enable(FALSE);
01066         return;
01067     }
01068
01069     CTreeCtrl& treeCtrl = GetTreeCtrl();
01070     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01071     if( selItem == 0L )
01072     {
01073         pCmdUI->Enable(FALSE);
01074         return;
01075     }
01076
01077     pCmdUI->Enable(TRUE);
01078 }
01079
01086 bool CWinCvsBrowser::StepToLocation(const char* path, bool notifyView /*= false*/)
01087 {
01088     bool bRes = false;
01089
01090     CStr root(m_root);
01091     if( !root.endsWith(kPathDelimiter) )
01092         root << kPathDelimiter;
01093
01094     CStr subpath(path);
01095     if( !subpath.endsWith(kPathDelimiter) )
01096         subpath << kPathDelimiter;
01097
01098     // Check if it is a sub-path
01099     if( strnicmp(root, subpath, root.length()) != 0 )
01100         return false;
01101
01102     CTreeCtrl& treeCtrl = GetTreeCtrl();
01103     HTREEITEM item = treeCtrl.GetRootItem();
01104     HTREEITEM lastitem = 0L;
01105     if( item == 0L )
01106         return false;
01107
01108     if( stricmp(root, subpath) == 0 )
01109     {
01110         // Must select root node
01111         lastitem = item;
01112         treeCtrl.Expand(item, TVE_EXPAND);
01113     }
01114     else
01115     {
01116         // Step inside synchronized
01117         const char* tmp = (const char*)subpath + root.length() - 1;
01118         while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
01119         {
01120             const char* name = ++tmp;
01121             if( name[0] == '\0' )
01122                 break;
01123
01124             CStr subname;
01125             const char* tmp2 = strchr(name, kPathDelimiter);
01126             if( tmp2 == 0L )
01127                 subname = name;
01128             else
01129                 subname.set(name, tmp2 - name);
01130
01131             HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01132
01133             // Find the subitem which matches this name
01134             while( childItem != 0L )
01135             {
01136                 EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
01137                 if( data != 0L )
01138                 {
01139                     if( _stricmp((*data)[EntnodeData::kName], subname) == 0 )
01140                     {
01141                         // Found it !
01142                         lastitem = item = childItem;
01143                         treeCtrl.Expand(item, TVE_EXPAND);
01144                         break;
01145                     }
01146                 }
01147
01148                 childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01149             }
01150         }
01151     }
01152
01153     // In case this is called by the view, turn off notifying when the item gets selected
01154     if( lastitem != 0L )
01155     {
01156         CSelectionChangeNotifier notifier(this, notifyView);
01157         VERIFY( bRes = (treeCtrl.Select(lastitem, TVGN_CARET) != 0) );
01158     }
01159
01160     return bRes;
01161 }
01162
01168 HTREEITEM CWinCvsBrowser::GetItemByLocation(const char* path)
01169 {
01170     CStr root(m_root);
01171     if( !root.endsWith(kPathDelimiter) )
01172         root << kPathDelimiter;
01173
01174     CStr subpath(path);
01175     if( !subpath.endsWith(kPathDelimiter) )
01176         subpath << kPathDelimiter;
01177
01178     // Check if it is a sub-path
01179     if( strncmp(root, subpath, root.length()) != 0 )
01180         return 0L;
01181
01182     CTreeCtrl& treeCtrl = GetTreeCtrl();
01183     HTREEITEM item = treeCtrl.GetRootItem();
01184     if( item == 0L )
01185         return 0L;
01186
01187     // Step inside synchronized
01188     const char* tmp = (const char*)subpath + root.length() - 1;
01189     while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
01190     {
01191         const char* name = ++tmp;
01192         if( name[0] == '\0' )
01193             break;
01194
01195         CStr subname;
01196         const char* tmp2 = strchr(name, kPathDelimiter);
01197         if( tmp2 == 0L )
01198             subname = name;
01199         else
01200             subname.set(name, tmp2 - name);
01201
01202         HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01203
01204         // Find the subitem which matches this name
01205         while( childItem != 0L )
01206         {
01207             EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
01208             if( data != 0L )
01209             {
01210                 if( _stricmp((*data)[EntnodeData::kName], subname) == 0 )
01211                 {
01212                     item = childItem;
01213                     break;
01214                 }
01215             }
01216
01217             childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01218         }
01219
01220         if( childItem == 0L )
01221             return 0L;
01222     }
01223
01224     return item;
01225 }
01226
01233 void CWinCvsBrowser::StoreExpanded(std::vector<CStr>& allExpanded, HTREEITEM root /*= 0L*/)
01234 {
01235     HTREEITEM item = root;
01236     CTreeCtrl& treeCtrl = GetTreeCtrl();
01237     if( item == 0L )
01238         item = treeCtrl.GetRootItem();
01239
01240     if( item == 0L )
01241         return;
01242
01243     TV_ITEM pItem;
01244     pItem.hItem = item;
01245     pItem.mask = TVIF_STATE;
01246     VERIFY(treeCtrl.GetItem(&pItem));
01247
01248     if( pItem.state & TVIS_EXPANDED )
01249     {
01250         CStr path;
01251         RetrievePath(item, path);
01252         allExpanded.push_back(path);
01253     }
01254
01255     HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01256     while( childItem != 0L )
01257     {
01258         StoreExpanded(allExpanded, childItem);
01259         childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01260     }
01261 }
01262
01268 void CWinCvsBrowser::ResetView(bool forceReload /*= false*/, bool notifyView /*= false*/)
01269 {
01270     // No outstanding request to reset the view any more
01271     m_resetViewPending = false;
01272
01273     CWaitCursor doWait;
01274     CWndRedrawMngr redrawMngr(this);
01275
01276     bool contentChanged = false;
01277
01278     vector<CStr> allExpanded;
01279     StoreExpanded(allExpanded);
01280
01281     CTreeCtrl& treeCtrl = GetTreeCtrl();
01282     CStr selPath;
01283
01284     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01285     if( selItem != 0L )
01286         RetrievePath(selItem, selPath);
01287
01288     if( forceReload )
01289     {
01290         ResetBrowser(m_root);
01291         contentChanged = true;
01292     }
01293
01294     if( contentChanged )
01295     {
01296         // Restore the expanded paths and the selected item
01297         vector<CStr>::const_iterator i;
01298         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
01299         {
01300             StepToLocation(*i);
01301         }
01302
01303         if( !selPath.empty() )
01304         {
01305             selItem = GetItemByLocation(selPath);
01306             if( selItem != 0L )
01307             {
01308                 VERIFY(treeCtrl.Select(selItem, TVGN_CARET));
01309                 treeCtrl.EnsureVisible(selItem);
01310             }
01311         }
01312     }
01313
01314     // We don't need to notify the file view if we force the reload because that's already done
01315     if( notifyView )
01316     {
01317         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01318         app->GetFileView()->ResetView();
01319     }
01320 }
01321
01323 void CWinCvsBrowser::OnUpdateViewReload(CCmdUI* pCmdUI)
01324 {
01325     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01326     pCmdUI->Enable(!app->IsCvsRunning());
01327 }
01328
01330 void CWinCvsBrowser::OnViewReload()
01331 {
01332     ResetView(true, true);
01333 }
01334
01336 BOOL CWinCvsBrowser::OnMacro(UINT nID)
01337 {
01338     PyDoPython(WINCMD_to_UCMD(nID));
01339
01340     return 1;
01341 }
01342
01344 void CWinCvsBrowser::OnUpdateMacro(CCmdUI* pCmdUI)
01345 {
01346     if( DisableCommon() )
01347     {
01348         pCmdUI->Enable(FALSE);
01349         return;
01350     }
01351
01352     // Fill the cache with current selection
01353     if( !PyIsUICacheValid() )
01354     {
01355         CTreeCtrl& treeCtrl = GetTreeCtrl();
01356         HTREEITEM selItem = treeCtrl.GetSelectedItem();
01357         if( selItem != 0L )
01358         {
01359             CStr selPath;
01360             RetrievePath(selItem, selPath);
01361             CStr uppath, folder;
01362             SplitPath(selPath, uppath, folder);
01363
01364             bool deleteData = false;
01365             EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(selItem);
01366             if( data == 0L )
01367             {
01368                 deleteData = true;
01369                 EntnodePath *thePath = new EntnodePath(uppath);
01370                 data = new EntnodeFolder(folder, thePath);
01371                 thePath->UnRef();
01372             }
01373
01374             PyAppendCache(data);
01375
01376             if( deleteData )
01377                 data->UnRef();
01378         }
01379     }
01380
01381     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01382     ucmdui.pCmdUI = pCmdUI;
01383     PyDoCmdUI(&ucmdui);
01384 }
01385
01387 BOOL CWinCvsBrowser::PreCreateWindow(CREATESTRUCT& cs)
01388 {
01389     cs.style |= WS_TABSTOP | TVS_SHOWSELALWAYS;
01390
01391     return CTreeView::PreCreateWindow(cs);
01392 }
01393
01398 bool CWinCvsBrowser::DisableCommon()
01399 {
01400     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01401     return app->IsCvsRunning() || gCvsPrefs.empty();
01402 }
01403
01405 void CWinCvsBrowser::OnViewCheckout()
01406 {
01407     KoCheckoutHandler handler;
01408     ProcessSelectionCommand(&handler);
01409 }
01410
01412 void CWinCvsBrowser::OnUpdateViewCheckout(CCmdUI* pCmdUI)
01413 {
01414     if( DisableCommon() )
01415     {
01416         pCmdUI->Enable(FALSE);
01417         return;
01418     }
01419
01420     pCmdUI->Enable(TRUE);
01421     pCmdUI->SetText("Chec&kout module...");
01422 }
01423
01425 void CWinCvsBrowser::OnViewImport()
01426 {
01427     KoImportHandler handler;
01428     ProcessSelectionCommand(&handler);
01429 }
01430
01432 void CWinCvsBrowser::OnUpdateViewImport(CCmdUI* pCmdUI)
01433 {
01434     if( DisableCommon() )
01435     {
01436         pCmdUI->Enable(FALSE);
01437         return;
01438     }
01439
01440     pCmdUI->Enable(TRUE);
01441     pCmdUI->SetText("&Import module...");
01442 }
01443
01445 BOOL CWinCvsBrowser::OnCustomize(UINT nID)
01446 {
01447     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01448     return TRUE;
01449 }
01450
01452 void CWinCvsBrowser::OnUpdateCustomize(CCmdUI* pCmdUI)
01453 {
01454     pCmdUI->Enable(TRUE);
01455 }
01456
01458 BOOL CWinCvsBrowser::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
01459 {
01460     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01461     if( app->IsCvsRunning() )
01462     {
01463         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01464         return TRUE;
01465     }
01466
01467     return CTreeView::OnSetCursor(pWnd, nHitTest, message);
01468 }
01469
01471 void CWinCvsBrowser::OnDestroy()
01472 {
01473     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
01474     {
01475         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01476     }
01477
01478     CTreeView::OnDestroy();
01479 }
01480
01482 void CWinCvsBrowser::OnIgnoreChanged()
01483 {
01484     if( !m_resetViewPending )
01485     {
01486         m_resetViewPending = true;
01487         PostMessage(WM_RESETVIEW);
01488     }
01489 }
01490
01492 LRESULT CWinCvsBrowser::OnResetView(WPARAM, LPARAM)
01493 {
01494     ResetView(true, false);
01495     return 0;
01496 }
01497
01499 void CWinCvsBrowser::OnAppCmdline()
01500 {
01501     KoCommandLineHandler handler;
01502     ProcessSelectionCommand(&handler);
01503 }
01504
01506 void CWinCvsBrowser::OnAppRtagbranch()
01507 {
01508     KoRtagBranchHandler handler;
01509     ProcessSelectionCommand(&handler);
01510 }
01511
01513 void CWinCvsBrowser::OnAppRtagcreate()
01514 {
01515     KoRtagCreateHandler handler;
01516     ProcessSelectionCommand(&handler);
01517 }
01518
01520 void CWinCvsBrowser::OnAppRtagdelete()
01521 {
01522     KoRtagDeleteHandler handler;
01523     ProcessSelectionCommand(&handler);
01524 }
Generated on Fri Jan 31 12:09:08 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvs/WinCvsBrowser.h Source File

WinCvs/WinCvsBrowser.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>
00019  */
00020
00021 #if !defined(AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_)
00022 #define AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_
00023
00024 #if _MSC_VER >= 1000
00025 #pragma once
00026 #endif // _MSC_VER >= 1000
00027 // WinCvsBrowser.h : header file
00028 //
00029
00030 #include <afxcview.h>
00031 #include "CPStr.h"
00032 #include "FileTraversal.h"
00033 #include "BrowseFileView.h"
00034
00035 class KiSelectionHandler;
00036 class CWinCvsBrowser;
00037 class EntnodeData;
00038
00043 class CSelectionChangeNotifier
00044 {
00045 public:
00046     // Construction
00047     CSelectionChangeNotifier(CWinCvsBrowser* view, bool notify);
00048     virtual ~CSelectionChangeNotifier();
00049
00050 private:
00051     // Data members
00052     bool m_notify;
00053     bool m_wasLocked;
00054     CWinCvsBrowser* m_view;
00055 };
00056
00058 class TBrowserFillDummy : public TraversalReport
00059 {
00060 public:
00061     // Construction
00062     TBrowserFillDummy(CTreeCtrl& treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData* data);
00063
00064 private:
00065     // Data members
00066     HTREEITEM m_root;
00067     HTREEITEM m_item;
00068     CTreeCtrl& m_treeCtrl;
00069     bool m_empty;
00070     bool m_hascvs;
00071     EntnodeData* m_data;
00073     // Methods
00074     virtual kTraversal EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec);
00075     virtual kTraversal ExitDirectory(const char* fullpath);
00076     virtual kTraversal OnError(const char* err, int errcode);
00077     virtual kTraversal OnIdle(const char* fullpath);
00078     virtual kTraversal OnDirectory(const char* fullpath, const char* fullname, const char* name,
00079         const struct stat& dir, const FSSpec* macspec);
00080
00081 public:
00082     // Interface
00083
00085     inline HTREEITEM GetItem() const { return m_item; };
00086 };
00087
00089 class TBrowserFill : public TraversalReport
00090 {
00091 public:
00092     // Construction
00093     TBrowserFill(CTreeCtrl& treeCtrl, HTREEITEM root, HTREEITEM item, CSortList<ENTNODE>& entries);
00094
00095 private:
00096     // Data members
00097     HTREEITEM m_root;
00098     HTREEITEM m_item;
00099     CTreeCtrl& m_treeCtrl;
00100     bool m_hascvs;
00101     CSortList<ENTNODE>& m_entries;
00102     vector<CStr> m_ignlist;
00103     bool m_isShowIgnored;
00105     // Methods
00106     virtual kTraversal EnterDirectory(const char* fullpath, const char* dirname, const FSSpec* macspec);
00107     virtual kTraversal ExitDirectory(const char* fullpath);
00108     virtual kTraversal OnError(const char* err, int errcode);
00109     virtual kTraversal OnIdle(const char* fullpath);
00110     virtual kTraversal OnDirectory(const char* fullpath, const char* fullname, const char* name,
00111         const struct stat& dir, const FSSpec* macspec);
00112 };
00113
00115 // CWinCvsBrowser view
00116
00117 class CWinCvsBrowser : public CTreeView
00118 {
00119 protected:
00120     DECLARE_DYNCREATE(CWinCvsBrowser)
00121
00122     CWinCvsBrowser();           // protected constructor used by dynamic creation
00123     virtual ~CWinCvsBrowser();
00124
00125 // Attributes
00126 protected:
00127
00128 // Operations
00129 public:
00130
00131 // Overrides
00132     // ClassWizard generated virtual function overrides
00133     //{{AFX_VIRTUAL(CWinCvsBrowser)
00134     public:
00135     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00136     virtual void OnInitialUpdate();
00137     protected:
00138     virtual void OnDraw(CDC* pDC);      // overridden to draw this view
00139     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00140     //}}AFX_VIRTUAL
00141
00142 // Implementation
00143 protected:
00144
00145
00146 #ifdef _DEBUG
00147     virtual void AssertValid() const;
00148     virtual void Dump(CDumpContext& dc) const;
00149 #endif
00150
00151     // Generated message map functions
00152 protected:
00153     //{{AFX_MSG(CWinCvsBrowser)
00154     afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
00155     afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
00156     afx_msg void OnUpdateViewAdd(CCmdUI* pCmdUI);
00157     afx_msg void OnUpdateViewUpdate(CCmdUI* pCmdUI);
00158     afx_msg void OnViewAdd();
00159     afx_msg void OnViewCommit();
00160     afx_msg void OnViewUpdate();
00161     afx_msg void OnViewQueryUpdate();
00162     afx_msg void OnViewDiff();
00163     afx_msg void OnViewLog();
00164     afx_msg void OnViewStatus();
00165     afx_msg void OnViewUnlock();
00166     afx_msg void OnViewWatchOn();
00167     afx_msg void OnViewWatchOff();
00168     afx_msg void OnViewEdit();
00169     afx_msg void OnViewUnedit();
00170     afx_msg void OnViewWatchers();
00171     afx_msg void OnViewEditors();
00172     afx_msg void OnViewRelease();
00173     afx_msg void OnViewTagNew();
00174     afx_msg void OnViewTagDelete();
00175     afx_msg void OnViewTagBranch();
00176     afx_msg void OnViewExplore();
00177     afx_msg void OnUpdateViewExplore(CCmdUI* pCmdUI);
00178     afx_msg void OnUpdateViewReload(CCmdUI* pCmdUI);
00179     afx_msg void OnViewReload();
00180     afx_msg void OnViewCheckout();
00181     afx_msg void OnUpdateViewCheckout(CCmdUI* pCmdUI);
00182     afx_msg void OnViewImport();
00183     afx_msg void OnUpdateViewImport(CCmdUI* pCmdUI);
00184     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00185     afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
00186     afx_msg void OnDestroy();
00187     afx_msg void OnViewReservededit();
00188     afx_msg void OnViewForceedit();
00189     afx_msg void OnAppCmdline();
00190     afx_msg void OnAppRtagbranch();
00191     afx_msg void OnAppRtagcreate();
00192     afx_msg void OnAppRtagdelete();
00193     afx_msg void OnUpdateAppCmdline(CCmdUI* pCmdUI);
00194     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00195     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00196     //}}AFX_MSG
00197     afx_msg void OnUpdateMacro(CCmdUI* pCmdUI);
00198     afx_msg BOOL OnMacro(UINT nID);
00199     afx_msg void OnUpdateCustomize(CCmdUI* pCmdUI);
00200     afx_msg BOOL OnCustomize(UINT nID);
00201     afx_msg LRESULT OnResetView(WPARAM, LPARAM);
00202
00203     DECLARE_MESSAGE_MAP()
00204 private:
00205     // Data members
00206     CStr m_root;
00207     static CImageList m_imageList;
00209     bool m_selectionNotificationLocked;
00210     bool m_selectionChanged;
00211     bool m_resetViewPending;
00213     // Methods
00214     void StoreExpanded(std::vector<CStr>& allExpanded, HTREEITEM root = 0L);
00215
00216     bool DisableCommon();
00217     void OnUpdateCmd(CCmdUI* pCmdUI, BOOL needCvsInfos);
00218
00219     void SetNewStyle(long lStyleMask, BOOL bSetBits);
00220     HTREEITEM GetItemByLocation(const char* path);
00221     void DeleteAllItems(HTREEITEM root = 0L);
00222     void RetrievePath(HTREEITEM item, CStr& path);
00223
00224     bool ProcessSelectionCommand(KiSelectionHandler* handler);
00225
00226 public:
00227     // Interface
00228     void ResetView(bool forceReload = false, bool notifyView = false);
00229     bool StepToLocation(const char* path, bool notifyView = false);
00230     void ResetBrowser(const char* path, bool notifyView = false);
00231
00232     void OnIgnoreChanged();
00233     void NotifySelectionChange();
00234
00236     inline const CStr& GetRoot(void) const { return m_root; }
00237
00239     inline bool GetSelectionNotificationLocked() const { return m_selectionNotificationLocked; }
00240
00242     inline SetSelectionNotificationLocked(bool selectionNotificationLocked) { m_selectionNotificationLocked = selectionNotificationLocked; }
00243
00245     inline bool GetSelectionChanged() const { return m_selectionChanged; };
00246
00248     inline SetSelectionChanged(bool selectionChanged) { m_selectionChanged = selectionChanged; };
00249 };
00250
00252
00253 //{{AFX_INSERT_LOCATION}}
00254 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00255
00256 #endif // !defined(AFX_WINCVSBROWSER_H__144A4971_CAB4_11D1_BC80_000000000000__INCLUDED_)
Generated on Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "Appglue.h"
00041 #include "BrowseViewHandlers.h"
00042
00043 #ifdef _DEBUG
00044 #define new DEBUG_NEW
00045 #undef THIS_FILE
00046 static char THIS_FILE[] = __FILE__;
00047 #endif
00048
00050 // CWincvsDoc
00051
00052 IMPLEMENT_DYNCREATE(CWincvsDoc, CDocument)
00053
00054 BEGIN_MESSAGE_MAP(CWincvsDoc, CDocument)
00055     //{{AFX_MSG_MAP(CWincvsDoc)
00056     ON_COMMAND(ID_APP_PREFERENCES, OnAppPreferences)
00057     ON_COMMAND(ID_APP_RTAGCREATE, OnAppRtagNew)
00058     ON_COMMAND(ID_APP_RTAGDELETE, OnAppRtagDelete)
00059     ON_COMMAND(ID_APP_RTAGBRANCH, OnAppRtagBranch)
00060     ON_COMMAND(ID_APP_CMDLINE, OnAppCmdline)
00061     ON_UPDATE_COMMAND_UI(ID_APP_RTAGCREATE, OnUpdateCvsCmd)
00062     ON_UPDATE_COMMAND_UI(ID_APP_PREFERENCES, OnUpdatePrefs)
00063     ON_COMMAND(ID_STOPCVS, OnStopcvs)
00064     ON_UPDATE_COMMAND_UI(ID_STOPCVS, OnUpdateStopcvs)
00065     ON_COMMAND(ID_BROWSER_OPEN, OnBrowserOpen)
00066     ON_COMMAND(ID_APP_LOGIN, OnAppLogin)
00067 //  ON_UPDATE_COMMAND_UI(ID_MACRO_ADMIN, OnUpdateMacroAdmin)
00068     ON_COMMAND(ID_APP_LOGOUT, OnAppLogout)
00069     ON_COMMAND(ID_VIEW_INIT, OnViewInit)
00070     ON_COMMAND(ID_SAVESETTINGS, OnSavesettings)
00071     ON_UPDATE_COMMAND_UI(ID_SAVESETTINGS, OnUpdateSavesettings)
00072     ON_COMMAND(ID_VIEW_BROWSELOCATION_REMOVEUNWANTED, OnViewBrowselocationRemoveunwanted)
00073     ON_UPDATE_COMMAND_UI(ID_VIEW_INIT, OnUpdateCvsCmd)
00074     ON_UPDATE_COMMAND_UI(ID_APP_RTAGDELETE, OnUpdateCvsCmd)
00075     ON_UPDATE_COMMAND_UI(ID_APP_RTAGBRANCH, OnUpdateCvsCmd)
00076     ON_UPDATE_COMMAND_UI(ID_APP_CMDLINE, OnUpdateCvsCmd)
00077     ON_UPDATE_COMMAND_UI(ID_APP_LOGIN, OnUpdateCvsCmd)
00078     ON_UPDATE_COMMAND_UI(ID_BROWSER_OPEN, OnUpdateCvsCmd)
00079     ON_UPDATE_COMMAND_UI(ID_APP_LOGOUT, OnUpdateCvsCmd)
00080     ON_UPDATE_COMMAND_UI(ID_VIEW_BROWSELOCATION_REMOVEUNWANTED, OnUpdateCvsCmd)
00081     ON_COMMAND(ID_USE_PYSHELL, OnUsePyshell)
00082     ON_UPDATE_COMMAND_UI(ID_USE_PYSHELL, OnUpdateUsePyshell)
00083     ON_COMMAND(ID_USE_TCLSHELL, OnUseTclshell)
00084     ON_UPDATE_COMMAND_UI(ID_USE_TCLSHELL, OnUpdateUseTclshell)
00085     //}}AFX_MSG_MAP
00086     // Enable default OLE container implementation
00087     //ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, CDocument::OnUpdatePasteMenu)
00088 //  ON_COMMAND_EX_RANGE(ID_MACRO_ADMIN, ID_MACRO_ADMIN + 99, OnMacroAdmin)
00089     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00090     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00091 END_MESSAGE_MAP()
00092
00093 BEGIN_DISPATCH_MAP(CWincvsDoc, CDocument)
00094     //{{AFX_DISPATCH_MAP(CWincvsDoc)
00095     DISP_PROPERTY_NOTIFY(CWincvsDoc, "ViewPath", m_viewPath, OnViewPathChanged, VT_BSTR)
00096     //}}AFX_DISPATCH_MAP
00097 END_DISPATCH_MAP()
00098
00099 // Note: we add support for IID_IWincvs to support typesafe binding
00100 //  from VBA.  This IID must match the GUID that is attached to the
00101 //  dispinterface in the .ODL file.
00102
00103 // {D2D77DC4-8299-11D1-8949-444553540000}
00104 static const IID IID_IWincvs =
00105 { 0xd2d77dc4, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
00106
00107 BEGIN_INTERFACE_MAP(CWincvsDoc, CDocument)
00108     INTERFACE_PART(CWincvsDoc, IID_IWincvs, Dispatch)
00109 END_INTERFACE_MAP()
00110
00111
00112 // CWincvsDoc construction/destruction
00113
00114 CWincvsDoc::CWincvsDoc()
00115 {
00116     // Use OLE compound files
00117     //EnableCompoundFile();
00118
00119     // TODO: add one-time construction code here
00120
00121     //EnableAutomation();
00122
00123     //AfxOleLockApp();
00124 }
00125
00126 CWincvsDoc::~CWincvsDoc()
00127 {
00128     //AfxOleUnlockApp();
00129 }
00130
00131 //CRichEditCntrItem* CWincvsDoc::CreateClientItem(REOBJECT* preo) const
00132 //{
00133 //  return new CRichEditCntrItem(preo, (CRichEditDoc *)this);
00134 //}
00135
00136 BOOL CWincvsDoc::OnNewDocument()
00137 {
00138     if (!CDocument::OnNewDocument())
00139         return FALSE;
00140
00141     return TRUE;
00142 }
00143
00144
00145
00147 // CWincvsDoc serialization
00148
00149 class _afxRichEditCookie
00150 {
00151 public:
00152     CArchive& m_ar;
00153     DWORD m_dwError;
00154     _afxRichEditCookie(CArchive& ar) : m_ar(ar) {m_dwError=0;}
00155 };
00156
00157 // return 0 for no error, otherwise return error code
00158 extern "C" DWORD CALLBACK EditStreamCallBack(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)
00159 {
00160     _afxRichEditCookie* pCookie = (_afxRichEditCookie*)dwCookie;
00161     CArchive& ar = pCookie->m_ar;
00162     ar.Flush();
00163     DWORD dw = 0;
00164     *pcb = cb;
00165     TRY
00166     {
00167         if (ar.IsStoring())
00168             ar.GetFile()->Write(pbBuff, cb);
00169         else
00170             *pcb = ar.GetFile()->Read(pbBuff, cb);
00171     }
00172     CATCH(CFileException, e)
00173     {
00174         *pcb = 0;
00175         pCookie->m_dwError = (DWORD)e->m_cause;
00176         dw = 1;
00177     }
00178     AND_CATCH_ALL(e)
00179     {
00180         *pcb = 0;
00181         pCookie->m_dwError = (DWORD)CFileException::generic;
00182         dw = 1;
00183     }
00184     END_CATCH_ALL
00185     return dw;
00186 }
00187
00188 void CWincvsDoc::Serialize(CArchive& ar)
00189 {
00190     if (ar.IsStoring())
00191     {
00192         POSITION pos = GetFirstViewPosition();
00193         CView* view;
00194         while((view = GetNextView(pos)) != NULL)
00195         {
00196             if(view->IsKindOf(RUNTIME_CLASS(CRichEditView)))
00197             {
00198                 int nFormat = SF_TEXT;
00199                 EDITSTREAM es = {0, 0, (EDITSTREAMCALLBACK)EditStreamCallBack};
00200                 _afxRichEditCookie cookie(ar);
00201                 es.dwCookie = (DWORD)&cookie;
00202                 ((CRichEditView *)view)->GetRichEditCtrl().StreamOut(nFormat, es);
00203                 break;
00204             }
00205         }
00206     }
00207     else
00208     {
00209         // We don't load right now
00210     }
00211
00212     // Calling the base class CDocument enables serialization
00213     //  of the container document's COleClientItem objects.
00214     // (but we don't have COleClientItem)
00215     CDocument::Serialize(ar);
00216 }
00217
00219 // CWincvsDoc diagnostics
00220
00221 #ifdef _DEBUG
00222 void CWincvsDoc::AssertValid() const
00223 {
00224     CDocument::AssertValid();
00225 }
00226
00227 void CWincvsDoc::Dump(CDumpContext& dc) const
00228 {
00229     CDocument::Dump(dc);
00230 }
00231 #endif //_DEBUG
00232
00234 // CWincvsDoc commands
00235
00236
00237 void CWincvsDoc::OnAppPreferences()
00238 {
00239     CompatGetPrefs();
00240 }
00241
00242 void CWincvsDoc::OnAppCmdline()
00243 {
00244     KoCommandLineHandler handler;
00245     CvsCmdCommandLine(handler);
00246 }
00247
00248 void CWincvsDoc::OnAppLogin()
00249 {
00250     CvsCmdLogin();
00251 }
00252
00253 void CWincvsDoc::OnUpdateCvsCmd(CCmdUI* pCmdUI)
00254 {
00255     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00256     pCmdUI->Enable(app->IsCvsRunning() || gCvsPrefs.empty() ? FALSE : TRUE);
00257 }
00258
00259 void CWincvsDoc::OnUpdatePrefs(CCmdUI* pCmdUI)
00260 {
00261     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00262     pCmdUI->Enable(app->IsCvsRunning() ? FALSE : TRUE);
00263 }
00264
00265 void CWincvsDoc::OnStopcvs()
00266 {
00267     stopCVS();
00268 }
00269
00270 void CWincvsDoc::OnUpdateStopcvs(CCmdUI* pCmdUI)
00271 {
00272     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00273     if( app )
00274     {
00275         pCmdUI->Enable(app->IsCvsRunning() && !app->IsCvsStopping() ? TRUE : FALSE);
00276     }
00277 }
00278
00279 void CWincvsDoc::OnBrowserOpen()
00280 {
00281     CStr newPath;
00282     if( BrowserGetDirectory("Select a folder to open with the browser", newPath) )
00283     {
00284         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00285         if( app )
00286         {
00287             app->GetBrowserView()->ResetBrowser(newPath, true);
00288         }
00289     }
00290 }
00291
00292 void CWincvsDoc::OnViewPathChanged()
00293 {
00294     // TODO: Add notification handler code
00295
00296 }
00297
00298 void CWincvsDoc::OnAppRtagNew()
00299 {
00300     KoRtagCreateHandler handler;
00301     CvsCmdRtagCreate(handler);
00302 }
00303
00304 void CWincvsDoc::OnAppRtagDelete()
00305 {
00306     KoRtagDeleteHandler handler;
00307     CvsCmdRtagDelete(handler);
00308 }
00309
00310 void CWincvsDoc::OnAppRtagBranch()
00311 {
00312     KoRtagBranchHandler handler;
00313     CvsCmdRtagBranch(handler);
00314 }
00315
00316 BOOL CWincvsDoc::OnMacroAdmin(UINT nID)
00317 {
00318     CMacroEntry & entry = gMacrosAdmin.entries[nID - ID_MACRO_ADMIN];
00319     CvsCmdMacrosAdmin(entry.path);
00320
00321     return 1;
00322 }
00323
00324 void CWincvsDoc::OnUpdateMacroAdmin(CCmdUI* pCmdUI)
00325 {
00326     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00327     if( app->IsCvsRunning() || gCvsPrefs.empty() || !CTcl_Interp::IsAvail() )
00328     {
00329         pCmdUI->Enable(FALSE);
00330         return;
00331     }
00332
00333     if( pCmdUI->m_pSubMenu != 0L || pCmdUI->m_pMenu == 0L )
00334         return;
00335
00336     int iMRUMax = pCmdUI->m_pMenu->GetMenuItemCount();
00337     for (int iMRU = 0; iMRU < iMRUMax; iMRU++)
00338         pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID + iMRU, MF_BYCOMMAND);
00339
00340     vector<CMacroEntry>::const_iterator i;
00341     for(i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i)
00342     {
00343         pCmdUI->m_pMenu->InsertMenu(pCmdUI->m_nIndex++,
00344             MF_STRING | MF_BYPOSITION, pCmdUI->m_nID++,
00345             (*i).name);
00346     }
00347
00348     pCmdUI->m_nIndexMax = pCmdUI->m_pMenu->GetMenuItemCount();
00349     pCmdUI->m_nIndex--; // point to last menu added
00350     pCmdUI->m_bEnableChanged = TRUE;    // all the added items are enabled
00351 }
00352
00353 void CWincvsDoc::OnAppLogout()
00354 {
00355     CvsCmdLogout();
00356 }
00357
00358 void CWincvsDoc::OnViewInit()
00359 {
00360     CvsCmdInit();
00361 }
00362
00363 void CWincvsDoc::OnSavesettings()
00364 {
00365     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00366     AskCreatePersistentSettings(app->GetBrowserView()->GetRoot());
00367 }
00368
00369 void CWincvsDoc::OnUpdateSavesettings(CCmdUI* pCmdUI)
00370 {
00371     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00372     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
00373 }
00374
00375 void CWincvsDoc::OnViewBrowselocationRemoveunwanted()
00376 {
00377     AfxMessageBox("To remove the unwanted location history items click DEL key when selecting from the combo box list.", MB_OK | MB_ICONINFORMATION);
00378 }
00379
00380 void CWincvsDoc::OnUsePyshell()
00381 {
00382     gCvsPrefs.SetUseShell(SHELL_PYTHON);
00383     cvs_out("Switching the shell to Python...\n");
00384 }
00385
00386 void CWincvsDoc::OnUpdateUsePyshell(CCmdUI* pCmdUI)
00387 {
00388     pCmdUI->Enable(CPython_Interp::IsAvail());
00389     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_PYTHON);
00390 }
00391
00392 void CWincvsDoc::OnUseTclshell()
00393 {
00394     gCvsPrefs.SetUseShell(SHELL_TCL);
00395     cvs_out("Switching the shell to TCL...\n");
00396 }
00397
00398 void CWincvsDoc::OnUpdateUseTclshell(CCmdUI* pCmdUI)
00399 {
00400     pCmdUI->Enable(CTcl_Interp::IsAvail());
00401     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_TCL);
00402 }
Generated on Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 static CPersistentT<CCharFormat> gViewFont("P_ViewFont", CCharFormat(), kNoClass);
00045
00047 // CWincvsView
00048
00049 IMPLEMENT_DYNCREATE(CWincvsView, CRichEditView)
00050
00051 BEGIN_MESSAGE_MAP(CWincvsView, CRichEditView)
00052     //{{AFX_MSG_MAP(CWincvsView)
00053     ON_WM_DESTROY()
00054     ON_WM_SETFOCUS()
00055     ON_WM_SIZE()
00056     ON_COMMAND(ID_FORMAT_FONT, OnMyFormatFont)
00057     ON_WM_KEYDOWN()
00058     ON_WM_DROPFILES()
00059     ON_COMMAND(ID_EDIT_CLEAR_ALL, OnEditClearAll)
00060     ON_WM_GETDLGCODE()
00061     ON_WM_CONTEXTMENU()
00062     ON_WM_RBUTTONDOWN()
00063     //}}AFX_MSG_MAP
00064     // Standard printing commands
00065     ON_COMMAND(ID_FILE_PRINT, CRichEditView::OnFilePrint)
00066     ON_COMMAND(ID_FILE_PRINT_DIRECT, CRichEditView::OnFilePrint)
00067     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRichEditView::OnFilePrintPreview)
00068 END_MESSAGE_MAP()
00069
00070
00071 // CWincvsView construction/destruction
00072
00073 char* CWincvsView::m_sbuf = 0L;
00074 int CWincvsView::m_snumbuf = 0;
00075
00076 CWincvsView::CWincvsView()
00077 {
00078     m_fRtfFormat = ::RegisterClipboardFormat(_T("Rich Text Format"));
00079 }
00080
00081 CWincvsView::~CWincvsView()
00082 {
00083     m_snumbuf = 0;
00084     if( m_sbuf != 0L)
00085     {
00086         free(m_sbuf);
00087         m_sbuf = 0L;
00088     }
00089
00090     PyInvalUICache();
00091     CPython_Interp::ClosePythonSupport();
00092 }
00093
00095 BOOL CWincvsView::PreCreateWindow(CREATESTRUCT& cs)
00096 {
00097     BOOL bRet = CRichEditView::PreCreateWindow(cs);
00098     cs.style |= WS_TABSTOP | ES_MULTILINE;
00099
00100     return bRet;
00101 }
00102
00104 // CWincvsView drawing
00105
00107 void CWincvsView::OnDraw(CDC* pDC)
00108 {
00109     //CWincvsDoc* pDoc = GetDocument();
00110     //ASSERT_VALID(pDoc);
00111
00112     // TODO: add draw code for native data here
00113     // TODO: also draw all OLE items in the document
00114
00115     // Draw the selection at an arbitrary position.  This code should be
00116     //  removed once your real drawing code is implemented.  This position
00117     //  corresponds exactly to the rectangle returned by CWincvsCntrItem,
00118     //  to give the effect of in-place editing.
00119
00120     // TODO: remove this code when final draw code is complete.
00121
00122     //if (m_pSelection == NULL)
00123     //{
00124     //  POSITION pos = pDoc->GetStartPosition();
00125     //  m_pSelection = (CWincvsCntrItem*)pDoc->GetNextClientItem(pos);
00126     //}
00127     //if (m_pSelection != NULL)
00128     //  m_pSelection->Draw(pDC, CRect(10, 10, 210, 210));
00129 }
00130
00132 void CWincvsView::OnInitialUpdate()
00133 {
00134     CRichEditView::OnInitialUpdate();
00135
00136     CRichEditCtrl& edit = GetRichEditCtrl();
00137     edit.SetSel(0, -1);
00138
00139     SetCharFormat((CCharFormat)gViewFont);
00140     edit.SetSel(-1, -1);
00141 }
00142
00144 // CWincvsView printing
00145
00147 BOOL CWincvsView::OnPreparePrinting(CPrintInfo* pInfo)
00148 {
00149     return DoPreparePrinting(pInfo);
00150     //return CRichEditView::OnPreparePrinting(pInfo);
00151 }
00152
00154 void CWincvsView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
00155 {
00156     // No extra initialization before printing
00157     CRichEditView::OnBeginPrinting(pDC, pInfo);
00158 }
00159
00161 void CWincvsView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
00162 {
00163     // No cleanup after printing
00164     CRichEditView::OnEndPrinting(pDC, pInfo);
00165 }
00166
00168 void CWincvsView::OnDestroy()
00169 {
00170     // Deactivate the item on destruction; this is important
00171     // when a splitter view is being used.
00172
00173     CRichEditView::OnDestroy();
00174
00175     //COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00176     //if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
00177     //{
00178     //  pActiveItem->Deactivate();
00179     //  ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00180     //}
00181 }
00182
00183
00185 // OLE Client support and commands
00186
00188 BOOL CWincvsView::IsSelected(const CObject* pDocItem) const
00189 {
00190     // The implementation below is adequate if your selection consists of
00191     //  only CWincvsCntrItem objects.  To handle different selection
00192     //  mechanisms, the implementation here should be replaced.
00193
00194     // TODO: implement this function that tests for a selected OLE client item
00195
00196     //return pDocItem == m_pSelection;
00197     return CRichEditView::IsSelected(pDocItem);
00198 }
00199
00200 #if 0
00201 // The following command handler provides the standard keyboard
00202 //  user interface to cancel an in-place editing session.  Here,
00203 //  the container (not the server) causes the deactivation.
00204 void CWincvsView::OnCancelEditCntr()
00205 {
00206     // Close any in-place active item on this view.
00207     COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00208     if (pActiveItem != NULL)
00209     {
00210         pActiveItem->Close();
00211     }
00212     ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00213 }
00214 #endif
00215
00216
00219 void CWincvsView::OnSetFocus(CWnd* pOldWnd)
00220 {
00221 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00222 //  if (pActiveItem != NULL &&
00223 //      pActiveItem->GetItemState() == COleClientItem::activeUIState)
00224 //  {
00225         // need to set focus to this item if it is in the same view
00226 //      CWnd* pWnd = pActiveItem->GetInPlaceWindow();
00227 //      if (pWnd != NULL)
00228 //      {
00229 //          pWnd->SetFocus();   // don't call the base class
00230 //          return;
00231 //      }
00232 //  }
00233
00234     CRichEditView::OnSetFocus(pOldWnd);
00235 }
00236
00238 void CWincvsView::OnSize(UINT nType, int cx, int cy)
00239 {
00240     CRichEditView::OnSize(nType, cx, cy);
00241 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00242 //  if (pActiveItem != NULL)
00243 //      pActiveItem->SetItemRects();
00244 }
00245
00252 void CWincvsView::OutLine(const char* buf, int numbuf, bool isStderr)
00253 {
00254     CRichEditCtrl& edit = GetRichEditCtrl();
00255     edit.SetSel(-1, -1);
00256
00257     if( numbuf <= 0 )
00258     {
00259         return;
00260     }
00261
00262     WCHARFORMAT cf;
00263     cf.cbSize = sizeof(WCHARFORMAT);
00264     cf = GetCharFormatSelection();
00265
00266     bool colorChanged = false;
00267     COLORREF oldColor = cf.crTextColor;
00268     DWORD oldEffect = cf.dwEffects;
00269     CString strline(buf, numbuf);
00270
00271     if( strline.GetLength() >= 5 && strline[1] == ' ' &&
00272         (strline[0] == 'M' || strline[0] == 'C' || strline[0] == 'U' ||
00273         strline[0] == 'P' || strline[0] == 'N' || strline[0] == 'A' ||
00274         strline[0] == 'R' || strline[0] == 'I' || strline[0] == '?' ||
00275         strline[0] == '<' || strline[0] == '>') )
00276     {
00277         colorChanged = true;
00278
00279         switch(strline[0])
00280         {
00281         default:
00282         case '?' :
00283         case 'I' :
00284             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00285             break;
00286         case 'U' :
00287         case 'N' :
00288             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00289             break;
00290         case 'M' :
00291         case 'A' :
00292         case 'R' :
00293             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00294             break;
00295         case 'C' :
00296         case '<' :
00297             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00298             break;
00299         case '>' :
00300         case 'P' :
00301             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00302             break;
00303         }
00304
00305         cf.dwMask = CFM_COLOR;
00306         cf.dwEffects = 0;
00307         SetCharFormat(cf);
00308     }
00309     else if( isStderr )
00310     {
00311         colorChanged = true;
00312         cf.crTextColor = RGB(0xFF, 0x80, 0x00);
00313         cf.dwMask = CFM_COLOR;
00314         cf.dwEffects = 0;
00315         SetCharFormat(cf);
00316     }
00317
00318     edit.ReplaceSel(strline);
00319
00320     if( colorChanged )
00321     {
00322         cf.dwMask = CFM_COLOR;
00323         cf.crTextColor = oldColor;
00324         cf.dwEffects = oldEffect;
00325         SetCharFormat(cf);
00326     }
00327 }
00328
00335 WCHARFORMAT CWincvsView::GetCurFormat(bool jumpEnd /*= true*/)
00336 {
00337     CRichEditCtrl& edit = GetRichEditCtrl();
00338
00339     if( jumpEnd )
00340         edit.SetSel(-1, -1);
00341
00342     return GetCharFormatSelection();
00343 }
00344
00350 void CWincvsView::OutColor(const char* txt, long len)
00351 {
00352     // Synchronize it since the thread calls it
00353     CCvsThreadLock threadLock;
00354
00355     CString strText;
00356     for(int index = 0; index < len; index++)
00357     {
00358         char chr = *txt++;
00359         if( chr == 0x0d || chr == 0x0a )
00360         {
00361             strText += (char)0x0d;
00362             strText += (char)0x0a;
00363
00364             // special case if we got already \r\n
00365             if( (index + 1) < len && chr == 0x0d && txt[0] == 0x0a )
00366                 index++;
00367         }
00368         else
00369         {
00370             strText += chr;
00371         }
00372     }
00373
00374     CRichEditCtrl& edit = GetRichEditCtrl();
00375     edit.ReplaceSel(strText);
00376 }
00377
00382 void CWincvsView::OutColor(kConsoleColor color)
00383 {
00384     CCvsThreadLock threadLock;
00385
00386     CRichEditCtrl& edit = GetRichEditCtrl();
00387
00388     WCHARFORMAT cf = GetCurFormat(false);
00389     cf.dwEffects = 0;
00390
00391     switch(color)
00392     {
00393     default:
00394         return;
00395         break;
00396     case kBrown :
00397         cf.dwMask = CFM_COLOR;
00398         cf.crTextColor = RGB(0x80, 0x80, 0x00);
00399         break;
00400     case kGreen :
00401         cf.dwMask = CFM_COLOR;
00402         cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00403         break;
00404     case kMagenta :
00405         cf.dwMask = CFM_COLOR;
00406         cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00407         break;
00408     case kRed :
00409         cf.dwMask = CFM_COLOR;
00410         cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00411         break;
00412     case kBlue :
00413         cf.dwMask = CFM_COLOR;
00414         cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00415         break;
00416     case kBold :
00417         cf.dwMask = CFM_BOLD;
00418         cf.dwEffects = CFE_BOLD;
00419         break;
00420     case kItalic :
00421         cf.dwMask = CFM_ITALIC;
00422         cf.dwEffects = CFE_ITALIC;
00423         break;
00424     case kUnderline :
00425         cf.dwMask = CFM_UNDERLINE;
00426         cf.dwEffects = CFE_UNDERLINE;
00427         break;
00428     }
00429
00430     SetCharFormat(cf);
00431 }
00432
00437 void CWincvsView::OutColor(WCHARFORMAT& format)
00438 {
00439     CCvsThreadLock threadLock;
00440
00441     CRichEditCtrl& edit = GetRichEditCtrl();
00442     SetCharFormat(format);
00443 }
00444
00451 void CWincvsView::OutConsole(const char* txt, long len, bool isStderr /*= false*/)
00452 {
00453     // Synchronize it since the thread calls it
00454     CCvsThreadLock threadLock;
00455
00456     if( len == 0 )
00457         return;
00458
00459     if( m_sbuf == 0L )
00460     {
00461         m_sbuf = (char*)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00462         if( m_sbuf == 0L )
00463             return;
00464     }
00465
00466     int index = 0;
00467     char chr;
00468
00469     do{
00470         for(; index < len && m_snumbuf < MAX_CHAR_BY_LINE; m_snumbuf++)
00471         {
00472             chr = txt[index++];
00473
00474             if( chr == 0x0d || chr == 0x0a )
00475             {
00476                 // Newline
00477                 break;
00478             }
00479
00480             m_sbuf[m_snumbuf] = chr;
00481         }
00482
00483         // Special case if we got already \r\n
00484         if( index < len && chr == 0x0d && txt[index] == 0x0a )
00485         {
00486             index++;
00487         }
00488
00489         if( chr == 0x0d || chr == 0x0a || m_snumbuf == MAX_CHAR_BY_LINE )
00490         {
00491             m_sbuf[m_snumbuf++] = 0x0d;
00492             m_sbuf[m_snumbuf++] = 0x0a;
00493             m_sbuf[m_snumbuf++] = 0x00;
00494
00495             OutLine(m_sbuf, m_snumbuf, isStderr);
00496             m_snumbuf = 0;
00497         }
00498     }while( index < len );
00499 }
00500
00502 // CWincvsView diagnostics
00503
00504 #ifdef _DEBUG
00505 void CWincvsView::AssertValid() const
00506 {
00507     CRichEditView::AssertValid();
00508 }
00509
00510 void CWincvsView::Dump(CDumpContext& dc) const
00511 {
00512     CRichEditView::Dump(dc);
00513 }
00514
00515 CWincvsDoc* CWincvsView::GetDocument() // non-debug version is inline
00516 {
00517     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWincvsDoc)));
00518     return (CWincvsDoc*)m_pDocument;
00519 }
00520
00521 #endif //_DEBUG
00522
00524 // CWincvsView message handlers
00525
00527 void CWincvsView::OnMyFormatFont()
00528 {
00529     CRichEditCtrl& edit = GetRichEditCtrl();
00530     edit.SetSel(0, -1);
00531
00532     CRichEditView::OnFormatFont();
00533     edit.SetSel(-1, -1);
00534
00535     gViewFont = CCharFormat(GetCharFormatSelection());
00536     gCvsPrefs.save();
00537 }
00538
00540 void CWincvsView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
00541 {
00542     CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
00543
00544     if( nChar != VK_RETURN )
00545     {
00546         return;
00547     }
00548
00549     long len = GetTextLength();
00550     if( len == 0 )
00551         return;
00552
00553     TCHAR* buf = (char*)malloc((len + 1) * sizeof(TCHAR));
00554     if( buf == 0L )
00555         return;
00556
00557     TEXTRANGE textRange;
00558     textRange.chrg.cpMin = 0;
00559     textRange.chrg.cpMax = len;
00560     textRange.lpstrText = buf;
00561     GetRichEditCtrl().SendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
00562
00563     long nStartChar, nEndChar;
00564     GetRichEditCtrl().GetSel(nStartChar, nEndChar);
00565
00566     if( nStartChar == nEndChar ) // i.e. there is no selection
00567     {
00568         // Get the end and the beginning of the line
00569         if( nStartChar > 0 && buf[nStartChar] == '\r' )
00570             nStartChar--;
00571
00572         while( nStartChar > 0 && buf[nStartChar] != '\n' && buf[nStartChar] != '\r' )
00573             nStartChar--;
00574
00575         if( buf[nStartChar] == '\n' || buf[nStartChar] == '\r' )
00576             nStartChar++;
00577
00578         while( nEndChar < len && buf[nEndChar] != '\n' && buf[nEndChar] != '\r' )
00579             nEndChar++;
00580     }
00581
00582     long length = nEndChar - nStartChar;
00583     if( length > 0 && nStartChar < len )
00584     {
00585         OutConsole("\n", 1);
00586         buf[nEndChar] = '\0';
00587
00588         if( gCvsPrefs.GetUseShell() == SHELL_PYTHON && CPython_Interp::IsAvail() )
00589         {
00590             CPython_Interp interp;
00591             interp.DoScript(buf + nStartChar);
00592         }
00593         else if( gCvsPrefs.GetUseShell() == SHELL_TCL && CTcl_Interp::IsAvail() )
00594         {
00595             CTcl_Interp interp;
00596             interp.DoScript(buf + nStartChar);
00597         }
00598     }
00599
00600     free(buf);
00601 }
00602
00604 HRESULT CWincvsView::QueryAcceptData(LPDATAOBJECT lpdataobj, CLIPFORMAT* lpcfFormat, DWORD dwReco, BOOL bReally, HGLOBAL hMetaPict)
00605 {
00606     ASSERT(lpcfFormat != NULL);
00607     if( !bReally ) // not actually pasting
00608         return S_OK;
00609
00610     // If direct pasting a particular native format allow it
00611     if( IsRichEditFormat(*lpcfFormat) )
00612         return S_OK;
00613
00614     COleDataObject dataobj;
00615     dataobj.Attach(lpdataobj, FALSE);
00616
00617     // If format is 0, then force particular formats if available
00618     if( *lpcfFormat == 0 && (m_nPasteType == 0) )
00619     {
00620         if( m_fRtfFormat != 0 && dataobj.IsDataAvailable(m_fRtfFormat)) // native avail, let rich edit do as it wants
00621         {
00622             *lpcfFormat = m_fRtfFormat;
00623             return S_OK;
00624         }
00625         else if (dataobj.IsDataAvailable(CF_TEXT))
00626         {
00627             *lpcfFormat = CF_TEXT;
00628             return S_OK;
00629         }
00630     }
00631
00632     // *DO NOT* paste OLE formats
00633     // Crash reported by Gerhard Möller
00634     //DoPaste(dataobj, *lpcfFormat, hMetaPict);
00635
00636     return S_FALSE;
00637 }
00638
00643 BOOL CWincvsView::CanPaste() const
00644 {
00645     return (CountClipboardFormats() != 0) &&
00646         (IsClipboardFormatAvailable(CF_TEXT) ||
00647         IsClipboardFormatAvailable(m_fRtfFormat) ||
00648         //IsClipboardFormatAvailable(_oleData.cfEmbedSource) ||
00649         //IsClipboardFormatAvailable(_oleData.cfEmbeddedObject) ||
00650         //IsClipboardFormatAvailable(_oleData.cfFileName) ||
00651         //IsClipboardFormatAvailable(_oleData.cfFileNameW) ||
00652         //IsClipboardFormatAvailable(CF_METAFILEPICT) ||
00653         //IsClipboardFormatAvailable(CF_DIB) ||
00654         //IsClipboardFormatAvailable(CF_BITMAP) ||
00655         GetRichEditCtrl().CanPaste());
00656 }
00657
00659 void CWincvsView::OnDropFiles(HDROP hDropInfo)
00660 {
00661     CWnd* pWnd = AfxGetMainWnd();   //look in InitInstance m_pMainWnd = m_mainFrame;
00662
00663     if( pWnd )
00664     {
00665         CMainFrame* pMainFrame = (CMainFrame*)pWnd;
00666
00667         if( pMainFrame->GetSafeHwnd() != NULL )
00668         {
00669             pMainFrame->DropFiles( hDropInfo );
00670         }
00671     }
00672
00673     //this cause the crash, remove
00674     //CRichEditView::OnDropFiles(hDropInfo);
00675 }
00676
00678 void CWincvsView::OnEditClearAll()
00679 {
00680     CRichEditCtrl& edit = GetRichEditCtrl();
00681     edit.SetSel(0, -1);
00682     edit.ReplaceSel("", TRUE);
00683 }
00684
00686 void CWincvsView::OnRButtonDown(UINT nFlags, CPoint point)
00687 {
00688     ClientToScreen(&point);
00689     OnContextMenu(this, point);
00690
00691     //CRichEditView::OnRButtonDown(nFlags, point);
00692 }
00693
00695 void CWincvsView::OnContextMenu(CWnd* pWnd, CPoint point)
00696 {
00697     CMenu* pSubMenu = ::GetSubCMenu(ID_EDIT_UNDO, this);
00698     if( pSubMenu )
00699     {
00700         // Set the track point in case it's not the mouse click
00701         if( -1 == point.x && -1 == point.y )
00702         {
00703             // Set the top left corner
00704             point.x = 0;
00705             point.y = 0;
00706             ClientToScreen(&point);
00707         }
00708
00709         pSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
00710     }
00711 }
00712
00714 UINT CWincvsView::OnGetDlgCode()
00715 {
00716     LRESULT DlgCode = CRichEditView::OnGetDlgCode();
00717
00718     if( 0x8000 & GetKeyState(VK_TAB) )
00719         return DlgCode & ~(DLGC_WANTTAB | DLGC_WANTALLKEYS | DLGC_WANTCHARS);
00720     else
00721         return DlgCode;
00722 }
Generated on Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if _RICHEDIT_VER >= 0x0210
00036 #   define WCHARFORMAT CHARFORMAT2
00037 #else
00038 #   define WCHARFORMAT CHARFORMAT
00039 #endif
00040
00042 #define MAX_CHAR_BY_LINE 1024
00043
00044 class CWincvsDoc;
00045
00047 class CCharFormat : public WCHARFORMAT
00048 {
00049 public:
00050     // Construction
00051     CCharFormat()
00052     {
00053         USES_CONVERSION;
00054
00055         CString strDefFont = _T("Courier New");
00056         //VERIFY(strDefFont.LoadString(IDS_DEFFONT));
00057
00058         cbSize = sizeof(WCHARFORMAT);
00059         dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_SIZE | CFM_COLOR | CFM_OFFSET | CFM_PROTECTED;
00060         dwEffects = CFE_AUTOCOLOR;
00061         yHeight = 200; //10pt
00062         yOffset = 0;
00063         crTextColor = RGB(0, 0, 0);
00064         bCharSet = 0;
00065         bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
00066
00067         ASSERT(strDefFont.GetLength() < LF_FACESIZE);
00068
00069         lstrcpynA(szFaceName, T2A((LPTSTR)(LPCTSTR)strDefFont), LF_FACESIZE);
00070         dwMask |= CFM_FACE;
00071     }
00072
00073     CCharFormat(const WCHARFORMAT& newf)
00074     {
00075         *(WCHARFORMAT*)this = newf;
00076     }
00077
00078 public:
00079     // Interface
00080
00082     inline operator WCHARFORMAT&()
00083     {
00084         return *(WCHARFORMAT*)this;
00085     }
00086 };
00087
00089 class CWincvsView : public CRichEditView
00090 {
00091 protected: // create from serialization only
00092     CWincvsView();
00093     DECLARE_DYNCREATE(CWincvsView)
00094
00095 // Attributes
00096 public:
00097     CWincvsDoc* GetDocument();
00098
00099 // Operations
00100 public:
00101
00102 // Overrides
00103     // ClassWizard generated virtual function overrides
00104     //{{AFX_VIRTUAL(CWincvsView)
00105     public:
00106     virtual void OnDraw(CDC* pDC);  // overridden to draw this view
00107     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00108     protected:
00109     virtual void OnInitialUpdate(); // called first time after construct
00110     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00111     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00112     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00113     virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
00114     //}}AFX_VIRTUAL
00115
00116 // Implementation
00117 public:
00118     virtual ~CWincvsView();
00119 #ifdef _DEBUG
00120     virtual void AssertValid() const;
00121     virtual void Dump(CDumpContext& dc) const;
00122 #endif
00123
00124 protected:
00125
00126 // Generated message map functions
00127 protected:
00128     //{{AFX_MSG(CWincvsView)
00129     afx_msg void OnDestroy();
00130     afx_msg void OnSetFocus(CWnd* pOldWnd);
00131     afx_msg void OnSize(UINT nType, int cx, int cy);
00132     afx_msg void OnMyFormatFont();
00133     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00134     afx_msg void OnDropFiles(HDROP hDropInfo);
00135     afx_msg void OnEditClearAll();
00136     afx_msg UINT OnGetDlgCode();
00137     afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
00138     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00139     //}}AFX_MSG
00140     DECLARE_MESSAGE_MAP()
00141 private:
00142     // Data members
00143     static char* m_sbuf;
00144     static int m_snumbuf;
00145     UINT m_fRtfFormat;
00147     // Methods
00148     virtual HRESULT QueryAcceptData(LPDATAOBJECT, CLIPFORMAT*, DWORD, BOOL, HGLOBAL);
00149
00150     void OutLine(const char* buf, int numbuf, bool isStderr);
00151     BOOL CanPaste() const;
00152
00153 public:
00154     // Interface
00155     WCHARFORMAT GetCurFormat(bool jumpEnd = true);
00156
00157     void OutConsole(const char* txt, long len, bool isStderr = false);
00158
00159     void OutColor(const char* txt, long len);
00160     void OutColor(kConsoleColor color);
00161     void OutColor(WCHARFORMAT& format);
00162 };
00163
00164 #ifndef _DEBUG  // debug version in wincvsView.cpp
00165 inline CWincvsDoc* CWincvsView::GetDocument()
00166    { return (CWincvsDoc*)m_pDocument; }
00167 #endif
00168
00170
00171 //{{AFX_INSERT_LOCATION}}
00172 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00173
00174 #endif // !defined(AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:09:09 2003 for WinCvs Source by doxygen 1.3-rc2


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
00271
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 Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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
00232
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 LRESULT 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     return 0;
00500 }
00501
00502 LRESULT CCJCaption::OnPushPinCancel(UINT lParam, LONG wParam)
00503 {
00504     UNUSED_ALWAYS( lParam );
00505     UNUSED_ALWAYS( wParam );
00506
00507     m_CaptionButton.SetState(FALSE);
00508     m_pWndPopDown->DestroyWindow();
00509
00510     _delete( m_pWndPopDown );
00511
00512     m_pNotifyWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00513
00514     return 0;
00515 }
00516
00517 void CCJCaption::UpdateCaption(LPCTSTR lpszWindowText, HICON hIcon)
00518 {
00519     ASSERT(::IsWindow(m_hWnd));
00520
00521     CRect rcClient;
00522     GetClientRect(&rcClient);
00523     CDC* pDC = GetDC();
00524
00525     UpdateCaptionBack(pDC, rcClient);
00526
00527     if( lpszWindowText )
00528     {
00529         m_strWindText = lpszWindowText;
00530         UpdateCaptionText(pDC, rcClient);
00531     }
00532
00533     if( hIcon ) {
00534         m_hIcon = hIcon;
00535         DrawCaptionIcon( pDC, rcClient );
00536     }
00537
00538     ReleaseDC(pDC);
00539 }
00540
00541 void CCJCaption::UpdateCaptionBack(CDC* pDC, CRect& rcItem)
00542 {
00543     CRect rc = rcItem;
00544
00545     // Set the background mode to transparent.
00546     pDC->SetBkMode( TRANSPARENT );
00547
00548     rc.DeflateRect(1,1);
00549     // repaint the background.
00550     pDC->FillSolidRect( rc, m_clrBtnFace );
00551
00552     // draw the caption banner border.
00553     if( m_nBorder != 0 ) {
00554         rc.DeflateRect( m_nBorder-1, m_nBorder-1 );
00555         pDC->FillSolidRect(rc, m_clrBackgnd);
00556     }
00557 }
00558
00559 void CCJCaption::UpdateCaptionText(CDC* pDC, CRect& rcItem)
00560 {
00561     CFont* pOldFont = pDC->SelectObject(m_pFont);
00562
00563     TEXTMETRIC tm;
00564     pDC->GetTextMetrics(&tm);
00565
00566     CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00567     size.cx += tm.tmAveCharWidth+21;
00568     pDC->SelectObject(pOldFont);
00569
00570     CRect rc( 0, 0, size.cx, rcItem.Height() );
00571     rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00572     m_CaptionButton.MoveWindow(rc);
00573     m_CaptionButton.SetWindowText(m_strWindText);
00574
00575     DrawCaptionText( pDC, rcItem );
00576 }
00577
00578 void CCJCaption::UpdateFont()
00579 {
00580     m_Font.DeleteObject();
00581     NONCLIENTMETRICS ncm;
00582     ncm.cbSize = sizeof(ncm);
00583     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00584     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00585     m_pFont = &m_Font;
00586 }
00587
00588 BOOL CCJCaption::OnEraseBkgnd(CDC* pDC)
00589 {
00590     // KStowell - overridden for flicker-free drawing.
00591     UNUSED_ALWAYS(pDC);
00592     return TRUE;
00593 }
Generated on Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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
00086
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 Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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
00135
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 Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00038  * $Revision: 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
00269
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 #if _MFC_VER < 0x700
00955 void CCJColorPopup::OnActivateApp(BOOL bActive, HTASK hTask)
00956 #else
00957 void CCJColorPopup::OnActivateApp(BOOL bActive, DWORD hTask)
00958 #endif
00959 {
00960     CWnd::OnActivateApp(bActive, hTask);
00961
00962     // If Deactivating App, cancel this selection
00963     if (!bActive)
00964          EndSelection(CPN_SELENDCANCEL);
00965 }
00966
00967 void CCJColorPopup::UpdateFont()
00968 {
00969     m_Font.DeleteObject();
00970     NONCLIENTMETRICS ncm;
00971     ncm.cbSize = sizeof(ncm);
00972     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00973     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00974     SetFont(&m_Font);
00975 }
00976
00977 BOOL CCJColorPopup::OnEraseBkgnd(CDC* pDC)
00978 {
00979     // KStowell - overridden for flicker-free drawing.
00980     UNUSED_ALWAYS(pDC);
00981     return TRUE;
00982 }
Generated on Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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
00135
00136
Generated on Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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
00324
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 Fri Jan 31 12:08:53 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00013  * $Revision: 1.2 $
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 #if _MFC_VER >= 0x700
01051         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01052 #else
01053         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01054 #endif
01055
01056     if (!pDX->m_bSaveAndValidate)
01057     {
01058         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01059               (pMaxRange != NULL && *pMaxRange < refValue))
01060         {
01061 #ifdef _DEBUG
01062 #if _MFC_VER >= 0x700
01063             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01064 #else
01065             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01066 #endif
01067             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01068 #endif
01069             return;     // don't stop now
01070         }
01071     }
01072
01073     pWnd->SetRange(pMinRange, pMaxRange);
01074 }
01075
01076 void AFXAPI DDV_CJMinMaxDateTime(CDataExchange* pDX,  COleDateTime& refValue,
01077     const COleDateTime* pMinRange, const COleDateTime* pMaxRange)
01078 {
01079     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01080     CCJDateTimeCtrl* pWnd =
01081 #if _MFC_VER >= 0x700
01082         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01083 #else
01084         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01085 #endif
01086
01087     if (!pDX->m_bSaveAndValidate)
01088     {
01089         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01090               (pMaxRange != NULL && *pMaxRange < refValue))
01091         {
01092 #if _MFC_VER >= 0x700
01093             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01094 #else
01095             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01096 #endif
01097             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01098             return;     // don't stop now
01099         }
01100     }
01101
01102     pWnd->SetRange(pMinRange, pMaxRange);
01103 }
01104
01105 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, CTime& refValue,
01106     const CTime* pMinRange, const CTime* pMaxRange)
01107 {
01108     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01109     CCJMonthCalCtrl* pWnd =
01110 #if _MFC_VER >= 0x700
01111         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01112 #else
01113         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01114 #endif
01115
01116     if (!pDX->m_bSaveAndValidate)
01117     {
01118         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01119               (pMaxRange != NULL && *pMaxRange < refValue))
01120         {
01121 #ifdef _DEBUG
01122 #if _MFC_VER >= 0x700
01123             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01124 #else
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126 #endif
01127             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01128 #endif
01129             return;     // don't stop now
01130         }
01131     }
01132
01133     pWnd->SetRange(pMinRange, pMaxRange);
01134 }
01135
01136 void AFXAPI DDV_CJMinMaxMonth(CDataExchange* pDX, COleDateTime& refValue,
01137     const COleDateTime* pMinRange, const COleDateTime* pMaxRange)
01138 {
01139     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01140     CCJMonthCalCtrl* pWnd =
01141 #if _MFC_VER >= 0x700
01142         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01143 #else
01144         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01145 #endif
01146
01147     if (!pDX->m_bSaveAndValidate)
01148     {
01149         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01150               (pMaxRange != NULL && *pMaxRange < refValue))
01151         {
01152 #ifdef _DEBUG
01153 #if _MFC_VER >= 0x700
01154             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01155 #else
01156             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01157 #endif
01158             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01159 #endif
01160             return;     // don't stop now
01161         }
01162     }
01163
01164     pWnd->SetRange(pMinRange, pMaxRange);
01165 }
01166
01168
01169 IMPLEMENT_DYNAMIC(CCJDateTimeCtrl, CWnd)
01170 IMPLEMENT_DYNAMIC(CCJMonthCalCtrl, CWnd)
01171
01172
Generated on Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00076
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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00125
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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00187
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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00158
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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00170
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 Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00013  * $Revision: 1.2 $
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
00084
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 #if _MFC_VER < 0x700
00106             ASSERT(afxData.bWin4);
00107 #endif
00108             pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
00109             rect.InflateRect(-CX_BORDER, -CY_BORDER);
00110             pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00111             return;
00112
00113         case splitIntersection:
00114 #if _MFC_VER < 0x700
00115             ASSERT(!afxData.bWin4);
00116 #endif
00117             break;
00118
00119         case splitBox:
00120 #if _MFC_VER < 0x700
00121             if (afxData.bWin4)
00122 #endif
00123             {
00124                 pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrWindowFrame);
00125                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00126                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00127                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00128                 break;
00129             }
00130             // fall through...
00131         case splitBar:
00132 #if _MFC_VER < 0x700
00133             if (!afxData.bWin4)
00134 #endif
00135             {
00136                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00137                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00138             }
00139             break;
00140
00141         default:
00142             ASSERT(FALSE);  // unknown splitter type
00143         }
00144
00145         // fill the middle
00146         pDC->FillSolidRect(rect, afxData.clrBtnFace);
00147     }
00148
00149     else {
00150         CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg);
00151     }
00152 }
00153
00154 void CCJFlatSplitterWnd::OnPaint()
00155 {
00156     if( m_bFlatSplitter )
00157     {
00158         ASSERT_VALID(this);
00159         CPaintDC dc(this);
00160
00161         CRect rectClient;
00162         GetClientRect(&rectClient);
00163
00164         CRect rectInside;
00165         GetInsideRect(rectInside);
00166         rectInside.InflateRect(4,4);
00167
00168         // draw the splitter boxes
00169         if (m_bHasVScroll && m_nRows < m_nMaxRows)
00170         {
00171             OnDrawSplitter(&dc, splitBox,
00172                 CRect(rectInside.right, rectClient.top,
00173                 rectClient.right, rectClient.top + m_cySplitter));
00174         }
00175
00176         if (m_bHasHScroll && m_nCols < m_nMaxCols)
00177         {
00178             OnDrawSplitter(&dc, splitBox,
00179                 CRect(rectClient.left, rectInside.bottom,
00180                 rectClient.left + m_cxSplitter, rectClient.bottom));
00181         }
00182
00183         // extend split bars to window border (past margins)
00184         DrawAllSplitBars(&dc, rectInside.right, rectInside.bottom);
00185
00186         // draw splitter intersections (inside only)
00187         GetInsideRect(rectInside);
00188         dc.IntersectClipRect(rectInside);
00189         CRect rect;
00190         rect.top = rectInside.top;
00191         for (int row = 0; row < m_nRows - 1; row++)
00192         {
00193             rect.top += m_pRowInfo[row].nCurSize + m_cyBorderShare;
00194             rect.bottom = rect.top + m_cySplitter;
00195             rect.left = rectInside.left;
00196             for (int col = 0; col < m_nCols - 1; col++)
00197             {
00198                 rect.left += m_pColInfo[col].nCurSize + m_cxBorderShare;
00199                 rect.right = rect.left + m_cxSplitter;
00200                 OnDrawSplitter(&dc, splitIntersection, rect);
00201                 rect.left = rect.right + m_cxBorderShare;
00202             }
00203             rect.top = rect.bottom + m_cxBorderShare;
00204         }
00205     }
00206     else {
00207         CSplitterWnd::OnPaint();
00208     }
00209 }
00210
00211 void CCJFlatSplitterWnd::HideRow(int nRowHide)
00212 {
00213     ASSERT_VALID( this );
00214     ASSERT( m_nRows > 1 );
00215     ASSERT( nRowHide < m_nRows );
00216     ASSERT( m_nHiddenRow == -1 );
00217     m_nHiddenRow = nRowHide;
00218
00219     int nActiveRow, nActiveCol;
00220
00221     // if the nRow has an active window -- change it
00222     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00223     {
00224         if( nActiveRow == nRowHide )
00225         {
00226             if( ++nActiveRow >= m_nRows )
00227                 nActiveRow = 0;
00228             SetActivePane( nActiveRow, nActiveCol );
00229         }
00230     }
00231
00232     // hide all nRow panes.
00233     for( int nCol = 0; nCol < m_nCols; ++nCol )
00234     {
00235         CWnd* pPaneHide = GetPane( nRowHide, nCol );
00236         ASSERT( pPaneHide != NULL );
00237
00238         pPaneHide->ShowWindow( SW_HIDE );
00239         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00240
00241         for( int nRow = nRowHide+1; nRow < m_nRows; ++nRow )
00242         {
00243             CWnd* pPane = GetPane( nRow, nCol );
00244             ASSERT( pPane != NULL );
00245
00246             pPane->SetDlgCtrlID( IdFromRowCol( nRow-1, nCol ));
00247         }
00248     }
00249
00250     m_nRows--;
00251     m_pRowInfo[m_nRows].nCurSize = m_pRowInfo[nRowHide].nCurSize;
00252     RecalcLayout();
00253 }
00254
00255 void CCJFlatSplitterWnd::ShowRow()
00256 {
00257     ASSERT_VALID( this );
00258     ASSERT( m_nRows < m_nMaxRows );
00259     ASSERT( m_nHiddenRow != -1 );
00260
00261     int nShowRow = m_nHiddenRow;
00262     m_nHiddenRow = -1;
00263
00264     int cyNew = m_pRowInfo[m_nRows].nCurSize;
00265     m_nRows++;  // add a nRow
00266
00267     ASSERT( m_nRows == m_nMaxRows );
00268
00269     int nRow;
00270
00271     // Show the hidden nRow
00272     for( int nCol = 0; nCol < m_nCols; ++nCol )
00273     {
00274         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00275         ASSERT( pPaneShow != NULL );
00276         pPaneShow->ShowWindow( SW_SHOWNA );
00277
00278         for( nRow = m_nRows - 2; nRow >= nShowRow; --nRow )
00279         {
00280             CWnd* pPane = GetPane( nRow, nCol );
00281             ASSERT( pPane != NULL );
00282             pPane->SetDlgCtrlID( IdFromRowCol( nRow + 1, nCol ));
00283         }
00284
00285         pPaneShow->SetDlgCtrlID( IdFromRowCol( nShowRow, nCol ));
00286     }
00287
00288     // new panes have been created -- recalculate layout
00289     for( nRow = nShowRow+1; nRow < m_nRows; nRow++ )
00290         m_pRowInfo[nRow].nIdealSize = m_pRowInfo[nRow - 1].nCurSize;
00291
00292     m_pRowInfo[nShowRow].nIdealSize = cyNew;
00293     RecalcLayout();
00294 }
00295
00296 void CCJFlatSplitterWnd::HideColumn(int nColHide)
00297 {
00298     ASSERT_VALID( this );
00299     ASSERT( m_nCols > 1 );
00300     ASSERT( nColHide < m_nCols );
00301     ASSERT( m_nHiddenCol == -1 );
00302     m_nHiddenCol = nColHide;
00303
00304     // if the column has an active window -- change it
00305     int nActiveRow, nActiveCol;
00306     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00307     {
00308         if( nActiveCol == nColHide )
00309         {
00310             if( ++nActiveCol >= m_nCols )
00311                 nActiveCol = 0;
00312             SetActivePane( nActiveRow, nActiveCol );
00313         }
00314     }
00315
00316     // hide all column panes
00317     for( int nRow = 0; nRow < m_nRows; nRow++)
00318     {
00319         CWnd* pPaneHide = GetPane(nRow, nColHide);
00320         ASSERT( pPaneHide != NULL );
00321
00322         pPaneHide->ShowWindow(SW_HIDE);
00323         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00324
00325         for( int nCol = nColHide + 1; nCol < m_nCols; nCol++ )
00326         {
00327             CWnd* pPane = GetPane( nRow, nCol );
00328             ASSERT( pPane != NULL );
00329
00330             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol - 1 ));
00331         }
00332     }
00333
00334     m_nCols--;
00335     m_pColInfo[m_nCols].nCurSize = m_pColInfo[nColHide].nCurSize;
00336     RecalcLayout();
00337 }
00338
00339 void CCJFlatSplitterWnd::ShowColumn()
00340 {
00341     ASSERT_VALID( this );
00342     ASSERT( m_nCols < m_nMaxCols );
00343     ASSERT( m_nHiddenCol != -1 );
00344
00345     int nShowCol = m_nHiddenCol;
00346     m_nHiddenCol = -1;
00347
00348     int cxNew = m_pColInfo[m_nCols].nCurSize;
00349     m_nCols++;  // add a column
00350
00351     ASSERT( m_nCols == m_nMaxCols );
00352
00353     int nCol;
00354
00355     // Show the hidden column
00356     for( int nRow = 0; nRow < m_nRows; ++nRow )
00357     {
00358         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00359         ASSERT( pPaneShow != NULL );
00360         pPaneShow->ShowWindow( SW_SHOWNA );
00361
00362         for( nCol = m_nCols - 2; nCol >= nShowCol; --nCol )
00363         {
00364             CWnd* pPane = GetPane( nRow, nCol );
00365             ASSERT( pPane != NULL );
00366             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol + 1 ));
00367         }
00368
00369         pPaneShow->SetDlgCtrlID( IdFromRowCol( nRow, nShowCol ));
00370     }
00371
00372     // new panes have been created -- recalculate layout
00373     for( nCol = nShowCol+1; nCol < m_nCols; nCol++ )
00374         m_pColInfo[nCol].nIdealSize = m_pColInfo[nCol - 1].nCurSize;
00375
00376     m_pColInfo[nShowCol].nIdealSize = cxNew;
00377     RecalcLayout();
00378 }
00379
00380 BOOL CCJFlatSplitterWnd::ReplaceView(int nRow, int nCol, CRuntimeClass *pViewClass)
00381 {
00382     CView *pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00383     ASSERT_KINDOF( CView, pView );
00384
00385     if( pView->IsKindOf( pViewClass ))
00386         return FALSE;
00387
00388     // Get pointer to CDocument object so that it can be used in the creation
00389     // process of the new view
00390     CDocument *pDoc = pView->GetDocument();
00391
00392     int nID = pView->GetDlgCtrlID();
00393     int nWidth, nHeight, nMinWidth, nMinHeight;
00394
00395     GetRowInfo( nRow, nWidth, nMinWidth );
00396     GetColumnInfo( nCol, nHeight, nMinHeight );
00397
00398     // Delete existing view
00399     DeleteView(nRow, nCol);
00400
00401     // Create new view
00402     CCreateContext context;
00403     context.m_pCurrentDoc = pDoc;
00404     CreateView( nRow, nCol, pViewClass, CSize( nWidth, nHeight ), &context );
00405     pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00406     ASSERT_KINDOF( CView, pView );
00407
00408     pView->SetDlgCtrlID( nID );
00409
00410     SetRowInfo( nRow, nWidth, nMinWidth );
00411     SetColumnInfo( nCol, nHeight, nMinHeight );
00412     RecalcLayout();
00413
00414     return TRUE;
00415 }
00416
00417 BOOL CCJFlatSplitterWnd::SwitchView(int nRow, int nCol, CView *pNewView)
00418 {
00419     CView *pOldView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00420     ASSERT_KINDOF( CView, pOldView );
00421
00422     if( pOldView == pNewView )
00423         return FALSE;
00424
00425     int nOldID, nNewID;
00426
00427     nOldID = pOldView->GetDlgCtrlID();
00428     nNewID = pNewView->GetDlgCtrlID();
00429
00430     pOldView->ShowWindow(SW_HIDE);
00431     pNewView->ShowWindow(SW_SHOW);
00432
00433     pOldView->SetDlgCtrlID(nNewID);
00434     pNewView->SetDlgCtrlID(nOldID);
00435
00436     RecalcLayout();
00437
00438     return TRUE;
00439 }
Generated on Fri Jan 31 12:08:54 2003 for WinCvs Source by doxygen 1.3-rc2


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
00503
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 Fri Jan 31 12:08:55 2003 for WinCvs Source by doxygen 1.3-rc2


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
00087
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 Fri Jan 31 12:08:55 2003 for WinCvs Source by doxygen 1.3-rc2


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
00153
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 Fri Jan 31 12:08:55 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00012  * $Revision: 1.2 $
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
00113
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 Fri Jan 31 12:08:55 2003 for WinCvs Source by doxygen 1.3-rc2


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
00120
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 Fri Jan 31 12:08:55 2003 for WinCvs Source by doxygen 1.3-rc2


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
00085
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00052
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00118
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00113
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00051
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00112
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00092
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 Fri Jan 31 12:08:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
00173
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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/08/15 02:23:25 $
00024  * $Revision: 1.2 $
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 #if _MFC_VER < 0x700
00149     DWORD dwPos = GetPosition();
00150 #else
00151     ULONGLONG dwPos = GetPosition();
00152 #endif
00153     SeekToBegin();
00154     fDuplicate->SetLength(0);
00155     while (GetPosition() < GetLength())
00156     {
00157         DWORD dwRead = Read(pbData,1024);
00158         fDuplicate->Write(pbData,dwRead);
00159     }
00160     Seek(dwPos,fDuplicate->begin);
00161     delete pbData;
00162     return true;
00163 }
00164
00165 bool CCJMemFile::Duplicate(CString strDup)
00166 {
00167     // Duplicate With CString compatibility
00168
00169     CFile file(strDup,CFile::modeCreate | CFile::modeWrite);
00170     bool bResult = Duplicate(&file);
00171     file.Close();
00172     return bResult;
00173 }
00174
00175 bool CCJMemFile::Open(CString strFilename, UINT uiOpenFlags,CFileException *pError)
00176 {
00177     // CFile compatible Open
00178
00179     if (m_File.m_hFile != NULL)
00180         return false;
00181     if (m_File.Open(strFilename,uiOpenFlags,pError))
00182     {
00183         m_uiOpenFlags = uiOpenFlags;
00184         Load();
00185         m_bOpen = true;
00186         return true;
00187     }
00188     else
00189         return false;
00190 }
00191
00192 bool CCJMemFile::Save()
00193 {
00194     if (m_File.m_hFile == NULL)
00195         return false;
00196     CString str;
00197
00198     // Check if the physical file has write access
00199     if (!(m_uiOpenFlags & modeWrite) && !(m_uiOpenFlags & modeReadWrite))
00200     {
00201         return false;
00202     }
00203
00204 #if _MFC_VER < 0x700
00205     DWORD dwPos = GetPosition();
00206 #else
00207     ULONGLONG dwPos = GetPosition();
00208 #endif
00209     DWORD dwLength = 1024;
00210     BYTE *pData = new BYTE[dwLength];
00211     if (pData == NULL)
00212         return false;
00213     SeekToBegin();
00214     m_File.SetLength(0);
00215     while (GetPosition() < GetLength())
00216     {
00217         DWORD dwRead = Read(pData,dwLength);
00218         m_File.Write(pData,dwRead);
00219     }
00220     Seek(dwPos,begin);
00221     delete pData;
00222     m_File.Flush();
00223     return true;
00224 }
00225
00226 bool CCJMemFile::Load()
00227 {
00228     if (m_File.m_hFile == NULL)
00229         return false;
00230
00231     DWORD dwLength = 1024;
00232     BYTE *pData = new BYTE[dwLength];
00233     if (pData == NULL)
00234         return false;
00235     SeekToBegin();
00236     SetLength(0);
00237     m_File.SeekToBegin();
00238     while (m_File.GetPosition() < m_File.GetLength())
00239     {
00240         DWORD dwRead = m_File.Read(pData,dwLength);
00241         Write(pData,dwRead);
00242     }
00243
00244     delete pData;
00245     return true;
00246 }
00247
00248
00249 void CCJMemFile::Close()
00250 {
00251     if ((m_File.m_hFile != NULL) && m_bOpen)
00252     {
00253         m_bOpen = false;
00254         Save();
00255         m_File.Close();
00256         m_File.m_hFile = NULL;
00257     }
00258 }
00259
00260 void CCJMemFile::Flush()
00261 {
00262     CMemFile::Flush();
00263     Save();
00264 }
00265
00266 bool CCJMemFile::Discard()
00267 {
00268     return Load();
00269 }
00270
00271 bool CCJMemFile::Import(CFile *fImp)
00272 {
00273     if ((fImp == NULL) || (fImp->m_hFile == NULL))
00274         return false;
00275
00276     DWORD dwLength = 1024;
00277     BYTE *pData = new BYTE[dwLength];
00278     if (pData == NULL)
00279         return false;
00280     SeekToBegin();
00281     SetLength(0);
00282     fImp->SeekToBegin();
00283     while (fImp->GetPosition() < fImp->GetLength())
00284     {
00285         DWORD dwRead = fImp->Read(pData,dwLength);
00286         Write(pData,dwRead);
00287     }
00288
00289     delete pData;
00290     return true;
00291 }
00292
00293 bool CCJMemFile::Append(CFile *fApp)
00294 {
00295     if ((fApp == NULL) || (fApp->m_hFile == NULL))
00296         return false;
00297
00298     DWORD dwLength = 1024;
00299     BYTE *pData = new BYTE[dwLength];
00300     if (pData == NULL)
00301         return false;
00302     SeekToEnd();
00303     fApp->SeekToBegin();
00304     while (fApp->GetPosition() < fApp->GetLength())
00305     {
00306         DWORD dwRead = fApp->Read(pData,dwLength);
00307         Write(pData,dwRead);
00308     }
00309
00310     delete pData;
00311     return true;
00312 }
00313
00314 DWORD CCJMemFile::Insert(CFile *fSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
00315 {
00316     if (dwBytes == 0)
00317         return 0;
00318
00319     CCJMemFile fPreIns;
00320     CCJMemFile fIns;
00321     CCJMemFile fPostIns;
00322     CCJMemFile fComplete;
00323
00324     Extract(&fPreIns,0,dwDestPos); // Extract Data BEFORE insertion point
00325     Extract(&fPostIns,dwDestPos,GetLength() - dwDestPos); // Extract Data AFTER intertion point
00326
00327     // Extract the "to be inserted" Data from the (fSrc) Source file
00328     {
00329         DWORD dwLength = 1024;
00330         DWORD dwCounter = 0;
00331         BYTE *pData = new BYTE[dwLength];
00332         if (pData == NULL)
00333             return 0;
00334         fSrc->Seek(dwSourcePos,begin);
00335
00336         while (((fSrc->GetPosition() - dwSourcePos) < dwBytes) && (fSrc->GetPosition() < fSrc->GetLength()) )
00337         {
00338             DWORD dwRead = fSrc->Read(pData,dwLength);
00339             if (dwCounter + dwRead > dwSourcePos + dwBytes)
00340                 dwRead = dwBytes - dwCounter;
00341             fIns.Write(pData,dwRead);
00342             dwCounter += dwRead;
00343         }
00344         delete pData;
00345     } // Finished Extraction
00346
00347
00348     fComplete += &fPreIns; // Append BEFORE Data
00349     fComplete += &fIns; // Append the "to be inserted" Data
00350     fComplete += &fPostIns;  // Append the AFTER Data
00351
00352     *this = &fComplete; // Copy completed File
00353
00354     return fIns.GetLength();
00355 }
00356
00357 DWORD CCJMemFile::Insert(CString strSrc, DWORD dwSourcePos, DWORD dwDestPos, DWORD dwBytes)
00358 {
00359     CFile file(strSrc,CFile::modeRead);
00360     DWORD dwResult = Insert(&file, dwSourcePos, dwDestPos, dwBytes);
00361     file.Close();
00362     return dwResult;
00363 }
00364
00365 DWORD CCJMemFile::Extract(CFile *fDest, DWORD dwStartPos, DWORD dwBytes)
00366 {
00367     if (dwBytes == 0)
00368         return 0;
00369 #if _MFC_VER < 0x700
00370     DWORD dwPos = GetPosition();
00371 #else
00372     ULONGLONG dwPos = GetPosition();
00373 #endif
00374     DWORD dwLength = 1024;
00375     DWORD dwCounter = 0;
00376     BYTE *pData = new BYTE[dwLength];
00377     if (pData == NULL)
00378         return 0;
00379     Seek(dwStartPos,begin);
00380
00381     while (((GetPosition() - dwStartPos) < dwBytes) && (GetPosition() < GetLength()) )
00382     {
00383         DWORD dwRead = Read(pData,dwLength);
00384         if (dwCounter + dwRead > dwStartPos + dwBytes)
00385             dwRead = dwBytes - dwCounter;
00386         fDest->Write(pData,dwRead);
00387         dwCounter += dwRead;
00388     }
00389     Seek(dwPos,begin);
00390     delete pData;
00391     fDest->Flush();
00392     return dwCounter;
00393
00394 }
00395
00396 DWORD CCJMemFile::Extract(CString strDest, DWORD dwStartPos, DWORD dwBytes)
00397 {
00398     CFile file(strDest,CFile::modeCreate | CFile::modeWrite);
00399     DWORD dwResult = Extract(&file,dwStartPos,dwBytes);
00400     file.Close();
00401     return dwResult;
00402 }
00403
00404 // Overloaded Operators
00405
00406 void CCJMemFile::operator =(CFile *fDup)
00407 {
00408     Import(fDup);
00409 }
00410
00411 void CCJMemFile::operator =(CString strDup)
00412 {
00413     CFile file;
00414     if (file.Open(strDup,CFile::modeRead))
00415     {
00416         Import(&file);
00417         file.Close();
00418     }
00419 }
00420
00421 void CCJMemFile::operator =(DWORD dwFilePos)
00422 {
00423     Seek(dwFilePos,begin);
00424 }
00425
00426
00427 void CCJMemFile::operator +=(CFile *fApp)
00428 {
00429     Append(fApp);
00430 }
00431
00432 void CCJMemFile::operator +=(CString strApp)
00433 {
00434     CFile file;
00435     if (file.Open(strApp,CFile::modeRead))
00436     {
00437         Append(&file);
00438         file.Close();
00439     }
00440 }
00441
00442 // Indexing Operators
00443
00444 BYTE CCJMemFile::operator [](DWORD dwFilePos)
00445 {
00446     if (dwFilePos > GetLength() -1)
00447         return 0;
00448
00449     BYTE bTemp;
00450     Seek(dwFilePos,begin);
00451     Read(&bTemp,sizeof(BYTE));
00452     return bTemp;
00453 }
00454
00455 LONG CCJMemFile::FindData(void* pData, DWORD dwDataLen, LONG lStartPos)
00456 {
00457     BYTE* pBytes = (BYTE*)pData;
00458
00459
00460     Seek(lStartPos,begin);
00461
00462     bool bFoundAll = false;
00463     LONG lPos = -1;
00464
00465     while ((!bFoundAll) && (GetPosition() < GetLength()))
00466     {
00467         bool bFoundFirst = false;
00468
00469         while ((!bFoundFirst) && (GetPosition() < GetLength()))
00470         {
00471             lPos = GetPosition();
00472             BYTE read;
00473             Read(&read,1);
00474             if (read != pBytes[0])
00475                 continue;
00476
00477             bFoundFirst = true;
00478             break;
00479         }
00480
00481         //Hier Die Restlichen Bytes (dwDataLen -1) vergleichen
00482
00483         DWORD i = 1;
00484         bool bFound = true;
00485
00486         while ((i < dwDataLen) && (GetPosition() < GetLength()) && bFoundFirst)
00487         {
00488             BYTE read;
00489             Read(&read,1);
00490             if (read == pBytes[i++])
00491                 continue;
00492
00493             bFound = false;
00494             Seek(lPos+1,begin);
00495             break;
00496         }
00497
00498         bFoundAll = bFound && bFoundFirst;
00499     }
00500
00501     lPos = bFoundAll ? lPos : -1;
00502 //  while (bFound && (iPos < strSeek.GetLength())
00503 //  {
00504 //  }
00505     return lPos;
00506 }
Generated on Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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
00087
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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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
00096
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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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
00120
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 Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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(NMHDR* pNMPG, LRESULT* pResult)
00094 {
00095     NMPGCALCSIZE* pNMPGCalcSize = reinterpret_cast<NMPGCALCSIZE*>(pNMPG);
00096     switch(pNMPGCalcSize->dwFlag)
00097     {
00098     case PGF_CALCWIDTH:
00099         pNMPGCalcSize->iWidth = m_nWidth;
00100         break;
00101
00102     case PGF_CALCHEIGHT:
00103         pNMPGCalcSize->iHeight = m_nHeight;
00104         break;
00105     }
00106
00107     *pResult = 0;
00108     return FALSE;   // Let parent handle message
00109 }
00110
00111 BOOL CCJPagerCtrl::OnPagerScroll(NMHDR* /*pNMPGScroll*/, LRESULT* pResult)
00112 {
00113     *pResult = 0;
00114     return FALSE;   // Let parent handle message
00115 }
Generated on Fri Jan 31 12:08:57 2003 for WinCvs Source by doxygen 1.3-rc2


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
00395
Generated on Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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
00110
Generated on Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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
00138
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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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
00124
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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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
00145
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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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
00052
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
00114
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 Fri Jan 31 12:08:58 2003 for WinCvs Source by doxygen 1.3-rc2


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
00136
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 Fri Jan 31 12:08:59 2003 for WinCvs Source by doxygen 1.3-rc2


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
00224
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 Fri Jan 31 12:08:59 2003 for WinCvs Source by doxygen 1.3-rc2


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
00078
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 Fri Jan 31 12:08:59 2003 for WinCvs Source by doxygen 1.3-rc2


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
01869
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
02193
Generated on Fri Jan 31 12:08:59 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00013  * $Revision: 1.2 $
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
00235 #if _MFC_VER >= 0x700
00236         COLORREF clr = afxData.clrBtnShadow;
00237 #else
00238         COLORREF clr = afxData.bWin4 ? afxData.clrBtnShadow : afxData.clrWindowFrame;
00239 #endif
00240
00241         // draw dark line one pixel back/up
00242         if (dwStyle & CBRS_BORDER_3D)
00243         {
00244             rect1.right -= CX_BORDER;
00245             rect1.bottom -= CY_BORDER;
00246         }
00247         if (dwStyle & CBRS_BORDER_TOP)
00248             rect2.top += afxData.cyBorder2;
00249         if (dwStyle & CBRS_BORDER_BOTTOM)
00250             rect2.bottom -= afxData.cyBorder2;
00251
00252         // draw left and top
00253         if (dwStyle & CBRS_BORDER_LEFT)
00254             pDC->FillSolidRect(0, rect2.top, CX_BORDER, rect2.Height(), clr);
00255         if (dwStyle & CBRS_BORDER_TOP)
00256             pDC->FillSolidRect(0, 0, rect.right, CY_BORDER, clr);
00257
00258         // draw right and bottom
00259         if (dwStyle & CBRS_BORDER_RIGHT)
00260             pDC->FillSolidRect(rect1.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00261         if (dwStyle & CBRS_BORDER_BOTTOM)
00262             pDC->FillSolidRect(0, rect1.bottom, rect.right, -CY_BORDER, clr);
00263
00264         if (dwStyle & CBRS_BORDER_3D)
00265         {
00266             // prepare for hilite lines
00267             clr = afxData.clrBtnHilite;
00268
00269             // draw left and top
00270             if (dwStyle & CBRS_BORDER_LEFT)
00271                 pDC->FillSolidRect(1, rect2.top, CX_BORDER, rect2.Height(), clr);
00272             if (dwStyle & CBRS_BORDER_TOP)
00273                 pDC->FillSolidRect(0, 1, rect.right, CY_BORDER, clr);
00274
00275             // draw right and bottom
00276             if (dwStyle & CBRS_BORDER_RIGHT)
00277                 pDC->FillSolidRect(rect.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00278             if (dwStyle & CBRS_BORDER_BOTTOM)
00279                 pDC->FillSolidRect(0, rect.bottom, rect.right, -CY_BORDER, clr);
00280         }
00281
00282         if (dwStyle & CBRS_BORDER_LEFT)
00283             rect.left += afxData.cxBorder2;
00284         if (dwStyle & CBRS_BORDER_TOP)
00285             rect.top += afxData.cyBorder2;
00286         if (dwStyle & CBRS_BORDER_RIGHT)
00287             rect.right -= afxData.cxBorder2;
00288         if (dwStyle & CBRS_BORDER_BOTTOM)
00289             rect.bottom -= afxData.cyBorder2;
00290     }
00291     else
00292     {
00293         if(dwStyle & CBRS_BORDER_RIGHT) {
00294             pDC->FillSolidRect(rect.right-1, 0, rect.right, rect.bottom, afxData.clrBtnShadow);
00295             rect.right--;
00296         }
00297         if(dwStyle & CBRS_BORDER_BOTTOM) {
00298             pDC->FillSolidRect(0, rect.bottom-1, rect.right, rect.bottom, afxData.clrBtnShadow);
00299             rect.bottom--;
00300         }
00301         if(dwStyle & CBRS_BORDER_TOP) {
00302             pDC->FillSolidRect(0, 0, rect.right, 1, afxData.clrBtnHilite);
00303             rect.top++;
00304         }
00305         if(dwStyle & CBRS_BORDER_LEFT) {
00306             pDC->FillSolidRect(0, 0, 1, rect.bottom, afxData.clrBtnHilite);
00307             rect.left++;
00308         }
00309     }
00310 }
00311
00312 #define CX_GRIPPER          3
00313 #define CY_GRIPPER          3
00314 #define CX_BORDER_GRIPPER   2
00315 #define CY_BORDER_GRIPPER   2
00316
00317 void CCJToolBarBase::DrawGripper(CDC* pDC, const CRect& rect)
00318 {
00319     // if we are floating return.
00320     if( m_dwStyle & CBRS_FLOATING ) {
00321         return;
00322     }
00323
00324     // if we are to draw the extended "office" style gripper.
00325     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bExStyle == true ))
00326     {
00327         // draw the gripper in the border
00328         if (m_dwStyle & CBRS_ORIENT_HORZ)
00329         {
00330             // Draw the first gripper.
00331             pDC->Draw3dRect( rect.left+3, rect.top+2, 3, rect.Height()-4,
00332                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00333
00334             pDC->SetPixel( rect.left+3, rect.top+2+rect.Height()-5,
00335                 afxData.clrBtnHilite);
00336
00337             // Draw the second gripper.
00338             pDC->Draw3dRect( rect.left+6, rect.top+2, 3, rect.Height()-4,
00339                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00340
00341             pDC->SetPixel( rect.left+6, rect.top+2+rect.Height()-5,
00342                 afxData.clrBtnHilite);
00343         }
00344         else
00345         {
00346             // Draw the first gripper.
00347             pDC->Draw3dRect( rect.left+2, rect.top+3, rect.Width()-4, 3,
00348                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00349
00350             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+3,
00351                 afxData.clrBtnHilite);
00352
00353             // Draw the second gripper.
00354             pDC->Draw3dRect( rect.left+2, rect.top+6, rect.Width()-4, 3,
00355                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00356
00357             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+6,
00358                 afxData.clrBtnHilite);
00359         }
00360
00361         GdiFlush();
00362     }
00363
00364     // if we are to draw the "ReBar" style gripper.
00365     else
00366     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bInReBar == true ))
00367     {
00368         // draw the gripper in the border
00369         if (m_dwStyle & CBRS_ORIENT_HORZ)
00370         {
00371             // Draw the first gripper.
00372             pDC->Draw3dRect( rect.left+CX_BORDER_GRIPPER, rect.top+m_cyTopBorder,
00373                 CX_GRIPPER, rect.Height()-m_cyTopBorder-m_cyBottomBorder,
00374                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00375         }
00376         else
00377         {
00378             // Draw the first gripper.
00379             pDC->Draw3dRect( rect.left+m_cyTopBorder, rect.top+CY_BORDER_GRIPPER,
00380                 rect.Width()-m_cyTopBorder-m_cyBottomBorder, CY_GRIPPER,
00381                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00382         }
00383
00384         GdiFlush();
00385     }
00386
00387     // by default, we will draw the "visual studio" style gripper.
00388     else
00389     if( m_dwStyle & CBRS_GRIPPER )
00390     {
00391         // draw the gripper in the border
00392         if (m_dwStyle & CBRS_ORIENT_HORZ)
00393         {
00394             // Draw the first gripper.
00395             pDC->Draw3dRect( rect.left+1, rect.top+2, 3, rect.Height()-4,
00396                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00397
00398             // Draw the second gripper.
00399             pDC->Draw3dRect( rect.left+5, rect.top+2, 3, rect.Height()-4,
00400                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00401         }
00402         else
00403         {
00404             // Draw the first gripper.
00405             pDC->Draw3dRect( rect.left+2, rect.top+1, rect.Width()-4, 3,
00406                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00407
00408             // Draw the second gripper.
00409             pDC->Draw3dRect( rect.left+2, rect.top+5, rect.Width()-4, 3,
00410                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00411         }
00412
00413         GdiFlush();
00414     }
00415 }
00416
00417 // input CRect should be client rectangle size
00418 void CCJToolBarBase::CalcInsideRect(CRect& rect, BOOL bHorz) const
00419 {
00420     ASSERT_VALID(this);
00421     DWORD dwStyle = m_dwStyle;
00422
00423     if (dwStyle & CBRS_BORDER_LEFT)
00424         rect.left += afxData.cxBorder2;
00425     if (dwStyle & CBRS_BORDER_TOP)
00426         rect.top += afxData.cyBorder2;
00427     if (dwStyle & CBRS_BORDER_RIGHT)
00428         rect.right -= afxData.cxBorder2;
00429     if (dwStyle & CBRS_BORDER_BOTTOM)
00430         rect.bottom -= afxData.cyBorder2;
00431
00432     // inset the top and bottom.
00433     if (bHorz)
00434     {
00435         rect.left += m_cxLeftBorder;
00436         rect.top += m_cyTopBorder;
00437         rect.right -= m_cxRightBorder;
00438         rect.bottom -= m_cyBottomBorder;
00439         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00440         {
00441             rect.left += CX_BORDER_GRIPPER+CX_GRIPPER+CX_BORDER_GRIPPER;
00442
00443             if( m_bExStyle == true ) {
00444                 rect.left += CX_GRIPPER;
00445             }
00446
00447             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00448                 rect.left -= CX_BORDER_GRIPPER+CX_GRIPPER;
00449             }
00450         }
00451     }
00452     else
00453     {
00454         rect.left += m_cyTopBorder;
00455         rect.top += m_cxLeftBorder;
00456         rect.right -= m_cyBottomBorder;
00457         rect.bottom -= m_cxRightBorder;
00458         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00459         {
00460             rect.top += CY_BORDER_GRIPPER+CY_GRIPPER+CY_BORDER_GRIPPER;
00461
00462             if( m_bExStyle == true ) {
00463                 rect.top += CY_GRIPPER;
00464             }
00465
00466             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00467                 rect.top -= CY_BORDER_GRIPPER+CY_GRIPPER;
00468             }
00469         }
00470     }
00471 }
00472
00474
00475 IMPLEMENT_DYNAMIC(CCJToolBarBase, CControlBar)
00476
00477
Generated on Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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
00068
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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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
00084
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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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
00059
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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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
00155
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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file TbEdit.h.

Generated on Fri Jan 31 12:13:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 42 of file TipDlg.cpp.

Variable Documentation

const TCHAR szIntFilePos[] = _T("FilePos") [static]

Definition at line 45 of file TipDlg.cpp.

const TCHAR szIntStartup[] = _T("StartUp") [static]

Definition at line 47 of file TipDlg.cpp.

const TCHAR szSection[] = _T("Tip") [static]

Definition at line 44 of file TipDlg.cpp.

const TCHAR szTimeStamp[] = _T("TimeStamp") [static]

Definition at line 46 of file TipDlg.cpp.

Generated on Fri Jan 31 12:13:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file TipDlg.h.

Generated on Fri Jan 31 12:13:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 22 of file ToolbarCombo.h.

Generated on Fri Jan 31 12:13:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:08 2003 for WinCvs Source by doxygen 1.3-rc2


version_no.h File Reference

WinCvs/version_no.h File Reference

Go to the source code of this file.

Defines

#define | WINCVS_PRODUCT_MAJOR 1
#define | WINCVS_PRODUCT_MINOR 3
#define | WINCVS_PRODUCT_PATCHLEVEL 11
#define | WINCVS_FILE_MAJOR WINCVS_PRODUCT_MAJOR
#define | WINCVS_FILE_MINOR WINCVS_PRODUCT_MINOR
#define | WINCVS_FILE_PATCHLEVEL WINCVS_PRODUCT_PATCHLEVEL
#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 WINCVS_PRODUCT_MAJOR

Definition at line 33 of file version_no.h.

#define WINCVS_FILE_MINOR WINCVS_PRODUCT_MINOR

Definition at line 34 of file version_no.h.

#define WINCVS_FILE_PATCHLEVEL WINCVS_PRODUCT_PATCHLEVEL

Definition at line 35 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 29 of file version_no.h.

#define WINCVS_PRODUCT_MINOR 3

Definition at line 30 of file version_no.h.

#define WINCVS_PRODUCT_PATCHLEVEL 11

Definition at line 31 of file version_no.h.

Generated on Fri Jan 31 12:13:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 "GraphView.h"
#include "WinCvsBrowser.h"
#include "BrowseFileView.h"
#include "AppGlue.h"
#include "CvsPrefs.h"
#include "AppConsole.h"
#include "Splash.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 "wincvs_winutil.h"

Include dependency graph for wincvs.cpp:

Include dependency graph

Go to the source code of this file.

Compounds

class | CAboutDlg
class | CLogoutThread
Class to handle auto-logout. More...

Defines

#define | AUTHORS_COUNT 3
The count of authors.

#define | AUTHORS_PERMUTATIONS 6
The number of permutations of author's names order.

#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.

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).

void AFXAPI | DDV_CheckCVSROOT (CDataExchange *pDX, CString &value)
Check whether the CVSROOT entered is valid, correct if not...

void AFXAPI | DDX_ComboMString (CDataExchange *pDX, int nIDC, CSmartComboBox &combo)
Note:
If pDX passed as NULL then the combo is populated

void AFXAPI | DDV_MinChars (CDataExchange *pDX, CString const &value, int nChars)
Verify the entry has at least nChars characters.

bool | MatchToken (LPCTSTR sLine, LPCTSTR sToken)

Variables

const char * | gAuthors [3]
Array of authors names.

const int | gAuthorsPermutations [6][3]
Array of indexes to traverse all authors names permutations.

CLogoutThread * | sLogout = 0L
CWincvsApp theApp
const CLSID | clsid

Define Documentation

#define AUTHORS_COUNT 3

The count of authors.

Definition at line 66 of file wincvs.cpp.

Referenced by CWincvsApp::OnAppCredits().

#define AUTHORS_PERMUTATIONS 6

The number of permutations of author's names order.

Definition at line 69 of file wincvs.cpp.

Referenced by CWincvsApp::OnAppCredits().

#define DEBUG_MESSAGE ( S ) 0

Definition at line 1350 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 925 of file wincvs.cpp.

References TrimRight().

Referenced by CGetPrefs_CVSROOT::DoDataExchange().

00926 {
00927     //check after the trailing white spaces - often an unwanted result of copy-paste
00928     if( pDX->m_bSaveAndValidate &&
00929         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00930     {
00931         value.ReleaseBuffer();
00932
00933         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00934         {
00935             TrimRight(value.GetBuffer(value.GetLength()+1));
00936             value.ReleaseBuffer();
00937         }
00938     }
00939 }

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 903 of file wincvs.cpp.

References CompatMakeSurePathExists(), and CStr.

Referenced by CCheckout_MAIN::DoDataExchange(), CGetPrefs_WINCVS::DoDataExchange(), CGetPrefs_CVS::DoDataExchange(), CImport_OPTIONS::DoDataExchange(), and CCmdLine_MAIN::DoDataExchange().

00904 {
00905     if( pDX->m_bSaveAndValidate )
00906     {
00907         if( !CompatMakeSurePathExists(value, false) )
00908         {
00909             if( CStr(value).endsWith(kPathDelimiter) )
00910             {
00911                 value.TrimRight(kPathDelimiter);
00912             }
00913
00914             if( !CompatMakeSurePathExists(value, promptForCreation) )
00915             {
00916                 AfxMessageBox("Cannot find folder: " + value);
00917                 pDX->PrepareEditCtrl(nIDC);
00918                 pDX->Fail();
00919             }
00920         }
00921     }
00922 }

void AFXAPI DDV_MinChars | ( | CDataExchange * | pDX,
 |  | CString const & | value,
 |  | int | nChars
 | ) |

Verify the entry has at least nChars characters.

Definition at line 978 of file wincvs.cpp.

References ASSERT.

Referenced by CAnnotate_MAIN::DoDataExchange(), CCheckout_MAIN::DoDataExchange(), CCheckout_OPTIONS::DoDataExchange(), CCommit_OPTIONS::DoDataExchange(), CDiff_MAIN::DoDataExchange(), CGetPrefs_CVSROOT::DoDataExchange(), CGetPrefs_WINCVS::DoDataExchange(), GetValue::DoDataExchange(), CImport_MAIN::DoDataExchange(), CCmdLine_MAIN::DoDataExchange(), CLogFilters::DoDataExchange(), CRtag_MAIN::DoDataExchange(), CRtag_OPTIONS::DoDataExchange(), CTag_MAIN::DoDataExchange(), CUpdateSticky::DoDataExchange(), and CUpdateMerge::DoDataExchange().

00979 {
00980     ASSERT(nChars > 0);        // allow them something
00981     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00982     {
00983         TCHAR szT[255];
00984         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00985         CString prompt;
00986         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00987         prompt.Empty(); // exception prep
00988         pDX->Fail();
00989     }
00990 }

void AFXAPI DDX_ComboMString | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CSmartComboBox & | combo
 | ) |

Note:
If pDX passed as NULL then the combo is populated

Definition at line 942 of file wincvs.cpp.

References ASSERT, USmartCombo::GetItems(), TMString< UStr >::GetList(), and TMString< UStr >::Insert().

Referenced by CAnnotate_MAIN::DoDataExchange(), CCheckout_MAIN::DoDataExchange(), CCheckout_OPTIONS::DoDataExchange(), CCommit_MAIN::DoDataExchange(), CCommit_OPTIONS::DoDataExchange(), CDiff_MAIN::DoDataExchange(), CGetPrefs_CVSROOT::DoDataExchange(), CImport_MAIN::DoDataExchange(), CItemListDlg::DoDataExchange(), CCmdLine_MAIN::DoDataExchange(), CLogFilters::DoDataExchange(), CRtag_MAIN::DoDataExchange(), CRtag_OPTIONS::DoDataExchange(), CTag_MAIN::DoDataExchange(), CUpdateSticky::DoDataExchange(), CUpdateMerge::DoDataExchange(), CDiff_MAIN::OnCheck1(), CDiff_MAIN::OnCheck2(), and CAnnotate_MAIN::OnIsdate().

00943 {
00944     CMString* mstr = combo.GetItems();
00945     ASSERT(mstr != NULL);
00946
00947     if( mstr )
00948     {
00949         if( !pDX || !pDX->m_bSaveAndValidate )
00950         {
00951             CString strOldText;
00952             combo.GetWindowText(strOldText);
00953
00954             combo.ResetContent();
00955
00956             const vector<CStr> & list = mstr->GetList();
00957             vector<CStr>::const_iterator i;
00958             for(i = list.begin(); i != list.end(); ++i)
00959             {
00960                 combo.AddString(*i);
00961             }
00962
00963             combo.SetWindowText(strOldText);
00964         }
00965         else
00966         {
00967             CString value;
00968             DDX_CBString(pDX, nIDC, value);
00969             if( !value.IsEmpty() )
00970             {
00971                 mstr->Insert(value);
00972             }
00973         }
00974     }
00975 }

IMPLEMENT_DYNAMIC | ( | CLogoutThread | ,
 |  | CWinThread |
 | ) |

bool IsValidHandle ( HANDLE handle )

Definition at line 277 of file wincvs.cpp.

References NULL.

Referenced by CWincvsApp::InitInstance().

00278 {
00279     HANDLE dupedHandle = NULL;
00280
00281     /*
00282      * GetFileType() returns FILE_TYPE_UNKNOWN for invalid handles.
00283      */
00284
00285     if( GetFileType(handle) == FILE_TYPE_UNKNOWN )
00286     {
00287         if( !DuplicateHandle(GetCurrentProcess(),
00288             handle,
00289             GetCurrentProcess(),
00290             &dupedHandle,
00291             0,
00292             FALSE,
00293             DUPLICATE_SAME_ACCESS) )
00294         {
00295             /*
00296             * Unable to make a duplicate. It's definately invalid at this point
00297             */
00298
00299             return false;
00300         }
00301
00302         /*
00303         * Use structured exception handling (Win32 SEH) to protect the close
00304         * of this duped handle which might throw EXCEPTION_INVALID_HANDLE.
00305         */
00306         __try
00307         {
00308             CloseHandle(dupedHandle);
00309         }
00310         __except (EXCEPTION_EXECUTE_HANDLER)
00311         {
00312             /*
00313             * Definately an invalid handle.  So, therefore, the original
00314             * is invalid also.
00315             */
00316
00317             return false;
00318         }
00319     }
00320
00321     return true;
00322 }

bool MatchToken | ( | LPCTSTR | sLine,
 |  | LPCTSTR | sToken
 | ) | [inline, static]

Definition at line 1327 of file wincvs.cpp.

Referenced by CWincvsApp::InitATL().

01328 {
01329     int n = _tcslen(sToken);
01330     if (0 != _tcsnicmp(sLine,sToken,n)) {
01331         return false;
01332     }
01333     LPCTSTR p = sLine + n;
01334     return ((!*p) || (0 != _tcschr(_T(" \t"),*p)));
01335 }

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 864 of file wincvs.cpp.

References NULL.

Referenced by DDV_CheckCVSROOT().

00865 {
00866     bool bRes = false;
00867
00868     char* pszPos = szValue;
00869     char* pszLastSpacePos = NULL;
00870
00871     //locate last white space
00872     while( *pszPos != '\0' )
00873     {
00874         if( isspace(*pszPos) )
00875         {
00876             if( pszLastSpacePos == NULL )
00877             {
00878                 pszLastSpacePos = pszPos;
00879             }
00880         }
00881         else
00882         {
00883             pszLastSpacePos = NULL;
00884         }
00885
00886         pszPos++;
00887     }
00888
00889     //and cut it off
00890     if( pszLastSpacePos )
00891     {
00892         if( !bTest )
00893         {
00894             *pszLastSpacePos = '\0';
00895         }
00896         bRes = true;
00897     }
00898
00899     return bRes;
00900 }

Variable Documentation

const CLSID clsid [static]

Initial value:

{ 0xd2d77dc2, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } }

Definition at line 263 of file wincvs.cpp.

const char* gAuthors[ 3 ]

Initial value:

{
    "\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n",
    "\t* Jerzy Kaczorowski <kaczoroj@hotmail.com>\n",
    "\t* Karl-Heinz Bruenen <gcvs@bruenen-net.de>\n"
}
Array of authors names.

Definition at line 72 of file wincvs.cpp.

const int gAuthorsPermutations[ 6 ][ 3 ]

Initial value:

{
    0, 1, 2,
    0, 2, 1,
    1, 0, 2,
    1, 2, 0,
    2, 0, 1,
    2, 1, 0
}
Array of indexes to traverse all authors names permutations.

Definition at line 80 of file wincvs.cpp.

CLogoutThread* sLogout = 0L [static]

Definition at line 208 of file wincvs.cpp.

Referenced by CWincvsApp::InitInstance(), and CWincvsApp::SaveAllModified().

CWincvsApp theApp

Definition at line 257 of file wincvs.cpp.

Generated on Fri Jan 31 12:13:10 2003 for WinCvs Source by doxygen 1.3-rc2


wincvs.h File Reference

WinCvs/wincvs.h File Reference

#include "resource.h"
#include "MultiString.h"
#include "SmartComboBox.h"
#include "cvsgui_process.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).

void AFXAPI | DDV_MinChars (CDataExchange *pDX, CString const &value, int nChars)
Verify the entry has at least nChars characters.

void AFXAPI | DDV_CheckCVSROOT (CDataExchange *pDX, CString &value)
Check whether the CVSROOT entered is valid, correct if not...

void AFXAPI | DDX_ComboMString (CDataExchange *pDX, int nIDC, CSmartComboBox &combo)
Note:
If pDX passed as NULL then the combo is populated

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 925 of file wincvs.cpp.

References TrimRight().

Referenced by CGetPrefs_CVSROOT::DoDataExchange().

00926 {
00927     //check after the trailing white spaces - often an unwanted result of copy-paste
00928     if( pDX->m_bSaveAndValidate &&
00929         TrimRight(value.GetBuffer(value.GetLength()+1), true) )
00930     {
00931         value.ReleaseBuffer();
00932
00933         if( AfxMessageBox("The CVSROOT value contains the trailing spaces. Do you want to trim them?", MB_ICONQUESTION | MB_YESNO) == IDYES )
00934         {
00935             TrimRight(value.GetBuffer(value.GetLength()+1));
00936             value.ReleaseBuffer();
00937         }
00938     }
00939 }

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 903 of file wincvs.cpp.

References CompatMakeSurePathExists(), and CStr.

Referenced by CCmdLine_MAIN::DoDataExchange(), CImport_OPTIONS::DoDataExchange(), CGetPrefs_CVS::DoDataExchange(), CGetPrefs_WINCVS::DoDataExchange(), and CCheckout_MAIN::DoDataExchange().

00904 {
00905     if( pDX->m_bSaveAndValidate )
00906     {
00907         if( !CompatMakeSurePathExists(value, false) )
00908         {
00909             if( CStr(value).endsWith(kPathDelimiter) )
00910             {
00911                 value.TrimRight(kPathDelimiter);
00912             }
00913
00914             if( !CompatMakeSurePathExists(value, promptForCreation) )
00915             {
00916                 AfxMessageBox("Cannot find folder: " + value);
00917                 pDX->PrepareEditCtrl(nIDC);
00918                 pDX->Fail();
00919             }
00920         }
00921     }
00922 }

void AFXAPI DDV_MinChars | ( | CDataExchange * | pDX,
 |  | CString const & | value,
 |  | int | nChars
 | ) |

Verify the entry has at least nChars characters.

Definition at line 978 of file wincvs.cpp.

References ASSERT.

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_WINCVS::DoDataExchange(), CGetPrefs_CVSROOT::DoDataExchange(), CDiff_MAIN::DoDataExchange(), CCommit_OPTIONS::DoDataExchange(), CCheckout_OPTIONS::DoDataExchange(), CCheckout_MAIN::DoDataExchange(), and CAnnotate_MAIN::DoDataExchange().

00979 {
00980     ASSERT(nChars > 0);        // allow them something
00981     if (pDX->m_bSaveAndValidate && value.GetLength() < nChars)
00982     {
00983         TCHAR szT[255];
00984         wsprintf(szT, _T("Please enter more than %d character"), nChars);
00985         CString prompt;
00986         AfxMessageBox(szT, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00987         prompt.Empty(); // exception prep
00988         pDX->Fail();
00989     }
00990 }

void AFXAPI DDX_ComboMString | ( | CDataExchange * | pDX,
 |  | int | nIDC,
 |  | CSmartComboBox & | combo
 | ) |

Note:
If pDX passed as NULL then the combo is populated

Definition at line 942 of file wincvs.cpp.

References ASSERT, USmartCombo::GetItems(), TMString< UStr >::GetList(), and TMString< UStr >::Insert().

Referenced by CUpdateMerge::DoDataExchange(), CUpdateSticky::DoDataExchange(), CTag_MAIN::DoDataExchange(), CRtag_OPTIONS::DoDataExchange(), CRtag_MAIN::DoDataExchange(), CLogFilters::DoDataExchange(), CCmdLine_MAIN::DoDataExchange(), CItemListDlg::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().

00943 {
00944     CMString* mstr = combo.GetItems();
00945     ASSERT(mstr != NULL);
00946
00947     if( mstr )
00948     {
00949         if( !pDX || !pDX->m_bSaveAndValidate )
00950         {
00951             CString strOldText;
00952             combo.GetWindowText(strOldText);
00953
00954             combo.ResetContent();
00955
00956             const vector<CStr> & list = mstr->GetList();
00957             vector<CStr>::const_iterator i;
00958             for(i = list.begin(); i != list.end(); ++i)
00959             {
00960                 combo.AddString(*i);
00961             }
00962
00963             combo.SetWindowText(strOldText);
00964         }
00965         else
00966         {
00967             CString value;
00968             DDX_CBString(pDX, nIDC, value);
00969             if( !value.IsEmpty() )
00970             {
00971                 mstr->Insert(value);
00972             }
00973         }
00974     }
00975 }

Generated on Fri Jan 31 12:13:11 2003 for WinCvs Source by doxygen 1.3-rc2


wincvs.odl File Reference

WinCvs/wincvs.odl File Reference

Go to the source code of this file.

Namespaces

namespace Wincvs

Generated on Fri Jan 31 12:13:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.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)
Return the menu which has the cmd nStartId.

CMenu * | _GetMenuEntryRecurs (CMenu *menu, int nStartId, int &pos)
CMenu * | GetMenuEntry (int nStartId, int &pos)
Return the menu and position of a cmd.

CMenu * | GetCustomMenu (int whichmenu, CView *pThis)
Return the custom menu.

void | CustomizeMenus (int whichmenu)
Ask to customize the menus.

bool | FormatMenuString (int cmd, CString &str)
bool | IsLargeFonts ()
bool | IsHideCommandKeyPressed ()
DWORD | SetListCtrlExtendedStyle (CListCtrl *pListCtrl, const DWORD dwExtendedStyle)

Variables

char * | sDefBrowserMenu []
char * | sDefFilesMenu []
CMMenuString | gFilesMenu (99,"P_FilesMenu", sDefFilesMenu)
CMMenuString | gBrowserMenu (99,"P_BrowserMenu", sDefBrowserMenu)

Function Documentation

CMenu* _GetMenuEntryRecurs | ( | CMenu * | menu,
 |  | int | nStartId,
 |  | int & | pos
 | ) |

Definition at line 295 of file wincvs_winutil.cpp.

Referenced by GetMenuEntry().

00296 {
00297     if( menu == 0L )
00298         return 0l;
00299
00300     for(UINT iPos = 0; iPos < menu->GetMenuItemCount(); iPos++)
00301     {
00302         UINT id = menu->GetMenuItemID(iPos);
00303         if( id == (UINT)nStartId )
00304         {
00305             pos = iPos;
00306             return menu;
00307         }
00308
00309         if( id == (UINT)-1 )
00310         {
00311             CMenu* res = _GetMenuEntryRecurs(menu->GetSubMenu(iPos), nStartId, pos);
00312             if( res != 0L )
00313                 return res;
00314         }
00315     }
00316
00317     return 0L;
00318 }

void CustomizeMenus ( int whichmenu )

Ask to customize the menus.

Definition at line 502 of file wincvs_winutil.cpp.

References ASSERT, gBrowserMenu, gFilesMenu, kCustomBrowserMenu, and kCustomFilesMenu.

Referenced by CBrowseFileView::OnCustomize(), and CWinCvsBrowser::OnCustomize().

00503 {
00504     CMMenuString *multiMenu;
00505
00506     switch(whichmenu)
00507     {
00508     case kCustomBrowserMenu:
00509         multiMenu = &gBrowserMenu;
00510         break;
00511     case kCustomFilesMenu:
00512         multiMenu = &gFilesMenu;
00513         break;
00514     default:
00515         ASSERT(0);
00516         return;
00517     }
00518
00519     CCustomizeMenus custom(multiMenu);
00520     if(custom.DoModal() == IDOK)
00521     {
00522         gCvsPrefs.save();
00523     }
00524 }

CWnd * FindNextChildWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 125 of file wincvs_winutil.cpp.

References FindNextSiblingWindow(), IsTargetWindow(), and NULL.

Referenced by FindNextSiblingWindow(), and FindNextWindow().

00126 {
00127     if (pWnd)
00128     {
00129         CWnd* pChildWnd = pWnd->GetTopWindow();
00130         while (pChildWnd)
00131         {
00132             if (IsTargetWindow(pChildWnd, CheckTabStop))
00133                 return pChildWnd;
00134             CWnd* pSiblingWnd = FindNextSiblingWindow(pChildWnd, CheckTabStop);
00135             if (pSiblingWnd)
00136                 return pSiblingWnd;
00137             pChildWnd = pChildWnd->GetTopWindow();
00138         }
00139     }
00140     return NULL;
00141 }

CWnd * FindNextSiblingWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 107 of file wincvs_winutil.cpp.

References FindNextChildWindow(), IsTargetWindow(), and NULL.

Referenced by FindNextChildWindow(), and FindNextWindow().

00108 {
00109     if (pWnd)
00110     {
00111         CWnd* pSiblingWnd = pWnd->GetNextWindow();
00112         while (pSiblingWnd)
00113         {
00114             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00115                 return pSiblingWnd;
00116             CWnd* pChildWnd = FindNextChildWindow(pSiblingWnd, CheckTabStop);
00117             if (pChildWnd)
00118                 return pChildWnd;
00119             pSiblingWnd = pSiblingWnd->GetNextWindow();
00120         }
00121     }
00122     return NULL;
00123 }

CWnd* FindNextWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 54 of file wincvs_winutil.cpp.

References FindNextChildWindow(), FindNextSiblingWindow(), and GetNextParentWindow().

00055 {
00056     ASSERT_VALID(pWnd);
00057     if (pWnd)
00058     {
00059         CWnd* pNextWnd;
00060         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00061         if (pNextWnd)
00062             return pNextWnd;
00063
00064         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00065         if (pNextWnd)
00066             return pNextWnd;
00067
00068         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00069         while ((pParentWnd) && (pNextWnd != pWnd))
00070         {
00071             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00072             if (pNextWnd)
00073                 return pNextWnd;
00074             pParentWnd = GetNextParentWindow(pParentWnd);
00075         }
00076     }
00077     return pWnd;
00078 }

CWnd * FindPrevSiblingWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 182 of file wincvs_winutil.cpp.

References IsTargetWindow(), and NULL.

Referenced by FindPrevWindow().

00183 {
00184     if (pWnd)
00185     {
00186         CWnd* pSiblingWnd = pWnd->GetWindow(GW_HWNDPREV);
00187         while (pSiblingWnd)
00188         {
00189             if (IsTargetWindow(pSiblingWnd, CheckTabStop))
00190                 return pSiblingWnd;
00191             pSiblingWnd = pSiblingWnd->GetWindow(GW_HWNDPREV);
00192         }
00193     }
00194     return NULL;
00195 }

CWnd* FindPrevWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) |

Definition at line 143 of file wincvs_winutil.cpp.

References FindPrevSiblingWindow(), GetEndOfDecendantWindow(), GetPrevParentWindow(), IsTargetWindow(), and NULL.

00144 {
00145     ASSERT_VALID(pWnd);
00146     if (pWnd)
00147     {
00148         CWnd* pWndCrntLevel = pWnd;
00149         while (TRUE)
00150         {
00151             CWnd* pFoundWnd;
00152             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00153             if (pFoundWnd)
00154                 return pFoundWnd;
00155             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00156             if (!pWndCrntLevel)
00157             {
00158                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00159                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00160                     return pFoundWnd;
00161                 pWndCrntLevel = pFoundWnd;
00162             }
00163         }
00164     }
00165     return NULL;
00166 }

bool FormatMenuString | ( | int | cmd,
 |  | CString & | str
 | ) |

Get the string for the command

Parameters:
cmd | Command
str | Return string for the command
Returns:
TRUE if string found for the command (str contains the resulting string)

Definition at line 532 of file wincvs_winutil.cpp.

References CStr, ID_VIEW_EDITSELDEF, SplitPath(), and TRUE.

Referenced by GetCustomMenu(), and CBrowseFileView::OnUpdateViewEditseldef().

00533 {
00534     bool res = false;
00535
00536     switch(cmd)
00537     {
00538     case ID_VIEW_EDITSELDEF:
00539         {
00540             CString viever("default viewer");
00541             if( gCvsPrefs.Viewer() != 0L )
00542             {
00543                 CStr uppath, folder;
00544                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00545
00546                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00547                 if( viever.Find(" ") > -1 )
00548                 {
00549                     viever = "\"" + viever + "\"";
00550                 }
00551             }
00552             str = "View &with " + viever;
00553
00554         }
00555         res = TRUE;
00556         break;
00557
00558     default:
00559         break;
00560     }
00561
00562     return res;
00563 }

CMenu* GetCustomMenu | ( | int | whichmenu,
 |  | CView * | pThis
 | ) |

Return the custom menu.

Definition at line 435 of file wincvs_winutil.cpp.

References ASSERT, CustInvertTable::cmd, CustGetByKey(), FormatMenuString(), gBrowserMenu, CMMenuString::GetList(), gFilesMenu, kCustomBrowserMenu, kCustomFilesMenu, CustInvertTable::title, updateUIMenu(), and VERIFY.

Referenced by CBrowseFileView::OnContextMenu(), and CWinCvsBrowser::OnContextMenu().

00436 {
00437     CMMenuString* multiMenu;
00438
00439     switch(whichmenu)
00440     {
00441     case kCustomBrowserMenu:
00442         multiMenu = &gBrowserMenu;
00443         break;
00444     case kCustomFilesMenu:
00445         multiMenu = &gFilesMenu;
00446         break;
00447     default:
00448         ASSERT(0);
00449         return 0L;
00450     }
00451
00452     CMenu* res = new CMenu;
00453     VERIFY(res->CreatePopupMenu());
00454
00455     std::vector<UStr>& list = multiMenu->GetList();
00456     std::vector<UStr>::iterator i = list.begin();
00457
00458     while( i != list.end() )
00459     {
00460         const CustInvertTable* tab = CustGetByKey(*i);
00461         if( tab == 0L )
00462         {
00463             TRACE1("Removing old command(%s)\n", (const char*)*i);
00464
00465             list.erase(i);
00466             i = list.begin();
00467             continue;
00468         }
00469
00470         i++;
00471     }
00472
00473     for(i = list.begin(); i != list.end(); ++i)
00474     {
00475         const CustInvertTable* tab = CustGetByKey(*i);
00476         if( tab )
00477         {
00478             if( tab->cmd == ID_SEPARATOR )
00479             {
00480                 res->AppendMenu(MF_SEPARATOR);
00481             }
00482             else
00483             {
00484                 CString str = tab->title;
00485                 FormatMenuString(tab->cmd, str);
00486                 res->AppendMenu(MF_STRING, tab->cmd, str);
00487             }
00488         }
00489     }
00490
00491     res->AppendMenu(MF_SEPARATOR);
00492     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00493         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00494         CString("Customize this menu..."));
00495
00496     updateUIMenu(res, pThis);
00497
00498     return res;
00499 }

CWnd * GetEndOfDecendantWindow ( CWnd * pWnd )

Definition at line 197 of file wincvs_winutil.cpp.

Referenced by FindPrevWindow().

00198 {
00199     CWnd* pTmpWnd = pWnd;
00200     CWnd* pPreTmpWnd;
00201     while (pTmpWnd)
00202     {
00203         pPreTmpWnd = pTmpWnd;
00204         pTmpWnd = pTmpWnd->GetWindow(GW_CHILD);
00205         if (pTmpWnd)
00206         {
00207             pPreTmpWnd = pTmpWnd;
00208             pTmpWnd = pTmpWnd->GetWindow(GW_HWNDLAST);
00209         }
00210     }
00211     return pPreTmpWnd;
00212 }

CMenu* GetMenuEntry | ( | int | nStartId,
 |  | int & | pos
 | ) |

Return the menu and position of a cmd.

Definition at line 321 of file wincvs_winutil.cpp.

References _GetMenuEntryRecurs(), and ASSERT.

Referenced by cvsgui_GetTopMacroAdminMenu(), and cvsgui_GetTopMacroSelectionMenu().

00322 {
00323     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00324     ASSERT(pTopMenu != 0L);
00325
00326     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00327 }

CWnd * GetNextParentWindow ( CWnd * pWnd )

Definition at line 80 of file wincvs_winutil.cpp.

References FALSE, NULL, and TRUE.

Referenced by FindNextWindow().

00081 {
00082     if (pWnd)
00083     {
00084         if (pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00085             return pWnd->GetTopWindow();
00086
00087         CFrameWnd* pFrameWnd = pWnd->GetParentFrame();
00088         ASSERT_VALID(pFrameWnd);
00089         CWnd* pParentWnd = pWnd->GetParent();
00090         ASSERT_VALID(pParentWnd);
00091
00092         CWnd* pCrntWnd;
00093         BOOL bFound = FALSE;
00094         while ((!bFound) && (pParentWnd != pFrameWnd))
00095         {
00096             pCrntWnd = pParentWnd->GetNextWindow();
00097             if (pCrntWnd)
00098                 bFound = TRUE;
00099             else
00100                 pParentWnd = pParentWnd->GetParent();
00101         }
00102         return (bFound) ? pCrntWnd : pParentWnd->GetTopWindow();
00103     }
00104     return NULL;
00105 }

CWnd * GetPrevParentWindow ( CWnd * pWnd )

Definition at line 168 of file wincvs_winutil.cpp.

References NULL.

Referenced by FindPrevWindow().

00169 {
00170     if (pWnd)
00171     {
00172         if (!pWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
00173         {
00174             CWnd* pParentWnd = pWnd->GetParent();
00175             ASSERT_VALID(pParentWnd);
00176             return pParentWnd;
00177         }
00178     }
00179     return NULL;
00180 }

CMenu* GetSubCMenu | ( | int | nStartId,
 |  | CView * | pThis
 | ) |

Return the menu which has the cmd nStartId.

Definition at line 268 of file wincvs_winutil.cpp.

References ASSERT, NULL, and updateUIMenu().

00269 {
00270     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00271     ASSERT(pTopMenu != 0L);
00272     if( pTopMenu == 0L )
00273         return NULL;
00274
00275     CMenu* pMyMenu=NULL;
00276     for(int iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00277     {
00278         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00279         if( pMenu && pMenu->GetMenuItemID(0) == (UINT)nStartId )
00280         {
00281             pMyMenu = pMenu;
00282             break;
00283         }
00284     }
00285
00286     ASSERT(pMyMenu != 0L);
00287     if( pMyMenu == 0L )
00288         return NULL;
00289
00290     updateUIMenu(pMyMenu, pThis);
00291
00292     return pMyMenu;
00293 }

bool IsHideCommandKeyPressed ( )

Check whether the hide command dialog key is pressed

Returns:
true if hiding key pressed, false otherwise
Note:
The hiding key is determined in the preferences and it can be either Shift or Ctrl

Definition at line 597 of file wincvs_winutil.cpp.

Referenced by COptionalPropertySheet::DoModal().

00598 {
00599     return ::GetKeyState(gCvsPrefs.HideCommandDlgUseShift() ? VK_SHIFT : VK_CONTROL) < 0;
00600 }

bool IsLargeFonts ( )

Check whether Large Fonts are set in the display settings

Returns:
true if Large Fonts are set, false otherwise
Note:
The actual testing is only done once, but since OS requires a reboot after font's size change it should not be a problem

Definition at line 571 of file wincvs_winutil.cpp.

Referenced by COptionalPropertySheet::GetOptionCheckRect(), and KoDateColumn::GetSetupData().

00572 {
00573     static bool bLargeFonts = false;
00574     static bool defined = false;
00575
00576     if( !defined )
00577     {
00578         defined = true;
00579
00580         HWND hDesktop = ::GetDesktopWindow();
00581         HDC hDesktopDC = ::GetDC(hDesktop);
00582         short nLogPixels = ::GetDeviceCaps(hDesktopDC, LOGPIXELSX);
00583
00584         ::ReleaseDC(hDesktop, hDesktopDC);
00585
00586         bLargeFonts = (nLogPixels > 96);
00587     }
00588
00589     return bLargeFonts;
00590 }

BOOL IsTargetWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop
 | ) | [inline]

Definition at line 46 of file wincvs_winutil.cpp.

Referenced by FindNextChildWindow(), FindNextSiblingWindow(), FindPrevSiblingWindow(), and FindPrevWindow().

00047 {
00048     return ((!CheckTabStop) || (WS_TABSTOP & pWnd->GetStyle()));
00049 }

DWORD SetListCtrlExtendedStyle | ( | CListCtrl * | pListCtrl,
 |  | const DWORD | dwExtendedStyle
 | ) |

Set the extended style for the list control

Parameters:
pListCtrl List control to set the style for
dwExtendedStyle
Returns:
The previous extended style of the list control

Definition at line 608 of file wincvs_winutil.cpp.

References ASSERT.

Referenced by CItemListDlg::OnInitDialog(), and CSelectionDetailsDlg::OnInitDialog().

00609 {
00610     if( !pListCtrl )
00611     {
00612         ASSERT(FALSE);  // bad pointer
00613         return 0;
00614     }
00615
00616     return pListCtrl->SetExtendedStyle(pListCtrl->GetExtendedStyle() | dwExtendedStyle);
00617 }

void updateUIMenu | ( | CMenu * | pMyMenu,
 |  | CView * | pThis
 | ) | [static]

Definition at line 214 of file wincvs_winutil.cpp.

References ASSERT, and NULL.

Referenced by GetCustomMenu(), and GetSubCMenu().

00215 {
00216     CCmdUI state;
00217     state.m_pMenu = pMyMenu;
00218
00219     state.m_nIndexMax = pMyMenu->GetMenuItemCount();
00220     for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
00221       state.m_nIndex++)
00222     {
00223         state.m_nID = pMyMenu->GetMenuItemID(state.m_nIndex);
00224         if (state.m_nID == 0)
00225             continue; // menu separator or invalid cmd - ignore it
00226
00227         ASSERT(state.m_pOther == NULL);
00228         ASSERT(state.m_pMenu != NULL);
00229         if (state.m_nID == (UINT)-1)
00230         {
00231             // possibly a popup menu, route to first item of that popup
00232             state.m_pSubMenu = pMyMenu->GetSubMenu(state.m_nIndex);
00233             if (state.m_pSubMenu == NULL ||
00234                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
00235                 state.m_nID == (UINT)-1)
00236             {
00237                 continue;       // first item of popup can't be routed to
00238             }
00239             state.DoUpdate(pThis, FALSE);    // popups are never auto disabled
00240         }
00241         else
00242         {
00243             // normal menu item
00244             // Auto enable/disable if frame window has 'm_bAutoMenuEnable'
00245             //    set and command is _not_ a system command.
00246             state.m_pSubMenu = NULL;
00247             state.DoUpdate(pThis, TRUE);
00248         }
00249
00250 #   if 0 /* ??? */
00251         // adjust for menu deletions and additions
00252         UINT nCount = pMyMenu->GetMenuItemCount();
00253         if (nCount < state.m_nIndexMax)
00254         {
00255             state.m_nIndex -= (state.m_nIndexMax - nCount);
00256             while (state.m_nIndex < nCount &&
00257                 pMyMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
00258             {
00259                 state.m_nIndex++;
00260             }
00261         }
00262         state.m_nIndexMax = nCount;
00263 #   endif
00264     }
00265 }

Variable Documentation

CMMenuString gBrowserMenu(99, "P_BrowserMenu", sDefBrowserMenu) [static]

Referenced by CustomizeMenus(), and GetCustomMenu().

CMMenuString gFilesMenu(99, "P_FilesMenu", sDefFilesMenu) [static]

Referenced by CustomizeMenus(), and GetCustomMenu().

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 397 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 411 of file wincvs_winutil.cpp.

Generated on Fri Jan 31 12:13:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 | CCvsThreadLock
Critical section to protect while accessing MFC from cvs. More...

class | CWndRedrawMngr
Class to support efficient drawing of CWnd based windows by managing window's redraw. 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)
Return the menu which has the cmd nStartId.

CMenu * | GetMenuEntry (int nStartId, int &pos)
Return the menu and position of a cmd.

CMenu * | GetCustomMenu (int whichmenu, CView *pThis)
Return the custom menu.

void | CustomizeMenus (int whichmenu)
Ask to customize the menus.

bool | FormatMenuString (int cmd, CString &str)
bool | IsLargeFonts ()
bool | IsHideCommandKeyPressed ()
DWORD | SetListCtrlExtendedStyle (CListCtrl *pListCtrl, const DWORD dwExtendedStyle)

Enumeration Type Documentation

anonymous enum

Enumeration values:
kCustomBrowserMenu
kCustomFilesMenu

Definition at line 24 of file wincvs_winutil.h.

00025 {
00026     kCustomBrowserMenu,
00027     kCustomFilesMenu
00028 };

Function Documentation

void CustomizeMenus ( int whichmenu )

Ask to customize the menus.

Definition at line 502 of file wincvs_winutil.cpp.

References ASSERT, gBrowserMenu, gFilesMenu, kCustomBrowserMenu, and kCustomFilesMenu.

Referenced by CWinCvsBrowser::OnCustomize(), and CBrowseFileView::OnCustomize().

00503 {
00504     CMMenuString *multiMenu;
00505
00506     switch(whichmenu)
00507     {
00508     case kCustomBrowserMenu:
00509         multiMenu = &gBrowserMenu;
00510         break;
00511     case kCustomFilesMenu:
00512         multiMenu = &gFilesMenu;
00513         break;
00514     default:
00515         ASSERT(0);
00516         return;
00517     }
00518
00519     CCustomizeMenus custom(multiMenu);
00520     if(custom.DoModal() == IDOK)
00521     {
00522         gCvsPrefs.save();
00523     }
00524 }

CWnd* FindNextWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop = TRUE
 | ) |

Definition at line 54 of file wincvs_winutil.cpp.

References FindNextChildWindow(), FindNextSiblingWindow(), and GetNextParentWindow().

00055 {
00056     ASSERT_VALID(pWnd);
00057     if (pWnd)
00058     {
00059         CWnd* pNextWnd;
00060         pNextWnd = FindNextChildWindow(pWnd, CheckTabStop);
00061         if (pNextWnd)
00062             return pNextWnd;
00063
00064         pNextWnd = FindNextSiblingWindow(pWnd, CheckTabStop);
00065         if (pNextWnd)
00066             return pNextWnd;
00067
00068         CWnd* pParentWnd = GetNextParentWindow(pWnd);
00069         while ((pParentWnd) && (pNextWnd != pWnd))
00070         {
00071             pNextWnd = FindNextChildWindow(pParentWnd, CheckTabStop);
00072             if (pNextWnd)
00073                 return pNextWnd;
00074             pParentWnd = GetNextParentWindow(pParentWnd);
00075         }
00076     }
00077     return pWnd;
00078 }

CWnd* FindPrevWindow | ( | CWnd * | pWnd,
 |  | BOOL | CheckTabStop = TRUE
 | ) |

Definition at line 143 of file wincvs_winutil.cpp.

References FindPrevSiblingWindow(), GetEndOfDecendantWindow(), GetPrevParentWindow(), IsTargetWindow(), and NULL.

00144 {
00145     ASSERT_VALID(pWnd);
00146     if (pWnd)
00147     {
00148         CWnd* pWndCrntLevel = pWnd;
00149         while (TRUE)
00150         {
00151             CWnd* pFoundWnd;
00152             pFoundWnd = FindPrevSiblingWindow(pWndCrntLevel, CheckTabStop);
00153             if (pFoundWnd)
00154                 return pFoundWnd;
00155             pWndCrntLevel = GetPrevParentWindow(pWndCrntLevel);
00156             if (!pWndCrntLevel)
00157             {
00158                 pFoundWnd = GetEndOfDecendantWindow(pWnd->GetParentFrame());
00159                 if (IsTargetWindow(pFoundWnd, CheckTabStop))
00160                     return pFoundWnd;
00161                 pWndCrntLevel = pFoundWnd;
00162             }
00163         }
00164     }
00165     return NULL;
00166 }

bool FormatMenuString | ( | int | cmd,
 |  | CString & | str
 | ) |

Get the string for the command

Parameters:
cmd | Command
str | Return string for the command
Returns:
TRUE if string found for the command (str contains the resulting string)

Definition at line 532 of file wincvs_winutil.cpp.

References CStr, ID_VIEW_EDITSELDEF, SplitPath(), and TRUE.

Referenced by GetCustomMenu(), and CBrowseFileView::OnUpdateViewEditseldef().

00533 {
00534     bool res = false;
00535
00536     switch(cmd)
00537     {
00538     case ID_VIEW_EDITSELDEF:
00539         {
00540             CString viever("default viewer");
00541             if( gCvsPrefs.Viewer() != 0L )
00542             {
00543                 CStr uppath, folder;
00544                 SplitPath(gCvsPrefs.Viewer(), uppath, folder);
00545
00546                 viever = folder.empty() ? (uppath.empty() ? gCvsPrefs.Viewer() : uppath) : folder;
00547                 if( viever.Find(" ") > -1 )
00548                 {
00549                     viever = "\"" + viever + "\"";
00550                 }
00551             }
00552             str = "View &with " + viever;
00553
00554         }
00555         res = TRUE;
00556         break;
00557
00558     default:
00559         break;
00560     }
00561
00562     return res;
00563 }

CMenu* GetCustomMenu | ( | int | whichmenu,
 |  | CView * | pThis
 | ) |

Return the custom menu.

Definition at line 435 of file wincvs_winutil.cpp.

References ASSERT, CustInvertTable::cmd, CustGetByKey(), FormatMenuString(), gBrowserMenu, CMMenuString::GetList(), gFilesMenu, kCustomBrowserMenu, kCustomFilesMenu, CustInvertTable::title, updateUIMenu(), and VERIFY.

Referenced by CWinCvsBrowser::OnContextMenu(), and CBrowseFileView::OnContextMenu().

00436 {
00437     CMMenuString* multiMenu;
00438
00439     switch(whichmenu)
00440     {
00441     case kCustomBrowserMenu:
00442         multiMenu = &gBrowserMenu;
00443         break;
00444     case kCustomFilesMenu:
00445         multiMenu = &gFilesMenu;
00446         break;
00447     default:
00448         ASSERT(0);
00449         return 0L;
00450     }
00451
00452     CMenu* res = new CMenu;
00453     VERIFY(res->CreatePopupMenu());
00454
00455     std::vector<UStr>& list = multiMenu->GetList();
00456     std::vector<UStr>::iterator i = list.begin();
00457
00458     while( i != list.end() )
00459     {
00460         const CustInvertTable* tab = CustGetByKey(*i);
00461         if( tab == 0L )
00462         {
00463             TRACE1("Removing old command(%s)\n", (const char*)*i);
00464
00465             list.erase(i);
00466             i = list.begin();
00467             continue;
00468         }
00469
00470         i++;
00471     }
00472
00473     for(i = list.begin(); i != list.end(); ++i)
00474     {
00475         const CustInvertTable* tab = CustGetByKey(*i);
00476         if( tab )
00477         {
00478             if( tab->cmd == ID_SEPARATOR )
00479             {
00480                 res->AppendMenu(MF_SEPARATOR);
00481             }
00482             else
00483             {
00484                 CString str = tab->title;
00485                 FormatMenuString(tab->cmd, str);
00486                 res->AppendMenu(MF_STRING, tab->cmd, str);
00487             }
00488         }
00489     }
00490
00491     res->AppendMenu(MF_SEPARATOR);
00492     res->AppendMenu(MF_STRING, whichmenu == kCustomFilesMenu ?
00493         ID_CUST_FILES_MENU : ID_CUST_FOLDER_MENU,
00494         CString("Customize this menu..."));
00495
00496     updateUIMenu(res, pThis);
00497
00498     return res;
00499 }

CMenu* GetMenuEntry | ( | int | nStartId,
 |  | int & | pos
 | ) |

Return the menu and position of a cmd.

Definition at line 321 of file wincvs_winutil.cpp.

References _GetMenuEntryRecurs(), and ASSERT.

Referenced by cvsgui_GetTopMacroAdminMenu(), and cvsgui_GetTopMacroSelectionMenu().

00322 {
00323     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00324     ASSERT(pTopMenu != 0L);
00325
00326     return _GetMenuEntryRecurs(pTopMenu, nStartId, pos);
00327 }

CMenu* GetSubCMenu | ( | int | nStartId,
 |  | CView * | pThis
 | ) |

Return the menu which has the cmd nStartId.

Definition at line 268 of file wincvs_winutil.cpp.

References ASSERT, NULL, and updateUIMenu().

00269 {
00270     CMenu* pTopMenu = AfxGetMainWnd()->GetMenu();
00271     ASSERT(pTopMenu != 0L);
00272     if( pTopMenu == 0L )
00273         return NULL;
00274
00275     CMenu* pMyMenu=NULL;
00276     for(int iPos = pTopMenu->GetMenuItemCount()-1; iPos >= 0; iPos--)
00277     {
00278         CMenu* pMenu = pTopMenu->GetSubMenu(iPos);
00279         if( pMenu && pMenu->GetMenuItemID(0) == (UINT)nStartId )
00280         {
00281             pMyMenu = pMenu;
00282             break;
00283         }
00284     }
00285
00286     ASSERT(pMyMenu != 0L);
00287     if( pMyMenu == 0L )
00288         return NULL;
00289
00290     updateUIMenu(pMyMenu, pThis);
00291
00292     return pMyMenu;
00293 }

bool IsHideCommandKeyPressed ( )

Check whether the hide command dialog key is pressed

Returns:
true if hiding key pressed, false otherwise
Note:
The hiding key is determined in the preferences and it can be either Shift or Ctrl

Definition at line 597 of file wincvs_winutil.cpp.

Referenced by COptionalPropertySheet::DoModal().

00598 {
00599     return ::GetKeyState(gCvsPrefs.HideCommandDlgUseShift() ? VK_SHIFT : VK_CONTROL) < 0;
00600 }

bool IsLargeFonts ( )

Check whether Large Fonts are set in the display settings

Returns:
true if Large Fonts are set, false otherwise
Note:
The actual testing is only done once, but since OS requires a reboot after font's size change it should not be a problem

Definition at line 571 of file wincvs_winutil.cpp.

Referenced by COptionalPropertySheet::GetOptionCheckRect(), and KoDateColumn::GetSetupData().

00572 {
00573     static bool bLargeFonts = false;
00574     static bool defined = false;
00575
00576     if( !defined )
00577     {
00578         defined = true;
00579
00580         HWND hDesktop = ::GetDesktopWindow();
00581         HDC hDesktopDC = ::GetDC(hDesktop);
00582         short nLogPixels = ::GetDeviceCaps(hDesktopDC, LOGPIXELSX);
00583
00584         ::ReleaseDC(hDesktop, hDesktopDC);
00585
00586         bLargeFonts = (nLogPixels > 96);
00587     }
00588
00589     return bLargeFonts;
00590 }

DWORD SetListCtrlExtendedStyle | ( | CListCtrl * | pListCtrl,
 |  | const DWORD | dwExtendedStyle
 | ) |

Set the extended style for the list control

Parameters:
pListCtrl List control to set the style for
dwExtendedStyle
Returns:
The previous extended style of the list control

Definition at line 608 of file wincvs_winutil.cpp.

References ASSERT.

Referenced by CSelectionDetailsDlg::OnInitDialog(), and CItemListDlg::OnInitDialog().

00609 {
00610     if( !pListCtrl )
00611     {
00612         ASSERT(FALSE);  // bad pointer
00613         return 0;
00614     }
00615
00616     return pListCtrl->SetExtendedStyle(pListCtrl->GetExtendedStyle() | dwExtendedStyle);
00617 }

Generated on Fri Jan 31 12:13:13 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvsBrowser.cpp File Reference

WinCvs/WinCvsBrowser.cpp File Reference

#include "stdafx.h"
#include "wincvs.h"
#include "MainFrm.h"
#include "WinCvsBrowser.h"
#include "AppConsole.h"
#include "CvsPrefs.h"
#include "CvsCommands.h"
#include "TclGlue.h"
#include "MacrosSetup.h"
#include "wincvs_winutil.h"
#include "PythonGlue.h"
#include "BrowseViewHandlers.h"
#include "umain.h"
#include "resource.h"

Include dependency graph for WinCvsBrowser.cpp:

Include dependency graph

Go to the source code of this file.

Enumerations

enum {
kIconFolderClosed,
kIconFolderOpened,
kIconFolderCVSClosed,
kIconFolderCVSOpened,
kIconFolderIgnoreClosed,
kIconFolderIgnoreOpened,
kIconFolderLost
}
Folder icons enum. More...

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
Application message to reset the view.

const char * | gDummyFile = "@@@dummy file@@@"
Dummy item text.

Enumeration Type Documentation

anonymous enum

Folder icons enum.

Enumeration values:
kIconFolderClosed | Closed folder
kIconFolderOpened | Opened folder
kIconFolderCVSClosed | Closed CVS folder
kIconFolderCVSOpened | Opened CVS folder
kIconFolderIgnoreClosed | Closed ignored folder
kIconFolderIgnoreOpened | Opened ignored folder
kIconFolderLost | Missing CVS folder

Definition at line 50 of file WinCvsBrowser.cpp.

00051 {
00052     kIconFolderClosed,
00053     kIconFolderOpened,
00054     kIconFolderCVSClosed,
00055     kIconFolderCVSOpened,
00056     kIconFolderIgnoreClosed,
00057     kIconFolderIgnoreOpened,
00058     kIconFolderLost
00059 };

Function Documentation

void onIgnoreChanged ( CObject * obj ) [static]

Ignore changed notification function

Parameters:
obj Browser view to be notified

Definition at line 127 of file WinCvsBrowser.cpp.

00128 {
00129     ((CWinCvsBrowser*)obj)->OnIgnoreChanged();
00130 }

void SetIcon | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | item,
 |  | bool | hasCvsInfos,
 |  | bool | expand,
 |  | EntnodeData * | data = 0L
 | ) | [static]

Helper method to set the appropriate icon for a given node

Parameters:
treeCtrl | Tree control to set the icon
item | Item handle to set the icon
hasCvsInfos | true for CVS folder, false otherwise
expand | true for expanded folder, false otherwise
data | Node data
Returns:
true on success, false otherwise

Definition at line 76 of file WinCvsBrowser.cpp.

References kIconFolderClosed, kIconFolderCVSClosed, kIconFolderCVSOpened, kIconFolderIgnoreClosed, kIconFolderIgnoreOpened, kIconFolderOpened, and VERIFY.

Referenced by CCJBrowseButton::Create(), and CCJFlatButton::SetIcon().

00078 {
00079     TV_ITEM pItem;
00080     pItem.hItem = item;
00081     pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00082     VERIFY(treeCtrl.GetItem(&pItem));
00083
00084     int newImage;
00085     if( data == 0L )
00086     {
00087         if( expand )
00088             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00089         else
00090             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00091     }
00092     else
00093     {
00094         if( expand )
00095         {
00096             if( data->IsIgnored() )
00097                 newImage = kIconFolderIgnoreOpened;
00098             else if( data->IsUnknown() )
00099                 newImage = kIconFolderOpened;
00100             else
00101                 newImage = kIconFolderCVSOpened;
00102         }
00103         else
00104         {
00105             if( data->IsIgnored() )
00106                 newImage = kIconFolderIgnoreClosed;
00107             else if( data->IsUnknown() )
00108                 newImage = kIconFolderClosed;
00109             else
00110                 newImage = kIconFolderCVSClosed;
00111         }
00112     }
00113
00114     if( pItem.iImage != newImage )
00115     {
00116         pItem.iImage = newImage;
00117         pItem.iSelectedImage = newImage;
00118         pItem.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00119         treeCtrl.SetItem(&pItem);
00120     }
00121 }

Variable Documentation

const char* gDummyFile = "@@@dummy file@@@" [static]

Dummy item text.

Definition at line 65 of file WinCvsBrowser.cpp.

const int WM_RESETVIEW = WM_APP + 12 [static]

Application message to reset the view.

Definition at line 62 of file WinCvsBrowser.cpp.

Generated on Fri Jan 31 12:13:14 2003 for WinCvs Source by doxygen 1.3-rc2


WinCvsBrowser.h File Reference

WinCvs/WinCvsBrowser.h File Reference

#include <afxcview.h>
#include "CPStr.h"
#include "FileTraversal.h"
#include "BrowseFileView.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 | CSelectionChangeNotifier
class | TBrowserFill
Class to create an item with all the subdirectories inside for a given path and a root item. More...

class | TBrowserFillDummy
Class to create an item with a dummy item inside if and only if the folder is not empty. More...

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 22 of file WinCvsBrowser.h.

Generated on Fri Jan 31 12:13:15 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by FileTraverse().

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.

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
 | ) |

Definition at line 67 of file WinCvsDebug.cpp.

References wcvsdbg_one_shot, wcvsdbg_one_shot_bit, and wincvs_debug_mask.

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 wincvs_debug_mask.

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.

References wincvs_debug_mask.

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 }

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 Fri Jan 31 12:13:15 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References wincvs_debug_mask.

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_one_shot, and wincvs_debug_mask.

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.

References wcvsdbg_one_shot, wcvsdbg_one_shot_bit, and wincvs_debug_mask.

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 wincvs_debug_mask.

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.

References wincvs_debug_mask.

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 Fri Jan 31 12:13:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 "Appglue.h"
#include "BrowseViewHandlers.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 158 of file wincvsDoc.cpp.

References _afxRichEditCookie::m_ar, and _afxRichEditCookie::m_dwError.

Referenced by CWincvsDoc::Serialize().

00159 {
00160     _afxRichEditCookie* pCookie = (_afxRichEditCookie*)dwCookie;
00161     CArchive& ar = pCookie->m_ar;
00162     ar.Flush();
00163     DWORD dw = 0;
00164     *pcb = cb;
00165     TRY
00166     {
00167         if (ar.IsStoring())
00168             ar.GetFile()->Write(pbBuff, cb);
00169         else
00170             *pcb = ar.GetFile()->Read(pbBuff, cb);
00171     }
00172     CATCH(CFileException, e)
00173     {
00174         *pcb = 0;
00175         pCookie->m_dwError = (DWORD)e->m_cause;
00176         dw = 1;
00177     }
00178     AND_CATCH_ALL(e)
00179     {
00180         *pcb = 0;
00181         pCookie->m_dwError = (DWORD)CFileException::generic;
00182         dw = 1;
00183     }
00184     END_CATCH_ALL
00185     return dw;
00186 }

Variable Documentation

const IID IID_IWincvs [static]

Initial value:

{ 0xd2d77dc4, 0x8299, 0x11d1, { 0x89, 0x49, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } }

Definition at line 104 of file wincvsDoc.cpp.

Generated on Fri Jan 31 12:13:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:17 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Functions

CPersistentT< CCharFormat > gViewFont ("P_ViewFont", CCharFormat(), kNoClass)

Function Documentation

CPersistentT<CCharFormat> gViewFont | ( | "P_ViewFont" | ,
 |  | CCharFormat() | ,
 |  | kNoClass |
 | ) | [static]

Referenced by CWincvsView::OnMyFormatFont().

Generated on Fri Jan 31 12:13:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 | CCharFormat
Character format wrapper class. More...

class | CWincvsView
Console window class. More...

Defines

#define | AFX_WINCVSVIEW_H__D2D77DD0_8299_11D1_8949_444553540000__INCLUDED_
#define | WCHARFORMAT CHARFORMAT
#define | MAX_CHAR_BY_LINE 1024
Max character count in the line.

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

Max character count in the line.

Definition at line 42 of file wincvsView.h.

Referenced by CWincvsView::OutConsole(), and UCvsConsole::OutConsole().

#define WCHARFORMAT CHARFORMAT

Definition at line 38 of file wincvsView.h.

Referenced by CCharFormat::CCharFormat(), and CCharFormat::operator CHARFORMAT &().

Generated on Fri Jan 31 12:13:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:43 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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 Fri Jan 31 12:11:44 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and CCJColorPopup::OnMouseMove().

#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(), and CCJColorPopup::OnMouseMove().

#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 Fri Jan 31 12:11:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:44 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#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 Fri Jan 31 12:11:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 1076 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJDateTimeCtrl::SetRange().

01078 {
01079     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01080     CCJDateTimeCtrl* pWnd =
01081 #if _MFC_VER >= 0x700
01082         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01083 #else
01084         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01085 #endif
01086
01087     if (!pDX->m_bSaveAndValidate)
01088     {
01089         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01090               (pMaxRange != NULL && *pMaxRange < refValue))
01091         {
01092 #if _MFC_VER >= 0x700
01093             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01094 #else
01095             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01096 #endif
01097             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01098             return;     // don't stop now
01099         }
01100     }
01101
01102     pWnd->SetRange(pMinRange, pMaxRange);
01103 }

void AFXAPI DDV_CJMinMaxDateTime | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 1044 of file CJDateTimeCtrl.cpp.

01046 {
01047     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01048
01049     CCJDateTimeCtrl* pWnd =
01050 #if _MFC_VER >= 0x700
01051         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01052 #else
01053         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01054 #endif
01055
01056     if (!pDX->m_bSaveAndValidate)
01057     {
01058         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01059               (pMaxRange != NULL && *pMaxRange < refValue))
01060         {
01061 #ifdef _DEBUG
01062 #if _MFC_VER >= 0x700
01063             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01064 #else
01065             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01066 #endif
01067             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01068 #endif
01069             return;     // don't stop now
01070         }
01071     }
01072
01073     pWnd->SetRange(pMinRange, pMaxRange);
01074 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1136 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJMonthCalCtrl::SetRange().

01138 {
01139     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01140     CCJMonthCalCtrl* pWnd =
01141 #if _MFC_VER >= 0x700
01142         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01143 #else
01144         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01145 #endif
01146
01147     if (!pDX->m_bSaveAndValidate)
01148     {
01149         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01150               (pMaxRange != NULL && *pMaxRange < refValue))
01151         {
01152 #ifdef _DEBUG
01153 #if _MFC_VER >= 0x700
01154             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01155 #else
01156             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01157 #endif
01158             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01159 #endif
01160             return;     // don't stop now
01161         }
01162     }
01163
01164     pWnd->SetRange(pMinRange, pMaxRange);
01165 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 1105 of file CJDateTimeCtrl.cpp.

01107 {
01108     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01109     CCJMonthCalCtrl* pWnd =
01110 #if _MFC_VER >= 0x700
01111         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01112 #else
01113         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01114 #endif
01115
01116     if (!pDX->m_bSaveAndValidate)
01117     {
01118         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01119               (pMaxRange != NULL && *pMaxRange < refValue))
01120         {
01121 #ifdef _DEBUG
01122 #if _MFC_VER >= 0x700
01123             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01124 #else
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126 #endif
01127             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01128 #endif
01129             return;     // don't stop now
01130         }
01131     }
01132
01133     pWnd->SetRange(pMinRange, pMaxRange);
01134 }

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.

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.

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 Fri Jan 31 12:11:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:48 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Generated on Fri Jan 31 12:11:48 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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.

Generated on Fri Jan 31 12:11:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:51 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Win32Type g_Shell = IsShellType() [static]

Definition at line 94 of file CJMenu.cpp.

Referenced by CCJMenu::IsNewShell(), and CCJMenu::MeasureItem().

Generated on Fri Jan 31 12:11:51 2003 for WinCvs Source by doxygen 1.3-rc2


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::TrackPopup().

CCJMenuBar* g_pMenuBar = NULL [static]

Definition at line 430 of file CJMenuBar.cpp.

Referenced by CCJMenuBar::MenuInputFilter(), and CCJMenuBar::TrackPopup().

Generated on Fri Jan 31 12:11:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:56 2003 for WinCvs Source by doxygen 1.3-rc2


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, _sysColorMap, CJX_COLORMAP::iSysColorTo, NULL, and CJX_COLORMAP::rgbqFrom.

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 = -1

Definition at line 227 of file CJToolBar.cpp.

Referenced by _GetComCtlVersion(), 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().

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.

Referenced by _LoadSysColorBitmap().

Generated on Fri Jan 31 12:11:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 314 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect().

#define CX_GRIPPER 3

Definition at line 312 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect().

#define CY_BORDER_GRIPPER 2

Definition at line 315 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect().

#define CY_GRIPPER 3

Definition at line 313 of file CJToolBarBase.cpp.

Referenced by CCJToolBarBase::CalcInsideRect(), and CCJToolBarBase::DrawGripper().

Generated on Fri Jan 31 12:11:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:58 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and LayoutRowCol().

#define CY_BORDER 1

Definition at line 45 of file GfxSplitterWnd.cpp.

Referenced by DeferClientPos(), CCJToolBarBase::DrawBorders(), and LayoutRowCol().

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, and CY_BORDER.

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, and CY_BORDER.

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 Fri Jan 31 12:11:58 2003 for WinCvs Source by doxygen 1.3-rc2


Resource.h File Reference

WinCvs/CJLib/CJLibrary/Resource.h File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:11:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:11:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 95 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 96 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 Fri Jan 31 12:11:06 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00011  * $Revision: 1.2 $
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 #if _MFC_VER < 0x700
00090 #include <..\src\afximpl.h>
00091 #else
00092 #include <..\atlmfc\src\mfc\afximpl.h>
00093 #endif
00094
00095 #define _delete(p){if(p){delete p;p=NULL;}}
00096 #define _destroyIcon(h){if(h){::DestroyIcon(h);h=NULL;}}
00097
00098 //{{AFX_INSERT_LOCATION}}
00099 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00100
00101 #endif // !defined(AFX_STDAFX_H__F235A078_2921_11D3_8733_000000000000__INCLUDED_)
Generated on Fri Jan 31 12:08:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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 LRESULT OnPushPinButton(UINT lParam, LONG wParam);
00228     afx_msg LRESULT 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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00029  * $Revision: 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 BOOL OnEraseBkgnd(CDC* pDC);
00146     //}}AFX_MSG
00147 #if _MFC_VER < 0x700
00148     afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
00149 #else
00150     afx_msg void OnActivateApp(BOOL bActive, DWORD hTask);
00151 #endif
00152     DECLARE_MESSAGE_MAP()
00153 };
00154
00156
00157 //{{AFX_INSERT_LOCATION}}
00158 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00159
00160 #endif // !defined(__CJCOLORPOPUP_H__)
Generated on Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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 #if _MFC_VER < 0x700
00114 #include <..\src\afximpl.h>
00115 #else
00116 #include <..\atlmfc\src\mfc\afximpl.h>
00117 #endif
00118
00119 #ifndef __CJBROWSEEDIT_H__
00120 #include "CJBrowseEdit.h"
00121 #endif
00122
00123 #ifndef __CJCAPTION_H__
00124 #include "CJCaption.h"
00125 #endif
00126
00127 #ifndef __CJCAPTIONPOPUPWND_H__
00128 #include "CJCaptionPopupWnd.h"
00129 #endif
00130
00131 #ifndef __CJCOLORPICKER_H__
00132 #include "CJColorPicker.h"
00133 #endif
00134
00135 #ifndef __CJCOLORPOPUP_H__
00136 #include "CJColorPopup.h"
00137 #endif
00138
00139 #ifndef __CJCOMBOBOXEX_H__
00140 #include "CJComboBoxEx.h"
00141 #endif
00142
00143 #ifndef __CJCONTROLBAR_H__
00144 #include "CJControlBar.h"
00145 #endif
00146
00147 #ifndef __CJDATETIMECTRL_H__
00148 #include "CJDateTimeCtrl.h"
00149 #endif
00150
00151 #ifndef __CJDOCKBAR_H__
00152 #include "CJDockBar.h"
00153 #endif
00154
00155 #ifndef __CJDOCKCONTEXT_H__
00156 #include "CJDockContext.h"
00157 #endif
00158
00159 #ifndef __CJEXPLORERBAR_H__
00160 #include "CJExplorerBar.h"
00161 #endif
00162
00163 #ifndef __CJFLATBUTTON_H__
00164 #include "CJFlatButton.h"
00165 #endif
00166
00167 #ifndef __CJFLATCOMBOBOX_H__
00168 #include "CJFlatComboBox.h"
00169 #endif
00170
00171 #ifndef __CJFLATHEADERCTRL_H__
00172 #include "CJFlatHeaderCtrl.h"
00173 #endif
00174
00175 #ifndef __CJFLATSPLITTERWND_H__
00176 #include "CJFlatSplitterWnd.h"
00177 #endif
00178
00179 #ifndef __CCJFLATTABCTRL_H__
00180 #include "CJFlatTabCtrl.h"
00181 #endif
00182
00183 #ifndef __CJFONTCOMBO_H__
00184 #include "CJFontCombo.h"
00185 #endif
00186
00187 #ifndef __CJFRAMEWND_H__
00188 #include "CJFrameWnd.h"
00189 #endif
00190
00191 #ifndef __CJHEXEDIT_H__
00192 #include "CJHexEdit.h"
00193 #endif
00194
00195 #ifndef __CJHTMLVIEW_H__
00196 #include "CJHtmlView.h"
00197 #endif
00198
00199 #ifndef __CJHYPERLINK_H__
00200 #include "CJHyperLink.h"
00201 #endif
00202
00203 #ifndef __CJLISTBOX_H__
00204 #include "CJListBox.h"
00205 #endif
00206
00207 #ifndef __CJLISTCTRL_H__
00208 #include "CJListCtrl.h"
00209 #endif
00210
00211 #ifndef __CJLISTVIEW_H__
00212 #include "CJListView.h"
00213 #endif
00214
00215 #ifndef __CJLOGOPANE_H__
00216 #include "CJLogoPane.h"
00217 #endif
00218
00219 #ifndef __CJMASKEDIT_H__
00220 #include "CJMaskEdit.h"
00221 #endif
00222
00223 #ifndef __CJMDICHILDWND_H__
00224 #include "CJMDIChildWnd.h"
00225 #endif
00226
00227 #ifndef __CJMDIFRAMEWND_H__
00228 #include "CJMDIFrameWnd.h"
00229 #endif
00230
00231 #ifndef __CJMEMFILE_H__
00232 #include "CJMemFile.h"
00233 #endif
00234
00235 #ifndef __CJMENU_H__
00236 #include "CJMenu.h"        // CCJMenu class declaration
00237 #endif
00238
00239 #ifndef __CJMENUBAR_H__
00240 #include "CJMenuBar.h"
00241 #endif
00242
00243 #ifndef __CJMETAFILEBUTTON_H__
00244 #include "CJMetaFileButton.h"
00245 #endif
00246
00247 #ifndef __CJMINIDOCKFRAMEWND_H__
00248 #include "CJMiniDockFrameWnd.h"
00249 #endif
00250
00251 #ifndef __CJOUTLOOKBAR_H__
00252 #include "CJOutlookBar.h"
00253 #endif
00254
00255 #ifndef __CJPAGERCTRL_H__
00256 #include "CJPagerCtrl.h"
00257 #endif
00258
00259 #ifndef __CJREBAR_H__
00260 #include "CJReBar.h"
00261 #endif
00262
00263 #ifndef __CJREBARCTRL_H__
00264 #include "CJReBarCtrl.h"
00265 #endif
00266
00267 #ifndef __CJSHELL_H__
00268 #include "CJShell.h"
00269 #endif
00270
00271 #ifndef __CJSHELLLIST_H__
00272 #include "CJShellList.h"
00273 #endif
00274
00275 #ifndef __CJSHELLTREE_H__
00276 #include "CJShellTree.h"
00277 #endif
00278
00279 #ifndef __CJSIZEDOCKBAR_H__
00280 #include "CJSizeDockBar.h"
00281 #endif
00282
00283 #ifndef __CJSORTCLASS_H__
00284 #include "CJSortClass.h"
00285 #endif
00286
00287 #ifndef __CJSTATUSBAR_H__
00288 #include "CJStatusBar.h"
00289 #endif
00290
00291 #ifndef __CJTABCTRL_H__
00292 #include "CJTabCtrl.h"
00293 #endif
00294
00295 #ifndef __CJTABCTRLBAR_H__
00296 #include "CJTabCtrlBar.h"
00297 #endif
00298
00299 #ifndef __CJTABVIEW_H__
00300 #include "CJTabView.h"
00301 #endif
00302
00303 #ifndef __CJTOOLBAR_H__
00304 #include "CJToolBar.h"
00305 #endif
00306
00307 #ifndef __CCJTOOLBARBASE_H__
00308 #include "CJToolBarBase.h"
00309 #endif
00310
00311 #ifndef __CJTOOLBARCTRL_H__
00312 #include "CJToolBarCtrl.h"
00313 #endif
00314
00315 #ifndef __CJTREECTRL_H__
00316 #include "CJTreeCtrl.h"
00317 #endif
00318
00319 #ifndef __CJWINDOWPLACEMENT_H__
00320 #include "CJWindowPlacement.h"
00321 #endif
00322
00323 #ifndef __GFXGROUPEDIT_H__
00324 #include "GfxGroupEdit.h"
00325 #endif
00326
00327 #ifndef __GFXOUTBARCTRL_H__
00328 #include "GfxOutBarCtrl.h"
00329 #endif
00330
00331 #ifndef __GFXSPLITTERWND_H__
00332 #include "GfxSplitterWnd.h"
00333 #endif
00334
00335 #define _delete(p){if(p){delete p;p=NULL;}}
00336
00337 #ifdef _AFXDLL
00338     #ifdef _DEBUG
00339         #if defined(_UNICODE)
00340             #define _CJX_COMMENT "CJ609Libud.lib"
00341             #define _CJX_MESSAGE "Automatically linking with CJ609Libud.dll"
00342         #else
00343             #define _CJX_COMMENT "CJ609Libd.lib"
00344             #define _CJX_MESSAGE "Automatically linking with CJ609Libd.dll"
00345         #endif
00346     #else
00347         #if defined(_UNICODE)
00348             #define _CJX_COMMENT "CJ609Libu.lib"
00349             #define _CJX_MESSAGE "Automatically linking with CJ609Libu.dll"
00350         #else
00351             #define _CJX_COMMENT "CJ609Lib.lib"
00352             #define _CJX_MESSAGE "Automatically linking with CJ609Lib.dll"
00353         #endif
00354     #endif
00355 #else
00356     #ifdef _DEBUG
00357         #if defined(_UNICODE)
00358             #define _CJX_COMMENT "CJ609LibStaticud.lib"
00359             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticud.lib"
00360         #else
00361             #define _CJX_COMMENT "CJ609LibStaticd.lib"
00362             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticd.lib"
00363         #endif
00364     #else
00365         #if defined(_UNICODE)
00366             #define _CJX_COMMENT "CJ609LibStaticu.lib"
00367             #define _CJX_MESSAGE "Automatically linking with CJ609LibStaticu.lib"
00368         #else
00369             #define _CJX_COMMENT "CJ609LibStatic.lib"
00370             #define _CJX_MESSAGE "Automatically linking with CJ609LibStatic.lib"
00371         #endif
00372     #endif
00373 #endif
00374
00375 #pragma comment(lib, _CJX_COMMENT)
00376 #pragma message(_CJX_MESSAGE)
00377
00378 #endif // __CJLIBRARY_H__
Generated on Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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: 2002/06/15 17:49:37 $
00009  * $Revision: 1.2 $
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(NMHDR* pNMPGScroll, LRESULT * pResult);
00174     virtual BOOL OnPagerCalcSize(NMHDR * 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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:09:07 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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 Fri Jan 31 12:12:05 2003 for WinCvs Source by doxygen 1.3-rc2


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.

00074                          {
00075     BT_DIRECTORY = 1,
00076     BT_FILE      = 2,
00077     BT_POPUPMENU = 3
00078 };

Generated on Fri Jan 31 12:12:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 CCJCaption::Create(), and CCJCaption::DrawCaptionBack().

Generated on Fri Jan 31 12:12:06 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#define CM_ONPUSHPINCANCEL WM_USER + 1002

Definition at line 59 of file CJCaptionPopupWnd.h.

Generated on Fri Jan 31 12:12:07 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References ASSERT, DDX_CJColorPicker(), CCJColorPicker::GetColor(), 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 Fri Jan 31 12:12:08 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#define CPN_DROPDOWN WM_USER + 1002

Definition at line 56 of file CJColorPopup.h.

#define CPN_SELCHANGE WM_USER + 1001

Definition at line 55 of file CJColorPopup.h.

#define CPN_SELENDCANCEL WM_USER + 1005

Definition at line 59 of file CJColorPopup.h.

Referenced by CCJColorPopup::EndSelection().

#define CPN_SELENDOK WM_USER + 1004

Definition at line 58 of file CJColorPopup.h.

Generated on Fri Jan 31 12:12:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:08 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and CCJSizeDockBar::OnNcLButtonDown().

#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(), and CCJFrameWnd::EnableDockingSizeBar().

Generated on Fri Jan 31 12:12:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 1076 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJDateTimeCtrl::SetRange().

01078 {
01079     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01080     CCJDateTimeCtrl* pWnd =
01081 #if _MFC_VER >= 0x700
01082         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01083 #else
01084         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01085 #endif
01086
01087     if (!pDX->m_bSaveAndValidate)
01088     {
01089         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01090               (pMaxRange != NULL && *pMaxRange < refValue))
01091         {
01092 #if _MFC_VER >= 0x700
01093             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01094 #else
01095             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01096 #endif
01097             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01098             return;     // don't stop now
01099         }
01100     }
01101
01102     pWnd->SetRange(pMinRange, pMaxRange);
01103 }

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 #if _MFC_VER >= 0x700
01051         (CCJDateTimeCtrl*) pDX->m_pDlgWnd;
01052 #else
01053         (CCJDateTimeCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01054 #endif
01055
01056     if (!pDX->m_bSaveAndValidate)
01057     {
01058         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01059               (pMaxRange != NULL && *pMaxRange < refValue))
01060         {
01061 #ifdef _DEBUG
01062 #if _MFC_VER >= 0x700
01063             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01064 #else
01065             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01066 #endif
01067             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01068 #endif
01069             return;     // don't stop now
01070         }
01071     }
01072
01073     pWnd->SetRange(pMinRange, pMaxRange);
01074 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | COleDateTime & | refValue,
 |  | const COleDateTime * | pMinRange,
 |  | const COleDateTime * | pMaxRange
 | ) |

Definition at line 1136 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJMonthCalCtrl::SetRange().

01138 {
01139     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01140     CCJMonthCalCtrl* pWnd =
01141 #if _MFC_VER >= 0x700
01142         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01143 #else
01144         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01145 #endif
01146
01147     if (!pDX->m_bSaveAndValidate)
01148     {
01149         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01150               (pMaxRange != NULL && *pMaxRange < refValue))
01151         {
01152 #ifdef _DEBUG
01153 #if _MFC_VER >= 0x700
01154             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01155 #else
01156             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01157 #endif
01158             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01159 #endif
01160             return;     // don't stop now
01161         }
01162     }
01163
01164     pWnd->SetRange(pMinRange, pMaxRange);
01165 }

void AFXAPI DDV_CJMinMaxMonth | ( | CDataExchange * | pDX,
 |  | CTime & | refValue,
 |  | const CTime * | pMinRange,
 |  | const CTime * | pMaxRange
 | ) |

Definition at line 1105 of file CJDateTimeCtrl.cpp.

References ASSERT, NULL, and CCJMonthCalCtrl::SetRange().

01107 {
01108     ASSERT(pMinRange == NULL || pMaxRange == NULL || *pMinRange <= *pMaxRange);
01109     CCJMonthCalCtrl* pWnd =
01110 #if _MFC_VER >= 0x700
01111         (CCJMonthCalCtrl*) pDX->m_pDlgWnd;
01112 #else
01113         (CCJMonthCalCtrl*) CWnd::FromHandle(pDX->m_hWndLastControl);
01114 #endif
01115
01116     if (!pDX->m_bSaveAndValidate)
01117     {
01118         if ( (pMinRange != NULL && *pMinRange > refValue) ||
01119               (pMaxRange != NULL && *pMaxRange < refValue))
01120         {
01121 #ifdef _DEBUG
01122 #if _MFC_VER >= 0x700
01123             int nIDC = GetWindowLong(*pDX->m_pDlgWnd, GWL_ID);
01124 #else
01125             int nIDC = GetWindowLong(pDX->m_hWndLastControl, GWL_ID);
01126 #endif
01127             TRACE1("Warning: initial dialog data is out of range in control ID %d.\n", nIDC);
01128 #endif
01129             return;     // don't stop now
01130         }
01131     }
01132
01133     pWnd->SetRange(pMinRange, pMaxRange);
01134 }

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 }

Generated on Fri Jan 31 12:12:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 369 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 370 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 335 of file CJLibrary.h.

#define _VC_VERSION_5

Definition at line 90 of file CJLibrary.h.

Generated on Fri Jan 31 12:12:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:19 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:12:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:21 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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 Fri Jan 31 12:12:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:23 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Generated on Fri Jan 31 12:12:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:25 2003 for WinCvs Source by doxygen 1.3-rc2


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.

#define ID_GFX_RENAMEITEM 5021

Definition at line 40 of file CJResource.h.

#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.

#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.

#define IDB_PUSHPIN 5030

Definition at line 49 of file CJResource.h.

#define IDC_BAR_BUTTON 5014

Definition at line 31 of file CJResource.h.

#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.

#define IDC_BUTTON_MINI 5013

Definition at line 29 of file CJResource.h.

#define IDC_CAPT_BUTTON 5029

Definition at line 48 of file CJResource.h.

#define IDC_DRAGGING 5003

Definition at line 10 of file CJResource.h.

#define IDC_ENDBUTTON 5034

Definition at line 53 of file CJResource.h.

#define IDC_HANDCUR 5005

Definition at line 13 of file CJResource.h.

#define IDC_HOMEBUTTON 5033

Definition at line 52 of file CJResource.h.

#define IDC_HSPLITBAR 5022

Definition at line 41 of file CJResource.h.

#define IDC_LEFTBUTTON 5031

Definition at line 50 of file CJResource.h.

#define IDC_NODRAGGING 5001

Definition at line 7 of file CJResource.h.

#define IDC_RIGHTBUTTON 5032

Definition at line 51 of file CJResource.h.

#define IDC_TAB_CONTROL 5007

Definition at line 17 of file CJResource.h.

#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.

#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.

#define IDR_POPUP_HEX_EDIT 103

Definition at line 5 of file CJResource.h.

#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.

#define IDS_COLOR_CUST 5011

Definition at line 26 of file CJResource.h.

#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::OnUpdateCmdUI().

#define IDS_HIDE 5000

Definition at line 6 of file CJResource.h.

#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.

#define IDS_RENAMEITEM 5015

Definition at line 34 of file CJResource.h.

#define IDS_SECTION 5012

Definition at line 28 of file CJResource.h.

#define IDS_SETTINGS 5025

Definition at line 44 of file CJResource.h.

#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.

#define IDS_WNDPOS 5028

Definition at line 47 of file CJResource.h.

Generated on Fri Jan 31 12:12:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 | 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().

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 Fri Jan 31 12:12:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:30 2003 for WinCvs Source by doxygen 1.3-rc2


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().

#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.

#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 _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 }

HBITMAP AFXAPI _LoadSysColorBitmap | ( | HINSTANCE | hInst,
 |  | HRSRC | hRsrc,
 |  | BOOL | bMono = FALSE
 | ) |

Definition at line 141 of file CJToolBar.cpp.

References _CLR_TO_RGBQUAD, _RGB_TO_RGBQUAD, _sysColorMap, CJX_COLORMAP::iSysColorTo, NULL, and CJX_COLORMAP::rgbqFrom.

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.

Referenced by _GetComCtlVersion(), CCJToolBar::GetButtonSize(), CCJToolBar::OnNcCalcSize(), CCJToolBar::OnPreserveZeroBorderHelper(), CCJToolBar::OnSetSizeHelper(), and CCJToolBar::SetButtons().

Generated on Fri Jan 31 12:12:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 | Color_Font

Generated on Fri Jan 31 12:12:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 | CBarFolder
class | 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.

#define NM_OB_DRAGITEM 4

Definition at line 46 of file GfxOutBarCtrl.h.

#define NM_OB_ITEMCLICK 1

Definition at line 43 of file GfxOutBarCtrl.h.

#define NM_OB_ITEMHOVER 6

Definition at line 48 of file GfxOutBarCtrl.h.

#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.

Generated on Fri Jan 31 12:12:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:35 2003 for WinCvs Source by doxygen 1.3-rc2


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

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.

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]

virtual HRESULT STDMETHODCALLTYPE CheckinFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE CheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE CloseProject ( int handle ) [pure virtual]

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]

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]

virtual HRESULT STDMETHODCALLTYPE GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) | [pure virtual]

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]

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.

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.

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.

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.

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.

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.

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]

virtual HRESULT STDMETHODCALLTYPE RenameFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE ShowFileHistory | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE ShowFileProperties | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE ShowUserInterface | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE UncheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

virtual HRESULT STDMETHODCALLTYPE UpdateFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bDirectories,
 |  | BOOL | bRecurse
 | ) | [pure virtual]

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.

Generated on Fri Jan 31 12:12:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:39 2003 for WinCvs Source by doxygen 1.3-rc2


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

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.

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_AddFiles_Stub().

virtual HRESULT STDMETHODCALLTYPE CheckinFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames,
 |  | BOOL | bKeepCheckedOut
 | ) | [pure virtual]

Referenced by ICvsCoworker_CheckinFiles_Stub().

virtual HRESULT STDMETHODCALLTYPE CheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_CheckoutFiles_Stub().

virtual HRESULT STDMETHODCALLTYPE CloseProject ( int handle ) [pure virtual]

Referenced by ICvsCoworker_CloseProject_Stub().

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_DiffFile_Stub().

virtual HRESULT STDMETHODCALLTYPE GetErrorMessage | ( | int | handle,
 |  | int | iError,
 |  | int | cbErrorBuffer,
 |  | unsigned char __RPC_FAR * | sErrorBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetErrorMessage_Stub().

virtual HRESULT STDMETHODCALLTYPE GetFileChanges | ( | int | handle,
 |  | int | cbFilenameBuffer,
 |  | unsigned char __RPC_FAR * | sFilenameBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetFileChanges_Stub().

virtual HRESULT STDMETHODCALLTYPE GetFilesToAdd | ( | int | handle,
 |  | int | cbFilenamesBuffer,
 |  | unsigned char __RPC_FAR * | sFilenamesBuffer
 | ) | [pure virtual]

Referenced by ICvsCoworker_GetFilesToAdd_Stub().

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]

Referenced by ICvsCoworker_GetProject_Stub().

virtual HRESULT STDMETHODCALLTYPE HasAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command,
 |  | BOOL __RPC_FAR * | pbAdvancedOptions
 | ) | [pure virtual]

Referenced by ICvsCoworker_HasAdvancedOptionsForCommand_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.

References __MIDL_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, AddFiles(), _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, CheckinFiles(), _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, CheckoutFiles(), _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, and _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 __MIDL_ProcFormatString, 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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, DiffFile(), _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, and _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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, and _MIDL_TYPE_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_ProcFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, and _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_ProcFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_TYPE_FORMAT_STRING::Format, and _MIDL_PROC_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_ProcFormatString, __MIDL_TypeFormatString, _MIDL_PROC_FORMAT_STRING::Format, _MIDL_TYPE_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 }

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]

Referenced by ICvsCoworker_OpenProject_Stub().

virtual HRESULT STDMETHODCALLTYPE RemoveFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_RemoveFiles_Stub().

virtual HRESULT STDMETHODCALLTYPE RenameFile | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sOldFilename,
 |  | const unsigned char __RPC_FAR * | sNewFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_RenameFile_Stub().

virtual HRESULT STDMETHODCALLTYPE ShowAdvancedOptionsForCommand | ( | int | handle,
 |  | CvsCommand | command
 | ) | [pure virtual]

Referenced by ICvsCoworker_ShowAdvancedOptionsForCommand_Stub().

virtual HRESULT STDMETHODCALLTYPE ShowFileHistory | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_ShowFileHistory_Stub().

virtual HRESULT STDMETHODCALLTYPE ShowFileProperties | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilename
 | ) | [pure virtual]

Referenced by ICvsCoworker_ShowFileProperties_Stub().

virtual HRESULT STDMETHODCALLTYPE ShowUserInterface | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_ShowUserInterface_Stub().

virtual HRESULT STDMETHODCALLTYPE UncheckoutFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | sFilenames
 | ) | [pure virtual]

Referenced by ICvsCoworker_UncheckoutFiles_Stub().

virtual HRESULT STDMETHODCALLTYPE UpdateFiles | ( | int | handle,
 |  | const unsigned char __RPC_FAR * | 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 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.

Generated on Fri Jan 31 12:12:41 2003 for WinCvs Source by doxygen 1.3-rc2


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_ProcFormatString, __MIDL_TypeFormatString, _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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, 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_ProcFormatString, __MIDL_TypeFormatString, _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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, 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_ProcFormatString, __MIDL_TypeFormatString, _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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, 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_ProcFormatString, and _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 __MIDL_ProcFormatString, 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_ProcFormatString, __MIDL_TypeFormatString, _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 __MIDL_ProcFormatString, __MIDL_TypeFormatString, 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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, and _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, and _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_ProcFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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_ProcFormatString, __MIDL_TypeFormatString, _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 2937 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().

const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString

Definition at line 3172 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().

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 2845 of file CVS_Coworker_p.c.

Generated on Fri Jan 31 12:12:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:45 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by CvsProject::CvsProject(), and CvsProject::FindProject().

Generated on Fri Jan 31 12:12:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:46 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:12:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:47 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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().

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 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.

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.

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 LogSetFilter().

const char sHex[] = "0123456789ABCDEF" [static]

Definition at line 144 of file CvsTrace.cpp.

Referenced by LogBuffer().

Generated on Fri Jan 31 12:12:48 2003 for WinCvs Source by doxygen 1.3-rc2


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(), CDiff_MAIN::CDiff_MAIN(), CheckBuffer(), CCJToolBar::CheckButton(), CvsCoworker::CheckinFiles(), CvsCoworker::CheckoutFiles(), CCJToolBar::CommandToIndex(), CCJSortClass::Compare(), CSelectionDetailsDlg::CompareItems(), CItemListDlg::CompareItems(), CDiff_Options::CompareItems(), CompareTargetDate(), CompatGetDiff(), 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(), CDiff_MAIN::EnableCompareType(), 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(), GetDateTime(), 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(), CItemListDlg::GetImageForItem(), 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(), COptionalPropertySheet::GetOptionCheckRect(), 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(), KiSelectionHandler::GetSelection(), 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(), glue_getenv(), 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(), CItemListDlg::InitListCtrl(), 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(), LaunchItemListCommand(), 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::OnCmdExplore(), 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(), CItemListDlg::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(), CItemListDlg::OnSelchangeAutoRefresh(), 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(), UCvsFolders::ProcessSelectionCommand(), 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(), SetListCtrlExtendedStyle(), 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.

References AddIndent(), AddPrefix(), ASSERT, InFilter(), IS_LOGGING, and LogWrite().

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.

References InFilter(), IS_LOGGING, Log_printf(), LogWrite(), and sHex.

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.

Referenced by CWincvsApp::ExitInstance().

00077 {
00078 }

void LogInitialize ( LPCSTR )

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 * )

Definition at line 19 of file CvsTrace.cpp.

References g_sFilter, and strdup().

00020 {
00021     g_sFilter = strdup(s);
00022 }

void LogString | ( | const char * | ,
 |  | const char * |
 | ) |

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 }

Generated on Fri Jan 31 12:12:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:12:49 2003 for WinCvs Source by doxygen 1.3-rc2


resrc1.h File Reference

WinCvs/res/resrc1.h File Reference

Go to the source code of this file.

Generated on Fri Jan 31 12:13:02 2003 for WinCvs Source by doxygen 1.3-rc2


Annotated Index

WinCvs Source Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
_afxRichEditCookie |
_CvsProcess | Structure to hold the cvs process info
_CvsProcessStartupInfo | Structure to hold the cvs startup information
_dircontents |
_dirdesc |
_frameRec |
_IID |
_MIDL_PROC_FORMAT_STRING |
_MIDL_TYPE_FORMAT_STRING |
_sDiffOptionsItem | Define the diff options list items
_WireHandler |
_WireMessage |
CAboutDlg |
AddBinCvsArgs | Class to add binary files
AddCvsArgs | Class to add files
AddUnicodeCvsArgs | Class to add Unicode files
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 |
UAuthen_Sspi |
AuthenGserver |
AuthenKserver |
AuthenLocal |
AuthenModel | Authentication model class
AuthenNtserver |
AuthenPserver |
AuthenRhosts |
AuthenServer |
CAuthenSetUp | Class to setup authentication model and proper environment
AuthenSSH |
AuthenSspi |
awidget |
CBarConsole |
CBrowseFileView |
CBrowserBar |
UBrush |
CBuffer |
CButton |
CCharFormat | Character format wrapper class
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 | Command line settings property page
UCmdTarget |
CCmdUI |
UCmdUI |
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 | Base class for cvs process console
UCvsFiles |
UCvsFolders |
UCvsFrame |
UCvsGraph |
UCvsMenubar |
CCvsStatusBar |
CCvsThreadLock | Critical section to protect while accessing MFC from cvs
UCvsToolbar |
UDC |
CDestroyThreadLock | Critical section used when destroying cvs process
CDialog |
CDiff_MAIN |
CDiff_Options |
CDiff_Options::CompareInfo | Structure to hold the sorting settings
direct |
CDockBar |
CDockContext |
CDocument |
Wincvs::Document |
DROPDOWNBUTTON |
CDummyClass |
CDummyInit | Use the runtime to initialize/delete a critical section
DYN_LIST |
CDynToolBar |
CEdit |
UEditMessage |
CEditorMonDlg |
ENTNODE | Allow reference of a file or a folder node
EntnodeData |
EntnodeFile |
EntnodeFolder |
EntnodePath |
CExploreBar |
CFileDialog |
FileEntry | Used internally
CFillPyEntries |
CFillTclEntries |
CFindSettings |
CFormView |
CFrameWnd |
garbyRec |
GetPassword |
CGetPrefs_CVS | CVS preferences property page
CGetPrefs_CVSCMD_DIALOGS | Command dialogs preferences property page
CGetPrefs_CVSROOT | General preferences property page
CGetPrefs_GLOBALS | Global preferences property page
CGetPrefs_WINCVS | WinCvs preferences property page
GetValue |
CGfxGroupEdit |
CGfxOutBarCtrl |
CGfxOutBarCtrl::CBarFolder |
CGfxOutBarCtrl::CBarItem |
CGfxSplitterWnd |
GPT_CONSOLE |
GPT_GETENV |
GPT_QUIT |
CGraphConsole | Graph console
CGraphDoc | Graph document class
CGraphFrame |
CGraphOptDlg |
CGraphRectTracker | Graph rectangle tracker
CGraphView | Graph view class
CHARFORMAT |
CHeaderCtrl |
CHistComboBoxEx |
ICvsCoworker |
ICvsCoworker |
CImport_MAIN |
CImport_OPTIONS |
CImportEntry |
CImportFilterDlg |
ImportReport | Class to traverse and detect conflicts or warnings for import
CImportWarning |
CInit_MAIN |
irciiAttrCvt |
ISupportErrorInfo |
ItemDisplayInfo | Class to hold and support data display (e.g. sorting or storing the result for next display)
CItemListConsole | Base class for item list console
CItemListDlg |
CItemListDlg::CompareInfo | Structure to hold the sorting settings
ItemRowInfo | Structure to hold item's row information
IUnknown |
Wincvs::IWincvs |
CJX_COLORMAP |
CJX_CONTROLPOS |
CKeyString |
CKeywordComboBox |
keywordMode | Structure to hold the keyword modes and their descriptions
KiColumn | Column descriptor interface
KiColumnModel | Columnar model of the data
KiFilterModel |
KiIgnoreModel |
KiRecursionModel |
KiSelectionHandler | Interface describing a handler to process a selection-related command
KoAddBinaryHandler | Handles binary addition of the selected items
KoAddHandler | Handles addition of the selected items
KoAddUnicodeHandler | Handles unicode addition of the selected items
KoAnnotateHandler | Handles annotate on the selected items
KoBranchTagHandler | Handles branch request on the selected items
KoCancelChangesHandler | Handles cancel changes on the selected items
KoCheckoutHandler | Handles Checkout
KoColumnContext | Context in which a column is accessed
KoCommandLineHandler | Handles Command Line
KoCommitHandler | Handles commits of the selected items
KoConflictColumn | Conflict column
KoCreateTagHandler | Handles create tag request on the selected items
KoDateColumn | Date column
KoDeleteTagHandler | Handles delete tag request on the selected items
KoDiffHandler | Handles diffing on the selected items
KoEditHandler | Handles edit start request on the selected items
KoEditorsHandler | Handles editors on the selected items
KoFileRemoveHandler | Handles file remove requests
KoFilterModel |
KoForceEditHandler | Handles force edit start request on the selected items
KoGraphDiffHandler | Handles diffing on the selected items
KoGraphHandler | Handles graph log queries on the selected items
KoIgnoreModel |
KoImportHandler | Handles Import
KoLockHandler | Handles locking on the selected items
KoLogHandler | Handles log queries on the selected items
KoMoveToTrashHandler | Handles moving files to trash
KoNameColumn | Name column
KoOptionColumn | Option column
KoPathColumn | Path column
KoQueryUpdateHandler | Handles query updates on the selected items
KoRecursionModel |
KoRecursiveModel | Recursive columnar model
KoRegularModel | Regular columnar model
KoReleaseHandler | Handles releasing on the selected items
KoReservedEditHandler | Handles reserved edit start request on the selected items
KoRevisionColumn | Revision column
KoRtagBranchHandler | Handles Rtag Branch
KoRtagCreateHandler | Handles Rtag Create
KoRtagDeleteHandler | Handles Rtag Delete
KoStatusColumn | Status column
KoStatusHandler | Handles status queries on the selected items
KoTagColumn | Tag column
KoTraversalContext | Context for traversing
KoUneditHandler | Handles edit stop request on the selected items
KoUnlockHandler | Handles unlocking on the selected items
KoUpdateHandler | Handles updates on the selected items
KoUpdateMoveToTrashHandler | Handles figuring out if moving files to trash is enabled
KoWatcher |
KoWatchersHandler | Handles watchers on the selected items
KoWatchOffHandler | Handles watch off on the selected items
KoWatchOnHandler | Handles watch on on the selected items
LAttachment |
LBevelButton |
LCommander |
ULIST_INFO |
ULIST_INSERT |
CListBox |
CListCtrl |
CListParserConsole | Class to parse directories/files (obtained using cvs ls)
CListView |
LListener |
LMainPseudoAttachment |
CLogFilters | Filters log dialog
CLogFrame |
CLogin_MAIN |
CLogMain | Main log dialog
CLogNodeData |
CLogoutThread | Class to handle auto-logout
LOutlineItem |
LOutlineTable |
LPane |
LPeriodical |
LPlaceHolder |
LPseudoDrawAttachment |
LPseudoWinAttachment |
LSReport |
UMacAppMenu |
CMacBinItem |
MACBINMAP |
MACBINMAPENTRIES |
MacBinMaps |
CMacBinTable |
CMacroEntry |
CMacroSet |
MacroTraversal |
CMainFrame |
CMapPtrToPtr |
match_dir | Helper functor to compare MultiFilesEntry by directory path
CMDIChildWnd |
CMDIFrameWnd |
CMemFile |
CMenu |
UMenu |
CMenuItemInfo |
UMessageMapFunctions |
CMfFileDialog | Multi-selection file dialog wrapper class
CMiniDockFrameWnd |
mircAttrCvt |
CMMenuString |
CModuleParserConsole | Class to parse modules (obtained using cvs co -c)
CMPString |
CMsg |
UMSGMAP |
UMSGMAP_ENTRY |
CMString |
MultiFiles | Store multiple files by directory
MultiFilesEntry | Used internally
MultiFilesEntryIndex | A pair of MultiFiles::const_iterator and index allowing to identify the FileEntry
CMyShellTree |
CNoPython |
NotificationManager |
NotificationManager::Node |
CObject |
UObject |
ColorTableEntry |
ControlCvsArgs | Base class for control arguments used by add commands (added files are tested appropriate)
option |
COptionalPropertySheet |
OUTBAR_INFO |
CPathBuffer | Support class to handle the selection buffer
PCPStr |
PCStr |
UPen |
CPersistent | Abstract class to access the persistent data to load/save
CPersistent::CPersistentEntry |
CPersistentBool | bool type persistant specialization
CPersistentInt | int type persistant specialization
CPersistentT< T > | Template class for persistant values
UPoint |
UPOINT |
poolRec |
UPPMenu |
CProgress | Progress indicator wrapper class
CProgressDlg | Progress dialog, should be dynamically allocated
UPromptMessage |
CPropertyPage |
CPropertySheet |
CPseudoButton |
UPseudoCmdStatusWrapper |
CPseudoDlg |
CPseudoDraw |
UPseudoFakePane |
CPseudoItem |
CPseudoList |
UPseudoPageHider |
UPseudoPlaceHolder |
UPseudoRotButton |
CPseudoRotButton |
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 | Class to prevent the recursive calls
CRelease_MAIN |
RemoveCvsArgs | Class to remove files
ReportConflict | Class to represent file type and help handle possible import conflicts
ReportWarning | Class to represent a warning (wrong line feed, escape characters etc.) and a set of files which illustrates this warning
CRevisionConsole | Console used to retrieve a specific revision
CRichEditView |
CRtag_MAIN |
CRtag_OPTIONS |
URuntimeClass |
USaveSettings |
CScrollView |
CSelectionChangeNotifier |
CSelectionDetailsDlg |
CSelectionDetailsDlg::CompareInfo | Structure to hold the sorting settings
SelectionDisplayInfo | Class to hold and support data display (e.g. sorting)
USemaphore |
USIZE |
USize |
USLIDER |
USmartCombo |
CSmartComboBox |
CSortHeaderCtrl |
CSortList< T > |
CSortParam | Sort parameters
CSplashWnd |
CSplitterWnd |
CStackThreadLock | Critical section used for cvs process stack operations
CStatic |
CStaticAllocT< T > |
CStatus_MAIN |
CStatusBar |
UStr | C string class
CStreamConsole | Class to implement stream console
CSubclassWnd |
CSubclassWndMap |
CTabCtrl |
TAdorner |
CTag_MAIN |
tagCTV_ITEM |
tagMENUITEMINFOA |
CTagParserConsole | Class to parse tags/branches (obtained using cvs log or cvs rlog)
tagTCB_ITEM |
UTB_BUTTON |
UTB_DROPDOWN |
UTB_INIT |
CTbEdit |
TBehavior |
TbEntry |
TbEntryButton |
TbEntryChkButton |
TbEntryDropDown |
TbEntrySeparator |
TBrowserFill | Class to create an item with all the subdirectories inside for a given path and a root item
TBrowserFillDummy | Class to create an item with a dummy item inside if and only if the folder is not empty
TBuggyPopup |
CTcl_Interp |
CTCLBrowserEnt |
CTCLCvsConsole |
CTCP2Parse |
CTCP2Parse::RGBColor |
TEditText |
CTempToggleBool |
TGraph | Base traverse class
TGraphCmdStatus | Graph command status class
TGraphDelCmd | Graph command delete revisions class
TGraphRectSelect | Graph traverse class
TGraphSelNonSig | Select non-significant revisions
TIconButton |
TIconCheckBox |
TIconPopup |
UTimer | Used by the UWidget class to implement timers/repeaters
CTipDlg |
TMPersistent< T > |
CTmpFiles | Class to support the clean up of any temporary files created
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 | Fill the view
CUpdateMain |
CUpdateMerge |
CUpdateSticky |
CustInvertTable |
vector |
CView |
CViewInfo |
CvsArgs | Class to handle cvs arguments, append "cvs" and misc options defined by preferences ("-z9" for example)
CvsCoworker |
CVS_COWORKERLib::CvsCoworker |
CvsFilenames |
CvsPrefs |
CvsProcessCallbacks | Structure to hold cvsgui protocol callbacks
CvsProject |
CvsString |
CvsTrace |
UWaitCursor |
UWidget | This is the pseudo widget class
Win32wstring |
CWinApp |
CWincvsApp |
CWinCvsBrowser |
CWincvsDoc |
CWincvsView | Console window class
WINDOWPLACEMENT |
WININFO |
CWinLogBranchData | Windows log branch node data
CWinLogData | Windows log data abstract class
CWinLogHeaderData | Windows log header node data
CWinLogRevData | Windows log revision node data
CWinLogTagData | Windows log tag node data
CWinPlacement |
CWinThread |
CWnd |
CWndRedrawMngr | Class to support efficient drawing of CWnd based windows by managing window's redraw
wnt_stat |
wstring |
Generated on Fri Jan 31 12:13:18 2003 for WinCvs Source by doxygen 1.3-rc2


_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 154 of file wincvsDoc.cpp.

00154 : m_ar(ar) {m_dwError=0;}

Member Data Documentation

CArchive& _afxRichEditCookie::m_ar

Definition at line 152 of file wincvsDoc.cpp.

Referenced by EditStreamCallBack().

DWORD _afxRichEditCookie::m_dwError

Definition at line 153 of file wincvsDoc.cpp.

Referenced by EditStreamCallBack().

The documentation for this class was generated from the following file:
  • WinCvs/wincvsDoc.cpp
Generated on Fri Jan 31 12:13:19 2003 for WinCvs Source by doxygen 1.3-rc2


_CvsProcess Struct Reference

Structure to hold the cvs process info. More...

#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
DWORD | threadID
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]
HANDLE | stopProcessEvent

Detailed Description

Structure to hold the cvs process info.

Definition at line 50 of file cvsgui_process.h.

Member Data Documentation

int _CvsProcess::argc

Definition at line 61 of file cvsgui_process.h.

Referenced by cvs_process_destroy(), cvs_process_new(), and cvs_process_run().

char** _CvsProcess::args

Process command line arguments

Definition at line 60 of file cvsgui_process.h.

Referenced by cvs_process_destroy(), cvs_process_new(), and cvs_process_run().

CvsProcessCallbacks* _CvsProcess::callbacks

Jump table

Definition at line 75 of file cvsgui_process.h.

Referenced by cvs_process_handle_message(), cvs_process_new(), cvs_process_run(), GetChldError(), and GetChldOutput().

unsigned int _CvsProcess::destroy

Flag to indicate whether the process should be destroyed

Definition at line 53 of file cvsgui_process.h.

Referenced by cvs_process_destroy(), and cvs_process_new().

pipe_t _CvsProcess::his_read

Process read file descriptor

Definition at line 66 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), and cvs_process_run().

pipe_t _CvsProcess::his_write

Process write file descriptor

Definition at line 67 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), and cvs_process_run().

pipe_t _CvsProcess::my_read

Application read file descriptor

Definition at line 63 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), cvs_process_recv_message(), cvs_process_run(), and ServeProtocol().

pipe_t _CvsProcess::my_write

Application write file descriptor

Definition at line 64 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_handle_message(), cvs_process_new(), and cvs_process_run().

unsigned int _CvsProcess::open

Flag to indicate if the process is open

Definition at line 52 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), cvs_process_recv_message(), and ServeProtocol().

pid_t _CvsProcess::pid

Process process id

Definition at line 58 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), cvs_process_terminate(), and MonitorChld().

pipe_t _CvsProcess::pstderr

Tty stderr descriptor used by the child

Definition at line 71 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), and GetChldError().

pipe_t _CvsProcess::pstdin

Tty stdin descriptor used by the child

Definition at line 69 of file cvsgui_process.h.

Referenced by cvs_process_close(), and cvs_process_new().

pipe_t _CvsProcess::pstdout

Tty stdout descriptor used by the child

Definition at line 70 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), and GetChldOutput().

unsigned int _CvsProcess::starting

Flag to indicate whether the process starting or not

Definition at line 55 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_new(), and ServeProtocol().

HANDLE _CvsProcess::stopProcessEvent

Stop command request event

Definition at line 81 of file cvsgui_process.h.

Referenced by cvs_process_destroy(), cvs_process_new(), cvs_process_stop(), and MonitorChld().

DWORD _CvsProcess::threadID

Process thread ID

Definition at line 56 of file cvsgui_process.h.

Referenced by cvs_process_new(), and cvs_process_terminate().

HANDLE _CvsProcess::threads[4]

Protocol thread's handles

Definition at line 78 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_destroy(), and cvs_process_new().

DWORD _CvsProcess::threadsID[4]

Protocol thread's IDs

Definition at line 79 of file cvsgui_process.h.

Referenced by cvs_process_close(), cvs_process_destroy(), and cvs_process_new().

char _CvsProcess::write_buffer[ 512 ]

Buffer for writing

Definition at line 73 of file cvsgui_process.h.

Referenced by cvs_process_pop(), and cvs_process_push().

int _CvsProcess::write_buffer_index

Buffer index for writing

Definition at line 74 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 Fri Jan 31 12:13:19 2003 for WinCvs Source by doxygen 1.3-rc2


_CvsProcessStartupInfo Struct Reference

Structure to hold the cvs startup information. More...

#include <cvsgui_process.h>

Collaboration diagram for _CvsProcessStartupInfo:

[legend]
List of all members.

Public Methods

_CvsProcessStartupInfo ()

Public Attributes

int | hasTty
const char * | currentDirectory

Detailed Description

Structure to hold the cvs startup information.

Definition at line 86 of file cvsgui_process.h.

Constructor & Destructor Documentation

_CvsProcessStartupInfo::_CvsProcessStartupInfo ( ) [inline]

Definition at line 92 of file cvsgui_process.h.

References NULL.

00093     {
00094         hasTty = false;
00095         currentDirectory = NULL;
00096     }

Member Data Documentation

const char* _CvsProcessStartupInfo::currentDirectory

Working directory for cvs process

Definition at line 89 of file cvsgui_process.h.

Referenced by cvs_process_run(), and launchCVS().

int _CvsProcessStartupInfo::hasTty

Flag to indicate that the child process has a TTY (console)

Definition at line 88 of file cvsgui_process.h.

Referenced by cvs_process_run(), and launchCVS().

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.h
Generated on Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


_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 Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


_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 Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


_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 Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


_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[8]

Definition at line 28 of file CVS_Coworker_i.c.

unsigned short _IID::s1

Definition at line 26 of file CVS_Coworker_i.c.

unsigned short _IID::s2

Definition at line 27 of file CVS_Coworker_i.c.

unsigned long _IID::x

Definition at line 25 of file CVS_Coworker_i.c.

The documentation for this struct was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker_i.c
Generated on Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


_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[ 151 ]

Definition at line 40 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 39 of file CVS_Coworker_p.c.

The documentation for this struct was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker_p.c
Generated on Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


_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[ 65 ]

Definition at line 34 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 33 of file CVS_Coworker_p.c.

The documentation for this struct was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker_p.c
Generated on Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


_sDiffOptionsItem Struct Reference

Define the diff options list items. More...

Collaboration diagram for _sDiffOptionsItem:

[legend]
List of all members.

Public Attributes

const char * | option
Option.

const char * | description
Option description.

Detailed Description

Define the diff options list items.

Definition at line 180 of file DiffDlg.cpp.

Member Data Documentation

const char* _sDiffOptionsItem::description

Option description.

Definition at line 182 of file DiffDlg.cpp.

Referenced by CDiff_Options::CompareItems().

const char* _sDiffOptionsItem::option

Option.

Definition at line 181 of file DiffDlg.cpp.

Referenced by CDiff_Options::CompareItems(), and CDiff_Options::OnInitDialog().

The documentation for this struct was generated from the following file:
  • common/DiffDlg.cpp
Generated on Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


_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 Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


_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 Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


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

CCJHyperLink m_CvsGuiSfUrl
CCJHyperLink m_WinCvsUrl
CString | m_vers

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 688 of file wincvs.cpp.

00688 { IDD = IDD_ABOUTBOX };

Constructor & Destructor Documentation

CAboutDlg::CAboutDlg ( )

Definition at line 708 of file wincvs.cpp.

References CStr, CWincvsApp::GetAppVersion(), and m_vers.

00708                      : CDialog(CAboutDlg::IDD)
00709 {
00710     //{{AFX_DATA_INIT(CAboutDlg)
00711     m_vers = _T("WinCvs ");
00712     //}}AFX_DATA_INIT
00713
00714     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00715     CStr vers;
00716
00717     if(app->GetAppVersion(vers))
00718     {
00719         m_vers = vers;
00720     }
00721 }

Member Function Documentation

void CAboutDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 734 of file wincvs.cpp.

00735 {
00736     CDialog::DoDataExchange(pDX);
00737     //{{AFX_DATA_MAP(CAboutDlg)
00738     DDX_Control(pDX, IDC_CVSGUISFURL, m_CvsGuiSfUrl);
00739     DDX_Control(pDX, IDC_WINCVSURL, m_WinCvsUrl);
00740     DDX_Text(pDX, IDC_WINCVSVER, m_vers);
00741     //}}AFX_DATA_MAP
00742 }

BOOL CAboutDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 723 of file wincvs.cpp.

References m_CvsGuiSfUrl, m_WinCvsUrl, CCJHyperLink::SetURL(), and TRUE.

00724 {
00725     CDialog::OnInitDialog();
00726
00727     m_WinCvsUrl.SetURL(_T("http://www.wincvs.org"));
00728     m_CvsGuiSfUrl.SetURL(_T("http://cvsgui.sourceforge.net/"));
00729
00730     return TRUE;  // return TRUE unless you set the focus to a control
00731                   // EXCEPTION: OCX Property Pages should return FALSE
00732 }

Member Data Documentation

CCJHyperLink CAboutDlg::m_CvsGuiSfUrl

Definition at line 689 of file wincvs.cpp.

Referenced by OnInitDialog().

CString CAboutDlg::m_vers

Definition at line 691 of file wincvs.cpp.

Referenced by CAboutDlg().

CCJHyperLink CAboutDlg::m_WinCvsUrl

Definition at line 690 of file wincvs.cpp.

Referenced by OnInitDialog().

The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


AddBinCvsArgs Class Reference

Class to add binary files. More...

#include <CvsArgs.h>

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 override to test the file type.

virtual const char * | TypeDesc ()
Virtual override to get the type description.

Detailed Description

Class to add binary files.

Definition at line 110 of file CvsArgs.h.

Member Function Documentation

virtual kTextBinTYPE AddBinCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Virtual override to test the file type.

Implements ControlCvsArgs.

Definition at line 113 of file CvsArgs.h.

References FileIsBinary(), and kTextBinTYPE.

00114     {
00115         return FileIsBinary(arg, dir, spec);
00116     }

virtual const char* AddBinCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Virtual override to get the type description.

Implements ControlCvsArgs.

Definition at line 118 of file CvsArgs.h.

00119     {
00120         return "binary";
00121     }

The documentation for this class was generated from the following file:
  • common/CvsArgs.h
Generated on Fri Jan 31 12:13:23 2003 for WinCvs Source by doxygen 1.3-rc2


AddCvsArgs Class Reference

Class to add files. More...

#include <CvsArgs.h>

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 override to test the file type.

virtual const char * | TypeDesc ()
Virtual override to get the type description.

Detailed Description

Class to add files.

Definition at line 92 of file CvsArgs.h.

Member Function Documentation

virtual kTextBinTYPE AddCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Virtual override to test the file type.

Implements ControlCvsArgs.

Definition at line 95 of file CvsArgs.h.

References FileIsText(), and kTextBinTYPE.

00096     {
00097         return FileIsText(arg, dir, spec);
00098     }

virtual const char* AddCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Virtual override to get the type description.

Implements ControlCvsArgs.

Definition at line 100 of file CvsArgs.h.

00101     {
00102         return "TEXT";
00103     }

The documentation for this class was generated from the following file:
  • common/CvsArgs.h
Generated on Fri Jan 31 12:13:23 2003 for WinCvs Source by doxygen 1.3-rc2


AddUnicodeCvsArgs Class Reference

Class to add Unicode files. More...

#include <CvsArgs.h>

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 override to test the file type.

virtual const char * | TypeDesc ()
Virtual override to get the type description.

Detailed Description

Class to add Unicode files.

Definition at line 128 of file CvsArgs.h.

Member Function Documentation

virtual kTextBinTYPE AddUnicodeCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [inline, protected, virtual]

Virtual override to test the file type.

Implements ControlCvsArgs.

Definition at line 131 of file CvsArgs.h.

References FileIsUnicode(), and kTextBinTYPE.

00132     {
00133         return FileIsUnicode(arg, dir, spec);
00134     }

virtual const char* AddUnicodeCvsArgs::TypeDesc ( ) [inline, protected, virtual]

Virtual override to get the type description.

Implements ControlCvsArgs.

Definition at line 136 of file CvsArgs.h.

00137     {
00138         return "Unicode";
00139     }

The documentation for this class was generated from the following file:
  • common/CvsArgs.h
Generated on Fri Jan 31 12:13:24 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 kSetState, m_optionString, 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, kChangeLog, kSetDescription, kSetState, m_optionDescription, m_optionString, m_singeLine, m_title, 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(), 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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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, wire_ht, and WireHandler.

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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 MultiFiles *mf, const char *rev, bool isDate)
~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 ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnIsdate ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnBrowseTag ()
BN_CLICKED message handler, display browse tag/branch dialog.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 59 of file AnnotateDlg.h.

00059 { IDD = IDD_ANNOTATE_MAIN };

Constructor & Destructor Documentation

CAnnotate_MAIN::CAnnotate_MAIN | ( | const MultiFiles * | mf,
 |  | const char * | rev,
 |  | bool | isDate
 | ) |

Definition at line 68 of file AnnotateDlg.cpp.

References FALSE, m_force, m_hasRev, m_isDate, m_noRecurse, m_revCombo, m_strRev, and USmartCombo::SetItems().

00070                                : m_mf(mf), CPropertyPage(CAnnotate_MAIN::IDD)
00071 {
00072     m_hasRev = FALSE;
00073     m_isDate = isDate;
00074     m_strRev = rev;
00075     m_force = FALSE;
00076     m_noRecurse = FALSE;
00077
00078     m_revCombo.SetItems(m_isDate ? &gDateNames : &gRevNames);
00079 }

CAnnotate_MAIN::~CAnnotate_MAIN ( )

Definition at line 81 of file AnnotateDlg.cpp.

00082 {
00083 }

Member Function Documentation

void CAnnotate_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 85 of file AnnotateDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), and OnSpecifyRev().

00086 {
00087     CPropertyPage::DoDataExchange(pDX);
00088     //{{AFX_DATA_MAP(CAnnotate_MAIN)
00089     DDX_Control(pDX, IDC_COMBO_REV, m_revCombo);
00090     DDX_Check(pDX, IDC_SPECIFY_REV, m_hasRev);
00091     DDX_Check(pDX, IDC_ISDATE, m_isDate);
00092     DDX_Check(pDX, IDC_FORCE, m_force);
00093     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00094     DDX_CBString(pDX, IDC_COMBO_REV, m_strRev);
00095     //}}AFX_DATA_MAP
00096
00097     if( m_hasRev )
00098     {
00099         DDV_MinChars(pDX, m_strRev, 1);
00100     }
00101
00102     DDX_ComboMString(pDX, IDC_COMBO_REV, m_revCombo);
00103
00104     if( !pDX->m_bSaveAndValidate )
00105     {
00106         OnSpecifyRev();
00107     }
00108 }

void CAnnotate_MAIN::OnBrowseTag ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 152 of file AnnotateDlg.cpp.

References CompatGetTagListItem(), CStr, m_revCombo, and m_strRev.

00153 {
00154     CStr tagName;
00155     if( CompatGetTagListItem(m_mf, tagName) )
00156     {
00157         m_strRev = (const char*)tagName;
00158         m_revCombo.SetWindowText(m_strRev);
00159     }
00160 }

void CAnnotate_MAIN::OnIsdate ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 140 of file AnnotateDlg.cpp.

References DDX_ComboMString(), m_revCombo, and USmartCombo::SetItems().

00141 {
00142     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_ISDATE);
00143     BOOL isDate = btnIsDate->GetCheck();
00144
00145     m_revCombo.SetItems(isDate ? &gDateNames : &gRevNames);
00146     DDX_ComboMString(NULL, IDC_COMBO_REV, m_revCombo);
00147
00148     GetDlgItem(IDC_BROWSE_TAG)->EnableWindow(!isDate);
00149 }

void CAnnotate_MAIN::OnSpecifyRev ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 123 of file AnnotateDlg.cpp.

Referenced by DoDataExchange().

00124 {
00125     CButton* btnHasRev = (CButton*)GetDlgItem(IDC_SPECIFY_REV);
00126     CWnd* wndIsDate = GetDlgItem(IDC_ISDATE);
00127     CWnd* wndRev = GetDlgItem(IDC_COMBO_REV);
00128     CWnd* wndForce = GetDlgItem(IDC_FORCE);
00129     CWnd* wndBrowseTag = GetDlgItem(IDC_BROWSE_TAG);
00130
00131     BOOL bEnable = btnHasRev->GetCheck();
00132
00133     wndIsDate->EnableWindow(bEnable);
00134     wndRev->EnableWindow(bEnable);
00135     wndForce->EnableWindow(bEnable);
00136     wndBrowseTag->EnableWindow(bEnable && !((CButton*)wndIsDate)->GetCheck());
00137 }

Member Data Documentation

BOOL CAnnotate_MAIN::m_force

Definition at line 63 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), and CompatGetAnnotate().

BOOL CAnnotate_MAIN::m_hasRev

Definition at line 61 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), and CompatGetAnnotate().

BOOL CAnnotate_MAIN::m_isDate

Definition at line 62 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), and CompatGetAnnotate().

const MultiFiles* CAnnotate_MAIN::m_mf [private]

Definition at line 86 of file AnnotateDlg.h.

BOOL CAnnotate_MAIN::m_noRecurse

Definition at line 64 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), and CompatGetAnnotate().

CSmartComboBox CAnnotate_MAIN::m_revCombo

Definition at line 60 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), OnBrowseTag(), and OnIsdate().

CString CAnnotate_MAIN::m_strRev

Definition at line 65 of file AnnotateDlg.h.

Referenced by CAnnotate_MAIN(), CompatGetAnnotate(), and OnBrowseTag().

The documentation for this class was generated from the following files:
  • common/AnnotateDlg.h
  • common/AnnotateDlg.cpp
Generated on Fri Jan 31 12:13:26 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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(), and ansiAttrCvt::AnsiSeq::paramc().

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, blink, bold, CCTCP2, 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.

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.

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.

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(), 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 Fri Jan 31 12:13:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 _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.

Referenced by ansiAttrCvt::ansi2ctcp().

00089 { return _seq->c_str(); }

char ansiAttrCvt::AnsiSeq::verb ( ) [inline]

Definition at line 88 of file CTCP2Parse.hpp.

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.

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(), and ~AnsiSeq().

char ansiAttrCvt::AnsiSeq::_verb [private]

Definition at line 81 of file CTCP2Parse.hpp.

Referenced by AnsiSeq().

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Fri Jan 31 12:13:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 56 of file AskYesNo.cpp.

00057     : CDialog(CAskYesNo::IDD, pParent)
00058 {
00059     //{{AFX_DATA_INIT(CAskYesNo)
00060     //}}AFX_DATA_INIT
00061 }

Member Function Documentation

void CAskYesNo::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 64 of file AskYesNo.cpp.

00065 {
00066     CDialog::DoDataExchange(pDX);
00067     //{{AFX_DATA_MAP(CAskYesNo)
00068     //}}AFX_DATA_MAP
00069 }

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 Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


Authen Class Reference

Authentication class. More...

#include <common/Authen.h>

List of all members.

Public Methods

Authen ()
AuthenKind | kind (void)
Get authentication kind.

const char * | kindstr (void)
Get authentication kind text description.

void | setkind (AuthenKind newkind)
Set authentication kind.

const char * | token (void)
Get current authentication token.

Static Public Methods

const char * | kindToToken (AuthenKind k)
Get authentication token for specified kind.

AuthenKind | tokenToKind (const char *t)
Get authentication kind for specified token.

short | kindToNum (AuthenKind k)
Get authentication number given the kind.

AuthenKind | numToKind (short num)
Get authentication kind given the number.

bool | parse_cvsroot (const char *CVSroot, UStr &theMethod, UStr &theUser, UStr &theHost, UStr &thePath)
Parse cvsroot.

const char * | token (AuthenKind k)
Get specified authentication token.

const char * | skiptoken (const char *cvsroot)
Skip token.

Detailed Description

Authentication class.

Definition at line 48 of file Authen.h.

Constructor & Destructor Documentation

Authen::Authen ( ) [inline]

Definition at line 51 of file Authen.h.

00051 {}

Member Function Documentation

AuthenKind Authen::kind ( void )

Get authentication kind.

Definition at line 90 of file Authen.cpp.

References AuthenKind, and gAuthenKind().

Referenced by kindstr(), and token().

00091 {
00092     return gAuthenKind;
00093 }

const char * Authen::kindstr ( void )

Get authentication kind text description.

Definition at line 102 of file Authen.cpp.

References CStr, gserver, kind(), kserver, local, ntserver, pserver, rhosts, server, ssh, and sspi.

00103 {
00104     static CStr res;
00105
00106     switch( kind() )
00107     {
00108     default:
00109     case rhosts:
00110         res = ".rhosts authentication";
00111         break;
00112     case pserver:
00113         res = "password authentication";
00114         break;
00115     case kserver:
00116         res = "kerberos authentication";
00117         break;
00118     case local:
00119         res = "local mounted directory";
00120         break;
00121     case ssh:
00122         res = "ssh authentication";
00123         break;
00124     case ntserver:
00125         res = "NT server services";
00126         break;
00127     case gserver:
00128         res = "GSSAPI authentication";
00129         break;
00130     case sspi:
00131         res = "sspi authentication";
00132         break;
00133     case server:
00134         res = "server authentication";
00135         break;
00136     }
00137
00138     if( kind() == pserver && gCvsPrefs.UseProxy() )
00139     {
00140         res << " using a proxy";
00141     }
00142
00143     return res;
00144 }

short Authen::kindToNum ( AuthenKind k ) [static]

Get authentication number given the kind.

Definition at line 236 of file Authen.cpp.

References AuthenModel::GetAllInstances(), and AuthenModel::GetKind().

00237 {
00238     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00239     std::vector<AuthenModel*>::const_iterator i;
00240     int cnt = 0;
00241     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00242     {
00243         AuthenModel* model = *i;
00244         if( model->GetKind() == kind )
00245             return cnt;
00246     }
00247
00248     return 0;
00249 }

const char * Authen::kindToToken ( AuthenKind k ) [static]

Get authentication token for specified kind.

Definition at line 212 of file Authen.cpp.

References AuthenModel::GetInstance(), and AuthenModel::GetToken().

00213 {
00214     AuthenModel* model = AuthenModel::GetInstance(kind);
00215     return model->GetToken();
00216 }

AuthenKind Authen::numToKind ( short num ) [static]

Get authentication kind given the number.

Definition at line 252 of file Authen.cpp.

References AuthenKind, AuthenModel::GetAllInstances(), AuthenModel::GetKind(), and local.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen().

00253 {
00254     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00255     std::vector<AuthenModel*>::const_iterator i;
00256     int cnt = 0;
00257     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00258     {
00259         AuthenModel* model = *i;
00260         if( cnt == num )
00261             return model->GetKind();
00262     }
00263
00264     return local;
00265 }

bool Authen::parse_cvsroot | ( | const char * | CVSroot,
 |  | UStr & | theMethod,
 |  | UStr & | theUser,
 |  | UStr & | theHost,
 |  | UStr & | thePath
 | ) | [static]

Parse cvsroot.

Definition at line 268 of file Authen.cpp.

References NULL.

Referenced by CGetPrefs_CVSROOT::FillFields().

00269 {
00270     char* p;
00271     UStr copyroot(CVSroot);
00272     char* cvsroot_copy = copyroot;
00273
00274     theMethod = "";
00275     theUser = "";
00276     theHost = "";
00277     thePath = "";
00278
00279     if( *cvsroot_copy == ':' )
00280     {
00281         char* method = ++cvsroot_copy;
00282         bool have_semicolon;
00283
00284         /* Access method specified, as in
00285         * "cvs -d :pserver:user@host:/path",
00286         * "cvs -d :local:e:\path",
00287         * "cvs -d :kserver:user@host:/path", or
00288         * "cvs -d :fork:/path".
00289         * We need to get past that part of CVSroot before parsing the
00290         * rest of it.
00291         */
00292
00293         if( !(p = strchr(method, ':')) )
00294             return false;
00295
00296         p = strpbrk(method, ":;#");
00297         if( p == 0L )
00298             return false;
00299
00300         have_semicolon = (*p == ';' || *p == '#');
00301         *p = '\0';
00302         cvsroot_copy = ++p;
00303
00304         theMethod = method;
00305
00306         while(have_semicolon)
00307         {
00308             /* More elaborate implementation would allow multiple
00309             semicolons, for example:
00310
00311             :server;rsh=34;command=cvs-1.6:
00312
00313             we will allow
00314             :server;port=22;proxy=www-proxy;proxyport=8080:
00315
00316             we will also allow # as well as ; as a separator to
00317             avoid having to quote the root in a shell.
00318             */
00319             /* FIXME: lots of error conditions should be better handled,
00320             e.g. garbage after the number or no valid number.
00321
00322             Would be nice to have testcases for some of these cases
00323             including the error cases.  */
00324             p = strpbrk(cvsroot_copy, ":;#");
00325             if( p == NULL )
00326                 return false;
00327
00328             /* pick up more options if we have them */
00329             have_semicolon = (*p == ';' || *p == '#');
00330             *p = '\0';
00331
00332             cvsroot_copy = ++p;
00333         }
00334     }
00335
00336     if( theMethod != "local" )
00337     {
00338         /* Check to see if there is a username in the string. */
00339
00340         if( (p = strchr(cvsroot_copy, '@')) != NULL )
00341         {
00342             *p = '\0';
00343             theUser = cvsroot_copy;
00344             cvsroot_copy = ++p;
00345         }
00346
00347         if( (p = strchr(cvsroot_copy, ':')) != NULL )
00348         {
00349             *p = '\0';
00350             theHost = cvsroot_copy;
00351             cvsroot_copy = ++p;
00352         }
00353     }
00354
00355     thePath = cvsroot_copy;
00356
00357     return true;
00358 }

void Authen::setkind ( AuthenKind newkind )

Set authentication kind.

Definition at line 96 of file Authen.cpp.

References gAuthenKind().

00097 {
00098     gAuthenKind = newkind;
00099 }

const char * Authen::skiptoken ( const char * cvsroot ) [static]

Skip token.

Definition at line 201 of file Authen.cpp.

References NULL.

Referenced by CvsArgs::addcvsroot(), CGetPrefs_CVSROOT::FillFields(), glue_getenv(), and CvsArgs::reset().

00202 {
00203     const char* secondColon;
00204
00205     if( cvsroot[0] != ':' || (secondColon = strchr(cvsroot + 1, ':')) == NULL )
00206         return cvsroot;
00207
00208     return secondColon + 1;
00209 }

const char * Authen::token ( AuthenKind k ) [static]

Get specified authentication token.

Definition at line 153 of file Authen.cpp.

References CStr, gserver, kserver, local, ntserver, pserver, rhosts, server, ssh, and sspi.

00154 {
00155     static CStr res;
00156
00157     switch( kind )
00158     {
00159     default :
00160     case rhosts:
00161         res = "";
00162         break;
00163     case pserver :
00164         res = ":pserver";
00165         if(gCvsPrefs.UseProxy())
00166         {
00167             res << ";proxy=";
00168             res << gCvsPrefs.ProxyHost();
00169             res << ";proxyport=";
00170             res << gCvsPrefs.ProxyPort();
00171         }
00172         res << ':';
00173         break;
00174     case kserver:
00175         res = ":kserver:";
00176         break;
00177     case local:
00178         res = ":local:";
00179         break;
00180     case ssh:
00181         res = ":ext:";
00182         break;
00183     case ntserver:
00184         res = ":ntserver:";
00185         break;
00186     case gserver:
00187         res = ":gserver:";
00188         break;
00189     case sspi:
00190         res = ":sspi:";
00191         break;
00192     case server:
00193         res = ":server:";
00194         break;
00195     }
00196
00197     return res;
00198 }

const char * Authen::token ( void )

Get current authentication token.

Definition at line 147 of file Authen.cpp.

References kind().

Referenced by CGetPrefs_CVSROOT::FillFields().

00148 {
00149     return Authen::token(kind());
00150 }

AuthenKind Authen::tokenToKind ( const char * t ) [static]

Get authentication kind for specified token.

Definition at line 219 of file Authen.cpp.

References AuthenKind, cvs_err(), AuthenModel::GetAllInstances(), AuthenModel::GetKind(), AuthenModel::GetToken(), and local.

00220 {
00221     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00222     std::vector<AuthenModel*>::const_iterator i;
00223     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00224     {
00225         AuthenModel* model = *i;
00226         if( strcmp(model->GetToken(), token) == 0 )
00227             return model->GetKind();
00228     }
00229
00230     cvs_err("Unknown authentication kind '%s'\n", token);
00231
00232     return local;
00233 }

The documentation for this class was generated from the following files:
  • common/Authen.h
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:29 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 1774 of file Authen.cpp.

01775     {
01776         kOK = EV_COMMAND_START, // 0
01777         kCancel,                // 1
01778         kCheckEncrypt           // 2
01779     };

Constructor & Destructor Documentation

UAuthen_Gserver::UAuthen_Gserver ( )

Definition at line 1792 of file Authen.cpp.

01792                                  : UWidget(::UEventGetWidID())
01793 {
01794 }

virtual UAuthen_Gserver::~UAuthen_Gserver ( ) [inline, virtual]

Definition at line 1772 of file Authen.cpp.

01772 {}

Member Function Documentation

const URuntimeClass * UAuthen_Gserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1787 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 1796 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01797 {
01798     if( fill )
01799     {
01800         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01801     }
01802     else
01803     {
01804         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01805         gCvsPrefs.SetEncryptCommunication(state != 0);
01806     }
01807 }

const UMSGMAP * UAuthen_Gserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1789 of file Authen.cpp.

const UMSGMAP * UAuthen_Gserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1789 of file Authen.cpp.

const URuntimeClass * UAuthen_Gserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1787 of file Authen.cpp.

const UMSGMAP * UAuthen_Gserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1789 of file Authen.cpp.

const URuntimeClass * UAuthen_Gserver::rtUAuthen_Gserver ( void ) [static]

Definition at line 1787 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 1789 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 1789 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:30 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 1623 of file Authen.cpp.

01624     {
01625         kOK = EV_COMMAND_START, // 0
01626         kCancel,            // 1
01627         kCheckPort,         // 2
01628         kEditPort           // 3
01629     };

Constructor & Destructor Documentation

UAuthen_Kserver::UAuthen_Kserver ( )

Definition at line 1647 of file Authen.cpp.

01647                                  : UWidget(::UEventGetWidID())
01648 {
01649 }

virtual UAuthen_Kserver::~UAuthen_Kserver ( ) [inline, virtual]

Definition at line 1621 of file Authen.cpp.

01621 {}

Member Function Documentation

const URuntimeClass * UAuthen_Kserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1641 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 1660 of file Authen.cpp.

References UCmdTarget::GetWidID(), m_port, UEventSendMessage(), and UMAKEINT.

01661 {
01662     if( fill )
01663     {
01664         m_port = gCvsPrefs.KserverPort();
01665
01666         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01667         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01668         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01669     }
01670     else
01671     {
01672         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01673         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01674         gCvsPrefs.SetKserverPort(state ? value : -1);
01675     }
01676 }

const UMSGMAP * UAuthen_Kserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1643 of file Authen.cpp.

const UMSGMAP * UAuthen_Kserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1643 of file Authen.cpp.

const URuntimeClass * UAuthen_Kserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1641 of file Authen.cpp.

const UMSGMAP * UAuthen_Kserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1643 of file Authen.cpp.

int UAuthen_Kserver::OnCheckPort ( void ) [protected]

Definition at line 1651 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01652 {
01653     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01654
01655     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01656
01657     return 0;
01658 }

const URuntimeClass * UAuthen_Kserver::rtUAuthen_Kserver ( void ) [static]

Definition at line 1641 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 1643 of file Authen.cpp.

const URuntimeClass UAuthen_Kserver::classUAuthen_Kserver [static, protected]

int UAuthen_Kserver::m_port [protected]

Definition at line 1634 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 1643 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:32 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 1166 of file Authen.cpp.

01167     {
01168         kOK = EV_COMMAND_START, // 0
01169         kCancel,            // 1
01170         kCheckPort,         // 2
01171         kEditPort,          // 3
01172         kCheckProxy,        // 4
01173         kNameProxy,         // 5
01174         kEditProxy          // 6
01175     };

Constructor & Destructor Documentation

UAuthen_Pserver::UAuthen_Pserver ( )

Definition at line 1197 of file Authen.cpp.

01197                                  : UWidget(::UEventGetWidID())
01198 {
01199 }

virtual UAuthen_Pserver::~UAuthen_Pserver ( ) [inline, virtual]

Definition at line 1164 of file Authen.cpp.

01164 {}

Member Function Documentation

const URuntimeClass * UAuthen_Pserver::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1190 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 1220 of file Authen.cpp.

References UCmdTarget::GetWidID(), m_pname, m_port, m_pport, UEventSendMessage(), and UMAKEINT.

01221 {
01222     if( fill )
01223     {
01224         m_port = gCvsPrefs.PserverPort();
01225
01226         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01227         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 2401 : m_port), 0L);
01228         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01229
01230         m_pport = gCvsPrefs.ProxyPort();
01231         m_pname = gCvsPrefs.ProxyHost();
01232         bool useProxy = gCvsPrefs.UseProxy();
01233
01234         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, useProxy), 0L);
01235         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, useProxy), 0L);
01236         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditProxy, m_pport), 0L);
01237         UEventSendMessage(GetWidID(), EV_SETTEXT, kNameProxy, (void*)(const char*)m_pname);
01238         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckProxy, useProxy), 0L);
01239     }
01240     else
01241     {
01242         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01243
01244         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01245         gCvsPrefs.SetPserverPort(state ? value : -1);
01246
01247         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01248         value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditProxy, 0L);
01249         UEventSendMessage(GetWidID(), EV_GETTEXT, kNameProxy, &m_pname);
01250         gCvsPrefs.SetUseProxy(state != 0);
01251
01252         if( state != 0 )
01253         {
01254             gCvsPrefs.SetProxyHost(m_pname);
01255             gCvsPrefs.SetProxyPort(value);
01256         }
01257     }
01258 }

const UMSGMAP * UAuthen_Pserver::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1192 of file Authen.cpp.

const UMSGMAP * UAuthen_Pserver::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1192 of file Authen.cpp.

const URuntimeClass * UAuthen_Pserver::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1190 of file Authen.cpp.

const UMSGMAP * UAuthen_Pserver::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1192 of file Authen.cpp.

int UAuthen_Pserver::OnCheckPort ( void ) [protected]

Definition at line 1201 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01202 {
01203     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01204
01205     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01206
01207     return 0;
01208 }

int UAuthen_Pserver::OnCheckProxy ( void ) [protected]

Definition at line 1210 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01211 {
01212     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01213
01214     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, state), 0L);
01215     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, state), 0L);
01216
01217     return 0;
01218 }

const URuntimeClass * UAuthen_Pserver::rtUAuthen_Pserver ( void ) [static]

Definition at line 1190 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 1192 of file Authen.cpp.

const URuntimeClass UAuthen_Pserver::classUAuthen_Pserver [static, protected]

UStr UAuthen_Pserver::m_pname [protected]

Definition at line 1182 of file Authen.cpp.

Referenced by DoDataExchange().

int UAuthen_Pserver::m_port [protected]

Definition at line 1180 of file Authen.cpp.

Referenced by DoDataExchange().

int UAuthen_Pserver::m_pport [protected]

Definition at line 1181 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 1192 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:33 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 1377 of file Authen.cpp.

01378     {
01379         kOK = EV_COMMAND_START, // 0
01380         kCancel,            // 1
01381         kCheckPort,         // 2
01382         kEditPort,          // 3
01383         kCheckRSHName,      // 4
01384         kEditRSHName,       // 5
01385         kCheckServerName,   // 6
01386         kEditServerName     // 7
01387     };

Constructor & Destructor Documentation

UAuthen_Rhosts::UAuthen_Rhosts ( )

Definition at line 1411 of file Authen.cpp.

01411                                : UWidget(::UEventGetWidID())
01412 {
01413 }

virtual UAuthen_Rhosts::~UAuthen_Rhosts ( ) [inline, virtual]

Definition at line 1375 of file Authen.cpp.

01375 {}

Member Function Documentation

const URuntimeClass * UAuthen_Rhosts::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1403 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 1442 of file Authen.cpp.

References UStr::c_str(), UStr::empty(), UCmdTarget::GetWidID(), m_port, m_rshname, m_servername, UEventSendMessage(), and UMAKEINT.

01443 {
01444     if( fill )
01445     {
01446         m_port = gCvsPrefs.RhostPort();
01447         m_rshname = gCvsPrefs.RshName();
01448         m_servername = gCvsPrefs.ServerName();
01449
01450         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01451         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01452         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01453
01454         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, !m_rshname.empty()), 0L);
01455         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRSHName, (void*)m_rshname.c_str());
01456         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRSHName, !m_rshname.empty()), 0L);
01457
01458         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, !m_servername.empty()), 0L);
01459         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditServerName, (void*)m_servername.c_str());
01460         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckServerName, !m_servername.empty()), 0L);
01461     }
01462     else
01463     {
01464         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01465         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01466         gCvsPrefs.SetRhostPort(state ? value : -1);
01467
01468         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01469         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRSHName, &m_rshname);
01470         gCvsPrefs.SetRshName(state ? m_rshname.c_str() : "");
01471
01472         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01473         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditServerName, &m_servername);
01474         gCvsPrefs.SetServerName(state ? m_servername.c_str() : "");
01475     }
01476 }

const UMSGMAP * UAuthen_Rhosts::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1405 of file Authen.cpp.

const UMSGMAP * UAuthen_Rhosts::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1405 of file Authen.cpp.

const URuntimeClass * UAuthen_Rhosts::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1403 of file Authen.cpp.

const UMSGMAP * UAuthen_Rhosts::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1405 of file Authen.cpp.

int UAuthen_Rhosts::OnCheckPort ( void ) [protected]

Definition at line 1415 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01416 {
01417     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01418
01419     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01420
01421     return 0;
01422 }

int UAuthen_Rhosts::OnCheckRshName ( void ) [protected]

Definition at line 1424 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01425 {
01426     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01427
01428     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, state), 0L);
01429
01430     return 0;
01431 }

int UAuthen_Rhosts::OnCheckServerName ( void ) [protected]

Definition at line 1433 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01434 {
01435     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01436
01437     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, state), 0L);
01438
01439     return 0;
01440 }

const URuntimeClass * UAuthen_Rhosts::rtUAuthen_Rhosts ( void ) [static]

Definition at line 1403 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 1405 of file Authen.cpp.

const URuntimeClass UAuthen_Rhosts::classUAuthen_Rhosts [static, protected]

int UAuthen_Rhosts::m_port [protected]

Definition at line 1392 of file Authen.cpp.

Referenced by DoDataExchange().

UStr UAuthen_Rhosts::m_rshname [protected]

Definition at line 1393 of file Authen.cpp.

Referenced by DoDataExchange().

UStr UAuthen_Rhosts::m_servername [protected]

Definition at line 1394 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 1405 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:35 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 773 of file Authen.cpp.

00774     {
00775         kOK = EV_COMMAND_START, // 0
00776         kCancel,            // 1
00777         kRSACheck,          // 2
00778         kRSAEdit,           // 3
00779         kRSABtn,            // 4
00780         kSSHCheck,          // 5
00781         kSSHName,           // 6
00782         kOptionsText,       // 7
00783         kOptionsCheck,      // 8
00784         kOptionsEdit,       // 9
00785         kSSHBtn         // 10
00786     };

Constructor & Destructor Documentation

UAuthen_SSH::UAuthen_SSH ( )

Definition at line 814 of file Authen.cpp.

00814                          : UWidget(::UEventGetWidID())
00815 {
00816 }

virtual UAuthen_SSH::~UAuthen_SSH ( ) [inline, virtual]

Definition at line 771 of file Authen.cpp.

00771 {}

Member Function Documentation

const URuntimeClass * UAuthen_SSH::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 804 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 922 of file Authen.cpp.

References UStr::c_str(), UStr::empty(), AuthenSSH::gCurRsaIdentity, TMString< UStr >::GetList(), UCmdTarget::GetWidID(), AuthenSSH::gRsaIdentity, AuthenSSH::gRsaIdentityFile, AuthenSSH::gSSHName, AuthenSSH::gSSHOptions, TMString< UStr >::Insert(), TMString< UStr >::list_t, m_rsaidentity, m_rsaidentityfile, OnCheckName(), OnCheckOptions(), OnCheckRSA(), AuthenSSH::RsaIdentityFile(), UEventSendMessage(), and UMAKEINT.

00923 {
00924     if( fill )
00925     {
00926         m_rsaidentity = AuthenSSH::gRsaIdentity;
00927         m_rsaidentityfile = AuthenSSH::RsaIdentityFile();
00928
00929         UStr helpMsg = "* Some Cygwin/OpenSSH options :\n"
00930             "-v : Verbose mode\n"
00931             "-C : Request compression\n"
00932             "-1 : Forces ssh to try protocol version 1 only\n"
00933             "-2 : Forces ssh to try protocol version 2 only\n"
00934             "-4 : Forces ssh to use IPv4 addresses only\n"
00935             "-6 : Forces ssh to use IPv6 addresses only";
00936
00937         UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsText, (void*)helpMsg.c_str());
00938
00939         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETFEATURE, kRSAEdit, (void*)USmartCombo::DefaultFeature);
00940         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETITEMS, kRSAEdit, (void*)&AuthenSSH::gRsaIdentityFile);
00941
00942         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRSAEdit, 0L);
00943         const CMString::list_t& rsastrings = AuthenSSH::gRsaIdentityFile.GetList();
00944         CMString::list_t::const_iterator i;
00945         for(i = rsastrings.begin(); i != rsastrings.end(); ++i)
00946         {
00947             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRSAEdit, (void*)(const char*)*i);
00948         }
00949
00950         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRSACheck, m_rsaidentity), 0L);
00951         UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void*)m_rsaidentityfile.c_str());
00952
00953         if( !AuthenSSH::gSSHName.empty() )
00954         {
00955             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSSHCheck, 1), 0L);
00956             UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void*)AuthenSSH::gSSHName.c_str());
00957         }
00958
00959         if( !AuthenSSH::gSSHOptions.empty() )
00960         {
00961             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kOptionsCheck, 1), 0L);
00962             UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsEdit, (void*)AuthenSSH::gSSHOptions.c_str());
00963         }
00964
00965         OnCheckRSA();
00966         OnCheckName();
00967         OnCheckOptions();
00968     }
00969     else
00970     {
00971         AuthenSSH::gRsaIdentity = m_rsaidentity;
00972         if( m_rsaidentity )
00973         {
00974             UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &m_rsaidentityfile);
00975             AuthenSSH::gRsaIdentityFile.Insert(m_rsaidentityfile);
00976             AuthenSSH::gCurRsaIdentity = m_rsaidentityfile;
00977         }
00978
00979         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) )
00980             UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &AuthenSSH::gSSHName);
00981         else
00982             AuthenSSH::gSSHName = "";
00983
00984         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L) )
00985             UEventSendMessage(GetWidID(), EV_GETTEXT, kOptionsEdit, &AuthenSSH::gSSHOptions);
00986         else
00987             AuthenSSH::gSSHOptions = "";
00988     }
00989 }

const UMSGMAP * UAuthen_SSH::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 806 of file Authen.cpp.

const UMSGMAP * UAuthen_SSH::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 806 of file Authen.cpp.

const URuntimeClass * UAuthen_SSH::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 804 of file Authen.cpp.

const UMSGMAP * UAuthen_SSH::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 806 of file Authen.cpp.

int UAuthen_SSH::OnBtnName ( void ) [protected]

Definition at line 885 of file Authen.cpp.

References CvsArgs::Argv(), MultiFiles::begin(), BrowserGetMultiFiles(), UStr::c_str(), CStr, UStr::empty(), UStr::endsWith(), UCmdTarget::GetWidID(), MultiFiles::newdir(), MultiFiles::newfile(), SplitPath(), and UEventSendMessage().

00886 {
00887     UStr SSHName;
00888     UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &SSHName);
00889
00890     MultiFiles mf;
00891     if( !SSHName.empty() )
00892     {
00893         CStr uppath;
00894         CStr file;
00895
00896         if( SplitPath(SSHName, uppath, file) )
00897         {
00898             mf.newdir(uppath);
00899             mf.newfile(file);
00900         }
00901     }
00902
00903     if( !BrowserGetMultiFiles("Select SSH", mf, true, kSelectExecutable) )
00904         return 0;
00905
00906     CvsArgs args(false);
00907     const char* dir = (*mf.begin()).add(args);
00908     char* const* argv = args.Argv();
00909
00910     UStr fullpath;
00911     fullpath = dir;
00912     if( !fullpath.endsWith(kPathDelimiter) )
00913         fullpath << kPathDelimiter;
00914
00915     fullpath << argv[0];
00916
00917     UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void*)fullpath.c_str());
00918
00919     return 0;
00920 }

int UAuthen_SSH::OnBtnRSA ( void ) [protected]

Definition at line 848 of file Authen.cpp.

References CvsArgs::Argv(), MultiFiles::begin(), BrowserGetMultiFiles(), UStr::c_str(), CStr, UStr::empty(), UStr::endsWith(), UCmdTarget::GetWidID(), MultiFiles::newdir(), MultiFiles::newfile(), SplitPath(), and UEventSendMessage().

00849 {
00850     UStr rsaidentityfile;
00851     UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &rsaidentityfile);
00852
00853     MultiFiles mf;
00854     if( !rsaidentityfile.empty() )
00855     {
00856         CStr uppath;
00857         CStr file;
00858
00859         if( SplitPath(rsaidentityfile, uppath, file) )
00860         {
00861             mf.newdir(uppath);
00862             mf.newfile(file);
00863         }
00864     }
00865
00866     if( !BrowserGetMultiFiles("Select the RSA identity file", mf, true) )
00867         return 0;
00868
00869     CvsArgs args(false);
00870     const char* dir = (*mf.begin()).add(args);
00871     char* const* argv = args.Argv();
00872
00873     UStr fullpath;
00874     fullpath = dir;
00875     if( !fullpath.endsWith(kPathDelimiter) )
00876         fullpath << kPathDelimiter;
00877
00878     fullpath << argv[0];
00879
00880     UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void*)fullpath.c_str());
00881
00882     return 0;
00883 }

int UAuthen_SSH::OnCheckName ( void ) [protected]

Definition at line 828 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

Referenced by DoDataExchange().

00829 {
00830     bool state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) != 0;
00831
00832     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHName, state), 0L);
00833     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHBtn, state), 0L);
00834
00835     return 0;
00836 }

int UAuthen_SSH::OnCheckOptions ( void ) [protected]

Definition at line 838 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

Referenced by DoDataExchange().

00839 {
00840     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L);
00841
00842     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsEdit, state), 0L);
00843     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsText, state), 0L);
00844
00845     return 0;
00846 }

int UAuthen_SSH::OnCheckRSA ( void ) [protected]

Definition at line 818 of file Authen.cpp.

References UCmdTarget::GetWidID(), m_rsaidentity, UEventSendMessage(), and UMAKEINT.

Referenced by DoDataExchange().

00819 {
00820     m_rsaidentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRSACheck, 0L) != 0;
00821
00822     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSAEdit, m_rsaidentity), 0L);
00823     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSABtn, m_rsaidentity), 0L);
00824
00825     return 0;
00826 }

const URuntimeClass * UAuthen_SSH::rtUAuthen_SSH ( void ) [static]

Definition at line 804 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 806 of file Authen.cpp.

const URuntimeClass UAuthen_SSH::classUAuthen_SSH [static, protected]

UStr UAuthen_SSH::m_options [protected]

Definition at line 793 of file Authen.cpp.

bool UAuthen_SSH::m_rsaidentity [protected]

Definition at line 791 of file Authen.cpp.

Referenced by DoDataExchange(), and OnCheckRSA().

UStr UAuthen_SSH::m_rsaidentityfile [protected]

Definition at line 792 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 806 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:37 2003 for WinCvs Source by doxygen 1.3-rc2


UAuthen_Sspi Class Reference

Inheritance diagram for UAuthen_Sspi:

[legend]
Collaboration diagram for UAuthen_Sspi:

[legend]
List of all members.

Public Types

enum {
kOK = EV_COMMAND_START,
kCancel,
kCheckEncrypt
}

Public Methods

virtual const URuntimeClass * | GetRuntimeClass () const
UAuthen_Sspi ()
virtual | ~UAuthen_Sspi ()
virtual void | DoDataExchange (bool fill)
while modaling, allows to fill/read the dialog content.

Static Public Methods

const URuntimeClass * | rtUAuthen_Sspi (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_Sspi
const UMSGMAP | messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Sspi ::_messageEntries[0] }

Static Private Attributes

const UMSGMAP_ENTRY | _messageEntries []

Member Enumeration Documentation

anonymous enum

Enumeration values:
kOK
kCancel
kCheckEncrypt

Definition at line 1871 of file Authen.cpp.

01872     {
01873         kOK = EV_COMMAND_START, // 0
01874         kCancel,                // 1
01875         kCheckEncrypt           // 2
01876     };

Constructor & Destructor Documentation

UAuthen_Sspi::UAuthen_Sspi ( )

Definition at line 1889 of file Authen.cpp.

01889                            : UWidget(::UEventGetWidID())
01890 {
01891 }

virtual UAuthen_Sspi::~UAuthen_Sspi ( ) [inline, virtual]

Definition at line 1869 of file Authen.cpp.

01869 {}

Member Function Documentation

const URuntimeClass * UAuthen_Sspi::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1884 of file Authen.cpp.

void UAuthen_Sspi::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 1893 of file Authen.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01894 {
01895     if( fill )
01896     {
01897         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01898     }
01899     else
01900     {
01901         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01902         gCvsPrefs.SetEncryptCommunication(state != 0);
01903     }
01904 }

const UMSGMAP * UAuthen_Sspi::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1886 of file Authen.cpp.

const UMSGMAP * UAuthen_Sspi::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 1886 of file Authen.cpp.

const URuntimeClass * UAuthen_Sspi::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 1884 of file Authen.cpp.

const UMSGMAP * UAuthen_Sspi::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 1886 of file Authen.cpp.

const URuntimeClass * UAuthen_Sspi::rtUAuthen_Sspi ( void ) [static]

Definition at line 1884 of file Authen.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UAuthen_Sspi::_messageEntries [static, private]

Initial value:

   {
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 1886 of file Authen.cpp.

const URuntimeClass UAuthen_Sspi::classUAuthen_Sspi [static, protected]

const UMSGMAP UAuthen_Sspi::messageMap = { UWidget ::GetThisMessageMap(), & UAuthen_Sspi ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 1886 of file Authen.cpp.

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 bool | HasEncryption (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 1737 of file Authen.cpp.

01737 {}

virtual AuthenGserver::~AuthenGserver ( ) [inline, virtual]

Definition at line 1738 of file Authen.cpp.

01738 {}

Member Function Documentation

void AuthenGserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1809 of file Authen.cpp.

References UWidget::DoModal().

01810 {
01811     UAuthen_Gserver* dlg = new UAuthen_Gserver();
01812
01813     try
01814     {
01815 #if WIN32
01816         dlg->DoModal(IDD_GSERVER);
01817 #endif
01818     }
01819     catch(...)
01820     {
01821     }
01822
01823     delete dlg;
01824 }

virtual AuthenKind AuthenGserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1740 of file Authen.cpp.

References AuthenKind, and gserver.

01740 { return gserver; }

void AuthenGserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1754 of file Authen.cpp.

01755 {
01756     if( gCvsPrefs.EncryptCommunication() )
01757         desc << "Encryption turned on";
01758     else
01759         desc << "Encryption turned off";
01760 }

virtual const char* AuthenGserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1741 of file Authen.cpp.

01741 { return "gserver"; }

virtual bool AuthenGserver::HasEncryption ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1746 of file Authen.cpp.

01746 { return true; }

virtual bool AuthenGserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1744 of file Authen.cpp.

01744 { return true; }

virtual bool AuthenGserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1743 of file Authen.cpp.

01743 { return true; }

const char * AuthenGserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1762 of file Authen.cpp.

01763 {
01764     return 0L;
01765 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 1600 of file Authen.cpp.

01600 {}

virtual AuthenKserver::~AuthenKserver ( ) [inline, virtual]

Definition at line 1601 of file Authen.cpp.

01601 {}

Member Function Documentation

void AuthenKserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1678 of file Authen.cpp.

References UWidget::DoModal().

01679 {
01680     UAuthen_Kserver* dlg = new UAuthen_Kserver();
01681
01682     try
01683     {
01684 #if qMacCvsPP
01685         dlg->DoModal(3003);
01686 #endif
01687     }
01688     catch(...)
01689     {
01690     }
01691
01692     delete dlg;
01693 }

virtual AuthenKind AuthenKserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1603 of file Authen.cpp.

References AuthenKind, and kserver.

01603 { return kserver; }

void AuthenKserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1695 of file Authen.cpp.

01696 {
01697     if( gCvsPrefs.KserverPort() == -1 )
01698         desc << "Using default port";
01699     else
01700         desc << "Using port " << gCvsPrefs.KserverPort();
01701 }

virtual const char* AuthenKserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1604 of file Authen.cpp.

01604 { return "kserver"; }

virtual bool AuthenKserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1607 of file Authen.cpp.

01607 { return true; }

virtual bool AuthenKserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1606 of file Authen.cpp.

01606 { return true; }

virtual bool AuthenKserver::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1608 of file Authen.cpp.

01608 { return true; }

const char * AuthenKserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1703 of file Authen.cpp.

01704 {
01705     return 0L;
01706 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 450 of file Authen.cpp.

00450 {}

virtual AuthenLocal::~AuthenLocal ( ) [inline, virtual]

Definition at line 451 of file Authen.cpp.

00451 {}

Member Function Documentation

virtual AuthenKind AuthenLocal::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 453 of file Authen.cpp.

References AuthenKind, and local.

00453 { return local; }

virtual const char* AuthenLocal::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 454 of file Authen.cpp.

00454 { return "local"; }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 ()
Constructor.

virtual | ~AuthenModel ()
Destructor.

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 bool | HasEncryption (void) const
virtual bool | HasLogin (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
Setup environment.

virtual void | OnRestoreEnv (void)
Restore environment.

Static Public Methods

std::vector< AuthenModel * > & | GetAllInstances (void)
Get authentication collection.

AuthenModel * | GetInstance (AuthenKind k)
Get authentication instance for given kind.

Static Protected Attributes

std::vector< AuthenModel * > * | m_instances = 0L
Authentication container.

UStr oldHome

Detailed Description

Authentication model class.

Definition at line 74 of file Authen.h.

Constructor & Destructor Documentation

AuthenModel::AuthenModel ( )

Constructor.

Definition at line 367 of file Authen.cpp.

References m_instances.

00368 {
00369     if( m_instances == 0L )
00370     {
00371         m_instances = new std::vector<AuthenModel*>;
00372         if( m_instances == 0L )
00373             throw std::bad_alloc();
00374     }
00375
00376     m_instances->push_back(this);
00377 }

AuthenModel::~AuthenModel ( ) [virtual]

Destructor.

Definition at line 380 of file Authen.cpp.

References m_instances.

00381 {
00382     std::vector<AuthenModel*>::iterator i;
00383     i = std::find(m_instances->begin(), m_instances->end(), this);
00384     if( i != m_instances->end() )
00385         m_instances->erase(i);
00386
00387     if( m_instances->empty() )
00388         delete m_instances;
00389 }

Member Function Documentation

virtual void AuthenModel::DoSettings ( void ) [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenGserver, and AuthenSspi.

Definition at line 93 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSettings().

00093 {}

std::vector< AuthenModel * > & AuthenModel::GetAllInstances ( void ) [static]

Get authentication collection.

Definition at line 392 of file Authen.cpp.

References m_instances.

Referenced by CGetPrefs_CVSROOT::DoDataExchange(), GetInstance(), glue_getenv(), Authen::kindToNum(), Authen::numToKind(), and Authen::tokenToKind().

00393 {
00394     return *AuthenModel::m_instances;
00395 }

AuthenModel * AuthenModel::GetInstance ( AuthenKind k ) [static]

Get authentication instance for given kind.

Definition at line 398 of file Authen.cpp.

References cvs_err(), GetAllInstances(), and GetKind().

Referenced by CAuthenSetUp::CAuthenSetUp(), CvsCmdLogin(), CvsCmdLogout(), CGetPrefs_CVSROOT::DoDataExchange(), glue_getenv(), CLogoutThread::InitInstance(), Authen::kindToToken(), CGetPrefs_CVSROOT::OnChangeFields(), CGetPrefs_CVSROOT::OnSelchangeAuthen(), CGetPrefs_CVSROOT::OnSettings(), CvsArgs::reset(), CWincvsApp::SaveAllModified(), and CAuthenSetUp::~CAuthenSetUp().

00399 {
00400     std::vector<AuthenModel*>& allInstances = GetAllInstances();
00401     std::vector<AuthenModel*>::const_iterator i;
00402     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00403     {
00404         AuthenModel* model = *i;
00405         if( model->GetKind() == k )
00406             return model;
00407     }
00408
00409     // default to local
00410     cvs_err("Unknown authentication kind %d\n", k);
00411
00412     return GetInstance(local);
00413 }

virtual AuthenKind AuthenModel::GetKind ( void ) const [pure virtual]

Implemented in AuthenLocal, AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenNtserver, AuthenGserver, AuthenSspi, and AuthenServer.

Referenced by GetInstance(), Authen::kindToNum(), Authen::numToKind(), and Authen::tokenToKind().

virtual void AuthenModel::GetSettingsDesc ( UStr & desc ) [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenGserver, and AuthenSspi.

Definition at line 94 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen(), and CGetPrefs_CVSROOT::OnSettings().

00094 { desc = ""; }

virtual const char* AuthenModel::GetToken ( void ) const [pure virtual]

Implemented in AuthenLocal, AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenNtserver, AuthenGserver, AuthenSspi, and AuthenServer.

Referenced by Authen::kindToToken(), and Authen::tokenToKind().

virtual bool AuthenModel::HasEncryption ( void ) const [inline, virtual]

Reimplemented in AuthenGserver, and AuthenSspi.

Definition at line 90 of file Authen.h.

Referenced by CvsArgs::reset().

00090 { return false; }

virtual bool AuthenModel::HasHost ( void ) const [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenNtserver, AuthenGserver, AuthenSspi, and AuthenServer.

Definition at line 87 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnChangeFields(), and CGetPrefs_CVSROOT::OnSelchangeAuthen().

00087 { return false; }

virtual bool AuthenModel::HasLogin ( void ) const [inline, virtual]

Reimplemented in AuthenPserver, and AuthenSspi.

Definition at line 91 of file Authen.h.

Referenced by CvsCmdLogin(), CvsCmdLogout(), CLogoutThread::InitInstance(), and CWincvsApp::SaveAllModified().

00091 { return false; }

virtual bool AuthenModel::HasSettings ( void ) const [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenNtserver, AuthenGserver, and AuthenSspi.

Definition at line 86 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnSelchangeAuthen().

00086 { return false; }

virtual bool AuthenModel::HasUser ( void ) const [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenSspi, and AuthenServer.

Definition at line 88 of file Authen.h.

Referenced by CGetPrefs_CVSROOT::OnChangeFields(), and CGetPrefs_CVSROOT::OnSelchangeAuthen().

00088 { return false; }

virtual const char* AuthenModel::OnGetEnv ( char * env ) [inline, virtual]

Reimplemented in AuthenSSH, AuthenPserver, AuthenRhosts, AuthenKserver, AuthenNtserver, AuthenGserver, AuthenSspi, and AuthenServer.

Definition at line 96 of file Authen.h.

Referenced by glue_getenv().

00096 { return 0L; }

void AuthenModel::OnRestoreEnv ( void ) [virtual]

Restore environment.

Reimplemented in AuthenSSH, AuthenPserver, and AuthenRhosts.

Definition at line 433 of file Authen.cpp.

References UStr::empty(), oldHome, and unsetenv.

Referenced by AuthenRhosts::OnRestoreEnv(), AuthenPserver::OnRestoreEnv(), AuthenSSH::OnRestoreEnv(), and CAuthenSetUp::~CAuthenSetUp().

00434 {
00435     /* we have not to clear the HOME enviroment on unix */
00436 #ifndef qUnix
00437     if( oldHome.empty() )
00438         unsetenv("HOME");
00439     else
00440         putenv(oldHome);
00441 #endif
00442 }

void AuthenModel::OnSetupEnv ( void ) [virtual]

Setup environment.

Reimplemented in AuthenSSH, AuthenPserver, and AuthenRhosts.

Definition at line 416 of file Authen.cpp.

References getenv, and oldHome.

Referenced by CAuthenSetUp::CAuthenSetUp(), AuthenRhosts::OnSetupEnv(), AuthenPserver::OnSetupEnv(), and AuthenSSH::OnSetupEnv().

00417 {
00418     /* under unix there should always be the correct home path
00419      * in the emviroment. So we have not to overwrite it.*/
00420 #ifndef qUnix
00421     static UStr home;
00422
00423     oldHome = getenv("HOME");
00424
00425     home = "HOME=";
00426     home << gCvsPrefs.Home();
00427
00428     putenv(home);
00429 #endif
00430 }

Member Data Documentation

std::vector< AuthenModel * > * AuthenModel::m_instances = 0L [static, protected]

Authentication container.

Definition at line 364 of file Authen.cpp.

Referenced by AuthenModel(), GetAllInstances(), and ~AuthenModel().

UStr AuthenModel::oldHome [static, protected]

Definition at line 80 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

The documentation for this class was generated from the following files:
  • common/Authen.h
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 1714 of file Authen.cpp.

01714 {}

virtual AuthenNtserver::~AuthenNtserver ( ) [inline, virtual]

Definition at line 1715 of file Authen.cpp.

01715 {}

Member Function Documentation

virtual AuthenKind AuthenNtserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1717 of file Authen.cpp.

References AuthenKind, and ntserver.

01717 { return ntserver; }

virtual const char* AuthenNtserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1718 of file Authen.cpp.

01718 { return "ntserver"; }

virtual bool AuthenNtserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1721 of file Authen.cpp.

01721 { return true; }

virtual bool AuthenNtserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1720 of file Authen.cpp.

01720 { return false; }

const char * AuthenNtserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1726 of file Authen.cpp.

01727 {
01728     return 0L;
01729 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 bool | HasLogin (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)
virtual void | OnSetupEnv (void)
Setup environment.

virtual void | OnRestoreEnv (void)
Restore environment.

Private Attributes

UStr oldPserverPort

Constructor & Destructor Documentation

AuthenPserver::AuthenPserver ( ) [inline]

Definition at line 1135 of file Authen.cpp.

01135 {}

virtual AuthenPserver::~AuthenPserver ( ) [inline, virtual]

Definition at line 1136 of file Authen.cpp.

01136 {}

Member Function Documentation

void AuthenPserver::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1260 of file Authen.cpp.

References UWidget::DoModal().

01261 {
01262     UAuthen_Pserver* dlg = new UAuthen_Pserver();
01263
01264     try
01265     {
01266 #if qMacCvsPP
01267         dlg->DoModal(3002);
01268 #endif
01269 #ifdef WIN32
01270         dlg->DoModal(IDD_PSERVER);
01271 #endif
01272     }
01273     catch(...)
01274     {
01275     }
01276
01277     delete dlg;
01278 }

virtual AuthenKind AuthenPserver::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1138 of file Authen.cpp.

References AuthenKind, and pserver.

01138 { return pserver; }

void AuthenPserver::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1280 of file Authen.cpp.

01281 {
01282     if( gCvsPrefs.PserverPort() == -1 )
01283         desc << "Using default port and ";
01284     else
01285         desc << "Using port " << gCvsPrefs.PserverPort() << " and ";
01286
01287     if( !gCvsPrefs.UseProxy() )
01288         desc << "no proxy";
01289     else
01290         desc << "using proxy host " << gCvsPrefs.ProxyHost() << " with port " << gCvsPrefs.ProxyPort();
01291 }

virtual const char* AuthenPserver::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1139 of file Authen.cpp.

01139 { return "pserver"; }

virtual bool AuthenPserver::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1142 of file Authen.cpp.

01142 { return true; }

virtual bool AuthenPserver::HasLogin ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1145 of file Authen.cpp.

01145 { return true; }

virtual bool AuthenPserver::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1141 of file Authen.cpp.

01141 { return true; }

virtual bool AuthenPserver::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1143 of file Authen.cpp.

01143 { return true; }

const char * AuthenPserver::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1323 of file Authen.cpp.

01324 {
01325     if( strcmp(env, "CVS_PSERVER_PORT") == 0 )
01326     {
01327         if( gCvsPrefs.PserverPort() != -1 )
01328         {
01329             static char port[10];
01330             sprintf(port, "%d", gCvsPrefs.PserverPort());
01331
01332             return port;
01333         }
01334
01335         return 0L;
01336     }
01337
01338     return 0L;
01339 }

void AuthenPserver::OnRestoreEnv ( void ) [virtual]

Restore environment.

Reimplemented from AuthenModel.

Definition at line 1310 of file Authen.cpp.

References UStr::empty(), oldPserverPort, AuthenModel::OnRestoreEnv(), and unsetenv.

01311 {
01312     AuthenModel::OnRestoreEnv();
01313
01314     if( gCvsPrefs.PserverPort() != -1 )
01315     {
01316         if( oldPserverPort.empty() )
01317                 unsetenv("CVS_PSERVER_PORT");
01318         else
01319                 putenv(oldPserverPort);
01320     }
01321 }

void AuthenPserver::OnSetupEnv ( void ) [virtual]

Setup environment.

Reimplemented from AuthenModel.

Definition at line 1293 of file Authen.cpp.

References getenv, oldPserverPort, and AuthenModel::OnSetupEnv().

01294 {
01295     AuthenModel::OnSetupEnv();
01296
01297     static UStr options;
01298
01299     if( gCvsPrefs.PserverPort() != -1 )
01300     {
01301         oldPserverPort = getenv("CVS_PSERVER_PORT");
01302
01303         options = "CVS_PSERVER_PORT=";
01304         options << gCvsPrefs.PserverPort();
01305
01306         putenv(options);
01307     }
01308 }

Member Data Documentation

UStr AuthenPserver::oldPserverPort [private]

Definition at line 1156 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:42 2003 for WinCvs Source by doxygen 1.3-rc2


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)
Setup environment.

virtual void | OnRestoreEnv (void)
Restore environment.

Private Attributes

UStr oldRsa
UStr oldRhostPort
UStr oldServerName

Constructor & Destructor Documentation

AuthenRhosts::AuthenRhosts ( ) [inline]

Definition at line 1347 of file Authen.cpp.

01347 {}

virtual AuthenRhosts::~AuthenRhosts ( ) [inline, virtual]

Definition at line 1348 of file Authen.cpp.

01348 {}

Member Function Documentation

void AuthenRhosts::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1478 of file Authen.cpp.

References UWidget::DoModal().

01479 {
01480     UAuthen_Rhosts* dlg = new UAuthen_Rhosts();
01481
01482     try
01483     {
01484 #if qMacCvsPP
01485         dlg->DoModal(3001);
01486 #endif
01487 #if WIN32
01488         dlg->DoModal(IDD_RSH);
01489 #endif
01490     }
01491     catch(...)
01492     {
01493     }
01494
01495     delete dlg;
01496 }

virtual AuthenKind AuthenRhosts::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1350 of file Authen.cpp.

References AuthenKind, and rhosts.

01350 { return rhosts; }

void AuthenRhosts::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1498 of file Authen.cpp.

01499 {
01500     if( gCvsPrefs.RhostPort() == -1 )
01501         desc << "Using default port and ";
01502     else
01503         desc << "Using port " << gCvsPrefs.RhostPort() << " and ";
01504
01505     if( gCvsPrefs.RshName() == 0L )
01506         desc << "default shell name";
01507     else
01508         desc << "shell named " << gCvsPrefs.RshName();
01509 }

virtual const char* AuthenRhosts::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1351 of file Authen.cpp.

01351 { return "rhosts"; }

virtual bool AuthenRhosts::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1354 of file Authen.cpp.

01354 { return true; }

virtual bool AuthenRhosts::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1353 of file Authen.cpp.

01353 { return true; }

virtual bool AuthenRhosts::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1355 of file Authen.cpp.

01355 { return true; }

const char * AuthenRhosts::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1568 of file Authen.cpp.

01569 {
01570     if( strcmp(env, "CVS_RSH") == 0 )
01571     {
01572         return (char*)gCvsPrefs.RshName();
01573     }
01574     else if( strcmp(env, "CVS_RCMD_PORT") == 0 )
01575     {
01576         if( gCvsPrefs.RhostPort() != -1 )
01577         {
01578             static char port[10];
01579             sprintf(port, "%d", gCvsPrefs.RhostPort());
01580
01581             return port;
01582         }
01583
01584         return 0L;
01585     }
01586     else if( strcmp(env, "CVS_SERVER") == 0 )
01587     {
01588         return (char*)gCvsPrefs.ServerName();
01589     }
01590
01591     return 0L;
01592 }

void AuthenRhosts::OnRestoreEnv ( void ) [virtual]

Restore environment.

Reimplemented from AuthenModel.

Definition at line 1548 of file Authen.cpp.

References UStr::empty(), oldRhostPort, oldRsa, oldServerName, AuthenModel::OnRestoreEnv(), and unsetenv.

01549 {
01550     AuthenModel::OnRestoreEnv();
01551
01552     if( oldRsa.empty() )
01553         unsetenv("CVS_RSH");
01554     else
01555         putenv(oldRsa);
01556
01557     if( oldRhostPort.empty() )
01558         unsetenv("CVS_RCMD_PORT");
01559     else
01560         putenv(oldRhostPort);
01561
01562     if( oldServerName.empty() )
01563         unsetenv("CVS_SERVER");
01564     else
01565         putenv(oldServerName);
01566 }

void AuthenRhosts::OnSetupEnv ( void ) [virtual]

Setup environment.

Reimplemented from AuthenModel.

Definition at line 1511 of file Authen.cpp.

References getenv, oldRhostPort, oldRsa, oldServerName, AuthenModel::OnSetupEnv(), and server.

01512 {
01513     AuthenModel::OnSetupEnv();
01514
01515     static UStr rsh;
01516     static UStr port;
01517     static UStr server;
01518
01519     oldRsa        = getenv("CVS_RSH");
01520     oldRhostPort  = getenv("CVS_RCMD_PORT");
01521     oldServerName = getenv("CVS_SERVER");
01522
01523     if( gCvsPrefs.RshName() != 0L )
01524     {
01525         rsh = "CVS_RSH=";
01526         rsh << gCvsPrefs.RshName();
01527
01528         putenv(rsh);
01529     }
01530
01531     if( gCvsPrefs.RhostPort() != -1 )
01532     {
01533         port = "CVS_RCMD_PORT=";
01534         port << gCvsPrefs.RhostPort();
01535
01536         putenv(port);
01537     }
01538
01539     if( gCvsPrefs.ServerName() != 0L )
01540     {
01541         server = "CVS_SERVER=";
01542         server << gCvsPrefs.ServerName();
01543
01544         putenv(server);
01545     }
01546 }

Member Data Documentation

UStr AuthenRhosts::oldRhostPort [private]

Definition at line 1366 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

UStr AuthenRhosts::oldRsa [private]

Definition at line 1365 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

UStr AuthenRhosts::oldServerName [private]

Definition at line 1367 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:42 2003 for WinCvs Source by doxygen 1.3-rc2


AuthenServer Class Reference

Inheritance diagram for AuthenServer:

[legend]
Collaboration diagram for AuthenServer:

[legend]
List of all members.

Public Methods

AuthenServer ()
virtual | ~AuthenServer ()
virtual AuthenKind | GetKind (void) const
virtual const char * | GetToken (void) const
virtual bool | HasHost (void) const
virtual bool | HasUser (void) const
virtual const char * | OnGetEnv (char *env)

Constructor & Destructor Documentation

AuthenServer::AuthenServer ( ) [inline]

Definition at line 1929 of file Authen.cpp.

01929 {}

virtual AuthenServer::~AuthenServer ( ) [inline, virtual]

Definition at line 1930 of file Authen.cpp.

01930 {}

Member Function Documentation

virtual AuthenKind AuthenServer::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1932 of file Authen.cpp.

References AuthenKind, and server.

01932 { return server; }

virtual const char* AuthenServer::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1933 of file Authen.cpp.

01933 { return "server"; }

virtual bool AuthenServer::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1935 of file Authen.cpp.

01935 { return true; }

virtual bool AuthenServer::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1936 of file Authen.cpp.

01936 { return true; }

const char * AuthenServer::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1941 of file Authen.cpp.

01942 {
01943     return 0L;
01944 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:43 2003 for WinCvs Source by doxygen 1.3-rc2


CAuthenSetUp Class Reference

Class to setup authentication model and proper environment. More...

#include <AppGlue.h>

List of all members.

Public Methods

CAuthenSetUp ()
virtual ~CAuthenSetUp ()

Detailed Description

Class to setup authentication model and proper environment.

Definition at line 94 of file AppGlue.h.

Constructor & Destructor Documentation

CAuthenSetUp::CAuthenSetUp ( )

Definition at line 750 of file AppGlue.cpp.

References AuthenModel::GetInstance(), and AuthenModel::OnSetupEnv().

00751 {
00752     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00753     if( curModel != 0L )
00754         curModel->OnSetupEnv();
00755 }

CAuthenSetUp::~CAuthenSetUp ( ) [virtual]

Definition at line 757 of file AppGlue.cpp.

References AuthenModel::GetInstance(), and AuthenModel::OnRestoreEnv().

00758 {
00759     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00760     if( curModel != 0L )
00761         curModel->OnRestoreEnv();
00762 }

The documentation for this class was generated from the following files:
  • common/AppGlue.h
  • common/AppGlue.cpp
Generated on Fri Jan 31 12:13:43 2003 for WinCvs Source by doxygen 1.3-rc2


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)
Setup environment.

virtual void | OnRestoreEnv (void)
Restore environment.

Static Public Methods

const char * | RsaIdentityFile (void)

Static Public Attributes

PCStr gSSHName
PCStr gSSHOptions
CPersistentBool gRsaIdentity
CMString gRsaIdentityFile
PCStr gCurRsaIdentity

Private Attributes

UStr oldRsh
UStr oldRsaOptions
UStr oldRsaIdentity

Constructor & Destructor Documentation

AuthenSSH::AuthenSSH ( ) [inline]

Definition at line 704 of file Authen.cpp.

00704 {}

virtual AuthenSSH::~AuthenSSH ( ) [inline, virtual]

Definition at line 705 of file Authen.cpp.

00705 {}

Member Function Documentation

void AuthenSSH::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 991 of file Authen.cpp.

References UWidget::DoModal().

00992 {
00993     UAuthen_SSH* dlg = new UAuthen_SSH();
00994
00995     try
00996     {
00997 #ifdef WIN32
00998         dlg->DoModal(IDD_SSH);
00999 #endif
01000 #if TARGET_RT_MAC_MACHO
01001         dlg->DoModal(3005);
01002 #endif
01003     }
01004     catch(...)
01005     {
01006     }
01007
01008     delete dlg;
01009 }

virtual AuthenKind AuthenSSH::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 707 of file Authen.cpp.

References AuthenKind, and ssh.

00707 { return ssh; }

void AuthenSSH::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1011 of file Authen.cpp.

References UStr::c_str(), UStr::empty(), gRsaIdentity, gSSHOptions, and RsaIdentityFile().

01012 {
01013     if( !gSSHOptions.empty() )
01014     {
01015         desc << "Using ";
01016         desc << gSSHOptions.c_str();
01017         desc << " ";
01018     }
01019
01020     if( (bool)gRsaIdentity )
01021     {
01022         if( gSSHOptions.empty() )
01023             desc << "Using ";
01024
01025         desc << "-i ";
01026         desc << RsaIdentityFile();
01027     }
01028 }

virtual const char* AuthenSSH::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 708 of file Authen.cpp.

00708 { return "ssh"; }

virtual bool AuthenSSH::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 711 of file Authen.cpp.

00711 { return true; }

virtual bool AuthenSSH::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 710 of file Authen.cpp.

00710 { return true; }

virtual bool AuthenSSH::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 712 of file Authen.cpp.

00712 { return true; }

const char * AuthenSSH::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1088 of file Authen.cpp.

References UStr::c_str(), UStr::empty(), gRsaIdentity, gSSHName, gSSHOptions, and RsaIdentityFile().

01089 {
01090     if( strcmp(env, "CVS_RSH") == 0 )
01091     {
01092         return gSSHName.empty() ? "ssh" : (char*)gSSHName.c_str();
01093     }
01094     else if( strcmp(env, "CVS_RSA_OPTIONS") == 0)
01095     {
01096         return gSSHOptions.empty() ? 0L : (char*)gSSHOptions.c_str();
01097     }
01098     else if( strcmp(env, "CVS_RSA_IDENTITY") == 0 && (bool)gRsaIdentity)
01099     {
01100         const char* tmp = RsaIdentityFile();
01101         if( tmp && *tmp )
01102         {
01103 #ifdef WIN32
01104             while( *tmp && iswspace(*tmp) )
01105 #else
01106             while( *tmp && isspace(*tmp) )
01107 #endif
01108                 tmp++;
01109
01110             return *tmp ? (char*)tmp : 0L;
01111         }
01112
01113         return 0L;
01114     }
01115
01116     return 0L;
01117 }

void AuthenSSH::OnRestoreEnv ( void ) [virtual]

Restore environment.

Reimplemented from AuthenModel.

Definition at line 1068 of file Authen.cpp.

References UStr::empty(), oldRsaIdentity, oldRsaOptions, oldRsh, AuthenModel::OnRestoreEnv(), and unsetenv.

01069 {
01070     AuthenModel::OnRestoreEnv();
01071
01072     if( oldRsh.empty() )
01073         unsetenv("CVS_RSH");
01074     else
01075         putenv(oldRsh);
01076
01077     if( oldRsaOptions.empty() )
01078         unsetenv("CVS_RSA_OPTIONS");
01079     else
01080         putenv(oldRsaOptions);
01081
01082     if( oldRsaIdentity.empty() )
01083         unsetenv("CVS_RSA_IDENTITY");
01084     else
01085         putenv(oldRsaIdentity);
01086 }

void AuthenSSH::OnSetupEnv ( void ) [virtual]

Setup environment.

Reimplemented from AuthenModel.

Definition at line 1030 of file Authen.cpp.

References UStr::c_str(), UStr::empty(), getenv, gRsaIdentity, gSSHName, gSSHOptions, oldRsaIdentity, oldRsaOptions, oldRsh, AuthenModel::OnSetupEnv(), and RsaIdentityFile().

01031 {
01032     AuthenModel::OnSetupEnv();
01033
01034     static UStr rsh;
01035     static UStr options;
01036     static UStr identity;
01037
01038     rsh = "CVS_RSH=";
01039
01040     oldRsh         = getenv("CVS_RSH");
01041     oldRsaOptions  = getenv("CVS_RSA_OPTIONS");
01042     oldRsaIdentity = getenv("CVS_RSA_IDENTITY");
01043
01044     if( gSSHName.empty() )
01045         rsh << "ssh";
01046     else
01047         rsh << gSSHName.c_str();
01048
01049     putenv(rsh);
01050
01051     if( !gSSHOptions.empty() )
01052     {
01053         options = "CVS_RSA_OPTIONS=";
01054         options << gSSHOptions.c_str();
01055
01056         putenv(options);
01057     }
01058
01059     if( (bool)gRsaIdentity )
01060     {
01061         identity = "CVS_RSA_IDENTITY=";
01062         identity << RsaIdentityFile();
01063
01064         putenv(identity);
01065     }
01066 }

const char * AuthenSSH::RsaIdentityFile ( void ) [static]

Definition at line 742 of file Authen.cpp.

References UStr::empty(), gCurRsaIdentity, getenv, TMString< UStr >::GetList(), gRsaIdentityFile, and MAX_PATH.

Referenced by UAuthen_SSH::DoDataExchange(), GetSettingsDesc(), OnGetEnv(), and OnSetupEnv().

00743 {
00744     if( gRsaIdentityFile.GetList().size() != 0 )
00745         gCurRsaIdentity = gRsaIdentityFile.GetList()[0];
00746
00747 #ifdef WIN32
00748     // Fill in a default value, if one empty slot
00749     if( gCurRsaIdentity.empty())
00750     {
00751         char* env = getenv( "HOME" );
00752         if( env != 0L )
00753         {
00754             char default_identity_folder[] = ".ssh/identity";
00755             char default_identity[ MAX_PATH ];
00756
00757             _makepath(default_identity, NULL, env, default_identity_folder, NULL);
00758             gCurRsaIdentity = default_identity;
00759         }
00760     }
00761 #endif
00762
00763     return gCurRsaIdentity.empty() ? 0L : (const char*)gCurRsaIdentity;
00764 }

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().

UStr AuthenSSH::oldRsaIdentity [private]

Definition at line 733 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

UStr AuthenSSH::oldRsaOptions [private]

Definition at line 732 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

UStr AuthenSSH::oldRsh [private]

Definition at line 731 of file Authen.cpp.

Referenced by OnRestoreEnv(), and OnSetupEnv().

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:44 2003 for WinCvs Source by doxygen 1.3-rc2


AuthenSspi Class Reference

Inheritance diagram for AuthenSspi:

[legend]
Collaboration diagram for AuthenSspi:

[legend]
List of all members.

Public Methods

AuthenSspi ()
virtual | ~AuthenSspi ()
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 bool | HasEncryption (void) const
virtual bool | HasLogin (void) const
virtual void | DoSettings (void)
virtual void | GetSettingsDesc (UStr &desc)
virtual const char * | OnGetEnv (char *env)

Constructor & Destructor Documentation

AuthenSspi::AuthenSspi ( ) [inline]

Definition at line 1832 of file Authen.cpp.

01832 {}

virtual AuthenSspi::~AuthenSspi ( ) [inline, virtual]

Definition at line 1833 of file Authen.cpp.

01833 {}

Member Function Documentation

void AuthenSspi::DoSettings ( void ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1906 of file Authen.cpp.

References UWidget::DoModal().

01907 {
01908     UAuthen_Sspi* dlg = new UAuthen_Sspi();
01909
01910     try
01911     {
01912 #if WIN32
01913         dlg->DoModal(IDD_SSPI);
01914 #endif
01915     }
01916     catch(...)
01917     {
01918     }
01919
01920     delete dlg;
01921 }

virtual AuthenKind AuthenSspi::GetKind ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1835 of file Authen.cpp.

References AuthenKind, and sspi.

01835 { return sspi; }

void AuthenSspi::GetSettingsDesc ( UStr & desc ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1851 of file Authen.cpp.

01852 {
01853     if( gCvsPrefs.EncryptCommunication() )
01854         desc << "Encryption turned on";
01855     else
01856         desc << "Encryption turned off";
01857 }

virtual const char* AuthenSspi::GetToken ( void ) const [inline, virtual]

Implements AuthenModel.

Definition at line 1836 of file Authen.cpp.

01836 { return "sspi"; }

virtual bool AuthenSspi::HasEncryption ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1842 of file Authen.cpp.

01842 { return true; }

virtual bool AuthenSspi::HasHost ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1839 of file Authen.cpp.

01839 { return true; }

virtual bool AuthenSspi::HasLogin ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1843 of file Authen.cpp.

01843 { return true; }

virtual bool AuthenSspi::HasSettings ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1838 of file Authen.cpp.

01838 { return true; }

virtual bool AuthenSspi::HasUser ( void ) const [inline, virtual]

Reimplemented from AuthenModel.

Definition at line 1840 of file Authen.cpp.

01840 { return true; }

const char * AuthenSspi::OnGetEnv ( char * env ) [virtual]

Reimplemented from AuthenModel.

Definition at line 1859 of file Authen.cpp.

01860 {
01861     return 0L;
01862 }

The documentation for this class was generated from the following file:
  • common/Authen.cpp
Generated on Fri Jan 31 12:13:44 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 Fri Jan 31 12:13:45 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 Fri Jan 31 12:13:45 2003 for WinCvs Source by doxygen 1.3-rc2


CBrowseFileView Class Reference

#include <BrowseFileView.h>

Inheritance diagram for CBrowseFileView:

[legend]
Collaboration diagram for CBrowseFileView:

[legend]
List of all members.

Public Methods

virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
PreCreateWindow virtual override, modify the window style.

virtual | ~CBrowseFileView ()
const UStr & | GetPath () const
Get the current path.

KiColumnModel * | GetColumnModel () const
Get the columnar model of the data.

void | CheckChanges (void)
Force the checking for changes after cvs command ends.

void | OnFilteringChanged ()
void | ResetView (bool notifyBrowser=false, const char *selectFile=0L)
void | ResetView (const char *path, bool notifyBrowser=false, const char *selectFile=0L)

Static Public Methods

int | GetImageForEntry (EntnodeData *data)

Protected Methods

CBrowseFileView ()
virtual void | OnInitialUpdate ()
OnInitialUpdate virtual override, initialize list control and start the refresh timer.

virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
OnBeginPrinting virtual override.

virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
OnPreparePrinting virtual override.

virtual void | OnPrint (CDC *pDC, CPrintInfo *pInfo)
OnPrint virtual override.

afx_msg void | OnViewSmallIcons ()
afx_msg void | OnViewList ()
afx_msg void | OnViewFullRowDetails ()
afx_msg void | OnUpdateViewSmallIcons (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewAdd (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewAddB (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewRelease (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewRmv (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewGraph (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewList (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewEditseldef (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewFullRowDetails (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point)
WM_LBUTTONDBLCLK message handler, edit the selection.

afx_msg void | OnColumnclick (NMHDR *pNMHDR, LRESULT *pResult)
LVN_COLUMNCLICK notification handler, sort items.

afx_msg void | OnViewAdd ()
WM_COMMAND message handler, cvs add selection.

afx_msg void | OnViewAddb ()
WM_COMMAND message handler, cvs add -kb selection.

afx_msg void | OnViewCommit ()
WM_COMMAND message handler, cvs commit selection.

afx_msg void | OnViewRmv ()
WM_COMMAND message handler, cvs remove selection.

afx_msg void | OnViewUpdate ()
WM_COMMAND message handler, cvs update selection.

afx_msg void | OnViewQueryUpdate ()
WM_COMMAND message handler, cvs -n update selection.

afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewReload ()
WM_COMMAND message handler, refresh view.

afx_msg void | OnKeydown (NMHDR *pNMHDR, LRESULT *pResult)
LVN_KEYDOWN notification handler, handle selected keys.

afx_msg void | OnViewUpone ()
WM_COMMAND message handler, go up one directory level unless we are at the root already.

afx_msg void | OnUpdateViewUpone (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewTrash ()
WM_COMMAND message handler, move the selection to trash.

afx_msg void | OnUpdateViewTrash (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewDiff ()
WM_COMMAND message handler, [cvs] diff selection.

afx_msg void | OnViewLog ()
WM_COMMAND message handler, cvs log selection.

afx_msg void | OnViewGraph ()
WM_COMMAND message handler, graph selection.

afx_msg void | OnViewStatus ()
WM_COMMAND message handler, cvs status selection.

afx_msg void | OnViewUnlock ()
WM_COMMAND message handler, cvs admin -u selection.

afx_msg void | OnViewWatchOn ()
WM_COMMAND message handler, cvs watch add selection.

afx_msg void | OnViewWatchOff ()
WM_COMMAND message handler, cvs watch remove selection.

afx_msg void | OnViewEdit ()
WM_COMMAND message handler, cvs edit selection.

afx_msg void | OnViewUnedit ()
WM_COMMAND message handler, cvs unedit selection.

afx_msg void | OnViewWatchers ()
WM_COMMAND message handler, cvs watchers selection.

afx_msg void | OnViewEditors ()
WM_COMMAND message handler, cvs editors selection.

afx_msg void | OnViewRelease ()
WM_COMMAND message handler, cvs release selection.

afx_msg void | OnViewTagNew ()
WM_COMMAND message handler, cvs tag selection.

afx_msg void | OnViewTagDelete ()
WM_COMMAND message handler, cvs tag -d selection.

afx_msg void | OnViewTagBranch ()
WM_COMMAND message handler, cvs tag -b selection.

afx_msg void | OnViewExplore ()
WM_COMMAND message handler, explore the selection.

afx_msg void | OnUpdateViewExplore (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnTimer (UINT nIDEvent)
WM_TIMER message handler, check for the file changes.

afx_msg void | OnViewEditsel ()
WM_COMMAND message handler, edit selection.

afx_msg void | OnViewEditseldef ()
WM_COMMAND message handler, edit selection.

afx_msg void | OnViewCheckout ()
WM_COMMAND message handler, cvs co.

afx_msg void | OnUpdateViewCheckout (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewImport ()
WM_COMMAND message handler, cvs import selection.

afx_msg void | OnUpdateViewImport (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnBegindrag (NMHDR *pNMHDR, LRESULT *pResult)
LVN_BEGINDRAG notification handler.

afx_msg void | OnBeginrdrag (NMHDR *pNMHDR, LRESULT *pResult)
LVN_BEGINRDRAG notification handler.

afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
WM_SETCURSOR message handler, set the hourglass cursor when cvs command is running.

afx_msg void | OnDeleteitem (NMHDR *pNMHDR, LRESULT *pResult)
LVN_DELETEITEM notification handler.

afx_msg void | OnDestroy ()
WM_DESTROY message handler, save settings, unregister change notifications and kill timers.

afx_msg void | OnUpdateViewAnnotate (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnAnnotate ()
WM_COMMAND message handler, cvs annotate selection.

afx_msg void | OnEditSelectAll ()
WM_COMMAND message handler, select all file items.

afx_msg void | OnViewReservededit ()
WM_COMMAND message handler, cvs edit -c selection.

afx_msg void | OnViewForceedit ()
WM_COMMAND message handler, cvs edit -f selection.

afx_msg void | OnViewAddu ()
WM_COMMAND message handler, cvs add -ku selection.

afx_msg void | OnAppCmdline ()
WM_COMMAND message handler, display command line dialog.

afx_msg void | OnUpdateCvsCmd (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnAppRtagbranch ()
WM_COMMAND message handler, cvs rtag -b selection.

afx_msg void | OnAppRtagcreate ()
WM_COMMAND message handler, cvs rtag selection.

afx_msg void | OnAppRtagdelete ()
WM_COMMAND message handler, cvs rtag -d selection.

afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point)
WM_CONTEXTMENU message handler, display the custom menu.

afx_msg void | OnUpdateMacro (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg BOOL | OnMacro (UINT nID)
WM_COMMAND message handler, call the macro on selection.

afx_msg void | OnUpdateCustomize (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg BOOL | OnCustomize (UINT nID)
WM_COMMAND message handler, customize menus.

afx_msg LRESULT | OnFileChange (WPARAM, LPARAM)
KoWatcher::WM_FILECHANGE message handler, mark the files change.

afx_msg LRESULT | OnResetView (WPARAM, LPARAM)
WM_RESETVIEW message handler, reset view.

Private Methods

void | SetFullRowSel (BOOL bFullRowSel)
void | Resort (void)
BOOL | SetViewType (DWORD dwViewType)
DWORD | GetViewType () const
void | GetEntriesModTime (time_t &newEntriesMod, time_t &newEntriesLogMod)
void | EditSel (EntnodeData *data, bool useDefault=false)
void | DoDrag ()
void | SetRecursive (bool isRecursive)
CFrameWnd * GetMainFrame ()
Used for changing the routing of CmdMsg.

bool | ProcessSelectionCommand (KiSelectionHandler *handler)
bool | DisableCommon (bool bCheckSelection=true)
void | SaveColumns ()
bool | LoadColumns ()
void | AddColumns ()
void | DeleteColumns ()
int | GetPathLength (LPCTSTR path)
bool | IsSamePath (LPCTSTR path1, LPCTSTR path2)

Private Attributes

UStr m_path
int | m_numberOfLines
int | m_numberByPages
int | m_numberOfPages
int | m_heightOfLines
bool | m_isRecursive
bool | m_isResetViewLocked
bool | m_isResetViewPending
bool | m_checkChanges
KoWatcher * m_watch
time_t | m_entriesMod
time_t | m_entriesLogMod
bool | m_isFilesChange
UINT | m_uiFilechangeTimer
CSortHeaderCtrl m_ctrlHeader
int | m_sort
bool | m_ascendant
KiColumnModel * m_modelColumns

Static Private Attributes

CImageList | m_smallImageList
CImageList | m_stateImageList

Constructor & Destructor Documentation

CBrowseFileView::CBrowseFileView ( ) [protected]

Definition at line 448 of file BrowseFileView.cpp.

References gFileViewSort, gFileViewSortAsc, m_ascendant, m_entriesLogMod, m_entriesMod, m_sort, NULL, and SetRecursive().

00449     : m_checkChanges(false), m_watch(NULL), m_isResetViewLocked(false), m_isFilesChange(false),
00450     m_isResetViewPending(false), m_uiFilechangeTimer(0)
00451 {
00452     m_sort = (int)gFileViewSort;
00453
00454     SetRecursive(false);
00455
00456     m_ascendant = (bool)gFileViewSortAsc;
00457     m_entriesMod = 0;
00458     m_entriesLogMod = 0;
00459 }

CBrowseFileView::~CBrowseFileView ( ) [virtual]

Definition at line 461 of file BrowseFileView.cpp.

References gFileViewSort, gFileViewSortAsc, m_ascendant, and m_sort.

00462 {
00463     gFileViewSortAsc = m_ascendant;
00464     gFileViewSort = m_sort;
00465 }

Member Function Documentation

void CBrowseFileView::AddColumns ( ) [private]

Add columns to view

Definition at line 609 of file BrowseFileView.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), KiColumnModel::GetCount(), and KiColumn::GetSetupData().

Referenced by OnInitialUpdate(), and ResetView().

00610 {
00611     KiColumnModel* model = GetColumnModel();
00612     int columnCount = model->GetCount();
00613     CListCtrl& listCtrl = GetListCtrl();
00614     for(int i = 0; i<columnCount; i++)
00615     {
00616         LV_COLUMN lvc;
00617         model->GetAt(i)->GetSetupData(&lvc);
00618         lvc.iSubItem = i;
00619         lvc.mask |= LVCF_SUBITEM;
00620         listCtrl.InsertColumn(i,&lvc);
00621     }
00622 }

void CBrowseFileView::CheckChanges ( void ) [inline]

Force the checking for changes after cvs command ends.

Definition at line 331 of file BrowseFileView.h.

Referenced by CWincvsApp::IdleCvsProgress().

00331 { m_checkChanges = true; }

void CBrowseFileView::DeleteColumns ( ) [private]

Delete all columns

Definition at line 627 of file BrowseFileView.cpp.

References GetColumnModel(), and KiColumnModel::GetCount().

Referenced by ResetView().

00628 {
00629     KiColumnModel* model = GetColumnModel();
00630     const int columnCount = model->GetCount();
00631     CListCtrl& listCtrl = GetListCtrl();
00632
00633     for(int i = 0; i < columnCount; i++)
00634     {
00635         listCtrl.DeleteColumn(0);
00636     }
00637 }

bool CBrowseFileView::DisableCommon ( bool bCheckSelection = true ) [private]

Check whether the commands should be disabled

Parameters:
bCheckSelection true if selection should be taken into consideration
Returns:
true if commands should be disabled, false otherwise

Definition at line 1007 of file BrowseFileView.cpp.

References CWincvsApp::IsCvsRunning().

Referenced by OnContextMenu(), OnUpdateMacro(), OnUpdateViewAdd(), OnUpdateViewAddB(), OnUpdateViewAnnotate(), OnUpdateViewCheckout(), OnUpdateViewEditseldef(), OnUpdateViewExplore(), OnUpdateViewGraph(), OnUpdateViewImport(), OnUpdateViewRelease(), OnUpdateViewRmv(), OnUpdateViewTrash(), and OnUpdateViewUpdate().

01008 {
01009     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01010     CListCtrl& ListCtrl = GetListCtrl();
01011     bool bCommon = app->IsCvsRunning() || gCvsPrefs.empty();
01012     bool bSelection = ListCtrl.GetSelectedCount() == 0 || this != CWnd::GetFocus();
01013
01014     return bCheckSelection ? bCommon || bSelection : bCommon;
01015 }

void CBrowseFileView::DoDrag ( ) [private]

Drag and drop

Note:
Implemented by Nikita Jorniak <nikita@tanner.com> Directories are intentionally left out This works to drag files from WinCVS and drop them to any external viewer/editor which supports Windows Shell standard CF_HDROP Clipboard style

Definition at line 2054 of file BrowseFileView.cpp.

References ENT_SUBDIR, FALSE, EntnodeData::GetFullPathName(), EntnodeData::GetType(), and NULL.

Referenced by OnBegindrag(), and OnBeginrdrag().

02055 {
02056     CListCtrl& ListCtrl = GetListCtrl();
02057     int nItem=-1;
02058     int nSize = 0;
02059
02060     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02061     {
02062         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02063         if( data->GetType() != ENT_SUBDIR )
02064         {
02065             UStr buf;
02066             const char* fullpath = data->GetFullPathName(buf);
02067             nSize += strlen(fullpath) + 1;
02068         }
02069     }
02070
02071     if( nSize > 0 )
02072     {
02073         HGLOBAL hMem = GlobalAlloc(GMEM_FIXED, sizeof(DROPFILES)+nSize+1);
02074         if( hMem != NULL )
02075         {
02076             DROPFILES& df = *reinterpret_cast<DROPFILES*>(hMem);
02077             df.pFiles = sizeof(DROPFILES);
02078             df.fNC = FALSE;
02079             df.pt.x = df.pt.y = 0;
02080             df.fWide = FALSE;
02081
02082             nItem=-1;
02083             int Offset = sizeof(DROPFILES);
02084             while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02085             {
02086                 EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02087                 if( data->GetType() != ENT_SUBDIR)
02088                 {
02089                     UStr buf;
02090                     const char* fullpath = data->GetFullPathName(buf);
02091                     int len = strlen(fullpath) + 1;
02092                     memcpy(reinterpret_cast<BYTE*>(hMem)+Offset, fullpath, len);
02093                     Offset+=len;
02094                 }
02095             }
02096
02097             reinterpret_cast<BYTE*>(hMem)[Offset]=0;
02098
02099             COleDataSource ds;
02100             ds.CacheGlobalData( CF_HDROP, hMem );
02101             ds.DoDragDrop( DROPEFFECT_COPY );
02102         }
02103     }
02104 }

void CBrowseFileView::EditSel | ( | EntnodeData * | data,
 |  | bool | useDefault = false
 | ) | [private]

Edit the selection using the editor

Parameters:
data | Node data to be edited
useDefault | true to use the default editor, false otherwise

Definition at line 955 of file BrowseFileView.cpp.

References cvs_err(), ENT_SUBDIR, EntnodeData::GetFullPathName(), EntnodeData::GetType(), LaunchViewer(), ResetView(), and stat.

Referenced by OnKeydown(), OnLButtonDblClk(), OnViewEditsel(), and OnViewEditseldef().

00956 {
00957     UStr buf;
00958     const char* fullpath = data->GetFullPathName(buf);
00959     if( data->GetType() == ENT_SUBDIR )
00960     {
00961         struct stat st;
00962         if( stat(fullpath, &st) != 0 && errno == ENOENT )
00963         {
00964             // Assume we're looking at directory previously in CVS,
00965             // but not currently in the file system.
00966             // If we ever run across another case (permissions perhaps)
00967             // then you might want to add code here.
00968             cvs_err("'%s' is not accessible\n", (char*)fullpath);
00969         }
00970         else
00971         {
00972             ResetView(fullpath, true);
00973             gCvsPrefs.SetLastWorkingDir(fullpath);
00974         }
00975     }
00976     else
00977     {
00978         LaunchViewer(fullpath, useDefault);
00979     }
00980 }

KiColumnModel* CBrowseFileView::GetColumnModel ( ) const [inline]

Get the columnar model of the data.

Definition at line 328 of file BrowseFileView.h.

Referenced by AddColumns(), DeleteColumns(), OnColumnclick(), OnPrint(), ResetView(), and Resort().

00328 { return m_modelColumns; }

void CBrowseFileView::GetEntriesModTime | ( | time_t & | newEntriesMod,
 |  | time_t & | newEntriesLogMod
 | ) | [private]

Get the modification time of the CVS/Entries and CVS/Entries.log files

Parameters:
newEntriesMod | Return the modification time of the CVS/Entries file
newEntriesLogMod | Return the modification time of the CVS/Entries.log file

Definition at line 644 of file BrowseFileView.cpp.

References free, NULL, and stat.

Referenced by OnTimer(), and ResetView().

00645 {
00646     char* szOriginalPath = getcwd(NULL, MAX_PATH);
00647
00648     newEntriesMod = 0;
00649     newEntriesLogMod = 0;
00650
00651     if( chdir(m_path) != 0 )
00652         return;
00653
00654     if( chdir("CVS") != 0 )
00655         return;
00656
00657     struct stat sb;
00658     if( stat("Entries", &sb) != -1 )
00659         newEntriesMod = sb.st_mtime;
00660
00661     if( stat("Entries.log", &sb) != -1 )
00662         newEntriesLogMod = sb.st_mtime;
00663
00664     // Restore the original path to prevent locking the folder we've been checking
00665     if( szOriginalPath )
00666     {
00667         chdir(szOriginalPath);
00668         free(szOriginalPath);
00669         szOriginalPath = NULL;
00670     }
00671 }

int CBrowseFileView::GetImageForEntry ( EntnodeData * data ) [static]

Get the ID of the image which reflects the state of the file/directory

Parameters:
data Node data to get the image for
Returns:
The ID of the image

Definition at line 481 of file BrowseFileView.cpp.

References ENT_FILE, EntnodeData::GetConflict(), EntnodeData::GetType(), EntnodeData::IsIgnored(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), kFileIconBinaryAdded, kFileIconUnicode, kFileIconUnicodeAdded, kFileIconUnicodeMod, EntnodeFile::kOption, and EntnodeFile::kVN.

00482 {
00483     int result = -1;
00484
00485     if( data->GetType() == ENT_FILE )
00486     {
00487         const char* info = 0L;
00488         if( data->IsIgnored() )
00489         {
00490             result = kFileIconIgnored;
00491         }
00492         else if( data->IsUnknown() )
00493         {
00494             result = kFileIconUnknown;
00495         }
00496         else if( data->GetConflict() != 0L )
00497         {
00498             result = kFileIconConflict;
00499         }
00500         else if( data->IsRemoved() )
00501         {
00502             result = kFileIconRemoved;
00503         }
00504         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0 )
00505         {
00506             const char* vn = (*data)[EntnodeFile::kVN];
00507             bool isAdded = vn && (strcmp(vn, "0") == 0);
00508
00509             result = data->IsUnmodified() ? kFileIconBinary :
00510                 isAdded ? kFileIconBinaryAdded : kFileIconBinaryMod;
00511         }
00512         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0 )
00513         {
00514             const char* vn = (*data)[EntnodeFile::kVN];
00515             bool isAdded = vn && (strcmp(vn, "0") == 0);
00516
00517             result = data->IsUnmodified() ? kFileIconUnicode :
00518                 isAdded ? kFileIconUnicodeAdded : kFileIconUnicodeMod;
00519         }
00520         else
00521         {
00522             const char* vn = (*data)[EntnodeFile::kVN];
00523             bool isAdded = vn && (strcmp(vn, "0") == 0);
00524
00525             result = data->IsUnmodified() ? kFileIconText :
00526                 isAdded ? kFileIconAdded : kFileIconTextMod;
00527         }
00528     }
00529     else
00530     {
00531         if( data->IsIgnored() )
00532         {
00533             result = kFolderIconIgnored;
00534         }
00535         else if( data->IsUnknown() )
00536         {
00537             result = kFolderIconUnknown;
00538         }
00539         else
00540         {
00541             result = kFolderIcon;
00542         }
00543     }
00544
00545     return result;
00546 }

CFrameWnd* CBrowseFileView::GetMainFrame ( void ) [inline, private]

Used for changing the routing of CmdMsg.

Definition at line 307 of file BrowseFileView.h.

00307 { return GetRoutingFrame(); }

const UStr& CBrowseFileView::GetPath ( ) const [inline]

Get the current path.

Definition at line 325 of file BrowseFileView.h.

References CStr.

Referenced by CWincvsApp::InitInstance(), OnPrint(), ProcessSelectionCommand(), and Resort().

00325 { return m_path; };

int CBrowseFileView::GetPathLength ( LPCTSTR path ) [private]

Get the path length

Parameters:
path The path to get the length for
Returns:
true on success, false otherwise
Note:
Takes the ending path delimiter into consideration

Definition at line 1423 of file BrowseFileView.cpp.

Referenced by IsSamePath().

01424 {
01425     int len = _tcslen(path);
01426     return (len > 0 && path[len - 1] == kPathDelimiter) ? (len - 1) : len;
01427 }

DWORD CBrowseFileView::GetViewType ( ) const [private]

Get the view type

Returns:
The view type

Definition at line 900 of file BrowseFileView.cpp.

Referenced by OnUpdateViewFullRowDetails(), OnUpdateViewList(), OnUpdateViewSmallIcons(), OnViewFullRowDetails(), OnViewList(), and OnViewSmallIcons().

00901 {
00902     return GetStyle() & LVS_TYPEMASK;
00903 }

bool CBrowseFileView::IsSamePath | ( | LPCTSTR | path1,
 |  | LPCTSTR | path2
 | ) | [private]

Compare two paths

Parameters:
path1 | First path
path2 | Seconds path
Returns:
true if paths are same, false otherwise

Definition at line 1435 of file BrowseFileView.cpp.

References GetPathLength().

Referenced by OnUpdateViewUpone(), and OnViewUpone().

01436 {
01437     int len1 = GetPathLength(path1);
01438     int len2 = GetPathLength(path2);
01439     return len1 == len2 && _tcsicmp(path1, path2) == 0;
01440 }

bool CBrowseFileView::LoadColumns ( void ) [private]

Load column state

Returns:
true on success, false otherwise

Definition at line 2184 of file BrowseFileView.cpp.

References m_ctrlHeader.

Referenced by OnInitialUpdate().

02185 {
02186     CString widths = AfxGetApp()->GetProfileString("FileDetailView", "Column Widths");
02187     CString orders  = AfxGetApp()->GetProfileString("FileDetailView", "Column Order");
02188
02189     if( widths.IsEmpty() || orders.IsEmpty() )
02190     {
02191         return false;
02192     }
02193
02194     int count = m_ctrlHeader.GetItemCount();
02195     int order[128];
02196     for(int i = 0; i < count; ++i)
02197     {
02198         CString strSubString;
02199         AfxExtractSubString(strSubString, widths, i, _T(' '));
02200
02201         const int width = _ttoi(strSubString);
02202         GetListCtrl().SetColumnWidth(i, width);
02203
02204         AfxExtractSubString(strSubString, orders, i, _T(' '));
02205         order[i] = _ttoi(strSubString);
02206     }
02207
02208     m_ctrlHeader.SetOrderArray(count, order);
02209
02210     return true;
02211 }

void CBrowseFileView::OnAnnotate ( ) [protected]

WM_COMMAND message handler, cvs annotate selection.

Definition at line 2287 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

02288 {
02289     KoAnnotateHandler handler;
02290     ProcessSelectionCommand(&handler);
02291 }

void CBrowseFileView::OnAppCmdline ( ) [protected]

WM_COMMAND message handler, display command line dialog.

Definition at line 2314 of file BrowseFileView.cpp.

References KoCommandLineHandler::OnFolder(), and ProcessSelectionCommand().

02315 {
02316     KoCommandLineHandler handler;
02317
02318     if( !ProcessSelectionCommand(&handler) )
02319     {
02320         handler.OnFolder(m_path);
02321     }
02322 }

void CBrowseFileView::OnAppRtagbranch ( ) [protected]

WM_COMMAND message handler, cvs rtag -b selection.

Definition at line 2332 of file BrowseFileView.cpp.

References KoRtagBranchHandler::OnFolder(), and ProcessSelectionCommand().

02333 {
02334     KoRtagBranchHandler handler;
02335
02336     if( !ProcessSelectionCommand(&handler) )
02337     {
02338         handler.OnFolder(m_path);
02339     }
02340 }

void CBrowseFileView::OnAppRtagcreate ( ) [protected]

WM_COMMAND message handler, cvs rtag selection.

Definition at line 2343 of file BrowseFileView.cpp.

References KoRtagCreateHandler::OnFolder(), and ProcessSelectionCommand().

02344 {
02345     KoRtagCreateHandler handler;
02346
02347     if( !ProcessSelectionCommand(&handler) )
02348     {
02349         handler.OnFolder(m_path);
02350     }
02351 }

void CBrowseFileView::OnAppRtagdelete ( ) [protected]

WM_COMMAND message handler, cvs rtag -d selection.

Definition at line 2354 of file BrowseFileView.cpp.

References KoRtagDeleteHandler::OnFolder(), and ProcessSelectionCommand().

02355 {
02356     KoRtagDeleteHandler handler;
02357
02358     if( !ProcessSelectionCommand(&handler) )
02359     {
02360         handler.OnFolder(m_path);
02361     }
02362 }

void CBrowseFileView::OnBegindrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_BEGINDRAG notification handler.

Definition at line 2107 of file BrowseFileView.cpp.

References DoDrag().

02108 {
02109     DoDrag();
02110     *pResult = 0;
02111 }

void CBrowseFileView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnBeginPrinting virtual override.

Definition at line 1816 of file BrowseFileView.cpp.

References m_heightOfLines, m_numberByPages, m_numberOfLines, and m_numberOfPages.

01817 {
01818     CListView::OnBeginPrinting(pDC, pInfo);
01819
01820     int nPageHeight = pDC->GetDeviceCaps(VERTRES);
01821     TEXTMETRIC tm;
01822     pDC->GetTextMetrics(&tm);
01823
01824     // compute the bounds
01825     CListCtrl& ListCtrl = GetListCtrl();
01826     m_numberOfLines = ListCtrl.GetItemCount();
01827     m_heightOfLines = 2 * tm.tmHeight;
01828     m_numberByPages = nPageHeight / m_heightOfLines;
01829     m_numberOfPages = m_numberOfLines / m_numberByPages + 1;
01830
01831     pInfo->SetMaxPage(m_numberOfPages);
01832 }

void CBrowseFileView::OnBeginrdrag | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_BEGINRDRAG notification handler.

Definition at line 2114 of file BrowseFileView.cpp.

References DoDrag().

02115 {
02116     DoDrag();
02117     *pResult = 0;
02118 }

void CBrowseFileView::OnColumnclick | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_COLUMNCLICK notification handler, sort items.

Definition at line 1245 of file BrowseFileView.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), KiColumn::IsDefaultAscending(), m_ascendant, m_sort, and Resort().

01246 {
01247     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01248     CListCtrl& ListCtrl = GetListCtrl();
01249
01250     if( pNMListView->iSubItem == m_sort )
01251     {
01252         m_ascendant = !m_ascendant;
01253     }
01254     else
01255     {
01256         m_ascendant = true;
01257         m_sort = pNMListView->iSubItem;
01258         KiColumnModel* model = GetColumnModel();
01259         m_ascendant = model->GetAt(m_sort)->IsDefaultAscending();
01260     }
01261
01262     Resort();
01263     *pResult = 0;
01264 }

void CBrowseFileView::OnContextMenu | ( | CWnd * | pWnd,
 |  | CPoint | point
 | ) | [protected]

WM_CONTEXTMENU message handler, display the custom menu.

Definition at line 1586 of file BrowseFileView.cpp.

References DisableCommon(), and GetCustomMenu().

01587 {
01588     if( DisableCommon() )
01589     {
01590         return;
01591     }
01592
01593     CListCtrl& listCtrl = GetListCtrl();
01594     if( listCtrl.GetSelectedCount() > 0 )
01595     {
01596         // Try to find a selected and focused item
01597         int item = listCtrl.GetNextItem(-1, LVNI_SELECTED | LVNI_FOCUSED);
01598         if( item == -1 )
01599         {
01600             // Get the first selected item then
01601             item = listCtrl.GetNextItem(-1, LVNI_SELECTED);
01602         }
01603
01604         if( item > -1 )
01605         {
01606             // Set the track point in case it's not the mouse click
01607             if( -1 == point.x && -1 == point.y )
01608             {
01609                 // Get the icon's rectangle
01610                 CRect rectItem;
01611                 if( listCtrl.GetItemRect(item, &rectItem, LVIR_ICON) )
01612                 {
01613                     point = rectItem.CenterPoint();
01614                     ClientToScreen(&point);
01615                 }
01616             }
01617
01618             // Display the pop-up menu
01619             std::auto_ptr<CMenu> pCustomMenu(::GetCustomMenu(kCustomFilesMenu, this));
01620             if( pCustomMenu.get() )
01621             {
01622                 pCustomMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
01623             }
01624         }
01625     }
01626 }

BOOL CBrowseFileView::OnCustomize ( UINT nID ) [protected]

WM_COMMAND message handler, customize menus.

Definition at line 1650 of file BrowseFileView.cpp.

References CustomizeMenus(), and TRUE.

01651 {
01652     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01653     return TRUE;
01654 }

void CBrowseFileView::OnDeleteitem | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_DELETEITEM notification handler.

Definition at line 2239 of file BrowseFileView.cpp.

References EntnodeData::UnRef().

02240 {
02241     NM_LISTVIEW* p = (NM_LISTVIEW*)pNMHDR;
02242     if( p->lParam )
02243     {
02244         EntnodeData* data = (EntnodeData*)(LPVOID)p->lParam;
02245         data->UnRef();
02246     }
02247
02248     *pResult = 0;
02249 }

void CBrowseFileView::OnDestroy ( ) [protected]

WM_DESTROY message handler, save settings, unregister change notifications and kill timers.

Definition at line 2121 of file BrowseFileView.cpp.

References NotificationManager::CheckOut(), CWincvsApp::GetFilterModel(), CWincvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), KiRecursionModel::GetNotificationManager(), KiFilterModel::GetNotificationManager(), CWincvsApp::GetRecursionModel(), m_watch, NULL, SaveColumns(), and KoWatcher::SignalTerminate().

02122 {
02123     SaveColumns();
02124
02125     if( m_watch )
02126     {
02127         m_watch->SignalTerminate();
02128         m_watch = NULL;
02129     }
02130
02131     // Unregister notifications
02132     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
02133     {
02134         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
02135         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
02136         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
02137     }
02138
02139     // Kill the timer
02140     if( m_uiFilechangeTimer )
02141     {
02142         KillTimer(m_uiFilechangeTimer);
02143     }
02144
02145     CListView::OnDestroy();
02146 }

void CBrowseFileView::OnEditSelectAll ( ) [protected]

WM_COMMAND message handler, select all file items.

Definition at line 2294 of file BrowseFileView.cpp.

References ENT_FILE, and EntnodeData::GetType().

02295 {
02296     CListCtrl& ListCtrl = GetListCtrl();
02297
02298     for( int nIndex = 0; nIndex < ListCtrl.GetItemCount(); nIndex++ )
02299     {
02300         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nIndex);
02301         if( data->GetType() == ENT_FILE )
02302         {
02303             ListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
02304         }
02305     }
02306
02307     if( ListCtrl.GetSelectedCount() )
02308     {
02309         ListCtrl.SetFocus();
02310     }
02311 }

LRESULT CBrowseFileView::OnFileChange | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

KoWatcher::WM_FILECHANGE message handler, mark the files change.

Definition at line 1793 of file BrowseFileView.cpp.

References m_isFilesChange.

01794 {
01795     m_isFilesChange = true;
01796     return 0;
01797 }

void CBrowseFileView::OnFilteringChanged ( )

Notify the view that app's filtering has changed

Definition at line 2229 of file BrowseFileView.cpp.

References m_isResetViewPending.

02230 {
02231     if( !m_isResetViewPending )
02232     {
02233         m_isResetViewPending = true;
02234         PostMessage(WM_RESETVIEW);
02235     }
02236 }

void CBrowseFileView::OnInitialUpdate ( ) [protected, virtual]

OnInitialUpdate virtual override, initialize list control and start the refresh timer.

Definition at line 559 of file BrowseFileView.cpp.

References AddColumns(), NotificationManager::CheckIn(), cvs_err(), CWincvsApp::GetFilterModel(), CWincvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), KiRecursionModel::GetNotificationManager(), KiFilterModel::GetNotificationManager(), CWincvsApp::GetRecursionModel(), KoTraversalContext::IsRecursive(), LoadColumns(), m_ctrlHeader, m_smallImageList, m_stateImageList, m_uiFilechangeTimer, SetFullRowSel(), and SetRecursive().

00560 {
00561     CListView::OnInitialUpdate();
00562
00563     CListCtrl& ListCtrl = GetListCtrl();
00564
00565     // Replace standard header with sort header
00566     if( HWND hWnd = ListView_GetHeader(ListCtrl.m_hWnd) )
00567     {
00568         m_ctrlHeader.SubclassWindow(hWnd);
00569     }
00570
00571     ListCtrl.SetExtendedStyle(LVS_EX_HEADERDRAGDROP);
00572
00573     // Set image lists
00574     if( m_smallImageList.m_hImageList == 0L )
00575         m_smallImageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
00576
00577     if( m_stateImageList.m_hImageList == 0L )
00578         m_stateImageList.Create(IDR_STATEICONS, 16, 1, RGB(255, 0, 0));
00579
00580     ListCtrl.SetImageList(&m_smallImageList, LVSIL_SMALL);
00581     ListCtrl.SetImageList(&m_stateImageList, LVSIL_STATE);
00582
00583     KoTraversalContext context(this);
00584     SetRecursive(context.IsRecursive());
00585
00586     AddColumns();
00587     SetFullRowSel(TRUE);
00588
00589     LoadColumns();
00590
00591     // Register for notifications on filter change
00592     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00593     {
00594         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00595         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00596         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00597     }
00598
00599     m_uiFilechangeTimer = SetTimer(FILECHANGE_TIMER, 200, 0L);
00600     if( 0L == m_uiFilechangeTimer )
00601     {
00602         cvs_err("Can't start the file change notification timer.\n");
00603     }
00604 }

void CBrowseFileView::OnKeydown | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_KEYDOWN notification handler, handle selected keys.

Definition at line 1382 of file BrowseFileView.cpp.

References EditSel(), ENT_SUBDIR, EntnodeData::GetFullPathName(), EntnodeData::GetType(), CWincvsApp::IsCvsRunning(), OnViewUpone(), and ResetView().

01383 {
01384     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01385     if( app->IsCvsRunning() )
01386         return;
01387
01388     CListCtrl& ListCtrl = GetListCtrl();
01389     LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
01390
01391     if( pLVKeyDow->wVKey == VK_BACK )
01392     {
01393         OnViewUpone();
01394     }
01395     else if( pLVKeyDow->wVKey == VK_RETURN && ListCtrl.GetSelectedCount() == 1 )
01396     {
01397         int nItem = -1;
01398         if( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01399         {
01400             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01401             if( data->GetType() == ENT_SUBDIR )
01402             {
01403                 UStr buf;
01404                 const char* fullpath = data->GetFullPathName(buf);
01405                 ResetView(fullpath, true);
01406             }
01407             else
01408             {
01409                 EditSel(data);
01410             }
01411         }
01412     }
01413
01414     *pResult = 0;
01415 }

void CBrowseFileView::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

WM_LBUTTONDBLCLK message handler, edit the selection.

Definition at line 983 of file BrowseFileView.cpp.

References EditSel(), and CWincvsApp::IsCvsRunning().

00984 {
00985     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00986     if( app->IsCvsRunning() )
00987         return;
00988
00989     CListCtrl& ListCtrl = GetListCtrl();
00990
00991     UINT pFlags;
00992     int nItem = ListCtrl.HitTest(point, &pFlags);
00993     if( nItem != -1 )
00994     {
00995         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00996         EditSel(data);
00997     }
00998
00999     CListView::OnLButtonDblClk(nFlags, point);
01000 }

BOOL CBrowseFileView::OnMacro ( UINT nID ) [protected]

WM_COMMAND message handler, call the macro on selection.

Definition at line 1663 of file BrowseFileView.cpp.

References PyDoPython(), and WINCMD_to_UCMD.

01664 {
01665     PyDoPython(WINCMD_to_UCMD(nID));
01666
01667     return 1;
01668 }

BOOL CBrowseFileView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

OnPreparePrinting virtual override.

Definition at line 1835 of file BrowseFileView.cpp.

References TRUE.

01836 {
01837     BOOL res = DoPreparePrinting(pInfo);
01838     if( !res )
01839         return res;
01840
01841     return TRUE;
01842 }

void CBrowseFileView::OnPrint | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnPrint virtual override.

Definition at line 1845 of file BrowseFileView.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), KiColumnModel::GetCount(), GetPath(), KiColumn::GetText(), kSpc, and m_numberByPages.

01846 {
01847     if( !pDC->IsPrinting() )
01848         return;
01849
01850     // Now compute the first item to draw
01851     CListCtrl& ListCtrl = GetListCtrl();
01852     int nFirstItem = -1;
01853     int numToIgnore = m_numberByPages * (pInfo->m_nCurPage - 1);
01854
01855     while( numToIgnore-- && (nFirstItem = ListCtrl.GetNextItem(nFirstItem, LVNI_ALL)) != -1 )
01856     {
01857     }
01858
01859     TEXTMETRIC tm;
01860     pDC->GetTextMetrics(&tm);
01861
01862     int nItem = nFirstItem, n = 0;
01863     int horz = pInfo->m_rectDraw.Width();
01864     int vert = pInfo->m_rectDraw.Height();
01865
01866     // Measure for each column
01867     KiColumnModel* model = GetColumnModel();
01868     int columnCount = model->GetCount();
01869     std::vector<int> widths(columnCount, 0);
01870     int totalwidth = 0;
01871     int j;
01872
01873     KoColumnContext context(GetPath());
01874     while( n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1 )
01875     {
01876         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01877         for(j = 0; j < columnCount; j++)
01878         {
01879             TCHAR buffer[256];
01880             model->GetAt(j)->GetText(&context, data, buffer, 256);
01881             int width = pDC->GetTextExtent(buffer, _tcslen(buffer)).cx + kSpc;
01882             widths[j] = max(widths[j], width);
01883         }
01884     }
01885
01886     for(j = 0; j < columnCount; j++)
01887     {
01888         totalwidth += widths[j];
01889     }
01890
01891     for(j = 0; j < columnCount; j++)
01892     {
01893         widths[j] += (horz - totalwidth) / columnCount;
01894     }
01895
01896     // Compute the margins
01897     for(j = columnCount - 1; j >= 0; j--)
01898     {
01899         int margin = 0;
01900         for(int i = j - 1; i >= 0; i--)
01901         {
01902             margin += widths[i];
01903         }
01904
01905         widths[j] = margin;
01906     }
01907
01908     // Now print
01909     nItem = nFirstItem;
01910     n = 0;
01911     CPoint off = pInfo->m_rectDraw.TopLeft();
01912
01913     while( n++ < m_numberByPages && (nItem = ListCtrl.GetNextItem(nItem, LVNI_ALL)) != -1 )
01914     {
01915         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01916         for(j = 0; j < columnCount; j++)
01917         {
01918             const char* info = (*data)[j];
01919             if( info == 0L )
01920                 continue;
01921
01922             CPoint where = off;
01923             where.x += widths[j];
01924             CString s(info);
01925             CRect r(0,0,0,0);
01926
01927             pDC->DrawText(s, -1, &r, DT_CALCRECT);
01928             r.OffsetRect(where);
01929
01930             pDC->DrawText(s, -1, &r, DT_CENTER);
01931         }
01932
01933         off += CPoint(0, m_heightOfLines);
01934     }
01935
01936     //CListView::OnPrint(pDC, pInfo);
01937 }

LRESULT CBrowseFileView::OnResetView | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

WM_RESETVIEW message handler, reset view.

Definition at line 2252 of file BrowseFileView.cpp.

References ResetView().

02253 {
02254     ResetView(false, NULL);
02255     return 0;
02256 }

BOOL CBrowseFileView::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

WM_SETCURSOR message handler, set the hourglass cursor when cvs command is running.

Definition at line 2214 of file BrowseFileView.cpp.

References CWincvsApp::IsCvsRunning(), and TRUE.

02215 {
02216     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02217     if( app->IsCvsRunning() )
02218     {
02219         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
02220         return TRUE;
02221     }
02222
02223     return CListView::OnSetCursor(pWnd, nHitTest, message);
02224 }

void CBrowseFileView::OnTimer ( UINT nIDEvent ) [protected]

WM_TIMER message handler, check for the file changes.

Definition at line 1752 of file BrowseFileView.cpp.

References GetEntriesModTime(), CWincvsApp::IsCvsRunning(), m_checkChanges, m_entriesLogMod, m_entriesMod, m_uiFilechangeTimer, and ResetView().

01753 {
01754     if( nIDEvent == m_uiFilechangeTimer )
01755     {
01756         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01757         if( !app->IsCvsRunning() )
01758         {
01759             // cvs command finished
01760             if( m_checkChanges )
01761             {
01762                 // Refresh the directory tree and file view
01763                 m_checkChanges = false;
01764                 ResetView(true);
01765
01766                 return;
01767             }
01768
01769             // file change
01770             if( m_isFilesChange )
01771             {
01772                 ResetView();
01773             }
01774
01775             // check if we need to reload
01776             time_t newEntriesMod;
01777             time_t newEntriesLogMod;
01778             GetEntriesModTime(newEntriesMod, newEntriesLogMod);
01779
01780             if( m_entriesMod != newEntriesMod || m_entriesLogMod != newEntriesLogMod )
01781             {
01782                 ResetView();
01783             }
01784         }
01785
01786         return;
01787     }
01788
01789     CListView::OnTimer(nIDEvent);
01790 }

void CBrowseFileView::OnUpdateCustomize ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1657 of file BrowseFileView.cpp.

01658 {
01659     pCmdUI->Enable(TRUE);
01660 }

void CBrowseFileView::OnUpdateCvsCmd ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 2325 of file BrowseFileView.cpp.

References FALSE, CWincvsApp::IsCvsRunning(), and TRUE.

02326 {
02327     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02328     pCmdUI->Enable(app->IsCvsRunning() || gCvsPrefs.empty() ? FALSE : TRUE);
02329 }

void CBrowseFileView::OnUpdateMacro ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1671 of file BrowseFileView.cpp.

References DisableCommon(), UCmdUI::pCmdUI, PyAppendCache(), PyDoCmdUI(), PyIsUICacheValid(), and WINCMD_to_UCMD.

01672 {
01673     if( DisableCommon(false) )
01674     {
01675         pCmdUI->Enable(FALSE);
01676         return;
01677     }
01678
01679     // Fill the cache with current selection
01680     if( !PyIsUICacheValid() )
01681     {
01682         CListCtrl& ListCtrl = GetListCtrl();
01683         int nItem = -1;
01684         while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01685         {
01686             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01687             PyAppendCache(data);
01688         }
01689     }
01690
01691     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01692     ucmdui.pCmdUI = pCmdUI;
01693     PyDoCmdUI(&ucmdui);
01694 }

void CBrowseFileView::OnUpdateViewAdd ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1056 of file BrowseFileView.cpp.

References DisableCommon(), ENT_FILE, FALSE, EntnodeData::GetType(), EntnodeData::IsMissing(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), and TRUE.

01057 {
01058     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01059     CListCtrl& ListCtrl = GetListCtrl();
01060
01061     if( DisableCommon() )
01062     {
01063         pCmdUI->Enable(FALSE);
01064         return;
01065     }
01066
01067     int nItem = -1;
01068     BOOL res = TRUE;
01069     int numFiles = 0;
01070     int numFolders = 0;
01071
01072     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01073     {
01074         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01075         if( !(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())) )
01076         {
01077             res = FALSE;
01078             break;
01079         }
01080
01081         if( data->GetType() == ENT_FILE )
01082         {
01083             numFiles++;
01084         }
01085         else
01086             numFolders++;
01087
01088         if( (numFiles != 0 && numFolders != 0) || numFolders > 1 )
01089         {
01090             res = FALSE;
01091             break;
01092         }
01093     }
01094
01095     pCmdUI->Enable(res);
01096 }

void CBrowseFileView::OnUpdateViewAddB ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1099 of file BrowseFileView.cpp.

References DisableCommon(), ENT_FILE, FALSE, EntnodeData::GetType(), EntnodeData::IsMissing(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), and TRUE.

01100 {
01101     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01102     CListCtrl& ListCtrl = GetListCtrl();
01103
01104     if( DisableCommon() )
01105     {
01106         pCmdUI->Enable(FALSE);
01107         return;
01108     }
01109
01110     int nItem = -1;
01111     BOOL res = TRUE;
01112
01113     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01114     {
01115         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01116         if( data->GetType() != ENT_FILE )
01117         {
01118             res = FALSE;
01119             break;
01120         }
01121
01122         if( !(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())) )
01123         {
01124             res = FALSE;
01125             break;
01126         }
01127     }
01128
01129     pCmdUI->Enable(res);
01130 }

void CBrowseFileView::OnUpdateViewAnnotate ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 2259 of file BrowseFileView.cpp.

References DisableCommon(), ENT_SUBDIR, FALSE, EntnodeData::GetType(), EntnodeData::IsUnknown(), and TRUE.

02260 {
02261     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
02262     CListCtrl& ListCtrl = GetListCtrl();
02263
02264     if( DisableCommon() )
02265     {
02266         pCmdUI->Enable(FALSE);
02267         return;
02268     }
02269
02270     int nItem = -1;
02271     BOOL res = TRUE;
02272
02273     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
02274     {
02275         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
02276         if( data->IsUnknown() || data->GetType() == ENT_SUBDIR )
02277         {
02278             res = FALSE;
02279             break;
02280         }
02281     }
02282
02283     pCmdUI->Enable(res);
02284 }

void CBrowseFileView::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 2012 of file BrowseFileView.cpp.

References DisableCommon().

02013 {
02014     if( DisableCommon(false) )
02015     {
02016         pCmdUI->Enable(FALSE);
02017         return;
02018     }
02019
02020     pCmdUI->Enable(TRUE);
02021     pCmdUI->SetText("Chec&kout module...");
02022 }

void CBrowseFileView::OnUpdateViewEditseldef ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1968 of file BrowseFileView.cpp.

References DisableCommon(), ENT_SUBDIR, FALSE, FormatMenuString(), EntnodeData::GetType(), EntnodeData::IsMissing(), and TRUE.

01969 {
01970     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01971     CListCtrl& ListCtrl = GetListCtrl();
01972     if( DisableCommon() )
01973     {
01974         pCmdUI->Enable(FALSE);
01975         return;
01976     }
01977
01978     int nItem = -1;
01979     BOOL res = TRUE;
01980
01981     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01982     {
01983         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01984         if( data->GetType() == ENT_SUBDIR || data->IsMissing() )
01985         {
01986             res = FALSE;
01987             break;
01988         }
01989     }
01990
01991     CString str;
01992     if( FormatMenuString(pCmdUI->m_nID, str) && pCmdUI->m_pParentMenu )
01993     {
01994         pCmdUI->SetText(str);
01995     }
01996
01997     pCmdUI->Enable(res);
01998 }

void CBrowseFileView::OnUpdateViewExplore ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1724 of file BrowseFileView.cpp.

References DisableCommon(), FALSE, EntnodeData::IsMissing(), and TRUE.

01725 {
01726     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01727     CListCtrl& ListCtrl = GetListCtrl();
01728     if( DisableCommon() )
01729     {
01730         pCmdUI->Enable(FALSE);
01731         return;
01732     }
01733
01734     int nItem = -1;
01735     int numItem = 0;
01736     BOOL res = TRUE;
01737
01738     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01739     {
01740         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01741         if( data->IsMissing() || ++numItem > 1 )
01742         {
01743             res = FALSE;
01744             break;
01745         }
01746     }
01747
01748     pCmdUI->Enable(res);
01749 }

void CBrowseFileView::OnUpdateViewFullRowDetails ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 945 of file BrowseFileView.cpp.

References GetViewType().

00946 {
00947     pCmdUI->SetCheck(GetViewType() == LVS_REPORT);
00948 }

void CBrowseFileView::OnUpdateViewGraph ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1174 of file BrowseFileView.cpp.

References DisableCommon(), ENT_SUBDIR, FALSE, EntnodeData::GetType(), EntnodeData::IsUnknown(), and TRUE.

01175 {
01176     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01177     CListCtrl& ListCtrl = GetListCtrl();
01178
01179     if( DisableCommon() )
01180     {
01181         pCmdUI->Enable(FALSE);
01182         return;
01183     }
01184
01185     int nItem = -1;
01186     BOOL res = TRUE;
01187
01188     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01189     {
01190         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01191         if( data->IsUnknown() || data->GetType() == ENT_SUBDIR )
01192         {
01193             res = FALSE;
01194             break;
01195         }
01196     }
01197
01198     pCmdUI->Enable(res);
01199 }

void CBrowseFileView::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 2036 of file BrowseFileView.cpp.

References DisableCommon().

02037 {
02038     if( DisableCommon(false) )
02039     {
02040         pCmdUI->Enable(FALSE);
02041         return;
02042     }
02043
02044     pCmdUI->Enable(TRUE);
02045     pCmdUI->SetText("&Import module...");
02046 }

void CBrowseFileView::OnUpdateViewList ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 939 of file BrowseFileView.cpp.

References GetViewType().

00940 {
00941     pCmdUI->SetCheck(GetViewType() == LVS_LIST);
00942 }

void CBrowseFileView::OnUpdateViewRelease ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1018 of file BrowseFileView.cpp.

References DisableCommon(), ENT_SUBDIR, FALSE, EntnodeData::GetType(), EntnodeData::IsUnknown(), and TRUE.

01019 {
01020     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01021     CListCtrl& ListCtrl = GetListCtrl();
01022
01023     if( DisableCommon() )
01024     {
01025         pCmdUI->Enable(FALSE);
01026         return;
01027     }
01028
01029     int nItem = -1;
01030     BOOL res = TRUE;
01031     int numFiles = 0;
01032     int numFolders = 0;
01033
01034     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01035     {
01036         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01037         if( data->IsUnknown() || data->GetType() != ENT_SUBDIR )
01038         {
01039             res = FALSE;
01040             break;
01041         }
01042
01043         numFolders++;
01044
01045         if( numFolders > 1 )
01046         {
01047             res = FALSE;
01048             break;
01049         }
01050     }
01051
01052     pCmdUI->Enable(res);
01053 }

void CBrowseFileView::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1369 of file BrowseFileView.cpp.

References CWincvsApp::IsCvsRunning().

01370 {
01371     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01372     pCmdUI->Enable(!app->IsCvsRunning());
01373 }

void CBrowseFileView::OnUpdateViewRmv ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1202 of file BrowseFileView.cpp.

References DisableCommon(), ENT_SUBDIR, FALSE, EntnodeData::GetType(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), and TRUE.

01203 {
01204     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01205     CListCtrl& ListCtrl = GetListCtrl();
01206
01207     if( DisableCommon() )
01208     {
01209         pCmdUI->Enable(FALSE);
01210         return;
01211     }
01212
01213     int nItem = -1;
01214     BOOL res = TRUE;
01215
01216     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01217     {
01218         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01219         if( data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR )
01220         {
01221             res = FALSE;
01222             break;
01223         }
01224     }
01225
01226     pCmdUI->Enable(res);
01227 }

void CBrowseFileView::OnUpdateViewSmallIcons ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 933 of file BrowseFileView.cpp.

References GetViewType().

00934 {
00935     pCmdUI->SetCheck(GetViewType() == LVS_SMALLICON);
00936 }

void CBrowseFileView::OnUpdateViewTrash ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1474 of file BrowseFileView.cpp.

References DisableCommon(), KoUpdateMoveToTrashHandler::IsEnabled(), and ProcessSelectionCommand().

01475 {
01476     bool enabled = !DisableCommon();
01477     if( enabled )
01478     {
01479         KoUpdateMoveToTrashHandler handler;
01480         ProcessSelectionCommand(&handler);
01481         enabled = handler.IsEnabled();
01482     }
01483
01484     pCmdUI->Enable(enabled);
01485 }

void CBrowseFileView::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1133 of file BrowseFileView.cpp.

References DisableCommon(), ENT_FILE, FALSE, EntnodeData::GetType(), EntnodeData::IsUnknown(), and TRUE.

01134 {
01135     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01136     CListCtrl& ListCtrl = GetListCtrl();
01137
01138     if( DisableCommon() )
01139     {
01140         pCmdUI->Enable(FALSE);
01141         return;
01142     }
01143
01144     int nItem = -1;
01145     BOOL res = TRUE;
01146     int numFiles = 0;
01147     int numFolders = 0;
01148
01149     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01150     {
01151         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01152         if( data->IsUnknown() )
01153         {
01154             res = FALSE;
01155             break;
01156         }
01157
01158         if( data->GetType() == ENT_FILE )
01159             numFiles++;
01160         else
01161             numFolders++;
01162
01163         if( (numFiles != 0 && numFolders != 0) || numFolders > 1 )
01164         {
01165             res = FALSE;
01166             break;
01167         }
01168     }
01169
01170     pCmdUI->Enable(res);
01171 }

void CBrowseFileView::OnUpdateViewUpone ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1460 of file BrowseFileView.cpp.

References CWincvsApp::GetRoot(), CWincvsApp::IsCvsRunning(), and IsSamePath().

01461 {
01462     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01463     pCmdUI->Enable(!app->IsCvsRunning() && !IsSamePath(m_path, app->GetRoot()));
01464 }

void CBrowseFileView::OnViewAdd ( ) [protected]

WM_COMMAND message handler, cvs add selection.

Definition at line 1320 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01321 {
01322     KoAddHandler handler;
01323     ProcessSelectionCommand(&handler);
01324 }

void CBrowseFileView::OnViewAddb ( ) [protected]

WM_COMMAND message handler, cvs add -kb selection.

Definition at line 1327 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01328 {
01329     KoAddBinaryHandler handler;
01330     ProcessSelectionCommand(&handler);
01331 }

void CBrowseFileView::OnViewAddu ( ) [protected]

WM_COMMAND message handler, cvs add -ku selection.

Definition at line 1334 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01335 {
01336     KoAddUnicodeHandler handler;
01337     ProcessSelectionCommand(&handler);
01338 }

void CBrowseFileView::OnViewCheckout ( ) [protected]

WM_COMMAND message handler, cvs co.

Definition at line 2001 of file BrowseFileView.cpp.

References KoCheckoutHandler::OnFolder(), and ProcessSelectionCommand().

02002 {
02003     KoCheckoutHandler handler;
02004
02005     if( !ProcessSelectionCommand(&handler) )
02006     {
02007         handler.OnFolder(m_path);
02008     }
02009 }

void CBrowseFileView::OnViewCommit ( ) [protected]

WM_COMMAND message handler, cvs commit selection.

Definition at line 1341 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01342 {
01343     KoCommitHandler handler;
01344     ProcessSelectionCommand(&handler);
01345 }

void CBrowseFileView::OnViewDiff ( ) [protected]

WM_COMMAND message handler, [cvs] diff selection.

Definition at line 1488 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01489 {
01490     KoDiffHandler handler;
01491     ProcessSelectionCommand(&handler);
01492 }

void CBrowseFileView::OnViewEdit ( ) [protected]

WM_COMMAND message handler, cvs edit selection.

Definition at line 1537 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01538 {
01539     KoEditHandler handler;
01540     ProcessSelectionCommand(&handler);
01541 }

void CBrowseFileView::OnViewEditors ( ) [protected]

WM_COMMAND message handler, cvs editors selection.

Definition at line 1579 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01580 {
01581     KoEditorsHandler handler;
01582     ProcessSelectionCommand(&handler);
01583 }

void CBrowseFileView::OnViewEditsel ( ) [protected]

WM_COMMAND message handler, edit selection.

Definition at line 1940 of file BrowseFileView.cpp.

References EditSel().

01941 {
01942     CListCtrl& ListCtrl = GetListCtrl();
01943     int nItem = -1;
01944
01945     // First add the folders
01946     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01947     {
01948         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01949         EditSel(data);
01950     }
01951 }

void CBrowseFileView::OnViewEditseldef ( ) [protected]

WM_COMMAND message handler, edit selection.

Definition at line 1954 of file BrowseFileView.cpp.

References EditSel().

01955 {
01956     CListCtrl& ListCtrl = GetListCtrl();
01957     int nItem = -1;
01958
01959     // first add the folders
01960     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01961     {
01962         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01963         EditSel(data, true);
01964     }
01965 }

void CBrowseFileView::OnViewExplore ( ) [protected]

WM_COMMAND message handler, explore the selection.

Definition at line 1697 of file BrowseFileView.cpp.

References cvs_err(), ENT_SUBDIR, EntnodeData::GetFullPathName(), EntnodeData::GetType(), and m_path.

01698 {
01699     const char* fullpath = m_path;
01700
01701     CListCtrl& ListCtrl = GetListCtrl();
01702     int nItem = -1;
01703
01704     // first add the folders
01705     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01706     {
01707         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01708         if( data->GetType() == ENT_SUBDIR )
01709         {
01710             UStr buf;
01711             fullpath = data->GetFullPathName(buf);
01712             break;
01713         }
01714     }
01715
01716     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath, 0L, 0L, SW_SHOWDEFAULT);
01717     if( (long)hInst < 32 )
01718     {
01719         cvs_err("Unable to explore '%s' (error %d)\n", (char *)m_path, GetLastError());
01720     }
01721 }

void CBrowseFileView::OnViewForceedit ( ) [protected]

WM_COMMAND message handler, cvs edit -f selection.

Definition at line 1551 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01552 {
01553     KoForceEditHandler handler;
01554     ProcessSelectionCommand(&handler);
01555 }

void CBrowseFileView::OnViewFullRowDetails ( ) [protected]

Set the full row details view

Definition at line 926 of file BrowseFileView.cpp.

References GetViewType(), and SetViewType().

00927 {
00928     if( GetViewType() != LVS_REPORT )
00929         SetViewType(LVS_REPORT);
00930 }

void CBrowseFileView::OnViewGraph ( ) [protected]

WM_COMMAND message handler, graph selection.

Definition at line 1502 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01503 {
01504     KoGraphHandler handler;
01505     ProcessSelectionCommand(&handler);
01506 }

void CBrowseFileView::OnViewImport ( ) [protected]

WM_COMMAND message handler, cvs import selection.

Definition at line 2025 of file BrowseFileView.cpp.

References KoImportHandler::OnFolder(), and ProcessSelectionCommand().

02026 {
02027     KoImportHandler handler;
02028
02029     if( !ProcessSelectionCommand(&handler) )
02030     {
02031         handler.OnFolder(m_path);
02032     }
02033 }

void CBrowseFileView::OnViewList ( ) [protected]

Set the list view

Definition at line 917 of file BrowseFileView.cpp.

References GetViewType(), and SetViewType().

00918 {
00919     if( GetViewType() != LVS_LIST )
00920         SetViewType(LVS_LIST);
00921 }

void CBrowseFileView::OnViewLog ( ) [protected]

WM_COMMAND message handler, cvs log selection.

Definition at line 1495 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01496 {
01497     KoLogHandler handler;
01498     ProcessSelectionCommand(&handler);
01499 }

void CBrowseFileView::OnViewQueryUpdate ( ) [protected]

WM_COMMAND message handler, cvs -n update selection.

Definition at line 1362 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01363 {
01364     KoQueryUpdateHandler handler;
01365     ProcessSelectionCommand(&handler);
01366 }

void CBrowseFileView::OnViewRelease ( ) [protected]

WM_COMMAND message handler, cvs release selection.

Definition at line 1565 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01566 {
01567     KoReleaseHandler handler;
01568     ProcessSelectionCommand(&handler);
01569 }

void CBrowseFileView::OnViewReload ( ) [protected]

WM_COMMAND message handler, refresh view.

Definition at line 1376 of file BrowseFileView.cpp.

References ResetView().

01377 {
01378     ResetView(true);
01379 }

void CBrowseFileView::OnViewReservededit ( ) [protected]

WM_COMMAND message handler, cvs edit -c selection.

Definition at line 1544 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01545 {
01546     KoReservedEditHandler handler;
01547     ProcessSelectionCommand(&handler);
01548 }

void CBrowseFileView::OnViewRmv ( ) [protected]

WM_COMMAND message handler, cvs remove selection.

Definition at line 1348 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01349 {
01350     KoFileRemoveHandler handler;
01351     ProcessSelectionCommand(&handler);
01352 }

void CBrowseFileView::OnViewSmallIcons ( ) [protected]

Set the small icons view

Definition at line 908 of file BrowseFileView.cpp.

References GetViewType(), and SetViewType().

00909 {
00910     if( GetViewType() != LVS_SMALLICON )
00911         SetViewType(LVS_SMALLICON);
00912 }

void CBrowseFileView::OnViewStatus ( ) [protected]

WM_COMMAND message handler, cvs status selection.

Definition at line 1509 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01510 {
01511     KoStatusHandler handler;
01512     ProcessSelectionCommand(&handler);
01513 }

void CBrowseFileView::OnViewTagBranch ( ) [protected]

WM_COMMAND message handler, cvs tag -b selection.

Definition at line 1643 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01644 {
01645     KoBranchTagHandler handler;
01646     ProcessSelectionCommand(&handler);
01647 }

void CBrowseFileView::OnViewTagDelete ( ) [protected]

WM_COMMAND message handler, cvs tag -d selection.

Definition at line 1636 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01637 {
01638     KoDeleteTagHandler handler;
01639     ProcessSelectionCommand(&handler);
01640 }

void CBrowseFileView::OnViewTagNew ( ) [protected]

WM_COMMAND message handler, cvs tag selection.

Definition at line 1629 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01630 {
01631     KoCreateTagHandler handler;
01632     ProcessSelectionCommand(&handler);
01633 }

void CBrowseFileView::OnViewTrash ( ) [protected]

WM_COMMAND message handler, move the selection to trash.

Definition at line 1467 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01468 {
01469     KoMoveToTrashHandler handler;
01470     ProcessSelectionCommand(&handler);
01471 }

void CBrowseFileView::OnViewUnedit ( ) [protected]

WM_COMMAND message handler, cvs unedit selection.

Definition at line 1558 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01559 {
01560     KoUneditHandler handler;
01561     ProcessSelectionCommand(&handler);
01562 }

void CBrowseFileView::OnViewUnlock ( ) [protected]

WM_COMMAND message handler, cvs admin -u selection.

Definition at line 1516 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01517 {
01518     KoUnlockHandler handler;
01519     ProcessSelectionCommand(&handler);
01520 }

void CBrowseFileView::OnViewUpdate ( ) [protected]

WM_COMMAND message handler, cvs update selection.

Definition at line 1355 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01356 {
01357     KoUpdateHandler handler;
01358     ProcessSelectionCommand(&handler);
01359 }

void CBrowseFileView::OnViewUpone ( ) [protected]

WM_COMMAND message handler, go up one directory level unless we are at the root already.

Definition at line 1443 of file BrowseFileView.cpp.

References CWincvsApp::GetRoot(), IsSamePath(), and ResetView().

Referenced by OnKeydown().

01444 {
01445     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01446     if( !IsSamePath(m_path, app->GetRoot()) && chdir(m_path) == 0 && chdir("..") == 0 )
01447     {
01448         char newpath[1024];
01449         getcwd(newpath, 1023);
01450
01451         ResetView(newpath, true);
01452     }
01453     else
01454     {
01455         MessageBeep(MB_ICONHAND);
01456     }
01457 }

void CBrowseFileView::OnViewWatchers ( ) [protected]

WM_COMMAND message handler, cvs watchers selection.

Definition at line 1572 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01573 {
01574     KoWatchersHandler handler;
01575     ProcessSelectionCommand(&handler);
01576 }

void CBrowseFileView::OnViewWatchOff ( ) [protected]

WM_COMMAND message handler, cvs watch remove selection.

Definition at line 1530 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01531 {
01532     KoWatchOffHandler handler;
01533     ProcessSelectionCommand(&handler);
01534 }

void CBrowseFileView::OnViewWatchOn ( ) [protected]

WM_COMMAND message handler, cvs watch add selection.

Definition at line 1523 of file BrowseFileView.cpp.

References ProcessSelectionCommand().

01524 {
01525     KoWatchOnHandler handler;
01526     ProcessSelectionCommand(&handler);
01527 }

BOOL CBrowseFileView::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

PreCreateWindow virtual override, modify the window style.

Definition at line 468 of file BrowseFileView.cpp.

00469 {
00470     cs.style |= WS_TABSTOP | LVS_SHOWSELALWAYS | LVS_REPORT;
00471     cs.dwExStyle |= LVS_EX_FULLROWSELECT;
00472
00473     return CListView::PreCreateWindow(cs);
00474 }

bool CBrowseFileView::ProcessSelectionCommand ( KiSelectionHandler * handler ) [private]

Process the selection handler command

Parameters:
handler Command selection handler
Returns:
true if the command was processed, false otherwise

Definition at line 1271 of file BrowseFileView.cpp.

References ENT_SUBDIR, EntnodeData::GetFullPathName(), GetPath(), EntnodeData::GetType(), UStr::length(), MultiFiles::newdir(), MultiFiles::newfile(), KiSelectionHandler::OnFiles(), KiSelectionHandler::OnFolder(), and MultiFiles::TotalNumFiles().

Referenced by OnAnnotate(), OnAppCmdline(), OnAppRtagbranch(), OnAppRtagcreate(), OnAppRtagdelete(), OnUpdateViewTrash(), OnViewAdd(), OnViewAddb(), OnViewAddu(), OnViewCheckout(), OnViewCommit(), OnViewDiff(), OnViewEdit(), OnViewEditors(), OnViewForceedit(), OnViewGraph(), OnViewImport(), OnViewLog(), OnViewQueryUpdate(), OnViewRelease(), OnViewReservededit(), OnViewRmv(), OnViewStatus(), OnViewTagBranch(), OnViewTagDelete(), OnViewTagNew(), OnViewTrash(), OnViewUnedit(), OnViewUnlock(), OnViewUpdate(), OnViewWatchers(), OnViewWatchOff(), and OnViewWatchOn().

01272 {
01273     bool res = false;
01274
01275     CListCtrl& ListCtrl = GetListCtrl();
01276     int nItem = -1;
01277     int pathLen = GetPath().length();
01278
01279     MultiFiles mf;
01280
01281     // First add the folders
01282     mf.newdir(GetPath());
01283
01284     // Process selection
01285     while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
01286     {
01287         EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
01288         UStr buf;
01289         const char* fullpath = data->GetFullPathName(buf);
01290
01291         if( data->GetType() == ENT_SUBDIR )
01292         {
01293             handler->OnFolder(fullpath);
01294             res = true;
01295
01296             break;
01297         }
01298         else
01299         {
01300             const char* fn = data->GetFullPathName(buf) + pathLen;
01301             if( *fn == '\\' )
01302             {
01303                 fn++;
01304             }
01305
01306             mf.newfile(fn, 0, (*data)[EntnodeFile::kVN]);
01307         }
01308     }
01309
01310     if( mf.TotalNumFiles() != 0 )
01311     {
01312         handler->OnFiles(&mf);
01313         res = true;
01314     }
01315
01316     return res;
01317 }

void CBrowseFileView::ResetView | ( | const char * | path,
 |  | bool | notifyBrowser = false,
 |  | const char * | selectFile = 0L
 | ) |

Reset the view to the given path

Parameters:
path | Path to reset the view
notifyBrowser | true to notify the directories tree
selectFile | If specified place the selection on this file

Definition at line 857 of file BrowseFileView.cpp.

References CWincvsApp::GetBrowserView(), CWincvsApp::GetDocument(), m_path, ResetView(), and CWinCvsBrowser::StepToLocation().

00858 {
00859     m_path = path;
00860     ResetView(false, selectFile);
00861     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00862     app->GetDocument()->SetTitle(m_path);
00863
00864     if( notifyBrowser )
00865     {
00866         // Notify the dir tree
00867         app->GetBrowserView()->StepToLocation(path);
00868     }
00869 }

void CBrowseFileView::ResetView | ( | bool | notifyBrowser = false,
 |  | const char * | selectFile = 0L
 | ) |

Reload and check for changes

Parameters:
notifyBrowser | true to notify the directories tree
selectFile | If specified place the selection on this file
Note:
Should *not* be called from another thread

Definition at line 679 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_isFilesChange, m_isRecursive, m_isResetViewPending, m_sort, m_watch, NULL, CvsArgs::reset(), CWinCvsBrowser::ResetView(), Resort(), SetRecursive(), KoWatcher::SignalStartWatch(), and VERIFY.

Referenced by EditSel(), CWincvsApp::InitInstance(), CWinCvsBrowser::NotifySelectionChange(), CMainFrame::OnDropFiles(), OnKeydown(), OnResetView(), CMyShellTree::OnSelchanged(), OnTimer(), OnViewReload(), OnViewUpone(), CWinCvsBrowser::ResetView(), and ResetView().

00680 {
00681     // No outstanding request to reset the view any more
00682     m_isResetViewPending = false;
00683
00684     if( m_isResetViewLocked )
00685     {
00686         // No recursion
00687         return;
00688     }
00689
00690     CRecursionLock recursionLock(m_isResetViewLocked);
00691
00692     CWndRedrawMngr redrawMngr(this);
00693
00694     // Reset dirty indicators
00695     m_isFilesChange = false;
00696     GetEntriesModTime(m_entriesMod, m_entriesLogMod);
00697
00698     CWaitCursor doWait;
00699
00700     bool bPartialOK = true;
00701
00702     CListCtrl& ListCtrl = GetListCtrl();
00703
00704     // Get the selection to later try to restore it
00705     CvsArgs selection(false);
00706
00707     if( !selectFile )
00708     {
00709         int nItem = -1;
00710         UStr buf;
00711         while( (nItem = ListCtrl.GetNextItem(nItem, LVNI_SELECTED)) != -1 )
00712         {
00713             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00714             selection.add(data->GetFullPathName(buf));
00715         }
00716     }
00717
00718     // Delete all items
00719     VERIFY(ListCtrl.DeleteAllItems());
00720
00721     // Make sure columns are ok
00722     KoTraversalContext context(this);
00723     if( (context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive) )
00724     {
00725         KiColumnModel* oldModel = GetColumnModel();
00726         int oldCount = oldModel->GetCount();
00727         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00728
00729         DeleteColumns();
00730         SetRecursive(context.IsRecursive());
00731         AddColumns();
00732
00733         if( oldColumn == NULL )
00734         {
00735             m_sort = 0;
00736         }
00737         else
00738         {
00739             KiColumnModel* newModel = GetColumnModel();
00740             int newCount = newModel->GetCount();
00741             int sort = -1;
00742             for(int pos = 0; pos < newCount && sort == -1; pos++)
00743             {
00744                 if( newModel->GetAt(pos) == oldColumn )
00745                 {
00746                     sort = pos;
00747                 }
00748             }
00749
00750             m_sort = (sort >= 0) ? sort : 0;
00751         }
00752     }
00753
00754     // Re-fetch all items
00755     TViewFill traverse(&context);
00756     kTraversal res = FileTraverse(m_path, traverse);
00757
00758     // Find the file for selection
00759     if( selectFile != 0L )
00760     {
00761         int count = ListCtrl.GetItemCount();
00762         for(int i = 0; i < count; i++)
00763         {
00764             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(i);
00765
00766             // Files only
00767             if( data->GetType() == ENT_SUBDIR )
00768                 continue;
00769
00770             UStr buf;
00771             const char* currentFile = data->GetFullPathName(buf);
00772             if( stricmp( selectFile, currentFile) == 0 )
00773             {
00774                 selection.reset(false); //we don't want any other selection
00775                 selection.add(currentFile);
00776
00777                 bPartialOK = FALSE;
00778                 break;
00779             }
00780         }
00781     }
00782
00783     Resort();
00784
00785     // Now restore the selection
00786     int argc = selection.Argc();
00787     char* const* argv = selection.Argv();
00788     bool isFirst = true;
00789     bool focusSet = false;
00790     int count = ListCtrl.GetItemCount();
00791
00792     // If there are no selections, then skip the looping
00793     if( argc )
00794     {
00795         for(int nItem = 0; nItem < count; nItem++)
00796         {
00797             EntnodeData* data = (EntnodeData*)ListCtrl.GetItemData(nItem);
00798             UStr buf;
00799             const char* currentFile = data->GetFullPathName(buf);
00800
00801             for(int i = 0; i < argc; i++)
00802             {
00803                 const char* fn = argv[i];
00804                 if( stricmp(fn, currentFile) == 0 )
00805                 {
00806                     VERIFY(ListCtrl.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED));
00807                     if( isFirst )
00808                     {
00809                         isFirst = false;
00810                         if( !bPartialOK )
00811                         {
00812                             // Move to the bottom first, so the selection will be on top
00813                             ListCtrl.EnsureVisible(ListCtrl.GetItemCount()-1 , bPartialOK);
00814                         }
00815
00816                         // Make sure the first selected file is visible
00817                         VERIFY( ListCtrl.EnsureVisible(nItem, bPartialOK/*TRUE*/) );
00818                         VERIFY( focusSet = (ListCtrl.SetItemState(nItem, LVIS_FOCUSED, LVIS_FOCUSED)!=0) );
00819                     }
00820
00821                     break;
00822                 }
00823             }
00824         }
00825     }
00826
00827     if( !focusSet && ListCtrl.GetItemCount() )
00828     {
00829         VERIFY(focusSet = (ListCtrl.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED) !=0 ));
00830     }
00831
00832     if( notifyBrowser )
00833     {
00834         // Notify the tree
00835         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00836         if( app )
00837         {
00838             app->GetBrowserView()->ResetView(true);
00839         }
00840     }
00841
00842     // Start monitoring file changes
00843     if( !m_watch )
00844     {
00845         m_watch = new KoWatcher(m_hWnd);
00846     }
00847
00848     m_watch->SignalStartWatch(m_path, m_isRecursive);
00849 }

void CBrowseFileView::Resort ( void ) [private]

Resort according to the current key

Definition at line 1232 of file BrowseFileView.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), GetPath(), m_ctrlHeader, and CSortHeaderCtrl::SetSortImage().

Referenced by OnColumnclick(), and ResetView().

01233 {
01234     CListCtrl& ListCtrl = GetListCtrl();
01235     KoColumnContext context(GetPath());
01236     KiColumnModel* model = GetColumnModel();
01237
01238     CSortParam sortParam(m_ascendant, true, model->GetAt(m_sort), model->GetAt(0), &context);
01239     m_ctrlHeader.SetSortImage(m_sort, m_ascendant);
01240
01241     ListCtrl.SortItems(_Compare, (LPARAM)&sortParam);
01242 }

void CBrowseFileView::SaveColumns ( void ) [private]

Save column state

Definition at line 2151 of file BrowseFileView.cpp.

References m_ctrlHeader.

Referenced by OnDestroy().

02152 {
02153     AfxGetApp()->WriteProfileString("FileDetailView", NULL, NULL);
02154
02155     char buffer[2048];
02156     char* cp = buffer;
02157     int count = m_ctrlHeader.GetItemCount();
02158
02159     for(int i = 0; i < count; ++i)
02160     {
02161         int width = GetListCtrl().GetColumnWidth(i);
02162         cp += sprintf(cp, "%d ", width);
02163     }
02164
02165     AfxGetApp()->WriteProfileString("FileDetailView", "Column Widths", buffer);
02166
02167     int order[128];
02168     if( m_ctrlHeader.GetOrderArray(order, count) )
02169     {
02170         cp = buffer;
02171         for(int i = 0; i < count; ++i)
02172         {
02173             cp += sprintf(cp, "%d ", order[i]);
02174         }
02175
02176         AfxGetApp()->WriteProfileString("FileDetailView", "Column Order", buffer);
02177     }
02178 }

void CBrowseFileView::SetFullRowSel ( BOOL bFullRowSel ) [private]

Set the full row selection

Parameters:
bFullRowSel TRUE to set the full row selection, FALSE otherwise

Definition at line 1803 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate().

01804 {
01805     CListCtrl& ListCtrl = GetListCtrl();
01806     DWORD dwExStyle = ListView_GetExtendedListViewStyle(ListCtrl.m_hWnd);
01807     if( bFullRowSel )
01808         dwExStyle |= LVS_EX_FULLROWSELECT;
01809     else
01810         dwExStyle &= ~LVS_EX_FULLROWSELECT;
01811
01812     ListView_SetExtendedListViewStyle(ListCtrl.m_hWnd, dwExStyle);
01813 }

void CBrowseFileView::SetRecursive ( bool isRecursive ) [private]

Set the recursive flag and model

Parameters:
isRecursive New recursive state

Definition at line 552 of file BrowseFileView.cpp.

References KiColumnModel::GetRecursiveModel(), KiColumnModel::GetRegularModel(), m_isRecursive, and m_modelColumns.

Referenced by CBrowseFileView(), OnInitialUpdate(), and ResetView().

00553 {
00554     m_isRecursive = isRecursive;
00555     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
00556 }

BOOL CBrowseFileView::SetViewType ( DWORD dwViewType ) [private]

Set the view type

Parameters:
dwViewType New view type
Returns:
TRUE on success, FALSE otherwise

Definition at line 891 of file BrowseFileView.cpp.

Referenced by OnViewFullRowDetails(), OnViewList(), and OnViewSmallIcons().

00892 {
00893     return ModifyStyle(LVS_TYPEMASK, dwViewType & LVS_TYPEMASK);
00894 }

Member Data Documentation

bool CBrowseFileView::m_ascendant [private]

Sort flag

Definition at line 287 of file BrowseFileView.h.

Referenced by CBrowseFileView(), OnColumnclick(), and ~CBrowseFileView().

bool CBrowseFileView::m_checkChanges [private]

Flag to force checking the changes

Definition at line 278 of file BrowseFileView.h.

Referenced by OnTimer().

CSortHeaderCtrl CBrowseFileView::m_ctrlHeader [private]

Sort header control

Definition at line 285 of file BrowseFileView.h.

Referenced by LoadColumns(), OnInitialUpdate(), Resort(), and SaveColumns().

time_t CBrowseFileView::m_entriesLogMod [private]

CVS/Entries.log

Definition at line 281 of file BrowseFileView.h.

Referenced by CBrowseFileView(), and OnTimer().

time_t CBrowseFileView::m_entriesMod [private]

Time stamp of CVS/Entries

Definition at line 280 of file BrowseFileView.h.

Referenced by CBrowseFileView(), and OnTimer().

int CBrowseFileView::m_heightOfLines [private]

Height of lines (for printing)

Definition at line 272 of file BrowseFileView.h.

Referenced by OnBeginPrinting().

bool CBrowseFileView::m_isFilesChange [private]

Flag to indicate whether a file change notification is pending

Definition at line 282 of file BrowseFileView.h.

Referenced by OnFileChange(), and ResetView().

bool CBrowseFileView::m_isRecursive [private]

true if displaying recursively

Definition at line 274 of file BrowseFileView.h.

Referenced by ResetView(), and SetRecursive().

bool CBrowseFileView::m_isResetViewLocked [private]

Flag to lock out recursion into ResetView()

Definition at line 275 of file BrowseFileView.h.

bool CBrowseFileView::m_isResetViewPending [private]

Flag to indicate whether there is an outstanding request to refresh the view contents

Definition at line 276 of file BrowseFileView.h.

Referenced by OnFilteringChanged(), and ResetView().

KiColumnModel* CBrowseFileView::m_modelColumns [private]

Columnar model in use

Definition at line 289 of file BrowseFileView.h.

Referenced by SetRecursive().

int CBrowseFileView::m_numberByPages [private]

Number by pages (for printing)

Definition at line 270 of file BrowseFileView.h.

Referenced by OnBeginPrinting(), and OnPrint().

int CBrowseFileView::m_numberOfLines [private]

Number of lines (for printing)

Definition at line 269 of file BrowseFileView.h.

Referenced by OnBeginPrinting().

int CBrowseFileView::m_numberOfPages [private]

Number of pages (for printing)

Definition at line 271 of file BrowseFileView.h.

Referenced by OnBeginPrinting().

UStr CBrowseFileView::m_path [private]

Current path

Definition at line 267 of file BrowseFileView.h.

Referenced by OnViewExplore(), and ResetView().

CImageList CBrowseFileView::m_smallImageList [static, private]

File/folder image list

Definition at line 336 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate().

int CBrowseFileView::m_sort [private]

Sort key

Definition at line 286 of file BrowseFileView.h.

Referenced by CBrowseFileView(), OnColumnclick(), ResetView(), and ~CBrowseFileView().

CImageList CBrowseFileView::m_stateImageList [static, private]

File state image list

Definition at line 337 of file BrowseFileView.cpp.

Referenced by OnInitialUpdate().

UINT CBrowseFileView::m_uiFilechangeTimer [private]

Stores the timer event for file's change notification, default to FILECHANGE_TIMER

Definition at line 283 of file BrowseFileView.h.

Referenced by OnInitialUpdate(), and OnTimer().

KoWatcher* CBrowseFileView::m_watch [private]

Thread to monitor file change notifications

Definition at line 279 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 Fri Jan 31 12:13:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 43 of file BrowserBar.cpp.

00044 {
00045 }

CBrowserBar::CBrowserBar ( ) [protected]

Definition at line 39 of file BrowserBar.cpp.

00039                          : m_browser(0L)
00040 {
00041 }

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 82 of file BrowserBar.cpp.

References CWinCvsBrowser::Create(), FALSE, m_browser, TRUE, and VERIFY.

00083 {
00084     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00085     if(!res)
00086         return FALSE;
00087
00088     m_browser = (CWinCvsBrowser *)RUNTIME_CLASS(CWinCvsBrowser)->CreateObject();
00089     VERIFY(m_browser->Create(0L, "", WS_CHILD | WS_VISIBLE | WS_TABSTOP, CRect(0,0,0,0), this, 0));
00090
00091     return TRUE;
00092 }

CWinCvsBrowser* CBrowserBar::GetBrowserView ( void ) [inline]

Definition at line 49 of file BrowserBar.h.

References m_browser.

Referenced by CMainFrame::GetBrowserView().

00049 { return m_browser; }

void CBrowserBar::OnDestroy ( ) [protected]

Definition at line 105 of file BrowserBar.cpp.

References m_browser.

00106 {
00107     if(m_browser)
00108         m_browser->DestroyWindow();
00109
00110     CView::OnDestroy();
00111 }

void CBrowserBar::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 77 of file BrowserBar.cpp.

00078 {
00079     CDocument* pDoc = GetDocument();
00080 }

void CBrowserBar::OnPaint ( ) [protected]

Definition at line 113 of file BrowserBar.cpp.

00114 {
00115     CPaintDC dc(this); // device context for painting
00116
00117     CRect r;
00118     GetClientRect(&r);
00119     CBrush brush(GetSysColor(COLOR_WINDOW));
00120     dc.FillRect(r, &brush);
00121 }

void CBrowserBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 94 of file BrowserBar.cpp.

References m_browser.

00095 {
00096     CView::OnWindowPosChanged(wp);
00097
00098     //m_browser->SetWindowPos(NULL, wp->x, wp->y, wp->cx, wp->cy, SWP_NOZORDER);
00099     CRect r;
00100     GetClientRect(&r);
00101     if(m_browser != 0L)
00102         m_browser->SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00103 }

Member Data Documentation

CWinCvsBrowser* CBrowserBar::m_browser [protected]

Definition at line 67 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 Fri Jan 31 12:13:49 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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 Fri Jan 31 12:13:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 467 of file PythonGlue.cpp.

References m_curSize.

00467               : m_curSize(0)
00468     {
00469     }

Member Function Documentation

void CBuffer::append | ( | const char * | ptr,
 |  | size_t | s
 | ) | [inline]

Definition at line 471 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().

00472     {
00473         if((s + m_curSize) > m_buf.size())
00474         {
00475             size_t step = s > 1024 ? s : 1024;
00476             m_buf.AdjustSize(m_buf.size() + step);
00477         }
00478 #ifdef WIN32
00479         char *tmp = (char *)m_buf + m_curSize;
00480         size_t incs = 0;
00481         while(s--)
00482         {
00483             char c = *ptr++;
00484             if(c == '\r')
00485                 continue;
00486             *tmp++ = c;
00487             incs++;
00488         }
00489         m_curSize += incs;
00490 #elif defined(TARGET_OS_MAC)
00491         char *tmp = (char *)m_buf + m_curSize;
00492         size_t cnt = s;
00493         while(cnt--)
00494         {
00495             char c = *ptr++;
00496             if(c == '\r')
00497                 c = '\n';
00498             *tmp++ = c;
00499         }
00500         m_curSize += s;
00501 #else
00502         memcpy((char *)m_buf + m_curSize, ptr, s * sizeof(char));
00503         m_curSize += s;
00504 #endif
00505     }

CBuffer::operator char * ( void ) const [inline]

Definition at line 508 of file PythonGlue.cpp.

References m_buf.

00508 { return m_buf; }

size_t CBuffer::size ( ) const [inline]

Definition at line 507 of file PythonGlue.cpp.

References m_curSize.

Referenced by cvsgui_RunCvs().

00507 { return m_curSize; }

Member Data Documentation

CStaticAllocT<char> CBuffer::m_buf [protected]

Definition at line 512 of file PythonGlue.cpp.

Referenced by append(), and operator char *().

size_t CBuffer::m_curSize [protected]

Definition at line 511 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 Fri Jan 31 12:13:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:50 2003 for WinCvs Source by doxygen 1.3-rc2


CCharFormat Class Reference

Character format wrapper class. More...

#include <wincvsView.h>

Inheritance diagram for CCharFormat:

[legend]
Collaboration diagram for CCharFormat:

[legend]
List of all members.

Public Methods

CCharFormat ()
CCharFormat (const CHARFORMAT &newf)
operator CHARFORMAT & ()
WCHARFORMAT& operator.

Detailed Description

Character format wrapper class.

Definition at line 47 of file wincvsView.h.

Constructor & Destructor Documentation

CCharFormat::CCharFormat ( ) [inline]

Definition at line 51 of file wincvsView.h.

References ASSERT.

00052     {
00053         USES_CONVERSION;
00054
00055         CString strDefFont = _T("Courier New");
00056         //VERIFY(strDefFont.LoadString(IDS_DEFFONT));
00057
00058         cbSize = sizeof(WCHARFORMAT);
00059         dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_SIZE | CFM_COLOR | CFM_OFFSET | CFM_PROTECTED;
00060         dwEffects = CFE_AUTOCOLOR;
00061         yHeight = 200; //10pt
00062         yOffset = 0;
00063         crTextColor = RGB(0, 0, 0);
00064         bCharSet = 0;
00065         bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
00066
00067         ASSERT(strDefFont.GetLength() < LF_FACESIZE);
00068
00069         lstrcpynA(szFaceName, T2A((LPTSTR)(LPCTSTR)strDefFont), LF_FACESIZE);
00070         dwMask |= CFM_FACE;
00071     }

CCharFormat::CCharFormat ( const CHARFORMAT & newf ) [inline]

Definition at line 73 of file wincvsView.h.

References WCHARFORMAT.

00074     {
00075         *(WCHARFORMAT*)this = newf;
00076     }

Member Function Documentation

CCharFormat::operator CHARFORMAT & ( ) [inline]

WCHARFORMAT& operator.

Definition at line 82 of file wincvsView.h.

References WCHARFORMAT.

00083     {
00084         return *(WCHARFORMAT*)this;
00085     }

The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.h
Generated on Fri Jan 31 12:13:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, const char *modname, const char *path)
~CCheckout_MAIN ()

Public Attributes

CEdit m_checkoutDirEdit
CButton m_overrideCoDirCheck
CEdit m_pathEdit
CSmartComboBox m_moduleCombo
CString | m_moduleName
CString | m_path
BOOL | m_noRecurse
BOOL | m_stdout
BOOL | m_overrideCoDir
CString | m_checkoutDir

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnPath ()
BN_CLICKED message handler, browse for checkout directory.

afx_msg void | OnCheckOverridecheckoutdir ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnBrowseModules ()
BN_CLICKED message handler, browse for file/directory.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 62 of file CheckoutDlg.h.

00062 { IDD = IDD_CHECKOUT_MAIN };

Constructor & Destructor Documentation

CCheckout_MAIN::CCheckout_MAIN | ( | const MultiFiles * | mf,
 |  | const char * | modname,
 |  | const char * | path
 | ) |

Definition at line 71 of file CheckoutDlg.cpp.

References FALSE, CWincvsApp::GetRoot(), m_checkoutDir, m_moduleCombo, m_moduleName, m_noRecurse, m_overrideCoDir, m_path, m_stdout, and USmartCombo::SetItems().

00072     : m_mf(mf), CPropertyPage(CCheckout_MAIN::IDD)
00073 {
00074     //{{AFX_DATA_INIT(CCheckout_MAIN)
00075     m_noRecurse = FALSE;
00076     m_stdout = FALSE;
00077     m_overrideCoDir = FALSE;
00078     m_checkoutDir = _T("");
00079     //}}AFX_DATA_INIT
00080
00081     m_moduleName = modname;
00082     m_path = path;
00083     if( m_path.IsEmpty() )
00084     {
00085         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00086         if( 0L != app )
00087             m_path = app->GetRoot();
00088     }
00089
00090     m_moduleCombo.SetItems(&gOldModules);
00091 }

CCheckout_MAIN::~CCheckout_MAIN ( )

Definition at line 93 of file CheckoutDlg.cpp.

00094 {
00095 }

Member Function Documentation

void CCheckout_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 97 of file CheckoutDlg.cpp.

References DDV_CheckPathExists(), DDV_MinChars(), DDX_ComboMString(), and OnCheckOverridecheckoutdir().

00098 {
00099     CPropertyPage::DoDataExchange(pDX);
00100
00101     //{{AFX_DATA_MAP(CCheckout_MAIN)
00102     DDX_Control(pDX, IDC_EDIT_CHECKOUTDIR, m_checkoutDirEdit);
00103     DDX_Control(pDX, IDC_CHECK_OVERRIDECHECKOUTDIR, m_overrideCoDirCheck);
00104     DDX_Control(pDX, IDC_PATH, m_pathEdit);
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_overrideCoDir);
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::OnBrowseModules ( ) [protected]

BN_CLICKED message handler, browse for file/directory.

Definition at line 176 of file CheckoutDlg.cpp.

References CompatGetModuleListItem(), CStr, m_moduleCombo, and m_moduleName.

00177 {
00178     CStr moduleName;
00179     if( CompatGetModuleListItem(m_mf, moduleName) )
00180     {
00181         m_moduleName = (const char*)moduleName;
00182         m_moduleCombo.SetWindowText(m_moduleName);
00183     }
00184 }

void CCheckout_MAIN::OnBtnPath ( ) [protected]

BN_CLICKED message handler, browse for checkout directory.

Definition at line 138 of file CheckoutDlg.cpp.

References BrowserGetDirectory(), CStr, and m_pathEdit.

00139 {
00140     CString strPath;
00141     m_pathEdit.GetWindowText(strPath);
00142
00143     CStr path(strPath);
00144     if( BrowserGetDirectory("Select a directory to checkout to", path, IsWindow(m_hWnd) ? this : NULL) )
00145     {
00146         m_pathEdit.SetWindowText(path);
00147     }
00148 }

void CCheckout_MAIN::OnCheckOverridecheckoutdir ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 151 of file CheckoutDlg.cpp.

References m_checkoutDirEdit, m_moduleCombo, and m_overrideCoDirCheck.

Referenced by DoDataExchange().

00152 {
00153     BOOL enableCheckoutDir = m_overrideCoDirCheck.GetCheck() != 0;
00154
00155     m_checkoutDirEdit.EnableWindow(enableCheckoutDir);
00156
00157     if( enableCheckoutDir )
00158     {
00159         CString strCheckoutDir;
00160         m_checkoutDirEdit.GetWindowText(strCheckoutDir);
00161         if( strCheckoutDir.IsEmpty() )
00162         {
00163             CString strModuleName;
00164             m_moduleCombo.GetWindowText(strModuleName);
00165
00166             if( !strModuleName.IsEmpty() )
00167             {
00168                 m_checkoutDirEdit.SetWindowText(strModuleName);
00169                 GotoDlgCtrl(&m_checkoutDirEdit);
00170             }
00171         }
00172     }
00173 }

Member Data Documentation

CString CCheckout_MAIN::m_checkoutDir

Definition at line 72 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), and CompatGetCheckout().

CEdit CCheckout_MAIN::m_checkoutDirEdit

Definition at line 63 of file CheckoutDlg.h.

Referenced by OnCheckOverridecheckoutdir().

const MultiFiles* CCheckout_MAIN::m_mf [private]

Definition at line 93 of file CheckoutDlg.h.

CSmartComboBox CCheckout_MAIN::m_moduleCombo

Definition at line 66 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), OnBrowseModules(), and OnCheckOverridecheckoutdir().

CString CCheckout_MAIN::m_moduleName

Definition at line 67 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), CompatGetCheckout(), and OnBrowseModules().

BOOL CCheckout_MAIN::m_noRecurse

Definition at line 69 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), and CompatGetCheckout().

BOOL CCheckout_MAIN::m_overrideCoDir

Definition at line 71 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), and CompatGetCheckout().

CButton CCheckout_MAIN::m_overrideCoDirCheck

Definition at line 64 of file CheckoutDlg.h.

Referenced by OnCheckOverridecheckoutdir().

CString CCheckout_MAIN::m_path

Definition at line 68 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), and CompatGetCheckout().

CEdit CCheckout_MAIN::m_pathEdit

Definition at line 65 of file CheckoutDlg.h.

Referenced by OnBtnPath().

BOOL CCheckout_MAIN::m_stdout

Definition at line 70 of file CheckoutDlg.h.

Referenced by CCheckout_MAIN(), and CompatGetCheckout().

The documentation for this class was generated from the following files:
  • common/CheckoutDlg.h
  • common/CheckoutDlg.cpp
Generated on Fri Jan 31 12:13:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 MultiFiles *mf, const char *rev, const char *date, const char *keyword)
~CCheckout_OPTIONS ()

Public Attributes

CButton m_browseTagButton
CButton m_hasRevCheck
CButton m_hasDateCheck
CKeywordComboBox m_keywordCombo
CStatic m_keywordDescStatic
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
CString | m_keyword

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnRev ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnBrowseTag ()
BN_CLICKED message handler, display browse tag/branch dialog.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initialize the controls.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 107 of file CheckoutDlg.h.

00107 { IDD = IDD_CHECKOUT_OPTIONS };

Constructor & Destructor Documentation

CCheckout_OPTIONS::CCheckout_OPTIONS | ( | const MultiFiles * | mf,
 |  | const char * | rev,
 |  | const char * | date,
 |  | const char * | keyword
 | ) |

Definition at line 188 of file CheckoutDlg.cpp.

References FALSE, m_date, m_dateCombo, m_export, m_forceRoot, m_hasDate, m_hasRev, m_keyword, m_match, m_rev, m_revCombo, and USmartCombo::SetItems().

00190                                      : m_mf(mf), CPropertyPage(CCheckout_OPTIONS::IDD)
00191 {
00192     //{{AFX_DATA_INIT(CCheckout_OPTIONS)
00193     m_date = date;
00194     m_rev = rev;
00195     m_hasDate = FALSE;
00196     m_match = FALSE;
00197     m_hasRev = FALSE;
00198     m_export = FALSE;
00199     m_forceRoot = FALSE;
00200     m_keyword = keyword;
00201     //}}AFX_DATA_INIT
00202
00203     m_revCombo.SetItems(&gRevNames);
00204     m_dateCombo.SetItems(&gDateNames);
00205 }

CCheckout_OPTIONS::~CCheckout_OPTIONS ( )

Definition at line 207 of file CheckoutDlg.cpp.

00208 {
00209 }

Member Function Documentation

void CCheckout_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 211 of file CheckoutDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), OnDate(), and OnRev().

00212 {
00213     CPropertyPage::DoDataExchange(pDX);
00214     //{{AFX_DATA_MAP(CCheckout_OPTIONS)
00215     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00216     DDX_Control(pDX, IDC_REV, m_hasRevCheck);
00217     DDX_Control(pDX, IDC_DATE, m_hasDateCheck);
00218     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00219     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00220     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00221     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00222     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00223     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00224     DDX_Check(pDX, IDC_DATE, m_hasDate);
00225     DDX_Check(pDX, IDC_MATCH, m_match);
00226     DDX_Check(pDX, IDC_REV, m_hasRev);
00227     DDX_Check(pDX, IDC_EXPORT, m_export);
00228     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00229     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00230     //}}AFX_DATA_MAP
00231
00232     if( m_hasRev )
00233     {
00234         DDV_MinChars(pDX, m_rev, 1);
00235     }
00236
00237     if( m_hasDate )
00238     {
00239         DDV_MinChars(pDX, m_date, 1);
00240     }
00241
00242     if( !pDX->m_bSaveAndValidate )
00243     {
00244         OnDate();
00245         OnRev();
00246     }
00247
00248     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00249     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00250 }

void CCheckout_OPTIONS::OnBrowseTag ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 290 of file CheckoutDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

00291 {
00292     CStr tagName;
00293     if( CompatGetTagListItem(m_mf, tagName) )
00294     {
00295         m_rev = (const char*)tagName;
00296         m_revCombo.SetWindowText(m_rev);
00297     }
00298 }

void CCheckout_OPTIONS::OnDate ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 277 of file CheckoutDlg.cpp.

References m_dateCombo, and m_hasDateCheck.

Referenced by DoDataExchange().

00278 {
00279     m_dateCombo.EnableWindow(m_hasDateCheck.GetCheck() != 0);
00280 }

BOOL CCheckout_OPTIONS::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initialize the controls.

Definition at line 265 of file CheckoutDlg.cpp.

References m_keywordCombo, m_keywordDescStatic, CKeywordComboBox::SetDescriptionWnd(), and TRUE.

00266 {
00267     CPropertyPage::OnInitDialog();
00268
00269     // Extra initialization
00270     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00271
00272     return TRUE;  // return TRUE unless you set the focus to a control
00273                   // EXCEPTION: OCX Property Pages should return FALSE
00274 }

void CCheckout_OPTIONS::OnRev ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 283 of file CheckoutDlg.cpp.

References m_browseTagButton, m_hasRevCheck, and m_revCombo.

Referenced by DoDataExchange().

00284 {
00285     m_revCombo.EnableWindow(m_hasRevCheck.GetCheck());
00286     m_browseTagButton.EnableWindow(m_hasRevCheck.GetCheck());
00287 }

Member Data Documentation

CButton CCheckout_OPTIONS::m_browseTagButton

Definition at line 108 of file CheckoutDlg.h.

Referenced by OnRev().

CString CCheckout_OPTIONS::m_date

Definition at line 115 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

CSmartComboBox CCheckout_OPTIONS::m_dateCombo

Definition at line 114 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and OnDate().

BOOL CCheckout_OPTIONS::m_export

Definition at line 120 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

BOOL CCheckout_OPTIONS::m_forceRoot

Definition at line 121 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

BOOL CCheckout_OPTIONS::m_hasDate

Definition at line 117 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

CButton CCheckout_OPTIONS::m_hasDateCheck

Definition at line 110 of file CheckoutDlg.h.

Referenced by OnDate().

BOOL CCheckout_OPTIONS::m_hasRev

Definition at line 119 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

CButton CCheckout_OPTIONS::m_hasRevCheck

Definition at line 109 of file CheckoutDlg.h.

Referenced by OnRev().

CString CCheckout_OPTIONS::m_keyword

Definition at line 122 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

CKeywordComboBox CCheckout_OPTIONS::m_keywordCombo

Definition at line 111 of file CheckoutDlg.h.

Referenced by OnInitDialog().

CStatic CCheckout_OPTIONS::m_keywordDescStatic

Definition at line 112 of file CheckoutDlg.h.

Referenced by OnInitDialog().

BOOL CCheckout_OPTIONS::m_match

Definition at line 118 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), and CompatGetCheckout().

const MultiFiles* CCheckout_OPTIONS::m_mf [private]

Definition at line 144 of file CheckoutDlg.h.

CString CCheckout_OPTIONS::m_rev

Definition at line 116 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), CompatGetCheckout(), and OnBrowseTag().

CSmartComboBox CCheckout_OPTIONS::m_revCombo

Definition at line 113 of file CheckoutDlg.h.

Referenced by CCheckout_OPTIONS(), OnBrowseTag(), and OnRev().

The documentation for this class was generated from the following files:
  • common/CheckoutDlg.h
  • common/CheckoutDlg.cpp
Generated on Fri Jan 31 12:13:52 2003 for WinCvs Source by doxygen 1.3-rc2


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, and m_Font.

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, BT_DIRECTORY, BT_FILE, BT_POPUPMENU, FALSE, GetNextID(), m_eType, m_hIcon, m_nMenu, m_nSubMenuIndx, m_pEditWnd, m_pParentWnd, 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_eType, m_pEditWnd, m_strTitle, 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 CCJBrowseEdit::SetDlgOpenFile().

DWORD CCJBrowseButton::m_dwFlags

Definition at line 101 of file CJBrowseEdit.h.

Referenced by 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().

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().

UINT CCJBrowseButton::m_nSubMenuIndx [protected]

Definition at line 113 of file CJBrowseEdit.h.

Referenced by Create().

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(), and CCJBrowseEdit::SetDlgOwner().

CString CCJBrowseButton::m_strDefExt

Definition at line 99 of file CJBrowseEdit.h.

Referenced by CCJBrowseEdit::SetDlgDefExt().

CString CCJBrowseButton::m_strFileName

Definition at line 100 of file CJBrowseEdit.h.

Referenced by CCJBrowseEdit::SetDlgFileName().

CString CCJBrowseButton::m_strFilter

Definition at line 102 of file CJBrowseEdit.h.

Referenced by 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 Fri Jan 31 12:13:53 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, and CCJBrowseButton::m_strDefExt.

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, and CCJBrowseButton::m_strFileName.

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, and CCJBrowseButton::m_strFilter.

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, and m_btnBrowse.

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, and CCJBrowseButton::m_pParentWnd.

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, and CCJBrowseButton::m_strTitle.

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 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 SetSearchType().

UINT CCJBrowseEdit::m_nMenu [protected]

Definition at line 161 of file CJBrowseEdit.h.

Referenced by SetSearchType().

UINT CCJBrowseEdit::m_nSubMenuIndx [protected]

Definition at line 162 of file CJBrowseEdit.h.

Referenced by SetSearchType().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJBrowseEdit.h
  • WinCvs/CJLib/CJLibrary/CJBrowseEdit.cpp
Generated on Fri Jan 31 12:13:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 LRESULT | OnPushPinButton (UINT lParam, LONG wParam)
afx_msg LRESULT | 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, m_CaptionButton, m_dwExStyle, m_strWindText, 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_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_cx, 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, 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_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, and m_rcChild.

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 588 of file CJCaption.cpp.

References TRUE.

00589 {
00590     // KStowell - overridden for flicker-free drawing.
00591     UNUSED_ALWAYS(pDC);
00592     return TRUE;
00593 }

void CCJCaption::OnPaint ( ) [protected]

Definition at line 235 of file CJCaption.cpp.

References DrawCaptionBack(), DrawCaptionIcon(), and DrawCaptionText().

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 }

LRESULT CCJCaption::OnPushPinButton | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 485 of file CJCaption.cpp.

References 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
00499     return 0;
00500 }

LRESULT CCJCaption::OnPushPinCancel | ( | UINT | lParam,
 |  | LONG | wParam
 | ) | [protected]

Definition at line 502 of file CJCaption.cpp.

References _delete, m_CaptionButton, m_pNotifyWnd, and m_pWndPopDown.

00503 {
00504     UNUSED_ALWAYS( lParam );
00505     UNUSED_ALWAYS( wParam );
00506
00507     m_CaptionButton.SetState(FALSE);
00508     m_pWndPopDown->DestroyWindow();
00509
00510     _delete( m_pWndPopDown );
00511
00512     m_pNotifyWnd->SendMessage(CM_ONPUSHPINCANCEL, 0, 0);
00513
00514     return 0;
00515 }

void CCJCaption::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

Definition at line 444 of file CJCaption.cpp.

References m_CaptionButton, 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.

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, and m_rcChild.

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.

Referenced by CCJCaption().

00238     { m_dwTextStyle = dwStyle; }

void CCJCaption::UpdateCaption | ( | LPCTSTR | lpszWindowText,
 |  | HICON | hIcon
 | ) | [virtual]

Definition at line 517 of file CJCaption.cpp.

References ASSERT, DrawCaptionIcon(), m_hIcon, m_strWindText, UpdateCaptionBack(), and UpdateCaptionText().

00518 {
00519     ASSERT(::IsWindow(m_hWnd));
00520
00521     CRect rcClient;
00522     GetClientRect(&rcClient);
00523     CDC* pDC = GetDC();
00524
00525     UpdateCaptionBack(pDC, rcClient);
00526
00527     if( lpszWindowText )
00528     {
00529         m_strWindText = lpszWindowText;
00530         UpdateCaptionText(pDC, rcClient);
00531     }
00532
00533     if( hIcon ) {
00534         m_hIcon = hIcon;
00535         DrawCaptionIcon( pDC, rcClient );
00536     }
00537
00538     ReleaseDC(pDC);
00539 }

void CCJCaption::UpdateCaptionBack | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 541 of file CJCaption.cpp.

References m_nBorder.

Referenced by UpdateCaption().

00542 {
00543     CRect rc = rcItem;
00544
00545     // Set the background mode to transparent.
00546     pDC->SetBkMode( TRANSPARENT );
00547
00548     rc.DeflateRect(1,1);
00549     // repaint the background.
00550     pDC->FillSolidRect( rc, m_clrBtnFace );
00551
00552     // draw the caption banner border.
00553     if( m_nBorder != 0 ) {
00554         rc.DeflateRect( m_nBorder-1, m_nBorder-1 );
00555         pDC->FillSolidRect(rc, m_clrBackgnd);
00556     }
00557 }

void CCJCaption::UpdateCaptionText | ( | CDC * | pDC,
 |  | CRect & | rcItem
 | ) | [virtual]

Definition at line 559 of file CJCaption.cpp.

References DrawCaptionText(), m_CaptionButton, and m_strWindText.

Referenced by UpdateCaption().

00560 {
00561     CFont* pOldFont = pDC->SelectObject(m_pFont);
00562
00563     TEXTMETRIC tm;
00564     pDC->GetTextMetrics(&tm);
00565
00566     CSize size = pDC->GetTextExtent(m_strWindText, m_strWindText.GetLength());
00567     size.cx += tm.tmAveCharWidth+21;
00568     pDC->SelectObject(pOldFont);
00569
00570     CRect rc( 0, 0, size.cx, rcItem.Height() );
00571     rc.DeflateRect(m_nBorder+1, m_nBorder+1);
00572     m_CaptionButton.MoveWindow(rc);
00573     m_CaptionButton.SetWindowText(m_strWindText);
00574
00575     DrawCaptionText( pDC, rcItem );
00576 }

void CCJCaption::UpdateFont ( ) [virtual]

Definition at line 578 of file CJCaption.cpp.

References m_Font, m_pFont, and VERIFY.

Referenced by Create().

00579 {
00580     m_Font.DeleteObject();
00581     NONCLIENTMETRICS ncm;
00582     ncm.cbSize = sizeof(ncm);
00583     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00584     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00585     m_pFont = &m_Font;
00586 }

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().

COLORREF CCJCaption::m_clrBorder [protected]

Definition at line 148 of file CJCaption.h.

Referenced by CCJCaption().

COLORREF CCJCaption::m_clrBtnFace [protected]

Definition at line 147 of file CJCaption.h.

Referenced by CCJCaption(), and OnSysColorChange().

COLORREF CCJCaption::m_clrBtnHilite [protected]

Definition at line 145 of file CJCaption.h.

Referenced by CCJCaption(), and OnSysColorChange().

COLORREF CCJCaption::m_clrBtnShadow [protected]

Definition at line 146 of file CJCaption.h.

Referenced by CCJCaption(), and OnSysColorChange().

COLORREF CCJCaption::m_clrFont [protected]

Definition at line 150 of file CJCaption.h.

Referenced by CCJCaption().

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.

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(), and UpdateCaptionBack().

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(), DrawCaptionText(), ModifyCaptionStyle(), 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 Fri Jan 31 12:13:56 2003 for WinCvs Source by doxygen 1.3-rc2


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_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 Fri Jan 31 12:13:56 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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, m_Caption, m_CaptionButton, m_hIconOff, m_hIconOn, m_pChildParent, m_pChildWnd, m_pParentWnd, NULL, CCJFlatButton::SetIcon(), and TRUE.

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 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_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 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(), and Create().

HICON CCJCaptionPopupWnd::m_hIconOn [protected]

Definition at line 77 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd(), and Create().

CWnd* CCJCaptionPopupWnd::m_pChildParent

Definition at line 73 of file CJCaptionPopupWnd.h.

Referenced by CCJCaptionPopupWnd(), and Create().

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 Fri Jan 31 12:13:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:58 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, 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 GetColor(), m_bActive, m_pParentWnd, 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(), 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(), 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(), 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.

00090 { m_bTrackSelection = bTracking; }

void CCJColorPicker::SetWindowSize ( ) [protected]

Definition at line 384 of file CJColorPicker.cpp.

References m_ArrowRect, and m_pParentWnd.

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 SetBkColor().

COLORREF CCJColorPicker::m_crColorText [protected]

Definition at line 128 of file CJColorPicker.h.

Referenced by 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(), and SetCustomText().

CString CCJColorPicker::m_strDefaultText [protected]

Definition at line 131 of file CJColorPicker.h.

Referenced by CCJColorPicker(), 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 Fri Jan 31 12:13:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 BOOL | OnEraseBkgnd (CDC *pDC)
afx_msg void | OnActivateApp (BOOL bActive, HTASK hTask)

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(), 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 CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, DrawCell(), GetColor(), INVALID_Color, m_crColor, 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, GetCellRect(), GetColor(), m_CustomTextRect, m_DefaultTextRect, m_nChosenColorSel, m_nCurrentSel, m_nMargin, 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 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_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 955 of file CJColorPopup.cpp.

00959 {
00960     CWnd::OnActivateApp(bActive, hTask);
00961
00962     // If Deactivating App, cancel this selection
00963     if (!bActive)
00964          EndSelection(CPN_SELENDCANCEL);
00965 }

BOOL CCJColorPopup::OnEraseBkgnd ( CDC * pDC ) [protected]

Definition at line 977 of file CJColorPopup.cpp.

References TRUE.

00978 {
00979     // KStowell - overridden for flicker-free drawing.
00980     UNUSED_ALWAYS(pDC);
00981     return TRUE;
00982 }

void CCJColorPopup::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

Definition at line 280 of file CJColorPopup.cpp.

References ChangeSelection(), CUSTOM_BOX_VALUE, DEFAULT_BOX_VALUE, EndSelection(), GetColumn(), GetIndex(), GetRow(), INVALID_Color, m_crColor, m_crInitialColor, 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 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_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 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_nMargin, m_nNumColors, m_nNumColumns, m_nNumRows, m_pParent, m_strCustomText, m_strDefaultText, m_WindowRect, and NUM_COLUMNS.

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 967 of file CJColorPopup.cpp.

References m_Font, and VERIFY.

Referenced by Create().

00968 {
00969     m_Font.DeleteObject();
00970     NONCLIENTMETRICS ncm;
00971     ncm.cbSize = sizeof(ncm);
00972     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
00973     VERIFY(m_Font.CreateFontIndirect(&ncm.lfMessageFont));
00974     SetFont(&m_Font);
00975 }

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.

COLORREF CCJColorPopup::m_crInitialColor [protected]

Definition at line 130 of file CJColorPopup.h.

Referenced by CCJColorPopup(), 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 UpdateFont(), and ~CCJColorPopup().

int CCJColorPopup::m_nBoxSize [protected]

Definition at line 122 of file CJColorPopup.h.

Referenced by GetCellRect(), and Initialise().

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(), 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(), 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 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 Fri Jan 31 12:14:00 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 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.

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.

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.

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.

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.

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.

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 Fri Jan 31 12:14:01 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, 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, IsFloating(), IsHorzDocked(), m_bGripper, 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.

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, and CCJTabCtrlBar.

Definition at line 980 of file CJControlBar.cpp.

References GetMinExt(), IsFloating(), IsVertDocked(), m_bToFit, 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.

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.

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.

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 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(), DrawGriperCaption(), 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(), DrawGriperCaption(), 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.

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, CCJTabCtrlBar, and CBarConsole.

Definition at line 688 of file CJControlBar.cpp.

References CCJFlatButton::DisableFlatLook(), m_bFlatBorder, m_bFlatGripper, m_btnClose, m_btnMinim, m_hIcon, m_ImageList, m_ToolTip, and CCJFlatButton::SetIcon().

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, 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_popupMenu, m_popupMenuID, 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, and CCJTabCtrlBar.

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.

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.

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.

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().

BOOL CCJControlBar::m_bButtons [protected]

Definition at line 262 of file CJControlBar.h.

Referenced by CCJControlBar(), GetGripperRect(), GetMinExt(), OnUpdateCmdUI(), and PreTranslateMessage().

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(), DrawGriperCaption(), DrawGripper(), and GetMinExt().

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().

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(), and OnUpdateCmdUI().

HICON CCJControlBar::m_hIcon [protected]

Reimplemented in CCJExplorerBar.

Definition at line 292 of file CJControlBar.h.

Referenced by CCJControlBar(), and OnCreate().

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().

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().

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(), and OnRButtonDown().

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(), Maximize(), Minimize(), Normalize(), and OnLButtonUp().

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(), and OnLButtonUp().

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 Fri Jan 31 12:14:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

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 Fri Jan 31 12:14:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:06 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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 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 Fri Jan 31 12:14:07 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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(), m_Caption, m_CaptionButton, m_hIcon, 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.

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(), and OnCreate().

CString CCJExplorerBar::m_strCaption [protected]

Definition at line 87 of file CJExplorerBar.h.

Referenced by CCJExplorerBar(), and Create().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJExplorerBar.h
  • WinCvs/CJLib/CJLibrary/CJExplorerBar.cpp
Generated on Fri Jan 31 12:14:08 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, and CPseudoToggle.

Definition at line 266 of file CJFlatButton.cpp.

References ASSERT, DrawButtonBitmap(), DrawButtonIcon(), and DrawButtonText().

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 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.

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, 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(), and SetAlternateColors().

COLORREF CCJFlatButton::m_clrNormal [protected]

Definition at line 154 of file CJFlatButton.h.

Referenced by OnSysColorChange(), and SetAlternateColors().

COLORREF CCJFlatButton::m_clrShadow [protected]

Definition at line 152 of file CJFlatButton.h.

Referenced by OnSysColorChange(), 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 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 Fri Jan 31 12:14:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 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, and m_bHasFocus.

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 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, and PointInRect().

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, 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, PointInRect(), 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 OnSysColorChange().

COLORREF CCJFlatComboBox::m_clrNormal [protected]

Definition at line 158 of file CJFlatComboBox.h.

Referenced by OnSysColorChange().

COLORREF CCJFlatComboBox::m_clrShadow [protected]

Definition at line 157 of file CJFlatComboBox.h.

Referenced by OnSysColorChange().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJFlatComboBox.h
  • WinCvs/CJLib/CJLibrary/CJFlatComboBox.cpp
Generated on Fri Jan 31 12:14:10 2003 for WinCvs Source by doxygen 1.3-rc2


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_nOffset, and m_nSortCol.

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_popupMenu, m_popupMenuID, 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.

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 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 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 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 Fri Jan 31 12:14:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 296 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenCol, and NULL.

00297 {
00298     ASSERT_VALID( this );
00299     ASSERT( m_nCols > 1 );
00300     ASSERT( nColHide < m_nCols );
00301     ASSERT( m_nHiddenCol == -1 );
00302     m_nHiddenCol = nColHide;
00303
00304     // if the column has an active window -- change it
00305     int nActiveRow, nActiveCol;
00306     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00307     {
00308         if( nActiveCol == nColHide )
00309         {
00310             if( ++nActiveCol >= m_nCols )
00311                 nActiveCol = 0;
00312             SetActivePane( nActiveRow, nActiveCol );
00313         }
00314     }
00315
00316     // hide all column panes
00317     for( int nRow = 0; nRow < m_nRows; nRow++)
00318     {
00319         CWnd* pPaneHide = GetPane(nRow, nColHide);
00320         ASSERT( pPaneHide != NULL );
00321
00322         pPaneHide->ShowWindow(SW_HIDE);
00323         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00324
00325         for( int nCol = nColHide + 1; nCol < m_nCols; nCol++ )
00326         {
00327             CWnd* pPane = GetPane( nRow, nCol );
00328             ASSERT( pPane != NULL );
00329
00330             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol - 1 ));
00331         }
00332     }
00333
00334     m_nCols--;
00335     m_pColInfo[m_nCols].nCurSize = m_pColInfo[nColHide].nCurSize;
00336     RecalcLayout();
00337 }

void CCJFlatSplitterWnd::HideRow ( int nRowHide ) [virtual]

Definition at line 211 of file CJFlatSplitterWnd.cpp.

References ASSERT, m_nHiddenRow, and NULL.

00212 {
00213     ASSERT_VALID( this );
00214     ASSERT( m_nRows > 1 );
00215     ASSERT( nRowHide < m_nRows );
00216     ASSERT( m_nHiddenRow == -1 );
00217     m_nHiddenRow = nRowHide;
00218
00219     int nActiveRow, nActiveCol;
00220
00221     // if the nRow has an active window -- change it
00222     if( GetActivePane( &nActiveRow, &nActiveCol ) != NULL )
00223     {
00224         if( nActiveRow == nRowHide )
00225         {
00226             if( ++nActiveRow >= m_nRows )
00227                 nActiveRow = 0;
00228             SetActivePane( nActiveRow, nActiveCol );
00229         }
00230     }
00231
00232     // hide all nRow panes.
00233     for( int nCol = 0; nCol < m_nCols; ++nCol )
00234     {
00235         CWnd* pPaneHide = GetPane( nRowHide, nCol );
00236         ASSERT( pPaneHide != NULL );
00237
00238         pPaneHide->ShowWindow( SW_HIDE );
00239         pPaneHide->SetDlgCtrlID( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00240
00241         for( int nRow = nRowHide+1; nRow < m_nRows; ++nRow )
00242         {
00243             CWnd* pPane = GetPane( nRow, nCol );
00244             ASSERT( pPane != NULL );
00245
00246             pPane->SetDlgCtrlID( IdFromRowCol( nRow-1, nCol ));
00247         }
00248     }
00249
00250     m_nRows--;
00251     m_pRowInfo[m_nRows].nCurSize = m_pRowInfo[nRowHide].nCurSize;
00252     RecalcLayout();
00253 }

void CCJFlatSplitterWnd::OnDrawSplitter | ( | CDC * | pDC,
 |  | ESplitType | nType,
 |  | const CRect & | rect
 | ) | [virtual]

Definition at line 87 of file CJFlatSplitterWnd.cpp.

References ASSERT, 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 #if _MFC_VER < 0x700
00106             ASSERT(afxData.bWin4);
00107 #endif
00108             pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrBtnFace);
00109             rect.InflateRect(-CX_BORDER, -CY_BORDER);
00110             pDC->Draw3dRect(rect, afxData.clrBtnShadow, afxData.clrBtnHilite);
00111             return;
00112
00113         case splitIntersection:
00114 #if _MFC_VER < 0x700
00115             ASSERT(!afxData.bWin4);
00116 #endif
00117             break;
00118
00119         case splitBox:
00120 #if _MFC_VER < 0x700
00121             if (afxData.bWin4)
00122 #endif
00123             {
00124                 pDC->Draw3dRect(rect, afxData.clrBtnFace, afxData.clrWindowFrame);
00125                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00126                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00127                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00128                 break;
00129             }
00130             // fall through...
00131         case splitBar:
00132 #if _MFC_VER < 0x700
00133             if (!afxData.bWin4)
00134 #endif
00135             {
00136                 pDC->Draw3dRect(rect, afxData.clrBtnHilite, afxData.clrBtnShadow);
00137                 rect.InflateRect(-CX_BORDER, -CY_BORDER);
00138             }
00139             break;
00140
00141         default:
00142             ASSERT(FALSE);  // unknown splitter type
00143         }
00144
00145         // fill the middle
00146         pDC->FillSolidRect(rect, afxData.clrBtnFace);
00147     }
00148
00149     else {
00150         CSplitterWnd::OnDrawSplitter(pDC, nType, rectArg);
00151     }
00152 }

void CCJFlatSplitterWnd::OnPaint ( ) [protected]

Definition at line 154 of file CJFlatSplitterWnd.cpp.

References OnDrawSplitter().

00155 {
00156     if( m_bFlatSplitter )
00157     {
00158         ASSERT_VALID(this);
00159         CPaintDC dc(this);
00160
00161         CRect rectClient;
00162         GetClientRect(&rectClient);
00163
00164         CRect rectInside;
00165         GetInsideRect(rectInside);
00166         rectInside.InflateRect(4,4);
00167
00168         // draw the splitter boxes
00169         if (m_bHasVScroll && m_nRows < m_nMaxRows)
00170         {
00171             OnDrawSplitter(&dc, splitBox,
00172                 CRect(rectInside.right, rectClient.top,
00173                 rectClient.right, rectClient.top + m_cySplitter));
00174         }
00175
00176         if (m_bHasHScroll && m_nCols < m_nMaxCols)
00177         {
00178             OnDrawSplitter(&dc, splitBox,
00179                 CRect(rectClient.left, rectInside.bottom,
00180                 rectClient.left + m_cxSplitter, rectClient.bottom));
00181         }
00182
00183         // extend split bars to window border (past margins)
00184         DrawAllSplitBars(&dc, rectInside.right, rectInside.bottom);
00185
00186         // draw splitter intersections (inside only)
00187         GetInsideRect(rectInside);
00188         dc.IntersectClipRect(rectInside);
00189         CRect rect;
00190         rect.top = rectInside.top;
00191         for (int row = 0; row < m_nRows - 1; row++)
00192         {
00193             rect.top += m_pRowInfo[row].nCurSize + m_cyBorderShare;
00194             rect.bottom = rect.top + m_cySplitter;
00195             rect.left = rectInside.left;
00196             for (int col = 0; col < m_nCols - 1; col++)
00197             {
00198                 rect.left += m_pColInfo[col].nCurSize + m_cxBorderShare;
00199                 rect.right = rect.left + m_cxSplitter;
00200                 OnDrawSplitter(&dc, splitIntersection, rect);
00201                 rect.left = rect.right + m_cxBorderShare;
00202             }
00203             rect.top = rect.bottom + m_cxBorderShare;
00204         }
00205     }
00206     else {
00207         CSplitterWnd::OnPaint();
00208     }
00209 }

BOOL CCJFlatSplitterWnd::ReplaceView | ( | int | nRow,
 |  | int | nCol,
 |  | CRuntimeClass * | pViewClass
 | ) | [virtual]

Definition at line 380 of file CJFlatSplitterWnd.cpp.

References FALSE, and TRUE.

00381 {
00382     CView *pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00383     ASSERT_KINDOF( CView, pView );
00384
00385     if( pView->IsKindOf( pViewClass ))
00386         return FALSE;
00387
00388     // Get pointer to CDocument object so that it can be used in the creation
00389     // process of the new view
00390     CDocument *pDoc = pView->GetDocument();
00391
00392     int nID = pView->GetDlgCtrlID();
00393     int nWidth, nHeight, nMinWidth, nMinHeight;
00394
00395     GetRowInfo( nRow, nWidth, nMinWidth );
00396     GetColumnInfo( nCol, nHeight, nMinHeight );
00397
00398     // Delete existing view
00399     DeleteView(nRow, nCol);
00400
00401     // Create new view
00402     CCreateContext context;
00403     context.m_pCurrentDoc = pDoc;
00404     CreateView( nRow, nCol, pViewClass, CSize( nWidth, nHeight ), &context );
00405     pView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00406     ASSERT_KINDOF( CView, pView );
00407
00408     pView->SetDlgCtrlID( nID );
00409
00410     SetRowInfo( nRow, nWidth, nMinWidth );
00411     SetColumnInfo( nCol, nHeight, nMinHeight );
00412     RecalcLayout();
00413
00414     return TRUE;
00415 }

void CCJFlatSplitterWnd::ShowColumn ( ) [virtual]

Definition at line 339 of file CJFlatSplitterWnd.cpp.

References ASSERT, and m_nHiddenCol.

00340 {
00341     ASSERT_VALID( this );
00342     ASSERT( m_nCols < m_nMaxCols );
00343     ASSERT( m_nHiddenCol != -1 );
00344
00345     int nShowCol = m_nHiddenCol;
00346     m_nHiddenCol = -1;
00347
00348     int cxNew = m_pColInfo[m_nCols].nCurSize;
00349     m_nCols++;  // add a column
00350
00351     ASSERT( m_nCols == m_nMaxCols );
00352
00353     int nCol;
00354
00355     // Show the hidden column
00356     for( int nRow = 0; nRow < m_nRows; ++nRow )
00357     {
00358         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+m_nCols + 16*nRow );
00359         ASSERT( pPaneShow != NULL );
00360         pPaneShow->ShowWindow( SW_SHOWNA );
00361
00362         for( nCol = m_nCols - 2; nCol >= nShowCol; --nCol )
00363         {
00364             CWnd* pPane = GetPane( nRow, nCol );
00365             ASSERT( pPane != NULL );
00366             pPane->SetDlgCtrlID( IdFromRowCol( nRow, nCol + 1 ));
00367         }
00368
00369         pPaneShow->SetDlgCtrlID( IdFromRowCol( nRow, nShowCol ));
00370     }
00371
00372     // new panes have been created -- recalculate layout
00373     for( nCol = nShowCol+1; nCol < m_nCols; nCol++ )
00374         m_pColInfo[nCol].nIdealSize = m_pColInfo[nCol - 1].nCurSize;
00375
00376     m_pColInfo[nShowCol].nIdealSize = cxNew;
00377     RecalcLayout();
00378 }

void CCJFlatSplitterWnd::ShowRow ( ) [virtual]

Definition at line 255 of file CJFlatSplitterWnd.cpp.

References ASSERT, and m_nHiddenRow.

00256 {
00257     ASSERT_VALID( this );
00258     ASSERT( m_nRows < m_nMaxRows );
00259     ASSERT( m_nHiddenRow != -1 );
00260
00261     int nShowRow = m_nHiddenRow;
00262     m_nHiddenRow = -1;
00263
00264     int cyNew = m_pRowInfo[m_nRows].nCurSize;
00265     m_nRows++;  // add a nRow
00266
00267     ASSERT( m_nRows == m_nMaxRows );
00268
00269     int nRow;
00270
00271     // Show the hidden nRow
00272     for( int nCol = 0; nCol < m_nCols; ++nCol )
00273     {
00274         CWnd* pPaneShow = GetDlgItem( AFX_IDW_PANE_FIRST+nCol + 16*m_nRows );
00275         ASSERT( pPaneShow != NULL );
00276         pPaneShow->ShowWindow( SW_SHOWNA );
00277
00278         for( nRow = m_nRows - 2; nRow >= nShowRow; --nRow )
00279         {
00280             CWnd* pPane = GetPane( nRow, nCol );
00281             ASSERT( pPane != NULL );
00282             pPane->SetDlgCtrlID( IdFromRowCol( nRow + 1, nCol ));
00283         }
00284
00285         pPaneShow->SetDlgCtrlID( IdFromRowCol( nShowRow, nCol ));
00286     }
00287
00288     // new panes have been created -- recalculate layout
00289     for( nRow = nShowRow+1; nRow < m_nRows; nRow++ )
00290         m_pRowInfo[nRow].nIdealSize = m_pRowInfo[nRow - 1].nCurSize;
00291
00292     m_pRowInfo[nShowRow].nIdealSize = cyNew;
00293     RecalcLayout();
00294 }

BOOL CCJFlatSplitterWnd::SwitchView | ( | int | nRow,
 |  | int | nCol,
 |  | CView * | pNewView
 | ) | [virtual]

Definition at line 417 of file CJFlatSplitterWnd.cpp.

References FALSE, and TRUE.

00418 {
00419     CView *pOldView = DYNAMIC_DOWNCAST( CView, GetPane( nRow, nCol ));
00420     ASSERT_KINDOF( CView, pOldView );
00421
00422     if( pOldView == pNewView )
00423         return FALSE;
00424
00425     int nOldID, nNewID;
00426
00427     nOldID = pOldView->GetDlgCtrlID();
00428     nNewID = pNewView->GetDlgCtrlID();
00429
00430     pOldView->ShowWindow(SW_HIDE);
00431     pNewView->ShowWindow(SW_SHOW);
00432
00433     pOldView->SetDlgCtrlID(nNewID);
00434     pNewView->SetDlgCtrlID(nOldID);
00435
00436     RecalcLayout();
00437
00438     return TRUE;
00439 }

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 Fri Jan 31 12:14:12 2003 for WinCvs Source by doxygen 1.3-rc2


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_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 m_BoldFont, and m_Font.

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.

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_iClientHeight, and m_TabList.

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, 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, and CCJMetaFileButton::SetMetaFiles().

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_iCurSel, m_iTotalTabWidth, m_iXOffset, and m_TabList.

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, 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(), 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(), 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(), 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(), and OnSize().

CCJMetaFileButton* CCJFlatTabCtrl::m_pHomeButton [private]

Definition at line 151 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl(), EnableButtons(), OnCreate(), and OnSize().

CCJMetaFileButton* CCJFlatTabCtrl::m_pLeftButton [private]

Definition at line 149 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl(), EnableButtons(), OnCreate(), and OnSize().

CCJMetaFileButton* CCJFlatTabCtrl::m_pRightButton [private]

Definition at line 150 of file CJFlatTabCtrl.h.

Referenced by CCJFlatTabCtrl(), EnableButtons(), OnCreate(), and OnSize().

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 Fri Jan 31 12:14:14 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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(), and SetNormalColors().

COLORREF CCJFontCombo::m_clrHilight [protected]

Definition at line 62 of file CJFontCombo.h.

Referenced by CCJFontCombo(), and SetHilightColors().

COLORREF CCJFontCombo::m_clrHilightText [protected]

Definition at line 64 of file CJFontCombo.h.

Referenced by CCJFontCombo(), and SetHilightColors().

COLORREF CCJFontCombo::m_clrNormalText [protected]

Definition at line 63 of file CJFontCombo.h.

Referenced by CCJFontCombo(), 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 Fri Jan 31 12:14:15 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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.

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.

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(), 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 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 Fri Jan 31 12:14:16 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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.

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.

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.

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.

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, 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, IsSelected(), 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_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_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 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_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_selEnd, m_selStart, Move(), 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, 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_currentMode, 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(), 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(), 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(), 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(), OnLButtonDown(), OnPaint(), and RepositionCaret().

int CCJHexEdit::m_lpp

Definition at line 54 of file CJHexEdit.h.

Referenced by CalcPos(), CCJHexEdit(), Move(), OnPaint(), OnVScroll(), ScrollIntoView(), and UpdateScrollbars().

int CCJHexEdit::m_nullWidth

Definition at line 63 of file CJHexEdit.h.

Referenced by CalcPos(), 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(), OnChar(), OnLButtonDown(), OnMouseMove(), OnPaint(), OnSetFocus(), OnVScroll(), SelDelete(), SelInsert(), and SetData().

int CCJHexEdit::m_selEnd

Definition at line 52 of file CJHexEdit.h.

Referenced by CCJHexEdit(), NormalizeSel(), OnEditCopy(), OnEditSelectAll(), OnKeyDown(), OnLButtonDown(), OnMouseMove(), OnPaint(), and SetSel().

int CCJHexEdit::m_selStart

Definition at line 51 of file CJHexEdit.h.

Referenced by CCJHexEdit(), IsSelected(), NormalizeSel(), OnEditClear(), OnEditCopy(), 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 Fri Jan 31 12:14:18 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

00252     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoBack(); }

_CJXLIB_INLINE void CCJHtmlView::GoForward ( )

Definition at line 254 of file CJHtmlView.h.

References ASSERT, and m_pBrowserApp.

00255     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoForward(); }

_CJXLIB_INLINE void CCJHtmlView::GoHome ( )

Definition at line 257 of file CJHtmlView.h.

References ASSERT, and m_pBrowserApp.

00258     { ASSERT(m_pBrowserApp != NULL); m_pBrowserApp->GoHome(); }

_CJXLIB_INLINE void CCJHtmlView::GoSearch ( )

Definition at line 260 of file CJHtmlView.h.

References ASSERT, and m_pBrowserApp.

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(), 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(), 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, and m_pBrowserApp.

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, and MakeOleVariant().

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 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.

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, and m_wndBrowser.

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, 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, 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, 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, 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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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, and m_pBrowserApp.

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(), 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 Fri Jan 31 12:14:21 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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.

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, 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.

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(), and SetDefaultCursor().

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, and PositionWindow().

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(), GetHoverColor(), and SetColors().

COLORREF CCJHyperLink::m_crLinkColor [protected]

Definition at line 94 of file CJHyperLink.h.

Referenced by CCJHyperLink(), GetLinkColor(), and SetColors().

COLORREF CCJHyperLink::m_crVisitedColor [protected]

Definition at line 94 of file CJHyperLink.h.

Referenced by CCJHyperLink(), GetVisitedColor(), and SetColors().

CFont CCJHyperLink::m_Font [protected]

Definition at line 101 of file CJHyperLink.h.

Referenced by PreSubclassWindow(), SetUnderline(), and ~CCJHyperLink().

HCURSOR CCJHyperLink::m_hLinkCursor [protected]

Definition at line 102 of file CJHyperLink.h.

Referenced by CCJHyperLink(), GetLinkCursor(), SetDefaultCursor(), and SetLinkCursor().

CString CCJHyperLink::m_strURL [protected]

Definition at line 100 of file CJHyperLink.h.

Referenced by CCJHyperLink(), GetURL(), 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 Fri Jan 31 12:14:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:22 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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(), and m_nMaxColWidth.

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.

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.

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.

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 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(), and SubclassHeader().

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().

CString CCJListCtrl::m_strEntry [protected]

Definition at line 105 of file CJListCtrl.h.

Referenced by AutoSaveColumns().

CString CCJListCtrl::m_strSection [protected]

Definition at line 104 of file CJListCtrl.h.

Referenced by AutoSaveColumns().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJListCtrl.h
  • WinCvs/CJLib/CJLibrary/CJListCtrl.cpp
Generated on Fri Jan 31 12:14:24 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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, 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.

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.

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.

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 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(), and SubclassHeader().

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().

CString CCJListView::m_strEntry [protected]

Definition at line 104 of file CJListView.h.

Referenced by AutoSaveColumns().

CString CCJListView::m_strSection [protected]

Definition at line 103 of file CJListView.h.

Referenced by AutoSaveColumns().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJListView.h
  • WinCvs/CJLib/CJLibrary/CJListView.cpp
Generated on Fri Jan 31 12:14:26 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 SetLogoFont(), and ~CCJLogoPane().

CString CCJLogoPane::m_strLogoText

Definition at line 41 of file CJLogoPane.h.

Referenced by Create(), GetLogoText(), 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 Fri Jan 31 12:14:26 2003 for WinCvs Source by doxygen 1.3-rc2


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, and CCJTimeEdit.

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 Fri Jan 31 12:14:27 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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(), 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 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 Fri Jan 31 12:14:28 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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().

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.

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.

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(), 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 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 Fri Jan 31 12:14:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 293 of file CJMemFile.cpp.

References NULL.

Referenced by operator+=().

00294 {
00295     if ((fApp == NULL) || (fApp->m_hFile == NULL))
00296         return false;
00297
00298     DWORD dwLength = 1024;
00299     BYTE *pData = new BYTE[dwLength];
00300     if (pData == NULL)
00301         return false;
00302     SeekToEnd();
00303     fApp->SeekToBegin();
00304     while (fApp->GetPosition() < fApp->GetLength())
00305     {
00306         DWORD dwRead = fApp->Read(pData,dwLength);
00307         Write(pData,dwRead);
00308     }
00309
00310     delete pData;
00311     return true;
00312 }

void CCJMemFile::Close ( ) [virtual]

Definition at line 249 of file CJMemFile.cpp.

References m_bOpen, m_File, NULL, and Save().

Referenced by ~CCJMemFile().

00250 {
00251     if ((m_File.m_hFile != NULL) && m_bOpen)
00252     {
00253         m_bOpen = false;
00254         Save();
00255         m_File.Close();
00256         m_File.m_hFile = NULL;
00257     }
00258 }

bool CCJMemFile::Discard ( ) [virtual]

Definition at line 266 of file CJMemFile.cpp.

References Load().

00267 {
00268     return Load();
00269 }

bool CCJMemFile::Duplicate ( CString strDup ) [virtual]

Definition at line 165 of file CJMemFile.cpp.

References Duplicate().

00166 {
00167     // Duplicate With CString compatibility
00168
00169     CFile file(strDup,CFile::modeCreate | CFile::modeWrite);
00170     bool bResult = Duplicate(&file);
00171     file.Close();
00172     return bResult;
00173 }

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 #if _MFC_VER < 0x700
00149     DWORD dwPos = GetPosition();
00150 #else
00151     ULONGLONG dwPos = GetPosition();
00152 #endif
00153     SeekToBegin();
00154     fDuplicate->SetLength(0);
00155     while (GetPosition() < GetLength())
00156     {
00157         DWORD dwRead = Read(pbData,1024);
00158         fDuplicate->Write(pbData,dwRead);
00159     }
00160     Seek(dwPos,fDuplicate->begin);
00161     delete pbData;
00162     return true;
00163 }

DWORD CCJMemFile::Extract | ( | CString | strDest,
 |  | DWORD | dwStartPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 396 of file CJMemFile.cpp.

References Extract().

00397 {
00398     CFile file(strDest,CFile::modeCreate | CFile::modeWrite);
00399     DWORD dwResult = Extract(&file,dwStartPos,dwBytes);
00400     file.Close();
00401     return dwResult;
00402 }

DWORD CCJMemFile::Extract | ( | CFile * | fDest,
 |  | DWORD | dwStartPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 365 of file CJMemFile.cpp.

References NULL.

Referenced by Extract(), and Insert().

00366 {
00367     if (dwBytes == 0)
00368         return 0;
00369 #if _MFC_VER < 0x700
00370     DWORD dwPos = GetPosition();
00371 #else
00372     ULONGLONG dwPos = GetPosition();
00373 #endif
00374     DWORD dwLength = 1024;
00375     DWORD dwCounter = 0;
00376     BYTE *pData = new BYTE[dwLength];
00377     if (pData == NULL)
00378         return 0;
00379     Seek(dwStartPos,begin);
00380
00381     while (((GetPosition() - dwStartPos) < dwBytes) && (GetPosition() < GetLength()) )
00382     {
00383         DWORD dwRead = Read(pData,dwLength);
00384         if (dwCounter + dwRead > dwStartPos + dwBytes)
00385             dwRead = dwBytes - dwCounter;
00386         fDest->Write(pData,dwRead);
00387         dwCounter += dwRead;
00388     }
00389     Seek(dwPos,begin);
00390     delete pData;
00391     fDest->Flush();
00392     return dwCounter;
00393
00394 }

LONG CCJMemFile::FindData | ( | void * | pData,
 |  | DWORD | dwDataLen,
 |  | LONG | lStartPos
 | ) |

Definition at line 455 of file CJMemFile.cpp.

00456 {
00457     BYTE* pBytes = (BYTE*)pData;
00458
00459
00460     Seek(lStartPos,begin);
00461
00462     bool bFoundAll = false;
00463     LONG lPos = -1;
00464
00465     while ((!bFoundAll) && (GetPosition() < GetLength()))
00466     {
00467         bool bFoundFirst = false;
00468
00469         while ((!bFoundFirst) && (GetPosition() < GetLength()))
00470         {
00471             lPos = GetPosition();
00472             BYTE read;
00473             Read(&read,1);
00474             if (read != pBytes[0])
00475                 continue;
00476
00477             bFoundFirst = true;
00478             break;
00479         }
00480
00481         //Hier Die Restlichen Bytes (dwDataLen -1) vergleichen
00482
00483         DWORD i = 1;
00484         bool bFound = true;
00485
00486         while ((i < dwDataLen) && (GetPosition() < GetLength()) && bFoundFirst)
00487         {
00488             BYTE read;
00489             Read(&read,1);
00490             if (read == pBytes[i++])
00491                 continue;
00492
00493             bFound = false;
00494             Seek(lPos+1,begin);
00495             break;
00496         }
00497
00498         bFoundAll = bFound && bFoundFirst;
00499     }
00500
00501     lPos = bFoundAll ? lPos : -1;
00502 //  while (bFound && (iPos < strSeek.GetLength())
00503 //  {
00504 //  }
00505     return lPos;
00506 }

void CCJMemFile::Flush ( ) [virtual]

Definition at line 260 of file CJMemFile.cpp.

References Save().

00261 {
00262     CMemFile::Flush();
00263     Save();
00264 }

bool CCJMemFile::Import ( CFile * fImp ) [protected, virtual]

Definition at line 271 of file CJMemFile.cpp.

References NULL.

Referenced by operator=().

00272 {
00273     if ((fImp == NULL) || (fImp->m_hFile == NULL))
00274         return false;
00275
00276     DWORD dwLength = 1024;
00277     BYTE *pData = new BYTE[dwLength];
00278     if (pData == NULL)
00279         return false;
00280     SeekToBegin();
00281     SetLength(0);
00282     fImp->SeekToBegin();
00283     while (fImp->GetPosition() < fImp->GetLength())
00284     {
00285         DWORD dwRead = fImp->Read(pData,dwLength);
00286         Write(pData,dwRead);
00287     }
00288
00289     delete pData;
00290     return true;
00291 }

DWORD CCJMemFile::Insert | ( | CString | strSrc,
 |  | DWORD | dwSourcePos,
 |  | DWORD | dwDestPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 357 of file CJMemFile.cpp.

References Insert().

00358 {
00359     CFile file(strSrc,CFile::modeRead);
00360     DWORD dwResult = Insert(&file, dwSourcePos, dwDestPos, dwBytes);
00361     file.Close();
00362     return dwResult;
00363 }

DWORD CCJMemFile::Insert | ( | CFile * | fSrc,
 |  | DWORD | dwSourcePos,
 |  | DWORD | dwDestPos,
 |  | DWORD | dwBytes
 | ) | [virtual]

Definition at line 314 of file CJMemFile.cpp.

References Extract(), and NULL.

Referenced by Insert().

00315 {
00316     if (dwBytes == 0)
00317         return 0;
00318
00319     CCJMemFile fPreIns;
00320     CCJMemFile fIns;
00321     CCJMemFile fPostIns;
00322     CCJMemFile fComplete;
00323
00324     Extract(&fPreIns,0,dwDestPos); // Extract Data BEFORE insertion point
00325     Extract(&fPostIns,dwDestPos,GetLength() - dwDestPos); // Extract Data AFTER intertion point
00326
00327     // Extract the "to be inserted" Data from the (fSrc) Source file
00328     {
00329         DWORD dwLength = 1024;
00330         DWORD dwCounter = 0;
00331         BYTE *pData = new BYTE[dwLength];
00332         if (pData == NULL)
00333             return 0;
00334         fSrc->Seek(dwSourcePos,begin);
00335
00336         while (((fSrc->GetPosition() - dwSourcePos) < dwBytes) && (fSrc->GetPosition() < fSrc->GetLength()) )
00337         {
00338             DWORD dwRead = fSrc->Read(pData,dwLength);
00339             if (dwCounter + dwRead > dwSourcePos + dwBytes)
00340                 dwRead = dwBytes - dwCounter;
00341             fIns.Write(pData,dwRead);
00342             dwCounter += dwRead;
00343         }
00344         delete pData;
00345     } // Finished Extraction
00346
00347
00348     fComplete += &fPreIns; // Append BEFORE Data
00349     fComplete += &fIns; // Append the "to be inserted" Data
00350     fComplete += &fPostIns;  // Append the AFTER Data
00351
00352     *this = &fComplete; // Copy completed File
00353
00354     return fIns.GetLength();
00355 }

bool CCJMemFile::Load ( ) [protected, virtual]

Definition at line 226 of file CJMemFile.cpp.

References m_File, and NULL.

Referenced by Discard(), and Open().

00227 {
00228     if (m_File.m_hFile == NULL)
00229         return false;
00230
00231     DWORD dwLength = 1024;
00232     BYTE *pData = new BYTE[dwLength];
00233     if (pData == NULL)
00234         return false;
00235     SeekToBegin();
00236     SetLength(0);
00237     m_File.SeekToBegin();
00238     while (m_File.GetPosition() < m_File.GetLength())
00239     {
00240         DWORD dwRead = m_File.Read(pData,dwLength);
00241         Write(pData,dwRead);
00242     }
00243
00244     delete pData;
00245     return true;
00246 }

bool CCJMemFile::Open | ( | CString | strFilename,
 |  | UINT | uiOpenFlags,
 |  | CFileException * | pError = NULL
 | ) | [virtual]

Definition at line 175 of file CJMemFile.cpp.

References Load(), m_bOpen, m_File, m_uiOpenFlags, and NULL.

Referenced by CCJMemFile().

00176 {
00177     // CFile compatible Open
00178
00179     if (m_File.m_hFile != NULL)
00180         return false;
00181     if (m_File.Open(strFilename,uiOpenFlags,pError))
00182     {
00183         m_uiOpenFlags = uiOpenFlags;
00184         Load();
00185         m_bOpen = true;
00186         return true;
00187     }
00188     else
00189         return false;
00190 }

void CCJMemFile::operator+= ( CString strApp )

Definition at line 432 of file CJMemFile.cpp.

References Append().

00433 {
00434     CFile file;
00435     if (file.Open(strApp,CFile::modeRead))
00436     {
00437         Append(&file);
00438         file.Close();
00439     }
00440 }

void CCJMemFile::operator+= ( CFile * fApp )

Definition at line 427 of file CJMemFile.cpp.

References Append().

00428 {
00429     Append(fApp);
00430 }

void CCJMemFile::operator= ( DWORD dwFilePos )

Definition at line 421 of file CJMemFile.cpp.

00422 {
00423     Seek(dwFilePos,begin);
00424 }

void CCJMemFile::operator= ( CString strDup )

Definition at line 411 of file CJMemFile.cpp.

References Import().

00412 {
00413     CFile file;
00414     if (file.Open(strDup,CFile::modeRead))
00415     {
00416         Import(&file);
00417         file.Close();
00418     }
00419 }

void CCJMemFile::operator= ( CFile * fDup )

Definition at line 406 of file CJMemFile.cpp.

References Import().

00407 {
00408     Import(fDup);
00409 }

BYTE CCJMemFile::operator[] ( DWORD dwFilePos )

Definition at line 444 of file CJMemFile.cpp.

00445 {
00446     if (dwFilePos > GetLength() -1)
00447         return 0;
00448
00449     BYTE bTemp;
00450     Seek(dwFilePos,begin);
00451     Read(&bTemp,sizeof(BYTE));
00452     return bTemp;
00453 }

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 192 of file CJMemFile.cpp.

References m_File, m_uiOpenFlags, and NULL.

Referenced by Close(), and Flush().

00193 {
00194     if (m_File.m_hFile == NULL)
00195         return false;
00196     CString str;
00197
00198     // Check if the physical file has write access
00199     if (!(m_uiOpenFlags & modeWrite) && !(m_uiOpenFlags & modeReadWrite))
00200     {
00201         return false;
00202     }
00203
00204 #if _MFC_VER < 0x700
00205     DWORD dwPos = GetPosition();
00206 #else
00207     ULONGLONG dwPos = GetPosition();
00208 #endif
00209     DWORD dwLength = 1024;
00210     BYTE *pData = new BYTE[dwLength];
00211     if (pData == NULL)
00212         return false;
00213     SeekToBegin();
00214     m_File.SetLength(0);
00215     while (GetPosition() < GetLength())
00216     {
00217         DWORD dwRead = Read(pData,dwLength);
00218         m_File.Write(pData,dwRead);
00219     }
00220     Seek(dwPos,begin);
00221     delete pData;
00222     m_File.Flush();
00223     return true;
00224 }

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 Fri Jan 31 12:14:31 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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(), 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_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.

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().

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_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(), 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().

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_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_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 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, 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(), 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 ModifyODMenuW().

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_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 CCJMenu(), 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 CCJMenu(), DrawItem(), GetBitmapFromImageList(), MeasureItem(), and SetIconSize().

int CCJMenu::m_iconY [protected]

Definition at line 260 of file CJMenu.h.

Referenced by CCJMenu(), DrawItem(), GetBitmapFromImageList(), MeasureItem(), 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 Fri Jan 31 12:14:33 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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, 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_pMenuBar, OnMenuInput(), and TRUE.

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_ptMouse, 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().

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.

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, 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(), g_hMsgHook, g_pMenuBar, CCJToolBar::GetRect(), CCJMenu::LoadMenu(), CCJMenu::LoadToolbar(), m_iNewPopup, m_popupMenu, NULL, CCJToolBar::PressButton(), and SetTrackingState().

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, 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(), and SetTrackingState().

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(), OnMenuSelect(), OnMouseMove(), SetTrackingState(), ToggleTrackButtonMode(), and TranslateFrameMessage().

int CCJMenuBar::m_nMenuID [protected]

Definition at line 116 of file CJMenuBar.h.

Referenced by LoadMenu().

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 Fri Jan 31 12:14:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:36 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References m_szMenuText.

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 GetString(), 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 Fri Jan 31 12:14:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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(), 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 Fri Jan 31 12:14:39 2003 for WinCvs Source by doxygen 1.3-rc2


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_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, and m_pOwner.

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.

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.

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, and m_bLBDown.

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 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 OnSysColorChange().

COLORREF CCJOutlookBar::m_clrShadow [protected]

Definition at line 143 of file CJOutlookBar.h.

Referenced by OnSysColorChange().

COLORREF CCJOutlookBar::m_clrTextNm [protected]

Definition at line 146 of file CJOutlookBar.h.

Referenced by OnSysColorChange().

CFont CCJOutlookBar::m_Font [protected]

Definition at line 141 of file CJOutlookBar.h.

Referenced by 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().

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 Fri Jan 31 12:14:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 (NMHDR *pNMPGScroll, LRESULT *pResult)
virtual BOOL | OnPagerCalcSize (NMHDR *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.

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 | ( | NMHDR * | pNMPGCalcSize,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 93 of file CJPagerCtrl.cpp.

References FALSE, m_nHeight, and m_nWidth.

00094 {
00095     NMPGCALCSIZE* pNMPGCalcSize = reinterpret_cast<NMPGCALCSIZE*>(pNMPG);
00096     switch(pNMPGCalcSize->dwFlag)
00097     {
00098     case PGF_CALCWIDTH:
00099         pNMPGCalcSize->iWidth = m_nWidth;
00100         break;
00101
00102     case PGF_CALCHEIGHT:
00103         pNMPGCalcSize->iHeight = m_nHeight;
00104         break;
00105     }
00106
00107     *pResult = 0;
00108     return FALSE;   // Let parent handle message
00109 }

BOOL CCJPagerCtrl::OnPagerScroll | ( | NMHDR * | pNMPGScroll,
 |  | LRESULT * | pResult
 | ) | [protected, virtual]

Definition at line 111 of file CJPagerCtrl.cpp.

References FALSE.

00112 {
00113     *pResult = 0;
00114     return FALSE;   // Let parent handle message
00115 }

_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 Fri Jan 31 12:14:42 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, 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.

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 Fri Jan 31 12:14:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

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 Fri Jan 31 12:14:44 2003 for WinCvs Source by doxygen 1.3-rc2


CCJShellTree Class Reference

Inheritance diagram for CCJShellTree:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/ExploreBar.h
Generated on Fri Jan 31 12:14:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 m_bFlatBorder.

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.

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, 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(), and CCJControlBar::Minimize().

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(), and CCJControlBar::Normalize().

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, 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(), 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 Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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, CCJSortClass::CSortItem::m_dwData, 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 CCJSortClass::CSortItem::m_strItemText.

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 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 Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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(), and CCJSortClass::~CCJSortClass().

CString CCJSortClass::CSortItem::m_strItemText

Definition at line 83 of file CJSortClass.h.

Referenced by CCJSortClass::Compare(), and CSortItem().

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJSortClass.h
Generated on Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 GetStatusPane(), m_aPans, CCJStatusBarPane::m_nID, NULL, and PositionControls().

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 Fri Jan 31 12:14:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:48 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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_popupMenu, m_popupMenuID, 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.

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.

UINT CCJTabCtrl::m_popToolbarID

Definition at line 107 of file CJTabCtrl.h.

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 OnRButtonDown().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJTabCtrl.h
  • WinCvs/CJLib/CJLibrary/CJTabCtrl.cpp
Generated on Fri Jan 31 12:14:49 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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, 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, and m_TabCtrl.

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(), 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.

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_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 m_nActiveTab, m_pActiveView, m_TabCtrl, m_viewList, OverkillAssert(), and tagTCB_ITEM::pWnd.

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, m_nActiveTab, m_pActiveView, m_TabCtrl, m_viewList, NULL, and tagTCB_ITEM::pWnd.

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(), and m_TabCtrl.

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 AddView(), DeleteView(), GetTabFromPoint(), GetToolTip(), GetView(), GetViewName(), OnCreate(), OnTabSelChange(), RemoveAllTabs(), RemoveView(), 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 Fri Jan 31 12:14:51 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, m_nActiveTab, m_pActiveView, m_pTabCtrl, m_views, NULL, and tagCTV_ITEM::pWnd.

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, m_nActiveTab, m_pActiveView, m_pTabCtrl, m_views, and tagCTV_ITEM::pWnd.

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 Fri Jan 31 12:14:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:53 2003 for WinCvs Source by doxygen 1.3-rc2


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_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(), and m_sizeButton.

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().

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 _GetComCtlVersion(), _GetDropDownWidth(), ASSERT, FALSE, CCJToolBarBase::m_bExStyle, 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(), and SetButtonInfo().

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 OnSetSizeHelper().

01975 {
01976     return OnSetSizeHelper(m_sizeImage, lParam);
01977 }

LRESULT CCJToolBar::OnSetButtonSize | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

Definition at line 1969 of file CJToolBar.cpp.

References 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, 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 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().

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().

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(), and m_strSubKey.

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(), and m_strSubKey.

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.

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(), 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, 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(), and OnSysColorChange().

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().

HRSRC CCJToolBar::m_hRsrcImageWell [protected]

Definition at line 122 of file CJToolBar.h.

Referenced by CCJToolBar(), LoadBitmap(), 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.

CSize CCJToolBar::m_sizeButton [protected]

Definition at line 133 of file CJToolBar.h.

Referenced by CalcSize(), CCJToolBar(), SetHeight(), SetSizes(), and WrapToolBar().

CSize CCJToolBar::m_sizeImage [protected]

Definition at line 132 of file CJToolBar.h.

Referenced by AddReplaceBitmap(), CCJToolBar(), 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().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJToolBar.h
  • WinCvs/CJLib/CJLibrary/CJToolBar.cpp
Generated on Fri Jan 31 12:14:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 418 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().

00419 {
00420     ASSERT_VALID(this);
00421     DWORD dwStyle = m_dwStyle;
00422
00423     if (dwStyle & CBRS_BORDER_LEFT)
00424         rect.left += afxData.cxBorder2;
00425     if (dwStyle & CBRS_BORDER_TOP)
00426         rect.top += afxData.cyBorder2;
00427     if (dwStyle & CBRS_BORDER_RIGHT)
00428         rect.right -= afxData.cxBorder2;
00429     if (dwStyle & CBRS_BORDER_BOTTOM)
00430         rect.bottom -= afxData.cyBorder2;
00431
00432     // inset the top and bottom.
00433     if (bHorz)
00434     {
00435         rect.left += m_cxLeftBorder;
00436         rect.top += m_cyTopBorder;
00437         rect.right -= m_cxRightBorder;
00438         rect.bottom -= m_cyBottomBorder;
00439         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00440         {
00441             rect.left += CX_BORDER_GRIPPER+CX_GRIPPER+CX_BORDER_GRIPPER;
00442
00443             if( m_bExStyle == true ) {
00444                 rect.left += CX_GRIPPER;
00445             }
00446
00447             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00448                 rect.left -= CX_BORDER_GRIPPER+CX_GRIPPER;
00449             }
00450         }
00451     }
00452     else
00453     {
00454         rect.left += m_cyTopBorder;
00455         rect.top += m_cxLeftBorder;
00456         rect.right -= m_cyBottomBorder;
00457         rect.bottom -= m_cxRightBorder;
00458         if ((m_dwStyle & (CBRS_GRIPPER|CBRS_FLOATING)) == CBRS_GRIPPER)
00459         {
00460             rect.top += CY_BORDER_GRIPPER+CY_GRIPPER+CY_BORDER_GRIPPER;
00461
00462             if( m_bExStyle == true ) {
00463                 rect.top += CY_GRIPPER;
00464             }
00465
00466             if(( m_bExStyle == false ) && ( m_bInReBar == false )) {
00467                 rect.top -= CY_BORDER_GRIPPER+CY_GRIPPER;
00468             }
00469         }
00470     }
00471 }

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
00235 #if _MFC_VER >= 0x700
00236         COLORREF clr = afxData.clrBtnShadow;
00237 #else
00238         COLORREF clr = afxData.bWin4 ? afxData.clrBtnShadow : afxData.clrWindowFrame;
00239 #endif
00240
00241         // draw dark line one pixel back/up
00242         if (dwStyle & CBRS_BORDER_3D)
00243         {
00244             rect1.right -= CX_BORDER;
00245             rect1.bottom -= CY_BORDER;
00246         }
00247         if (dwStyle & CBRS_BORDER_TOP)
00248             rect2.top += afxData.cyBorder2;
00249         if (dwStyle & CBRS_BORDER_BOTTOM)
00250             rect2.bottom -= afxData.cyBorder2;
00251
00252         // draw left and top
00253         if (dwStyle & CBRS_BORDER_LEFT)
00254             pDC->FillSolidRect(0, rect2.top, CX_BORDER, rect2.Height(), clr);
00255         if (dwStyle & CBRS_BORDER_TOP)
00256             pDC->FillSolidRect(0, 0, rect.right, CY_BORDER, clr);
00257
00258         // draw right and bottom
00259         if (dwStyle & CBRS_BORDER_RIGHT)
00260             pDC->FillSolidRect(rect1.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00261         if (dwStyle & CBRS_BORDER_BOTTOM)
00262             pDC->FillSolidRect(0, rect1.bottom, rect.right, -CY_BORDER, clr);
00263
00264         if (dwStyle & CBRS_BORDER_3D)
00265         {
00266             // prepare for hilite lines
00267             clr = afxData.clrBtnHilite;
00268
00269             // draw left and top
00270             if (dwStyle & CBRS_BORDER_LEFT)
00271                 pDC->FillSolidRect(1, rect2.top, CX_BORDER, rect2.Height(), clr);
00272             if (dwStyle & CBRS_BORDER_TOP)
00273                 pDC->FillSolidRect(0, 1, rect.right, CY_BORDER, clr);
00274
00275             // draw right and bottom
00276             if (dwStyle & CBRS_BORDER_RIGHT)
00277                 pDC->FillSolidRect(rect.right, rect2.top, -CX_BORDER, rect2.Height(), clr);
00278             if (dwStyle & CBRS_BORDER_BOTTOM)
00279                 pDC->FillSolidRect(0, rect.bottom, rect.right, -CY_BORDER, clr);
00280         }
00281
00282         if (dwStyle & CBRS_BORDER_LEFT)
00283             rect.left += afxData.cxBorder2;
00284         if (dwStyle & CBRS_BORDER_TOP)
00285             rect.top += afxData.cyBorder2;
00286         if (dwStyle & CBRS_BORDER_RIGHT)
00287             rect.right -= afxData.cxBorder2;
00288         if (dwStyle & CBRS_BORDER_BOTTOM)
00289             rect.bottom -= afxData.cyBorder2;
00290     }
00291     else
00292     {
00293         if(dwStyle & CBRS_BORDER_RIGHT) {
00294             pDC->FillSolidRect(rect.right-1, 0, rect.right, rect.bottom, afxData.clrBtnShadow);
00295             rect.right--;
00296         }
00297         if(dwStyle & CBRS_BORDER_BOTTOM) {
00298             pDC->FillSolidRect(0, rect.bottom-1, rect.right, rect.bottom, afxData.clrBtnShadow);
00299             rect.bottom--;
00300         }
00301         if(dwStyle & CBRS_BORDER_TOP) {
00302             pDC->FillSolidRect(0, 0, rect.right, 1, afxData.clrBtnHilite);
00303             rect.top++;
00304         }
00305         if(dwStyle & CBRS_BORDER_LEFT) {
00306             pDC->FillSolidRect(0, 0, 1, rect.bottom, afxData.clrBtnHilite);
00307             rect.left++;
00308         }
00309     }
00310 }

void CCJToolBarBase::DrawGripper | ( | CDC * | pDC,
 |  | const CRect & | rect
 | ) |

Definition at line 317 of file CJToolBarBase.cpp.

References CY_GRIPPER, m_bExStyle, and m_bInReBar.

Referenced by DoPaint(), and EraseNonClient().

00318 {
00319     // if we are floating return.
00320     if( m_dwStyle & CBRS_FLOATING ) {
00321         return;
00322     }
00323
00324     // if we are to draw the extended "office" style gripper.
00325     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bExStyle == true ))
00326     {
00327         // draw the gripper in the border
00328         if (m_dwStyle & CBRS_ORIENT_HORZ)
00329         {
00330             // Draw the first gripper.
00331             pDC->Draw3dRect( rect.left+3, rect.top+2, 3, rect.Height()-4,
00332                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00333
00334             pDC->SetPixel( rect.left+3, rect.top+2+rect.Height()-5,
00335                 afxData.clrBtnHilite);
00336
00337             // Draw the second gripper.
00338             pDC->Draw3dRect( rect.left+6, rect.top+2, 3, rect.Height()-4,
00339                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00340
00341             pDC->SetPixel( rect.left+6, rect.top+2+rect.Height()-5,
00342                 afxData.clrBtnHilite);
00343         }
00344         else
00345         {
00346             // Draw the first gripper.
00347             pDC->Draw3dRect( rect.left+2, rect.top+3, rect.Width()-4, 3,
00348                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00349
00350             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+3,
00351                 afxData.clrBtnHilite);
00352
00353             // Draw the second gripper.
00354             pDC->Draw3dRect( rect.left+2, rect.top+6, rect.Width()-4, 3,
00355                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00356
00357             pDC->SetPixel( rect.left+2+rect.Width()-5, rect.top+6,
00358                 afxData.clrBtnHilite);
00359         }
00360
00361         GdiFlush();
00362     }
00363
00364     // if we are to draw the "ReBar" style gripper.
00365     else
00366     if(( m_dwStyle & CBRS_GRIPPER ) && ( m_bInReBar == true ))
00367     {
00368         // draw the gripper in the border
00369         if (m_dwStyle & CBRS_ORIENT_HORZ)
00370         {
00371             // Draw the first gripper.
00372             pDC->Draw3dRect( rect.left+CX_BORDER_GRIPPER, rect.top+m_cyTopBorder,
00373                 CX_GRIPPER, rect.Height()-m_cyTopBorder-m_cyBottomBorder,
00374                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00375         }
00376         else
00377         {
00378             // Draw the first gripper.
00379             pDC->Draw3dRect( rect.left+m_cyTopBorder, rect.top+CY_BORDER_GRIPPER,
00380                 rect.Width()-m_cyTopBorder-m_cyBottomBorder, CY_GRIPPER,
00381                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00382         }
00383
00384         GdiFlush();
00385     }
00386
00387     // by default, we will draw the "visual studio" style gripper.
00388     else
00389     if( m_dwStyle & CBRS_GRIPPER )
00390     {
00391         // draw the gripper in the border
00392         if (m_dwStyle & CBRS_ORIENT_HORZ)
00393         {
00394             // Draw the first gripper.
00395             pDC->Draw3dRect( rect.left+1, rect.top+2, 3, rect.Height()-4,
00396                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00397
00398             // Draw the second gripper.
00399             pDC->Draw3dRect( rect.left+5, rect.top+2, 3, rect.Height()-4,
00400                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00401         }
00402         else
00403         {
00404             // Draw the first gripper.
00405             pDC->Draw3dRect( rect.left+2, rect.top+1, rect.Width()-4, 3,
00406                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00407
00408             // Draw the second gripper.
00409             pDC->Draw3dRect( rect.left+2, rect.top+5, rect.Width()-4, 3,
00410                 afxData.clrBtnHilite, afxData.clrBtnShadow);
00411         }
00412
00413         GdiFlush();
00414     }
00415 }

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, and CCJToolBar.

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 Fri Jan 31 12:15:00 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:15:01 2003 for WinCvs Source by doxygen 1.3-rc2


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(), CCJToolBar::SetButtonStyle(), TBBS_DISABLED, TBBS_PRESSED, 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, TBBS_CHECKED, and TBBS_INDETERMINATE.

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 Fri Jan 31 12:15:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 CCJTreeCtrl::Color_Font::color, and 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, CCJTreeCtrl::Color_Font::logfont, 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 CCJTreeCtrl::Color_Font::color, GetItemBold(), CCJTreeCtrl::Color_Font::logfont, and m_mapColorFont.

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 CCJTreeCtrl::Color_Font::color, CCJTreeCtrl::Color_Font::logfont, and 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 CCJTreeCtrl::Color_Font::color, CCJTreeCtrl::Color_Font::logfont, and 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 Fri Jan 31 12:15:03 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by CCJTreeCtrl::GetItemColor(), CCJTreeCtrl::OnPaint(), CCJTreeCtrl::SetItemColor(), and CCJTreeCtrl::SetItemFont().

LOGFONT CCJTreeCtrl::Color_Font::logfont

Definition at line 77 of file CJTreeCtrl.h.

Referenced by CCJTreeCtrl::GetItemFont(), CCJTreeCtrl::OnPaint(), CCJTreeCtrl::SetItemColor(), and CCJTreeCtrl::SetItemFont().

The documentation for this struct was generated from the following file:
  • WinCvs/CJLib/Include/CJTreeCtrl.h
Generated on Fri Jan 31 12:15:03 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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.

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().

CString CCJWindowPlacement::m_strSection [private]

Definition at line 72 of file CJWindowPlacement.h.

Referenced by LoadWindowPos().

CString CCJWindowPlacement::m_strWndPos [private]

Definition at line 73 of file CJWindowPlacement.h.

Referenced by LoadWindowPos().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/CJWindowPlacement.h
  • WinCvs/CJLib/CJLibrary/CJWindowPlacement.cpp
Generated on Fri Jan 31 12:15:04 2003 for WinCvs Source by doxygen 1.3-rc2


CCmdLine_MAIN Class Reference

Command line settings property page. More...

#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 (const MultiFiles *mf, const char *lastcmd, bool hasPath, const char *lastpath, bool addDefault, bool addSelection, bool forceRoot)
~CCmdLine_MAIN ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
PreTranslateMessage virtual override, intercept the Cancel and Enter keys to allow closing the dialog even is command line has focus.

Public Attributes

CSmartComboBox m_folderLocCombo
CButton m_addSelectionCheck
CButton m_checkPathCheck
CEdit m_cmdLineEdit
CSmartComboBox m_prevCmdCombo
CButton m_selFolderButton
BOOL | m_checkPath
CString | m_cmdLine
CString | m_folderLoc
BOOL | m_addDefault
BOOL | m_addSelection
BOOL | m_forceRoot

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnCheckpath ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnSelfolder ()
BN_CLICKED message handler, select folder to execute command.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, enable controls.

afx_msg void | OnSelchangePrevcmd ()
CBN_SELCHANGE message handler, insert the selected previous command into command line control.

afx_msg void | OnSetfocusCmdline ()
EN_SETFOCUS message handler, cancel the selection if it's the first time command line control gets focus.

afx_msg void | OnTag ()
BN_CLICKED message handler, display browse tag/branch dialog.

afx_msg void | OnModule ()
BN_CLICKED message handler, browse for file/directory.

afx_msg void | OnAddSelection ()
BN_CLICKED message handler, enable controls.

Private Attributes

const MultiFiles * | m_mf
bool | m_firstTimeCmdline
bool | m_hasSelection

Detailed Description

Command line settings property page.

Definition at line 45 of file LineCmd.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 58 of file LineCmd.h.

00058 { IDD = IDD_CMDLINE_MAIN };

Constructor & Destructor Documentation

CCmdLine_MAIN::CCmdLine_MAIN | ( | const MultiFiles * | mf,
 |  | const char * | lastcmd,
 |  | bool | hasPath,
 |  | const char * | lastpath,
 |  | bool | addDefault,
 |  | bool | addSelection,
 |  | bool | forceRoot
 | ) |

Definition at line 122 of file LineCmd.cpp.

References m_addDefault, m_addSelection, m_checkPath, m_cmdLine, m_firstTimeCmdline, m_folderLoc, m_folderLocCombo, m_forceRoot, m_hasSelection, m_mf, m_prevCmdCombo, MultiFiles::NumDirs(), and USmartCombo::SetItems().

00125                              : m_mf(mf), CPropertyPage(CCmdLine_MAIN::IDD)
00126 {
00127     //{{AFX_DATA_INIT(CCmdLine_MAIN)
00128     m_checkPath = hasPath;
00129     m_cmdLine = lastcmd;
00130     m_folderLoc = lastpath;
00131     m_addDefault = addDefault;
00132     m_addSelection = addSelection;
00133     m_forceRoot = forceRoot;
00134     //}}AFX_DATA_INIT
00135
00136     m_hasSelection = m_mf->NumDirs() > 0;
00137
00138     m_firstTimeCmdline = true;
00139     m_prevCmdCombo.SetItems(&gPrevCvsCmd);
00140     m_folderLocCombo.SetItems(&gPrevCvsCmdDir);
00141 }

CCmdLine_MAIN::~CCmdLine_MAIN ( )

Definition at line 143 of file LineCmd.cpp.

00144 {
00145 }

Member Function Documentation

void CCmdLine_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 147 of file LineCmd.cpp.

References DDV_CheckPathExists(), DDV_MinChars(), DDX_ComboMString(), DEF_CVS_CMD, gPrevCvsCmd, TMString< UStr >::Insert(), m_cmdLine, and m_selFolderButton.

00148 {
00149     CPropertyPage::DoDataExchange(pDX);
00150     //{{AFX_DATA_MAP(CCmdLine_MAIN)
00151     DDX_Control(pDX, IDC_FOLDERLOC, m_folderLocCombo);
00152     DDX_Control(pDX, IDC_ADD_SELECTION, m_addSelectionCheck);
00153     DDX_Control(pDX, IDC_CHECKPATH, m_checkPathCheck);
00154     DDX_Control(pDX, IDC_CMDLINE, m_cmdLineEdit);
00155     DDX_Control(pDX, IDC_PREVCMD, m_prevCmdCombo);
00156     DDX_Control(pDX, IDC_SELFOLDER, m_selFolderButton);
00157     DDX_Check(pDX, IDC_CHECKPATH, m_checkPath);
00158     DDX_Text(pDX, IDC_CMDLINE, m_cmdLine);
00159     DDV_MinChars(pDX, m_cmdLine, 1);
00160     DDX_Text(pDX, IDC_FOLDERLOC, m_folderLoc);
00161     DDX_Check(pDX, IDC_ADD_DEFAULT, m_addDefault);
00162     DDX_Check(pDX, IDC_ADD_SELECTION, m_addSelection);
00163     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00164     //}}AFX_DATA_MAP
00165
00166     if( pDX->m_bSaveAndValidate )
00167     {
00168         if( !m_cmdLine.IsEmpty() && DEF_CVS_CMD != m_cmdLine )
00169         {
00170             gPrevCvsCmd.Insert(m_cmdLine);
00171         }
00172     }
00173     else
00174     {
00175         DDX_ComboMString(pDX, IDC_PREVCMD, m_prevCmdCombo);
00176     }
00177
00178     DDX_ComboMString(pDX, IDC_FOLDERLOC, m_folderLocCombo);
00179
00180     if( m_checkPath )
00181     {
00182         DDV_MinChars(pDX, m_folderLoc, 1);
00183         DDV_CheckPathExists(pDX, IDC_FOLDERLOC, m_folderLoc);
00184     }
00185
00186     if( !pDX->m_bSaveAndValidate )
00187     {
00188         m_selFolderButton.EnableWindow(m_checkPath);
00189     }
00190 }

void CCmdLine_MAIN::OnAddSelection ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 333 of file LineCmd.cpp.

References m_addSelectionCheck, m_checkPathCheck, m_folderLocCombo, m_selFolderButton, and OnCheckpath().

Referenced by OnInitDialog().

00334 {
00335     if( m_addSelectionCheck.IsWindowEnabled() )
00336     {
00337         const BOOL enable = m_addSelectionCheck.GetCheck() ? false : true;
00338
00339         OnCheckpath();
00340
00341         m_checkPathCheck.EnableWindow(enable);
00342         m_selFolderButton.EnableWindow(enable);
00343         m_folderLocCombo.EnableWindow(enable);
00344
00345         if( enable )
00346         {
00347             OnCheckpath();
00348         }
00349     }
00350 }

void CCmdLine_MAIN::OnCheckpath ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 209 of file LineCmd.cpp.

References CStr, MultiFiles::getdir(), m_addSelectionCheck, m_checkPathCheck, m_folderLocCombo, m_hasSelection, m_mf, and m_selFolderButton.

Referenced by OnAddSelection(), and OnInitDialog().

00210 {
00211     const BOOL enable = m_checkPathCheck.GetCheck();
00212
00213     m_selFolderButton.EnableWindow(enable);
00214     m_folderLocCombo.EnableWindow(enable);
00215     m_addSelectionCheck.EnableWindow(!enable && m_hasSelection);
00216
00217     if( enable && m_hasSelection && m_mf )
00218     {
00219         CString strFolderLoc;
00220         m_folderLocCombo.GetWindowText(strFolderLoc);
00221
00222         if( strFolderLoc.IsEmpty() )
00223         {
00224             CStr path;
00225             if( m_mf->getdir(0, path) )
00226             {
00227                 m_folderLocCombo.SetWindowText(path.c_str());
00228             }
00229         }
00230     }
00231 }

BOOL CCmdLine_MAIN::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, enable controls.

Definition at line 271 of file LineCmd.cpp.

References OnAddSelection(), OnCheckpath(), and TRUE.

00272 {
00273     CPropertyPage::OnInitDialog();
00274
00275     // Extra initialization
00276     OnCheckpath();
00277     OnAddSelection();
00278
00279     return TRUE;  // return TRUE unless you set the focus to a control
00280                   // EXCEPTION: OCX Property Pages should return FALSE
00281 }

void CCmdLine_MAIN::OnModule ( ) [protected]

BN_CLICKED message handler, browse for file/directory.

Definition at line 323 of file LineCmd.cpp.

References CompatGetModuleListItem(), CStr, m_cmdLineEdit, and TRUE.

00324 {
00325     CStr moduleName;
00326     if( CompatGetModuleListItem(m_mf, moduleName) )
00327     {
00328         m_cmdLineEdit.ReplaceSel(moduleName.c_str(), TRUE);
00329     }
00330 }

void CCmdLine_MAIN::OnSelchangePrevcmd ( ) [protected]

CBN_SELCHANGE message handler, insert the selected previous command into command line control.

Definition at line 284 of file LineCmd.cpp.

References TMString< UStr >::GetList(), gPrevCvsCmd, m_cmdLineEdit, m_prevCmdCombo, and NAMESPACE.

00285 {
00286     int sel = m_prevCmdCombo.GetCurSel();
00287     if( sel == CB_ERR )
00288         return;
00289
00290     m_cmdLineEdit.SetSel(0, -1);
00291     const NAMESPACE(std) vector<CStr> & list = gPrevCvsCmd.GetList();
00292     m_cmdLineEdit.ReplaceSel(list[sel]);
00293 }

void CCmdLine_MAIN::OnSelfolder ( ) [protected]

BN_CLICKED message handler, select folder to execute command.

Definition at line 234 of file LineCmd.cpp.

References BrowserGetDirectory(), CStr, and m_folderLocCombo.

00235 {
00236     CString strFolderLoc;
00237     m_folderLocCombo.GetWindowText(strFolderLoc);
00238
00239     CStr folderLoc(strFolderLoc);
00240     if( BrowserGetDirectory("Select where to execute", folderLoc, IsWindow(m_hWnd) ? this : NULL) )
00241     {
00242         m_folderLocCombo.SetWindowText(folderLoc);
00243     }
00244 }

void CCmdLine_MAIN::OnSetfocusCmdline ( ) [protected]

EN_SETFOCUS message handler, cancel the selection if it's the first time command line control gets focus.

Definition at line 296 of file LineCmd.cpp.

References DEF_CVS_CMD, m_cmdLineEdit, and m_firstTimeCmdline.

00297 {
00298     if( m_firstTimeCmdline )
00299     {
00300         m_firstTimeCmdline = false;
00301
00302         CString cmdLine;
00303         m_cmdLineEdit.GetWindowText(cmdLine);
00304
00305         if( DEF_CVS_CMD == cmdLine )
00306         {
00307             m_cmdLineEdit.SetSel(-1, -1);
00308         }
00309     }
00310 }

void CCmdLine_MAIN::OnTag ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 313 of file LineCmd.cpp.

References CompatGetTagListItem(), CStr, m_cmdLineEdit, and TRUE.

00314 {
00315     CStr tagName;
00316     if( CompatGetTagListItem(m_mf, tagName) )
00317     {
00318         m_cmdLineEdit.ReplaceSel(tagName.c_str(), TRUE);
00319     }
00320 }

BOOL CCmdLine_MAIN::PreTranslateMessage ( MSG * pMsg ) [virtual]

PreTranslateMessage virtual override, intercept the Cancel and Enter keys to allow closing the dialog even is command line has focus.

Definition at line 247 of file LineCmd.cpp.

00248 {
00249     if( pMsg->message == WM_KEYDOWN )
00250     {
00251         switch( (int)pMsg->wParam )
00252         {
00253         case VK_ESCAPE:     //dialog can be dismissed by Esc key
00254             EndDialog(IDCANCEL);
00255             break;
00256         case VK_RETURN:     //command can be executed with Enter key
00257             if( UpdateData() )
00258             {
00259                 EndDialog(IDOK);
00260             }
00261             break;
00262         default:
00263             break;
00264         }
00265     }
00266
00267     return CPropertyPage::PreTranslateMessage(pMsg);
00268 }

Member Data Documentation

BOOL CCmdLine_MAIN::m_addDefault

Definition at line 68 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and CompatGetCommand().

BOOL CCmdLine_MAIN::m_addSelection

Definition at line 69 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and CompatGetCommand().

CButton CCmdLine_MAIN::m_addSelectionCheck

Definition at line 60 of file LineCmd.h.

Referenced by OnAddSelection(), and OnCheckpath().

BOOL CCmdLine_MAIN::m_checkPath

Definition at line 65 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and CompatGetCommand().

CButton CCmdLine_MAIN::m_checkPathCheck

Definition at line 61 of file LineCmd.h.

Referenced by OnAddSelection(), and OnCheckpath().

CString CCmdLine_MAIN::m_cmdLine

Definition at line 66 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), CompatGetCommand(), and DoDataExchange().

CEdit CCmdLine_MAIN::m_cmdLineEdit

Definition at line 62 of file LineCmd.h.

Referenced by OnModule(), OnSelchangePrevcmd(), OnSetfocusCmdline(), and OnTag().

bool CCmdLine_MAIN::m_firstTimeCmdline [private]

Flag to indicate the first time command line control gets the focus

Definition at line 99 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and OnSetfocusCmdline().

CString CCmdLine_MAIN::m_folderLoc

Definition at line 67 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and CompatGetCommand().

CSmartComboBox CCmdLine_MAIN::m_folderLocCombo

Definition at line 59 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), OnAddSelection(), OnCheckpath(), and OnSelfolder().

BOOL CCmdLine_MAIN::m_forceRoot

Definition at line 70 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and CompatGetCommand().

bool CCmdLine_MAIN::m_hasSelection [private]

Flag to indicate there is a selection in the GUI

Definition at line 100 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and OnCheckpath().

const MultiFiles* CCmdLine_MAIN::m_mf [private]

Current selection in GUI

Definition at line 98 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and OnCheckpath().

CSmartComboBox CCmdLine_MAIN::m_prevCmdCombo

Definition at line 63 of file LineCmd.h.

Referenced by CCmdLine_MAIN(), and OnSelchangePrevcmd().

CButton CCmdLine_MAIN::m_selFolderButton

Definition at line 64 of file LineCmd.h.

Referenced by DoDataExchange(), OnAddSelection(), and OnCheckpath().

The documentation for this class was generated from the following files:
  • common/LineCmd.h
  • common/LineCmd.cpp
Generated on Fri Jan 31 12:15:05 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 711 of file umain.h.

Referenced by UDispatchMessage(), UEventNotifyMessage(), UEventSendMessage(), and UEventSendMessageExt().

00712     {
00713         kUNoDispatchInfo,
00714         kUDispatchHandled = 0x01
00715     } 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 UEventRemoveWidID().

00413 {
00414     UEventRemoveWidID(m_widid);
00415 }

Member Function Documentation

const URuntimeClass * UCmdTarget::_GetBaseClass ( ) [static, protected]

Reimplemented from UObject.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 144 of file uevent.cpp.

00148 {

const UMSGMAP * UCmdTarget::GetBaseMessageMap ( ) [static, protected]

Reimplemented in UMacAppMenu, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 108 of file uevent.cpp.

00109     { return 0L; }

const UMSGMAP * UCmdTarget::GetMessageMap ( ) const [protected, virtual]

Reimplemented in UMacAppMenu, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 144 of file uevent.cpp.

00148 {

const UMSGMAP * UCmdTarget::GetThisMessageMap ( ) [static, protected]

Reimplemented in UMacAppMenu, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 110 of file uevent.cpp.

References messageMap.

00111     { return &UCmdTarget::messageMap; }

int UCmdTarget::GetWidID ( void ) const [inline]

Definition at line 720 of file umain.h.

Referenced by UWidget::AddPage(), AskCreatePersistentSettings(), UCvsGraph::CalcImageSize(), CvsLogParse(), UCvsFolders::DeleteAllItems(), UCvsFiles::DisableGeneric(), USaveSettings::DoDataExchange(), UAuthen_Sspi::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(), TViewFill::GetListCtrl(), UWidget::HasFocus(), UCvsFiles::HideColumns(), UWidget::OnBlockHandler(), UCvsGraph::OnBtnClick(), 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(), UCvsFiles::OnCmdEditsel(), UCvsFiles::OnCmdEditseldef(), UCvsFolders::OnCmdExplore(), UCvsFiles::OnCmdExplore(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIEditseldef(), UCvsFolders::OnCmdUIExplore(), UCvsFiles::OnCmdUIExplore(), UCvsFiles::OnCmdUIGraph(), UCvsFiles::OnCmdUIMacroSel(), UCvsFolders::OnCmdUIMacrosSel(), UCvsFiles::OnCmdUIRelease(), UCvsFiles::OnCmdUIRmv(), UCvsFiles::OnCmdUITrash(), UCvsFiles::OnCmdUIUpdate(), UWidget::OnComboAppend(), UToolbar::OnCommands(), UMenu::OnCommands(), USaveSettings::OnCopyFrom(), UCvsGraph::OnCreate(), UCvsFiles::OnCreate(), UCvsFiles::OnDblClick(), TBrowserFill::OnDirectory(), UCvsGraph::OnDrawing(), 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::OnUnblockHandler(), UWidget::OnUpdateFocus(), UCvsFolders::OnUpdateGeneric(), UWidget::OnUpdateUI(), UToolbar::OnUpdateUI(), UMenu::OnUpdateUI(), UMacAppMenu::OnUpdateUI(), UCvsFolders::ProcessSelectionCommand(), UCvsFiles::ProcessSelectionCommand(), UCvsFolders::ResetBrowser(), UCvsFolders::ResetView(), UCvsFiles::ResetView(), UCvsFiles::Resort(), UCvsFolders::RetrievePath(), UCvsFiles::Search(), LPseudoWinAttachment::SearchWidID(), UCvsFiles::ShowColumns(), UCvsFolders::StepToLocation(), UCvsFolders::StoreExpanded(), UEventGiveTime(), UMacAppMenu::UMacAppMenu(), UPPMenu::UPPMenu(), UWinPseudoWindowProc(), WinInitWidgets(), and CPseudoDlg::~CPseudoDlg().

00720 { 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, and UWidget.

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(), 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, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 116 of file uevent.cpp.

const URuntimeClass UCmdTarget::classUCmdTarget [static, protected]

int UCmdTarget::m_widid [private]

Definition at line 722 of file umain.h.

const UMSGMAP UCmdTarget::messageMap [static, protected]

Initial value:

{ 0L, &UCmdTarget::_messageEntries[0] }

Reimplemented in UMacAppMenu, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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 Fri Jan 31 12:15:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 732 of file umain.h.

References m_continue, m_nID, m_widget, pCmdUI, pNMHDR, and qMacPP.

00732                    : m_nID(id)
00733 #ifdef WIN32
00734     , pCmdUI(0L)
00735     , pNMHDR(0L)
00736 #endif
00737 #ifdef qMacPP
00738     , m_wrapper(0L)
00739 #endif
00740     , m_widget(0L)
00741     , m_continue(true)
00742         {}

virtual UCmdUI::~UCmdUI ( ) [inline, virtual]

Definition at line 743 of file umain.h.

00743 {}

Member Function Documentation

bool UCmdUI::CanContinue ( void ) [inline]

Definition at line 755 of file umain.h.

References m_continue.

Referenced by LMainPseudoAttachment::ExecuteSelf(), UToolbar::OnUpdateUI(), UMenu::OnUpdateUI(), and UMacAppMenu::OnUpdateUI().

00755 { 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 UCvsFrame::OnCmdUIHideUnknown(), UCvsFolders::OnCmdUIIgnore(), UCvsFiles::OnCmdUIIgnore(), UCvsFrame::OnCmdUIViewAdded(), UCvsFrame::OnCmdUIViewChanged(), UCvsFrame::OnCmdUIViewConflict(), UCvsFrame::OnCmdUIViewIgnored(), UCvsFrame::OnCmdUIViewMissing(), UCvsFrame::OnCmdUIViewModified(), UCvsFrame::OnCmdUIViewRecursive(), UCvsFolders::OnCmdUIViewRecursive(), UCvsFiles::OnCmdUIViewRecursive(), UCvsFrame::OnCmdUIViewRemoved(), UCvsFrame::OnCmdUIViewUnknown(), 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(), UCvsFrame::OnCmdUIFilterMask(), UCvsFiles::OnCmdUIGraph(), UCvsFrame::OnCmdUIHideUnknown(), 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(), UCvsFrame::OnCmdUIViewAdded(), UCvsFrame::OnCmdUIViewChanged(), UCvsFrame::OnCmdUIViewConflict(), UCvsFrame::OnCmdUIViewIgnored(), UCvsFrame::OnCmdUIViewMissing(), UCvsFrame::OnCmdUIViewModified(), UCvsFrame::OnCmdUIViewRecursive(), UCvsFolders::OnCmdUIViewRecursive(), UCvsFiles::OnCmdUIViewRecursive(), UCvsFrame::OnCmdUIViewRemoved(), UCvsFrame::OnCmdUIViewUnknown(), 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 754 of file umain.h.

References m_continue.

00754 { m_continue = state; }

void UCmdUI::SetText ( const char * title ) [virtual]

Definition at line 566 of file uevent.cpp.

References getLabelFromContainer(), m_continue, 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 767 of file umain.h.

Referenced by CanContinue(), Check(), Enable(), SetContinue(), SetText(), and UCmdUI().

int UCmdUI::m_nID

Definition at line 746 of file umain.h.

Referenced by Check(), Enable(), LMainPseudoAttachment::ExecuteSelf(), UWidget::OnUpdateUI(), UToolbar::OnUpdateUI(), UMenu::OnUpdateUI(), UMacAppMenu::OnUpdateUI(), and UCmdUI().

void* UCmdUI::m_widget

Definition at line 766 of file umain.h.

Referenced by Check(), Enable(), UWidget::OnUpdateUI(), UToolbar::OnUpdateUI(), UMenu::OnUpdateUI(), SetText(), and UCmdUI().

class CCmdUI* UCmdUI::pCmdUI

Definition at line 760 of file umain.h.

Referenced by Check(), Enable(), CWinCvsBrowser::OnUpdateMacro(), CBrowseFileView::OnUpdateMacro(), SetText(), and UCmdUI().

void* UCmdUI::pNMHDR

Definition at line 761 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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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(), 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().

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 70 of file AppConsole.h.

Referenced by CColorConsole(), and GetView().

CHARFORMAT CColorConsole::oldFormat [protected]

Definition at line 72 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 Fri Jan 31 12:15:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:09 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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(), and SetColor().

The documentation for this class was generated from the following files:
  • WinCvs/ColorStatic.h
  • WinCvs/ColorStatic.cpp
Generated on Fri Jan 31 12:15:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:10 2003 for WinCvs Source by doxygen 1.3-rc2


CComboBoxEx Class Reference

Inheritance diagram for CComboBoxEx:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/HistComboBoxEx.h
Generated on Fri Jan 31 12:15:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, const char *logMsg, const char *pathTmpl=0L)
~CCommit_MAIN ()
virtual BOOL | PreTranslateMessage (MSG *pMsg)
PreTranslateMessage virtual override, update log message info and allow Esc key to close the dialog.

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

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnSelchangeCombo ()
CBN_SELCHANGE message handler, copy the selected text as the log message.

afx_msg void | OnLauncheditor ()
BN_CLICKED message handler, launch external editor to enter the log message.

afx_msg BOOL | OnEraseBkgnd (CDC *pDC)
WM_ERASEBKGND message handler, prevent flickering while switching the log message windows.

afx_msg void | OnWordwrap ()
BN_CLICKED message handler, switch the log message windows.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, fill the preview files.

afx_msg void | OnDiff ()
BN_CLICKED message handler, launch external diff to preview the changes.

afx_msg void | OnSelchangeFiletodiff ()
CBN_SELCHANGE message handler, update preview file info.

afx_msg void | OnTemplate ()
BN_CLICKED message handler, copy the message template as a message log.

afx_msg void | OnDestroy ()
WM_DESTROY message handler, release allocated memory.

Private Methods

void | UpdateInfo ()
Display log message info.

void | UpdatePreviewInfo ()
Display preview file info.

void | SwitchWrapEdit (BOOL bWordWrap)
Switch the edit wrap and non-wrap edit boxes.

int | GetLogMsgID ()
Get the log window dialog ID.

CWnd * GetLogMsgWnd ()
Get the log window.

Private Attributes

UStr m_tmplPath
const MultiFiles * | m_mf
BOOL | m_bSwitchingWrap

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 60 of file CommitDlg.h.

00060 { IDD = IDD_COMMIT_MAIN };

Constructor & Destructor Documentation

CCommit_MAIN::CCommit_MAIN | ( | const MultiFiles * | mf,
 |  | const char * | logMsg,
 |  | const char * | pathTmpl = 0L
 | ) |

Definition at line 106 of file CommitDlg.cpp.

References UStr::empty(), UStr::endsWith(), FALSE, m_bSwitchingWrap, m_logMsg, m_prevLogsCombo, m_tmplPath, m_wordWrap, and USmartCombo::SetItems().

00107     : m_mf(mf), m_fileToDiffCombo(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly),
00108     CPropertyPage(CCommit_MAIN::IDD)
00109 {
00110     //{{AFX_DATA_INIT(CCommit_MAIN)
00111     m_logMsg = logMsg;
00112     m_wordWrap = FALSE;
00113     //}}AFX_DATA_INIT
00114
00115     m_tmplPath = pathTmpl;
00116     if( !m_tmplPath.empty() )
00117     {
00118         if( !m_tmplPath.endsWith(kPathDelimiter) )
00119             m_tmplPath << kPathDelimiter;
00120
00121         m_tmplPath << "CVS";
00122         m_tmplPath << kPathDelimiter;
00123         m_tmplPath << "Template";
00124     }
00125
00126     m_bSwitchingWrap = FALSE;
00127     m_wordWrap = gCvsPrefs.WordWrapLogMsg();
00128
00129     m_prevLogsCombo.SetItems(&gCommitLogs);
00130 }

CCommit_MAIN::~CCommit_MAIN ( )

Definition at line 132 of file CommitDlg.cpp.

00133 {
00134 }

Member Function Documentation

void CCommit_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 136 of file CommitDlg.cpp.

References DDX_ComboMString(), gCommitLogs, GetLogMsgID(), TMString< UStr >::Insert(), and m_logMsg.

00137 {
00138     CPropertyPage::DoDataExchange(pDX);
00139     //{{AFX_DATA_MAP(CCommit_MAIN)
00140     DDX_Control(pDX, IDC_PREVIEWINFO, m_previewInfo);
00141     DDX_Control(pDX, IDC_FILETODIFF, m_fileToDiffCombo);
00142     DDX_Control(pDX, IDC_WORDWRAP, m_wordWrapCtrl);
00143     DDX_Control(pDX, IDC_LOGMSG_WRAP, m_logMsgCtrlWrap);
00144     DDX_Control(pDX, IDC_LOGMSG, m_logMsgCtrl);
00145     DDX_Control(pDX, IDC_COMBO, m_prevLogsCombo);
00146     DDX_Check(pDX, IDC_WORDWRAP, m_wordWrap);
00147     //}}AFX_DATA_MAP
00148
00149     if( !pDX->m_bSaveAndValidate )
00150     {
00151         DDX_Text(pDX, IDC_LOGMSG_WRAP, m_logMsg);
00152         DDX_Text(pDX, IDC_LOGMSG, m_logMsg);
00153     }
00154     else
00155     {
00156         DDX_Text(pDX, GetLogMsgID(), m_logMsg);
00157     }
00158
00159     if( pDX->m_bSaveAndValidate )
00160     {
00161         if( !m_logMsg.IsEmpty() )
00162         {
00163             gCommitLogs.Insert(m_logMsg);
00164         }
00165     }
00166     else
00167     {
00168         DDX_ComboMString(pDX, IDC_COMBO, m_prevLogsCombo);
00169     }
00170 }

int CCommit_MAIN::GetLogMsgID ( ) [private]

Get the log window dialog ID.

Definition at line 311 of file CommitDlg.cpp.

References IDC_LOGMSG, IDC_LOGMSG_WRAP, and m_wordWrapCtrl.

Referenced by DoDataExchange(), and GetLogMsgWnd().

00312 {
00313     return m_wordWrapCtrl.GetCheck() ? IDC_LOGMSG_WRAP : IDC_LOGMSG;
00314 }

CWnd * CCommit_MAIN::GetLogMsgWnd ( ) [private]

Get the log window.

Definition at line 317 of file CommitDlg.cpp.

References GetLogMsgID().

Referenced by OnLauncheditor(), OnSelchangeCombo(), OnTemplate(), and UpdateInfo().

00318 {
00319     return GetDlgItem(GetLogMsgID());
00320 }

void CCommit_MAIN::OnDestroy ( ) [protected]

WM_DESTROY message handler, release allocated memory.

Definition at line 431 of file CommitDlg.cpp.

References m_fileToDiffCombo.

00432 {
00433     const int count = m_fileToDiffCombo.GetCount();
00434     for(int nIndex = 0; nIndex < count; nIndex++)
00435     {
00436         MultiFilesEntryIndex* entryIndex = (MultiFilesEntryIndex*)m_fileToDiffCombo.GetItemData(nIndex);
00437         delete entryIndex;
00438     }
00439
00440     CPropertyPage::OnDestroy();
00441 }

void CCommit_MAIN::OnDiff ( ) [protected]

BN_CLICKED message handler, launch external diff to preview the changes.

Definition at line 341 of file CommitDlg.cpp.

References CStr, MultiFilesEntryIndex::GetIndex(), MultiFilesEntryIndex::GetIterator(), m_fileToDiffCombo, MultiFiles::newdir(), MultiFiles::newfile(), and KoDiffHandler::OnFiles().

00342 {
00343     const int nComboIndex = m_fileToDiffCombo.GetCurSel();
00344     if( nComboIndex > CB_ERR )
00345     {
00346         MultiFilesEntryIndex* entryIndex = (MultiFilesEntryIndex*)m_fileToDiffCombo.GetItemData(nComboIndex);
00347         CStr path;
00348         CStr fileName;
00349         CStr currRev;
00350
00351         if( entryIndex && entryIndex->GetIterator()->get(entryIndex->GetIndex(), path, fileName, currRev) )
00352         {
00353             MultiFiles mf;
00354             mf.newdir(path);
00355             mf.newfile(fileName, 0, currRev);
00356
00357             KoDiffHandler handler;
00358             handler.OnFiles(&mf);
00359         }
00360     }
00361 }

BOOL CCommit_MAIN::OnEraseBkgnd ( CDC * pDC ) [protected]

WM_ERASEBKGND message handler, prevent flickering while switching the log message windows.

Definition at line 323 of file CommitDlg.cpp.

References TRUE.

00324 {
00325     if( m_bSwitchingWrap )
00326     {
00327         return TRUE;
00328     }
00329
00330     return CPropertyPage::OnEraseBkgnd(pDC);
00331 }

BOOL CCommit_MAIN::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, fill the preview files.

Definition at line 364 of file CommitDlg.cpp.

References MultiFiles::begin(), UStr::empty(), MultiFiles::end(), UStr::endsWith(), m_fileToDiffCombo, m_mf, SwitchWrapEdit(), MultiFiles::TotalNumFiles(), TRUE, and UpdatePreviewInfo().

00365 {
00366     CPropertyPage::OnInitDialog();
00367
00368     // Extra initialization here
00369     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00370
00371     if( m_mf && m_mf->TotalNumFiles() )
00372     {
00373         MultiFiles::const_iterator mfi;
00374         for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00375         {
00376             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00377             {
00378                 UStr path;
00379                 UStr fileName;
00380                 UStr currRev;
00381
00382                 mfi->get(nIndex, path, fileName, currRev);
00383                 if( !path.empty() && !path.endsWith(kPathDelimiter) )
00384                     path << kPathDelimiter;
00385
00386                 path << fileName;
00387
00388                 const int nComboIndex = m_fileToDiffCombo.AddString(path);
00389
00390                 MultiFilesEntryIndex* entryIndex = new MultiFilesEntryIndex(nComboIndex, mfi);
00391                 m_fileToDiffCombo.SetItemData(nComboIndex, (DWORD)entryIndex);
00392             }
00393         }
00394     }
00395
00396     if( m_fileToDiffCombo.GetCount() )
00397     {
00398         m_fileToDiffCombo.SetCurSel(0);
00399     }
00400     else
00401     {
00402         m_fileToDiffCombo.EnableWindow(FALSE);
00403         CWnd* pButton = GetDlgItem(IDC_DIFF);
00404         if( pButton )
00405         {
00406             pButton->EnableWindow(FALSE);
00407         }
00408     }
00409
00410     //enable template button
00411     {
00412         CWnd* pTemplateButton = GetDlgItem(IDC_TEMPLATE);
00413         if( pTemplateButton )
00414         {
00415             FILE* templateFile = fopen(m_tmplPath, "r");
00416             pTemplateButton->EnableWindow(NULL != templateFile);
00417             if( templateFile )
00418             {
00419                 fclose(templateFile);
00420             }
00421         }
00422     }
00423
00424     UpdatePreviewInfo();
00425
00426     return TRUE;  // return TRUE unless you set the focus to a control
00427                   // EXCEPTION: OCX Property Pages should return FALSE
00428 }

void CCommit_MAIN::OnLauncheditor ( ) [protected]

BN_CLICKED message handler, launch external editor to enter the log message.

Definition at line 263 of file CommitDlg.cpp.

References CompatGetEditorMsg(), and GetLogMsgWnd().

00264 {
00265     UStr message;
00266
00267     if( CompatGetEditorMsg(message) )
00268     {
00269         CString strMessage(message);
00270         strMessage.Replace("\n", "\r\n");
00271
00272         if( !strMessage.IsEmpty() )
00273         {
00274             CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00275             pEdit->SetSel(0, -1);
00276             pEdit->ReplaceSel(strMessage);
00277         }
00278     }
00279
00280     GotoDlgCtrl(GetLogMsgWnd());
00281 }

void CCommit_MAIN::OnSelchangeCombo ( ) [protected]

CBN_SELCHANGE message handler, copy the selected text as the log message.

Definition at line 173 of file CommitDlg.cpp.

References gCommitLogs, TMString< UStr >::GetList(), GetLogMsgWnd(), m_prevLogsCombo, and NAMESPACE.

00174 {
00175     int sel = m_prevLogsCombo.GetCurSel();
00176     if( sel == CB_ERR )
00177         return;
00178
00179     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00180     pEdit->SetSel(0, -1);
00181
00182     const NAMESPACE(std) vector<CStr>& list = gCommitLogs.GetList();
00183     pEdit->ReplaceSel(list[sel]);
00184 }

void CCommit_MAIN::OnSelchangeFiletodiff ( ) [protected]

CBN_SELCHANGE message handler, update preview file info.

Definition at line 257 of file CommitDlg.cpp.

References UpdatePreviewInfo().

00258 {
00259     UpdatePreviewInfo();
00260 }

void CCommit_MAIN::OnTemplate ( ) [protected]

BN_CLICKED message handler, copy the message template as a message log.

Definition at line 444 of file CommitDlg.cpp.

References UStr::empty(), free, getline(), GetLogMsgWnd(), and m_tmplPath.

00445 {
00446     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00447     pEdit->SetSel(0, -1);
00448
00449     bool gotIt = false;
00450     FILE* output;
00451
00452     if( !m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L )
00453     {
00454         char* line = 0L;
00455         size_t line_chars_allocated = 0;
00456         int line_length;
00457         while( (line_length = getline(&line, &line_chars_allocated, output)) > 0 )
00458         {
00459             //correct the new line characters for edit box and insert the line
00460             CString strLine(line);
00461             strLine.Replace( "\n", "\r\n" );
00462             pEdit->ReplaceSel(strLine);
00463         }
00464
00465         gotIt = true;
00466         if( line_length < 0 && !feof(output) )
00467             gotIt = false;
00468
00469         if( line != 0L )
00470             free(line);
00471
00472         fclose(output);
00473     }
00474
00475     if( !gotIt )
00476     {
00477         pEdit->ReplaceSel("*CVS/Template file not found*");
00478     }
00479 }

void CCommit_MAIN::OnWordwrap ( ) [protected]

BN_CLICKED message handler, switch the log message windows.

Definition at line 334 of file CommitDlg.cpp.

References m_wordWrapCtrl, and SwitchWrapEdit().

00335 {
00336     gCvsPrefs.SetWordWrapLogMsg(m_wordWrapCtrl.GetCheck());
00337     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00338 }

BOOL CCommit_MAIN::PreTranslateMessage ( MSG * pMsg ) [virtual]

PreTranslateMessage virtual override, update log message info and allow Esc key to close the dialog.

Definition at line 200 of file CommitDlg.cpp.

References UpdateInfo().

00201 {
00202     if( pMsg->message >= WM_KEYFIRST ||
00203         pMsg->message <= WM_KEYLAST ||
00204         pMsg->message == WM_COPY || pMsg->message == WM_CUT || pMsg->message == WM_PASTE )
00205     {
00206         UpdateInfo();
00207     }
00208
00209     //dialog can be dismissed by Esc key
00210     if( pMsg->message == WM_KEYDOWN &&
00211         (int)pMsg->wParam == VK_ESCAPE )
00212     {
00213         EndDialog(IDCANCEL);
00214     }
00215
00216     return CPropertyPage::PreTranslateMessage(pMsg);
00217 }

void CCommit_MAIN::SwitchWrapEdit ( BOOL bWordWrap ) [private]

Switch the edit wrap and non-wrap edit boxes.

Definition at line 284 of file CommitDlg.cpp.

References FALSE, m_bSwitchingWrap, m_logMsgCtrl, m_logMsgCtrlWrap, and TRUE.

Referenced by OnInitDialog(), and OnWordwrap().

00285 {
00286     CString strMessage;
00287
00288     if( bWordWrap )
00289     {
00290         m_logMsgCtrl.GetWindowText(strMessage);
00291         m_logMsgCtrlWrap.SetWindowText(strMessage);
00292
00293         m_bSwitchingWrap = TRUE;
00294         m_logMsgCtrl.ShowWindow(SW_HIDE);
00295         m_logMsgCtrlWrap.ShowWindow(SW_SHOW);
00296         m_bSwitchingWrap = FALSE;
00297     }
00298     else
00299     {
00300         m_logMsgCtrlWrap.GetWindowText(strMessage);
00301         m_logMsgCtrl.SetWindowText(strMessage);
00302
00303         m_bSwitchingWrap = TRUE;
00304         m_logMsgCtrlWrap.ShowWindow(SW_HIDE);
00305         m_logMsgCtrl.ShowWindow(SW_SHOW);
00306         m_bSwitchingWrap = FALSE;
00307     }
00308 }

void CCommit_MAIN::UpdateInfo ( ) [private]

Display log message info.

Definition at line 220 of file CommitDlg.cpp.

References GetLogMsgWnd().

Referenced by PreTranslateMessage().

00221 {
00222     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00223
00224     CString strOldInfo;
00225     CString strInfo;
00226     int nLineNumber = pEdit->LineFromChar();
00227     int nLineLenght = pEdit->LineLength(pEdit->LineIndex());
00228
00229     strInfo.Format("Line %d (%d chars)", nLineNumber + 1, nLineLenght);
00230
00231     GetDlgItemText(IDC_EDIT_POSITION, strOldInfo);
00232     if( strOldInfo != strInfo )
00233     {
00234         SetDlgItemText(IDC_EDIT_POSITION, strInfo);
00235     }
00236 }

void CCommit_MAIN::UpdatePreviewInfo ( ) [private]

Display preview file info.

Definition at line 239 of file CommitDlg.cpp.

References m_fileToDiffCombo, and m_previewInfo.

Referenced by OnInitDialog(), and OnSelchangeFiletodiff().

00240 {
00241     CString strPreviewInfo;
00242     int nSelInfo = m_fileToDiffCombo.GetCurSel();
00243     if( nSelInfo < 0 || !m_fileToDiffCombo.GetCount() )
00244     {
00245         nSelInfo = 0;
00246     }
00247     else
00248     {
00249         nSelInfo++;
00250     }
00251
00252     strPreviewInfo.Format("Preview file changes (%d/%d):", nSelInfo, m_fileToDiffCombo.GetCount());
00253     m_previewInfo.SetWindowText(strPreviewInfo);
00254 }

Member Data Documentation

BOOL CCommit_MAIN::m_bSwitchingWrap [private]

Definition at line 99 of file CommitDlg.h.

Referenced by CCommit_MAIN(), and SwitchWrapEdit().

CSmartComboBox CCommit_MAIN::m_fileToDiffCombo

Definition at line 62 of file CommitDlg.h.

Referenced by OnDestroy(), OnDiff(), OnInitDialog(), and UpdatePreviewInfo().

CString CCommit_MAIN::m_logMsg

Definition at line 67 of file CommitDlg.h.

Referenced by CCommit_MAIN(), CompatGetCommit(), and DoDataExchange().

CEdit CCommit_MAIN::m_logMsgCtrl

Definition at line 65 of file CommitDlg.h.

Referenced by SwitchWrapEdit().

CEdit CCommit_MAIN::m_logMsgCtrlWrap

Definition at line 64 of file CommitDlg.h.

Referenced by SwitchWrapEdit().

const MultiFiles* CCommit_MAIN::m_mf [private]

Definition at line 97 of file CommitDlg.h.

Referenced by OnInitDialog().

CButton CCommit_MAIN::m_previewInfo

Definition at line 61 of file CommitDlg.h.

Referenced by UpdatePreviewInfo().

CSmartComboBox CCommit_MAIN::m_prevLogsCombo

Definition at line 66 of file CommitDlg.h.

Referenced by CCommit_MAIN(), and OnSelchangeCombo().

UStr CCommit_MAIN::m_tmplPath [private]

Definition at line 96 of file CommitDlg.h.

Referenced by CCommit_MAIN(), and OnTemplate().

BOOL CCommit_MAIN::m_wordWrap

Definition at line 68 of file CommitDlg.h.

Referenced by CCommit_MAIN().

CButton CCommit_MAIN::m_wordWrapCtrl

Definition at line 63 of file CommitDlg.h.

Referenced by GetLogMsgID(), and OnWordwrap().

The documentation for this class was generated from the following files:
  • common/CommitDlg.h
  • common/CommitDlg.cpp
Generated on Fri Jan 31 12:15:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf)
~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 ()
BN_CLICKED message handler, enable controls for force revision option.

afx_msg void | OnBrowseTag ()
BN_CLICKED message handler, display browse tag/branch dialog.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 122 of file CommitDlg.h.

00122 { IDD = IDD_COMMIT_OPTIONS };

Constructor & Destructor Documentation

CCommit_OPTIONS::CCommit_OPTIONS ( const MultiFiles * mf )

Definition at line 486 of file CommitDlg.cpp.

References FALSE, gCheckValidEdits, m_checkValidEdits, m_forceCommit, m_forceRecurse, m_forceRevision, m_noModuleProgram, m_noRecurse, m_rev, m_revCombo, and USmartCombo::SetItems().

00487     : m_mf(mf), CPropertyPage(CCommit_OPTIONS::IDD)
00488 {
00489     //{{AFX_DATA_INIT(CCommit_OPTIONS)
00490     m_forceCommit = FALSE;
00491     m_rev = _T("");
00492     m_forceRecurse = FALSE;
00493     m_forceRevision = FALSE;
00494     m_noModuleProgram = FALSE;
00495     m_noRecurse = FALSE;
00496     m_checkValidEdits = FALSE;
00497     //}}AFX_DATA_INIT
00498
00499     m_checkValidEdits = (bool)gCheckValidEdits;
00500     m_revCombo.SetItems(&gRevNames);
00501 }

CCommit_OPTIONS::~CCommit_OPTIONS ( )

Definition at line 503 of file CommitDlg.cpp.

00504 {
00505 }

Member Function Documentation

void CCommit_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 507 of file CommitDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), and OnForcerevision().

00508 {
00509     CPropertyPage::DoDataExchange(pDX);
00510     //{{AFX_DATA_MAP(CCommit_OPTIONS)
00511     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00512     DDX_Check(pDX, IDC_FORCECOMMIT, m_forceCommit);
00513     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00514     DDX_Check(pDX, IDC_FORCERECURSE, m_forceRecurse);
00515     DDX_Check(pDX, IDC_FORCEREVISION, m_forceRevision);
00516     DDX_Check(pDX, IDC_NOMODULEPROGRAM, m_noModuleProgram);
00517     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00518     DDX_Check(pDX, IDC_CHECKVALIDEDITS, m_checkValidEdits);
00519     //}}AFX_DATA_MAP
00520
00521     if( m_forceRevision )
00522     {
00523         DDV_MinChars(pDX, m_rev, 1);
00524     }
00525
00526     if( !pDX->m_bSaveAndValidate )
00527     {
00528         OnForcerevision();
00529     }
00530
00531     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00532 }

void CCommit_OPTIONS::OnBrowseTag ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 564 of file CommitDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

00565 {
00566     CStr tagName;
00567     if( CompatGetTagListItem(m_mf, tagName) )
00568     {
00569         m_rev = (const char*)tagName;
00570         m_revCombo.SetWindowText(m_rev);
00571     }
00572 }

void CCommit_OPTIONS::OnForcerevision ( ) [protected]

BN_CLICKED message handler, enable controls for force revision option.

Definition at line 546 of file CommitDlg.cpp.

Referenced by DoDataExchange().

00547 {
00548     CButton* but = (CButton*)GetDlgItem(IDC_FORCEREVISION);
00549
00550     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00551     if( wnd )
00552     {
00553         wnd->EnableWindow(but->GetCheck());
00554     }
00555
00556     wnd = GetDlgItem(IDC_BROWSE_TAG);
00557     if( wnd )
00558     {
00559         wnd->EnableWindow(but->GetCheck());
00560     }
00561 }

Member Data Documentation

BOOL CCommit_OPTIONS::m_checkValidEdits

Definition at line 130 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

BOOL CCommit_OPTIONS::m_forceCommit

Definition at line 124 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

BOOL CCommit_OPTIONS::m_forceRecurse

Definition at line 126 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

BOOL CCommit_OPTIONS::m_forceRevision

Definition at line 127 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

const MultiFiles* CCommit_OPTIONS::m_mf [private]

Definition at line 150 of file CommitDlg.h.

BOOL CCommit_OPTIONS::m_noModuleProgram

Definition at line 128 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

BOOL CCommit_OPTIONS::m_noRecurse

Definition at line 129 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and CompatGetCommit().

CString CCommit_OPTIONS::m_rev

Definition at line 125 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), CompatGetCommit(), and OnBrowseTag().

CSmartComboBox CCommit_OPTIONS::m_revCombo

Definition at line 123 of file CommitDlg.h.

Referenced by CCommit_OPTIONS(), and OnBrowseTag().

The documentation for this class was generated from the following files:
  • common/CommitDlg.h
  • common/CommitDlg.cpp
Generated on Fri Jan 31 12:15:14 2003 for WinCvs Source by doxygen 1.3-rc2


CComModule Class Reference

Inheritance diagram for CComModule:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/StdAfx.h
Generated on Fri Jan 31 12:15:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:15 2003 for WinCvs Source by doxygen 1.3-rc2


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, and sInitInvTable.

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 Fri Jan 31 12:15:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 GetIcon(), GetInvString(), m_cmdsList, m_menuList, 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 CustInvertTable::cmd, CustGetByKey(), GetIcon(), GetInvString(), CMMenuString::GetList(), 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[0]);
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, 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, 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 Fri Jan 31 12:15:17 2003 for WinCvs Source by doxygen 1.3-rc2


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
 | ) |

Referenced by CWincvsApp::InitATL().

LONG CCVS_CoworkerModule::Lock ( )

LONG CCVS_CoworkerModule::Unlock ( )

Member Data Documentation

DWORD CCVS_CoworkerModule::dwThreadID

Definition at line 52 of file StdAfx.h.

Referenced by CWincvsApp::InitATL().

The documentation for this class was generated from the following file:
  • WinCvs/StdAfx.h
Generated on Fri Jan 31 12:15:18 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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().

CString CCVSAlert::m_defhit

Definition at line 49 of file CvsAlert.h.

Referenced by CCVSAlert().

CString CCVSAlert::m_prompt

Definition at line 48 of file CvsAlert.h.

Referenced by CCVSAlert().

The documentation for this class was generated from the following files:
  • common/CvsAlert.h
  • common/CvsAlert.cpp
Generated on Fri Jan 31 12:15:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 | SetCvsProcess (CvsProcess *proc)
CvsProcess * | GetCvsProcess (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)
void | PeekPumpAndIdle (bool)
KiFilterModel * | GetFilterModel () const
KiRecursionModel * | GetRecursionModel () const
KiIgnoreModel * | GetIgnoreModel () const
UCvsFrame * | GetMainFrame (void)

Static Public Methods

const URuntimeClass * | rtUCvsApp (void)

Static Public Attributes

UCvsApp * | gApp = 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

UCvsFrame * m_mainFrame
bool | gCvsRunning
bool | gCvsStopping

Static Protected Attributes

const URuntimeClass | classUCvsApp
CvsProcess * | gCvsProcess = 0L
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 87 of file UCvsApp.h.

00088     {
00089         kProcessTimer = EV_COMMAND_START
00090     };

Constructor & Destructor Documentation

UCvsApp::UCvsApp | ( | int | argc,
 |  | char ** | argv
 | ) |

Definition at line 76 of file UCvsApp.cpp.

References UWidget::AddTimer(), cvs_err(), gApp, m_mainFrame, MacrosReloadAll(), required_argument, UCvsFolders::SetDefaultRoot(), and usage().

00076                                       :
00077 UWidget (::UEventGetWidID ()),
00078 gCvsRunning (false),
00079 gCvsStopping (false)
00080 {
00081     gApp = this;
00082
00083 #if qGTK
00084     add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps");
00085     add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
00086 #endif
00087
00088     // load the persistent values (i.e. preferences) and the locate the macros
00089     gCvsPrefs.load ();
00090     MacrosReloadAll ();
00091
00092     AddTimer (50, kProcessTimer);
00093
00094     m_mainFrame = new UCvsFrame();
00095
00096     if (argc > 0)
00097     {
00098         static struct option long_options[] = {
00099             {"root", required_argument, 0L, 1},
00100             {0, 0, 0, 0}
00101         };
00102         optind = 0;
00103         int option_index = 0, c;
00104         while ((c = getopt_long
00105             (argc, argv, "+", long_options,
00106              &option_index)) != EOF)
00107         {
00108             switch (c)
00109             {
00110             case 1:
00111                 UCvsFolders::SetDefaultRoot (optarg);
00112                 break;
00113             default:
00114                 cvs_err (_("Warning : unknown option\n"));
00115                 usage ();
00116                 break;
00117             }
00118         }
00119
00120     }
00121 }

UCvsApp::~UCvsApp ( ) [virtual]

Definition at line 123 of file UCvsApp.cpp.

00124 {
00125 }

Member Function Documentation

const URuntimeClass * UCvsApp::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 64 of file UCvsApp.cpp.

void UCvsApp::Execute | ( | int | argc,
 |  | char *const * | argv
 | ) |

Definition at line 414 of file UCvsApp.cpp.

References CvsArgs::add(), CvsArgs::Argc(), and CvsArgs::Argv().

Referenced by UCvsFiles::EditSel(), LaunchDiff(), UCvsFolders::OnCmdExplore(), and UCvsFiles::OnCmdExplore().

00415 {
00416 #if qUnix
00417     // The Authentication code (AnthenModel) nulls home
00418     // after a CVS call so rather that mess with it (somebody
00419     // apparently meant to do it) we will make sure HOME is set
00420     // for our child process here.
00421     CvsArgs args(false);
00422     UStr home;
00423     home = "HOME=";
00424     home << gCvsPrefs.Home();
00425     args.add(home);
00426
00427     gnome_execute_async_with_env_fds (0L, argc, argv, args.Argc(), args.Argv(), true);
00428 #endif
00429 }

const char* UCvsApp::GetAppLibFolder ( void ) const

const char * UCvsApp::GetAppName ( void ) const

Definition at line 187 of file UCvsApp.cpp.

Referenced by AboutDialog(), UCvsFrame::OnCopyrights(), and UCvsFrame::OnCredits().

00188 {
00189 #ifdef macintosh
00190     return "MacCvs";
00191 #elif defined(WIN32)
00192     return "WinCvs";
00193 #elif defined(qUnix)
00194     return PACKAGE;
00195 #endif
00196 }

const char * UCvsApp::GetAppVersion ( void ) const

Definition at line 199 of file UCvsApp.cpp.

Referenced by UCvsFrame::OnCredits().

00200 {
00201 #ifdef macintosh
00202
00203 #elif defined(WIN32)
00204
00205 #elif defined(qUnix)
00206     return VERSION;
00207 #endif
00208 }

const UMSGMAP * UCvsApp::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsApp.cpp.

UCvsFolders * UCvsApp::GetBrowserView ( void )

Definition at line 167 of file UCvsApp.cpp.

References UObject::IsKindOf(), and UEventQueryWidget().

Referenced by UCvsFrame::OnBrowserPopup(), UCvsFrame::OnComboSelDir(), UCvsFiles::ResetView(), and CvsPrefs::save().

00168 {
00169     UCmdTarget *cmd = UEventQueryWidget (kUCvsFoldersID);
00170     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFolders)))
00171         return (UCvsFolders *) cmd;
00172
00173     return 0L;
00174 }

CvsProcess* UCvsApp::GetCvsProcess ( void ) [inline]

Definition at line 50 of file UCvsApp.h.

References gCvsProcess.

Referenced by UCvsFrame::OnCmdStopcvs().

00050 { return gCvsProcess; }

UCvsFiles * UCvsApp::GetFilesView ( void )

Definition at line 177 of file UCvsApp.cpp.

References UObject::IsKindOf(), and UEventQueryWidget().

Referenced by OnMainTimer(), UCvsFolders::ResetBrowser(), and UCvsFolders::ResetView().

00178 {
00179     UCmdTarget *cmd = UEventQueryWidget (kUCvsFilesID);
00180     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFiles)))
00181         return (UCvsFiles *) cmd;
00182
00183     return 0L;
00184 }

KiFilterModel * UCvsApp::GetFilterModel ( ) const

Definition at line 227 of file UCvsApp.cpp.

References UCvsFrame::GetFilterModel(), and m_mainFrame.

Referenced by UCvsFiles::OnCreate(), and UCvsFiles::OnDestroy().

00228 {
00229         return m_mainFrame->GetFilterModel();
00230 }

KiIgnoreModel * UCvsApp::GetIgnoreModel ( ) const

Definition at line 238 of file UCvsApp.cpp.

References UCvsFrame::GetIgnoreModel(), and m_mainFrame.

Referenced by UCvsFolders::OnCmdIgnore(), UCvsFiles::OnCmdIgnore(), UCvsFolders::OnCmdUIIgnore(), UCvsFiles::OnCmdUIIgnore(), UCvsFolders::OnCreate(), UCvsFiles::OnCreate(), UCvsFolders::OnDestroy(), UCvsFiles::OnDestroy(), and TBrowserFill::TBrowserFill().

00239 {
00240         return m_mainFrame->GetIgnoreModel();
00241 }

UCvsFrame* UCvsApp::GetMainFrame ( void ) [inline]

Definition at line 84 of file UCvsApp.h.

References m_mainFrame.

Referenced by UCvsFiles::OnViewRecursive().

00084 { return m_mainFrame; }

const UMSGMAP * UCvsApp::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 65 of file UCvsApp.cpp.

KiRecursionModel * UCvsApp::GetRecursionModel ( ) const

Definition at line 233 of file UCvsApp.cpp.

References UCvsFrame::GetRecursionModel(), and m_mainFrame.

Referenced by UCvsFrame::OnCmdUIViewRecursive(), UCvsFolders::OnCmdUIViewRecursive(), UCvsFiles::OnCmdUIViewRecursive(), UCvsFiles::OnCreate(), UCvsFiles::OnDestroy(), UCvsFolders::OnViewRecursive(), and UCvsFiles::OnViewRecursive().

00234 {
00235         return m_mainFrame->GetRecursionModel();
00236 }

const URuntimeClass * UCvsApp::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 64 of file UCvsApp.cpp.

const UMSGMAP * UCvsApp::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsApp.cpp.

bool UCvsApp::IsCvsRunning ( void ) [inline]

Definition at line 54 of file UCvsApp.h.

References gCvsRunning.

Referenced by UCvsFrame::AskForQuitting(), UCvsFolders::DisableGeneric(), UCvsFiles::DisableGeneric(), IsAppEnabled(), UCvsFolders::OnCmdUICheckout(), UCvsFolders::OnCmdUIImport(), and UCvsFolders::OnCmdUIReload().

00054 { return gCvsRunning; }

bool UCvsApp::IsCvsStopping ( void ) [inline]

Definition at line 58 of file UCvsApp.h.

References gCvsStopping.

00058 { return gCvsStopping; }

void UCvsApp::OnMainTimer ( long time ) [protected]

Definition at line 432 of file UCvsApp.cpp.

References cvs_process_give_time(), cvs_process_is_active(), UWidget::DoValidUI(), gApp, gCvsProcess, GetFilesView(), UCvsFiles::ResetView(), SetCvsProcess(), and SetCvsRunning().

00433 {
00434     if (gCvsProcess != 0L)
00435     {
00436         cvs_process_give_time ();
00437         if (!cvs_process_is_active (gCvsProcess))
00438         {
00439             UCvsApp::gApp->SetCvsRunning (false);
00440             UCvsApp::gApp->SetCvsProcess((CvsProcess*)0L);
00441             UWidget::DoValidUI (false);
00442             UCvsApp::gApp->GetFilesView ()->ResetView ();
00443         }
00444     }
00445 }

void UCvsApp::PeekPumpAndIdle ( bool )

Definition at line 211 of file UCvsApp.cpp.

References UEventGiveTime().

00212 {
00213     while (gtk_events_pending())
00214         gtk_main_iteration();
00215
00216     UEventGiveTime();
00217     if(doIdle) {
00218         // nothing to do on idle time yet
00219         /*long lIdle = 0;
00220
00221         while( OnIdle(lIdle++) )
00222             ; */
00223     }
00224 }

const URuntimeClass * UCvsApp::rtUCvsApp ( void ) [static]

Definition at line 64 of file UCvsApp.cpp.

void UCvsApp::SayWelcome ( void )

Definition at line 128 of file UCvsApp.cpp.

References CompatGetPrefs(), cvs_err(), cvs_out(), and CTcl_Interp::IsAvail().

00129 {
00130     // say hello from the application, optionnaly prompt for the CVSROOT
00131     cvs_out (_("Welcome to %s %s\n"), PACKAGE, VERSION);
00132     if (gCvsPrefs.empty ())
00133         CompatGetPrefs ();
00134     else
00135         cvs_out ("CVSROOT: %s (%s)\n", (const char *) gCvsPrefs,
00136              gAuthen.kindstr ());
00137
00138     if (CTcl_Interp::IsAvail ())
00139     {
00140         cvs_out (_("TCL is available, shell and macros are enabled : help (select and press enter)\n"));
00141     }
00142     else
00143     {
00144         cvs_err (_("TCL is *not* available, shell and macros are disabled\n"));
00145     }
00146 }

void UCvsApp::SetCvsProcess ( CvsProcess * proc ) [inline]

Definition at line 49 of file UCvsApp.h.

References gCvsProcess.

Referenced by OnMainTimer().

00049 { gCvsProcess = proc; };

void UCvsApp::SetCvsRunning ( bool state )

Definition at line 149 of file UCvsApp.cpp.

References gCvsRunning.

Referenced by OnMainTimer().

00150 {
00151     if (state ^ gCvsRunning)
00152     {
00153         gCvsRunning = state;
00154     }
00155 }

void UCvsApp::SetCvsStopping ( bool state )

Definition at line 158 of file UCvsApp.cpp.

References gCvsStopping.

Referenced by UCvsFrame::OnCmdStopcvs().

00159 {
00160     if (state ^ gCvsStopping)
00161     {
00162         gCvsStopping = state;
00163     }
00164 }

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 65 of file UCvsApp.cpp.

const URuntimeClass UCvsApp::classUCvsApp [static, protected]

UCvsApp * UCvsApp::gApp = 0L [static]

Definition at line 68 of file UCvsApp.cpp.

Referenced by AboutDialog(), UCvsFrame::AskForQuitting(), UCvsFolders::DisableGeneric(), UCvsFiles::DisableGeneric(), UCvsFiles::EditSel(), IsAppEnabled(), KoTraversalContext::KoTraversalContext(), launchCVS(), LaunchDiff(), UCvsFrame::OnBrowserPopup(), UCvsFolders::OnCmdExplore(), UCvsFiles::OnCmdExplore(), UCvsFolders::OnCmdIgnore(), UCvsFiles::OnCmdIgnore(), UCvsFrame::OnCmdStopcvs(), UCvsFolders::OnCmdUICheckout(), UCvsFolders::OnCmdUIIgnore(), UCvsFiles::OnCmdUIIgnore(), UCvsFolders::OnCmdUIImport(), UCvsFolders::OnCmdUIReload(), UCvsFrame::OnCmdUIViewRecursive(), UCvsFolders::OnCmdUIViewRecursive(), UCvsFiles::OnCmdUIViewRecursive(), UCvsFrame::OnComboSelDir(), UCvsFrame::OnCopyrights(), UCvsFolders::OnCreate(), UCvsFiles::OnCreate(), UCvsFrame::OnCredits(), UCvsFolders::OnDestroy(), UCvsFiles::OnDestroy(), OnMainTimer(), UCvsFolders::OnViewRecursive(), UCvsFiles::OnViewRecursive(), UCvsFolders::ResetBrowser(), UCvsFolders::ResetView(), UCvsFiles::ResetView(), CvsPrefs::save(), TBrowserFill::TBrowserFill(), and UCvsApp().

CvsProcess * UCvsApp::gCvsProcess = 0L [static, protected]

Definition at line 69 of file UCvsApp.cpp.

Referenced by GetCvsProcess(), OnMainTimer(), and SetCvsProcess().

bool UCvsApp::gCvsRunning [protected]

Definition at line 96 of file UCvsApp.h.

Referenced by IsCvsRunning(), and SetCvsRunning().

bool UCvsApp::gCvsStopping [protected]

Definition at line 97 of file UCvsApp.h.

Referenced by IsCvsStopping(), and SetCvsStopping().

UCvsFrame* UCvsApp::m_mainFrame [protected]

Definition at line 93 of file UCvsApp.h.

Referenced by GetFilterModel(), GetIgnoreModel(), GetMainFrame(), GetRecursionModel(), and UCvsApp().

const UMSGMAP UCvsApp::messageMap = { UWidget ::GetThisMessageMap(), & UCvsApp ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 65 of file UCvsApp.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsApp.h
  • common/UCvsApp.cpp
Generated on Fri Jan 31 12:15:21 2003 for WinCvs Source by doxygen 1.3-rc2


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(), UStr::length(), 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(), 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, 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(), 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, MAX_CHAR_BY_LINE, 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 Fri Jan 31 12:15:23 2003 for WinCvs Source by doxygen 1.3-rc2


CCvsConsole Class Reference

Base class for cvs process console. More...

#include <AppGlue.h>

Inheritance diagram for CCvsConsole:

[legend]
List of all members.

Public Methods

virtual long | cvs_out (char *txt, long len)=0L
Stdout handler.

virtual long | cvs_err (char *txt, long len)=0L
Stderr handler.

Detailed Description

Base class for cvs process console.

Definition at line 70 of file AppGlue.h.

Member Function Documentation

virtual long CCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [pure virtual]

Stderr handler.

Implemented in CStreamConsole, CItemListConsole, CPyCvsConsole, CTCLCvsConsole, CGraphConsole, and CRevisionConsole.

Referenced by glue_consoleerr().

virtual long CCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [pure virtual]

Stdout handler.

Implemented in CStreamConsole, CItemListConsole, CPyCvsConsole, CTCLCvsConsole, CGraphConsole, and CRevisionConsole.

Referenced by glue_consoleout().

The documentation for this class was generated from the following file:
  • common/AppGlue.h
Generated on Fri Jan 31 12:15:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 | OnFilteringChanged ()
void | ResetView (const char *path, bool notifyBrowser=false)
void | ResetView (bool forceReload=false, bool notifyBrowser=false)
bool | IsSortAscendant (void)
KiColumnModel * | GetColumnModel () const
const UStr & | GetPath () const

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 (bool needSelection)
bool | DisableGeneric (void)
int | Search (const char *title)
int | ProcessSelectionCommand (KiSelectionHandler &handler)
void | SaveColumns (void)
bool | LoadColumns (void)
void | ShowColumns (void)
void | HideColumns (void)
void | SetRecursive (bool isRecursive)
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 | OnCmdUIViewRecursive (UCmdUI *pCmdUI)
void | OnDblClick (void)
void | OnPopup (void)
void | OnSelColumn (int column)
void | OnViewRecursive (void)
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
KiColumnModel * m_modelColumns
bool | m_isRecursive

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 471 of file UCvsFiles.cpp.

References gFileViewSort, gFileViewSortAsc, kUCvsFilesID, m_ascendant, m_sort, and SetRecursive().

00471                      : UWidget(kUCvsFilesID), m_entries(200, ENTNODE::Compare), m_entriesMod(0), m_entriesLogMod(0)
00472
00473 {
00474     m_sort = (int)gFileViewSort;
00475     m_ascendant = (bool)gFileViewSortAsc;
00476
00477     SetRecursive(false);
00478 }

UCvsFiles::~UCvsFiles ( ) [virtual]

Definition at line 480 of file UCvsFiles.cpp.

References gFileViewSort, gFileViewSortAsc, m_ascendant, and m_sort.

00481 {
00482     gFileViewSort = m_sort;
00483     gFileViewSortAsc = m_ascendant;
00484 }

Member Function Documentation

const URuntimeClass * UCvsFiles::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 69 of file UCvsFiles.cpp.

bool UCvsFiles::DisableGeneric ( void ) [protected]

Definition at line 914 of file UCvsFiles.cpp.

Referenced by OnCmdUIAdd(), OnCmdUIAddB(), OnCmdUIEditseldef(), OnCmdUIExplore(), OnCmdUIGraph(), OnCmdUIIgnore(), OnCmdUIMacroSel(), OnCmdUIRelease(), OnCmdUIReload(), OnCmdUIRmv(), OnCmdUITrash(), OnCmdUIUpdate(), and OnCmdUIUpone().

00915 {
00916     return DisableGeneric(true);
00917 }

bool UCvsFiles::DisableGeneric ( bool needSelection ) [protected]

Definition at line 908 of file UCvsFiles.cpp.

References UCvsApp::gApp, UCmdTarget::GetWidID(), UWidget::HasFocus(), UCvsApp::IsCvsRunning(), UEventSendMessage(), and UMAKEINT.

00909 {
00910     return ((UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L) == -1) && needSelection) ||
00911         UCvsApp::gApp->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00912 }

void UCvsFiles::EditSel | ( | EntnodeData * | data,
 |  | bool | useDefault = false
 | ) | [protected]

Definition at line 1504 of file UCvsFiles.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, ENT_SUBDIR, UCvsApp::Execute(), UCvsApp::gApp, EntnodeData::GetFullPathName(), EntnodeData::GetType(), LaunchViewer(), and ResetView().

Referenced by OnCmdEditsel(), OnCmdEditseldef(), and OnDblClick().

01505 {
01506     UStr buf;
01507     CStr fullpath = data->GetFullPathName(buf);
01508
01509     if(data->GetType() == ENT_SUBDIR)
01510     {
01511         ResetView(fullpath, true);
01512     }
01513     else
01514     {
01515 #ifdef WIN32
01516         // This replaces huge chunk of code for now, even thought it's not ever called
01517         LaunchViewer((*data)[EntnodeData::kName]);
01518 #endif
01519 #ifdef qUnix
01520         CStr fullpath = data->GetFullPathName(buf);
01521
01522         CvsArgs args(false);
01523         args.add(gCvsPrefs.Viewer());
01524         args.add(fullpath);
01525         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01526 #endif
01527     }
01528 }

const UMSGMAP * UCvsFiles::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 71 of file UCvsFiles.cpp.

KiColumnModel* UCvsFiles::GetColumnModel ( ) const [inline]

Definition at line 59 of file UCvsFiles.h.

References m_modelColumns.

Referenced by HideColumns(), TViewFill::InitItem(), ResetView(), Resort(), and ShowColumns().

00060     {
00061         return m_modelColumns;
00062     }

void UCvsFiles::GetEntriesModTime | ( | time_t & | newEntriesMod,
 |  | time_t & | newEntriesLogMod
 | ) | [protected]

Definition at line 604 of file UCvsFiles.cpp.

References GetPath(), and stat.

Referenced by ResetView().

00605 {
00606     newEntriesMod = 0;
00607     newEntriesLogMod = 0;
00608     if(chdir(GetPath()) != 0)
00609         return;
00610     if(chdir("CVS") != 0)
00611         return;
00612
00613     struct stat sb;
00614     if (stat("Entries", &sb) != -1)
00615         newEntriesMod = sb.st_mtime;
00616     if (stat("Entries.log", &sb) != -1)
00617         newEntriesLogMod = sb.st_mtime;
00618     chdir(GetPath());
00619 }

void * UCvsFiles::GetImageForEntry ( EntnodeData * data ) [static]

Definition at line 787 of file UCvsFiles.cpp.

References ENT_FILE, EntnodeData::GetType(), EntnodeData::IsIgnored(), EntnodeData::IsMissing(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), 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 ResetView().

00788 {
00789     int result;
00790     void *resIcon = 0L;
00791
00792     if(data->GetType() == ENT_FILE)
00793     {
00794         const char *info = 0L;
00795         if(data->IsIgnored())
00796         {
00797             result = kFileIconIgnored;
00798         }
00799         else if(data->IsUnknown())
00800         {
00801             result = kFileIconUnknown;
00802         }
00803         else if(data->IsMissing())
00804         {
00805             result = data->IsRemoved() ? kFileIconRemoved : kFileIconMiss;
00806         }
00807         else if((*data)[EntnodeFile::kConflict] != 0L)
00808         {
00809             result = kFileIconConflict;
00810         }
00811         else if(data->IsRemoved())
00812         {
00813             result = kFileIconRemoved;
00814         }
00815         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00816         {
00817             result = data->IsUnmodified() ? kFileIconBinary : kFileIconBinaryMod;
00818         }
00819         else
00820         {
00821             result = data->IsUnmodified() ? kFileIconText : kFileIconTextMod;
00822         }
00823     }
00824     else
00825     {
00826         if(data->IsIgnored())
00827         {
00828             result = kFolderIconIgnored;
00829         }
00830         else if(data->IsUnknown())
00831         {
00832             result = kFolderIconUnknown;
00833         }
00834         else if(data->IsMissing())
00835         {
00836             result = kFolderIconMiss;
00837         }
00838         else
00839         {
00840             result = kFolderIcon;
00841         }
00842     }
00843
00844 #if qGTK
00845     void *pixmap = 0L;
00846     switch(result)
00847     {
00848     case kFileIconText:
00849         pixmap = sFileIconTextIcon;
00850         break;
00851     case kFileIconBinary:
00852         pixmap = sFileIconBinaryIcon;
00853         break;
00854     case kFileIconUnknown:
00855         pixmap = sFileIconUnknownIcon;
00856         break;
00857     case kFileIconAdded:
00858         pixmap = sFileIconAddedIcon;
00859         break;
00860     case kFileIconConflict:
00861         pixmap = sFileIconConflictIcon;
00862         break;
00863     case kFileIconMiss:
00864         pixmap = sFileIconMissIcon;
00865         break;
00866     case kFolderIcon:
00867         pixmap = sFolderIconIcon;
00868         break;
00869     case kFolderIconUnknown:
00870         pixmap = sFolderIconUnknownIcon;
00871         break;
00872     case kFolderIconMiss:
00873         pixmap = sFolderIconMissIcon;
00874         break;
00875     case kFileIconTextMod:
00876         pixmap = sFileIconTextModIcon;
00877         break;
00878     case kFileIconBinaryMod:
00879         pixmap = sFileIconBinaryModIcon;
00880         break;
00881     case kFileIconIgnored:
00882         pixmap = sFileIconIgnoredIcon;
00883         break;
00884     case kFolderIconIgnored:
00885         pixmap = sFolderIconIgnoredIcon;
00886         break;
00887     case kFileIconRemoved:
00888         pixmap = sFileIconRemovedIcon;
00889         break;
00890     }
00891     if(pixmap != 0L)
00892     {
00893         resIcon = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00894     }
00895 #endif
00896
00897     return resIcon;
00898 }

const UMSGMAP * UCvsFiles::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 71 of file UCvsFiles.cpp.

const UStr& UCvsFiles::GetPath ( ) const [inline]

Definition at line 168 of file UCvsFiles.h.

References CStr.

Referenced by GetEntriesModTime(), OnCmdExplore(), OnCmdUpone(), OnMacroSel(), ProcessSelectionCommand(), ResetView(), and Resort().

00168 { return m_path; };

const URuntimeClass * UCvsFiles::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 69 of file UCvsFiles.cpp.

const UMSGMAP * UCvsFiles::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 71 of file UCvsFiles.cpp.

void UCvsFiles::HideColumns ( void ) [protected]

Definition at line 1786 of file UCvsFiles.cpp.

References GetColumnModel(), KiColumnModel::GetCount(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

Referenced by OnCreate(), and ResetView().

01787 {
01788     KiColumnModel* model = GetColumnModel();
01789     int columnCount = model->GetCount();
01790
01791     UEventSendMessage(GetWidID(), EV_LIST_HIDECOLUMNS, UMAKEINT(kUMainWidget, columnCount), 0L);
01792 }

bool UCvsFiles::IsSortAscendant ( void ) [inline]

Definition at line 56 of file UCvsFiles.h.

References m_ascendant.

00056 { return m_ascendant; }

bool UCvsFiles::LoadColumns ( void ) [protected]

int UCvsFiles::OnCmdAdd ( void ) [protected]

Definition at line 1234 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01235 {
01236   KoAddHandler handler;
01237
01238   return ProcessSelectionCommand(handler);
01239 }

int UCvsFiles::OnCmdAddb ( void ) [protected]

Definition at line 1250 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01251 {
01252   KoAddBinaryHandler handler;
01253
01254   return ProcessSelectionCommand(handler);
01255 }

int UCvsFiles::OnCmdCommit ( void ) [protected]

Definition at line 1257 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01258 {
01259   KoCommitHandler handler;
01260   return ProcessSelectionCommand(handler);
01261 }

int UCvsFiles::OnCmdDiff ( void ) [protected]

Definition at line 1298 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01299 {
01300   KoDiffHandler handler;
01301
01302   return ProcessSelectionCommand(handler);
01303 }

int UCvsFiles::OnCmdEdit ( void ) [protected]

Definition at line 1354 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01355 {
01356   KoEditHandler handler;
01357
01358   return ProcessSelectionCommand(handler);
01359 }

int UCvsFiles::OnCmdEditors ( void ) [protected]

Definition at line 1375 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01376 {
01377   KoEditorsHandler handler;
01378
01379   return ProcessSelectionCommand(handler);
01380 }

int UCvsFiles::OnCmdEditsel ( void ) [protected]

Definition at line 1454 of file UCvsFiles.cpp.

References EditSel(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01455 {
01456     int nItem = -1;
01457
01458     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01459     {
01460         EntnodeData *data;
01461         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01462         EditSel(data);
01463     }
01464     return 0;
01465 }

int UCvsFiles::OnCmdEditseldef ( void ) [protected]

Definition at line 1467 of file UCvsFiles.cpp.

References EditSel(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01468 {
01469     int nItem = -1;
01470
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         EditSel(data, true);
01476     }
01477     return 0;
01478 }

int UCvsFiles::OnCmdExplore ( void ) [protected]

Definition at line 1412 of file UCvsFiles.cpp.

References _i18n, cvs_err(), UCvsApp::Execute(), UCvsApp::gApp, EntnodeData::GetFullPathName(), GetPath(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01413 {
01414     const char* fullpath = GetPath();
01415
01416     int nItem = -1;
01417
01418     // first add the folders
01419     if((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01420     {
01421         EntnodeData *data;
01422         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01423
01424         UStr buf;
01425         fullpath = data->GetFullPathName(buf);
01426
01427 #ifdef WIN32
01428         HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01429                                        0L, 0L, SW_SHOWDEFAULT);
01430         if((long)hInst < 32)
01431         {
01432             cvs_err(_i18n("Unable to explore '%s' (error %d)\n", (char *)GetPath(), GetLastError());
01433         }
01434 #endif
01435 #ifdef qUnix
01436         CvsArgs args(false);
01437         args.add(gCvsPrefs.Browser());
01438         args.add(fullpath);
01439         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01440 #endif
01441     }
01442     return 0;
01443 }

int UCvsFiles::OnCmdGraph ( void ) [protected]

Definition at line 1312 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01313 {
01314   KoGraphHandler handler;
01315
01316   return ProcessSelectionCommand(handler);
01317 }

int UCvsFiles::OnCmdIgnore ( void ) [protected]

Definition at line 1445 of file UCvsFiles.cpp.

References UCvsApp::gApp, UCvsApp::GetIgnoreModel(), ResetView(), and KoIgnoreModel::ToggleIgnore().

01446 {
01447     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01448     m_ignore->ToggleIgnore();
01449
01450     ResetView(true);
01451     return 0;
01452 }

int UCvsFiles::OnCmdLock ( void ) [protected]

Definition at line 1326 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01327 {
01328   KoLockHandler handler;
01329
01330   return ProcessSelectionCommand(handler);
01331 }

int UCvsFiles::OnCmdLog ( void ) [protected]

Definition at line 1305 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01306 {
01307   KoLogHandler handler;
01308
01309   return ProcessSelectionCommand(handler);
01310 }

int UCvsFiles::OnCmdQueryUpdate ( void ) [protected]

Definition at line 1270 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01271 {
01272   KoQueryUpdateHandler handler;
01273
01274   return ProcessSelectionCommand(handler);
01275 }

int UCvsFiles::OnCmdRelease ( void ) [protected]

Definition at line 1382 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01383 {
01384   KoReleaseHandler handler;
01385
01386   return ProcessSelectionCommand(handler);
01387 }

int UCvsFiles::OnCmdReload ( void ) [protected]

Definition at line 1277 of file UCvsFiles.cpp.

References ResetView().

01278 {
01279     ResetView(true, true);
01280     return 0;
01281 }

int UCvsFiles::OnCmdRmv ( void ) [protected]

Definition at line 1263 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01264 {
01265   KoFileRemoveHandler handler;
01266
01267   return ProcessSelectionCommand(handler);
01268 }

int UCvsFiles::OnCmdStatus ( void ) [protected]

Definition at line 1319 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01320 {
01321   KoStatusHandler handler;
01322
01323   return ProcessSelectionCommand(handler);
01324 }

int UCvsFiles::OnCmdTagBranch ( void ) [protected]

Definition at line 1404 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01405 {
01406   KoBranchTagHandler handler;
01407
01408   return ProcessSelectionCommand(handler);
01409 }

int UCvsFiles::OnCmdTagDelete ( void ) [protected]

Definition at line 1397 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01398 {
01399   KoDeleteTagHandler handler;
01400
01401   return ProcessSelectionCommand(handler);
01402 }

int UCvsFiles::OnCmdTagNew ( void ) [protected]

Definition at line 1390 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01391 {
01392   KoCreateTagHandler handler;
01393
01394   return ProcessSelectionCommand(handler);
01395 }

int UCvsFiles::OnCmdTrash ( void ) [protected]

Definition at line 1291 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01292 {
01293   KoMoveToTrashHandler handler;
01294
01295   return ProcessSelectionCommand(handler);
01296 }

void UCvsFiles::OnCmdUIAdd ( UCmdUI * pCmdUI ) [protected]

Definition at line 957 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_FILE, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsMissing(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

00958 {
00959     if(DisableGeneric())
00960     {
00961         pCmdUI->Enable(false);
00962         return;
00963     }
00964
00965     int nItem = -1;
00966     bool res = true;
00967     int numFiles = 0;
00968     int numFolders = 0;
00969
00970     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00971     {
00972         EntnodeData *data;
00973         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00974
00975         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00976         {
00977             res = false;
00978             break;
00979         }
00980         if(data->GetType() == ENT_FILE)
00981         {
00982             numFiles++;
00983         }
00984         else
00985             numFolders++;
00986
00987         if((numFiles != 0) && (numFolders != 0))
00988         {
00989             res = false;
00990             break;
00991         }
00992     }
00993
00994     pCmdUI->Enable(res);
00995 }

void UCvsFiles::OnCmdUIAddB ( UCmdUI * pCmdUI ) [protected]

Definition at line 997 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_FILE, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsMissing(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

00998 {
00999     if(DisableGeneric())
01000     {
01001         pCmdUI->Enable(false);
01002         return;
01003     }
01004
01005     int nItem = -1;
01006     bool res = true;
01007
01008     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01009     {
01010         EntnodeData *data;
01011         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01012
01013         if(data->GetType() != ENT_FILE)
01014         {
01015             res = false;
01016             break;
01017         }
01018         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
01019         {
01020             res = false;
01021             break;
01022         }
01023     }
01024
01025     pCmdUI->Enable(res);
01026 }

void UCvsFiles::OnCmdUIEditseldef ( UCmdUI * pCmdUI ) [protected]

Definition at line 1114 of file UCvsFiles.cpp.

References _i18n, CStr, DisableGeneric(), UCmdUI::Enable(), ENT_SUBDIR, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsMissing(), UCmdUI::SetText(), UEventSendMessage(), and UMAKEINT.

01115 {
01116     if(DisableGeneric())
01117     {
01118         pCmdUI->Enable(false);
01119         return;
01120     }
01121
01122     int nItem = -1;
01123     bool res = true;
01124
01125     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01126     {
01127         EntnodeData *data;
01128         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01129
01130         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01131         {
01132             res = false;
01133             break;
01134         }
01135     }
01136
01137     pCmdUI->Enable(res);
01138     if(gCvsPrefs.Viewer() != 0L)
01139     {
01140         CStr title(_i18n("Edit with "));
01141         title << gCvsPrefs.Viewer();
01142         pCmdUI->SetText(title);
01143     }
01144 }

void UCvsFiles::OnCmdUIExplore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1181 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), UCmdTarget::GetWidID(), EntnodeData::IsMissing(), UEventSendMessage(), and UMAKEINT.

01182 {
01183     if(DisableGeneric())
01184     {
01185         pCmdUI->Enable(false);
01186         return;
01187     }
01188
01189     int nItem = -1;
01190     bool res = true;
01191     int numItem = 0;
01192
01193     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01194     {
01195         EntnodeData *data;
01196         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01197
01198         if(data->IsMissing() || ++numItem > 1)
01199         {
01200             res = false;
01201             break;
01202         }
01203     }
01204
01205     pCmdUI->Enable(res);
01206 }

void UCvsFiles::OnCmdUIGraph ( UCmdUI * pCmdUI ) [protected]

Definition at line 1088 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_SUBDIR, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

01089 {
01090     if(DisableGeneric())
01091     {
01092         pCmdUI->Enable(false);
01093         return;
01094     }
01095
01096     int nItem = -1;
01097     bool res = true;
01098
01099     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01100     {
01101         EntnodeData *data;
01102         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01103
01104         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
01105         {
01106             res = false;
01107             break;
01108         }
01109     }
01110
01111     pCmdUI->Enable(res);
01112 }

void UCvsFiles::OnCmdUIIgnore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1208 of file UCvsFiles.cpp.

References UCmdUI::Check(), DisableGeneric(), UCmdUI::Enable(), UCvsApp::gApp, UCvsApp::GetIgnoreModel(), and KoIgnoreModel::IsShowIgnored().

01209 {
01210     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01211     pCmdUI->Enable(!DisableGeneric(false));
01212     pCmdUI->Check(m_ignore->IsShowIgnored());
01213 }

void UCvsFiles::OnCmdUIMacroSel | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 1222 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01223 {
01224     if(DisableGeneric())
01225     {
01226         pCmdUI->Enable(false);
01227         return;
01228     }
01229
01230     int nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L);
01231     pCmdUI->Enable(nItem != -1 && CTcl_Interp::IsAvail());
01232 }

void UCvsFiles::OnCmdUIRelease ( UCmdUI * pCmdUI ) [protected]

Definition at line 1028 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_SUBDIR, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

01029 {
01030     if(DisableGeneric())
01031     {
01032         pCmdUI->Enable(false);
01033         return;
01034     }
01035
01036     int nItem = -1;
01037     bool res = true;
01038     int numFolders = 0;
01039
01040     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01041     {
01042         EntnodeData *data;
01043         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01044
01045         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
01046         {
01047             res = false;
01048             break;
01049         }
01050         numFolders++;
01051
01052         if(numFolders > 1)
01053         {
01054             res = false;
01055             break;
01056         }
01057     }
01058
01059     pCmdUI->Enable(res);
01060 }

void UCvsFiles::OnCmdUIReload ( UCmdUI * pCmdUI ) [protected]

Definition at line 1146 of file UCvsFiles.cpp.

References DisableGeneric(), and UCmdUI::Enable().

01147 {
01148     pCmdUI->Enable(!DisableGeneric());
01149 }

void UCvsFiles::OnCmdUIRmv ( UCmdUI * pCmdUI ) [protected]

Definition at line 1062 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_SUBDIR, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsRemoved(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

01063 {
01064     if(DisableGeneric())
01065     {
01066         pCmdUI->Enable(false);
01067         return;
01068     }
01069
01070     int nItem = -1;
01071     bool res = true;
01072
01073     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01074     {
01075         EntnodeData *data;
01076         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01077
01078         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
01079         {
01080             res = false;
01081             break;
01082         }
01083     }
01084
01085     pCmdUI->Enable(res);
01086 }

void UCvsFiles::OnCmdUITrash ( UCmdUI * pCmdUI ) [protected]

Definition at line 1156 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_SUBDIR, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsMissing(), UEventSendMessage(), and UMAKEINT.

01157 {
01158     if(DisableGeneric())
01159     {
01160         pCmdUI->Enable(false);
01161         return;
01162     }
01163
01164     int nItem = -1;
01165     bool res = true;
01166
01167     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01168     {
01169         EntnodeData *data;
01170         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01171         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01172         {
01173             res = false;
01174             break;
01175         }
01176     }
01177
01178     pCmdUI->Enable(res);
01179 }

void UCvsFiles::OnCmdUIUpdate ( UCmdUI * pCmdUI ) [protected]

Definition at line 919 of file UCvsFiles.cpp.

References DisableGeneric(), UCmdUI::Enable(), ENT_FILE, EntnodeData::GetType(), UCmdTarget::GetWidID(), EntnodeData::IsUnknown(), UEventSendMessage(), and UMAKEINT.

00920 {
00921     if(DisableGeneric())
00922     {
00923         pCmdUI->Enable(false);
00924         return;
00925     }
00926
00927     int nItem = -1;
00928     bool res = true;
00929     int numFiles = 0;
00930     int numFolders = 0;
00931
00932     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00933     {
00934         EntnodeData *data;
00935         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00936
00937         if(data->IsUnknown())
00938         {
00939             res = false;
00940             break;
00941         }
00942         if(data->GetType() == ENT_FILE)
00943             numFiles++;
00944         else
00945             numFolders++;
00946
00947         if((numFiles != 0) && (numFolders != 0))
00948         {
00949             res = false;
00950             break;
00951         }
00952     }
00953
00954     pCmdUI->Enable(res);
00955 }

void UCvsFiles::OnCmdUIUpone ( UCmdUI * pCmdUI ) [protected]

Definition at line 1151 of file UCvsFiles.cpp.

References DisableGeneric(), and UCmdUI::Enable().

01152 {
01153     pCmdUI->Enable(!DisableGeneric());
01154 }

void UCvsFiles::OnCmdUIViewRecursive ( UCmdUI * pCmdUI ) [protected]

Definition at line 1215 of file UCvsFiles.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), UCvsApp::gApp, UCvsApp::GetRecursionModel(), and KoRecursionModel::IsShowRecursive().

01216 {
01217     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01218     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01219     pCmdUI->Check(m_recursion->IsShowRecursive());
01220 }

int UCvsFiles::OnCmdUnedit ( void ) [protected]

Definition at line 1361 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01362 {
01363   KoUneditHandler handler;
01364
01365   return ProcessSelectionCommand(handler);
01366 }

int UCvsFiles::OnCmdUnlock ( void ) [protected]

Definition at line 1333 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01334 {
01335   KoUnlockHandler handler;
01336
01337   return ProcessSelectionCommand(handler);
01338 }

int UCvsFiles::OnCmdUpdate ( void ) [protected]

Definition at line 901 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

00902 {
00903   KoUpdateHandler handler;
00904
00905   return ProcessSelectionCommand(handler);
00906 }

int UCvsFiles::OnCmdUpone ( void ) [protected]

Definition at line 1283 of file UCvsFiles.cpp.

References GetPath(), ResetView(), and SplitPath().

01284 {
01285     UStr uppath, filename;
01286     SplitPath(GetPath(), uppath, filename);
01287     ResetView(uppath, true);
01288     return 0;
01289 }

int UCvsFiles::OnCmdWatchers ( void ) [protected]

Definition at line 1368 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01369 {
01370   KoWatchersHandler handler;
01371
01372   return ProcessSelectionCommand(handler);
01373 }

int UCvsFiles::OnCmdWatchOff ( void ) [protected]

Definition at line 1347 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01348 {
01349   KoWatchOnHandler handler;
01350
01351   return ProcessSelectionCommand(handler);
01352 }

int UCvsFiles::OnCmdWatchOn ( void ) [protected]

Definition at line 1340 of file UCvsFiles.cpp.

References ProcessSelectionCommand().

01341 {
01342   KoWatchOnHandler handler;
01343
01344   return ProcessSelectionCommand(handler);
01345 }

void UCvsFiles::OnCreate ( ) [protected]

Definition at line 546 of file UCvsFiles.cpp.

References NotificationManager::CheckIn(), UCvsApp::gApp, UCvsApp::GetFilterModel(), UCvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), KiRecursionModel::GetNotificationManager(), KiFilterModel::GetNotificationManager(), UCvsApp::GetRecursionModel(), UCmdTarget::GetWidID(), HideColumns(), KoTraversalContext::IsRecursive(), SetRecursive(), sFileIconAddedIcon, sFileIconBinaryIcon, sFileIconBinaryModIcon, sFileIconConflictIcon, sFileIconIgnoredIcon, sFileIconMissIcon, sFileIconRemovedIcon, sFileIconTextIcon, sFileIconTextModIcon, sFileIconUnknownIcon, sFolderIconIcon, sFolderIconIgnoredIcon, sFolderIconMissIcon, sFolderIconUnknownIcon, ShowColumns(), UCreate_pixmap(), UEventSendMessage(), and UMAKEINT.

00547 {
00548     KoTraversalContext context(this);
00549     bool recursive;
00550
00551     if(sFileIconTextIcon == 0L)
00552     {
00553         sFileIconTextIcon = UCreate_pixmap(this, "cvsfile.xpm");
00554         sFileIconBinaryIcon = UCreate_pixmap(this, "binfile.xpm");
00555         sFileIconUnknownIcon = UCreate_pixmap(this, "unkfile.xpm");
00556         sFileIconAddedIcon = UCreate_pixmap(this, "addfile.xpm");
00557         sFileIconConflictIcon = UCreate_pixmap(this, "conflict.xpm");
00558         sFileIconMissIcon = UCreate_pixmap(this, "missfile.xpm");
00559         sFolderIconIcon = UCreate_pixmap(this, "folder.xpm");
00560         sFolderIconUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00561         sFolderIconMissIcon = UCreate_pixmap(this, "foldmiss.xpm");
00562         sFileIconTextModIcon = UCreate_pixmap(this, "modfile.xpm");
00563         sFileIconBinaryModIcon = UCreate_pixmap(this, "modbin.xpm");
00564         sFileIconIgnoredIcon = UCreate_pixmap(this, "ignfile.xpm");
00565         sFolderIconIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00566         sFileIconRemovedIcon = UCreate_pixmap(this, "delfile.xpm");
00567     }
00568
00569     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 0), 0L);
00570
00571     recursive = context.IsRecursive();
00572
00573     SetRecursive(!recursive);
00574     HideColumns();
00575
00576     SetRecursive(recursive);
00577     ShowColumns();
00578
00579     if( UCvsApp* app = UCvsApp::gApp ) {
00580         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00581         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00582         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00583     }
00584     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 1), 0L);
00585 }

void UCvsFiles::OnDblClick ( void ) [protected]

Definition at line 1530 of file UCvsFiles.cpp.

References EditSel(), UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

01531 {
01532     int nItem = -1;
01533
01534     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01535     {
01536         EntnodeData *data;
01537         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01538         EditSel(data);
01539     }
01540 }

void UCvsFiles::OnDestroy ( ) [protected]

Definition at line 528 of file UCvsFiles.cpp.

References NotificationManager::CheckOut(), UCvsApp::gApp, UCvsApp::GetFilterModel(), UCvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), KiRecursionModel::GetNotificationManager(), KiFilterModel::GetNotificationManager(), and UCvsApp::GetRecursionModel().

00529 {
00530     // unregister notifications
00531     if (UCvsApp* app = UCvsApp::gApp)
00532     {
00533         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
00534         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
00535         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
00536     }
00537
00538     delete this;
00539 }

void UCvsFiles::OnFilteringChanged ( )

Definition at line 1794 of file UCvsFiles.cpp.

References ResetView().

01795 {
01796 //  if( !m_isResetViewPending ) {
01797 //      m_isResetViewPending = true;
01798     ResetView(true);
01799 //  }
01800 }

int UCvsFiles::OnMacroSel ( int cmd ) [protected]

Definition at line 1480 of file UCvsFiles.cpp.

References cmdSELMACRO, CStr, CTcl_Interp::DoScriptVar(), GetPath(), UCmdTarget::GetWidID(), CMacroEntry::path, ResetView(), TclBrowserAppend(), TclBrowserReset(), UEventSendMessage(), UMAKEINT, and CTcl_Interp::Unixfy().

01481 {
01482     CTcl_Interp interp;
01483     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01484     CStr path = entry.path;
01485     CTcl_Interp::Unixfy(path);
01486
01487     TclBrowserReset();
01488
01489     int nItem = -1;
01490     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01491     {
01492         EntnodeData *data;
01493         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01494         TclBrowserAppend(GetPath(), data);
01495     }
01496
01497     interp.DoScriptVar("source \"%s\"", (const char *)path);
01498
01499     ResetView(true, true);
01500
01501     return 0;
01502 }

void UCvsFiles::OnPopup ( void ) [protected]

Definition at line 1542 of file UCvsFiles.cpp.

01543 {
01544     fprintf(stderr, "UCvsFiles: Popup called\n");
01545 }

void UCvsFiles::OnSelColumn ( int column ) [protected]

Definition at line 1739 of file UCvsFiles.cpp.

References EntnodeFile::kConflict, EntnodeData::kName, EntnodeFile::kOption, EntnodeData::kStatus, EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kVN, m_ascendant, m_sort, and Resort().

01740 {
01741     if(column == m_sort)
01742         m_ascendant = !m_ascendant;
01743     else
01744     {
01745         m_ascendant = true;
01746         switch(column)
01747         {
01748         case EntnodeData::kName:
01749         case EntnodeData::kStatus:
01750         case EntnodeFile::kOption:
01751         case EntnodeFile::kTag:
01752         case EntnodeFile::kConflict:
01753         case EntnodeFile::kTS:
01754         case EntnodeFile::kVN:
01755             m_sort = column;
01756             break;
01757         }
01758     }
01759
01760     Resort();
01761 }

void UCvsFiles::OnViewRecursive ( void ) [protected]

Definition at line 1241 of file UCvsFiles.cpp.

References UCvsApp::gApp, UCvsApp::GetMainFrame(), UCvsApp::GetRecursionModel(), UCvsFrame::OnFilterMaskEntered(), ResetView(), and KoRecursionModel::ToggleRecursion().

01242 {
01243     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01244     m_recursion->ToggleRecursion();
01245     ResetView(true, true);
01246
01247     UCvsApp::gApp->GetMainFrame()->OnFilterMaskEntered();
01248 }

int UCvsFiles::ProcessSelectionCommand ( KiSelectionHandler & handler ) [protected]

Definition at line 486 of file UCvsFiles.cpp.

References ENT_SUBDIR, EntnodeData::GetFullPathName(), KiSelectionHandler::GetNeedViewReset(), GetPath(), EntnodeData::GetType(), UCmdTarget::GetWidID(), UStr::length(), MultiFiles::newdir(), MultiFiles::newfile(), KiSelectionHandler::OnFiles(), KiSelectionHandler::OnFolder(), ResetView(), MultiFiles::TotalNumFiles(), UEventSendMessage(), and UMAKEINT.

Referenced by OnCmdAdd(), OnCmdAddb(), OnCmdCommit(), OnCmdDiff(), OnCmdEdit(), OnCmdEditors(), OnCmdGraph(), OnCmdLock(), OnCmdLog(), OnCmdQueryUpdate(), OnCmdRelease(), OnCmdRmv(), OnCmdStatus(), OnCmdTagBranch(), OnCmdTagDelete(), OnCmdTagNew(), OnCmdTrash(), OnCmdUnedit(), OnCmdUnlock(), OnCmdUpdate(), OnCmdWatchers(), OnCmdWatchOff(), and OnCmdWatchOn().

00487 {
00488   int nItem = -1;
00489
00490   MultiFiles mf;
00491   mf.newdir(GetPath());
00492   int pathLen = GetPath().length();
00493
00494   // first add the folders
00495   while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00496   {
00497     EntnodeData *data;
00498     UStr buf;
00499
00500     UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00501     const char* fullpath = data->GetFullPathName(buf);
00502
00503     if(data->GetType() == ENT_SUBDIR)
00504     {
00505         handler.OnFolder(fullpath);
00506     }
00507     else
00508     {
00509         const char* fn = data->GetFullPathName(buf) + pathLen;
00510         if(*fn == kPathDelimiter ) {
00511             fn++;
00512         }
00513
00514
00515         mf.newfile(fn, 0, (*data)[EntnodeFile::kVN]);
00516     }
00517   }
00518   if(mf.TotalNumFiles() != 0)
00519   {
00520     handler.OnFiles(&mf);
00521
00522     ResetView(handler.GetNeedViewReset());
00523   }
00524
00525   return 0;
00526 }

void UCvsFiles::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyBrowser = false
 | ) |

Definition at line 645 of file UCvsFiles.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), ULIST_INSERT::col, Entries_SetMissing(), FileTraverse(), UCvsApp::gApp, CSortList< ENTNODE >::Get(), KiColumnModel::GetAt(), UCvsApp::GetBrowserView(), GetColumnModel(), KiColumnModel::GetCount(), EntnodeData::GetDesc(), GetEntriesModTime(), EntnodeData::GetFullPathName(), GetImageForEntry(), GetPath(), UCmdTarget::GetWidID(), HideColumns(), ULIST_INSERT::icon, TViewFill::InitItem(), USemaphore::IsEnteredTwice(), EntnodeData::IsMissing(), KoTraversalContext::IsRecursive(), EntnodeData::kName, EntnodeData::kStatus, m_entries, m_entriesLogMod, m_entriesMod, m_isRecursive, m_modelColumns, m_sort, NULL, CSortList< ENTNODE >::NumOfElements(), UCvsFolders::ResetView(), Resort(), ULIST_INSERT::row, Search(), SetRecursive(), ShowColumns(), ULIST_INSERT::title, UEventSendMessage(), and UMAKEINT.

00646 {
00647     UWaitCursor wait;
00648
00649     static bool sSemaphore = false;
00650     USemaphore policeman(sSemaphore);
00651     if(policeman.IsEnteredTwice())
00652         return;
00653
00654     // - check if we really need to reload (forceReload == false)
00655     // - wait a bit for the watcher in order to let him tell us
00656     // if something was modified.
00657     time_t newEntriesMod;
00658     time_t newEntriesLogMod;
00659     GetEntriesModTime(newEntriesMod, newEntriesLogMod);
00660     if(!forceReload)
00661     {
00662         if(m_entriesMod == newEntriesMod && m_entriesLogMod == newEntriesLogMod)
00663             return;
00664     }
00665
00666     // reset all the watchers
00667     m_entriesMod = newEntriesMod;
00668     m_entriesLogMod = newEntriesLogMod;
00669
00670     // get the selection to later try to restore it
00671     CvsArgs selection(false);
00672     int nItem = -1;
00673     UStr buf;
00674
00675     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
00676                                      UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00677     {
00678         EntnodeData *data;
00679         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00680         //selection.add((*data)[EntnodeData::kName]);
00681         selection.add(data->GetFullPathName(buf));
00682     }
00683
00684     UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kUMainWidget, 0L);
00685
00686     // make sure columns are ok
00687     KoTraversalContext context(this);
00688
00689     if ((context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive))
00690     {
00691
00692         KiColumnModel* oldModel = GetColumnModel();
00693         int oldCount = oldModel->GetCount();
00694         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00695         HideColumns();
00696
00697         SetRecursive(context.IsRecursive());
00698         ShowColumns();
00699
00700         if (oldColumn == NULL)
00701         {
00702                 m_sort = 0;
00703         }
00704         else
00705         {
00706             KiColumnModel* newModel = GetColumnModel();
00707             int newCount = newModel->GetCount();
00708             int sort = -1;
00709             for (int pos = 0; pos < newCount && sort == -1; pos++)
00710             {
00711                 if (newModel->GetAt(pos) == oldColumn)
00712                 {
00713                     sort = pos;
00714                 }
00715             }
00716             m_sort = (sort >= 0) ? sort : 0;
00717         }
00718     }
00719
00720     // refetch all items
00721     TViewFill traverse(/*this, */&context, m_entries);
00722     /*kTraversal res = */FileTraverse(GetPath(), traverse);
00723
00724     // add the missing files
00725     Entries_SetMissing(m_entries);
00726
00727     int numEntries = m_entries.NumOfElements();
00728     for(int i = 0; i < numEntries; i++)
00729     {
00730         const ENTNODE & theNode = m_entries.Get(i);
00731         EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00732         if(!data->IsMissing())
00733             continue;
00734
00735         //TViewFill::
00736         traverse.InitItem(data, UCvsFiles::GetImageForEntry(data));
00737 #ifdef _0_
00738         int rownum;
00739         UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00740         UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00741         ULIST_INSERT entry;
00742         entry.row = rownum;
00743
00744         entry.col = 0;
00745         entry.title = (*data)[EntnodeData::kName];
00746         entry.icon = UCvsFiles::GetImageForEntry(data);
00747         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00748
00749         entry.icon = 0L;
00750
00751         // set item text for additional columns
00752         for(int j = 1; j < m_modelColumns->GetCount(); j++)
00753         {
00754             const char *info = (*data)[j];
00755             if(info != 0L)
00756             {
00757                 entry.col = j;
00758                 entry.title = info;
00759                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00760             }
00761         }
00762         entry.col = EntnodeData::kStatus;
00763         entry.title = data->GetDesc();
00764         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00765 #endif
00766     }
00767
00768     Resort();
00769
00770     // now restore the selection
00771     int argc = selection.Argc(), c;
00772     char * const *argv = selection.Argv();
00773     for(c = 0; c < argc; c++)
00774     {
00775         int row = Search(argv[c]);
00776         if(row != -1)
00777             UEventSendMessage(GetWidID(), EV_LIST_ADDSEL, UMAKEINT(kUMainWidget, row), 0L);
00778     }
00779
00780     if(notifyBrowser)
00781     {
00782         // notify the tree
00783         UCvsApp::gApp->GetBrowserView()->ResetView(forceReload);
00784     }
00785 }

void UCvsFiles::ResetView | ( | const char * | path,
 |  | bool | notifyBrowser = false
 | ) |

Definition at line 587 of file UCvsFiles.cpp.

References UCvsApp::gApp, UCvsApp::GetBrowserView(), GetPath(), m_path, UCvsFolders::StepToLocation(), and UEventSendMessage().

Referenced by EditSel(), OnCmdIgnore(), OnCmdReload(), OnCmdUpone(), OnFilteringChanged(), OnMacroSel(), UCvsApp::OnMainTimer(), UCvsFolders::OnTreeSelecting(), OnViewRecursive(), ProcessSelectionCommand(), UCvsFolders::ResetBrowser(), and UCvsFolders::ResetView().

00588 {
00589     m_path = path;
00590     ResetView(true);
00591
00592     UStr title(UCvsApp::gApp->GetAppName());
00593     title << ": ";
00594     title << GetPath();
00595     UEventSendMessage(kUCvsFrameID, EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00596
00597     if(notifyBrowser)
00598     {
00599         // notify the tree
00600         UCvsApp::gApp->GetBrowserView()->StepToLocation(path);
00601     }
00602 }

void UCvsFiles::Resort ( void ) [protected]

Definition at line 1729 of file UCvsFiles.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), GetPath(), UCmdTarget::GetWidID(), gSortParam, UEventSendMessage(), and UMAKEINT.

Referenced by OnSelColumn(), and ResetView().

01730 {
01731     KiColumnModel* model = GetColumnModel();
01732     KoColumnContext context(GetPath());
01733     gSortParam = new CSortParam (m_ascendant, true, model->GetAt(m_sort), model->GetAt(EntnodeData::kName), &context);
01734
01735     UEventSendMessage(GetWidID(), EV_LIST_RESORT, UMAKEINT(kUMainWidget, m_sort), (void *)gtkCompareWrap);
01736     UEventSendMessage(GetWidID(), EV_LIST_SETSORTDIR, UMAKEINT(kUMainWidget, m_sort), (void *)m_ascendant);
01737 }

const URuntimeClass * UCvsFiles::rtUCvsFiles ( void ) [static]

Definition at line 69 of file UCvsFiles.cpp.

void UCvsFiles::SaveColumns ( void ) [protected]

int UCvsFiles::Search ( const char * title ) [protected]

Definition at line 621 of file UCvsFiles.cpp.

References ULIST_INFO::col, UCmdTarget::GetWidID(), ULIST_INFO::row, ULIST_INFO::title, UEventSendMessage(), and UMAKEINT.

Referenced by ResetView().

00622 {
00623     int row = -1;
00624     while((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXT,
00625                                      UMAKEINT(kUMainWidget, row), 0L)) != -1)
00626     {
00627         ULIST_INFO info;
00628         info.col = 0;
00629         info.row = row;
00630         UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kUMainWidget, &info);
00631         if(info.title == 0L)
00632             continue;
00633
00634 #if qUnix
00635         if(strcmp(title, info.title) == 0)
00636 #else
00637         if(stricmp(title, info.title) == 0)
00638 #endif
00639             return row;
00640     }
00641
00642     return -1;
00643 }

void UCvsFiles::SetRecursive ( bool isRecursive ) [protected]

Definition at line 1763 of file UCvsFiles.cpp.

References KiColumnModel::GetRecursiveModel(), KiColumnModel::GetRegularModel(), m_isRecursive, and m_modelColumns.

Referenced by OnCreate(), ResetView(), and UCvsFiles().

01764 {
01765     m_isRecursive = isRecursive;
01766     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
01767 }

void UCvsFiles::ShowColumns ( void ) [protected]

Definition at line 1769 of file UCvsFiles.cpp.

References KiColumnModel::GetAt(), GetColumnModel(), KiColumnModel::GetCount(), KiColumn::GetSetupData(), UCmdTarget::GetWidID(), m_modelColumns, UEventSendMessage(), and UMAKEINT.

Referenced by OnCreate(), and ResetView().

01770 {
01771     KiColumnModel* model = GetColumnModel();
01772     int columnCount = model->GetCount();
01773
01774     UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kUMainWidget, columnCount), 0L);
01775
01776     for(int i = 0; i<columnCount; i++)
01777     {
01778         LV_COLUMN lv;
01779
01780         m_modelColumns->GetAt(i)->GetSetupData(&lv);
01781         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kUMainWidget, i), (char*)lv.name);
01782         UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kUMainWidget, i), (void *)lv.width);
01783     }
01784 }

Member Data Documentation

const UMSGMAP_ENTRY UCvsFiles::_messageEntries [static, private]

Reimplemented from UWidget.

Definition at line 71 of file UCvsFiles.cpp.

const URuntimeClass UCvsFiles::classUCvsFiles [static, protected]

bool UCvsFiles::m_ascendant [protected]

Definition at line 83 of file UCvsFiles.h.

Referenced by IsSortAscendant(), OnSelColumn(), UCvsFiles(), and ~UCvsFiles().

CSortList<ENTNODE> UCvsFiles::m_entries [protected]

Definition at line 74 of file UCvsFiles.h.

Referenced by ResetView().

time_t UCvsFiles::m_entriesLogMod [protected]

Definition at line 79 of file UCvsFiles.h.

Referenced by ResetView().

time_t UCvsFiles::m_entriesMod [protected]

Definition at line 78 of file UCvsFiles.h.

Referenced by ResetView().

bool UCvsFiles::m_isRecursive [protected]

Definition at line 111 of file UCvsFiles.h.

Referenced by ResetView(), and SetRecursive().

KiColumnModel* UCvsFiles::m_modelColumns [protected]

Definition at line 86 of file UCvsFiles.h.

Referenced by GetColumnModel(), ResetView(), SetRecursive(), and ShowColumns().

UStr UCvsFiles::m_path [protected]

Definition at line 76 of file UCvsFiles.h.

Referenced by ResetView().

int UCvsFiles::m_sort [protected]

Definition at line 81 of file UCvsFiles.h.

Referenced by OnSelColumn(), ResetView(), UCvsFiles(), and ~UCvsFiles().

const UMSGMAP UCvsFiles::messageMap = { UWidget ::GetThisMessageMap(), & UCvsFiles ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 71 of file UCvsFiles.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFiles.h
  • common/UCvsFiles.cpp
Generated on Fri Jan 31 12:15:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 (void)
void | DeleteAllItems (UTREEITEM root)
void | ResetView (bool forceReload=false, bool notifyView=false)
int | OnCmdIgnore (void)

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)
int | ProcessSelectionCommand (KiSelectionHandler &handler)
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)
void | OnCmdUIViewRecursive (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 | OnCmdCheckout (void)
int | OnCmdImport (void)
int | OnViewRecursive (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 442 of file UCvsFolders.cpp.

References kUCvsFoldersID.

00442                          : UWidget(kUCvsFoldersID)
00443 {
00444 }

UCvsFolders::~UCvsFolders ( ) [virtual]

Definition at line 446 of file UCvsFolders.cpp.

00447 {
00448 }

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 )

Definition at line 925 of file UCvsFolders.cpp.

References ASSERT, UTREE_INFO::child, UTREE_INFO::data, DeleteAllItems(), UCmdTarget::GetWidID(), UTREE_INFO::item, UTREE_INFO::next, UEventSendMessage(), EntnodeData::UnRef(), and UTREEITEM.

00926 {
00927     // we don't want the file view to be notified when things get deleted
00928     CTempToggleBool toggler(sTemporaryTurnOffNotify);
00929
00930     UTREE_INFO query;
00931     bool eraseRoot = false;
00932     query.item = root;
00933     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00934     if(root == 0L)
00935     {
00936         root = query.item;
00937         eraseRoot = true;
00938     }
00939
00940     if(root == 0L)
00941         return;
00942
00943     UTREEITEM childItem = query.child;
00944
00945     // erase all the childs
00946     while(childItem != 0L)
00947     {
00948         UTREE_INFO queryChild;
00949         queryChild.item = childItem;
00950         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &queryChild);
00951
00952         EntnodeData *data = (EntnodeData *)queryChild.data;
00953         if(data != 0L)
00954         {
00955             queryChild.data = 0L; // So that subsequent references after UnRef() won't SEGV
00956             UEventSendMessage(GetWidID(), EV_TREE_SETDATA, kUMainWidget, &queryChild);
00957             data->UnRef();  // Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00958         }
00959
00960         DeleteAllItems(childItem);
00961
00962         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, childItem);
00963         childItem = queryChild.next;
00964     }
00965
00966     // erase the root only if initially root was 0L
00967     if(eraseRoot)
00968     {
00969         EntnodeData *data = (EntnodeData *)query.data;
00970         ASSERT(data == 0L);
00971
00972         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, root);
00973     }
00974 }

void UCvsFolders::DeleteAllItems ( void )

Definition at line 920 of file UCvsFolders.cpp.

Referenced by DeleteAllItems(), OnTreeExpanding(), and ResetBrowser().

00921 {
00922     DeleteAllItems(NULL);
00923 }

bool UCvsFolders::DisableGeneric ( ) [protected]

Definition at line 976 of file UCvsFolders.cpp.

References UCvsApp::gApp, UWidget::HasFocus(), and UCvsApp::IsCvsRunning().

Referenced by OnCmdUIExplore(), OnCmdUIMacrosSel(), and OnUpdateGeneric().

00977 {
00978     UCvsApp *app = UCvsApp::gApp;
00979     return app->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00980 }

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 729 of file UCvsFolders.cpp.

References UTREE_INFO::child, CStr, UTREE_INFO::data, UStr::endsWith(), UCmdTarget::GetWidID(), UTREE_INFO::item, UStr::length(), UTREE_INFO::next, UEventSendMessage(), and UTREEITEM.

Referenced by ResetView().

00730 {
00731     UStr root(m_root);
00732     if(!root.endsWith(kPathDelimiter))
00733         root << kPathDelimiter;
00734     UStr subpath(path);
00735     if(!subpath.endsWith(kPathDelimiter))
00736         subpath << kPathDelimiter;
00737
00738     // check if it is a sub-path
00739     if(strncmp(root, subpath, root.length()) != 0)
00740         return 0L;
00741
00742     UTREE_INFO query;
00743     query.item = 0L;
00744     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00745     UTREEITEM item = query.item;
00746     if(item == 0L)
00747         return 0L;
00748
00749     // step inside synchronized
00750     const char *tmp = (const char *)subpath + root.length() - 1;
00751     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00752     {
00753         const char *name = ++tmp;
00754         if(name[0] == '\0')
00755             break;
00756
00757         CStr subname;
00758         const char *tmp2 = strchr(name, kPathDelimiter);
00759         if(tmp2 == 0L)
00760             subname = name;
00761         else
00762             subname.set(name, tmp2 - name);
00763
00764         UTREEITEM childItem = query.child;
00765
00766         // find the subitem which matches this name
00767         while(childItem != 0L)
00768         {
00769             query.item = childItem;
00770             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00771             EntnodeData *data = (EntnodeData *)query.data;
00772             if(data != 0L)
00773             {
00774 #if qUnix
00775                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00776 #else
00777                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00778 #endif
00779                 {
00780                     item = childItem;
00781                     break;
00782                 }
00783             }
00784
00785             childItem = query.next;
00786         }
00787         if(childItem == 0L)
00788             return 0L;
00789     }
00790
00791     return item;
00792 }

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 42 of file UCvsFolders.h.

References m_root.

Referenced by CvsPrefs::save().

00042 { 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 1024 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01025 {
01026     KoAddHandler handler;
01027     return ProcessSelectionCommand(handler);
01028 }

int UCvsFolders::OnCmdCheckout ( void ) [protected]

Definition at line 1183 of file UCvsFolders.cpp.

References CvsCmdCheckoutModule().

01184 {
01185   KoCheckoutHandler handler;
01186     CvsCmdCheckoutModule(handler);
01187     return 0;
01188 }

int UCvsFolders::OnCmdCommit ( void ) [protected]

Definition at line 1030 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01031 {
01032     KoCommitHandler handler;
01033     return ProcessSelectionCommand(handler);
01034 }

int UCvsFolders::OnCmdDiff ( void ) [protected]

Definition at line 1042 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01043 {
01044     KoDiffHandler handler;
01045     return ProcessSelectionCommand(handler);
01046 }

int UCvsFolders::OnCmdEdit ( void ) [protected]

Definition at line 1084 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01085 {
01086     KoEditHandler handler;
01087     return ProcessSelectionCommand(handler);
01088 }

int UCvsFolders::OnCmdEditors ( void ) [protected]

Definition at line 1102 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01103 {
01104     KoEditorsHandler handler;
01105     return ProcessSelectionCommand(handler);
01106 }

int UCvsFolders::OnCmdExplore ( void ) [protected]

Definition at line 1132 of file UCvsFolders.cpp.

References _i18n, CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), ASSERT, cvs_err(), UCvsApp::Execute(), UCvsApp::gApp, UCmdTarget::GetWidID(), RetrievePath(), UEventSendMessage(), and UTREEITEM.

01133 {
01134     UTREEITEM *item;
01135     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01136     ASSERT(item != 0L);
01137
01138     UStr path;
01139     RetrievePath(item, path);
01140
01141 #ifdef WIN32
01142     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
01143             0L, 0L, SW_SHOWDEFAULT);
01144     if((long)hInst < 32)
01145     {
01146         cvs_err(_i18n("Unable to explore '%s' (error %d)\n"), (const char *)path, GetLastError());
01147     }
01148 #endif
01149 #ifdef qUnix
01150     CvsArgs args(false);
01151     args.add(gCvsPrefs.Browser());
01152     args.add(path);
01153     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01154 #endif
01155
01156     return 0;
01157 }

int UCvsFolders::OnCmdIgnore ( void )

Definition at line 1165 of file UCvsFolders.cpp.

References UCvsApp::gApp, UCvsApp::GetIgnoreModel(), ResetView(), and KoIgnoreModel::ToggleIgnore().

01166 {
01167     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01168     m_ignore->ToggleIgnore();
01169
01170     ResetView(true);
01171     return 0;
01172 }

int UCvsFolders::OnCmdImport ( void ) [protected]

Definition at line 1190 of file UCvsFolders.cpp.

References CvsCmdImportModule().

01191 {
01192   KoImportHandler handler;
01193     CvsCmdImportModule(handler);
01194     return 0;
01195 }

int UCvsFolders::OnCmdLock ( void ) [protected]

Definition at line 1060 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01061 {
01062     KoLockHandler handler;
01063     return ProcessSelectionCommand(handler);
01064 }

int UCvsFolders::OnCmdLog ( void ) [protected]

Definition at line 1048 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01049 {
01050     KoLogHandler handler;
01051     return ProcessSelectionCommand(handler);
01052 }

int UCvsFolders::OnCmdMacrosSel ( int cmd ) [protected]

Definition at line 1258 of file UCvsFolders.cpp.

References cmdSELMACRO, CStr, UTREE_INFO::data, CTcl_Interp::DoScriptVar(), UCmdTarget::GetWidID(), UTREE_INFO::item, CMacroEntry::path, ResetView(), RetrievePath(), SplitPath(), TclBrowserAppend(), TclBrowserReset(), UEventSendMessage(), CTcl_Interp::Unixfy(), EntnodeData::UnRef(), EntnodePath::UnRef(), and UTREEITEM.

01259 {
01260     CTcl_Interp interp;
01261     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01262     CStr path = entry.path;
01263     CTcl_Interp::Unixfy(path);
01264
01265     UTREEITEM selItem;
01266     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01267
01268     CStr selPath;
01269     RetrievePath(selItem, selPath);
01270     CStr uppath, folder;
01271     SplitPath(selPath, uppath, folder);
01272
01273     UTREE_INFO query;
01274     query.item = selItem;
01275     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
01276     bool deleteData = false;
01277     EntnodeData *data = (EntnodeData *)query.data;
01278     if(data == 0L)
01279     {
01280         deleteData = true;
01281         EntnodePath *apath = new EntnodePath(uppath);
01282         data = new EntnodeFolder(folder, apath);
01283         apath->UnRef();
01284     }
01285
01286     TclBrowserReset();
01287     TclBrowserAppend(uppath, data);
01288
01289     interp.DoScriptVar("source \"%s\"", (const char *)path);
01290
01291     if(deleteData)
01292         data->UnRef();
01293
01294     ResetView(true, true);
01295
01296     return 0;
01297 }

int UCvsFolders::OnCmdQueryUpdate ( void ) [protected]

Definition at line 1036 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01037 {
01038     KoQueryUpdateHandler handler;
01039     return ProcessSelectionCommand(handler);
01040 }

int UCvsFolders::OnCmdRelease ( void ) [protected]

Definition at line 1108 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01109 {
01110     KoReleaseHandler handler;
01111     return ProcessSelectionCommand(handler);
01112 }

int UCvsFolders::OnCmdReload ( void ) [protected]

Definition at line 1159 of file UCvsFolders.cpp.

References ResetView().

01160 {
01161     ResetView(true);
01162     return 0;
01163 }

int UCvsFolders::OnCmdStatus ( void ) [protected]

Definition at line 1054 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01055 {
01056     KoStatusHandler handler;
01057     return ProcessSelectionCommand(handler);
01058 }

int UCvsFolders::OnCmdTagBranch ( void ) [protected]

Definition at line 1126 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01127 {
01128     KoBranchTagHandler handler;
01129     return ProcessSelectionCommand(handler);
01130 }

int UCvsFolders::OnCmdTagDelete ( void ) [protected]

Definition at line 1120 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01121 {
01122     KoDeleteTagHandler handler;
01123     return ProcessSelectionCommand(handler);
01124 }

int UCvsFolders::OnCmdTagNew ( void ) [protected]

Definition at line 1114 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01115 {
01116     KoCreateTagHandler handler;
01117     return ProcessSelectionCommand(handler);
01118 }

void UCvsFolders::OnCmdUIAdd ( UCmdUI * pCmdUI ) [protected]

Definition at line 1197 of file UCvsFolders.cpp.

References OnUpdateGeneric().

01198 {
01199     OnUpdateGeneric(pCmdUI, false);
01200 }

void UCvsFolders::OnCmdUICheckout ( UCmdUI * pCmdUI ) [protected]

Definition at line 1234 of file UCvsFolders.cpp.

References UCmdUI::Enable(), UCvsApp::gApp, and UCvsApp::IsCvsRunning().

01235 {
01236     UCvsApp *app = UCvsApp::gApp;
01237     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01238 }

void UCvsFolders::OnCmdUIExplore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1202 of file UCvsFolders.cpp.

References DisableGeneric(), UCmdUI::Enable(), UCmdTarget::GetWidID(), UEventSendMessage(), and UTREEITEM.

01203 {
01204     if(DisableGeneric())
01205     {
01206         pCmdUI->Enable(false);
01207         return;
01208     }
01209     UTREEITEM selItem;
01210     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01211     pCmdUI->Enable(selItem != 0L);
01212 }

void UCvsFolders::OnCmdUIIgnore ( UCmdUI * pCmdUI ) [protected]

Definition at line 1220 of file UCvsFolders.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), UCvsApp::gApp, UCvsApp::GetIgnoreModel(), and KoIgnoreModel::IsShowIgnored().

01221 {
01222     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01223     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01224     pCmdUI->Check(m_ignore->IsShowIgnored());
01225 }

void UCvsFolders::OnCmdUIImport ( UCmdUI * pCmdUI ) [protected]

Definition at line 1240 of file UCvsFolders.cpp.

References UCmdUI::Enable(), UCvsApp::gApp, and UCvsApp::IsCvsRunning().

01241 {
01242     UCvsApp *app = UCvsApp::gApp;
01243     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01244 }

void UCvsFolders::OnCmdUIMacrosSel | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 1246 of file UCvsFolders.cpp.

References DisableGeneric(), UCmdUI::Enable(), UCmdTarget::GetWidID(), UEventSendMessage(), and UTREEITEM.

01247 {
01248     if(DisableGeneric())
01249     {
01250         pCmdUI->Enable(false);
01251         return;
01252     }
01253     UTREEITEM selItem;
01254     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01255     pCmdUI->Enable(selItem != 0L && CTcl_Interp::IsAvail());
01256 }

void UCvsFolders::OnCmdUIReload ( UCmdUI * pCmdUI ) [protected]

Definition at line 1214 of file UCvsFolders.cpp.

References UCmdUI::Enable(), UCvsApp::gApp, and UCvsApp::IsCvsRunning().

01215 {
01216     UCvsApp *app = UCvsApp::gApp;
01217     pCmdUI->Enable(!app->IsCvsRunning());
01218 }

void UCvsFolders::OnCmdUIUpdate ( UCmdUI * pCmdUI ) [protected]

Definition at line 1019 of file UCvsFolders.cpp.

References OnUpdateGeneric().

01020 {
01021     OnUpdateGeneric(pCmdUI, true);
01022 }

void UCvsFolders::OnCmdUIViewRecursive ( UCmdUI * pCmdUI ) [protected]

Definition at line 1227 of file UCvsFolders.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), UCvsApp::gApp, UCvsApp::GetRecursionModel(), and KoRecursionModel::IsShowRecursive().

01228 {
01229     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01230     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01231     pCmdUI->Check(m_recursion->IsShowRecursive());
01232 }

int UCvsFolders::OnCmdUnedit ( void ) [protected]

Definition at line 1090 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01091 {
01092     KoUneditHandler handler;
01093     return ProcessSelectionCommand(handler);
01094 }

int UCvsFolders::OnCmdUnlock ( void ) [protected]

Definition at line 1066 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01067 {
01068     KoUnlockHandler handler;
01069     return ProcessSelectionCommand(handler);
01070 }

int UCvsFolders::OnCmdUpdate ( void ) [protected]

Definition at line 1013 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01014 {
01015   KoUpdateHandler handler;
01016   return ProcessSelectionCommand(handler);
01017 }

int UCvsFolders::OnCmdWatchers ( void ) [protected]

Definition at line 1096 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01097 {
01098     KoWatchersHandler handler;
01099     return ProcessSelectionCommand(handler);
01100 }

int UCvsFolders::OnCmdWatchOff ( void ) [protected]

Definition at line 1078 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01079 {
01080     KoWatchOffHandler handler;
01081     return ProcessSelectionCommand(handler);
01082 }

int UCvsFolders::OnCmdWatchOn ( void ) [protected]

Definition at line 1072 of file UCvsFolders.cpp.

References ProcessSelectionCommand().

01073 {
01074     KoWatchOnHandler handler;
01075     return ProcessSelectionCommand(handler);
01076 }

void UCvsFolders::OnCreate ( ) [protected]

Definition at line 487 of file UCvsFolders.cpp.

References NotificationManager::CheckIn(), UStr::empty(), UCvsApp::gApp, UCvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), gOldLoc, ResetBrowser(), sFolderIcon, sFolderIgnoredIcon, sFolderMissingIcon, sFolderUnknownIcon, and UCreate_pixmap().

00488 {
00489     if(sFolderIcon == 0L)
00490     {
00491         sFolderIcon = UCreate_pixmap(this, "folder.xpm");
00492         sFolderUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00493         sFolderIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00494         sFolderMissingIcon = UCreate_pixmap(this, "foldmiss.xpm");
00495     }
00496
00497     UStr newpath;
00498     newpath = (const char *)gOldLoc;
00499     if(newpath.empty())
00500         newpath = gCvsPrefs.Home();
00501
00502     // set the initial root
00503     ResetBrowser(newpath, true);
00504
00505     if( UCvsApp* app = UCvsApp::gApp )
00506         app->GetIgnoreModel()->GetNotificationManager()->CheckIn((CObject*)this, onIgnoreChanged);
00507 }

void UCvsFolders::OnDestroy ( ) [protected]

Definition at line 474 of file UCvsFolders.cpp.

References NotificationManager::CheckOut(), UCvsApp::gApp, UCvsApp::GetIgnoreModel(), and KiIgnoreModel::GetNotificationManager().

00475 {
00476     if( UCvsApp* app = UCvsApp::gApp )
00477         app->GetIgnoreModel()->GetNotificationManager()->CheckOut((CObject*)this);
00478
00479     delete this;
00480 }

void UCvsFolders::OnTreeExpanding | ( | int | collapse,
 |  | UTREEITEM | item
 | ) | [protected]

Definition at line 794 of file UCvsFolders.cpp.

References UTREE_INSERT::data, UTREE_INFO::data, DeleteAllItems(), ENT_SUBDIR, Entries_SetMissing(), FileTraverse(), CSortList< T >::Get(), GetIcon(), EntnodeData::GetType(), UCmdTarget::GetWidID(), UTREE_INSERT::icon, USemaphore::IsEnteredTwice(), EntnodeData::IsMissing(), UTREE_INFO::item, EntnodeData::kName, CSortList< T >::NumOfElements(), UTREE_INSERT::parent, EntnodeData::Ref(), RetrievePath(), UTREE_INSERT::title, UEventSendMessage(), and UMAKEINT.

00795 {
00796     // many situations make that we enter here twice. Fortunately enough
00797     // we only dare the first signal.
00798     static bool sSemaphore = false;
00799     USemaphore policeman(sSemaphore);
00800     if(policeman.IsEnteredTwice())
00801         return;
00802
00803     UWaitCursor wait;
00804
00805     UTREE_INFO query;
00806     query.item = item;
00807     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00808     EntnodeData *data = (EntnodeData *)query.data;
00809
00810     // we refuse to expand in this case cause the folder is not really here
00811     if(data != 0L && data->IsMissing())
00812     {
00813         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 1), item);
00814         return;
00815     }
00816
00817     // erase all the childs
00818     DeleteAllItems(item);
00819
00820     UStr path;
00821     RetrievePath(item, path);
00822
00823     if(collapse)
00824     {
00825         TBrowserFillDummy traverse(this, 0L, item, 0L);
00826         /*kTraversal res = */FileTraverse(path, traverse);
00827     }
00828     else
00829     {
00830         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00831         TBrowserFill traverse(this, 0L, item, entries);
00832         /*kTraversal res = */FileTraverse(path, traverse);
00833
00834 #if qGTK
00835         // gtk is closing the tree when we removed everything in it
00836         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00837 #endif
00838
00839         // add the missing folders
00840         Entries_SetMissing(entries);
00841         int numEntries = entries.NumOfElements();
00842         for(int i = 0; i < numEntries; i++)
00843         {
00844             const ENTNODE & theNode = entries.Get(i);
00845             EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00846             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00847                 continue;
00848
00849             UTREE_INSERT insert;
00850             insert.parent = item;
00851             insert.icon = GetIcon(this, item, false, false, data->Ref());
00852             insert.title = (*data)[EntnodeData::kName];
00853             insert.data = data;
00854             UEventSendMessage(GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00855         }
00856     }
00857 }

void UCvsFolders::OnTreeSelecting | ( | int | deselect,
 |  | UTREEITEM | item
 | ) | [protected]

Definition at line 859 of file UCvsFolders.cpp.

References ASSERT, UTREE_INFO::data, UCmdTarget::GetWidID(), UObject::IsKindOf(), EntnodeData::IsMissing(), UTREE_INFO::item, UCvsFiles::ResetView(), RetrievePath(), sTemporaryTurnOffNotify, UEventQueryWidget(), UEventSendMessage(), and URUNTIME_CLASS.

00860 {
00861     if(deselect)
00862         return;
00863
00864     UTREE_INFO query;
00865     query.item = item;
00866     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00867     EntnodeData *data = (EntnodeData *)query.data;
00868     if(data != 0L && data->IsMissing())
00869         return;
00870
00871     if(!sTemporaryTurnOffNotify)
00872     {
00873         UStr path;
00874         RetrievePath(item, path);
00875         UCvsFiles *fileView = (UCvsFiles *)UEventQueryWidget(kUCvsFilesID);
00876         if(fileView != 0L)
00877         {
00878             ASSERT(fileView->IsKindOf(URUNTIME_CLASS(UCvsFiles)));
00879             fileView->ResetView(path);
00880         }
00881     }
00882
00883 }

void UCvsFolders::OnUpdateGeneric | ( | UCmdUI * | pCmdUI,
 |  | bool | needCvsInfos
 | ) | [protected]

Definition at line 982 of file UCvsFolders.cpp.

References DisableGeneric(), UCmdUI::Enable(), UStr::endsWith(), UCmdTarget::GetWidID(), RetrievePath(), stat, UEventSendMessage(), and UTREEITEM.

Referenced by OnCmdUIAdd(), and OnCmdUIUpdate().

00983 {
00984     if(DisableGeneric())
00985     {
00986         pCmdUI->Enable(false);
00987         return;
00988     }
00989
00990     UTREEITEM *item;
00991     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00992     if(item == 0L)
00993     {
00994         pCmdUI->Enable(false);
00995         return;
00996     }
00997
00998     UStr path;
00999     RetrievePath(item, path);
01000     if(!path.endsWith(kPathDelimiter))
01001         path << kPathDelimiter;
01002     path << "CVS";
01003
01004     struct stat sb;
01005     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
01006         pCmdUI->Enable(!needCvsInfos);
01007     else
01008         pCmdUI->Enable(needCvsInfos);
01009 }

int UCvsFolders::OnViewRecursive ( void ) [protected]

Definition at line 1174 of file UCvsFolders.cpp.

References UCvsApp::gApp, UCvsApp::GetRecursionModel(), ResetView(), and KoRecursionModel::ToggleRecursion().

01175 {
01176     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01177     m_recursion->ToggleRecursion();
01178
01179     ResetView(true, true);
01180     return 0;
01181 }

int UCvsFolders::ProcessSelectionCommand ( KiSelectionHandler & handler ) [protected]

Definition at line 454 of file UCvsFolders.cpp.

References ASSERT, UCmdTarget::GetWidID(), KiSelectionHandler::OnFolder(), RetrievePath(), UEventSendMessage(), and UTREEITEM.

Referenced by OnCmdAdd(), OnCmdCommit(), OnCmdDiff(), OnCmdEdit(), OnCmdEditors(), OnCmdLock(), OnCmdLog(), OnCmdQueryUpdate(), OnCmdRelease(), OnCmdStatus(), OnCmdTagBranch(), OnCmdTagDelete(), OnCmdTagNew(), OnCmdUnedit(), OnCmdUnlock(), OnCmdUpdate(), OnCmdWatchers(), OnCmdWatchOff(), and OnCmdWatchOn().

00455 {
00456   bool res = false;
00457   UTREEITEM *selItem;
00458
00459     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00460
00461   if( selItem ) {
00462     UStr path;
00463     RetrievePath(selItem, path);
00464
00465     handler.OnFolder(path);
00466     res = true;
00467   } else {
00468     ASSERT(selItem != 0L);
00469   }
00470
00471   return res;
00472 }

void UCvsFolders::ResetBrowser | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 509 of file UCvsFolders.cpp.

References AskCreatePersistentSettings(), CStr, DeleteAllItems(), UStr::empty(), UStr::endsWith(), FileTraverse(), UCvsApp::gApp, UCvsApp::GetFilesView(), TMString< UStr >::GetList(), UCmdTarget::GetWidID(), gHistoryLocs, gOldLoc, HasPersistentSettings(), TMString< UStr >::Insert(), LoadPersistentSettings(), TBrowserFillDummy::m_item, m_root, UCvsFiles::ResetView(), stat, UEventSendMessage(), and UMAKEINT.

Referenced by UCvsFrame::OnBrowserPopup(), UCvsFrame::OnComboSelDir(), OnCreate(), and ResetView().

00510 {
00511     UWaitCursor wait;
00512
00513     // Must make a copy of 'path' before calling DeleteAllItems(), since
00514     // this function may have been called with 'm_root' passed as the first
00515     // parameter (in fact it is in several places in the code) whose value
00516     // gets deleted by the call to DeleteAllItems() below, making 'path'
00517     // point to an invalid memory location
00518     CStr pathCopy(path);
00519     DeleteAllItems();
00520     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00521
00522     m_root = pathCopy;
00523
00524     if( pathCopy.empty() )
00525         return;
00526
00527     if(!isReload)
00528     {
00529         if(HasPersistentSettings(m_root))
00530             LoadPersistentSettings(m_root);
00531         else
00532         {
00533             // check if the path has a CVS folder. If not,
00534             // we don't want the user to be prompted (like when
00535             // WinCvs is starting for the first time).
00536             UStr cvsFolder(m_root);
00537             if(!cvsFolder.endsWith(kPathDelimiter))
00538                 cvsFolder << kPathDelimiter;
00539             cvsFolder << "CVS";
00540             struct stat sb;
00541             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00542                 AskCreatePersistentSettings(m_root);
00543         }
00544     }
00545
00546     if(stricmp(gOldLoc, m_root) != 0)
00547         gOldLoc = m_root;
00548
00549     // update the history combo
00550     gHistoryLocs.Insert(m_root);
00551     UEventSendMessage(kUCvsFrameID, EV_COMBO_RESETALL, UCvsFrame::kDirCombo, 0L);
00552     const std::vector<UStr> & list = gHistoryLocs.GetList();
00553     std::vector<UStr>::const_iterator i;
00554     int pos = 0;
00555     for(i = list.begin(); i != list.end(); ++i, pos++)
00556     {
00557         UEventSendMessage(kUCvsFrameID, EV_COMBO_APPEND,
00558                           UCvsFrame::kDirCombo, (void *)(const char *)*i);
00559     }
00560     UEventSendMessage(kUCvsFrameID, EV_COMBO_SETSEL, UMAKEINT(UCvsFrame::kDirCombo, 0), 0L);
00561
00562     // fill the browser
00563     TBrowserFillDummy traverse(this, 0L, 0L, 0L);
00564     /*kTraversal res = */FileTraverse(m_root, traverse);
00565
00566     if(traverse.m_item != 0L)
00567     {
00568         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), traverse.m_item);
00569         if(notifyView && UCvsApp::gApp->GetFilesView())
00570             UCvsApp::gApp->GetFilesView()->ResetView(path);
00571     }
00572 }

void UCvsFolders::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyView = false
 | ) |

Definition at line 574 of file UCvsFolders.cpp.

References UStr::empty(), UCvsApp::gApp, UCvsApp::GetFilesView(), GetItemByLocation(), UCmdTarget::GetWidID(), ResetBrowser(), UCvsFiles::ResetView(), RetrievePath(), StepToLocation(), StoreExpanded(), UEventSendMessage(), UMAKEINT, and UTREEITEM.

Referenced by OnCmdIgnore(), OnCmdMacrosSel(), OnCmdReload(), OnViewRecursive(), and UCvsFiles::ResetView().

00575 {
00576     UWaitCursor doWait;
00577
00578     std::vector<UStr> allExpanded;
00579     StoreExpanded(allExpanded);
00580
00581     bool contentChanged = false;
00582     UStr selPath;
00583     UTREEITEM selItem;
00584     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00585     if(selItem != 0L)
00586         RetrievePath(selItem, selPath);
00587
00588     if(forceReload)
00589     {
00590         ResetBrowser(m_root);
00591         contentChanged = true;
00592     }
00593
00594     if(contentChanged)
00595     {
00596         // restore the expanded paths and the selected item
00597         std::vector<UStr>::const_iterator i;
00598         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
00599         {
00600             StepToLocation(*i);
00601         }
00602         if(!selPath.empty())
00603         {
00604             selItem = GetItemByLocation(selPath);
00605             if(selItem != 0L)
00606                 UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), selItem);
00607         }
00608     }
00609
00610     // we don't need to notify the file view if we force the reload
00611     // because that's already done
00612     if(notifyView)
00613     {
00614         UCvsApp::gApp->GetFilesView()->ResetView(forceReload);
00615     }
00616     UEventSendMessage(GetWidID(), EV_CHGFOCUS, kUMainWidget, 0L);
00617 }

void UCvsFolders::RetrievePath | ( | UTREEITEM | item,
 |  | UStr & | path
 | ) |

Definition at line 898 of file UCvsFolders.cpp.

References UStr::endsWith(), UCmdTarget::GetWidID(), UTREE_INFO::item, m_root, UTREE_INFO::parent, UTREE_INFO::title, and UEventSendMessage().

Referenced by OnCmdExplore(), OnCmdMacrosSel(), OnTreeExpanding(), OnTreeSelecting(), OnUpdateGeneric(), ProcessSelectionCommand(), ResetView(), and StoreExpanded().

00899 {
00900     UStr tmp, newPath;
00901     path = "";
00902
00903     do
00904     {
00905         UTREE_INFO query;
00906         query.item = item;
00907         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00908
00909         item = query.parent;
00910
00911         tmp = path;
00912         newPath = item == 0L ? (const char *)m_root : query.title;
00913         if(!newPath.endsWith(kPathDelimiter))
00914             newPath << kPathDelimiter;
00915         newPath << path;
00916         path = newPath;
00917     } while(item != 0L);
00918 }

const URuntimeClass * UCvsFolders::rtUCvsFolders ( void ) [static]

Definition at line 79 of file UCvsFolders.cpp.

void UCvsFolders::SetDefaultRoot ( const char * root ) [static]

Definition at line 885 of file UCvsFolders.cpp.

References _i18n, cvs_err(), gOldLoc, and stat.

Referenced by UCvsApp::UCvsApp().

00886 {
00887     struct stat sb;
00888
00889     if (stat(root, &sb) == -1 || !S_ISDIR(sb.st_mode))
00890     {
00891         cvs_err(_i18n("Cannot access directory '%s' (error %d)\n"), root, errno);
00892         return;
00893     }
00894
00895     gOldLoc = root;
00896 }

void UCvsFolders::StepToLocation | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Definition at line 647 of file UCvsFolders.cpp.

References UTREE_INFO::child, UTREE_INFO::data, UStr::endsWith(), UCmdTarget::GetWidID(), UTREE_INFO::item, UStr::length(), UTREE_INFO::next, UStr::set(), UEventSendMessage(), UMAKEINT, and UTREEITEM.

Referenced by ResetView(), and UCvsFiles::ResetView().

00648 {
00649     UStr root(m_root);
00650     if(!root.endsWith(kPathDelimiter))
00651         root << kPathDelimiter;
00652     UStr subpath(path);
00653     if(!subpath.endsWith(kPathDelimiter))
00654         subpath << kPathDelimiter;
00655
00656     // check if it is a sub-path
00657     if(strncmp(root, subpath, root.length()) != 0)
00658         return;
00659
00660     UTREE_INFO query;
00661     query.item = 0L;
00662     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00663
00664     UTREEITEM item = query.item;
00665     UTREEITEM lastitem = 0L;
00666     if(item == 0L)
00667         return;
00668
00669     // step inside synchronized
00670     const char *tmp = (const char *)subpath + root.length() - 1;
00671     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00672     {
00673         const char *name = ++tmp;
00674         if(name[0] == '\0')
00675             break;
00676
00677         UStr subname;
00678         const char *tmp2 = strchr(name, kPathDelimiter);
00679         if(tmp2 == 0L)
00680             subname = name;
00681         else
00682             subname.set(name, tmp2 - name);
00683
00684         query.item = item;
00685         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00686         UTREEITEM childItem = query.child;
00687
00688         // find the subitem which matches this name
00689         while(childItem != 0L)
00690         {
00691             query.item = childItem;
00692             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00693             EntnodeData *data = (EntnodeData *)query.data;
00694             if(data != 0L)
00695             {
00696 #ifdef qUnix
00697                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00698 #else
00699                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00700 #endif
00701                 {
00702                     // found it !
00703                     lastitem = item = childItem;
00704                     UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00705                     break;
00706                 }
00707             }
00708
00709             childItem = query.next;
00710         }
00711     }
00712
00713     // in case this is called by the view, turn off notifying
00714     // when the item gets selected
00715     if(lastitem != 0L)
00716     {
00717         if(!notifyView)
00718         {
00719             CTempToggleBool toggler(sTemporaryTurnOffNotify);
00720             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00721         }
00722         else
00723         {
00724             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00725         }
00726     }
00727 }

void UCvsFolders::StoreExpanded | ( | std::vector< UStr > & | allExpanded,
 |  | UTREEITEM | root = 0L
 | ) | [protected]

Definition at line 619 of file UCvsFolders.cpp.

References UTREE_INFO::child, UTREE_INFO::expanded, UCmdTarget::GetWidID(), UTREE_INFO::item, UTREE_INFO::next, RetrievePath(), UEventSendMessage(), and UTREEITEM.

Referenced by ResetView().

00620 {
00621     UTREE_INFO query;
00622     query.item = root;
00623     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00624
00625     UTREEITEM item = query.item;
00626     if(item == 0L)
00627         return;
00628
00629     if(query.expanded)
00630     {
00631         UStr path;
00632         RetrievePath(item, path);
00633         allExpanded.push_back(path);
00634     }
00635
00636     UTREEITEM childItem = query.child;
00637
00638     while(childItem != 0L)
00639     {
00640         StoreExpanded(allExpanded, childItem);
00641         query.item = childItem;
00642         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00643         childItem = query.next;
00644     }
00645 }

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 70 of file UCvsFolders.h.

Referenced by GetRoot(), ResetBrowser(), and RetrievePath().

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 Fri Jan 31 12:15:33 2003 for WinCvs Source by doxygen 1.3-rc2


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)
KiFilterModel * | GetFilterModel (void)
KiRecursionModel * | GetRecursionModel (void)
KiIgnoreModel * | GetIgnoreModel (void)
void | OnFilterMaskEntered (void)
bool | FreshenFileMask (void)

Static Public Methods

const URuntimeClass * | rtUCvsFrame (void)

Protected Methods

void | OnCmdUIAnytime (int cmd, UCmdUI *pCmdUI)
void | OnCmdUIViewRecursive (UCmdUI *pCmdUI)
void | OnCmdUIViewIgnored (UCmdUI *pCmdUI)
void | OnCmdUIFilterMask (UCmdUI *pCmdUI)
void | OnCmdUIViewAdded (UCmdUI *pCmdUI)
void | OnCmdUIViewModified (UCmdUI *pCmdUI)
void | OnCmdUIViewConflict (UCmdUI *pCmdUI)
void | OnCmdUIViewUnknown (UCmdUI *pCmdUI)
void | OnCmdUIViewMissing (UCmdUI *pCmdUI)
void | OnCmdUIViewRemoved (UCmdUI *pCmdUI)
void | OnCmdUIViewChanged (UCmdUI *pCmdUI)
void | OnCmdUIHideUnknown (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)
int | OnAbout (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)
void | OnViewIgnored (void)
void | OnViewRecursive (void)
void | OnViewAdded (void)
void | OnViewModified (void)
void | OnViewConflict (void)
void | OnViewUnknown (void)
void | OnViewMissing (void)
void | OnViewRemoved (void)
void | OnViewChanged (void)
void | OnHideUnknown (void)
virtual const UMSGMAP * | GetMessageMap () const

Static Protected Methods

const URuntimeClass * | _GetBaseClass ()
const UMSGMAP * | GetBaseMessageMap ()
const UMSGMAP * | GetThisMessageMap ()

Protected Attributes

KoFilterModel m_filter
KoRecursionModel m_recursion
KoIgnoreModel m_ignore

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 42 of file UCvsFrame.h.

00043     {
00044         kDirCombo = EV_COMMAND_START,   // 0
00045         kBrowserPopup                   // 1
00046     };

Constructor & Destructor Documentation

UCvsFrame::UCvsFrame ( )

Definition at line 118 of file UCvsFrame.cpp.

References kUCvsFrameID.

00118                      : UWidget(kUCvsFrameID)
00119 {
00120 }

UCvsFrame::~UCvsFrame ( ) [virtual]

Definition at line 122 of file UCvsFrame.cpp.

00123 {
00124 }

Member Function Documentation

const URuntimeClass * UCvsFrame::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

bool UCvsFrame::AskForQuitting ( void )

Definition at line 134 of file UCvsFrame.cpp.

References _i18n, CvsAlert(), UCvsApp::gApp, and UCvsApp::IsCvsRunning().

Referenced by OnQuit().

00135 {
00136     bool res = true;
00137
00138     if(UCvsApp::gApp->IsCvsRunning())
00139         res = !CvsAlert(_i18n("Cvs is currently running. Are-you sure you want to quit ?"), _i18n("Cancel"), _i18n("Quit"));
00140
00141     gCvsPrefs.save();
00142
00143     return res;
00144 }

bool UCvsFrame::FreshenFileMask ( void )

Definition at line 379 of file UCvsFrame.cpp.

Referenced by OnFilterMaskEntered(), OnHideUnknown(), OnViewAdded(), OnViewChanged(), OnViewConflict(), OnViewMissing(), OnViewModified(), OnViewRemoved(), and OnViewUnknown().

00380 {
00381     //CString strFileMask;
00382     //m_comboFilterMask.GetWindowText(strFileMask);
00383     return /*false;*/true;
00384     //return m_filter.SetMask(strFileMask);
00385 }

const UMSGMAP * UCvsFrame::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 49 of file UCvsFrame.cpp.

KiFilterModel* UCvsFrame::GetFilterModel ( void ) [inline]

Definition at line 56 of file UCvsFrame.h.

Referenced by UCvsApp::GetFilterModel().

00057     {
00058         return &m_filter;
00059     }

KiIgnoreModel* UCvsFrame::GetIgnoreModel ( void ) [inline]

Definition at line 68 of file UCvsFrame.h.

Referenced by UCvsApp::GetIgnoreModel().

00069     {
00070         return &m_ignore;
00071     }

const UMSGMAP * UCvsFrame::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 49 of file UCvsFrame.cpp.

KiRecursionModel* UCvsFrame::GetRecursionModel ( void ) [inline]

Definition at line 62 of file UCvsFrame.h.

Referenced by UCvsApp::GetRecursionModel().

00063     {
00064         return &m_recursion;
00065     }

const URuntimeClass * UCvsFrame::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 47 of file UCvsFrame.cpp.

const UMSGMAP * UCvsFrame::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 49 of file UCvsFrame.cpp.

int UCvsFrame::OnAbout ( void ) [protected]

Definition at line 184 of file UCvsFrame.cpp.

References AboutDialog().

00185 {
00186     AboutDialog();
00187     return 0;
00188 }

int UCvsFrame::OnBrowserPopup ( void ) [protected]

Definition at line 151 of file UCvsFrame.cpp.

References _i18n, BrowserGetDirectory(), CStr, UCvsApp::gApp, UCvsApp::GetBrowserView(), and UCvsFolders::ResetBrowser().

00152 {
00153     CStr newPath;
00154     if( BrowserGetDirectory(_i18n("Select a folder to open with the browser"), newPath) )
00155     {
00156         UCvsApp::gApp->GetBrowserView()->ResetBrowser(newPath, true);
00157     }
00158
00159     return 0;
00160 }

int UCvsFrame::OnCmdCmdline ( void ) [protected]

Definition at line 295 of file UCvsFrame.cpp.

References CvsCmdCommandLine().

00296 {
00297   KoCommandLineHandler handler;
00298     CvsCmdCommandLine(handler);
00299     return 0;
00300 }

int UCvsFrame::OnCmdInit ( void ) [protected]

Definition at line 326 of file UCvsFrame.cpp.

References CvsCmdInit().

00327 {
00328     CvsCmdInit();
00329     return 0;
00330 }

int UCvsFrame::OnCmdLogin ( void ) [protected]

Definition at line 302 of file UCvsFrame.cpp.

References CvsCmdLogin().

00303 {
00304     CvsCmdLogin();
00305     return 0;
00306 }

int UCvsFrame::OnCmdLogout ( void ) [protected]

Definition at line 308 of file UCvsFrame.cpp.

References CvsCmdLogout().

00309 {
00310     CvsCmdLogout();
00311     return 0;
00312 }

int UCvsFrame::OnCmdMacroAdmin ( int cmd ) [protected]

Definition at line 332 of file UCvsFrame.cpp.

References cmdMACROADMIN, CvsCmdMacrosAdmin(), and CMacroEntry::path.

00333 {
00334     CMacroEntry & entry = gMacrosAdmin.entries[cmd - cmdMACROADMIN];
00335     CvsCmdMacrosAdmin(entry.path);
00336     return 0;
00337 }

int UCvsFrame::OnCmdPreferences ( void ) [protected]

Definition at line 259 of file UCvsFrame.cpp.

00260 {
00261     CompatGetPrefs();
00262     return 0;
00263 }

int UCvsFrame::OnCmdRtagBranch ( void ) [protected]

Definition at line 288 of file UCvsFrame.cpp.

References CvsCmdRtagBranch().

00289 {
00290   KoRtagBranchHandler handler;
00291     CvsCmdRtagBranch(handler);
00292     return 0;
00293 }

int UCvsFrame::OnCmdRtagDelete ( void ) [protected]

Definition at line 281 of file UCvsFrame.cpp.

References CvsCmdRtagDelete().

00282 {
00283   KoRtagDeleteHandler handler;
00284     CvsCmdRtagDelete(handler);
00285     return 0;
00286 }

int UCvsFrame::OnCmdRtagNew ( void ) [protected]

Definition at line 273 of file UCvsFrame.cpp.

References CvsCmdRtagCreate().

00274 {
00275   KoRtagCreateHandler handler;
00276     CvsCmdRtagCreate(handler);
00277
00278     return 0;
00279 }

int UCvsFrame::OnCmdSaveSettings ( void ) [protected]

Definition at line 265 of file UCvsFrame.cpp.

00266 {
00267     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00268     if(browser != 0L && browser->GetRoot() != 0L)
00269         AskCreatePersistentSettings(browser->GetRoot());
00270     return 0;
00271 }

int UCvsFrame::OnCmdStopcvs ( void ) [protected]

Definition at line 314 of file UCvsFrame.cpp.

References _i18n, cvs_out(), cvs_process_is_active(), cvs_process_stop(), UCvsApp::gApp, UCvsApp::GetCvsProcess(), and UCvsApp::SetCvsStopping().

00315 {
00316     UCvsApp::gApp->SetCvsStopping(true);
00317     if(UCvsApp::gApp->GetCvsProcess() != 0L && cvs_process_is_active(UCvsApp::gApp->GetCvsProcess()))
00318     {
00319         cvs_process_stop(UCvsApp::gApp->GetCvsProcess());
00320         cvs_out(_i18n("***** CVS stopped on user request !!! *****\n\n"));
00321     }
00322
00323     return 0;
00324 }

void UCvsFrame::OnCmdUIAnytime | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 179 of file UCvsFrame.cpp.

References UCmdUI::Enable().

00180 {
00181     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00182 }

void UCvsFrame::OnCmdUICvsCmd ( UCmdUI * pCmdUI ) [protected]

Definition at line 344 of file UCvsFrame.cpp.

References UCmdUI::Enable(), and IsAppEnabled().

00345 {
00346     pCmdUI->Enable(IsAppEnabled());
00347 }

void UCvsFrame::OnCmdUIFilterMask ( UCmdUI * pCmdUI ) [protected]

Definition at line 367 of file UCvsFrame.cpp.

References UCmdUI::Enable(), and IsAppEnabled().

00368 {
00369     pCmdUI->Enable(IsAppEnabled());
00370 }

void UCvsFrame::OnCmdUIHideUnknown ( UCmdUI * pCmdUI ) [protected]

Definition at line 493 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsDefaultMode(), KoFilterModel::IsHideUnknown(), and m_filter.

00494 {
00495     pCmdUI->Enable(IsAppEnabled() && m_filter.IsDefaultMode());
00496     pCmdUI->Check(m_filter.IsHideUnknown());
00497 }

void UCvsFrame::OnCmdUIMacroAdmin | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

Definition at line 349 of file UCvsFrame.cpp.

References UCmdUI::Enable(), and IsAppEnabled().

00350 {
00351     pCmdUI->Enable(IsAppEnabled() && CTcl_Interp::IsAvail());
00352 }

void UCvsFrame::OnCmdUIQuit ( UCmdUI * pCmdUI ) [protected]

Definition at line 174 of file UCvsFrame.cpp.

References UCmdUI::Enable().

00175 {
00176     pCmdUI->Enable(true);
00177 }

void UCvsFrame::OnCmdUIStopcvs ( UCmdUI * pCmdUI ) [protected]

Definition at line 339 of file UCvsFrame.cpp.

References UCmdUI::Enable(), and IsAppEnabled().

00340 {
00341     pCmdUI->Enable(IsAppEnabled());
00342 }

void UCvsFrame::OnCmdUIViewAdded ( UCmdUI * pCmdUI ) [protected]

Definition at line 454 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), KoFilterModel::IsAdded(), IsAppEnabled(), and m_filter.

00455 {
00456     pCmdUI->Enable(IsAppEnabled());
00457     pCmdUI->Check(m_filter.IsAdded());
00458 }

void UCvsFrame::OnCmdUIViewChanged ( UCmdUI * pCmdUI ) [protected]

Definition at line 480 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsChanged(), and m_filter.

00481 {
00482     pCmdUI->Enable(IsAppEnabled());
00483     pCmdUI->Check(m_filter.IsChanged());
00484 }

void UCvsFrame::OnCmdUIViewConflict ( UCmdUI * pCmdUI ) [protected]

Definition at line 415 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsConflict(), and m_filter.

00416 {
00417     pCmdUI->Enable(IsAppEnabled());
00418     pCmdUI->Check(m_filter.IsConflict());
00419 }

void UCvsFrame::OnCmdUIViewIgnored ( UCmdUI * pCmdUI ) [protected]

Definition at line 361 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoIgnoreModel::IsShowIgnored(), and m_ignore.

00362 {
00363     pCmdUI->Enable(IsAppEnabled());
00364     pCmdUI->Check(m_ignore.IsShowIgnored());
00365 }

void UCvsFrame::OnCmdUIViewMissing ( UCmdUI * pCmdUI ) [protected]

Definition at line 441 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsMissing(), and m_filter.

00442 {
00443     pCmdUI->Enable(IsAppEnabled());
00444     pCmdUI->Check(m_filter.IsMissing());
00445 }

void UCvsFrame::OnCmdUIViewModified ( UCmdUI * pCmdUI ) [protected]

Definition at line 394 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsModified(), and m_filter.

00395 {
00396     pCmdUI->Enable(IsAppEnabled());
00397     pCmdUI->Check(m_filter.IsModified());
00398 }

void UCvsFrame::OnCmdUIViewRecursive ( UCmdUI * pCmdUI ) [protected]

Definition at line 372 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), UCvsApp::gApp, UCvsApp::GetRecursionModel(), KoRecursionModel::IsShowRecursive(), and m_recursion.

00373 {
00374     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
00375     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00376     pCmdUI->Check(m_recursion->IsShowRecursive());
00377 }

void UCvsFrame::OnCmdUIViewRemoved ( UCmdUI * pCmdUI ) [protected]

Definition at line 460 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsRemoved(), and m_filter.

00461 {
00462     pCmdUI->Enable(IsAppEnabled());
00463     pCmdUI->Check(m_filter.IsRemoved());
00464 }

void UCvsFrame::OnCmdUIViewUnknown ( UCmdUI * pCmdUI ) [protected]

Definition at line 428 of file UCvsFrame.cpp.

References UCmdUI::Check(), UCmdUI::Enable(), IsAppEnabled(), KoFilterModel::IsUnknown(), and m_filter.

00429 {
00430     pCmdUI->Enable(IsAppEnabled());
00431     pCmdUI->Check(m_filter.IsUnknown());
00432 }

void UCvsFrame::OnComboSelDir | ( | int | pos,
 |  | const char * | txt
 | ) | [protected]

Definition at line 146 of file UCvsFrame.cpp.

References UCvsApp::gApp, UCvsApp::GetBrowserView(), and UCvsFolders::ResetBrowser().

00147 {
00148     UCvsApp::gApp->GetBrowserView()->ResetBrowser(txt, true);
00149 }

int UCvsFrame::OnCopyrights ( void ) [protected]

Definition at line 190 of file UCvsFrame.cpp.

References _i18n, cvs_out(), UCvsApp::gApp, and UCvsApp::GetAppName().

00191 {
00192     const char *appName = UCvsApp::gApp->GetAppName();
00193
00194     cvs_out(_i18n("\nBoth %s and CVS are distributed under the terms of\n"
00195               "the GNU General Public Licence (GPL).\n\n"), appName);
00196     cvs_out(_i18n("* %s : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n"), appName);
00197     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00198     cvs_out(_i18n("        Jeff Polk, and other authors\n"));
00199 #ifdef macintosh
00200     printf("* MacCVS : Mike Ladwig, Matthias Neeracher, Alexandre Parenteau\n");
00201     printf("* GUSI : Copyright © 1992-1997 Matthias Neeracher\n");
00202     printf("* Waste : Copyright © 1993-1998 Marco Piovanelli\n");
00203     printf("* CWASTEEdit : Copyright © 1995-1997 Timothy Paustian\n");
00204     printf(_i18n("* ABalloon : Freeware of James W. Walker (jwwalker@kagi.com)\n"));
00205     printf("* Metrowerks Standard Library, PowerPlant & CodeWarrior :\n");
00206     printf("    Copyright © 1996-1997 Metrowerks Inc.\n");
00207     printf("* MPW, MoreFiles : Copyright © Apple Computer Inc.\n");
00208 #endif
00209 #ifdef WIN32
00210     cvs_out(_i18n("* WinCvs documentation : Copyright %c 1999 Don Harper <don@lamrc.com>.\n", '@');
00211     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n"));
00212     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00213 #endif
00214     cvs_out("* Kerberos : Copyright © 1997 Massachusetts Institute of Technology\n");
00215     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00216     cvs_out(_i18n("\nSome others copyrights may apply, check the source code for details.\n"));
00217     return 0;
00218 }

int UCvsFrame::OnCredits ( void ) [protected]

Definition at line 220 of file UCvsFrame.cpp.

References _i18n, cvs_out(), UCvsApp::gApp, UCvsApp::GetAppName(), and UCvsApp::GetAppVersion().

00221 {
00222     const char *appName = UCvsApp::gApp->GetAppName();
00223     const char *appVers = UCvsApp::gApp->GetAppVersion();
00224
00225 #ifndef macintosh
00226     cvs_out(_i18n("\n%s %s - Client/Local\n"), appName, appVers);
00227 #else
00228     cvs_out(_i18n("\n%s %s - Client\n"), appName, appVers);
00229 #endif
00230     cvs_out(_i18n("%s is maintained by Alexandre Parenteau\n"), appName);
00231     cvs_out(_i18n("- WinCvs/MacCvs/gcvs page : http://www.wincvs.org or http://cvsgui.sourceforge.net/\n"));
00232     cvs_out(_i18n("- cvs page : http://www.cvshome.org\n"));
00233 #ifdef WIN32
00234     cvs_out(_i18n("- WinCvs documentation : Don Harper <don@lamrc.com>.\n"));
00235     cvs_out(_i18n("- WinHelp cvs documentation : Norbert Klamann.\n"));
00236 #endif
00237 #ifdef macintosh
00238     printf(_i18n("- Mac port :\n"));
00239     printf("\t* Mike Ladwig <mike@twinpeaks.prc.com>\n");
00240     printf("\t* Matthias Neeracher <neeri@iis.ee.ethz.ch>\n");
00241     printf("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00242     printf(_i18n("- With contributions of :\n");
00243     printf("\t* Miro Jurisic <meeroh@mit.edu> (Kerberos)\n");
00244     printf("\t* Aleks Totic <atotic@netscape.com> (AppleSingle)\n");
00245     printf("\t* Jocelyn Houle <houlejo@IRO.UMontreal.CA> (Help balloons)\n");
00246 #endif
00247     cvs_out(_i18n("- Special thanks to :\n"));
00248     cvs_out(_i18n("\t* Gary Bringhurst from C3D Digital who gives me time, resources,\n"
00249               "\t  help and ideas for doing this project (http://www.3d.com)\n"));
00250     cvs_out(_i18n("\t* The Freeware community for providing cvs, Linux, Perl, GTK, gcc\n"
00251               "\t  and so many others valuables tools\n"));
00252     cvs_out(_i18n("\t* The users of the CvsGui project (WinCvs, MacCvs, gcvs) who have\n"
00253               "\t  defined all the functionnalities and help every day to enhance it\n"));
00254     cvs_out(_i18n("- Cvs contributors :\n"));
00255     cvs_out(_i18n("\t* Too many to be listed here, see the 'ChangeLog' instead !\n"));
00256     return 0;
00257 }

void UCvsFrame::OnDestroy ( void ) [protected]

Definition at line 126 of file UCvsFrame.cpp.

00127 {
00128 #if qGTK
00129     gtk_main_quit();
00130 #endif /* qGTK */
00131     delete this;
00132 }

void UCvsFrame::OnFilterMaskEntered ( void )

Definition at line 400 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, and NotificationManager::NotifyAll().

Referenced by OnViewIgnored(), and UCvsFiles::OnViewRecursive().

00401 {
00402     if (FreshenFileMask())
00403     {
00404         m_filter.GetNotificationManager()->NotifyAll();
00405     }
00406 }

void UCvsFrame::OnHideUnknown ( void ) [protected]

Definition at line 486 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleHideUnknown().

00487 {
00488     m_filter.ToggleHideUnknown();
00489     FreshenFileMask();
00490     m_filter.GetNotificationManager()->NotifyAll();
00491 }

int UCvsFrame::OnQuit ( void ) [protected]

Definition at line 162 of file UCvsFrame.cpp.

References AskForQuitting().

00163 {
00164     if(!AskForQuitting())
00165         return 0;
00166
00167 #if qGTK
00168     gtk_main_quit();
00169 #endif /* qGTK */
00170
00171     return 0;
00172 }

void UCvsFrame::OnViewAdded ( void ) [protected]

Definition at line 447 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleAdded().

00448 {
00449     m_filter.ToggleAdded();
00450     FreshenFileMask();
00451     m_filter.GetNotificationManager()->NotifyAll();
00452 }

void UCvsFrame::OnViewChanged ( void ) [protected]

Definition at line 473 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleChanged().

00474 {
00475     m_filter.ToggleChanged();
00476     FreshenFileMask();
00477     m_filter.GetNotificationManager()->NotifyAll();
00478 }

void UCvsFrame::OnViewConflict ( void ) [protected]

Definition at line 408 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleConflict().

00409 {
00410     m_filter.ToggleConflict();
00411     FreshenFileMask();
00412     m_filter.GetNotificationManager()->NotifyAll();
00413 }

void UCvsFrame::OnViewIgnored ( void ) [protected]

Definition at line 354 of file UCvsFrame.cpp.

References KoIgnoreModel::GetNotificationManager(), m_ignore, NotificationManager::NotifyAll(), OnFilterMaskEntered(), and KoIgnoreModel::ToggleIgnore().

00355 {
00356     m_ignore.ToggleIgnore();
00357     m_ignore.GetNotificationManager()->NotifyAll();
00358     OnFilterMaskEntered();
00359 }

void UCvsFrame::OnViewMissing ( void ) [protected]

Definition at line 434 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleMissing().

00435 {
00436     m_filter.ToggleMissing();
00437     FreshenFileMask();
00438     m_filter.GetNotificationManager()->NotifyAll();
00439 }

void UCvsFrame::OnViewModified ( void ) [protected]

Definition at line 387 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleModified().

00388 {
00389     m_filter.ToggleModified();
00390     FreshenFileMask();
00391     m_filter.GetNotificationManager()->NotifyAll();
00392 }

void UCvsFrame::OnViewRecursive ( void ) [protected]

void UCvsFrame::OnViewRemoved ( void ) [protected]

Definition at line 466 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleRemoved().

00467 {
00468     m_filter.ToggleRemoved();
00469     FreshenFileMask();
00470     m_filter.GetNotificationManager()->NotifyAll();
00471 }

void UCvsFrame::OnViewUnknown ( void ) [protected]

Definition at line 421 of file UCvsFrame.cpp.

References FreshenFileMask(), KoFilterModel::GetNotificationManager(), m_filter, NotificationManager::NotifyAll(), and KoFilterModel::ToggleUnknown().

00422 {
00423     m_filter.ToggleUnknown();
00424     FreshenFileMask();
00425     m_filter.GetNotificationManager()->NotifyAll();
00426 }

const URuntimeClass * UCvsFrame::rtUCvsFrame ( void ) [static]

Definition at line 47 of file UCvsFrame.cpp.

Member Data Documentation

const UMSGMAP_ENTRY UCvsFrame::_messageEntries [static, private]

Reimplemented from UWidget.

Definition at line 49 of file UCvsFrame.cpp.

const URuntimeClass UCvsFrame::classUCvsFrame [static, protected]

KoFilterModel UCvsFrame::m_filter [protected]

Definition at line 50 of file UCvsFrame.h.

Referenced by OnCmdUIHideUnknown(), OnCmdUIViewAdded(), OnCmdUIViewChanged(), OnCmdUIViewConflict(), OnCmdUIViewMissing(), OnCmdUIViewModified(), OnCmdUIViewRemoved(), OnCmdUIViewUnknown(), OnFilterMaskEntered(), OnHideUnknown(), OnViewAdded(), OnViewChanged(), OnViewConflict(), OnViewMissing(), OnViewModified(), OnViewRemoved(), and OnViewUnknown().

KoIgnoreModel UCvsFrame::m_ignore [protected]

Definition at line 52 of file UCvsFrame.h.

Referenced by OnCmdUIViewIgnored(), and OnViewIgnored().

KoRecursionModel UCvsFrame::m_recursion [protected]

Definition at line 51 of file UCvsFrame.h.

Referenced by OnCmdUIViewRecursive().

const UMSGMAP UCvsFrame::messageMap = { UWidget ::GetThisMessageMap(), & UCvsFrame ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 49 of file UCvsFrame.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFrame.h
  • common/UCvsFrame.cpp
Generated on Fri Jan 31 12:15:37 2003 for WinCvs Source by doxygen 1.3-rc2


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)
void | OnBtnClick (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 133 of file UCvsGraph.h.

00134     {
00135         kDrawing = EV_COMMAND_START // 0
00136     };

Constructor & Destructor Documentation

UCvsGraph::UCvsGraph | ( | CLogNode * | node,
 |  | const char * | dir
 | ) |

Definition at line 49 of file UCvsGraph.cpp.

References cvs_err(), Entries_Open(), Entries_SetVisited(), m_data, m_name, EntnodeData::Ref(), and stat.

00049                                                     :
00050     UWidget(::UEventGetWidID()), m_node(node), m_dir(dir), m_data(0L)
00051 {
00052     // get the CVS/Entries infos for this file
00053     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00054     if(!Entries_Open (entries, dir))
00055     {
00056         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00057     }
00058     else
00059     {
00060         if(node->GetType() != kNodeHeader)
00061         {
00062             cvs_err("Warning : Top node is not a RCS file description !\n");
00063         }
00064         else
00065         {
00066             const char *name = (**(CLogNodeHeader *)node).WorkingFile();
00067             struct stat sb;
00068             if (stat(name, &sb) == -1)
00069             {
00070                 cvs_err("Warning : Unknown file '%s'\n", name);
00071             }
00072             else
00073             {
00074                 m_data = Entries_SetVisited(dir, entries, name, sb, false);
00075                 m_data->Ref();
00076                 m_name = name;
00077             }
00078         }
00079     }
00080 }

UCvsGraph::~UCvsGraph ( ) [virtual]

Definition at line 82 of file UCvsGraph.cpp.

References m_data, m_node, and EntnodeData::UnRef().

00083 {
00084     if(m_node != 0L)
00085         delete m_node;
00086     if(m_data != 0L)
00087         m_data->UnRef();
00088 }

Member Function Documentation

const URuntimeClass * UCvsGraph::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 39 of file UCvsGraph.cpp.

void UCvsGraph::CalcImageSize ( void ) [protected]

Definition at line 613 of file UCvsGraph.cpp.

References CWinLogData::Bounds(), CWinLogData::ComputeBounds(), CWinLogData::CreateNewData(), UWidget::GetWidget(), UCmdTarget::GetWidID(), URect::Height(), m_node, CWinLogData::Offset(), URect::Size(), URect::TopLeft(), and URect::Width().

Referenced by OnDrawing().

00614 {
00615     if(m_node == 0L)
00616         return;
00617
00618     // set all the bounds locations
00619     UDC dc(GetWidID(), kDrawing);
00620     CWinLogData *data = CWinLogData::CreateNewData(m_node);
00621     m_node->SetUserData(data);
00622     UPoint start(5, 5);
00623     data->ComputeBounds(start, dc, m_data);
00624
00625     // reoffset from (0, 0)
00626     URect bounds = data->Bounds();
00627     data->Offset(start - bounds.TopLeft());
00628     bounds = data->Bounds();
00629
00630 #if qGTK
00631     GtkWidget *layout = (GtkWidget *)GetWidget(kDrawing);
00632     gtk_drawing_area_size(GTK_DRAWING_AREA(layout), bounds.Width()+5, bounds.Height()+5);
00633 #endif
00634 #if 0
00635     // set the scroll size
00636     SetScrollSizes(MM_TEXT, bounds.Size() + USize(5, 5));
00637 #endif
00638 }

const UMSGMAP * UCvsGraph::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 41 of file UCvsGraph.cpp.

const UMSGMAP * UCvsGraph::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 41 of file UCvsGraph.cpp.

const URuntimeClass * UCvsGraph::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 39 of file UCvsGraph.cpp.

const UMSGMAP * UCvsGraph::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 41 of file UCvsGraph.cpp.

void UCvsGraph::OnBtnClick ( void * info ) [protected]

Definition at line 697 of file UCvsGraph.cpp.

References CvsLogOutput(), UCmdTarget::GetWidID(), CWinLogData::HitTest(), m_node, CWinLogData::Selected(), CWinLogData::SetSelected(), UK_LBUTTON, CWinLogData::UnselectAll(), and CWinLogData::Update().

00698 {
00699     GdkEventButton *event = (GdkEventButton *)info;
00700     UPoint point((int)event->x, (int)event->y);
00701     int nFlags = event->state;
00702     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00703     UDC dc(GetWidID(), kDrawing);
00704
00705     //fprintf(stderr,"x: %f, y:%f, x_root: %f, y_root:%f, state:%d, button:%d\n",
00706     //              event->x, event->y, event->x_root, event->y_root, event->state, event->button);
00707
00708     if(event->button & UK_LBUTTON ) {
00709         if((nFlags & GDK_SHIFT_MASK) == 0 && (nFlags & GDK_CONTROL_MASK) == 0)
00710             data->UnselectAll();
00711
00712         CWinLogData *hit = data->HitTest(point);
00713
00714         if(hit != 0L) {
00715             if((nFlags & GDK_SHIFT_MASK) == 0 && (nFlags & GDK_CONTROL_MASK) == 0) {
00716                 if(!hit->Selected()) {
00717                     CColorConsole out;
00718
00719                     hit->SetSelected(true);
00720
00721                     CvsLogOutput(out, hit->Node());
00722                 }
00723             } else {
00724                 hit->SetSelected(!hit->Selected());
00725             }
00726
00727             data->Update(dc, m_data);
00728         }
00729     }
00730 }

void UCvsGraph::OnCreate ( ) [protected]

Definition at line 95 of file UCvsGraph.cpp.

References UCmdTarget::GetWidID(), m_name, and UEventSendMessage().

00096 {
00097     UStr title("Graph log : ");
00098     title << m_name;
00099     UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00100 }

void UCvsGraph::OnDestroy ( ) [protected]

Definition at line 90 of file UCvsGraph.cpp.

00091 {
00092     delete this;
00093 }

void UCvsGraph::OnDrawing ( void * info ) [protected]

Definition at line 640 of file UCvsGraph.cpp.

References CalcImageSize(), UWidget::GetWidget(), UCmdTarget::GetWidID(), m_node, UWidget::OnBlockHandler(), UWidget::OnUnblockHandler(), and CWinLogData::Update().

00641 {
00642 #if qGTK
00643     GdkEventExpose *event = (GdkEventExpose *)info;
00644     GtkDrawingArea *drawing = GTK_DRAWING_AREA(GetWidget(kDrawing));
00645     gdk_window_clear_area (drawing->widget.window,
00646                            event->area.x, event->area.y,
00647                            event->area.width, event->area.height);
00648     //fprintf(stderr,"Area: x: %d, y:%d, width: %d, height:%d\n",
00649     //      event->area.x, event->area.y, event->area.width, event->area.height);
00650 #endif
00651     CalcImageSize();
00652
00653     if(m_node == 0L || m_node->GetUserData() == 0L)
00654         return;
00655
00656     OnBlockHandler(drawing, kDrawing, GDK_EXPOSE);
00657
00658     UDC dc(GetWidID(), kDrawing);
00659     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00660     data->Update(dc, m_data);
00661
00662     while (gtk_events_pending())
00663           gtk_main_iteration();
00664
00665     OnUnblockHandler(drawing, kDrawing, GDK_EXPOSE);
00666
00667     /*  GtkWidget *widget = (GtkWidget *)GetWidget(kDrawing);
00668     if(widget == 0L)
00669         return;
00670
00671     GtkDrawingArea *darea;
00672     GdkDrawable *drawable;
00673     GdkGC *black_gc;
00674     GdkGC *gray_gc;
00675     GdkGC *white_gc;
00676     guint max_width;
00677     guint max_height;
00678
00679     g_return_if_fail (widget != NULL);
00680     g_return_if_fail (GTK_IS_DRAWING_AREA (widget));
00681
00682     darea = GTK_DRAWING_AREA (widget);
00683     drawable = widget->window;
00684     white_gc = widget->style->white_gc;
00685     gray_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
00686     black_gc = widget->style->black_gc;
00687     max_width = widget->allocation.width;
00688     max_height = widget->allocation.height;
00689     gdk_draw_rectangle (drawable, black_gc,
00690                         TRUE,
00691                         0,
00692                         max_height / 2,
00693                         max_width,
00694                         max_height / 2);*/
00695 }

const URuntimeClass * UCvsGraph::rtUCvsGraph ( void ) [static]

Definition at line 39 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_CUSTOM_CLICK, epV_VP, UMSG_RANGE,  UCvsGraph::kDrawing ,  UCvsGraph::kDrawing ,   (UPMSG)(void (UCmdTarget::*)(void *drawInfo))& UCvsGraph::OnBtnClick  },
    { EV_RESIZE, epV_VP, UMSG_RANGE,  UCvsGraph::kDrawing ,  UCvsGraph::kDrawing ,   (UPMSG)(void (UCmdTarget::*)(const URECT * r))& UCvsGraph::OnDrawing  },
{EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 }   }

Reimplemented from UWidget.

Definition at line 41 of file UCvsGraph.cpp.

const URuntimeClass UCvsGraph::classUCvsGraph [static, protected]

EntnodeData* UCvsGraph::m_data [protected]

Definition at line 141 of file UCvsGraph.h.

Referenced by UCvsGraph(), and ~UCvsGraph().

UStr UCvsGraph::m_dir [protected]

Definition at line 139 of file UCvsGraph.h.

UStr UCvsGraph::m_name [protected]

Definition at line 140 of file UCvsGraph.h.

Referenced by OnCreate(), and UCvsGraph().

CLogNode* UCvsGraph::m_node [protected]

Definition at line 138 of file UCvsGraph.h.

Referenced by CalcImageSize(), OnBtnClick(), OnDrawing(), and ~UCvsGraph().

const UMSGMAP UCvsGraph::messageMap = { UWidget ::GetThisMessageMap(), & UCvsGraph ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 41 of file UCvsGraph.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • common/UCvsGraph.cpp
Generated on Fri Jan 31 12:15:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 38 of file CvsStatusBar.cpp.

References m_indic.

00038                              : m_step(-1), m_settimer(false)
00039 {
00040     m_indic.LoadBitmap(IDB_IDLE);
00041 }

CCvsStatusBar::~CCvsStatusBar ( ) [virtual]

Definition at line 43 of file CvsStatusBar.cpp.

00044 {
00045 }

Member Function Documentation

void CCvsStatusBar::DrawItem ( LPDRAWITEMSTRUCT ) [virtual]

Definition at line 47 of file CvsStatusBar.cpp.

References CWincvsApp::IsCvsRunning(), m_settimer, and m_step.

00048 {
00049     if( !m_settimer )
00050     {
00051         SetTimer(999, 100, 0L);
00052         m_settimer = true;
00053     }
00054
00055     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00056     if( !app->IsCvsRunning() && !gCvsPrefs.IsTclFileRunning() )
00057         return;
00058
00059     static int tab[12] = {
00060         -2, -1, 1, 4, 8, 11, 13, 11,
00061         8, 4, 1, -1};
00062     CDC hdc;
00063     CBrush b(RGB(0, 0, 0xFF));
00064
00065     hdc.Attach(p->hDC);
00066     CRect r(p->rcItem);
00067     hdc.FillRect(r, &b);
00068     CPoint off(r.TopLeft());
00069     off.x -= m_step;
00070     int cnt = 0;
00071     while(off.x < r.right)
00072     {
00073         CPoint offy(off);
00074         offy.y += tab[(m_step + cnt) % 12];
00075         hdc.DrawState(offy, CSize(16,16), m_indic, DSS_NORMAL);
00076         off.x += 24;
00077         cnt++;
00078     }
00079
00080     hdc.Detach();
00081 }

void CCvsStatusBar::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 83 of file CvsStatusBar.cpp.

References CWincvsApp::IsCvsRunning(), and m_step.

00084 {
00085     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00086     if( app->IsCvsRunning() || gCvsPrefs.IsTclFileRunning() )
00087     {
00088         if( m_step-- <= 0 )
00089             m_step = 23;
00090
00091         CRect r;
00092         GetItemRect(1, r);
00093         InvalidateRect(r, FALSE);
00094     }
00095     else if( m_step != -1 )
00096     {
00097         m_step = -1;
00098         CRect r;
00099         GetItemRect(1, r);
00100         InvalidateRect(r, FALSE);
00101     }
00102 }

Member Data Documentation

CBitmap CCvsStatusBar::m_indic [protected]

Definition at line 57 of file CvsStatusBar.h.

Referenced by CCvsStatusBar().

bool CCvsStatusBar::m_settimer [protected]

Definition at line 59 of file CvsStatusBar.h.

Referenced by DrawItem().

int CCvsStatusBar::m_step [protected]

Definition at line 58 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 Fri Jan 31 12:15:41 2003 for WinCvs Source by doxygen 1.3-rc2


CCvsThreadLock Class Reference

Critical section to protect while accessing MFC from cvs. More...

#include <wincvs_winutil.h>

Collaboration diagram for CCvsThreadLock:

[legend]
List of all members.

Public Methods

CCvsThreadLock ()
virtual | ~CCvsThreadLock ()

Static Public Methods

void | Initialize ()
void | Delete ()

Static Private Attributes

CRITICAL_SECTION | m_lock
bool | m_initialized = false

Detailed Description

Critical section to protect while accessing MFC from cvs.

Definition at line 58 of file wincvs_winutil.h.

Constructor & Destructor Documentation

CCvsThreadLock::CCvsThreadLock ( )

Definition at line 661 of file wincvs_winutil.cpp.

00662 {
00663     EnterCriticalSection(&m_lock);
00664 }

CCvsThreadLock::~CCvsThreadLock ( ) [virtual]

Definition at line 666 of file wincvs_winutil.cpp.

00667 {
00668     LeaveCriticalSection(&m_lock);
00669 }

Member Function Documentation

void CCvsThreadLock::Delete ( ) [static]

Delete critical section

Definition at line 686 of file wincvs_winutil.cpp.

References m_initialized.

Referenced by CWincvsApp::ExitInstance().

00687 {
00688     if( m_initialized )
00689     {
00690         DeleteCriticalSection(&m_lock);
00691         m_initialized = false;
00692     }
00693 }

void CCvsThreadLock::Initialize ( ) [static]

Initialize critical section

Definition at line 674 of file wincvs_winutil.cpp.

References m_initialized.

Referenced by CWincvsApp::InitInstance().

00675 {
00676     if( !m_initialized )
00677     {
00678         m_initialized = true;
00679         InitializeCriticalSection(&m_lock);
00680     }
00681 }

Member Data Documentation

bool CCvsThreadLock::m_initialized = false [static, private]

Flag to prevent multiple initialization

Definition at line 659 of file wincvs_winutil.cpp.

Referenced by Delete(), and Initialize().

CRITICAL_SECTION CCvsThreadLock::m_lock [static, private]

Critical section lock structure

Definition at line 658 of file wincvs_winutil.cpp.

The documentation for this class was generated from the following files:
  • WinCvs/wincvs_winutil.h
  • WinCvs/wincvs_winutil.cpp
Generated on Fri Jan 31 12:15:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 (int widid)
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 ( int widid )

Definition at line 37 of file UCvsToolbar.cpp.

00037                                   : UToolbar(widid)
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 Fri Jan 31 12:15:43 2003 for WinCvs Source by doxygen 1.3-rc2


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
00175         if(GTK_IS_DRAWING_AREA(widget))
00176         {
00177             m_drawable = GTK_DRAWING_AREA(widget)->widget.window;
00178             m_orig.x = 0;
00179             m_orig.y = 0;
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 URect::Height(), URECT::left, m_brush, m_wid, SelectObject(), URECT::top, 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 URect::Height(), URECT::left, m_brush, m_wid, SelectObject(), URECT::top, 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 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 Fri Jan 31 12:15:44 2003 for WinCvs Source by doxygen 1.3-rc2


CDestroyThreadLock Struct Reference

Critical section used when destroying cvs process. More...

List of all members.

Public Methods

CDestroyThreadLock ()
~CDestroyThreadLock ()

Detailed Description

Critical section used when destroying cvs process.

Definition at line 172 of file cvsgui_process.cpp.

Constructor & Destructor Documentation

CDestroyThreadLock::CDestroyThreadLock ( ) [inline]

Definition at line 175 of file cvsgui_process.cpp.

00176     {
00177         EnterCriticalSection(&CDummyInit::m_destroylock);
00178     }

CDestroyThreadLock::~CDestroyThreadLock ( ) [inline]

Definition at line 180 of file cvsgui_process.cpp.

00181     {
00182         LeaveCriticalSection(&CDummyInit::m_destroylock);
00183     }

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Fri Jan 31 12:15:44 2003 for WinCvs Source by doxygen 1.3-rc2


CDialog Class Reference

Inheritance diagram for CDialog:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CustomizeMenus.h
Generated on Fri Jan 31 12:15:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 MultiFiles *mf, kDiffCmdType diffType, const char *rev1, const char *rev2, bool allowExtDiff, bool useExtDiff, bool unifiedDiff, bool noWhiteSpace, bool ignoreCase, const char *keyword, const char *diffOptions)
~CDiff_MAIN ()

Public Attributes

CSmartComboBox m_diffOptionsCombo
CButton m_noWhiteSpaceCheck
CButton m_ignoreCaseCheck
CButton m_extDiffButton
CButton m_optionsMenuButton
CButton m_noRecursCheck
CButton m_unifiedDiffCheck
CStatic m_keywordDescStatic
CKeywordComboBox m_keywordCombo
CButton m_browseTag2Button
CButton m_browseTag1Button
CButton m_isDate2Check
CButton m_isDate1Check
CSmartComboBox m_compareTypeCombo
CSmartComboBox m_rev2Combo
CSmartComboBox m_rev1Combo
BOOL | m_isDate1
BOOL | m_isDate2
CString | m_rev1
CString | m_rev2
BOOL | m_noWhiteSpace
BOOL | m_ignoreCase
int | m_compareType
BOOL | m_unifiedDiff
CString | m_keyword
BOOL | m_noRecurs
BOOL | m_extDiff
CString | m_diffOptions

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnExtdiff ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnCheck1 ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnCheck2 ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnBrowseTag1 ()
BN_CLICKED message handler, display browse tag/branch dialog.

afx_msg void | OnBrowseTag2 ()
BN_CLICKED message handler, display browse tag/branch dialog.

afx_msg void | OnSelchangeCompareType ()
CBN_SELCHANGE message handler, enable controls.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initialize the controls.

afx_msg void | OnOptionsmenu ()
BN_CLICKED message handler, display the diff options dialog.

Private Methods

void | EnableCompareType (int compareType)
void | EnableCmdLineDiffOptions (bool enable)

Private Attributes

const MultiFiles * | m_mf
bool | m_allowExtDiff
kDiffCmdType m_diffType

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 76 of file DiffDlg.h.

00076 { IDD = IDD_DIFF_MAIN };

Constructor & Destructor Documentation

CDiff_MAIN::CDiff_MAIN | ( | const MultiFiles * | mf,
 |  | kDiffCmdType | diffType,
 |  | const char * | rev1,
 |  | const char * | rev2,
 |  | bool | allowExtDiff,
 |  | bool | useExtDiff,
 |  | bool | unifiedDiff,
 |  | bool | noWhiteSpace,
 |  | bool | ignoreCase,
 |  | const char * | keyword,
 |  | const char * | diffOptions
 | ) |

Definition at line 256 of file DiffDlg.cpp.

References ASSERT, MultiFiles::begin(), UStr::c_str(), MultiFiles::end(), FALSE, kCompareAnotherRev, kCompareSameRev, kCompareTwoRev, kDiffGraph, m_compareType, m_diffOptions, m_diffOptionsCombo, m_diffType, m_extDiff, m_ignoreCase, m_isDate1, m_isDate2, m_keyword, m_mf, m_noRecurs, m_noWhiteSpace, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, m_unifiedDiff, USmartCombo::SetFeature(), USmartCombo::SetItems(), and MultiFiles::TotalNumFiles().

00261                        : m_mf(mf), m_diffType(diffType), m_compareTypeCombo(USmartCombo::AutoDropWidth), m_allowExtDiff(allowExtDiff),
00262                        CPropertyPage(CDiff_MAIN::IDD)
00263 {
00264     //{{AFX_DATA_INIT(CDiff_MAIN)
00265     m_isDate1 = FALSE;
00266     m_isDate2 = FALSE;
00267     m_rev1 = rev1;
00268     m_rev2 = rev2;
00269     m_noWhiteSpace = noWhiteSpace;
00270     m_ignoreCase = ignoreCase;
00271     m_compareType = kCompareSameRev;
00272     m_unifiedDiff = unifiedDiff;
00273     m_keyword = keyword;
00274     m_noRecurs = FALSE;
00275     m_extDiff = useExtDiff;
00276     m_diffOptions = diffOptions;
00277     //}}AFX_DATA_INIT
00278
00279     if( kDiffGraph != m_diffType )
00280     {
00281         m_rev1Combo.SetItems(m_isDate1 ? &gDateNames : &gRevNames);
00282         m_rev2Combo.SetItems(m_isDate2 ? &gDateNames : &gRevNames);
00283     }
00284     else
00285     {
00286         m_compareType = m_mf->TotalNumFiles() == 1 ? kCompareAnotherRev : kCompareTwoRev;
00287
00288         m_rev1Combo.SetFeature(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly);
00289         m_rev2Combo.SetFeature(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly);
00290
00291         if( m_mf && m_mf->TotalNumFiles() )
00292         {
00293             MultiFiles::const_iterator mfi;
00294             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00295             {
00296                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00297                 {
00298                     UStr path;
00299                     UStr fileName;
00300                     UStr currRev;
00301
00302                     mfi->get(nIndex, path, fileName, currRev);
00303
00304                     switch( nIndex )
00305                     {
00306                     case 0:
00307                         m_rev1 = currRev.c_str();
00308                         break;
00309                     case 1:
00310                         m_rev2 = currRev.c_str();
00311                         break;
00312                     default:
00313                         ASSERT(FALSE);  // there should be no more than 2 files in the selection
00314                         break;
00315                     }
00316                 }
00317             }
00318         }
00319     }
00320
00321     m_diffOptionsCombo.SetItems(&gDiffOptions);
00322 }

CDiff_MAIN::~CDiff_MAIN ( )

Definition at line 324 of file DiffDlg.cpp.

00325 {
00326 }

Member Function Documentation

void CDiff_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 328 of file DiffDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), EnableCompareType(), kCompareAnotherRev, kCompareTwoRev, kDiffGraph, m_compareType, m_diffType, m_extDiffButton, and OnExtdiff().

00329 {
00330     CPropertyPage::DoDataExchange(pDX);
00331     //{{AFX_DATA_MAP(CDiff_MAIN)
00332     DDX_Control(pDX, IDC_DIFFOPTIONS, m_diffOptionsCombo);
00333     DDX_Control(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpaceCheck);
00334     DDX_Control(pDX, IDC_IGNORECASE, m_ignoreCaseCheck);
00335     DDX_Control(pDX, IDC_EXTDIFF, m_extDiffButton);
00336     DDX_Control(pDX, IDC_OPTIONSMENU, m_optionsMenuButton);
00337     DDX_Control(pDX, IDC_NORECURS, m_noRecursCheck);
00338     DDX_Control(pDX, IDC_UNIFIEDDIFF, m_unifiedDiffCheck);
00339     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00340     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00341     DDX_Control(pDX, IDC_BROWSE_TAG2, m_browseTag2Button);
00342     DDX_Control(pDX, IDC_BROWSE_TAG1, m_browseTag1Button);
00343     DDX_Control(pDX, IDC_ISDATE2, m_isDate2Check);
00344     DDX_Control(pDX, IDC_ISDATE1, m_isDate1Check);
00345     DDX_Control(pDX, IDC_COMPARE_TYPE, m_compareTypeCombo);
00346     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00347     DDX_Control(pDX, IDC_COMBOREV1, m_rev1Combo);
00348     DDX_Check(pDX, IDC_ISDATE1, m_isDate1);
00349     DDX_Check(pDX, IDC_ISDATE2, m_isDate2);
00350     DDX_CBString(pDX, IDC_COMBOREV1, m_rev1);
00351     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00352     DDX_Check(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpace);
00353     DDX_Check(pDX, IDC_IGNORECASE, m_ignoreCase);
00354     DDX_CBIndex(pDX, IDC_COMPARE_TYPE, m_compareType);
00355     DDX_Check(pDX, IDC_UNIFIEDDIFF, m_unifiedDiff);
00356     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00357     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00358     DDX_Check(pDX, IDC_EXTDIFF, m_extDiff);
00359     DDX_CBString(pDX, IDC_DIFFOPTIONS, m_diffOptions);
00360     //}}AFX_DATA_MAP
00361
00362     if( kDiffGraph != m_diffType )
00363     {
00364         if( kCompareAnotherRev == m_compareType || kCompareTwoRev == m_compareType )
00365         {
00366             DDV_MinChars(pDX, m_rev1, 1);
00367         }
00368
00369         if( kCompareTwoRev == m_compareType )
00370         {
00371             DDV_MinChars(pDX, m_rev2, 1);
00372         }
00373
00374         if( !pDX->m_bSaveAndValidate )
00375         {
00376             EnableCompareType(m_compareType);
00377         }
00378
00379         DDX_ComboMString(pDX, IDC_COMBOREV1, m_rev1Combo);
00380         DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00381
00382         DDX_ComboMString(pDX, IDC_DIFFOPTIONS, m_diffOptionsCombo);
00383     }
00384
00385     m_extDiffButton.EnableWindow(m_allowExtDiff ? true : false);
00386
00387     OnExtdiff();
00388 }

void CDiff_MAIN::EnableCmdLineDiffOptions ( bool enable ) [private]

Enable controls for command line option

Parameters:
enable true to enable controls, false to disable

Definition at line 415 of file DiffDlg.cpp.

References m_diffOptionsCombo, m_ignoreCaseCheck, m_keywordCombo, m_keywordDescStatic, m_noRecursCheck, m_noWhiteSpaceCheck, m_optionsMenuButton, and m_unifiedDiffCheck.

Referenced by OnExtdiff().

00416 {
00417     m_unifiedDiffCheck.EnableWindow(enable);
00418     m_ignoreCaseCheck.EnableWindow(enable);
00419     m_noWhiteSpaceCheck.EnableWindow(enable);
00420     m_noRecursCheck.EnableWindow(enable);
00421     m_keywordCombo.EnableWindow(enable);
00422     m_keywordDescStatic.EnableWindow(enable);
00423     m_diffOptionsCombo.EnableWindow(enable);
00424     m_optionsMenuButton.EnableWindow(enable);
00425 }

void CDiff_MAIN::EnableCompareType ( int compareType ) [private]

Enable controls for given compare type

Parameters:
compareType Compare type

Definition at line 481 of file DiffDlg.cpp.

References ASSERT, kCompareAnotherRev, kCompareSameRev, kCompareTwoRev, m_browseTag1Button, m_browseTag2Button, m_isDate1Check, m_isDate2Check, m_rev1Combo, and m_rev2Combo.

Referenced by DoDataExchange(), and OnSelchangeCompareType().

00482 {
00483     bool hasRev1 = false;
00484     bool hasRev2 = false;
00485
00486     switch( compareType )
00487     {
00488     default:
00489         ASSERT(FALSE);  //unknown compare type
00490     case kCompareSameRev:
00491         hasRev1 = hasRev2 = false;
00492         break;
00493     case kCompareAnotherRev:
00494         hasRev1 = true;
00495         hasRev2 = false;
00496         break;
00497     case kCompareTwoRev:
00498         hasRev1 = true;
00499         hasRev2 = true;
00500         break;
00501     }
00502
00503     m_rev1Combo.EnableWindow(hasRev1);
00504     m_isDate1Check.EnableWindow(hasRev1);
00505     m_browseTag1Button.EnableWindow(hasRev1);
00506
00507     m_rev2Combo.EnableWindow(hasRev2);
00508     m_isDate2Check.EnableWindow(hasRev2);
00509     m_browseTag2Button.EnableWindow(hasRev2);
00510 }

void CDiff_MAIN::OnBrowseTag1 ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 450 of file DiffDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev1, and m_rev1Combo.

00451 {
00452     CStr tagName;
00453     if( CompatGetTagListItem(m_mf, tagName) )
00454     {
00455         m_rev1 = (const char*)tagName;
00456         m_rev1Combo.SetWindowText(m_rev1);
00457     }
00458 }

void CDiff_MAIN::OnBrowseTag2 ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 461 of file DiffDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev2, and m_rev2Combo.

00462 {
00463     CStr tagName;
00464     if( CompatGetTagListItem(m_mf, tagName) )
00465     {
00466         m_rev2 = (const char*)tagName;
00467         m_rev2Combo.SetWindowText(m_rev2);
00468     }
00469 }

void CDiff_MAIN::OnCheck1 ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 428 of file DiffDlg.cpp.

References DDX_ComboMString(), m_browseTag1Button, m_isDate1Check, m_rev1Combo, and USmartCombo::SetItems().

00429 {
00430     BOOL isDate = m_isDate1Check.GetCheck();
00431
00432     m_rev1Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00433     DDX_ComboMString(NULL, IDC_COMBOREV1, m_rev1Combo);
00434
00435     m_browseTag1Button.EnableWindow(!isDate);
00436 }

void CDiff_MAIN::OnCheck2 ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 439 of file DiffDlg.cpp.

References DDX_ComboMString(), m_browseTag2Button, m_isDate2Check, m_rev2Combo, and USmartCombo::SetItems().

00440 {
00441     BOOL isDate = m_isDate2Check.GetCheck();
00442
00443     m_rev2Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00444     DDX_ComboMString(NULL, IDC_COMBOREV2, m_rev2Combo);
00445
00446     m_browseTag2Button.EnableWindow(!isDate);
00447 }

void CDiff_MAIN::OnExtdiff ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 406 of file DiffDlg.cpp.

References EnableCmdLineDiffOptions(), and m_extDiffButton.

Referenced by DoDataExchange().

00407 {
00408     EnableCmdLineDiffOptions(!m_extDiffButton.GetCheck() || !m_extDiffButton.IsWindowEnabled());
00409 }

BOOL CDiff_MAIN::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initialize the controls.

Definition at line 513 of file DiffDlg.cpp.

References kCompareAnotherRev, kCompareTwoRev, kDiffGraph, m_browseTag1Button, m_browseTag2Button, m_compareTypeCombo, m_diffType, m_isDate1Check, m_isDate2Check, m_keywordCombo, m_keywordDescStatic, m_mf, m_rev1, m_rev1Combo, m_rev2, m_rev2Combo, CKeywordComboBox::SetDescriptionWnd(), CSmartComboBox::SetReadOnly(), MultiFiles::TotalNumFiles(), and TRUE.

00514 {
00515     CPropertyPage::OnInitDialog();
00516
00517     // Extra initialization
00518     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00519
00520     // Special setup for the diff invoked using the graph view
00521     if( kDiffGraph == m_diffType )
00522     {
00523         m_compareTypeCombo.SetCurSel(m_mf->TotalNumFiles() == 1 ? kCompareAnotherRev : kCompareTwoRev);
00524         m_compareTypeCombo.EnableWindow(FALSE);
00525
00526         m_browseTag1Button.EnableWindow(FALSE);
00527         m_browseTag2Button.EnableWindow(FALSE);
00528
00529         m_isDate1Check.EnableWindow(FALSE);
00530         m_isDate2Check.EnableWindow(FALSE);
00531
00532         m_rev1Combo.SetReadOnly(TRUE);
00533         m_rev1Combo.ResetContent();
00534
00535         if( !m_rev1.IsEmpty() )
00536         {
00537             m_rev1Combo.AddString(m_rev1);
00538             m_rev1Combo.SetWindowText(m_rev1);
00539         }
00540
00541         if( m_mf && m_mf->TotalNumFiles() == 2 )
00542         {
00543             m_rev2Combo.SetReadOnly(TRUE);
00544             m_rev2Combo.ResetContent();
00545
00546             if( !m_rev2.IsEmpty() )
00547             {
00548                 m_rev2Combo.AddString(m_rev2);
00549                 m_rev2Combo.SetWindowText(m_rev2);
00550             }
00551         }
00552         else
00553         {
00554             m_rev2Combo.EnableWindow(FALSE);
00555         }
00556     }
00557
00558     return TRUE;  // return TRUE unless you set the focus to a control
00559                   // EXCEPTION: OCX Property Pages should return FALSE
00560 }

void CDiff_MAIN::OnOptionsmenu ( ) [protected]

BN_CLICKED message handler, display the diff options dialog.

Definition at line 563 of file DiffDlg.cpp.

References CDiff_Options::GetDiffOptions(), CDiff_Options::m_currentOptions, and m_diffOptionsCombo.

00564 {
00565     CDiff_Options diffOptionsDlg;
00566
00567     CString currentOptions;
00568     m_diffOptionsCombo.GetWindowText(currentOptions);
00569     diffOptionsDlg.m_currentOptions = currentOptions;
00570
00571     if( diffOptionsDlg.DoModal() == IDOK )
00572     {
00573         CString diffOptions = diffOptionsDlg.GetDiffOptions();
00574         if( !diffOptions.IsEmpty() )
00575         {
00576             currentOptions.TrimRight();
00577             currentOptions += currentOptions.IsEmpty() ? "" : " ";
00578             m_diffOptionsCombo.SetWindowText(currentOptions + diffOptions);
00579             GotoDlgCtrl(&m_diffOptionsCombo);
00580         }
00581     }
00582 }

void CDiff_MAIN::OnSelchangeCompareType ( ) [protected]

CBN_SELCHANGE message handler, enable controls.

Definition at line 472 of file DiffDlg.cpp.

References EnableCompareType(), and m_compareTypeCombo.

00473 {
00474     EnableCompareType(m_compareTypeCombo.GetCurSel());
00475 }

Member Data Documentation

bool CDiff_MAIN::m_allowExtDiff [private]

Definition at line 131 of file DiffDlg.h.

CButton CDiff_MAIN::m_browseTag1Button

Definition at line 87 of file DiffDlg.h.

Referenced by EnableCompareType(), OnCheck1(), and OnInitDialog().

CButton CDiff_MAIN::m_browseTag2Button

Definition at line 86 of file DiffDlg.h.

Referenced by EnableCompareType(), OnCheck2(), and OnInitDialog().

int CDiff_MAIN::m_compareType

Definition at line 99 of file DiffDlg.h.

Referenced by CDiff_MAIN(), CompatGetDiff(), and DoDataExchange().

CSmartComboBox CDiff_MAIN::m_compareTypeCombo

Definition at line 90 of file DiffDlg.h.

Referenced by OnInitDialog(), and OnSelchangeCompareType().

CString CDiff_MAIN::m_diffOptions

Definition at line 104 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CSmartComboBox CDiff_MAIN::m_diffOptionsCombo

Definition at line 77 of file DiffDlg.h.

Referenced by CDiff_MAIN(), EnableCmdLineDiffOptions(), and OnOptionsmenu().

kDiffCmdType CDiff_MAIN::m_diffType [private]

Definition at line 132 of file DiffDlg.h.

Referenced by CDiff_MAIN(), DoDataExchange(), and OnInitDialog().

BOOL CDiff_MAIN::m_extDiff

Definition at line 103 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_extDiffButton

Definition at line 80 of file DiffDlg.h.

Referenced by DoDataExchange(), and OnExtdiff().

BOOL CDiff_MAIN::m_ignoreCase

Definition at line 98 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_ignoreCaseCheck

Definition at line 79 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions().

BOOL CDiff_MAIN::m_isDate1

Definition at line 93 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_isDate1Check

Definition at line 89 of file DiffDlg.h.

Referenced by EnableCompareType(), OnCheck1(), and OnInitDialog().

BOOL CDiff_MAIN::m_isDate2

Definition at line 94 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_isDate2Check

Definition at line 88 of file DiffDlg.h.

Referenced by EnableCompareType(), OnCheck2(), and OnInitDialog().

CString CDiff_MAIN::m_keyword

Definition at line 101 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CKeywordComboBox CDiff_MAIN::m_keywordCombo

Definition at line 85 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions(), and OnInitDialog().

CStatic CDiff_MAIN::m_keywordDescStatic

Definition at line 84 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions(), and OnInitDialog().

const MultiFiles* CDiff_MAIN::m_mf [private]

Definition at line 130 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and OnInitDialog().

BOOL CDiff_MAIN::m_noRecurs

Definition at line 102 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_noRecursCheck

Definition at line 82 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions().

BOOL CDiff_MAIN::m_noWhiteSpace

Definition at line 97 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_noWhiteSpaceCheck

Definition at line 78 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions().

CButton CDiff_MAIN::m_optionsMenuButton

Definition at line 81 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions().

CString CDiff_MAIN::m_rev1

Definition at line 95 of file DiffDlg.h.

Referenced by CDiff_MAIN(), CompatGetDiff(), OnBrowseTag1(), and OnInitDialog().

CSmartComboBox CDiff_MAIN::m_rev1Combo

Definition at line 92 of file DiffDlg.h.

Referenced by CDiff_MAIN(), EnableCompareType(), OnBrowseTag1(), OnCheck1(), and OnInitDialog().

CString CDiff_MAIN::m_rev2

Definition at line 96 of file DiffDlg.h.

Referenced by CDiff_MAIN(), CompatGetDiff(), OnBrowseTag2(), and OnInitDialog().

CSmartComboBox CDiff_MAIN::m_rev2Combo

Definition at line 91 of file DiffDlg.h.

Referenced by CDiff_MAIN(), EnableCompareType(), OnBrowseTag2(), OnCheck2(), and OnInitDialog().

BOOL CDiff_MAIN::m_unifiedDiff

Definition at line 100 of file DiffDlg.h.

Referenced by CDiff_MAIN(), and CompatGetDiff().

CButton CDiff_MAIN::m_unifiedDiffCheck

Definition at line 83 of file DiffDlg.h.

Referenced by EnableCmdLineDiffOptions().

The documentation for this class was generated from the following files:
  • common/DiffDlg.h
  • common/DiffDlg.cpp
Generated on Fri Jan 31 12:15:47 2003 for WinCvs Source by doxygen 1.3-rc2


CDiff_Options Class Reference

#include <DiffDlg.h>

Inheritance diagram for CDiff_Options:

[legend]
Collaboration diagram for CDiff_Options:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_DIFF_OPTIONS }

Public Methods

CDiff_Options (CWnd *pParent=NULL)
CString | GetDiffOptions ()

Public Attributes

CListCtrl m_optionsListCtrl
CString | m_currentOptions

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual void | OnOK ()
OnOK virtual override, sets the string containing all selected options.

afx_msg void | OnItemchangedOptionslist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_ITEMCHANGED message handler, update the option's description edit box value as selection is changing.

afx_msg void | OnColumnclickOptionslist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_COLUMNCLICK message handler, sort items in response to column click.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initialize diff options list.

Private Methods

void | SortItems (int column, bool asc)

Static Private Methods

int CALLBACK | CompareItems (LPARAM itemData1, LPARAM itemData2, LPARAM lParam)

Private Attributes

CString | m_diffOptions
bool | m_sortAsc
int | m_sortColumn
CSortHeaderCtrl m_headerCtrl

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 150 of file DiffDlg.h.

00150 { IDD = IDD_DIFF_OPTIONS };

Constructor & Destructor Documentation

CDiff_Options::CDiff_Options ( CWnd * pParent = NULL )

Definition at line 588 of file DiffDlg.cpp.

References m_currentOptions, m_sortAsc, and m_sortColumn.

00589     : CDialog(CDiff_Options::IDD, pParent)
00590 {
00591     //{{AFX_DATA_INIT(CDiff_Options)
00592     m_currentOptions = _T("");
00593     //}}AFX_DATA_INIT
00594
00595     m_sortAsc = false;
00596     m_sortColumn = 0;
00597 }

Member Function Documentation

int CALLBACK CDiff_Options::CompareItems | ( | LPARAM | itemData1,
 |  | LPARAM | itemData2,
 |  | LPARAM | lParam
 | ) | [static, private]

Callback method used for sorting of items in the list control

Parameters:
itemData1 | DiffOptionsItem* of the first element
itemData2 | DiffOptionsItem* of the second element
lParam | CompareInfo* Sort settings
Returns:
1, -1 or 0 depending on the sort settings

Definition at line 756 of file DiffDlg.cpp.

References ASSERT, _sDiffOptionsItem::description, CDiff_Options::CompareInfo::m_asc, CDiff_Options::CompareInfo::m_column, and _sDiffOptionsItem::option.

00757 {
00758     int res = 0;
00759
00760     const CompareInfo* info = (CompareInfo*)lParam;
00761     if( info )
00762     {
00763         DiffOptionsItem* diffOptionsItem1 = (DiffOptionsItem*)itemData1;
00764         DiffOptionsItem* diffOptionsItem2 = (DiffOptionsItem*)itemData2;
00765
00766         switch( info->m_column )
00767         {
00768         case 0:
00769             res = stricmp(diffOptionsItem1->option, diffOptionsItem2->option);
00770             break;
00771         case 1:
00772             res = stricmp(diffOptionsItem1->description, diffOptionsItem2->description);
00773             break;
00774         default:
00775             ASSERT(FALSE); // should not come here
00776             break;
00777         }
00778     }
00779
00780     if( res )
00781     {
00782         if( info->m_asc )
00783         {
00784             res *= -1;
00785         }
00786     }
00787
00788     return res;
00789 }

void CDiff_Options::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 600 of file DiffDlg.cpp.

00601 {
00602     CDialog::DoDataExchange(pDX);
00603     //{{AFX_DATA_MAP(CDiff_Options)
00604     DDX_Control(pDX, IDC_OPTIONSLIST, m_optionsListCtrl);
00605     DDX_Text(pDX, IDC_CURRENT_OPTIONS, m_currentOptions);
00606     //}}AFX_DATA_MAP
00607 }

CString CDiff_Options::GetDiffOptions ( )

Get the diff options

Returns:
The diff options as CString

Definition at line 624 of file DiffDlg.cpp.

References m_diffOptions.

Referenced by CDiff_MAIN::OnOptionsmenu().

00625 {
00626     return m_diffOptions;
00627 }

void CDiff_Options::OnColumnclickOptionslist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_COLUMNCLICK message handler, sort items in response to column click.

Definition at line 665 of file DiffDlg.cpp.

References m_sortAsc, m_sortColumn, and SortItems().

00666 {
00667     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00668
00669     if( m_sortColumn != pNMListView->iSubItem )
00670     {
00671         m_sortAsc = false;
00672     }
00673     else
00674     {
00675         m_sortAsc = !m_sortAsc;
00676     }
00677
00678     m_sortColumn = pNMListView->iSubItem;
00679
00680     SortItems(m_sortColumn, m_sortAsc);
00681
00682     *pResult = 0;
00683 }

BOOL CDiff_Options::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initialize diff options list.

Definition at line 686 of file DiffDlg.cpp.

References m_headerCtrl, m_optionsListCtrl, _sDiffOptionsItem::option, sDiffOptions, and TRUE.

00687 {
00688     CDialog::OnInitDialog();
00689
00690     // Set the control's style
00691     {
00692         DWORD dwExtendedStyle = m_optionsListCtrl.GetExtendedStyle();
00693         dwExtendedStyle |= LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
00694         m_optionsListCtrl.SetExtendedStyle(dwExtendedStyle);
00695     }
00696
00697     // Setup controls
00698     CHeaderCtrl* headerCtrl = m_optionsListCtrl.GetHeaderCtrl();
00699     if( headerCtrl )
00700     {
00701         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00702     }
00703
00704     // Get the client area width to properly size columns
00705     CRect rect;
00706     m_optionsListCtrl.GetClientRect(rect);
00707
00708     const int listCtrlWidth = rect.Width();
00709     const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
00710
00711     // Insert columns
00712     m_optionsListCtrl.InsertColumn(0, "Option", LVCFMT_LEFT, 65);
00713     m_optionsListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, listCtrlWidthNoScroll - 65);
00714
00715     // Insert options
00716     const int itemsCount = (sizeof(sDiffOptions) / sizeof(DiffOptionsItem));
00717     for(int nIndex = 0; nIndex < itemsCount; nIndex++)
00718     {
00719         const int item = m_optionsListCtrl.InsertItem(m_optionsListCtrl.GetItemCount(), sDiffOptions[nIndex].option);
00720         if( item > -1 )
00721         {
00722             m_optionsListCtrl.SetItemText(item, 1, sDiffOptions[nIndex].description);
00723             m_optionsListCtrl.SetItemData(item, (DWORD)&sDiffOptions[nIndex]);
00724         }
00725     }
00726
00727     return TRUE;  // return TRUE unless you set the focus to a control
00728                   // EXCEPTION: OCX Property Pages should return FALSE
00729 }

void CDiff_Options::OnItemchangedOptionslist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_ITEMCHANGED message handler, update the option's description edit box value as selection is changing.

Definition at line 647 of file DiffDlg.cpp.

References m_optionsListCtrl.

00648 {
00649     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00650     if( pNMListView->iItem > -1 &&
00651         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
00652     {
00653         CString item;
00654         item.Format(STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT,
00655             m_optionsListCtrl.GetItemText(pNMListView->iItem, 0),
00656             m_optionsListCtrl.GetItemText(pNMListView->iItem, 1));
00657
00658         SetDlgItemText(IDC_OPTIONDETAILS, item);
00659     }
00660
00661     *pResult = 0;
00662 }

void CDiff_Options::OnOK ( ) [protected, virtual]

OnOK virtual override, sets the string containing all selected options.

Definition at line 630 of file DiffDlg.cpp.

References m_diffOptions, and m_optionsListCtrl.

00631 {
00632     for(int nIndex = 0; nIndex < m_optionsListCtrl.GetItemCount(); nIndex++)
00633     {
00634         if( m_optionsListCtrl.GetCheck(nIndex) )
00635         {
00636             m_diffOptions += m_optionsListCtrl.GetItemText(nIndex, 0);
00637             m_diffOptions += " ";
00638         }
00639     }
00640
00641     m_diffOptions.TrimRight();
00642
00643     CDialog::OnOK();
00644 }

void CDiff_Options::SortItems | ( | int | column,
 |  | bool | asc
 | ) | [private]

Sort items listed in the list control

Parameters:
column | Column to sort items by
asc | Sort ascending or descending
Note:
Using list control callback CompareItems

Definition at line 737 of file DiffDlg.cpp.

References CDiff_Options::CompareInfo::m_asc, CDiff_Options::CompareInfo::m_column, m_headerCtrl, m_optionsListCtrl, and CSortHeaderCtrl::SetSortImage().

Referenced by OnColumnclickOptionslist().

00738 {
00739     m_headerCtrl.SetSortImage(column, asc);
00740
00741     CompareInfo info = { 0 };
00742
00743     info.m_column = column;
00744     info.m_asc = asc;
00745
00746     m_optionsListCtrl.SortItems(CompareItems, (DWORD)&info);
00747 }

Member Data Documentation

CString CDiff_Options::m_currentOptions

Definition at line 152 of file DiffDlg.h.

Referenced by CDiff_Options(), and CDiff_MAIN::OnOptionsmenu().

CString CDiff_Options::m_diffOptions [private]

Diff options

Definition at line 176 of file DiffDlg.h.

Referenced by GetDiffOptions(), and OnOK().

CSortHeaderCtrl CDiff_Options::m_headerCtrl [private]

Definition at line 188 of file DiffDlg.h.

Referenced by OnInitDialog(), and SortItems().

CListCtrl CDiff_Options::m_optionsListCtrl

Definition at line 151 of file DiffDlg.h.

Referenced by OnInitDialog(), OnItemchangedOptionslist(), OnOK(), and SortItems().

bool CDiff_Options::m_sortAsc [private]

Current ascending/descending sorting

Definition at line 186 of file DiffDlg.h.

Referenced by CDiff_Options(), and OnColumnclickOptionslist().

int CDiff_Options::m_sortColumn [private]

Current sort column

Definition at line 187 of file DiffDlg.h.

Referenced by CDiff_Options(), and OnColumnclickOptionslist().

The documentation for this class was generated from the following files:
  • common/DiffDlg.h
  • common/DiffDlg.cpp
Generated on Fri Jan 31 12:15:48 2003 for WinCvs Source by doxygen 1.3-rc2


CDiff_Options::CompareInfo Struct Reference

Structure to hold the sorting settings. More...

Collaboration diagram for CDiff_Options::CompareInfo:

[legend]
List of all members.

Public Attributes

int | m_column
bool | m_asc

Detailed Description

Structure to hold the sorting settings.

Definition at line 180 of file DiffDlg.h.

Member Data Documentation

bool CDiff_Options::CompareInfo::m_asc

Sort ascending or descending

Definition at line 183 of file DiffDlg.h.

Referenced by CDiff_Options::CompareItems(), and CDiff_Options::SortItems().

int CDiff_Options::CompareInfo::m_column

Sorting column

Definition at line 182 of file DiffDlg.h.

Referenced by CDiff_Options::CompareItems(), and CDiff_Options::SortItems().

The documentation for this struct was generated from the following file:
  • common/DiffDlg.h
Generated on Fri Jan 31 12:15:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


CDocument Class Reference

Inheritance diagram for CDocument:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphDoc.h
Generated on Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


Wincvs::Document Class Reference

The documentation for this class was generated from the following file:
  • WinCvs/wincvs.odl
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


CDummyInit Class Reference

Use the runtime to initialize/delete a critical section. More...

Collaboration diagram for CDummyInit:

[legend]
List of all members.

Public Methods

CDummyInit ()
~CDummyInit ()

Static Public Attributes

CRITICAL_SECTION | m_destroylock
CRITICAL_SECTION | m_stacklock

Detailed Description

Use the runtime to initialize/delete a critical section.

Definition at line 85 of file cvsgui_process.cpp.

Constructor & Destructor Documentation

CDummyInit::CDummyInit ( ) [inline]

Definition at line 88 of file cvsgui_process.cpp.

References m_destroylock, and m_stacklock.

00089     {
00090         ::InitializeCriticalSection(&m_destroylock);
00091         ::InitializeCriticalSection(&m_stacklock);
00092     }

CDummyInit::~CDummyInit ( ) [inline]

Definition at line 94 of file cvsgui_process.cpp.

References m_destroylock, and m_stacklock.

00095     {
00096         ::DeleteCriticalSection(&m_destroylock);
00097         ::DeleteCriticalSection(&m_stacklock);
00098     }

Member Data Documentation

CRITICAL_SECTION CDummyInit::m_destroylock [static]

Definition at line 104 of file cvsgui_process.cpp.

Referenced by CDummyInit(), and ~CDummyInit().

CRITICAL_SECTION CDummyInit::m_stacklock [static]

Definition at line 105 of file cvsgui_process.cpp.

Referenced by CDummyInit(), and ~CDummyInit().

The documentation for this class was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Fri Jan 31 12:15:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 GetPseudoID(), 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[0]);
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 Fri Jan 31 12:15:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:52 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 207 of file AskYesNo.cpp.

00208     {
00209         kOK = EV_COMMAND_START, // 0
00210         kCancel,                // 1
00211         kMsg,                   // 2
00212         kEdit                   // 3
00213     };

Constructor & Destructor Documentation

UEditMessage::UEditMessage | ( | const char * | msg,
 |  | const char * | edit,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) | [inline]

Definition at line 200 of file AskYesNo.cpp.

References m_edit.

00201                           : UPromptMessage(msg, title, def, cncl), m_edit(edit)
00202     {
00203     }

virtual UEditMessage::~UEditMessage ( ) [inline, virtual]

Definition at line 205 of file AskYesNo.cpp.

00205 {}

Member Function Documentation

const URuntimeClass * UEditMessage::_GetBaseClass ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 236 of file AskYesNo.cpp.

00242 {

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 215 of file AskYesNo.cpp.

References UStr::c_str(), UPromptMessage::DoDataExchange(), UCmdTarget::GetWidID(), m_edit, and UEventSendMessage().

00216     {
00217         UPromptMessage::DoDataExchange(fill);
00218
00219         if(fill)
00220         {
00221             UEventSendMessage(GetWidID(), EV_SETTEXT, kEdit, (void *)m_edit.c_str());
00222         }
00223         else
00224         {
00225             UEventSendMessage(GetWidID(), EV_GETTEXT, kEdit, &m_edit);
00226         }
00227     }

const UMSGMAP * UEditMessage::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 238 of file AskYesNo.cpp.

00242 {

const UMSGMAP * UEditMessage::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UPromptMessage.

Definition at line 238 of file AskYesNo.cpp.

00242 {

const URuntimeClass * UEditMessage::GetRuntimeClass ( ) const [virtual]

Reimplemented from UPromptMessage.

Definition at line 236 of file AskYesNo.cpp.

00242 {

const UMSGMAP * UEditMessage::GetThisMessageMap ( ) [static, protected]

Reimplemented from UPromptMessage.

Definition at line 238 of file AskYesNo.cpp.

00242 {

const URuntimeClass * UEditMessage::rtUEditMessage ( void ) [static]

Definition at line 236 of file AskYesNo.cpp.

00242 {

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 238 of file AskYesNo.cpp.

const URuntimeClass UEditMessage::classUEditMessage [static, protected]

UStr UEditMessage::m_edit

Definition at line 229 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 238 of file AskYesNo.cpp.

The documentation for this class was generated from the following file:
  • common/AskYesNo.cpp
Generated on Fri Jan 31 12:15:53 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

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, 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(), and CompatGetEditorMsg().

UINT CEditorMonDlg::m_timer [private]

Definition at line 75 of file EditorMonDlg.h.

Referenced by OnInitDialog(), and OnTimer().

The documentation for this class was generated from the following files:
  • common/EditorMonDlg.h
  • common/EditorMonDlg.cpp
Generated on Fri Jan 31 12:15:54 2003 for WinCvs Source by doxygen 1.3-rc2


ENTNODE Class Reference

Allow reference of a file or a folder node. More...

#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)
virtual | ~ENTNODE ()
ENTNODE & | operator= (const ENTNODE &anode)
Operator =.

EntnodeData * | Data () const
Access data.

operator EntnodeData * () const
Operator EntnodeData*.

Static Public Methods

int | Compare (const ENTNODE &node1, const ENTNODE &node2)

Protected Attributes

EntnodeData * shareData

Detailed Description

Allow reference of a file or a folder node.

Definition at line 212 of file CvsEntries.h.

Constructor & Destructor Documentation

ENTNODE::ENTNODE ( ) [inline]

Definition at line 447 of file CvsEntries.h.

00447                         : shareData(0L)
00448 {
00449 }

ENTNODE::ENTNODE ( EntnodeData * data ) [inline]

Definition at line 451 of file CvsEntries.h.

00451                                          : shareData(data->Ref())
00452 {
00453 }

ENTNODE::ENTNODE ( EntnodeData & data ) [inline]

Definition at line 455 of file CvsEntries.h.

00455                                          : shareData(data.Ref())
00456 {
00457 }

ENTNODE::ENTNODE ( const ENTNODE & anode ) [inline]

Definition at line 459 of file CvsEntries.h.

00459                                             : shareData(0L)
00460 {
00461     *this = anode;
00462 }

ENTNODE::~ENTNODE ( ) [inline, virtual]

Definition at line 464 of file CvsEntries.h.

References shareData, and EntnodeData::UnRef().

00465 {
00466     if( shareData != 0L )
00467         shareData->UnRef();
00468 }

Member Function Documentation

int ENTNODE::Compare | ( | const ENTNODE & | node1,
 |  | const ENTNODE & | node2
 | ) | [inline, static]

Compare two ENTNODE items

Parameters:
node1 | First item
node2 | Second item
Returns:
Less than zero if node1 is less than node2, zero if nodes are equal, more than zero if node2 is less than node1

Definition at line 476 of file CvsEntries.h.

References EntnodeData::Compare(), and shareData.

00477 {
00478     return EntnodeData::Compare(*node1.shareData, *node2.shareData);
00479 }

EntnodeData * ENTNODE::Data ( ) const [inline]

Access data.

Definition at line 482 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().

00483 {
00484     return shareData;
00485 }

ENTNODE::operator EntnodeData * ( ) const [inline]

Operator EntnodeData*.

Definition at line 488 of file CvsEntries.h.

References shareData.

00489 {
00490     return shareData;
00491 }

ENTNODE & ENTNODE::operator= ( const ENTNODE & anode )

Operator =.

Definition at line 355 of file CvsEntries.cpp.

References EntnodeData::Ref(), shareData, and EntnodeData::UnRef().

00356 {
00357     EntnodeData* oldData = shareData;
00358     shareData = anode.shareData;
00359
00360     if( shareData != 0L )
00361     {
00362         shareData->Ref();
00363     }
00364
00365     if( oldData != 0L )
00366     {
00367         oldData->UnRef();
00368     }
00369
00370     return *this;
00371 }

Member Data Documentation

EntnodeData* ENTNODE::shareData [protected]

Data

Definition at line 230 of file CvsEntries.h.

Referenced by Compare(), Data(), operator EntnodeData *(), operator=(), and ~ENTNODE().

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Fri Jan 31 12:15:55 2003 for WinCvs Source by doxygen 1.3-rc2


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
}
Enum node types. More...

Public Methods

virtual ent_type | GetType () const=0
Get the entry type.

EntnodeData * | Ref ()
Increase reference count.

EntnodeData * | UnRef ()
Decrease reference count, delete self if reference count reached zero.

virtual const char * | operator[] (int index) const
Operator [].

void | SetMissing (bool state)
Set the missing flag.

bool | IsMissing () const
Get the missing flag.

void | SetVisited (bool state)
Set the visited flag.

bool | IsVisited () const
Get the visited flag.

void | SetUnknown (bool state)
Set the unknown flag.

bool | IsUnknown () const
Get the unknown flag.

void | SetIgnored (bool state)
Set the ignored flag.

bool | IsIgnored () const
Get the ignored flag.

void | SetLocked (bool state)
Set the locked flag.

bool | IsLocked () const
Get the locked flag.

void | SetRemoved (bool state)
Set the removed flag.

bool | IsRemoved () const
Get the removed flag.

void | SetDesc (const char *newdesc)
Set the description.

const char * | GetDesc () const
Get the description.

const char * | GetName () const
Get the item name.

const char * | GetFullPathName (UStr &resPath) const
Get the fully qualified item name.

const char * | GetFolderPath () const
Get the fully qualified folder name of the item.

virtual const char * | GetConflict () const
Get the conflict marker.

void | SetUnmodified (bool state)
Set the unmodified flag.

bool | IsUnmodified () const
Get the unmodified flag.

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

Detailed Description

Abstract class to hold the node data
Note:
Reference-counted, we don't use delete on it

Definition at line 71 of file CvsEntries.h.

Member Enumeration Documentation

anonymous enum

Enum node types.

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 212 of file CvsEntries.cpp.

References CloneStr(), fullpathname, EntnodePath::Ref(), unmodified(), and user.

00213     : ref(1), missing(false), visited(false), unknown(false),
00214       unmodified(true), ignored(false), locked(false), removed(false),
00215       user(0L), desc(0L), fullpathname(0L)
00216 {
00217 #if TARGET_RT_MAC_CFM
00218     macspec.vRefNum = 0;
00219     macspec.parID = 0;
00220     macspec.name[0] = '\0';
00221 #endif
00222
00223 #if TARGET_RT_MAC_MACHO
00224     memset(&macspec, 0, sizeof(macspec));
00225 #endif
00226
00227     user = CloneStr(name);
00228     fullpathname = path->Ref();
00229 }

EntnodeData::~EntnodeData ( ) [protected, virtual]

Definition at line 231 of file CvsEntries.cpp.

References DisposeStr(), fullpathname, and EntnodePath::UnRef().

00232 {
00233     DisposeStr(user);
00234
00235     if( fullpathname )
00236         fullpathname->UnRef();
00237 }

Member Function Documentation

int EntnodeData::Compare | ( | const EntnodeData & | node1,
 |  | const EntnodeData & | node2
 | ) | [inline, static]

Compare two nodes data

Parameters:
node1 | First node
node2 | Second node
Returns:
Less than zero if node1 is less than node2, zero if nodes are equal, more than zero if node2 is less than node1
Note:
For windows comparison is not case sensitive

Definition at line 301 of file CvsEntries.h.

References user.

Referenced by ENTNODE::Compare().

00302 {
00303 #ifdef WIN32
00304     return stricmp(node1.user, node2.user);
00305 #else /* !WIN32 */
00306     return strcmp(node1.user, node2.user);
00307 #endif /* !WIN32 */
00308 }

const char * EntnodeData::GetConflict ( ) const [inline, virtual]

Get the conflict marker.

Reimplemented in EntnodeFile.

Definition at line 413 of file CvsEntries.h.

Referenced by KoConflictColumn::Compare(), PyCvsEntry::GetAttr(), CBrowseFileView::GetImageForEntry(), KoConflictColumn::GetText(), and KoFilterModel::IsMatch().

00414 {
00415     return 0L;
00416 }

const char * EntnodeData::GetDesc ( ) const [inline]

Get the description.

Definition at line 389 of file CvsEntries.h.

References desc.

Referenced by PyCvsEntry::GetAttr(), TViewFill::InitItem(), and UCvsFiles::ResetView().

00390 {
00391     return desc;
00392 }

const char * EntnodeData::GetFolderPath ( ) const [inline]

Get the fully qualified folder name of the item.

Definition at line 407 of file CvsEntries.h.

References fullpathname, and EntnodePath::GetFolderPath().

00408 {
00409     return fullpathname->GetFolderPath();
00410 }

const char * EntnodeData::GetFullPathName ( UStr & resPath ) const [inline]

Get the fully qualified item name.

Definition at line 401 of file CvsEntries.h.

References fullpathname, and EntnodePath::GetFullPathName().

Referenced by CBrowseFileView::DoDrag(), CBrowseFileView::EditSel(), UCvsFiles::EditSel(), PyCvsEntry::GetAttr(), CTCLBrowserEnt::GetNormalized(), KoPathColumn::GetText(), CTCLBrowserEnt::IsSamePath(), UCvsFiles::OnCmdExplore(), CBrowseFileView::OnKeydown(), CBrowseFileView::OnViewExplore(), operator[](), CBrowseFileView::ProcessSelectionCommand(), UCvsFiles::ProcessSelectionCommand(), CBrowseFileView::ResetView(), and UCvsFiles::ResetView().

00402 {
00403     return fullpathname->GetFullPathName(resPath, user);
00404 }

const char * EntnodeData::GetName ( ) const [inline]

Get the item name.

Definition at line 395 of file CvsEntries.h.

References user.

Referenced by KoNameColumn::Compare(), PyCvsEntry::GetAttr(), KoPathColumn::GetText(), KoNameColumn::GetText(), and KoFilterModel::IsMatch().

00396 {
00397     return user;
00398 }

virtual ent_type EntnodeData::GetType ( ) const [pure virtual]

Get the entry type.

Implemented in EntnodeFile, and EntnodeFolder.

Referenced by _Compare(), CBrowseFileView::DoDrag(), CBrowseFileView::EditSel(), UCvsFiles::EditSel(), TViewFill::ExitDirectory(), PyCvsEntry::GetAttr(), CBrowseFileView::GetImageForEntry(), UCvsFiles::GetImageForEntry(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIEditseldef(), UCvsFiles::OnCmdUIGraph(), UCvsFiles::OnCmdUIRelease(), UCvsFiles::OnCmdUIRmv(), UCvsFiles::OnCmdUITrash(), UCvsFiles::OnCmdUIUpdate(), CBrowseFileView::OnEditSelectAll(), CWinCvsBrowser::OnItemexpanding(), CBrowseFileView::OnKeydown(), UCvsFolders::OnTreeExpanding(), CBrowseFileView::OnUpdateViewAdd(), CBrowseFileView::OnUpdateViewAddB(), CBrowseFileView::OnUpdateViewAnnotate(), CBrowseFileView::OnUpdateViewEditseldef(), CBrowseFileView::OnUpdateViewGraph(), CBrowseFileView::OnUpdateViewRelease(), CBrowseFileView::OnUpdateViewRmv(), CBrowseFileView::OnUpdateViewUpdate(), CBrowseFileView::OnViewExplore(), CBrowseFileView::ProcessSelectionCommand(), UCvsFiles::ProcessSelectionCommand(), CBrowseFileView::ResetView(), and tclCvsBrowserProc().

bool EntnodeData::IsIgnored ( ) const [inline]

Get the ignored flag.

Definition at line 353 of file CvsEntries.h.

References ignored.

Referenced by Entries_SetVisited(), PyCvsEntry::GetAttr(), GetIcon(), CBrowseFileView::GetImageForEntry(), UCvsFiles::GetImageForEntry(), TBrowserFill::OnDirectory(), TViewFill::OnDirectory(), TViewFill::OnFile(), and CHistComboBoxEx::SetIcon().

00354 {
00355     return 0 != ignored;
00356 }

bool EntnodeData::IsLocked ( ) const [inline]

Get the locked flag.

Definition at line 365 of file CvsEntries.h.

References locked.

Referenced by PyCvsEntry::GetAttr(), and TViewFill::InitItem().

00366 {
00367     return 0 != locked;
00368 }

bool EntnodeData::IsMissing ( ) const [inline]

Get the missing flag.

Definition at line 317 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(), and CHistComboBoxEx::SetIcon().

00318 {
00319     return 0 != missing;
00320 }

bool EntnodeData::IsRemoved ( ) const [inline]

Get the removed flag.

Definition at line 377 of file CvsEntries.h.

References removed.

Referenced by Entries_SetMissing(), PyCvsEntry::GetAttr(), CBrowseFileView::GetImageForEntry(), UCvsFiles::GetImageForEntry(), KoFilterModel::IsMatch(), UCvsFiles::OnCmdUIAdd(), UCvsFiles::OnCmdUIAddB(), UCvsFiles::OnCmdUIRmv(), CBrowseFileView::OnUpdateViewAdd(), CBrowseFileView::OnUpdateViewAddB(), and CBrowseFileView::OnUpdateViewRmv().

00378 {
00379     return 0 != removed;
00380 }

bool EntnodeData::IsUnknown ( ) const [inline]

Get the unknown flag.

Definition at line 341 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::OnUpdateViewAdd(), CBrowseFileView::OnUpdateViewAddB(), CBrowseFileView::OnUpdateViewAnnotate(), CBrowseFileView::OnUpdateViewGraph(), CBrowseFileView::OnUpdateViewRelease(), CBrowseFileView::OnUpdateViewRmv(), CBrowseFileView::OnUpdateViewUpdate(), and CHistComboBoxEx::SetIcon().

00342 {
00343     return 0 != unknown;
00344 }

bool EntnodeData::IsUnmodified ( ) const [inline]

Get the unmodified flag.

Definition at line 425 of file CvsEntries.h.

References unmodified.

Referenced by PyCvsEntry::GetAttr(), and KoFilterModel::IsMatch().

00426 {
00427     return 0 != unmodified;
00428 }

bool EntnodeData::IsVisited ( ) const [inline]

Get the visited flag.

Definition at line 329 of file CvsEntries.h.

References visited.

Referenced by Entries_SetMissing().

00330 {
00331     return 0 != visited;
00332 }

const char * EntnodeData::operator[] ( int index ) const [virtual]

Operator [].

Reimplemented in EntnodeFile, and EntnodeFolder.

Definition at line 240 of file CvsEntries.cpp.

References desc, GetFullPathName(), kName, kPath, kStatus, and user.

Referenced by EntnodeFolder::operator[](), and EntnodeFile::operator[]().

00241 {
00242     switch( index )
00243     {
00244     case kName:
00245         return user;
00246     case kStatus:
00247         return desc;
00248     case kPath:
00249         return GetFullPathName(sbuffer);
00250     default:
00251         break;
00252     }
00253
00254     return 0L;
00255 }

EntnodeData * EntnodeData::Ref ( ) [inline]

Increase reference count.

Definition at line 276 of file CvsEntries.h.

References ref.

Referenced by TBrowserFillDummy::ExitDirectory(), TViewFill::InitItem(), CWinCvsBrowser::OnItemexpanding(), UCvsFolders::OnTreeExpanding(), ENTNODE::operator=(), CGraphDoc::SetNode(), and UCvsGraph::UCvsGraph().

00277 {
00278     ++ref;
00279     return this;
00280 }

void EntnodeData::SetDesc ( const char * newdesc ) [inline]

Set the description.

Definition at line 383 of file CvsEntries.h.

References desc.

Referenced by Entries_SetMissing(), and Entries_SetVisited().

00384 {
00385     desc = newdesc;
00386 }

void EntnodeData::SetIgnored ( bool state ) [inline]

Set the ignored flag.

Definition at line 347 of file CvsEntries.h.

References ignored.

Referenced by Entries_SetVisited().

00348 {
00349     ignored = state;
00350 }

void EntnodeData::SetLocked ( bool state ) [inline]

Set the locked flag.

Definition at line 359 of file CvsEntries.h.

References locked.

00360 {
00361     locked = state;
00362 }

void EntnodeData::SetMissing ( bool state ) [inline]

Set the missing flag.

Definition at line 311 of file CvsEntries.h.

References missing.

Referenced by Entries_SetMissing().

00312 {
00313     missing = state;
00314 }

void EntnodeData::SetRemoved ( bool state ) [inline]

Set the removed flag.

Definition at line 371 of file CvsEntries.h.

References removed.

Referenced by EntnodeFile::EntnodeFile().

00372 {
00373     removed = state;
00374 }

void EntnodeData::SetUnknown ( bool state ) [inline]

Set the unknown flag.

Definition at line 335 of file CvsEntries.h.

References unknown.

Referenced by Entries_SetVisited().

00336 {
00337     unknown = state;
00338 }

void EntnodeData::SetUnmodified ( bool state ) [inline]

Set the unmodified flag.

Definition at line 419 of file CvsEntries.h.

References unmodified.

00420 {
00421     unmodified = state;
00422 }

void EntnodeData::SetVisited ( bool state ) [inline]

Set the visited flag.

Definition at line 323 of file CvsEntries.h.

References visited.

Referenced by Entries_SetVisited().

00324 {
00325     visited = state;
00326 }

EntnodeData * EntnodeData::UnRef ( ) [inline]

Decrease reference count, delete self if reference count reached zero.

Definition at line 283 of file CvsEntries.h.

References ref.

Referenced by CGraphDoc::Clear(), CWinCvsBrowser::DeleteAllItems(), UCvsFolders::DeleteAllItems(), Entries_Open(), Entries_SetVisited(), TBrowserFillDummy::ExitDirectory(), UCvsFolders::OnCmdMacrosSel(), CBrowseFileView::OnDeleteitem(), CWinCvsBrowser::OnUpdateMacro(), ENTNODE::operator=(), ENTNODE::~ENTNODE(), and UCvsGraph::~UCvsGraph().

00284 {
00285     if( --ref == 0 )
00286     {
00287         delete this;
00288         return 0L;
00289     }
00290
00291     return this;
00292 }

Member Data Documentation

const char* EntnodeData::desc [private]

Item's description

Definition at line 144 of file CvsEntries.h.

Referenced by GetDesc(), operator[](), and SetDesc().

EntnodePath* EntnodeData::fullpathname [private]

Fully qualified pathname of the folder containing the item

Definition at line 145 of file CvsEntries.h.

Referenced by EntnodeData(), GetFolderPath(), GetFullPathName(), and ~EntnodeData().

int EntnodeData::ignored [protected]

Ignored flag

Definition at line 134 of file CvsEntries.h.

Referenced by IsIgnored(), and SetIgnored().

int EntnodeData::locked [protected]

Locked flag

Definition at line 135 of file CvsEntries.h.

Referenced by IsLocked(), and SetLocked().

int EntnodeData::missing [protected]

Missing flag

Definition at line 130 of file CvsEntries.h.

Referenced by IsMissing(), and SetMissing().

int EntnodeData::ref [protected]

Reference counter

Definition at line 128 of file CvsEntries.h.

Referenced by Ref(), and UnRef().

int EntnodeData::removed [protected]

Removed flag

Definition at line 136 of file CvsEntries.h.

Referenced by IsRemoved(), and SetRemoved().

UStr EntnodeData::sbuffer [static, private]

Static buffer

Definition at line 210 of file CvsEntries.cpp.

int EntnodeData::unknown [protected]

Unknown flag

Definition at line 132 of file CvsEntries.h.

Referenced by IsUnknown(), and SetUnknown().

int EntnodeData::unmodified [protected]

Unmodified flag

Definition at line 133 of file CvsEntries.h.

Referenced by IsUnmodified(), and SetUnmodified().

const char* EntnodeData::user [private]

Name of this item

Definition at line 143 of file CvsEntries.h.

Referenced by Compare(), EntnodeData(), GetName(), and operator[]().

int EntnodeData::visited [protected]

Visited flag

Definition at line 131 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 Fri Jan 31 12:15:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
}
Enum file node types. More...

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
Operator [] to access fields.

virtual ent_type | GetType () const
Get the type.

virtual const char * | GetConflict () const
Get the conflict marker.

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

Detailed Description

Abstract class to hold the file node data
Note:
Reference-counted, we don't use delete on it

Definition at line 154 of file CvsEntries.h.

Member Enumeration Documentation

anonymous enum

Enum file node types.

Enumeration values:
kVN
kTS
kOption
kTag
kConflict

Definition at line 167 of file CvsEntries.h.

00168     {
00169         kVN = 1,
00170         kTS = 5,
00171         kOption = 2,
00172         kTag = 4,
00173         kConflict = 6
00174     };

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 260 of file CvsEntries.cpp.

References CloneStr(), date, EntnodeData::SetRemoved(), tag, ts, ts_conflict, and vn.

00262                                                                        : EntnodeData(name, path)
00263 {
00264     vn = 0L;
00265     ts = 0L;
00266     option = 0L;
00267     tag = 0L;
00268     date = 0L;
00269     ts_conflict = 0L;
00270
00271     vn = CloneStr(newvn);
00272     ts = CloneStr(newts);
00273     option = CloneStr(newoptions);
00274     tag = CloneStr(newtag);
00275     date = CloneStr(newdate);
00276     ts_conflict = CloneStr(newts_conflict);
00277
00278     if( newvn != 0L && newvn[0] == '-' )
00279         SetRemoved(true);
00280 }

EntnodeFile::~EntnodeFile ( ) [protected, virtual]

Definition at line 282 of file CvsEntries.cpp.

References DisposeStr().

00283 {
00284     DisposeStr(vn);
00285     DisposeStr(ts);
00286     DisposeStr(option);
00287     DisposeStr(tag);
00288     DisposeStr(date);
00289     DisposeStr(ts_conflict);
00290 }

Member Function Documentation

const char * EntnodeFile::GetConflict ( ) const [virtual]

Get the conflict marker.

Reimplemented from EntnodeData.

Definition at line 321 of file CvsEntries.cpp.

References ts_conflict.

00322 {
00323     return ts_conflict;
00324 }

ent_type EntnodeFile::GetType ( ) const [virtual]

Get the type.

Implements EntnodeData.

Definition at line 315 of file CvsEntries.cpp.

References ENT_FILE, and ent_type.

00316 {
00317     return ENT_FILE;
00318 }

const char * EntnodeFile::operator[] ( int index ) const [virtual]

Operator [] to access fields.

Reimplemented from EntnodeData.

Definition at line 293 of file CvsEntries.cpp.

References date, kConflict, kOption, kTag, kTS, kVN, EntnodeData::operator[](), tag, ts, ts_conflict, and vn.

00294 {
00295     switch( index )
00296     {
00297     case kVN:
00298         return vn;
00299     case kTS:
00300         return ts;
00301     case kOption:
00302         return option;
00303     case kTag:
00304         return tag != 0L ? tag : date;
00305     case kConflict:
00306         return ts_conflict;
00307     default:
00308         break;
00309     }
00310
00311     return EntnodeData::operator[](index);
00312 }

Member Data Documentation

const char* EntnodeFile::date [protected]

Date, can be NULL

Definition at line 187 of file CvsEntries.h.

Referenced by EntnodeFile(), and operator[]().

const char* EntnodeFile::option [protected]

Option

Definition at line 185 of file CvsEntries.h.

const char* EntnodeFile::tag [protected]

Tag, can be NULL

Definition at line 186 of file CvsEntries.h.

Referenced by EntnodeFile(), and operator[]().

const char* EntnodeFile::ts [protected]

Timestamp

Definition at line 184 of file CvsEntries.h.

Referenced by EntnodeFile(), and operator[]().

const char* EntnodeFile::ts_conflict [protected]

Conflict, can be NULL

Definition at line 188 of file CvsEntries.h.

Referenced by EntnodeFile(), GetConflict(), and operator[]().

const char* EntnodeFile::vn [protected]

Revision

Definition at line 183 of file CvsEntries.h.

Referenced by EntnodeFile(), and operator[]().

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Fri Jan 31 12:15:57 2003 for WinCvs Source by doxygen 1.3-rc2


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
Operator [] to access fields.

virtual ent_type | GetType () const
Get the type.

Protected Methods

virtual | ~EntnodeFolder ()

Detailed Description

Abstract class to hold the folder node data
Note:
Reference-counted, we don't use delete on it

Definition at line 195 of file CvsEntries.h.

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 329 of file CvsEntries.cpp.

00331                                                                        : EntnodeData(name, path)
00332 {
00333 }

EntnodeFolder::~EntnodeFolder ( ) [protected, virtual]

Definition at line 335 of file CvsEntries.cpp.

00336 {
00337 }

Member Function Documentation

ent_type EntnodeFolder::GetType ( ) const [virtual]

Get the type.

Implements EntnodeData.

Definition at line 346 of file CvsEntries.cpp.

References ENT_SUBDIR, and ent_type.

00347 {
00348     return ENT_SUBDIR;
00349 }

const char * EntnodeFolder::operator[] ( int index ) const [virtual]

Operator [] to access fields.

Reimplemented from EntnodeData.

Definition at line 340 of file CvsEntries.cpp.

References EntnodeData::operator[]().

00341 {
00342     return EntnodeData::operator[](index);
00343 }

The documentation for this class was generated from the following files:
  • common/CvsEntries.h
  • common/CvsEntries.cpp
Generated on Fri Jan 31 12:15:58 2003 for WinCvs Source by doxygen 1.3-rc2


EntnodePath Class Reference

#include <CvsEntries.h>

Collaboration diagram for EntnodePath:

[legend]
List of all members.

Public Methods

EntnodePath (const char *path)
EntnodePath * | Ref ()
Increase reference count.

EntnodePath * | UnRef ()
Decrease reference count, delete self if reference count reached zero.

const char * | GetFullPathName (UStr &resPath, const char *name) const
const char * | GetFolderPath () const

Protected Methods

virtual | ~EntnodePath ()

Protected Attributes

const char * | fullpathname
int | ref

Detailed Description

Class to support reference counted full path description
Note:
Reference-counted, we don't use delete on it

Definition at line 46 of file CvsEntries.h.

Constructor & Destructor Documentation

EntnodePath::EntnodePath ( const char * path )

Definition at line 180 of file CvsEntries.cpp.

References CloneStr(), and fullpathname.

00180                                          : fullpathname(0L), ref(1)
00181 {
00182     fullpathname = CloneStr(path);
00183 }

EntnodePath::~EntnodePath ( ) [protected, virtual]

Definition at line 185 of file CvsEntries.cpp.

References DisposeStr().

00186 {
00187     DisposeStr(fullpathname);
00188 }

Member Function Documentation

const char * EntnodePath::GetFolderPath ( ) const [inline]

Get the folder path

Returns:
Folder path

Definition at line 267 of file CvsEntries.h.

References fullpathname.

Referenced by EntnodeData::GetFolderPath().

00268 {
00269     return fullpathname;
00270 }

const char * EntnodePath::GetFullPathName | ( | UStr & | resPath,
 |  | const char * | name
 | ) | const

Get the full path for a given name

Parameters:
resPath | Return full path
name | File name
Returns:
Full path

Definition at line 196 of file CvsEntries.cpp.

References UStr::endsWith(), and fullpathname.

Referenced by EntnodeData::GetFullPathName().

00197 {
00198     resPath = fullpathname;
00199     if( !resPath.endsWith(kPathDelimiter) )
00200         resPath << kPathDelimiter;
00201
00202     resPath << name;
00203
00204     return resPath;
00205 }

EntnodePath * EntnodePath::Ref ( ) [inline]

Increase reference count.

Definition at line 245 of file CvsEntries.h.

References ref.

Referenced by EntnodeData::EntnodeData().

00246 {
00247     ++ref;
00248     return this;
00249 }

EntnodePath * EntnodePath::UnRef ( ) [inline]

Decrease reference count, delete self if reference count reached zero.

Definition at line 252 of file CvsEntries.h.

References ref.

Referenced by Entries_SetVisited(), GetNextEntriesLine(), UCvsFolders::OnCmdMacrosSel(), CWinCvsBrowser::OnUpdateMacro(), and EntnodeData::~EntnodeData().

00253 {
00254     if( --ref == 0 )
00255     {
00256         delete this;
00257         return 0L;
00258     }
00259
00260     return this;
00261 }

Member Data Documentation

const char* EntnodePath::fullpathname [protected]

Fully qualified pathname of the folder containing the item

Definition at line 63 of file CvsEntries.h.

Referenced by EntnodePath(), GetFolderPath(), and GetFullPathName().

int EntnodePath::ref [protected]

Reference count

Definition at line 64 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 Fri Jan 31 12:15:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 127 of file ExploreBar.cpp.

00128 {
00129 }

CExploreBar::~CExploreBar ( ) [protected, virtual]

Definition at line 131 of file ExploreBar.cpp.

00132 {
00133 }

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 172 of file ExploreBar.cpp.

References FALSE, and m_TreeCtrl.

00173 {
00174     BOOL res = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
00175
00176     if(res)
00177     {
00178         if (!m_TreeCtrl.Create(
00179             WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
00180             CRect(0,0,0,0), this, IDC_BAR_TREE))
00181         {
00182             TRACE0("Unable to create caption button.\n");
00183             return FALSE;
00184         }
00185     }
00186
00187     //m_TreeCtrl.EnableImages();
00188     //m_TreeCtrl.PopulateTree();
00189
00190     //SetChild(&m_TreeCtrl);
00191
00192     return res;
00193 }

bool CExploreBar::DisableCommon ( ) [protected]

Definition at line 222 of file ExploreBar.cpp.

References CWincvsApp::IsCvsRunning().

Referenced by OnUpdateCmd().

00223 {
00224     CWincvsApp *app = (CWincvsApp *)AfxGetApp();
00225     return app->IsCvsRunning() || gCvsPrefs.empty();
00226 }

void CExploreBar::OnDraw ( CDC * pDC ) [protected, virtual]

Definition at line 149 of file ExploreBar.cpp.

00150 {
00151     CDocument* pDoc = GetDocument();
00152 }

void CExploreBar::OnUpdateCmd ( CCmdUI * pCmdUI ) [protected]

Definition at line 204 of file ExploreBar.cpp.

References DisableCommon(), and m_TreeCtrl.

Referenced by OnUpdateViewCheckout(), and OnUpdateViewImport().

00205 {
00206     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00207     if(DisableCommon())
00208     {
00209         pCmdUI->Enable(FALSE);
00210         return;
00211     }
00212     CString folderPath;
00213     if(!m_TreeCtrl.GetSelectedFolderPath(folderPath) || folderPath.IsEmpty())
00214     {
00215         pCmdUI->Enable(FALSE);
00216         return;
00217     }
00218
00219     pCmdUI->Enable(TRUE);
00220 }

void CExploreBar::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

Definition at line 238 of file ExploreBar.cpp.

References OnUpdateCmd().

00239 {
00240     OnUpdateCmd(pCmdUI);
00241     pCmdUI->SetText("Chec&kout module to selection...");
00242 }

void CExploreBar::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

Definition at line 254 of file ExploreBar.cpp.

References OnUpdateCmd().

00255 {
00256     OnUpdateCmd(pCmdUI);
00257     pCmdUI->SetText("&Import module from selection...");
00258 }

void CExploreBar::OnViewCheckout ( ) [protected]

Definition at line 228 of file ExploreBar.cpp.

References m_TreeCtrl, and KoCheckoutHandler::OnFolder().

00229 {
00230     CString folderPath;
00231     if( m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty() )
00232     {
00233         KoCheckoutHandler handler;
00234         handler.OnFolder(folderPath);
00235     }
00236 }

void CExploreBar::OnViewImport ( ) [protected]

Definition at line 244 of file ExploreBar.cpp.

References m_TreeCtrl, and KoImportHandler::OnFolder().

00245 {
00246     CString folderPath;
00247     if( m_TreeCtrl.GetSelectedFolderPath(folderPath) && !folderPath.IsEmpty() )
00248     {
00249         KoImportHandler handler;
00250         handler.OnFolder(folderPath);
00251     }
00252 }

void CExploreBar::OnWindowPosChanged ( WINDOWPOS FAR * lpwndpos ) [protected]

Definition at line 195 of file ExploreBar.cpp.

References m_TreeCtrl.

00196 {
00197     CView::OnWindowPosChanged(wp);
00198
00199     CRect r;
00200     GetClientRect(&r);
00201     m_TreeCtrl.SetWindowPos(NULL, r.left, r.top, r.Width(), r.Height(), SWP_NOZORDER);
00202 }

Member Data Documentation

CMyShellTree CExploreBar::m_TreeCtrl

Definition at line 60 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 Fri Jan 31 12:15:59 2003 for WinCvs Source by doxygen 1.3-rc2


CFileDialog Class Reference

Inheritance diagram for CFileDialog:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/MfFileDialog.h
Generated on Fri Jan 31 12:16:00 2003 for WinCvs Source by doxygen 1.3-rc2


FileEntry Class Reference

Used internally. More...

#include <MultiFiles.h>

Collaboration diagram for FileEntry:

[legend]
List of all members.

Public Methods

FileEntry ()
FileEntry (const char *filename, const FSSpec *macspec=0L, const char *currRevision=0L)
FileEntry (const FileEntry &entry)
FileEntry & | operator= (const FileEntry &entry)

Protected Attributes

UStr file
UStr currRev
FSSpec spec

Friends

class | MultiFilesEntry
class | MultiFiles

Detailed Description

Used internally.

Definition at line 40 of file MultiFiles.h.

Constructor & Destructor Documentation

FileEntry::FileEntry ( )

Definition at line 52 of file MultiFiles.cpp.

00053 {
00054 }

FileEntry::FileEntry | ( | const char * | filename,
 |  | const FSSpec * | macspec = 0L,
 |  | const char * | currRevision = 0L
 | ) |

Definition at line 56 of file MultiFiles.cpp.

References currRev, file, and spec.

00057 {
00058     file = filename;
00059
00060     if( currRevision != 0L )
00061         currRev = currRevision;
00062
00063     if( macspec != 0L )
00064         spec = *macspec;
00065 }

FileEntry::FileEntry ( const FileEntry & entry )

Definition at line 67 of file MultiFiles.cpp.

00068 {
00069     *this = entry;
00070 }

Member Function Documentation

FileEntry & FileEntry::operator= ( const FileEntry & entry )

Definition at line 72 of file MultiFiles.cpp.

References currRev, file, and spec.

00073 {
00074     file = entry.file;
00075     currRev = entry.currRev;
00076     spec = entry.spec;
00077     return *this;
00078 }

Friends And Related Function Documentation

friend class MultiFiles [friend]

Definition at line 55 of file MultiFiles.h.

friend class MultiFilesEntry [friend]

Definition at line 54 of file MultiFiles.h.

Member Data Documentation

UStr FileEntry::currRev [protected]

Definition at line 51 of file MultiFiles.h.

Referenced by FileEntry(), and operator=().

UStr FileEntry::file [protected]

Definition at line 50 of file MultiFiles.h.

Referenced by FileEntry(), and operator=().

FSSpec FileEntry::spec [protected]

Definition at line 52 of file MultiFiles.h.

Referenced by FileEntry(), and operator=().

The documentation for this class was generated from the following files:
  • common/MultiFiles.h
  • common/MultiFiles.cpp
Generated on Fri Jan 31 12:16:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 294 of file PythonGlue.cpp.

00294                                                  :
00295         m_entries(entries) {}

virtual CFillPyEntries::~CFillPyEntries ( ) [inline, virtual]

Definition at line 297 of file PythonGlue.cpp.

00297 {}

Member Function Documentation

virtual kTraversal CFillPyEntries::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 299 of file PythonGlue.cpp.

References BuildIgnoredList(), Entries_Open(), kContinueTraversal, and kTraversal.

00300     {
00301         Entries_Open (m_entries, fullpath);
00302         BuildIgnoredList(m_ignlist, fullpath);
00303         return kContinueTraversal;
00304     }

virtual kTraversal CFillPyEntries::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 306 of file PythonGlue.cpp.

References kContinueTraversal, and kTraversal.

00307     {
00308         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00309         return kContinueTraversal;
00310     }

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 339 of file PythonGlue.cpp.

References kTraversal, and OnFile().

00343     {
00344         return OnFile(fullpath, fullname, name, dir, macspec);
00345     }

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 322 of file PythonGlue.cpp.

References Entries_SetVisited(), kSkipFile, and kTraversal.

00326     {
00327 #if defined(WIN32) || defined(TARGET_OS_MAC)
00328         if(stricmp(name, "CVS") == 0)
00329 #else
00330         if(strcmp(name, "CVS") == 0)
00331 #endif
00332             return kSkipFile;
00333
00334         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00335
00336         return kSkipFile;
00337     }

virtual kTraversal CFillPyEntries::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 312 of file PythonGlue.cpp.

References kTraversal, and kTraversalError.

00313     {
00314         return kTraversalError;
00315     }

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 347 of file PythonGlue.cpp.

References Entries_SetVisited(), kContinueTraversal, and kTraversal.

Referenced by OnAlias().

00351     {
00352         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00353
00354         return kContinueTraversal;
00355     }

virtual kTraversal CFillPyEntries::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 317 of file PythonGlue.cpp.

References kContinueTraversal, and kTraversal.

00318     {
00319         return kContinueTraversal;
00320     }

Member Data Documentation

CSortList<ENTNODE>& CFillPyEntries::m_entries

Definition at line 291 of file PythonGlue.cpp.

std::vector< UStr > CFillPyEntries::m_ignlist

Definition at line 292 of file PythonGlue.cpp.

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Fri Jan 31 12:16:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 556 of file TclGlue.cpp.

00556                                                   :
00557         m_entries(entries) {}

virtual CFillTclEntries::~CFillTclEntries ( ) [inline, virtual]

Definition at line 559 of file TclGlue.cpp.

00559 {}

Member Function Documentation

virtual kTraversal CFillTclEntries::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 561 of file TclGlue.cpp.

References BuildIgnoredList(), Entries_Open(), kContinueTraversal, and kTraversal.

00562     {
00563         Entries_Open (m_entries, fullpath);
00564         BuildIgnoredList(m_ignlist, fullpath);
00565         return kContinueTraversal;
00566     }

virtual kTraversal CFillTclEntries::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 568 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00569     {
00570         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00571         return kContinueTraversal;
00572     }

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 601 of file TclGlue.cpp.

References kTraversal, and OnFile().

00605     {
00606         return OnFile(fullpath, fullname, name, dir, macspec);
00607     }

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 584 of file TclGlue.cpp.

References Entries_SetVisited(), kSkipFile, and kTraversal.

00588     {
00589 #if defined(WIN32) || defined(TARGET_OS_MAC)
00590         if(stricmp(name, "CVS") == 0)
00591 #else
00592         if(strcmp(name, "CVS") == 0)
00593 #endif
00594             return kSkipFile;
00595
00596         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00597
00598         return kSkipFile;
00599     }

virtual kTraversal CFillTclEntries::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 574 of file TclGlue.cpp.

References kTraversal, and kTraversalError.

00575     {
00576         return kTraversalError;
00577     }

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 609 of file TclGlue.cpp.

References Entries_SetVisited(), kContinueTraversal, and kTraversal.

Referenced by OnAlias().

00613     {
00614         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00615
00616         return kContinueTraversal;
00617     }

virtual kTraversal CFillTclEntries::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 579 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00580     {
00581         return kContinueTraversal;
00582     }

Member Data Documentation

CSortList<ENTNODE>& CFillTclEntries::m_entries

Definition at line 553 of file TclGlue.cpp.

std::vector< UStr > CFillTclEntries::m_ignlist

Definition at line 554 of file TclGlue.cpp.

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Fri Jan 31 12:16:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 992 of file Persistent.cpp.

References UStr::endsWith(), UStr::length(), m_list, and m_pathToFind.

00992                                         : m_pathToFind(findPath), m_list(0L)
00993     {
00994         if( m_pathToFind.endsWith(kPathDelimiter) )
00995             m_pathToFind[m_pathToFind.length() - 1] = '\0';
00996     }

CFindSettings::CFindSettings ( std::map< UStr, UStr > & list ) [inline]

Definition at line 998 of file Persistent.cpp.

References m_list.

00998                                             : m_list(&list)
00999     {
01000     }

virtual CFindSettings::~CFindSettings ( ) [inline, virtual]

Definition at line 1002 of file Persistent.cpp.

01002 {}

Member Function Documentation

virtual kTraversal CFindSettings::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 1004 of file Persistent.cpp.

References cvs_err(), kTraversal, and kTraversalError.

01005     {
01006         cvs_err(err);
01007         cvs_err("\n");
01008         return kTraversalError;
01009     }

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 1063 of file Persistent.cpp.

References kContinueTraversal, kStopTraversal, kTraversal, loadSettingsInternal(), m_foundIt, m_list, and m_settingsFile.

01067 {
01068     m_foundIt = false;
01069
01070     if( m_list == 0L )
01071     {
01072         loadSettingsInternal(fullname, searchPath, this);
01073     }
01074     else
01075     {
01076         m_settingsFile = fullname;
01077         loadSettingsInternal(fullname, searchAllPath, this);
01078     }
01079
01080     if( m_foundIt )
01081         m_settingsFile = fullname;
01082
01083     return m_foundIt ? kStopTraversal : kContinueTraversal;
01084 }

bool CFindSettings::searchAllPath | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 1048 of file Persistent.cpp.

References getSettingName(), m_list, and m_settingsFile.

01049 {
01050     CFindSettings *loader = (CFindSettings*)data;
01051     if( strcmp(token, "PATH") == 0 )
01052     {
01053         getSettingName(loader->m_settingsFile, loader->m_settingsFile);
01054         std::map<UStr, UStr>::value_type v(loader->m_settingsFile, UStr(value));
01055         loader->m_list->insert(v);
01056
01057         return true;
01058     }
01059
01060     return false;
01061 }

bool CFindSettings::searchPath | ( | const char * | token,
 |  | const char * | value,
 |  | void * | data
 | ) | [static]

Definition at line 1026 of file Persistent.cpp.

References m_foundIt, m_pathToFind, and m_topfolder.

01027 {
01028     CFindSettings* loader = (CFindSettings*)data;
01029     // if we give a sub-folder to look for, it will return the
01030     // top folder's settings
01031     if( strcmp(token, "PATH") == 0 &&
01032 #if qUnix
01033         strcmp(value, loader->m_pathToFind) == 0
01034 #else
01035         stricmp(value, loader->m_pathToFind) == 0
01036 #endif
01037         )
01038     {
01039         loader->m_foundIt = true;
01040         loader->m_topfolder = value;
01041
01042         return true;
01043     }
01044
01045     return false;
01046 }

Member Data Documentation

bool CFindSettings::m_foundIt

Definition at line 1021 of file Persistent.cpp.

Referenced by OnFile(), and searchPath().

std::map<UStr, UStr>* CFindSettings::m_list

Definition at line 1023 of file Persistent.cpp.

Referenced by CFindSettings(), OnFile(), and searchAllPath().

UStr CFindSettings::m_pathToFind

Definition at line 1019 of file Persistent.cpp.

Referenced by CFindSettings(), and searchPath().

UStr CFindSettings::m_settingsFile

Definition at line 1020 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings(), HasPersistentSettings(), LoadPersistentSettings(), OnFile(), SavePersistentSettings(), and searchAllPath().

UStr CFindSettings::m_topfolder

Definition at line 1022 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 Fri Jan 31 12:16:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 62 of file GetPassword.cpp.

References m_passwd.

00063     : CDialog(GetPassword::IDD, pParent)
00064 {
00065     //{{AFX_DATA_INIT(GetPassword)
00066     m_passwd = _T("");
00067     //}}AFX_DATA_INIT
00068 }

Member Function Documentation

void GetPassword::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 71 of file GetPassword.cpp.

00072 {
00073     CDialog::DoDataExchange(pDX);
00074     //{{AFX_DATA_MAP(GetPassword)
00075     DDX_Text(pDX, IDC_PASSWD, m_passwd);
00076     //}}AFX_DATA_MAP
00077 }

BOOL GetPassword::OnInitDialog ( ) [protected, virtual]

Definition at line 88 of file GetPassword.cpp.

References TRUE.

00089 {
00090     CDialog::OnInitDialog();
00091
00092     // Extra initialization here
00093
00094     //force the window to the foreground in case it was covered by terminal or DOS box
00095     if( !IsWindowVisible() )
00096     {
00097         SetForegroundWindow();
00098     }
00099
00100     return TRUE;  // return TRUE unless you set the focus to a control
00101     // EXCEPTION: OCX Property Pages should return FALSE
00102 }

Member Data Documentation

CString GetPassword::m_passwd

Definition at line 46 of file GetPassword.h.

Referenced by CompatGetPassword(), and GetPassword().

The documentation for this class was generated from the following files:
  • common/GetPassword.h
  • common/GetPassword.cpp
Generated on Fri Jan 31 12:16:05 2003 for WinCvs Source by doxygen 1.3-rc2


CGetPrefs_CVS Class Reference

CVS preferences property page. More...

#include <GetPrefs.h>

Inheritance diagram for CGetPrefs_CVS:

[legend]
Collaboration diagram for CGetPrefs_CVS:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PREFS_CVS }

Public Methods

CGetPrefs_CVS ()
~CGetPrefs_CVS ()
void | StoreValues ()
Save the values.

Public Attributes

CEdit m_altCvsEdit
CButton m_selAltCvsButton
CButton m_useAltCvsCheck
CEdit m_homeEdit
CString | m_home
BOOL | m_useAltCvs
CString | m_altCvs

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnhome ()
BN_CLICKED message handler, change HOME directory.

afx_msg void | OnAltcvschk ()
BN_CLICKED message handler, enable to change alternate cvs executable.

afx_msg void | OnAltcvssel ()
BN_CLICKED message handler, change alternate cvs executable.

Protected Attributes

bool | m_didInteract

Detailed Description

CVS preferences property page.

Definition at line 212 of file GetPrefs.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 223 of file GetPrefs.h.

00223 { IDD = IDD_PREFS_CVS };

Constructor & Destructor Documentation

CGetPrefs_CVS::CGetPrefs_CVS ( )

Definition at line 631 of file GetPrefs.cpp.

References m_altCvs, m_home, and m_useAltCvs.

00631                              : CPropertyPage(CGetPrefs_CVS::IDD), m_didInteract(false)
00632 {
00633     UStr cvsPath;
00634     //{{AFX_DATA_INIT(CGetPrefs_CVS)
00635     m_home = gCvsPrefs.Home() != 0L ? gCvsPrefs.Home() : "";
00636     m_useAltCvs = gCvsPrefs.WhichCvs(cvsPath, true) != 0L;
00637     m_altCvs = gCvsPrefs.WhichCvs(cvsPath);
00638     //}}AFX_DATA_INIT
00639 }

CGetPrefs_CVS::~CGetPrefs_CVS ( )

Definition at line 641 of file GetPrefs.cpp.

00642 {
00643 }

Member Function Documentation

void CGetPrefs_CVS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 645 of file GetPrefs.cpp.

References DDV_CheckPathExists(), m_didInteract, and OnAltcvschk().

00646 {
00647     m_didInteract = true;
00648
00649     CPropertyPage::DoDataExchange(pDX);
00650
00651     //{{AFX_DATA_MAP(CGetPrefs_CVS)
00652     DDX_Control(pDX, IDC_ALTCVSPROG, m_altCvsEdit);
00653     DDX_Control(pDX, IDC_ALTCVSSEL, m_selAltCvsButton);
00654     DDX_Control(pDX, IDC_ALTCVSCHK, m_useAltCvsCheck);
00655     DDX_Control(pDX, IDC_HOME, m_homeEdit);
00656     DDX_Text(pDX, IDC_HOME, m_home);
00657     DDX_Check(pDX, IDC_ALTCVSCHK, m_useAltCvs);
00658     DDX_Text(pDX, IDC_ALTCVSPROG, m_altCvs);
00659     //}}AFX_DATA_MAP
00660
00661     DDV_CheckPathExists(pDX, IDC_HOME, m_home);
00662
00663     if( !pDX->m_bSaveAndValidate )
00664     {
00665         OnAltcvschk();
00666     }
00667 }

void CGetPrefs_CVS::OnAltcvschk ( ) [protected]

BN_CLICKED message handler, enable to change alternate cvs executable.

Definition at line 701 of file GetPrefs.cpp.

References m_altCvsEdit, m_selAltCvsButton, and m_useAltCvsCheck.

Referenced by DoDataExchange().

00702 {
00703     m_altCvsEdit.EnableWindow(m_useAltCvsCheck.GetCheck() != 0);
00704     m_selAltCvsButton.EnableWindow(m_useAltCvsCheck.GetCheck() != 0);
00705 }

void CGetPrefs_CVS::OnAltcvssel ( ) [protected]

BN_CLICKED message handler, change alternate cvs executable.

Definition at line 708 of file GetPrefs.cpp.

References CvsArgs::Argv(), MultiFiles::begin(), BrowserGetMultiFiles(), CStr, m_altCvsEdit, MultiFiles::newdir(), MultiFiles::newfile(), and SplitPath().

00709 {
00710     MultiFiles mf;
00711
00712     CString altCvs;
00713     m_altCvsEdit.GetWindowText(altCvs);
00714
00715     if( !altCvs.IsEmpty() )
00716     {
00717         CStr uppath;
00718         CStr file;
00719
00720         if( SplitPath(altCvs, uppath, file) )
00721         {
00722             mf.newdir(uppath);
00723             mf.newfile(file);
00724         }
00725     }
00726
00727     if( !BrowserGetMultiFiles("Select the cvs client application", mf, true, kSelectExecutable) )
00728         return;
00729
00730     CvsArgs args(false);
00731
00732     const char* dir = (*mf.begin()).add(args);
00733     char* const* argv = args.Argv();
00734
00735     CStr fullpath;
00736     fullpath = dir;
00737
00738     if( !fullpath.endsWith(kPathDelimiter) )
00739         fullpath << kPathDelimiter;
00740
00741     fullpath << argv[0];
00742
00743     m_altCvsEdit.SetWindowText(fullpath);
00744 }

void CGetPrefs_CVS::OnBtnhome ( ) [protected]

BN_CLICKED message handler, change HOME directory.

Definition at line 688 of file GetPrefs.cpp.

References BrowserGetDirectory(), CStr, and m_homeEdit.

00689 {
00690     CString strHome;
00691     m_homeEdit.GetWindowText(strHome);
00692
00693     CStr home(strHome);
00694     if( BrowserGetDirectory("Select the HOME directory", home, IsWindow(m_hWnd) ? this : NULL) )
00695     {
00696         m_homeEdit.SetWindowText(home);
00697     }
00698 }

void CGetPrefs_CVS::StoreValues ( )

Save the values.

Definition at line 670 of file GetPrefs.cpp.

References m_altCvs, and m_didInteract.

Referenced by CompatGetPrefs().

00671 {
00672     if( !m_didInteract )
00673         return;
00674
00675     gCvsPrefs.SetHome(m_home);
00676     gCvsPrefs.SetWhichCvs(m_useAltCvs && !m_altCvs.IsEmpty() ? (LPCTSTR)m_altCvs : "");
00677 }

Member Data Documentation

CString CGetPrefs_CVS::m_altCvs

Definition at line 230 of file GetPrefs.h.

Referenced by CGetPrefs_CVS(), and StoreValues().

CEdit CGetPrefs_CVS::m_altCvsEdit

Definition at line 224 of file GetPrefs.h.

Referenced by OnAltcvschk(), and OnAltcvssel().

bool CGetPrefs_CVS::m_didInteract [protected]

Flag indicating data change

Definition at line 243 of file GetPrefs.h.

Referenced by DoDataExchange(), and StoreValues().

CString CGetPrefs_CVS::m_home

Definition at line 228 of file GetPrefs.h.

Referenced by CGetPrefs_CVS().

CEdit CGetPrefs_CVS::m_homeEdit

Definition at line 227 of file GetPrefs.h.

Referenced by OnBtnhome().

CButton CGetPrefs_CVS::m_selAltCvsButton

Definition at line 225 of file GetPrefs.h.

Referenced by OnAltcvschk().

BOOL CGetPrefs_CVS::m_useAltCvs

Definition at line 229 of file GetPrefs.h.

Referenced by CGetPrefs_CVS().

CButton CGetPrefs_CVS::m_useAltCvsCheck

Definition at line 226 of file GetPrefs.h.

Referenced by OnAltcvschk().

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Fri Jan 31 12:16:06 2003 for WinCvs Source by doxygen 1.3-rc2


CGetPrefs_CVSCMD_DIALOGS Class Reference

Command dialogs preferences property page. More...

#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 ()
Save the values.

Public Attributes

BOOL | m_hideUpdate
BOOL | m_hideDiff
BOOL | m_hideGraph
BOOL | m_hideLog
int | m_keyForce
BOOL | m_hideAnnotate
BOOL | m_hideStatus

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Protected Attributes

bool | m_didInteract

Detailed Description

Command dialogs preferences property page.

Definition at line 258 of file GetPrefs.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 271 of file GetPrefs.h.

00271 { IDD = IDD_PREFS_CVSCMD_DIALOGS };

Constructor & Destructor Documentation

CGetPrefs_CVSCMD_DIALOGS::CGetPrefs_CVSCMD_DIALOGS ( )

Definition at line 749 of file GetPrefs.cpp.

References m_hideAnnotate, m_hideDiff, m_hideGraph, m_hideLog, m_hideStatus, m_hideUpdate, and m_keyForce.

00749                                                    : CPropertyPage(CGetPrefs_CVSCMD_DIALOGS::IDD), m_didInteract(false)
00750 {
00751     //{{AFX_DATA_INIT(CGetPrefs_CVSCMD_DIALOGS)
00752     m_hideUpdate = gCvsPrefs.HideCommandDlgUpdate() != 0L;
00753     m_hideDiff = gCvsPrefs.HideCommandDlgDiff() != 0L;
00754     m_hideGraph = gCvsPrefs.HideCommandDlgGraph() != 0L;
00755     m_hideLog = gCvsPrefs.HideCommandDlgLog() != 0L;
00756     m_keyForce = gCvsPrefs.HideCommandDlgUseShift() != 0L ? 0 : 1;
00757     m_hideAnnotate = gCvsPrefs.HideCommandDlgAnnotate() != 0L;
00758     m_hideStatus = gCvsPrefs.HideCommandDlgStatus() != 0L;
00759     //}}AFX_DATA_INIT
00760 }

CGetPrefs_CVSCMD_DIALOGS::~CGetPrefs_CVSCMD_DIALOGS ( )

Definition at line 762 of file GetPrefs.cpp.

00763 {
00764 }

Member Function Documentation

void CGetPrefs_CVSCMD_DIALOGS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 766 of file GetPrefs.cpp.

References m_didInteract.

00767 {
00768     m_didInteract = true;
00769
00770     CPropertyPage::DoDataExchange(pDX);
00771     //{{AFX_DATA_MAP(CGetPrefs_CVSCMD_DIALOGS)
00772     DDX_Check(pDX, IDC_CHECKUPDATE, m_hideUpdate);
00773     DDX_Check(pDX, IDC_CHECKDIFF, m_hideDiff);
00774     DDX_Check(pDX, IDC_CHECKGRAPH, m_hideGraph);
00775     DDX_Check(pDX, IDC_CHECKLOG, m_hideLog);
00776     DDX_Radio(pDX, IDC_RADIOSHIFT, m_keyForce);
00777     DDX_Check(pDX, IDC_CHECKANNOTATE, m_hideAnnotate);
00778     DDX_Check(pDX, IDC_CHECKSTATUS, m_hideStatus);
00779     //}}AFX_DATA_MAP
00780 }

void CGetPrefs_CVSCMD_DIALOGS::StoreValues ( )

Save the values.

Definition at line 783 of file GetPrefs.cpp.

References m_didInteract.

Referenced by CompatGetPrefs().

00784 {
00785     if( !m_didInteract )
00786         return;
00787
00788     gCvsPrefs.SetHideCommandDlgUpdate(m_hideUpdate ? true : false);
00789     gCvsPrefs.SetHideCommandDlgDiff(m_hideDiff ? true : false);
00790     gCvsPrefs.SetHideCommandDlgGraph(m_hideGraph ? true : false);
00791     gCvsPrefs.SetHideCommandDlgAnnotate(m_hideAnnotate ? true : false);
00792     gCvsPrefs.SetHideCommandDlgLog(m_hideLog ? true : false);
00793     gCvsPrefs.SetHideCommandDlgStatus(m_hideStatus ? true : false);
00794     gCvsPrefs.SetHideCommandDlgUseShift(m_keyForce == 0);
00795 }

Member Data Documentation

bool CGetPrefs_CVSCMD_DIALOGS::m_didInteract [protected]

Flag indicating data change

Definition at line 291 of file GetPrefs.h.

Referenced by DoDataExchange(), and StoreValues().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideAnnotate

Definition at line 277 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideDiff

Definition at line 273 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideGraph

Definition at line 274 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideLog

Definition at line 275 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideStatus

Definition at line 278 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

BOOL CGetPrefs_CVSCMD_DIALOGS::m_hideUpdate

Definition at line 272 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

int CGetPrefs_CVSCMD_DIALOGS::m_keyForce

Definition at line 276 of file GetPrefs.h.

Referenced by CGetPrefs_CVSCMD_DIALOGS().

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Fri Jan 31 12:16:06 2003 for WinCvs Source by doxygen 1.3-rc2


CGetPrefs_CVSROOT Class Reference

General preferences property page. More...

#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 ()
Save the values.

Public Attributes

CStatic m_authenDescEdit
CButton m_settingsButton
CEdit m_pathEdit
CEdit m_loginEdit
CEdit m_hostEdit
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)
Parse entered CVSROOT and fill the authentication fields.

void | OnChangeFields (void)
Update CVSROOT from changed fields.

afx_msg void | OnSelchangeAuthen ()
CBN_SELCHANGE message handler, change authentication.

afx_msg void | OnChangePath ()
EN_CHANGE message handler, update fields.

afx_msg void | OnChangeHost ()
EN_CHANGE message handler, update fields.

afx_msg void | OnChangeLogin ()
EN_CHANGE message handler, update fields.

afx_msg void | OnSettings ()
BN_CLICKED message handler, display settings dialog.

afx_msg void | OnSelchangeComboroot ()
CBN_SELCHANGE message handler, update fields.

afx_msg void | OnEditchangeComboroot ()
CBN_EDITCHANGE message handler, update fields.

Protected Attributes

bool | m_didInteract
bool | m_flag

Detailed Description

General preferences property page.

Definition at line 39 of file GetPrefs.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 50 of file GetPrefs.h.

00050 { IDD = IDD_PREFS_CVSROOT };

Constructor & Destructor Documentation

CGetPrefs_CVSROOT::CGetPrefs_CVSROOT ( )

Definition at line 71 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().

00072     : m_versCombo(USmartCombo::AutoDropWidth), m_authenCombo(USmartCombo::AutoDropWidth),
00073     CPropertyPage(CGetPrefs_CVSROOT::IDD), m_didInteract(false)
00074 {
00075     //{{AFX_DATA_INIT(CGetPrefs_CVSROOT)
00076     m_cvsroot = (const char*)gCvsPrefs;
00077     m_cvsvers = gCvsPrefs.CvsVersion();
00078     m_cvsconsole = gCvsPrefs.CvsConsole();
00079     m_authen = gAuthen.kind();
00080     m_host = _T("");
00081     m_login = _T("");
00082     m_path = _T("");
00083     //}}AFX_DATA_INIT
00084
00085     m_flag = false;
00086     m_cvsrootCombo.SetItems(&gOldCvsroots);
00087 }

CGetPrefs_CVSROOT::~CGetPrefs_CVSROOT ( )

Definition at line 89 of file GetPrefs.cpp.

00090 {
00091 }

Member Function Documentation

void CGetPrefs_CVSROOT::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 94 of file GetPrefs.cpp.

References DDV_CheckCVSROOT(), DDV_MinChars(), DDX_ComboMString(), FillFields(), AuthenModel::GetAllInstances(), AuthenModel::GetInstance(), m_authenCombo, m_cvsroot, m_cvsvers, m_didInteract, m_versCombo, and OnSelchangeAuthen().

00095 {
00096     m_didInteract = true;
00097
00098     CPropertyPage::DoDataExchange(pDX);
00099
00100     //{{AFX_DATA_MAP(CGetPrefs_CVSROOT)
00101     DDX_Control(pDX, IDC_AUTHENDESC, m_authenDescEdit);
00102     DDX_Control(pDX, IDC_SETTINGS, m_settingsButton);
00103     DDX_Control(pDX, IDC_PATH, m_pathEdit);
00104     DDX_Control(pDX, IDC_LOGIN, m_loginEdit);
00105     DDX_Control(pDX, IDC_HOST, m_hostEdit);
00106     DDX_Control(pDX, IDC_CVSVERS, m_versCombo);
00107     DDX_Control(pDX, IDC_AUTHEN, m_authenCombo);
00108     DDX_Control(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00109     DDX_CBString(pDX, IDC_COMBOROOT, m_cvsroot);
00110     DDV_MinChars(pDX, m_cvsroot, 1);
00111     DDX_Text(pDX, IDC_HOST, m_host);
00112     DDX_Text(pDX, IDC_LOGIN, m_login);
00113     DDX_Text(pDX, IDC_PATH, m_path);
00114     DDX_Check(pDX, IDC_CONSOLE, m_cvsconsole);
00115     //}}AFX_DATA_MAP
00116
00117     DDV_CheckCVSROOT(pDX, m_cvsroot);
00118
00119     if( pDX->m_bSaveAndValidate )
00120     {
00121         //in case the CVSROOT was modified by DDV rutine we need to refill the fields
00122         FillFields();
00123
00124         m_cvsvers = m_versCombo.GetCurSel();
00125
00126         if( !m_cvsroot.IsEmpty() )
00127         {
00128             gOldCvsroots.Insert(m_cvsroot);
00129         }
00130     }
00131     else
00132     {
00133         DDX_ComboMString(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00134
00135         m_versCombo.SetCurSel(m_cvsvers);
00136
00137         m_authenCombo.ResetContent();
00138         std::vector<AuthenModel*>& allAuthen = AuthenModel::GetAllInstances();
00139         std::vector<AuthenModel*>::iterator j;
00140         for(j = allAuthen.begin(); j != allAuthen.end(); ++j)
00141         {
00142             m_authenCombo.InsertString(-1, (*j)->GetToken());
00143         }
00144
00145         AuthenModel* model = AuthenModel::GetInstance(m_authen);
00146         m_authenCombo.SetCurSel(Authen::kindToNum(m_authen));
00147
00148         FillFields();
00149         OnSelchangeAuthen();
00150     }
00151 }

void CGetPrefs_CVSROOT::FillFields ( void ) [protected]

Parse entered CVSROOT and fill the authentication fields.

Definition at line 217 of file GetPrefs.cpp.

References USemaphore::IsEnteredTwice(), m_hostEdit, m_loginEdit, m_pathEdit, Authen::parse_cvsroot(), Authen::skiptoken(), and Authen::token().

Referenced by DoDataExchange(), OnEditchangeComboroot(), and OnSelchangeComboroot().

00218 {
00219     UStr theMethod, theUser, theHost, thePath;
00220     USemaphore policeman(m_flag);
00221     if( policeman.IsEnteredTwice() )
00222         return;
00223
00224     UStr root;
00225     root = Authen::token(m_authen);
00226     root << Authen::skiptoken(m_cvsroot);
00227
00228     if( Authen::parse_cvsroot(root, theMethod, theUser, theHost, thePath) )
00229     {
00230         m_pathEdit.SetWindowText(thePath);
00231         m_hostEdit.SetWindowText(theHost);
00232         m_loginEdit.SetWindowText(theUser);
00233     }
00234 }

void CGetPrefs_CVSROOT::OnChangeFields ( void ) [protected]

Update CVSROOT from changed fields.

Definition at line 244 of file GetPrefs.cpp.

References AuthenModel::GetInstance(), AuthenModel::HasHost(), AuthenModel::HasUser(), USemaphore::IsEnteredTwice(), m_cvsroot, m_cvsrootCombo, m_hostEdit, m_loginEdit, and m_pathEdit.

Referenced by OnChangeHost(), OnChangeLogin(), and OnChangePath().

00245 {
00246     USemaphore policeman(m_flag);
00247     if( policeman.IsEnteredTwice() )
00248         return;
00249
00250     CString theUser, theHost, thePath;
00251
00252     m_pathEdit.GetWindowText(thePath);
00253     m_hostEdit.GetWindowText(theHost);
00254     m_loginEdit.GetWindowText(theUser);
00255
00256     m_cvsroot = "";
00257     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00258     if( model->HasUser() )
00259     {
00260         m_cvsroot += theUser;
00261
00262         if( model->HasHost() && !(theUser.IsEmpty() || theHost.IsEmpty()) )
00263         {
00264             m_cvsroot += '@';
00265         }
00266     }
00267
00268     if( model->HasHost() )
00269     {
00270         m_cvsroot += theHost;
00271     }
00272
00273     if( model->HasUser() || model->HasHost() )
00274         m_cvsroot += ':';
00275
00276     m_cvsroot += thePath;
00277
00278     m_cvsrootCombo.SetWindowText(m_cvsroot);
00279 }

void CGetPrefs_CVSROOT::OnChangeHost ( ) [protected]

EN_CHANGE message handler, update fields.

Definition at line 194 of file GetPrefs.cpp.

References OnChangeFields().

00195 {
00196     OnChangeFields();
00197 }

void CGetPrefs_CVSROOT::OnChangeLogin ( ) [protected]

EN_CHANGE message handler, update fields.

Definition at line 200 of file GetPrefs.cpp.

References OnChangeFields().

00201 {
00202     OnChangeFields();
00203 }

void CGetPrefs_CVSROOT::OnChangePath ( ) [protected]

EN_CHANGE message handler, update fields.

Definition at line 188 of file GetPrefs.cpp.

References OnChangeFields().

00189 {
00190     OnChangeFields();
00191 }

void CGetPrefs_CVSROOT::OnEditchangeComboroot ( ) [protected]

CBN_EDITCHANGE message handler, update fields.

Definition at line 237 of file GetPrefs.cpp.

References FillFields(), and m_cvsrootCombo.

00238 {
00239     m_cvsrootCombo.GetWindowText(m_cvsroot);
00240     FillFields();
00241 }

void CGetPrefs_CVSROOT::OnSelchangeAuthen ( ) [protected]

CBN_SELCHANGE message handler, change authentication.

Definition at line 166 of file GetPrefs.cpp.

References AuthenModel::GetInstance(), AuthenModel::GetSettingsDesc(), AuthenModel::HasHost(), AuthenModel::HasSettings(), AuthenModel::HasUser(), m_authen, m_authenCombo, m_authenDescEdit, m_hostEdit, m_loginEdit, m_settingsButton, and Authen::numToKind().

Referenced by DoDataExchange().

00167 {
00168     m_authen = Authen::numToKind(m_authenCombo.GetCurSel());
00169
00170     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00171
00172     m_hostEdit.EnableWindow(model->HasHost());
00173     m_loginEdit.EnableWindow(model->HasUser());
00174     m_settingsButton.EnableWindow(model->HasSettings());
00175
00176     if( !model->HasHost() )
00177         m_hostEdit.SetWindowText("");
00178
00179     if( !model->HasUser() )
00180         m_loginEdit.SetWindowText("");
00181
00182     UStr desc;
00183     model->GetSettingsDesc(desc);
00184     m_authenDescEdit.SetWindowText(desc);
00185 }

void CGetPrefs_CVSROOT::OnSelchangeComboroot ( ) [protected]

CBN_SELCHANGE message handler, update fields.

Definition at line 282 of file GetPrefs.cpp.

References FillFields(), and m_cvsrootCombo.

00283 {
00284     int nCurSel = m_cvsrootCombo.GetCurSel();
00285     m_cvsrootCombo.GetLBText(nCurSel, m_cvsroot);
00286     FillFields();
00287 }

void CGetPrefs_CVSROOT::OnSettings ( ) [protected]

BN_CLICKED message handler, display settings dialog.

Definition at line 206 of file GetPrefs.cpp.

References AuthenModel::DoSettings(), AuthenModel::GetInstance(), AuthenModel::GetSettingsDesc(), and m_authenDescEdit.

00207 {
00208     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00209     model->DoSettings();
00210
00211     UStr desc;
00212     model->GetSettingsDesc(desc);
00213     m_authenDescEdit.SetWindowText(desc);
00214 }

void CGetPrefs_CVSROOT::StoreValues ( )

Save the values.

Definition at line 154 of file GetPrefs.cpp.

References m_cvsroot, and m_didInteract.

Referenced by CompatGetCheckout(), CompatGetImport(), CompatGetInit(), CompatGetLogin(), and CompatGetPrefs().

00155 {
00156     if( !m_didInteract )
00157         return;
00158
00159     gCvsPrefs = (const char*)m_cvsroot;
00160     gAuthen.setkind(m_authen);
00161     gCvsPrefs.SetCvsVersion(m_cvsvers);
00162     gCvsPrefs.SetCvsConsole(m_cvsconsole != 0);
00163 }

Member Data Documentation

AuthenKind CGetPrefs_CVSROOT::m_authen

Definition at line 61 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT(), and OnSelchangeAuthen().

CSmartComboBox CGetPrefs_CVSROOT::m_authenCombo

Definition at line 57 of file GetPrefs.h.

Referenced by DoDataExchange(), and OnSelchangeAuthen().

CStatic CGetPrefs_CVSROOT::m_authenDescEdit

Definition at line 51 of file GetPrefs.h.

Referenced by OnSelchangeAuthen(), and OnSettings().

BOOL CGetPrefs_CVSROOT::m_cvsconsole

Definition at line 65 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT().

CString CGetPrefs_CVSROOT::m_cvsroot

Definition at line 59 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT(), DoDataExchange(), OnChangeFields(), and StoreValues().

CSmartComboBox CGetPrefs_CVSROOT::m_cvsrootCombo

Definition at line 58 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT(), OnChangeFields(), OnEditchangeComboroot(), and OnSelchangeComboroot().

int CGetPrefs_CVSROOT::m_cvsvers

Definition at line 60 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT(), and DoDataExchange().

bool CGetPrefs_CVSROOT::m_didInteract [protected]

Flag indicating data change

Definition at line 77 of file GetPrefs.h.

Referenced by DoDataExchange(), and StoreValues().

bool CGetPrefs_CVSROOT::m_flag [protected]

Flag used for semaphore

Definition at line 78 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT().

CString CGetPrefs_CVSROOT::m_host

Definition at line 62 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT().

CEdit CGetPrefs_CVSROOT::m_hostEdit

Definition at line 55 of file GetPrefs.h.

Referenced by FillFields(), OnChangeFields(), and OnSelchangeAuthen().

CString CGetPrefs_CVSROOT::m_login

Definition at line 63 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT().

CEdit CGetPrefs_CVSROOT::m_loginEdit

Definition at line 54 of file GetPrefs.h.

Referenced by FillFields(), OnChangeFields(), and OnSelchangeAuthen().

CString CGetPrefs_CVSROOT::m_path

Definition at line 64 of file GetPrefs.h.

Referenced by CGetPrefs_CVSROOT().

CEdit CGetPrefs_CVSROOT::m_pathEdit

Definition at line 53 of file GetPrefs.h.

Referenced by FillFields(), and OnChangeFields().

CButton CGetPrefs_CVSROOT::m_settingsButton

Definition at line 52 of file GetPrefs.h.

Referenced by OnSelchangeAuthen().

CSmartComboBox CGetPrefs_CVSROOT::m_versCombo

Definition at line 56 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 Fri Jan 31 12:16:08 2003 for WinCvs Source by doxygen 1.3-rc2


CGetPrefs_GLOBALS Class Reference

Global preferences property page. More...

#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 ()
Save the values.

Public Attributes

CSpinButtonCtrl | m_logoutSpinButton
CEdit m_logoutEdit
CButton m_logoutCheck
CSpinButtonCtrl | m_zspinSpinButton
CEdit m_zlevelEdit
CButton m_tcpipCheck
BOOL | m_checkoutro
BOOL | m_prune
BOOL | m_tcpip
BOOL | m_quiet
BOOL | m_cntladd
BOOL | m_dirty
BOOL | m_alwaysroot
BOOL | m_logout
BOOL | m_unixlf
UINT | m_zlevel
BOOL | m_disableSplashScreen
UINT | m_logoutTime

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnLogout ()
BN_CLICKED message handler, enable controls.

afx_msg void | OnCheckunixlf ()
BN_CLICKED message handler, display the warning about changing the line endings.

afx_msg void | OnTcpip ()
BN_CLICKED message handler, enable controls.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, setup spin controls.

Protected Attributes

bool | m_didInteract

Detailed Description

Global preferences property page.

Definition at line 100 of file GetPrefs.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 111 of file GetPrefs.h.

00111 { IDD = IDD_PREFS_GLOBALS };

Constructor & Destructor Documentation

CGetPrefs_GLOBALS::CGetPrefs_GLOBALS ( )

Definition at line 304 of file GetPrefs.cpp.

References m_alwaysroot, m_checkoutro, m_cntladd, m_dirty, m_disableSplashScreen, m_logout, m_logoutTime, m_prune, m_quiet, m_tcpip, m_unixlf, and m_zlevel.

00304                                      : CPropertyPage(CGetPrefs_GLOBALS::IDD), m_didInteract(false)
00305 {
00306     //{{AFX_DATA_INIT(CGetPrefs_GLOBALS)
00307     m_checkoutro = gCvsPrefs.CheckoutRO();
00308     m_prune = gCvsPrefs.PruneOption();
00309     m_tcpip = gCvsPrefs.Z9Option();
00310     m_quiet = gCvsPrefs.QuietOption();
00311     m_cntladd = gCvsPrefs.AddControl();
00312     m_dirty = gCvsPrefs.DirtySupport();
00313     m_alwaysroot = gCvsPrefs.AlwaysUseCvsroot();
00314     m_logout = gCvsPrefs.LogoutTimeOut() > 0;
00315     m_unixlf = gCvsPrefs.UnixLF();
00316     m_zlevel = gCvsPrefs.ZLevel();
00317     m_disableSplashScreen = gCvsPrefs.DisableSplashScreen();
00318     m_logoutTime = gCvsPrefs.LogoutTimeOut();
00319     //}}AFX_DATA_INIT
00320 }

CGetPrefs_GLOBALS::~CGetPrefs_GLOBALS ( )

Definition at line 322 of file GetPrefs.cpp.

00323 {
00324 }

Member Function Documentation

void CGetPrefs_GLOBALS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 326 of file GetPrefs.cpp.

References m_didInteract, OnLogout(), and OnTcpip().

00327 {
00328     m_didInteract = true;
00329
00330     CPropertyPage::DoDataExchange(pDX);
00331
00332     //{{AFX_DATA_MAP(CGetPrefs_GLOBALS)
00333     DDX_Control(pDX, IDC_SPINLOGOUT, m_logoutSpinButton);
00334     DDX_Control(pDX, IDC_EDITLOGOUT, m_logoutEdit);
00335     DDX_Control(pDX, IDC_LOGOUT, m_logoutCheck);
00336     DDX_Control(pDX, IDC_ZSPIN, m_zspinSpinButton);
00337     DDX_Control(pDX, IDC_ZLEVEL, m_zlevelEdit);
00338     DDX_Control(pDX, IDC_TCPIP, m_tcpipCheck);
00339     DDX_Check(pDX, IDC_CHECKOUTRO, m_checkoutro);
00340     DDX_Check(pDX, IDC_PRUNE, m_prune);
00341     DDX_Check(pDX, IDC_TCPIP, m_tcpip);
00342     DDX_Check(pDX, IDC_QUIET, m_quiet);
00343     DDX_Check(pDX, IDC_CTNLADD, m_cntladd);
00344     DDX_Check(pDX, IDC_DIRTYSUPPORT, m_dirty);
00345     DDX_Check(pDX, IDC_ALWAYSROOT, m_alwaysroot);
00346     DDX_Check(pDX, IDC_LOGOUT, m_logout);
00347     DDX_Check(pDX, IDC_CHECKUNIXLF, m_unixlf);
00348     DDX_Text(pDX, IDC_ZLEVEL, m_zlevel);
00349     DDV_MinMaxUInt(pDX, m_zlevel, 1, 9);
00350     DDX_Check(pDX, IDC_DISABLESPLASHSCREEN, m_disableSplashScreen);
00351     DDX_Text(pDX, IDC_EDITLOGOUT, m_logoutTime);
00352     DDV_MinMaxUInt(pDX, m_logoutTime, 0, 999999);
00353     //}}AFX_DATA_MAP
00354
00355     if( !pDX->m_bSaveAndValidate )
00356     {
00357         OnTcpip();
00358         OnLogout();
00359     }
00360 }

void CGetPrefs_GLOBALS::OnCheckunixlf ( ) [protected]

BN_CLICKED message handler, display the warning about changing the line endings.

Definition at line 420 of file GetPrefs.cpp.

00421 {
00422     AfxMessageBox("Be careful when toggling this option : you *CANNOT* use WinCvs in"
00423         " both mode. You got to use either one or the other. If you experience some"
00424         " problems, try to remove the global cvs files (such as .cvspass) because they probably"
00425         " don't match the new line feeds.", MB_ICONEXCLAMATION | MB_OK);
00426 }

BOOL CGetPrefs_GLOBALS::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, setup spin controls.

Definition at line 390 of file GetPrefs.cpp.

References m_logoutSpinButton, m_zspinSpinButton, and TRUE.

00391 {
00392     CPropertyPage::OnInitDialog();
00393
00394     // Extra initialization
00395     m_logoutSpinButton.SetBase(10);
00396     m_logoutSpinButton.SetRange(0, 30000);
00397
00398     m_zspinSpinButton.SetBase(1);
00399     m_zspinSpinButton.SetRange(1, 9);
00400
00401     return TRUE;  // return TRUE unless you set the focus to a control
00402                   // EXCEPTION: OCX Property Pages should return FALSE
00403 }

void CGetPrefs_GLOBALS::OnLogout ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 413 of file GetPrefs.cpp.

References m_logoutCheck, m_logoutEdit, and m_logoutSpinButton.

Referenced by DoDataExchange().

00414 {
00415     m_logoutEdit.EnableWindow(m_logoutCheck.GetCheck() != 0);
00416     m_logoutSpinButton.EnableWindow(m_logoutCheck.GetCheck() != 0);
00417 }

void CGetPrefs_GLOBALS::OnTcpip ( ) [protected]

BN_CLICKED message handler, enable controls.

Definition at line 406 of file GetPrefs.cpp.

References m_tcpipCheck, m_zlevelEdit, and m_zspinSpinButton.

Referenced by DoDataExchange().

00407 {
00408     m_zlevelEdit.EnableWindow(m_tcpipCheck.GetCheck() != 0);
00409     m_zspinSpinButton.EnableWindow(m_tcpipCheck.GetCheck() != 0);
00410 }

void CGetPrefs_GLOBALS::StoreValues ( )

Save the values.

Definition at line 363 of file GetPrefs.cpp.

References m_didInteract.

Referenced by CompatGetAnnotate(), CompatGetCheckout(), CompatGetCommand(), CompatGetCommit(), CompatGetDiff(), CompatGetImport(), CompatGetInit(), CompatGetLog(), CompatGetLogin(), CompatGetPrefs(), CompatGetRelease(), CompatGetStatus(), CompatGetUpdate(), CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CompatTagBranch(), CompatTagCreate(), and CompatTagDelete().

00364 {
00365     if( !m_didInteract )
00366         return;
00367
00368     gCvsPrefs.SetCheckoutRO(m_checkoutro ? true : false);
00369     gCvsPrefs.SetPruneOption(m_prune ? true : false);
00370     gCvsPrefs.SetZ9Option(m_tcpip ? true : false);
00371     gCvsPrefs.SetQuietOption(m_quiet ? true : false);
00372     gCvsPrefs.SetAddControl(m_cntladd ? true : false);
00373     gCvsPrefs.SetDirtySupport(m_dirty ? true : false);
00374     gCvsPrefs.SetAlwaysUseCvsroot(m_alwaysroot ? true : false);
00375     gCvsPrefs.SetLogoutTimeOut(m_logout ? (int)m_logoutTime : 0);
00376     gCvsPrefs.SetUnixLF(m_unixlf != 0);
00377     gCvsPrefs.SetZLevel(m_zlevel);
00378     gCvsPrefs.SetDisableSplashScreen(m_disableSplashScreen ? true : false);
00379 }

Member Data Documentation

BOOL CGetPrefs_GLOBALS::m_alwaysroot

Definition at line 124 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_checkoutro

Definition at line 118 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_cntladd

Definition at line 122 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

bool CGetPrefs_GLOBALS::m_didInteract [protected]

Flag indicating data change

Definition at line 142 of file GetPrefs.h.

Referenced by DoDataExchange(), and StoreValues().

BOOL CGetPrefs_GLOBALS::m_dirty

Definition at line 123 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_disableSplashScreen

Definition at line 128 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_logout

Definition at line 125 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

CButton CGetPrefs_GLOBALS::m_logoutCheck

Definition at line 114 of file GetPrefs.h.

Referenced by OnLogout().

CEdit CGetPrefs_GLOBALS::m_logoutEdit

Definition at line 113 of file GetPrefs.h.

Referenced by OnLogout().

CSpinButtonCtrl CGetPrefs_GLOBALS::m_logoutSpinButton

Definition at line 112 of file GetPrefs.h.

Referenced by OnInitDialog(), and OnLogout().

UINT CGetPrefs_GLOBALS::m_logoutTime

Definition at line 129 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_prune

Definition at line 119 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_quiet

Definition at line 121 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

BOOL CGetPrefs_GLOBALS::m_tcpip

Definition at line 120 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

CButton CGetPrefs_GLOBALS::m_tcpipCheck

Definition at line 117 of file GetPrefs.h.

Referenced by OnTcpip().

BOOL CGetPrefs_GLOBALS::m_unixlf

Definition at line 126 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

UINT CGetPrefs_GLOBALS::m_zlevel

Definition at line 127 of file GetPrefs.h.

Referenced by CGetPrefs_GLOBALS().

CEdit CGetPrefs_GLOBALS::m_zlevelEdit

Definition at line 116 of file GetPrefs.h.

Referenced by OnTcpip().

CSpinButtonCtrl CGetPrefs_GLOBALS::m_zspinSpinButton

Definition at line 115 of file GetPrefs.h.

Referenced by OnInitDialog(), and OnTcpip().

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Fri Jan 31 12:16:10 2003 for WinCvs Source by doxygen 1.3-rc2


CGetPrefs_WINCVS Class Reference

WinCvs preferences property page. More...

#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 ()
Save the values.

Public Attributes

CEdit m_viewerEdit
CButton m_extDiffSelButton
CEdit m_diffProgEdit
CButton m_useExtDiffCheck
CEdit m_settingsFolderEdit
CButton m_settingsFolderButton
CButton m_useSettingsFolderCheck
CString | m_viewer
BOOL | m_useViewerAlways
BOOL | m_useExtDiff
CString | m_diffProg
BOOL | m_useSettingsFolder
CString | m_settingsFolder

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnviewer ()
BN_CLICKED message handler, change default viewer used to open files.

afx_msg void | OnExtdiffsel ()
BN_CLICKED message handler, change external diff program.

afx_msg void | OnExtdiff ()
BN_CLICKED message handler, enable to change external diff program.

afx_msg void | OnAltsettingschk ()
BN_CLICKED message handler, enable to change settings folder.

afx_msg void | OnBtnsettings ()
BN_CLICKED message handler, change settings folder.

Protected Attributes

bool | m_didInteract

Detailed Description

WinCvs preferences property page.

Definition at line 158 of file GetPrefs.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 169 of file GetPrefs.h.

00169 { IDD = IDD_PREFS_WINCVS };

Constructor & Destructor Documentation

CGetPrefs_WINCVS::CGetPrefs_WINCVS ( )

Definition at line 431 of file GetPrefs.cpp.

References m_diffProg, m_settingsFolder, m_useExtDiff, m_useSettingsFolder, m_useViewerAlways, and m_viewer.

00431                                    : CPropertyPage(CGetPrefs_WINCVS::IDD), m_didInteract(false)
00432 {
00433     //{{AFX_DATA_INIT(CGetPrefs_WINCVS)
00434     m_viewer = gCvsPrefs.Viewer() != 0L ? gCvsPrefs.Viewer() : "";
00435     m_useViewerAlways = gCvsPrefs.UseViewerAlways();
00436     m_useExtDiff = gCvsPrefs.ExtDiff() != 0L;
00437     m_diffProg = gCvsPrefs.ExtDiff();
00438     m_useSettingsFolder = gCvsPrefs.SettingsFolder() != 0L;
00439     m_settingsFolder = gCvsPrefs.SettingsFolder() != 0L ? gCvsPrefs.SettingsFolder() : "";
00440     //}}AFX_DATA_INIT
00441 }

CGetPrefs_WINCVS::~CGetPrefs_WINCVS ( )

Definition at line 443 of file GetPrefs.cpp.

00444 {
00445 }

Member Function Documentation

void CGetPrefs_WINCVS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 447 of file GetPrefs.cpp.

References DDV_CheckPathExists(), DDV_MinChars(), m_didInteract, OnAltsettingschk(), and OnExtdiff().

00448 {
00449     m_didInteract = true;
00450
00451     CPropertyPage::DoDataExchange(pDX);
00452
00453     //{{AFX_DATA_MAP(CGetPrefs_WINCVS)
00454     DDX_Control(pDX, IDC_PROGRAM, m_viewerEdit);
00455     DDX_Control(pDX, IDC_EXTDIFFSEL, m_extDiffSelButton);
00456     DDX_Control(pDX, IDC_DIFFPROG, m_diffProgEdit);
00457     DDX_Control(pDX, IDC_EXTDIFF, m_useExtDiffCheck);
00458     DDX_Control(pDX, IDC_SETTINGS, m_settingsFolderEdit);
00459     DDX_Control(pDX, IDC_BTNSETTINGS, m_settingsFolderButton);
00460     DDX_Control(pDX, IDC_ALTSETTINGSCHK, m_useSettingsFolderCheck);
00461     DDX_Text(pDX, IDC_PROGRAM, m_viewer);
00462     DDX_Check(pDX, IDC_USE_VIEWER_ALWAYS, m_useViewerAlways);
00463     DDX_Check(pDX, IDC_EXTDIFF, m_useExtDiff);
00464     DDX_Text(pDX, IDC_DIFFPROG, m_diffProg);
00465     DDX_Check(pDX, IDC_ALTSETTINGSCHK, m_useSettingsFolder);
00466     DDX_Text(pDX, IDC_SETTINGS, m_settingsFolder);
00467     //}}AFX_DATA_MAP
00468
00469     if( m_useSettingsFolder )
00470     {
00471         DDV_MinChars(pDX, m_settingsFolder, 1);
00472         DDV_CheckPathExists(pDX, IDC_SETTINGS, m_settingsFolder);
00473     }
00474
00475     if( !pDX->m_bSaveAndValidate )
00476     {
00477         OnExtdiff();
00478         OnAltsettingschk();
00479     }
00480 }

void CGetPrefs_WINCVS::OnAltsettingschk ( ) [protected]

BN_CLICKED message handler, enable to change settings folder.

Definition at line 590 of file GetPrefs.cpp.

References CStr, FormatDefaultSettingsLoc(), m_settingsFolderButton, m_settingsFolderEdit, and m_useSettingsFolderCheck.

Referenced by DoDataExchange().

00591 {
00592     const bool useSettingsFolder = m_useSettingsFolderCheck.GetCheck() != 0;
00593
00594     m_settingsFolderEdit.EnableWindow(useSettingsFolder);
00595     m_settingsFolderButton.EnableWindow(useSettingsFolder);
00596
00597     if( useSettingsFolder )
00598     {
00599         CString strSettingsFolder;
00600         m_settingsFolderEdit.GetWindowText(strSettingsFolder);
00601
00602         if( strSettingsFolder.IsEmpty() )
00603         {
00604             CStr settingsFolder;
00605             if( FormatDefaultSettingsLoc(settingsFolder) )
00606             {
00607                 m_settingsFolderEdit.SetWindowText(settingsFolder);
00608             }
00609         }
00610     }
00611 }

void CGetPrefs_WINCVS::OnBtnsettings ( ) [protected]

BN_CLICKED message handler, change settings folder.

Definition at line 614 of file GetPrefs.cpp.

References BrowserGetDirectory(), CStr, and m_settingsFolderEdit.

00615 {
00616     CString strSettingsFolder;
00617     m_settingsFolderEdit.GetWindowText(strSettingsFolder);
00618
00619     CStr settingsFolder(strSettingsFolder);
00620     if( BrowserGetDirectory("Select the settings directory", settingsFolder, IsWindow(m_hWnd) ? this : NULL) )
00621     {
00622         m_settingsFolderEdit.SetWindowText(settingsFolder);
00623     }
00624 }

void CGetPrefs_WINCVS::OnBtnviewer ( ) [protected]

BN_CLICKED message handler, change default viewer used to open files.

Definition at line 505 of file GetPrefs.cpp.

References CvsArgs::Argv(), MultiFiles::begin(), BrowserGetMultiFiles(), CStr, m_viewerEdit, MultiFiles::newdir(), MultiFiles::newfile(), and SplitPath().

00506 {
00507     MultiFiles mf;
00508
00509     CString viewerPath;
00510     m_viewerEdit.GetWindowText(viewerPath);
00511
00512     if( !viewerPath.IsEmpty() )
00513     {
00514         CStr uppath;
00515         CStr file;
00516
00517         if( SplitPath(viewerPath, uppath, file) )
00518         {
00519             mf.newdir(uppath);
00520             mf.newfile(file);
00521         }
00522     }
00523
00524     if( !BrowserGetMultiFiles("Select the viewer application", mf, true, kSelectExecutable) )
00525         return;
00526
00527     CvsArgs args(false);
00528
00529     const char* dir = (*mf.begin()).add(args);
00530     char* const* argv = args.Argv();
00531
00532     CStr fullpath;
00533     fullpath = dir;
00534
00535     if( !fullpath.endsWith(kPathDelimiter) )
00536         fullpath << kPathDelimiter;
00537
00538     fullpath << argv[0];
00539
00540     m_viewerEdit.SetWindowText(fullpath);
00541 }

void CGetPrefs_WINCVS::OnExtdiff ( ) [protected]

BN_CLICKED message handler, enable to change external diff program.

Definition at line 583 of file GetPrefs.cpp.

References m_diffProgEdit, m_extDiffSelButton, and m_useExtDiffCheck.

Referenced by DoDataExchange().

00584 {
00585     m_diffProgEdit.EnableWindow(m_useExtDiffCheck.GetCheck() != 0);
00586     m_extDiffSelButton.EnableWindow(m_useExtDiffCheck.GetCheck() != 0);
00587 }

void CGetPrefs_WINCVS::OnExtdiffsel ( ) [protected]

BN_CLICKED message handler, change external diff program.

Definition at line 544 of file GetPrefs.cpp.

References CvsArgs::Argv(), MultiFiles::begin(), BrowserGetMultiFiles(), CStr, m_diffProgEdit, MultiFiles::newdir(), MultiFiles::newfile(), and SplitPath().

00545 {
00546     MultiFiles mf;
00547
00548     CString diffProg;
00549     m_diffProgEdit.GetWindowText(diffProg);
00550
00551     if( !diffProg.IsEmpty() )
00552     {
00553         CStr uppath;
00554         CStr file;
00555
00556         if( SplitPath(diffProg, uppath, file) )
00557         {
00558             mf.newdir(uppath);
00559             mf.newfile(file);
00560         }
00561     }
00562
00563     if( !BrowserGetMultiFiles("Select the external diff application", mf, true, kSelectExecutable) )
00564         return;
00565
00566     CvsArgs args(false);
00567
00568     const char* dir = (*mf.begin()).add(args);
00569     char* const* argv = args.Argv();
00570
00571     CStr fullpath;
00572     fullpath = dir;
00573
00574     if( !fullpath.endsWith(kPathDelimiter) )
00575         fullpath << kPathDelimiter;
00576
00577     fullpath << argv[0];
00578
00579     m_diffProgEdit.SetWindowText(fullpath);
00580 }

void CGetPrefs_WINCVS::StoreValues ( )

Save the values.

Definition at line 483 of file GetPrefs.cpp.

References m_didInteract, m_diffProg, m_settingsFolder, and m_viewer.

Referenced by CompatGetPrefs().

00484 {
00485     if( !m_didInteract )
00486         return;
00487
00488     gCvsPrefs.SetViewer(!m_viewer.IsEmpty() ? (LPCTSTR)m_viewer : 0L);
00489     gCvsPrefs.SetExtDiff(m_useExtDiff && !m_diffProg.IsEmpty() ? (LPCTSTR)m_diffProg : 0L);
00490     gCvsPrefs.SetUseViewerAlways(m_useViewerAlways ? true : false);
00491     gCvsPrefs.SetSettingsFolder(m_useSettingsFolder && !m_settingsFolder.IsEmpty() ? (LPCTSTR)m_settingsFolder : 0L);
00492 }

Member Data Documentation

bool CGetPrefs_WINCVS::m_didInteract [protected]

Flag indicating data change

Definition at line 195 of file GetPrefs.h.

Referenced by DoDataExchange(), and StoreValues().

CString CGetPrefs_WINCVS::m_diffProg

Definition at line 180 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS(), and StoreValues().

CEdit CGetPrefs_WINCVS::m_diffProgEdit

Definition at line 172 of file GetPrefs.h.

Referenced by OnExtdiff(), and OnExtdiffsel().

CButton CGetPrefs_WINCVS::m_extDiffSelButton

Definition at line 171 of file GetPrefs.h.

Referenced by OnExtdiff().

CString CGetPrefs_WINCVS::m_settingsFolder

Definition at line 182 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS(), and StoreValues().

CButton CGetPrefs_WINCVS::m_settingsFolderButton

Definition at line 175 of file GetPrefs.h.

Referenced by OnAltsettingschk().

CEdit CGetPrefs_WINCVS::m_settingsFolderEdit

Definition at line 174 of file GetPrefs.h.

Referenced by OnAltsettingschk(), and OnBtnsettings().

BOOL CGetPrefs_WINCVS::m_useExtDiff

Definition at line 179 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS().

CButton CGetPrefs_WINCVS::m_useExtDiffCheck

Definition at line 173 of file GetPrefs.h.

Referenced by OnExtdiff().

BOOL CGetPrefs_WINCVS::m_useSettingsFolder

Definition at line 181 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS().

CButton CGetPrefs_WINCVS::m_useSettingsFolderCheck

Definition at line 176 of file GetPrefs.h.

Referenced by OnAltsettingschk().

BOOL CGetPrefs_WINCVS::m_useViewerAlways

Definition at line 178 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS().

CString CGetPrefs_WINCVS::m_viewer

Definition at line 177 of file GetPrefs.h.

Referenced by CGetPrefs_WINCVS(), and StoreValues().

CEdit CGetPrefs_WINCVS::m_viewerEdit

Definition at line 170 of file GetPrefs.h.

Referenced by OnBtnviewer().

The documentation for this class was generated from the following files:
  • common/GetPrefs.h
  • common/GetPrefs.cpp
Generated on Fri Jan 31 12:16:11 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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 GetValue().

CString GetValue::m_value

Definition at line 52 of file GetValue.h.

Referenced by CompatGetValue(), and GetValue().

The documentation for this class was generated from the following files:
  • common/GetValue.h
  • common/GetValue.cpp
Generated on Fri Jan 31 12:16:12 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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, and text.

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(), 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 Fri Jan 31 12:16:13 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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, ASSERT, and CGfxOutBarCtrl::CBarFolder::pChild.

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, DrawFolder(), GetFolderChild(), GetFolderCount(), GetFolderRect(), GetInsideRect(), 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.

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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, GetFolderCount(), GetFolderImageList(), GetInsideRect(), GetItemCount(), GetItemRect(), iFirstItem, CGfxOutBarCtrl::CBarItem::iImageIndex, iLastSel, 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, and iLastDragItemDrawType.

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, and CGfxOutBarCtrl::CBarFolder::cName.

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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::cItem, dwFlags, fSelHighlight, GetFolderCount(), GetFolderImageList(), GetIconRect(), GetItemCount(), CGfxOutBarCtrl::CBarItem::iImageIndex, iLastSel, 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(), 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, NULL, and CGfxOutBarCtrl::CBarFolder::pChild.

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, CGfxOutBarCtrl::CBarFolder::dwData, 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, CGfxOutBarCtrl::CBarFolder::pLargeImageList, pSmallImageList, and CGfxOutBarCtrl::CBarFolder::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, 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, 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 CGfxOutBarCtrl::CBarFolder::GetItemCount().

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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::dwData, GetFolderCount(), 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, GetFolderCount(), CGfxOutBarCtrl::CBarItem::iImageIndex, 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, 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::cItem, GetFolderCount(), GetFolderImageList(), GetInsideRect(), GetItemCount(), CGfxOutBarCtrl::CBarItem::iImageIndex, ircAll, ircIcon, ircLabel, and IsSmallIconView().

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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::cItem, GetFolderCount(), 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, 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(), CGfxOutBarCtrl::CBarFolder::GetItemCount(), 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 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 dwFlags, fSelHighlight, GetIconRect(), GetInsideRect(), iLastItemHighlighted, iLastSel, iSelAnimTiming, IsValidItem(), and NULL.

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(), CGfxOutBarCtrl::CBarFolder::GetItemCount(), GetItemRect(), GetLabelRect(), htDownScroll, htFolder, htItem, htNothing, htUpScroll, iFirstItem, 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, GetFolderCount(), and CGfxOutBarCtrl::CBarFolder::InsertItem().

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 CGfxOutBarCtrl::CBarFolder::GetItemCount().

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(), and CGfxGroupEdit::text.

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, 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, 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, bDownArrow, bDownPressed, bLooping, bPressedHighlight, bUpArrow, bUpPressed, DrawAnimItem(), DrawDragArrow(), DrawFolder(), dwFlags, 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, NULL, rcDownArrow, rcUpArrow, SetSelFolder(), and VERIFY.

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, and iLastItemHighlighted.

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, bUpArrow, DrawFolder(), GetFolderChild(), GetFolderRect(), GetInsideRect(), GetItemCount(), GetVisibleRange(), HighlightFolder(), HighlightItem(), iLastFolderHighlighted, iLastItemHighlighted, 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, iHitInternal1, CCJMenu::LoadMenu(), CCJMenu::LoadToolbar(), m_popupMenu, 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 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(), CGfxOutBarCtrl::CBarFolder::GetItemCount(), 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, GetFolderCount(), GetInsideRect(), GetItemCount(), 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.

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(), NULL, CGfxOutBarCtrl::CBarFolder::pLargeImageList, and CGfxOutBarCtrl::CBarFolder::pSmallImageList.

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, CGfxOutBarCtrl::CBarFolder::cName, 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::dwData, GetFolderCount(), 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, GetFolderCount(), CGfxOutBarCtrl::CBarItem::iImageIndex, 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxOutBarCtrl::CBarItem::cItem, GetFolderCount(), 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, and lAnimationTickCount.

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, CGfxOutBarCtrl::CBarFolder::cName, 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, CGfxOutBarCtrl::CBarFolder::arItems, ASSERT, CGfxGroupEdit::bNoDown, CGfxOutBarCtrl::CBarItem::cItem, GetFolderCount(), GetIconRect(), GetInsideRect(), GetItemCount(), GetLabelRect(), CGfxGroupEdit::iIndex, 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(), and OnLButtonDown().

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(), and OnSysColorChange().

COLORREF CGfxOutBarCtrl::crBackGroundColor

Definition at line 74 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), and OnSysColorChange().

COLORREF CGfxOutBarCtrl::crBackGroundColor1

Definition at line 74 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), and OnSysColorChange().

COLORREF CGfxOutBarCtrl::crDkShadowBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), and OnSysColorChange().

COLORREF CGfxOutBarCtrl::crHilightBorder

Definition at line 76 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), 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(), 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().

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(), 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.

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(), GetFolderChild(), GetFolderData(), GetFolderRect(), GetInsideRect(), GetSelFolder(), OnLButtonDown(), RemoveFolder(), and SetSelFolder().

long CGfxOutBarCtrl::lAnimationTickCount

Definition at line 89 of file GfxOutBarCtrl.h.

Referenced by 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().

CString CGfxOutBarCtrl::m_strRenameItem

Definition at line 146 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl().

CPen* CGfxOutBarCtrl::pBlackPen

Definition at line 142 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), 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(), and DrawItem().

int CGfxOutBarCtrl::yLargeIconLabelOffset

Definition at line 79 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), DrawItem(), and HitTestEx().

int CGfxOutBarCtrl::yLargeIconSpacing

Definition at line 80 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl(), GetIconRect(), GetItemRect(), 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 Fri Jan 31 12:16:18 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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, 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 CGfxOutBarCtrl::GetItemCount(), CGfxOutBarCtrl::GetVisibleRange(), CGfxOutBarCtrl::HitTestEx(), InsertItem(), CGfxOutBarCtrl::IsValidItem(), and CGfxOutBarCtrl::PaintItems().

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().

Referenced by CGfxOutBarCtrl::InsertItem().

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 CGfxOutBarCtrl::DrawAnimItem(), CGfxOutBarCtrl::DrawItem(), GetItemCount(), CGfxOutBarCtrl::GetItemData(), CGfxOutBarCtrl::GetItemImage(), CGfxOutBarCtrl::GetItemSize(), CGfxOutBarCtrl::GetItemText(), InsertItem(), CGfxOutBarCtrl::OnLButtonDown(), CGfxOutBarCtrl::RemoveItem(), CGfxOutBarCtrl::SetItemData(), CGfxOutBarCtrl::SetItemImage(), CGfxOutBarCtrl::SetItemText(), CGfxOutBarCtrl::StartItemEdit(), and ~CBarFolder().

LPTSTR CGfxOutBarCtrl::CBarFolder::cName

Definition at line 125 of file GfxOutBarCtrl.h.

Referenced by CBarFolder(), CGfxOutBarCtrl::DrawFolder(), CGfxOutBarCtrl::SetFolderText(), CGfxOutBarCtrl::StartGroupEdit(), and ~CBarFolder().

DWORD CGfxOutBarCtrl::CBarFolder::dwData

Definition at line 126 of file GfxOutBarCtrl.h.

Referenced by CBarFolder(), and CGfxOutBarCtrl::GetFolderData().

CWnd* CGfxOutBarCtrl::CBarFolder::pChild

Definition at line 130 of file GfxOutBarCtrl.h.

Referenced by CGfxOutBarCtrl::AddFolderBar(), CBarFolder(), and CGfxOutBarCtrl::GetFolderChild().

CImageList* CGfxOutBarCtrl::CBarFolder::pLargeImageList

Definition at line 127 of file GfxOutBarCtrl.h.

Referenced by CBarFolder(), CGfxOutBarCtrl::GetFolderImageList(), and CGfxOutBarCtrl::SetFolderImageList().

CImageList* CGfxOutBarCtrl::CBarFolder::pSmallImageList

Definition at line 128 of file GfxOutBarCtrl.h.

Referenced by CBarFolder(), CGfxOutBarCtrl::GetFolderImageList(), and CGfxOutBarCtrl::SetFolderImageList().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
  • WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp
Generated on Fri Jan 31 12:16:19 2003 for WinCvs Source by doxygen 1.3-rc2


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(), CGfxOutBarCtrl::DrawItem(), CGfxOutBarCtrl::GetItemSize(), CGfxOutBarCtrl::GetItemText(), CGfxOutBarCtrl::SetItemText(), CGfxOutBarCtrl::StartItemEdit(), and ~CBarItem().

DWORD CGfxOutBarCtrl::CBarItem::dwData

Definition at line 115 of file GfxOutBarCtrl.h.

Referenced by CBarItem(), CGfxOutBarCtrl::GetItemData(), and CGfxOutBarCtrl::SetItemData().

int CGfxOutBarCtrl::CBarItem::iImageIndex

Definition at line 113 of file GfxOutBarCtrl.h.

Referenced by CBarItem(), CGfxOutBarCtrl::DrawAnimItem(), CGfxOutBarCtrl::DrawItem(), CGfxOutBarCtrl::GetItemImage(), CGfxOutBarCtrl::GetItemSize(), and CGfxOutBarCtrl::SetItemImage().

The documentation for this class was generated from the following files:
  • WinCvs/CJLib/Include/GfxOutBarCtrl.h
  • WinCvs/CJLib/CJLibrary/GfxOutBarCtrl.cpp
Generated on Fri Jan 31 12:16:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 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(), GetInsideRect(), LayoutRowCol(), m_upBorder, and NULL.

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 Fri Jan 31 12:16:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


CGraphConsole Class Reference

Graph console. More...

#include <GraphView.h>

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)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

Private Attributes

CWincvsView * m_view

Detailed Description

Graph console.

Definition at line 229 of file GraphView.h.

Constructor & Destructor Documentation

CGraphConsole::CGraphConsole ( )

Definition at line 957 of file GraphView.cpp.

References CWincvsApp::GetConsoleView(), and m_view.

00958 {
00959     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00960     m_view = app->GetConsoleView();
00961 }

Member Function Documentation

long CGraphConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 971 of file GraphView.cpp.

References m_view, and CWincvsView::OutConsole().

00972 {
00973     if( m_view != 0L )
00974         m_view->OutConsole(txt, len, true);
00975
00976     return len;
00977 }

long CGraphConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 963 of file GraphView.cpp.

References m_view, and CWincvsView::OutConsole().

00964 {
00965     if( m_view != 0L )
00966         m_view->OutConsole(txt, len);
00967
00968     return len;
00969 }

Member Data Documentation

CWincvsView* CGraphConsole::m_view [private]

View

Definition at line 237 of file GraphView.h.

Referenced by CGraphConsole(), cvs_err(), and cvs_out().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:16:22 2003 for WinCvs Source by doxygen 1.3-rc2


CGraphDoc Class Reference

Graph document class. More...

#include <GraphDoc.h>

Inheritance diagram for CGraphDoc:

[legend]
Collaboration diagram for CGraphDoc:

[legend]
List of all members.

Public Methods

virtual | ~CGraphDoc ()
virtual BOOL | OnNewDocument ()
OnNewDocument virtual override, clear the data.

virtual void | Serialize (CArchive &ar)
void | SetNode (CLogNode *node, const char *dir)
CLogNode * | GetNode (void)
Get the node data.

EntnodeData * | GetEntryInfo (void)
Get the entry info.

const char * | GetDir (void) const
Get the directory.

const char * | GetName (void) const
Get the file name.

CGraphView * | GetTreeView (void)

Protected Methods

CGraphDoc ()
afx_msg long | NumNodes ()

Private Methods

void | Clear (void)

Private Attributes

CLogNode * | m_fNode
CString | m_fDir
CString | m_fName
EntnodeData * m_fData

Detailed Description

Graph document class.

Definition at line 38 of file GraphDoc.h.

Constructor & Destructor Documentation

CGraphDoc::CGraphDoc ( ) [protected]

Definition at line 99 of file GraphDoc.cpp.

References m_fData, and m_fNode.

00100 {
00101     EnableAutomation();
00102
00103     AfxOleLockApp();
00104
00105     m_fNode = 0L;
00106     m_fData = 0L;
00107 }

CGraphDoc::~CGraphDoc ( ) [virtual]

Definition at line 109 of file GraphDoc.cpp.

References Clear().

00110 {
00111     AfxOleUnlockApp();
00112
00113     Clear();
00114 }

Member Function Documentation

void CGraphDoc::Clear ( void ) [private]

Clear the data

Definition at line 119 of file GraphDoc.cpp.

References m_fData, m_fDir, m_fName, m_fNode, and EntnodeData::UnRef().

Referenced by OnNewDocument(), SetNode(), and ~CGraphDoc().

00120 {
00121     if( m_fNode != 0L )
00122     {
00123         delete m_fNode;
00124         m_fNode = 0L;
00125     }
00126
00127     if( m_fData != 0L )
00128     {
00129         m_fData->UnRef();
00130         m_fData = 0L;
00131     }
00132
00133     m_fDir.Empty();
00134     m_fName.Empty();
00135 }

const char * CGraphDoc::GetDir ( void ) const [inline]

Get the directory.

Definition at line 119 of file GraphDoc.h.

References m_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().

00120 {
00121     return m_fDir;
00122 }

EntnodeData * CGraphDoc::GetEntryInfo ( void ) [inline]

Get the entry info.

Definition at line 113 of file GraphDoc.h.

References m_fData.

Referenced by CGraphView::CalcImageSize(), CGraphView::OnBeginPrinting(), CGraphView::OnDraw(), and CGraphView::OnPrint().

00114 {
00115     return m_fData;
00116 }

const char * CGraphDoc::GetName ( void ) const [inline]

Get the file name.

Definition at line 125 of file GraphDoc.h.

References m_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().

00126 {
00127     return m_fName;
00128 }

CLogNode * CGraphDoc::GetNode ( void ) [inline]

Get the node data.

Definition at line 107 of file GraphDoc.h.

References m_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().

00108 {
00109     return m_fNode;
00110 }

CGraphView * CGraphDoc::GetTreeView ( void )

Get the graph (tree) view

Returns:
The graph view

Definition at line 229 of file GraphDoc.cpp.

References NULL.

Referenced by SetNode().

00230 {
00231     CView* view;
00232
00233     POSITION posv = GetFirstViewPosition();
00234     while( posv != NULL )
00235     {
00236         view = GetNextView(posv);
00237         if( view->IsKindOf(RUNTIME_CLASS(CGraphView)) )
00238             return (CGraphView*)view;
00239     }
00240
00241     return NULL;
00242 }

long CGraphDoc::NumNodes ( ) [protected]

Get the number of nodes

Returns:
The number of nodes

Definition at line 266 of file GraphDoc.cpp.

00267 {
00268     return 0;
00269 }

BOOL CGraphDoc::OnNewDocument ( ) [virtual]

OnNewDocument virtual override, clear the data.

Definition at line 138 of file GraphDoc.cpp.

References Clear(), FALSE, and TRUE.

00139 {
00140     Clear();
00141
00142     if( !CDocument::OnNewDocument() )
00143         return FALSE;
00144
00145     return TRUE;
00146 }

void CGraphDoc::Serialize ( CArchive & ar ) [virtual]

Definition at line 213 of file GraphDoc.cpp.

00214 {
00215     if (ar.IsStoring())
00216     {
00217         // TODO: add storing code here
00218     }
00219     else
00220     {
00221         // TODO: add loading code here
00222     }
00223 }

void CGraphDoc::SetNode | ( | CLogNode * | node,
 |  | const char * | folder
 | ) |

Set the node data

Parameters:
node | Log node
folder | Folder

Definition at line 153 of file GraphDoc.cpp.

References CGraphView::CalcImageSize(), Clear(), CStr, cvs_err(), Entries_Open(), Entries_SetVisited(), GetTreeView(), m_fData, m_fDir, m_fName, m_fNode, NormalizeFn(), EntnodeData::Ref(), and stat.

Referenced by CvsLogParse().

00154 {
00155     Clear();
00156
00157     // Normalize folder/fname
00158     const char* fn = (**(CLogNodeHeader*)node).WorkingFile();
00159     char dir[_MAX_PATH];
00160     char name[_MAX_PATH];
00161     NormalizeFn(folder, fn, dir, name);
00162
00163     m_fNode = node;
00164     m_fDir = dir;
00165
00166     // Get the CVS/Entries infos for this file
00167     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00168     if( !Entries_Open(entries, dir) )
00169     {
00170         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00171     }
00172     else
00173     {
00174         if( node->GetType() != kNodeHeader )
00175         {
00176             cvs_err("Warning : Top node is not a RCS file description !\n");
00177         }
00178         else
00179         {
00180             CStr fullPath;
00181
00182             fullPath << m_fDir;
00183             fullPath << fn;
00184
00185             struct stat sb;
00186             if( stat(fullPath, &sb) == -1 )
00187             {
00188                 cvs_err("Warning : Unknown file '%s'\n", name);
00189             }
00190             else
00191             {
00192                 m_fData = Entries_SetVisited(dir, entries, name, sb, false);
00193                 m_fData->Ref();
00194                 m_fName = name;
00195             }
00196         }
00197     }
00198
00199     // Create the graph and redraw
00200     CGraphView* view = GetTreeView();
00201     if( view != 0L )
00202     {
00203         view->CalcImageSize();
00204         view->Invalidate();
00205         SetTitle(m_fName);
00206     }
00207 }

Member Data Documentation

EntnodeData* CGraphDoc::m_fData [private]

Node data

Definition at line 89 of file GraphDoc.h.

Referenced by CGraphDoc(), Clear(), GetEntryInfo(), and SetNode().

CString CGraphDoc::m_fDir [private]

Directory

Definition at line 87 of file GraphDoc.h.

Referenced by Clear(), GetDir(), and SetNode().

CString CGraphDoc::m_fName [private]

File name

Definition at line 88 of file GraphDoc.h.

Referenced by Clear(), GetName(), and SetNode().

CLogNode* CGraphDoc::m_fNode [private]

Node data

Definition at line 86 of file GraphDoc.h.

Referenced by CGraphDoc(), Clear(), GetNode(), and SetNode().

The documentation for this class was generated from the following files:
  • WinCvs/GraphDoc.h
  • WinCvs/GraphDoc.cpp
Generated on Fri Jan 31 12:16:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:24 2003 for WinCvs Source by doxygen 1.3-rc2


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_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.

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 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 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 PromptForColor().

00196 {
00197     PromptForColor(m_rgbDead);
00198 }

void CGraphOptDlg::OnHeader ( ) [protected]

Definition at line 175 of file GraphOptDlg.cpp.

References PromptForColor().

00176 {
00177     PromptForColor(m_rgbHeader);
00178 }

void CGraphOptDlg::OnNode ( ) [protected]

Definition at line 190 of file GraphOptDlg.cpp.

References 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, 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 PromptForColor().

00206 {
00207     PromptForColor(m_rgbSelection);
00208 }

void CGraphOptDlg::OnShadow ( ) [protected]

Definition at line 210 of file GraphOptDlg.cpp.

References PromptForColor().

00211 {
00212     PromptForColor(m_rgbShadow);
00213 }

void CGraphOptDlg::OnState ( ) [protected]

Definition at line 200 of file GraphOptDlg.cpp.

References PromptForColor().

00201 {
00202     PromptForColor(m_rgbState);
00203 }

void CGraphOptDlg::OnTag ( ) [protected]

Definition at line 180 of file GraphOptDlg.cpp.

References 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 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 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(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbDead

Definition at line 63 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbHeader

Definition at line 67 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbNode

Definition at line 64 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbSelection

Definition at line 61 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbShadow

Definition at line 60 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbState

Definition at line 62 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

CColorStatic CGraphOptDlg::m_rgbTag

Definition at line 66 of file GraphOptDlg.h.

Referenced by CGraphOptDlg(), GetAllColors(), and OnReset().

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 Fri Jan 31 12:16:27 2003 for WinCvs Source by doxygen 1.3-rc2


CGraphRectTracker Class Reference

Graph rectangle tracker. More...

#include <GraphView.h>

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)
OnChangedRect virtual override.

Protected Attributes

CGraphView * m_view

Detailed Description

Graph rectangle tracker.

Definition at line 304 of file GraphView.h.

Constructor & Destructor Documentation

CGraphRectTracker::CGraphRectTracker ( CGraphView * view ) [inline]

Definition at line 307 of file GraphView.h.

References m_view.

00307 : m_view(view) {}

Member Function Documentation

void CGraphRectTracker::OnChangedRect ( const CRect & rectOld ) [virtual]

OnChangedRect virtual override.

Definition at line 807 of file GraphView.cpp.

References CScrollView::GetDeviceScrollPosition(), and m_view.

00808 {
00809 #if 0 // :-< doesn't work...
00810     CRect r;
00811     m_view->GetClientRect(&r);
00812     CPoint rb = m_rect.BottomRight();
00813
00814     if( !r.PtInRect(rb) )
00815     {
00816         CPoint orig = m_view->GetDeviceScrollPosition();
00817         CPoint offset;
00818         if( rb.x >= r.right )
00819             offset.x += 10;
00820
00821         if( rb.y >= r.bottom )
00822             offset.y += 10;
00823
00824         orig += offset;
00825         m_rect -= offset;
00826         m_view->ScrollToPosition(orig);
00827     }
00828 #endif
00829 }

Member Data Documentation

CGraphView* CGraphRectTracker::m_view [protected]

View

Definition at line 311 of file GraphView.h.

Referenced by CGraphRectTracker(), and OnChangedRect().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:16:27 2003 for WinCvs Source by doxygen 1.3-rc2


CGraphView Class Reference

Graph view class. More...

#include <GraphView.h>

Inheritance diagram for CGraphView:

[legend]
Collaboration diagram for CGraphView:

[legend]
List of all members.

Public Methods

void | CalcImageSize (void)
Calculate the size of the graph and set the scroll bars.

Static Public Methods

CImageList & | GetImgList (void)
Get the image list.

Protected Methods

CGraphView ()
virtual | ~CGraphView ()
virtual void | OnDraw (CDC *pDC)
OnDraw virtual override, paint the graph.

virtual void | OnInitialUpdate ()
OnInitialUpdate virtual override, set the initial scroll sizes.

virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
OnBeginPrinting virtual override.

virtual void | OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
OnEndPrinting virtual override.

virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
OnPreparePrinting virtual override.

virtual void | OnPrint (CDC *pDC, CPrintInfo *pInfo)
OnPrint virtual override.

afx_msg void | OnLButtonDown (UINT nFlags, CPoint point)
WM_LBUTTONDOWN message handler, update selection.

afx_msg void | OnViewReload ()
WM_COMMAND message handler, reload view.

afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewDiff ()
WM_COMMAND message handler, diff the selection.

afx_msg void | OnUpdateViewDiff (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewUpdate ()
WM_COMMAND message handler, update.

afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewTag ()
WM_COMMAND message handler, tag update.

afx_msg void | OnUpdateViewTag (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewDelrev ()
WM_COMMAND message handler, delete selected revisions.

afx_msg void | OnUpdateViewDelrev (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewSelnonsig ()
WM_COMMAND message handler, select non-significant revisions.

afx_msg void | OnUpdateViewSelnonsig (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewRetrieve ()
WM_COMMAND message handler, retrieve revisions.

afx_msg void | OnUpdateViewRetrieve (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | DisableUpdate (CCmdUI *pCmdUI)
Update command UI state, disable command.

afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point)
afx_msg void | OnQueryAnnotate ()
WM_COMMAND message handler, annotate selection.

afx_msg void | OnUpdateQueryAnnotate (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnGraphGraphoptions ()
WM_COMMAND message handler, display graph options menu.

afx_msg void | OnUpdateGraphChangelogmessage (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnGraphChangelogmessage ()
WM_COMMAND message handler, change the log message.

afx_msg void | OnUpdateGraphSetdescription (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnGraphSetdescription ()
WM_COMMAND message handler, set the description.

afx_msg void | OnGraphSetstate ()
WM_COMMAND message handler, set the state.

afx_msg void | OnUpdateGraphSetstate (CCmdUI *pCmdUI)
Update command UI state.

afx_msg void | OnViewUnlockf ()
WM_COMMAND message handler, unlock the selection.

afx_msg void | OnUpdateViewUnlockf (CCmdUI *pCmdUI)
Update command UI state.

Private Methods

bool | DisableCommon ()
bool | IsSelSingleNode (kLogNode type, bool equal=true)
void | OnInitMenuPopup (CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu)
WM_INITMENUPOPUP message handler.

Private Attributes

int | m_numberOfPages
int | m_pageHeight

Static Private Attributes

CImageList | m_imageList

Detailed Description

Graph view class.

Definition at line 318 of file GraphView.h.

Constructor & Destructor Documentation

CGraphView::CGraphView ( ) [protected]

Definition at line 1102 of file GraphView.cpp.

References m_imageList.

01103 {
01104     if( m_imageList.m_hImageList == 0L )
01105         m_imageList.Create(IDB_SMALLICONS, 16, 1, RGB(255, 255, 255));
01106 }

CGraphView::~CGraphView ( ) [protected, virtual]

Definition at line 1108 of file GraphView.cpp.

01109 {
01110 }

Member Function Documentation

void CGraphView::CalcImageSize ( void )

Calculate the size of the graph and set the scroll bars.

Definition at line 1163 of file GraphView.cpp.

References CWinLogData::Bounds(), CWinLogData::ComputeBounds(), CWinLogData::CreateNewData(), CGraphDoc::GetEntryInfo(), CGraphDoc::GetNode(), and CWinLogData::Offset().

Referenced by OnEndPrinting(), and CGraphDoc::SetNode().

01164 {
01165     const CPoint startPoint(STARTPOINT_PT);
01166     CWindowDC dc(this);
01167     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01168
01169     CLogNode* root = pDoc->GetNode();
01170     if( root == 0L )
01171         return;
01172
01173     // Set all the bounds locations
01174     CWinLogData* data = CWinLogData::CreateNewData(root);
01175     root->SetUserData(data);
01176     data->ComputeBounds(startPoint, dc, pDoc->GetEntryInfo());
01177
01178     // Re-offset from (0, 0)
01179     CRect bounds = data->Bounds();
01180     data->Offset(startPoint - bounds.TopLeft());
01181     bounds = data->Bounds();
01182
01183     // Set the scroll size, we add the margin of the start point offset on each side
01184     SetScrollSizes(MM_TEXT, bounds.Size() + CSize(startPoint)+CSize(startPoint)+CSize(SHADOW_OFFSET_PT));
01185 }

bool CGraphView::DisableCommon ( ) [private]

Check whether the commands should be disabled

Returns:
true if commands should be disabled, false otherwise

Definition at line 1522 of file GraphView.cpp.

References CGraphDoc::GetNode(), and CWincvsApp::IsCvsRunning().

Referenced by OnContextMenu(), OnUpdateGraphChangelogmessage(), OnUpdateGraphSetdescription(), OnUpdateGraphSetstate(), OnUpdateQueryAnnotate(), OnUpdateViewDelrev(), OnUpdateViewDiff(), OnUpdateViewReload(), OnUpdateViewRetrieve(), OnUpdateViewSelnonsig(), OnUpdateViewTag(), OnUpdateViewUnlockf(), and OnUpdateViewUpdate().

01523 {
01524     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01525     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01526     CLogNode* root = pDoc->GetNode();
01527
01528     return root == 0L || root->GetUserData() == 0L || app->IsCvsRunning() || this != CWnd::GetFocus() || gCvsPrefs.empty();
01529 }

void CGraphView::DisableUpdate ( CCmdUI * pCmdUI ) [protected]

Update command UI state, disable command.

Definition at line 1677 of file GraphView.cpp.

01678 {
01679     pCmdUI->Enable(false);
01680 }

CImageList& CGraphView::GetImgList ( void ) [inline, static]

Get the image list.

Definition at line 402 of file GraphView.h.

Referenced by CWinLogRevData::UpdateSelf().

00402 { return m_imageList; }

bool CGraphView::IsSelSingleNode | ( | kLogNode | type,
 |  | bool | equal = true
 | ) | [private]

Check whether a single node is selected

Parameters:
kLogNode | Node type
equal | true if selection should be equal, false otherwise
Returns:
true if the selection is a single node, false otherwise

Definition at line 1537 of file GraphView.cpp.

References CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), TGraphCmdStatus::GetSelCount(), CWinLogData::GetType(), and TGraph::TraverseGraph().

Referenced by OnUpdateGraphChangelogmessage(), OnUpdateGraphSetdescription(), OnUpdateGraphSetstate(), OnUpdateQueryAnnotate(), OnUpdateViewRetrieve(), and OnUpdateViewUnlockf().

01538 {
01539     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01540     CLogNode* root = pDoc->GetNode();
01541
01542     TGraphCmdStatus trav;
01543     trav.TraverseGraph(root);
01544
01545     return (trav.GetSelCount() == 1 &&
01546         (equal ? trav.GetSel1()->GetType() == type : trav.GetSel1()->GetType() != type));
01547 }

void CGraphView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnBeginPrinting virtual override.

Definition at line 1452 of file GraphView.cpp.

References CWinLogData::Bounds(), CWinLogData::ComputeBounds(), CWinLogData::CreateNewData(), CGraphDoc::GetEntryInfo(), CGraphDoc::GetNode(), m_numberOfPages, and m_pageHeight.

01453 {
01454     CScrollView::OnBeginPrinting(pDC, pInfo);
01455
01456     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01457     CLogNode* root = pDoc->GetNode();
01458     if( root == 0L )
01459         return;
01460
01461     // set all the bounds locations
01462     CWinLogData* data = CWinLogData::CreateNewData(root);
01463     root->SetUserData(data);
01464     CPoint start(0, 0);
01465     data->ComputeBounds(start, *pDC, pDoc->GetEntryInfo());
01466
01467     // compute the number of pages
01468     CRect bounds = data->Bounds();
01469     m_pageHeight = pDC->GetDeviceCaps(VERTRES);
01470     m_numberOfPages = bounds.Height() / m_pageHeight + 1;
01471
01472     pInfo->SetMaxPage(m_numberOfPages);
01473 }

void CGraphView::OnContextMenu | ( | CWnd * | pWnd,
 |  | CPoint | point
 | ) | [protected]

Display context menu

Parameters:
pWnd | Window
point | Mouse position

Definition at line 1687 of file GraphView.cpp.

References DisableCommon(), FALSE, CScrollView::GetDeviceScrollPosition(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), TGraphCmdStatus::GetSelCount(), CWinLogData::GetType(), CWinLogData::HitTest(), CWinLogData::Selected(), CWinLogData::SetSelected(), TGraph::TraverseGraph(), and CWinLogData::UnselectAll().

01688 {
01689     // Comply with windows UI standard (Windows Explorer file view used as a reference),
01690     // change selections according to the state of Control and Shift keys
01691     BYTE abKeyboardState[256];
01692     BOOL bControlState = FALSE;
01693     BOOL bShiftState = FALSE;
01694     memset( abKeyboardState, 0, 256 );
01695
01696     if( GetKeyboardState(abKeyboardState) )
01697     {
01698         bControlState = abKeyboardState[VK_CONTROL] & 0x80;
01699         bShiftState = abKeyboardState[VK_SHIFT] & 0x80;
01700     }
01701
01702     if( (!bControlState || (bControlState && bShiftState)) && !DisableCommon() )
01703     {
01704         CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01705         CLogNode* root = pDoc->GetNode();
01706
01707         TGraphCmdStatus trav;
01708         trav.TraverseGraph(root);
01709
01710         CWinLogData* data = (CWinLogData*)root->GetUserData();
01711         CPoint hitPoint(point);
01712         ScreenToClient(&hitPoint);
01713         hitPoint += GetDeviceScrollPosition();
01714         CWinLogData* hit = data->HitTest(hitPoint);
01715
01716         if( hit != 0L )
01717         {
01718             if( trav.GetSelCount() == 0 )
01719             {
01720                 hit->SetSelected(this, true);
01721             }
01722             else if( trav.GetSelCount() >= 1 && trav.GetSel1()->GetType() != kNodeHeader )
01723             {
01724                 if( !(hit->Selected() && bShiftState) && !(bControlState && bShiftState && hit->Selected()) )
01725                 {
01726                     data->UnselectAll(this);
01727                 }
01728
01729                 hit->SetSelected(this, true);
01730             }
01731         }
01732     }
01733
01734     // Get the menu to display from the main app window, which for graph view
01735     // will be IDR_GRAPH,  The submenu to display is the menu under "Graph".
01736     // Note that if the position of this menu changes, the index under
01737     // GetSubMenu must also change.
01738     CMenu* pMenu    = ::AfxGetMainWnd()->GetMenu();
01739     CMenu* pSubMenu = pMenu->GetSubMenu(5);
01740
01741     pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON, point.x, point.y, this);
01742 }

void CGraphView::OnDraw ( CDC * pDC ) [protected, virtual]

OnDraw virtual override, paint the graph.

Definition at line 1197 of file GraphView.cpp.

References CGraphDoc::GetEntryInfo(), CGraphDoc::GetNode(), and CWinLogData::Update().

01198 {
01199     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01200     CLogNode* root = pDoc->GetNode();
01201     if( root == 0L || root->GetUserData() == 0L )
01202         return;
01203
01204     CWinLogData* data = (CWinLogData*)root->GetUserData();
01205
01206     pDC->SetTextAlign(TA_CENTER);
01207     pDC->SetBkMode(TRANSPARENT);
01208     data->Update(*pDC, pDoc->GetEntryInfo());
01209 }

void CGraphView::OnEndPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnEndPrinting virtual override.

Definition at line 1476 of file GraphView.cpp.

References CalcImageSize().

01477 {
01478     CScrollView::OnEndPrinting(pDC, pInfo);
01479
01480     CalcImageSize();
01481     Invalidate();
01482 }

void CGraphView::OnGraphChangelogmessage ( ) [protected]

WM_COMMAND message handler, change the log message.

Definition at line 1905 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), ASSERT, CleanupLogMsg(), CompatGetAdminOptions(), CPStr, CStr, CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), launchCVS(), OnViewReload(), CvsArgs::print(), and TGraph::TraverseGraph().

01906 {
01907     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01908     CLogNode* root = pDoc->GetNode();
01909     if( root == 0L || root->GetUserData() == 0L )
01910         return;
01911
01912     TGraphCmdStatus trav;
01913     trav.TraverseGraph(root);
01914
01915     CLogNode* node = trav.GetSel1()->Node();
01916     ASSERT(node->GetType() == kNodeRev);
01917     CRevFile& rev = **(CLogNodeRev*)node;
01918
01919     CPStr msg = (const char*)rev.DescLog();
01920
01921     if( CompatGetAdminOptions(kChangeLog, msg) )
01922     {
01923         CvsArgs args;
01924         args.add("admin");
01925         args.add(CStr("-m") + trav.GetSel1()->GetStr() + CStr(":") + CleanupLogMsg(msg));
01926
01927         args.add(pDoc->GetName());
01928         args.print(pDoc->GetDir());
01929
01930         CGraphConsole cons;
01931         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01932         OnViewReload();
01933     }
01934 }

void CGraphView::OnGraphGraphoptions ( ) [protected]

WM_COMMAND message handler, display graph options menu.

Definition at line 1876 of file GraphView.cpp.

References CompatGetGraphOptions(), and CWincvsApp::UpdateAllDocsView().

01877 {
01878     if( CompatGetGraphOptions(gGraphSelColor, gGraphShadowColor,
01879         gGraphHeaderColor, gGraphTagColor, gGraphBranchColor,
01880         gGraphNodeColor, gGraphDeadNodeColor, gGraphUserStateNodeColor) )
01881     {
01882         // add any additional processing here
01883     }
01884
01885     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
01886     if( pApp )
01887     {
01888         pApp->UpdateAllDocsView();
01889     }
01890 }

void CGraphView::OnGraphSetdescription ( ) [protected]

WM_COMMAND message handler, set the description.

Definition at line 1949 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), ASSERT, CleanupLogMsg(), CompatGetAdminOptions(), CPStr, CStr, CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), launchCVS(), OnViewReload(), CvsArgs::print(), and TGraph::TraverseGraph().

01950 {
01951     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01952     CLogNode* root = pDoc->GetNode();
01953     if( root == 0L || root->GetUserData() == 0L )
01954         return;
01955
01956     TGraphCmdStatus trav;
01957     trav.TraverseGraph(root);
01958
01959     CLogNode* node = trav.GetSel1()->Node();
01960     ASSERT(node->GetType() == kNodeHeader);
01961     CRcsFile& rev = **(CLogNodeHeader*)node;
01962
01963     CPStr msg = (const char*)rev.DescLog();
01964
01965     if( CompatGetAdminOptions(kSetDescription, msg) )
01966     {
01967         CvsArgs args;
01968         args.add("admin");
01969         args.add(CStr("-t-") + CleanupLogMsg(msg));
01970
01971         args.add(pDoc->GetName());
01972         args.print(pDoc->GetDir());
01973
01974         CGraphConsole cons;
01975         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01976         OnViewReload();
01977     }
01978 }

void CGraphView::OnGraphSetstate ( ) [protected]

WM_COMMAND message handler, set the state.

Definition at line 1993 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), ASSERT, CleanupLogMsg(), CompatGetAdminOptions(), CPStr, CStr, CvsAlert(), CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), launchCVS(), OnViewReload(), CvsArgs::print(), and TGraph::TraverseGraph().

01994 {
01995     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01996     CLogNode* root = pDoc->GetNode();
01997     if( root == 0L || root->GetUserData() == 0L )
01998         return;
01999
02000     TGraphCmdStatus trav;
02001     trav.TraverseGraph(root);
02002
02003     CLogNode* node = trav.GetSel1()->Node();
02004     ASSERT(node->GetType() == kNodeRev);
02005     CRevFile& rev = **(CLogNodeRev*)node;
02006
02007     CPStr state = (const char*)rev.State();
02008
02009     if( strcmp("dead", (const char*)state ) == 0 &&
02010         CvsAlert("The revision state is: \"dead\". You should not alter it manually.\nAre you sure you want to continue?", "Cancel", "Continue") )
02011     {
02012         return;
02013     }
02014
02015     if( CompatGetAdminOptions(kSetState, state) )
02016     {
02017         CvsArgs args;
02018         args.add("admin");
02019         args.add("-s");
02020         args.add(CleanupLogMsg(state) + CStr(":") + trav.GetSel1()->GetStr());
02021
02022         args.add(pDoc->GetName());
02023         args.print(pDoc->GetDir());
02024
02025         CGraphConsole cons;
02026         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
02027         OnViewReload();
02028     }
02029 }

void CGraphView::OnInitialUpdate ( ) [protected, virtual]

OnInitialUpdate virtual override, set the initial scroll sizes.

Definition at line 1188 of file GraphView.cpp.

01189 {
01190     CScrollView::OnInitialUpdate();
01191
01192     SetScrollSizes(MM_TEXT, CSize(200, 100));
01193     //CalcImageSize();
01194 }

void CGraphView::OnInitMenuPopup | ( | CMenu * | pPopupMenu,
 |  | UINT | nIndex,
 |  | BOOL | bSysMenu
 | ) | [private]

WM_INITMENUPOPUP message handler.

Definition at line 1745 of file GraphView.cpp.

References ASSERT, and NULL.

01746 {
01747     ASSERT(pPopupMenu != NULL);
01748     // Check the enabled state of various menu items.
01749
01750     CCmdUI state;
01751     state.m_pMenu = pPopupMenu;
01752     ASSERT(state.m_pOther == NULL);
01753     ASSERT(state.m_pParentMenu == NULL);
01754
01755     // Determine if menu is popup in top-level menu and set m_pOther to
01756     // it if so (m_pParentMenu == NULL indicates that it is secondary popup).
01757     HMENU hParentMenu;
01758     if( AfxGetThreadState()->m_hTrackingMenu == pPopupMenu->m_hMenu )
01759         state.m_pParentMenu = pPopupMenu;    // Parent == child for tracking popup.
01760     else if( (hParentMenu = ::GetMenu(m_hWnd)) != NULL )
01761     {
01762         CWnd* pParent = this;
01763         // Child windows don't have menus--need to go to the top!
01764         if( pParent != NULL &&
01765             (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL )
01766         {
01767             int nIndexMax = ::GetMenuItemCount(hParentMenu);
01768             for(int nIndex = 0; nIndex < nIndexMax; nIndex++)
01769             {
01770                 if( ::GetSubMenu(hParentMenu, nIndex) == pPopupMenu->m_hMenu )
01771                 {
01772                     // When popup is found, m_pParentMenu is containing menu.
01773                     state.m_pParentMenu = CMenu::FromHandle(hParentMenu);
01774                     break;
01775                 }
01776             }
01777         }
01778     }
01779
01780     state.m_nIndexMax = pPopupMenu->GetMenuItemCount();
01781     for(state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; state.m_nIndex++)
01782     {
01783         state.m_nID = pPopupMenu->GetMenuItemID(state.m_nIndex);
01784         if( state.m_nID == 0 )
01785             continue; // Menu separator or invalid cmd - ignore it.
01786
01787         ASSERT(state.m_pOther == NULL);
01788         ASSERT(state.m_pMenu != NULL);
01789         if( state.m_nID == (UINT)-1 )
01790         {
01791             // Possibly a popup menu, route to first item of that popup.
01792             state.m_pSubMenu = pPopupMenu->GetSubMenu(state.m_nIndex);
01793             if( state.m_pSubMenu == NULL ||
01794                 (state.m_nID = state.m_pSubMenu->GetMenuItemID(0)) == 0 ||
01795                 state.m_nID == (UINT)-1 )
01796             {
01797                 continue;       // First item of popup can't be routed to.
01798             }
01799
01800             state.DoUpdate(this, TRUE);   // Popups are never auto disabled.
01801         }
01802         else
01803         {
01804             // Normal menu item.
01805             // Auto enable/disable if frame window has m_bAutoMenuEnable
01806             // set and command is _not_ a system command.
01807             state.m_pSubMenu = NULL;
01808             state.DoUpdate(this, FALSE);
01809         }
01810
01811         // Adjust for menu deletions and additions.
01812         UINT nCount = pPopupMenu->GetMenuItemCount();
01813         if( nCount < state.m_nIndexMax )
01814         {
01815             state.m_nIndex -= (state.m_nIndexMax - nCount);
01816             while( state.m_nIndex < nCount &&
01817                 pPopupMenu->GetMenuItemID(state.m_nIndex) == state.m_nID )
01818             {
01819                 state.m_nIndex++;
01820             }
01821         }
01822
01823         state.m_nIndexMax = nCount;
01824     }
01825 }

void CGraphView::OnLButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

WM_LBUTTONDOWN message handler, update selection.

Definition at line 1230 of file GraphView.cpp.

References CvsLogOutput(), CWincvsApp::GetConsoleView(), CScrollView::GetDeviceScrollPosition(), CGraphDoc::GetNode(), CWinLogData::HitTest(), CWinLogData::Selected(), CWinLogData::SetSelected(), TGraph::TraverseGraph(), and CWinLogData::UnselectAll().

01231 {
01232     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01233     CLogNode* root = pDoc->GetNode();
01234     if( root == 0L || root->GetUserData() == 0L )
01235         return;
01236
01237     CWinLogData* data = (CWinLogData*)root->GetUserData();
01238
01239     if( nFlags & MK_LBUTTON )
01240     {
01241         if((nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0)
01242             data->UnselectAll(this);
01243
01244         point += GetDeviceScrollPosition();
01245
01246         CWinLogData* hit = data->HitTest(point);
01247         if( hit != 0L )
01248         {
01249             if( (nFlags & MK_SHIFT) == 0 && (nFlags & MK_CONTROL) == 0 )
01250             {
01251                 if( !hit->Selected() )
01252                 {
01253                     hit->SetSelected(this, true);
01254                     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01255                     CWincvsView* view = app->GetConsoleView();
01256
01257                     if( view != 0L )
01258                     {
01259                         CColorConsole out(view);
01260                         CvsLogOutput(out, hit->Node());
01261                     }
01262                 }
01263             }
01264             else
01265             {
01266                 hit->SetSelected(this, !hit->Selected());
01267             }
01268         }
01269         else
01270         {
01271             CGraphRectTracker track(this);
01272             point -= GetDeviceScrollPosition();
01273             if( track.TrackRubberBand(this, point, true) )
01274             {
01275                 // Traverse and mark
01276                 track.m_rect.OffsetRect(GetDeviceScrollPosition());
01277                 track.m_rect.NormalizeRect();
01278
01279                 TGraphRectSelect traversal((nFlags & MK_CONTROL) != 0, this, track.m_rect);
01280                 traversal.TraverseGraph(root);
01281             }
01282         }
01283     }
01284     else if( nFlags & MK_RBUTTON )
01285     {
01286     }
01287
01288     CScrollView::OnLButtonDown(nFlags, point);
01289 }

BOOL CGraphView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

OnPreparePrinting virtual override.

Definition at line 1485 of file GraphView.cpp.

References TRUE.

01486 {
01487     BOOL res = DoPreparePrinting(pInfo);
01488     if( !res )
01489         return res;
01490
01491     return TRUE;
01492 }

void CGraphView::OnPrint | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnPrint virtual override.

Definition at line 1495 of file GraphView.cpp.

References CGraphDoc::GetEntryInfo(), CGraphDoc::GetNode(), m_pageHeight, and CWinLogData::Update().

01496 {
01497     if( !pDC->IsPrinting() )
01498         return;
01499
01500     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01501     CLogNode* root = pDoc->GetNode();
01502     if( root == 0L || root->GetUserData() == 0L )
01503         return;
01504
01505     CWinLogData* data = (CWinLogData*)root->GetUserData();
01506
01507     // Orient the viewport so that the first row to be printed
01508     // has a viewport coordinate of (0,0).
01509     int yTopOfPage = (pInfo->m_nCurPage -1) * m_pageHeight;
01510     pDC->SetViewportOrg(0, -yTopOfPage);
01511     pDC->SetTextAlign(TA_CENTER);
01512     pDC->SetBkMode(TRANSPARENT);
01513     data->Update(*pDC, pDoc->GetEntryInfo());
01514
01515     //  CScrollView::OnPrint(pDC, pInfo);
01516 }

void CGraphView::OnQueryAnnotate ( ) [protected]

WM_COMMAND message handler, annotate selection.

Definition at line 1840 of file GraphView.cpp.

References CvsArgs::add(), CStr, CGraphDoc::GetDir(), GetExtension(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), launchCVS(), LaunchViewer(), CvsArgs::print(), and TGraph::TraverseGraph().

01841 {
01842     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01843     CLogNode* root = pDoc->GetNode();
01844     if( root == 0L || root->GetUserData() == 0L )
01845         return;
01846
01847     TGraphCmdStatus trav;
01848     trav.TraverseGraph(root);
01849
01850     if( gCvsPrefs.ExtDiff() != 0L )
01851     {
01852         CStr file, prf, ext, base;
01853         CvsArgs args;
01854
01855         GetExtension(pDoc->GetName(), base, ext);
01856
01857         prf = base;
01858         prf << "_ann_";
01859         prf << trav.GetSel1()->GetStr();
01860         prf << '_';
01861         args.add("annotate");
01862         args.add("-r");
01863         args.add(trav.GetSel1()->GetStr());
01864         args.add(pDoc->GetName());
01865         args.print(pDoc->GetDir());
01866         file = launchCVS(pDoc->GetDir(), args, prf.c_str(), ext);
01867
01868         if( file.empty() )
01869             return;
01870
01871         LaunchViewer(file);
01872     }
01873 }

void CGraphView::OnUpdateGraphChangelogmessage ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1893 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

01894 {
01895     BOOL enabled = FALSE;
01896     if( !DisableCommon() )
01897     {
01898         enabled = IsSelSingleNode(kNodeRev);
01899     }
01900
01901     pCmdUI->Enable(enabled);
01902 }

void CGraphView::OnUpdateGraphSetdescription ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1937 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

01938 {
01939     BOOL enabled = FALSE;
01940     if( !DisableCommon() )
01941     {
01942         enabled = IsSelSingleNode(kNodeHeader);
01943     }
01944
01945     pCmdUI->Enable(enabled);
01946 }

void CGraphView::OnUpdateGraphSetstate ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1981 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

01982 {
01983     BOOL enabled = FALSE;
01984     if( !DisableCommon() )
01985     {
01986         enabled = IsSelSingleNode(kNodeRev);
01987     }
01988
01989     pCmdUI->Enable(enabled);
01990 }

void CGraphView::OnUpdateQueryAnnotate ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1828 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

01829 {
01830     BOOL enabled = FALSE;
01831     if( !DisableCommon() )
01832     {
01833         enabled = IsSelSingleNode(kNodeHeader, false);
01834     }
01835
01836     pCmdUI->Enable(enabled);
01837 }

void CGraphView::OnUpdateViewDelrev ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1594 of file GraphView.cpp.

References DisableCommon(), TGraphDelCmd::GetCountSel(), CGraphDoc::GetNode(), TGraphDelCmd::GetOnlyRev(), and TGraph::TraverseGraph().

01595 {
01596     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01597     CLogNode* root = pDoc->GetNode();
01598     if( DisableCommon() )
01599     {
01600         pCmdUI->Enable(FALSE);
01601         return;
01602     }
01603
01604     TGraphDelCmd trav;
01605     trav.TraverseGraph(root);
01606     BOOL outEnabled = trav.GetCountSel() >= 1 && trav.GetOnlyRev();
01607     pCmdUI->Enable(outEnabled);
01608 }

void CGraphView::OnUpdateViewDiff ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1342 of file GraphView.cpp.

References DisableCommon(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), TGraphCmdStatus::GetSel2(), TGraphCmdStatus::GetSelCount(), CWinLogData::GetType(), and TGraph::TraverseGraph().

01343 {
01344     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01345     CLogNode* root = pDoc->GetNode();
01346     if( DisableCommon() )
01347     {
01348         pCmdUI->Enable(FALSE);
01349         return;
01350     }
01351
01352     TGraphCmdStatus trav;
01353     trav.TraverseGraph(root);
01354
01355     const BOOL outEnabled = (trav.GetSelCount() == 2 && trav.GetSel1()->GetType() != kNodeHeader &&
01356         trav.GetSel2()->GetType() != kNodeHeader) ||
01357         (trav.GetSelCount() == 1 && trav.GetSel1()->GetType() != kNodeHeader);
01358
01359     pCmdUI->Enable(outEnabled);
01360 }

void CGraphView::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1308 of file GraphView.cpp.

References DisableCommon().

01309 {
01310     if( DisableCommon() )
01311         pCmdUI->Enable(FALSE);
01312     else
01313         pCmdUI->Enable(TRUE);
01314 }

void CGraphView::OnUpdateViewRetrieve ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1665 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

01666 {
01667     BOOL enabled = FALSE;
01668     if( !DisableCommon() )
01669     {
01670         enabled = IsSelSingleNode(kNodeHeader, false);
01671     }
01672
01673     pCmdUI->Enable(enabled);
01674 }

void CGraphView::OnUpdateViewSelnonsig ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1626 of file GraphView.cpp.

References DisableCommon().

01627 {
01628     if( DisableCommon() )
01629         pCmdUI->Enable(FALSE);
01630     else
01631         pCmdUI->Enable(TRUE);
01632 }

void CGraphView::OnUpdateViewTag ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1433 of file GraphView.cpp.

References DisableCommon(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSelCount(), and TGraph::TraverseGraph().

01434 {
01435     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01436     CLogNode* root = pDoc->GetNode();
01437
01438     if( DisableCommon() )
01439     {
01440         pCmdUI->Enable(FALSE);
01441         return;
01442     }
01443
01444     TGraphCmdStatus trav;
01445     trav.TraverseGraph(root);
01446
01447     const BOOL outEnabled = trav.GetSelCount() == 1;
01448     pCmdUI->Enable(outEnabled);
01449 }

void CGraphView::OnUpdateViewUnlockf ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 2032 of file GraphView.cpp.

References DisableCommon(), FALSE, and IsSelSingleNode().

02033 {
02034     BOOL enabled = FALSE;
02035     if( !DisableCommon() )
02036     {
02037         enabled = IsSelSingleNode(kNodeRev);
02038     }
02039
02040     pCmdUI->Enable(enabled);
02041 }

void CGraphView::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

Update command UI state.

Definition at line 1382 of file GraphView.cpp.

References DisableCommon().

01383 {
01384     if( DisableCommon() )
01385         pCmdUI->Enable(FALSE);
01386     else
01387         pCmdUI->Enable(TRUE);
01388 }

void CGraphView::OnViewDelrev ( ) [protected]

WM_COMMAND message handler, delete selected revisions.

Definition at line 1550 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), TGraphDelCmd::GetAllRevs(), CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), CProgress::HasAborted(), launchCVS(), OnViewReload(), CvsArgs::print(), CProgress::SetProgress(), 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     if( AfxMessageBox("Are you really sure you want to do that ? This will permanently remove the revisions on the server.",
01558         MB_OKCANCEL|MB_DEFBUTTON2|MB_ICONSTOP) != IDOK )
01559     {
01560         return;
01561     }
01562
01563     TGraphDelCmd trav;
01564     trav.TraverseGraph(root);
01565
01566     CProgress progress(true, "Deleting revisions...");
01567
01568     std::vector<CStr>::const_iterator i;
01569     int count = 0;
01570     for(i = trav.GetAllRevs().begin(); i != trav.GetAllRevs().end(); ++i, ++count)
01571     {
01572         progress.SetProgress((int)(((float)count / (float)trav.GetAllRevs().size()) * 100.0 + .5));
01573         if( progress.HasAborted() )
01574             break;
01575
01576         CvsArgs args;
01577         args.add("admin");
01578         args.add("-o");
01579         args.add(*i);
01580         args.add(pDoc->GetName());
01581         args.print(pDoc->GetDir());
01582
01583         CGraphConsole cons;
01584         launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01585     }
01586
01587     if( !progress.HasAborted() )
01588         progress.SetProgress(100);
01589
01590     OnViewReload();
01591 }

void CGraphView::OnViewDiff ( ) [protected]

WM_COMMAND message handler, diff the selection.

Definition at line 1317 of file GraphView.cpp.

References CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), TGraphCmdStatus::GetSel2(), TGraphCmdStatus::GetSelCount(), CWinLogData::GetStr(), MultiFiles::newdir(), MultiFiles::newfile(), NULL, KoGraphDiffHandler::OnFiles(), and TGraph::TraverseGraph().

01318 {
01319     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01320     CLogNode* root = pDoc->GetNode();
01321     if( root == NULL || root->GetUserData() == NULL || pDoc == NULL )
01322         return;
01323
01324     TGraphCmdStatus trav;
01325     trav.TraverseGraph(root);
01326
01327     MultiFiles mf;
01328
01329     mf.newdir(pDoc->GetDir());
01330     mf.newfile(pDoc->GetName(), 0L, trav.GetSel1()->GetStr());
01331
01332     if( trav.GetSelCount() == 2 )
01333     {
01334         mf.newfile(pDoc->GetName(), 0L, trav.GetSel2()->GetStr());
01335     }
01336
01337     KoGraphDiffHandler handler;
01338     handler.OnFiles(&mf);
01339 }

void CGraphView::OnViewReload ( ) [protected]

WM_COMMAND message handler, reload view.

Definition at line 1292 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().

01293 {
01294     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01295     CLogNode* root = pDoc->GetNode();
01296     if( root == 0L || root->GetUserData() == 0L )
01297         return;
01298
01299     CvsArgs args;
01300     args.add("log");
01301     args.add(pDoc->GetName());
01302     args.print(pDoc->GetDir());
01303     CStr dir(pDoc->GetDir());
01304     CvsLogParse(dir, args, true, pDoc);
01305 }

void CGraphView::OnViewRetrieve ( ) [protected]

WM_COMMAND message handler, retrieve revisions.

Definition at line 1635 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), CRevisionConsole::init(), launchCVS(), CvsArgs::print(), and TGraph::TraverseGraph().

01636 {
01637     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01638     CLogNode* root = pDoc->GetNode();
01639     if( root == 0L || root->GetUserData() == 0L )
01640         return;
01641
01642     TGraphCmdStatus trav;
01643     trav.TraverseGraph(root);
01644
01645     CStr f1, prf1;
01646     CvsArgs args;
01647
01648     prf1 = pDoc->GetName();
01649     prf1 << ".#.";
01650     prf1 << trav.GetSel1()->GetStr();
01651     args.add("update");
01652     args.add("-p");
01653     args.add("-r");
01654     args.add(trav.GetSel1()->GetStr());
01655     args.add(pDoc->GetName());
01656     args.print(pDoc->GetDir());
01657
01658     CRevisionConsole console;
01659     console.init(pDoc->GetDir(), prf1);
01660
01661     int code = launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &console);
01662 }

void CGraphView::OnViewSelnonsig ( ) [protected]

WM_COMMAND message handler, select non-significant revisions.

Definition at line 1611 of file GraphView.cpp.

References CGraphDoc::GetNode(), TGraph::TraverseGraph(), and CWinLogData::UnselectAll().

01612 {
01613     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01614     CLogNode* root = pDoc->GetNode();
01615     if( root == 0L || root->GetUserData() == 0L )
01616         return;
01617
01618     CWinLogData* data = (CWinLogData*)root->GetUserData();
01619     data->UnselectAll(this);
01620
01621     TGraphSelNonSig trav(this);
01622     trav.TraverseGraph(root);
01623 }

void CGraphView::OnViewTag ( ) [protected]

WM_COMMAND message handler, tag update.

Definition at line 1391 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), launchCVS(), OnViewReload(), CvsArgs::print(), and TGraph::TraverseGraph().

01392 {
01393     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01394     CLogNode* root = pDoc->GetNode();
01395
01396     if( root == 0L || root->GetUserData() == 0L )
01397         return;
01398
01399     TGraphCmdStatus trav;
01400     trav.TraverseGraph(root);
01401
01402     CvsArgs args;
01403     args.add("update");
01404
01405     CLogNode* node = trav.GetSel1()->Node();
01406     switch(node->GetType())
01407     {
01408     case kNodeHeader:
01409         {
01410             args.add("-A");
01411             break;
01412         }
01413     case kNodeRev:
01414     case kNodeBranch:
01415     case kNodeTag:
01416         {
01417             args.add("-r");
01418             args.add(trav.GetSel1()->GetStr());
01419             break;
01420         }
01421     }
01422
01423     args.add(pDoc->GetName());
01424     args.print(pDoc->GetDir());
01425
01426     CGraphConsole cons;
01427     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01428
01429     OnViewReload();
01430 }

void CGraphView::OnViewUnlockf ( ) [protected]

WM_COMMAND message handler, unlock the selection.

Definition at line 2044 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), TGraphCmdStatus::GetSel1(), CWinLogData::GetStr(), launchCVS(), OnViewReload(), CvsArgs::print(), and TGraph::TraverseGraph().

02045 {
02046     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
02047     CLogNode* root = pDoc->GetNode();
02048     if( root == 0L || root->GetUserData() == 0L )
02049         return;
02050
02051     TGraphCmdStatus trav;
02052     trav.TraverseGraph(root);
02053
02054     CvsArgs args;
02055     args.add("admin");
02056     args.add(CStr("-u") + trav.GetSel1()->GetStr());
02057
02058     args.add(pDoc->GetName());
02059     args.print(pDoc->GetDir());
02060
02061     CGraphConsole cons;
02062     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
02063     OnViewReload();
02064 }

void CGraphView::OnViewUpdate ( ) [protected]

WM_COMMAND message handler, update.

Definition at line 1363 of file GraphView.cpp.

References CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CGraphDoc::GetDir(), CGraphDoc::GetName(), CGraphDoc::GetNode(), launchCVS(), OnViewReload(), and CvsArgs::print().

01364 {
01365     CGraphDoc* pDoc = (CGraphDoc*)GetDocument();
01366     CLogNode* root = pDoc->GetNode();
01367     if(root == 0L || root->GetUserData() == 0L)
01368         return;
01369
01370     CvsArgs args;
01371     args.add("update");
01372     args.add("-A");
01373     args.add(pDoc->GetName());
01374     args.print(pDoc->GetDir());
01375     CGraphConsole cons;
01376     launchCVS(pDoc->GetDir(), args.Argc(), args.Argv(), &cons);
01377
01378     OnViewReload();
01379 }

Member Data Documentation

CImageList CGraphView::m_imageList [static, private]

Image list

Definition at line 1098 of file GraphView.cpp.

Referenced by CGraphView().

int CGraphView::m_numberOfPages [private]

Number of pages

Definition at line 388 of file GraphView.h.

Referenced by OnBeginPrinting().

int CGraphView::m_pageHeight [private]

Page height

Definition at line 389 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 Fri Jan 31 12:16:30 2003 for WinCvs Source by doxygen 1.3-rc2


CHARFORMAT Class Reference

Inheritance diagram for CHARFORMAT:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.h
Generated on Fri Jan 31 12:16:30 2003 for WinCvs Source by doxygen 1.3-rc2


CHeaderCtrl Class Reference

Inheritance diagram for CHeaderCtrl:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/SortHeaderCtrl.h
Generated on Fri Jan 31 12:16:31 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

Protected Methods

afx_msg void | OnDropdown ()
CBN_DROPDOWN notification message handler.

Private Methods

virtual int | CalcDroppedWidth ()
Calculate droplist width.

BOOL | DelKeyTest (MSG *pMsg)
Test if the Del key is pressed and remove the item if the droplist is dropped down.

Private Attributes

CImageList | m_ImageList

Constructor & Destructor Documentation

CHistComboBoxEx::CHistComboBoxEx ( int feature = USmartCombo::DefaultFeature )

Definition at line 63 of file HistComboBoxEx.cpp.

00064     : USmartCombo(feature)
00065 {
00066 }

CHistComboBoxEx::~CHistComboBoxEx ( ) [virtual]

Definition at line 68 of file HistComboBoxEx.cpp.

00069 {
00070 }

Member Function Documentation

int CHistComboBoxEx::AddString ( LPCTSTR lpszString )

Definition at line 168 of file HistComboBoxEx.cpp.

References InsertString().

00169 {
00170     return InsertString(-1, lpszString);
00171 }

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 264 of file HistComboBoxEx.cpp.

References HISTLOC_IMAGE_CX.

Referenced by OnDropdown().

00265 {
00266     int maxSize = 0;
00267
00268     CClientDC ClientDC(this);
00269     int savedDc = ClientDC.SaveDC();
00270     ClientDC.SelectObject(GetFont());
00271
00272     CString strLBText;
00273     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00274     {
00275         GetLBText( nIndex, strLBText );
00276         CSize size = ClientDC.GetTextExtent(strLBText);
00277
00278         if( size.cx > maxSize )
00279         {
00280             maxSize = size.cx;
00281         }
00282     }
00283     ClientDC.RestoreDC(savedDc);
00284
00285     maxSize += ::GetSystemMetrics(SM_CXVSCROLL)     //vertical scroll bar
00286         + 4*::GetSystemMetrics(SM_CXEDGE)           //the border aroung the text and icon: Edge-Icon-Edge - Edge-Text-Edge
00287         + HISTLOC_IMAGE_CX                          //the icon width
00288         + 2;                                        //the focus frame width
00289
00290     CRect rect;
00291     GetWindowRect(rect);
00292     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00293
00294     return maxSize;
00295 }

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 303 of file HistComboBoxEx.cpp.

References ASSERT, CMainFrame::ChangeLocation(), FALSE, USmartCombo::GetItems(), CWincvsApp::GetMainFrame(), USmartCombo::RemoveItem(), and TRUE.

Referenced by PreTranslateMessage().

00304 {
00305     CMString* pstrItems = GetItems();
00306     ASSERT(pstrItems != NULL);
00307
00308     BOOL bRes = FALSE;
00309
00310     if( WM_KEYDOWN == pMsg->message &&
00311         VK_DELETE == (int)pMsg->wParam &&
00312         pstrItems &&
00313         GetDroppedState() )
00314     {
00315         int sel = GetCurSel();
00316         if( CB_ERR < sel && GetCount() > 1 )
00317         {
00318             CString strItem;
00319             GetLBText(sel, strItem);
00320
00321             if( RemoveItem(strItem) )
00322             {
00323                 DeleteString(sel);
00324
00325                 if( GetCount() )
00326                 {
00327                     int nNewSel = (0 == sel ? sel : (GetCount() ? 0 : -1));
00328                     if( 0 != nNewSel || 0 == sel )
00329                     {
00330                         SetCurSel(nNewSel);
00331
00332                         //trigger the location change for all views
00333                         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00334                         CMainFrame* mainFrm = app->GetMainFrame();
00335                         mainFrm->ChangeLocation();
00336                     }
00337                 }
00338             }
00339         }
00340         else if( GetCount() == 1 )
00341         {
00342             AfxMessageBox("Can't remove the last item from the history.\n"
00343                 "Please add a new location first and then remove the current one.", MB_OK | MB_ICONSTOP);
00344         }
00345
00346         //we have to prevent it going to another window
00347         bRes = TRUE;
00348     }
00349
00350     return bRes;
00351 }

CString CHistComboBoxEx::FindBestRoot | ( | CMString & | strItems,
 |  | const char * | path,
 |  | bool | mustExist = false
 | ) | [static]

Find the best root for passed path.

Definition at line 111 of file HistComboBoxEx.cpp.

References TMString< UStr >::GetList().

Referenced by CWincvsApp::InitInstance().

00112 {
00113     CString normPath(path);
00114     CString bestRoot;
00115     normPath.TrimRight("\\/");
00116     normPath.MakeLower();
00117
00118     const std::vector<CStr> & list = strItems.GetList();
00119     std::vector<CStr>::const_iterator i;
00120     for(i = list.begin(); i != list.end(); ++i)
00121     {
00122         CString root = *i;
00123         root.TrimRight("\\/");
00124         root.MakeLower();
00125
00126         if( normPath.Find(root) != -1 )
00127         {
00128             //we want the longest root so it's near the file
00129             if( root.GetLength() > bestRoot.GetLength() )
00130             {
00131                 bestRoot = *i;
00132             }
00133         }
00134     }
00135
00136     if( !mustExist && bestRoot.IsEmpty() )
00137     {
00138         bestRoot = path;
00139         bestRoot.TrimRight("\\/");
00140     }
00141
00142     //handle the drive root
00143     if( bestRoot.GetAllocLength() &&
00144         ':' == bestRoot[bestRoot.GetLength()-1])
00145     {
00146         bestRoot += kPathDelimiter;
00147     }
00148
00149     return bestRoot;
00150 }

const char * CHistComboBoxEx::GetOldLoc ( )

Definition at line 82 of file HistComboBoxEx.cpp.

References gOldLoc.

Referenced by CWinCvsBrowser::Create().

00083 {
00084     return gOldLoc;
00085 }

int CHistComboBoxEx::InsertString | ( | int | nIndex,
 |  | LPCTSTR | lpszString
 | ) |

Definition at line 152 of file HistComboBoxEx.cpp.

References SetIcon().

Referenced by AddString(), and NewRoot().

00153 {
00154     int nRes = -1;
00155
00156     COMBOBOXEXITEM cbi;
00157     cbi.mask = CBEIF_TEXT;
00158     cbi.iItem = 0 > nIndex ? GetCount() : nIndex;
00159     cbi.pszText = (LPTSTR)lpszString;   //this cast is safe because we are Inserting item only
00160     cbi.cchTextMax = 0;
00161
00162     nRes = InsertItem(&cbi);
00163     SetIcon(cbi);
00164
00165     return nRes;
00166 }

int CHistComboBoxEx::NewRoot ( const char * root )

Definition at line 87 of file HistComboBoxEx.cpp.

References ASSERT, USmartCombo::GetItems(), TMString< UStr >::GetList(), gOldLoc, TMString< UStr >::Insert(), and InsertString().

Referenced by CWinCvsBrowser::ResetBrowser().

00088 {
00089     if(stricmp(gOldLoc, root) != 0)
00090         gOldLoc = root;
00091
00092     CMString* pstrItems = GetItems();
00093     ASSERT(pstrItems != NULL);
00094
00095     // update the history combo
00096     pstrItems->Insert(root);
00097     ResetContent();
00098     const std::vector<CStr> & list = pstrItems->GetList();
00099     std::vector<CStr>::const_iterator i;
00100     for(i = list.begin(); i != list.end(); ++i)
00101     {
00102         InsertString(-1, *i);
00103     }
00104     SetCurSel(0);
00105     TRACE("Browse History has %d items\n", GetCount());
00106
00107     return GetCount();
00108 }

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 250 of file HistComboBoxEx.cpp.

References CalcDroppedWidth(), USmartCombo::HasFeature(), and TraverseHistory().

00251 {
00252     TraverseHistory(*this);
00253     if( HasFeature(USmartCombo::AutoDropWidth) )
00254     {
00255         SetDroppedWidth(CalcDroppedWidth());
00256     }
00257 }

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 232 of file HistComboBoxEx.cpp.

References DelKeyTest(), USmartCombo::HasFeature(), and TRUE.

00233 {
00234     if( HasFeature(USmartCombo::RemoveItems) )
00235     {
00236         if( DelKeyTest(pMsg) )
00237         {
00238             return TRUE;
00239         }
00240     }
00241
00242     return CComboBoxEx::PreTranslateMessage(pMsg);
00243 }

BOOL CHistComboBoxEx::SetIcon ( COMBOBOXEXITEM cbi )

Definition at line 173 of file HistComboBoxEx.cpp.

References BuildIgnoredList(), CStr, Entries_SetVisited(), EntnodeData::IsIgnored(), EntnodeData::IsMissing(), EntnodeData::IsUnknown(), kLocationIcon, kLocationIconErased, kLocationIconIgnored, kLocationIconMissing, kLocationIconUnknown, m_ImageList, SplitPath(), and stat.

Referenced by InsertString(), and TraverseHistory().

00174 {
00175     //initialize the image list if neccessary
00176     if( m_ImageList.m_hImageList == 0L )
00177     {
00178         m_ImageList.Create(IDB_HISTLOC, HISTLOC_IMAGE_CX, 1, RGB(255, 255, 255));
00179         SetImageList(&m_ImageList);
00180     }
00181
00182     cbi.mask = CBEIF_IMAGE | /*CBEIF_OVERLAY |*/ CBEIF_SELECTEDIMAGE;
00183     cbi.iImage = cbi.iSelectedImage = kLocationIconUnknown;
00184     //cbi.iOverlay = ;
00185
00186     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00187     vector<CStr> ignlist;
00188     struct stat sb;
00189     const char *fullpath = cbi.pszText;
00190
00191     int statres = stat(fullpath, &sb);
00192     if( statres != -1 )
00193     {
00194         if( S_ISDIR(sb.st_mode) )
00195         {
00196             CStr uppath, folder;
00197             if( !SplitPath(fullpath, uppath, folder) || uppath.empty() )
00198             {
00199                 uppath = fullpath;
00200                 folder = ".";
00201             }
00202
00203             BuildIgnoredList(ignlist, uppath);
00204
00205             EntnodeData *data = Entries_SetVisited(uppath, entries, folder, sb, true, &ignlist);
00206             if( !data->IsUnknown() )
00207             {
00208                 cbi.iImage = cbi.iSelectedImage = kLocationIcon;
00209             }
00210             if( data->IsIgnored() )
00211             {
00212                 cbi.iImage = cbi.iSelectedImage = kLocationIconIgnored;
00213             }
00214             if( data->IsMissing() )
00215             {
00216                 cbi.iImage = cbi.iSelectedImage = kLocationIconMissing;
00217             }
00218         }
00219     }
00220     else
00221     {
00222         cbi.iImage = cbi.iSelectedImage = kLocationIconErased;
00223     }
00224
00225     return SetItem(&cbi);
00226 }

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 Fri Jan 31 12:16:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 MultiFiles *mf, const char *logmsg, const char *modname, const char *rtag, const char *vtag)
~CImport_MAIN ()

Public Attributes

CSmartComboBox m_moduleCombo
CSmartComboBox m_rtagCombo
CSmartComboBox m_vtagCombo
CString | m_logmsg
CString | m_vtag
CString | m_rtag
CString | m_moduleName

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBrowseTag1 ()
BN_CLICKED message handler, display browse tag/branch dialog.

afx_msg void | OnBrowseTag2 ()
BN_CLICKED message handler, display browse tag/branch dialog.

afx_msg void | OnBrowseModules ()
BN_CLICKED message handler, browse for file/directory.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 57 of file ImportDlg.h.

00057 { IDD = IDD_IMPORT_MAIN };

Constructor & Destructor Documentation

CImport_MAIN::CImport_MAIN | ( | const MultiFiles * | mf,
 |  | const char * | logmsg,
 |  | const char * | modname,
 |  | const char * | rtag,
 |  | const char * | vtag
 | ) |

Definition at line 90 of file ImportDlg.cpp.

References m_logmsg, m_moduleCombo, m_moduleName, m_rtag, m_rtagCombo, m_vtag, m_vtagCombo, and USmartCombo::SetItems().

00093                            : m_mf(mf), CPropertyPage(CImport_MAIN::IDD)
00094 {
00095     //{{AFX_DATA_INIT(CImport_MAIN)
00096     m_logmsg = logmsg;
00097     m_vtag = vtag;
00098     m_rtag = rtag;
00099     m_moduleName = modname;
00100     //}}AFX_DATA_INIT
00101
00102     m_moduleCombo.SetItems(&gImportModuleNames);
00103     m_rtagCombo.SetItems(&gReleasesNames);
00104     m_vtagCombo.SetItems(&gVendorNames);
00105 }

CImport_MAIN::~CImport_MAIN ( )

Definition at line 107 of file ImportDlg.cpp.

00108 {
00109 }

Member Function Documentation

void CImport_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 111 of file ImportDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), m_rtag, and m_vtag.

00112 {
00113     CPropertyPage::DoDataExchange(pDX);
00114
00115     //{{AFX_DATA_MAP(CImport_MAIN)
00116     DDX_Control(pDX, IDC_COMBOMODNAME, m_moduleCombo);
00117     DDX_Control(pDX, IDC_COMBORTAG, m_rtagCombo);
00118     DDX_Control(pDX, IDC_COMBOVTAG, m_vtagCombo);
00119     DDX_Text(pDX, IDC_LOGMSG, m_logmsg);
00120     DDX_CBString(pDX, IDC_COMBOVTAG, m_vtag);
00121     DDX_CBString(pDX, IDC_COMBORTAG, m_rtag);
00122     DDX_CBString(pDX, IDC_COMBOMODNAME, m_moduleName);
00123     //}}AFX_DATA_MAP
00124
00125     DDV_MinChars(pDX, m_moduleName, 1);
00126     DDV_MinChars(pDX, m_rtag, 1);
00127     DDV_MinChars(pDX, m_vtag, 1);
00128     DDX_ComboMString(pDX, IDC_COMBOMODNAME, m_moduleCombo);
00129     DDX_ComboMString(pDX, IDC_COMBOVTAG, m_vtagCombo);
00130     DDX_ComboMString(pDX, IDC_COMBORTAG, m_rtagCombo);
00131
00132     //error if the vendor and release tags are same
00133     if( pDX->m_bSaveAndValidate )
00134     {
00135         if( m_vtag == m_rtag )
00136         {
00137             AfxMessageBox("Vendor Tag and Release Tag can't have the same values.", MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00138             pDX->Fail();
00139         }
00140     }
00141 }

void CImport_MAIN::OnBrowseModules ( ) [protected]

BN_CLICKED message handler, browse for file/directory.

Definition at line 228 of file ImportDlg.cpp.

References CompatGetModuleListItem(), CStr, m_moduleCombo, and m_moduleName.

00229 {
00230     CStr moduleName;
00231     if( CompatGetModuleListItem(m_mf, moduleName) )
00232     {
00233         m_moduleName = (const char*)moduleName;
00234         m_moduleCombo.SetWindowText(m_moduleName);
00235     }
00236 }

void CImport_MAIN::OnBrowseTag1 ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 206 of file ImportDlg.cpp.

References CompatGetTagListItem(), CStr, m_vtag, and m_vtagCombo.

00207 {
00208     CStr tagName;
00209     if( CompatGetTagListItem(m_mf, tagName) )
00210     {
00211         m_vtag = (const char*)tagName;
00212         m_vtagCombo.SetWindowText(m_vtag);
00213     }
00214 }

void CImport_MAIN::OnBrowseTag2 ( ) [protected]

BN_CLICKED message handler, display browse tag/branch dialog.

Definition at line 217 of file ImportDlg.cpp.

References CompatGetTagListItem(), CStr, m_rtag, and m_rtagCombo.

00218 {
00219     CStr tagName;
00220     if( CompatGetTagListItem(m_mf, tagName) )
00221     {
00222         m_rtag = (const char*)tagName;
00223         m_rtagCombo.SetWindowText(m_rtag);
00224     }
00225 }

Member Data Documentation

CString CImport_MAIN::m_logmsg

Definition at line 61 of file ImportDlg.h.

Referenced by CImport_MAIN(), and CompatGetImport().

const MultiFiles* CImport_MAIN::m_mf [private]

Definition at line 85 of file ImportDlg.h.

CSmartComboBox CImport_MAIN::m_moduleCombo

Definition at line 58 of file ImportDlg.h.

Referenced by CImport_MAIN(), and OnBrowseModules().

CString CImport_MAIN::m_moduleName

Definition at line 64 of file ImportDlg.h.

Referenced by CImport_MAIN(), CompatGetImport(), and OnBrowseModules().

CString CImport_MAIN::m_rtag

Definition at line 63 of file ImportDlg.h.

Referenced by CImport_MAIN(), CompatGetImport(), DoDataExchange(), and OnBrowseTag2().

CSmartComboBox CImport_MAIN::m_rtagCombo

Definition at line 59 of file ImportDlg.h.

Referenced by CImport_MAIN(), and OnBrowseTag2().

CString CImport_MAIN::m_vtag

Definition at line 62 of file ImportDlg.h.

Referenced by CImport_MAIN(), CompatGetImport(), DoDataExchange(), and OnBrowseTag1().

CSmartComboBox CImport_MAIN::m_vtagCombo

Definition at line 60 of file ImportDlg.h.

Referenced by CImport_MAIN(), and OnBrowseTag1().

The documentation for this class was generated from the following files:
  • common/ImportDlg.h
  • common/ImportDlg.cpp
Generated on Fri Jan 31 12:16:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 ()

Public Attributes

CEdit m_pathEdit
CString | m_path
BOOL | m_useDefIgnore
BOOL | m_useFilesTime

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnBtnpath ()
BN_CLICKED message handler, browse for import directory.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 99 of file ImportDlg.h.

00099 { IDD = IDD_IMPORT_OPTIONS };

Constructor & Destructor Documentation

CImport_OPTIONS::CImport_OPTIONS | ( | const char * | path,
 |  | const bool | useDefIgnore,
 |  | const bool | useFilesTime
 | ) |

Definition at line 154 of file ImportDlg.cpp.

References m_path, m_useDefIgnore, and m_useFilesTime.

00154                                                                                                    :
00155     CPropertyPage(CImport_OPTIONS::IDD)
00156 {
00157     //{{AFX_DATA_INIT(CImport_OPTIONS)
00158     m_path = path;
00159     m_useDefIgnore = useDefIgnore;
00160     m_useFilesTime = useFilesTime;
00161     //}}AFX_DATA_INIT
00162 }

CImport_OPTIONS::~CImport_OPTIONS ( )

Definition at line 164 of file ImportDlg.cpp.

00165 {
00166 }

Member Function Documentation

void CImport_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 168 of file ImportDlg.cpp.

References DDV_CheckPathExists().

00169 {
00170     CPropertyPage::DoDataExchange(pDX);
00171
00172     //{{AFX_DATA_MAP(CImport_OPTIONS)
00173     DDX_Control(pDX, IDC_PATH, m_pathEdit);
00174     DDX_Text(pDX, IDC_PATH, m_path);
00175     DDX_Check(pDX, IDC_USEDEFIGNORE, m_useDefIgnore);
00176     DDX_Check(pDX, IDC_USEFILESTIME, m_useFilesTime);
00177     //}}AFX_DATA_MAP
00178
00179     DDV_CheckPathExists(pDX, IDC_PATH, m_path, false);
00180 }

void CImport_OPTIONS::OnBtnpath ( ) [protected]

BN_CLICKED message handler, browse for import directory.

Definition at line 193 of file ImportDlg.cpp.

References BrowserGetDirectory(), CStr, and m_pathEdit.

00194 {
00195     CString strPath;
00196     m_pathEdit.GetWindowText(strPath);
00197
00198     CStr path(strPath);
00199     if( BrowserGetDirectory("Select a directory to import from", path, IsWindow(m_hWnd) ? this : NULL) )
00200     {
00201         m_pathEdit.SetWindowText(m_path);
00202     }
00203 }

Member Data Documentation

CString CImport_OPTIONS::m_path

Definition at line 101 of file ImportDlg.h.

Referenced by CImport_OPTIONS(), and CompatGetImport().

CEdit CImport_OPTIONS::m_pathEdit

Definition at line 100 of file ImportDlg.h.

Referenced by OnBtnpath().

BOOL CImport_OPTIONS::m_useDefIgnore

Definition at line 102 of file ImportDlg.h.

Referenced by CImport_OPTIONS(), and CompatGetImport().

BOOL CImport_OPTIONS::m_useFilesTime

Definition at line 103 of file ImportDlg.h.

Referenced by CImport_OPTIONS(), and CompatGetImport().

The documentation for this class was generated from the following files:
  • common/ImportDlg.h
  • common/ImportDlg.cpp
Generated on Fri Jan 31 12:16:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 115 of file ImportFilterDlg.h.

00115 { IDD = IDD_ENTRYDESC };

Constructor & Destructor Documentation

CImportEntry::CImportEntry | ( | ReportConflict * | entry,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 120 of file ImportFilterDlg.cpp.

References CStr, ReportConflict::HasForceBinary(), ReportConflict::HasForceNoKeywords(), ReportConflict::HasForceText(), ReportConflict::HasForceUnicode(), ReportConflict::HasIgnore(), m_desc, m_radios, and ReportConflict::PrintOut().

00121     : CDialog(CImportEntry::IDD, pParent)
00122 {
00123     CStr print;
00124     entry->PrintOut(print);
00125
00126     //{{AFX_DATA_INIT(CImportEntry)
00127     //}}AFX_DATA_INIT
00128
00129     //keep these outside MFC remarks
00130     m_desc = print;
00131
00132     if( entry->HasForceBinary() )
00133         m_radios = 1;
00134     else if( entry->HasForceUnicode() )
00135         m_radios = 2;
00136     else if( entry->HasForceText() )
00137         m_radios = 3;
00138     else if( entry->HasForceNoKeywords() )
00139         m_radios = 4;
00140     else if( entry->HasIgnore() )
00141         m_radios = 5;
00142     else
00143         m_radios = 0;
00144 }

Member Function Documentation

void CImportEntry::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 147 of file ImportFilterDlg.cpp.

00148 {
00149     CDialog::DoDataExchange(pDX);
00150     //{{AFX_DATA_MAP(CImportEntry)
00151     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00152     DDX_Radio(pDX, IDC_ENTRYSTATE, m_radios);
00153     //}}AFX_DATA_MAP
00154 }

Member Data Documentation

CString CImportEntry::m_desc

Definition at line 116 of file ImportFilterDlg.h.

Referenced by CImportEntry().

int CImportEntry::m_radios

Definition at line 117 of file ImportFilterDlg.h.

Referenced by CImportEntry(), and CImportFilterDlg::OnEditentry().

The documentation for this class was generated from the following files:
  • common/ImportFilterDlg.h
  • common/ImportFilterDlg.cpp
Generated on Fri Jan 31 12:16:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 ()
BN_CLICKED message handler, edit the selected entry.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initialize controls.

afx_msg void | OnDblclkListentries (NMHDR *pNMHDR, LRESULT *pResult)
BN_CLICKED message handler, edit the selected entry.

Private Attributes

CImageList | m_imageList
ReportConflict * m_entries
ReportWarning * m_warnings

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 49 of file ImportFilterDlg.h.

00049 { IDD = IDD_IMPORTFILTER };

Constructor & Destructor Documentation

CImportFilterDlg::CImportFilterDlg | ( | ReportConflict * | entries,
 |  | ReportWarning * | warnings,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 167 of file ImportFilterDlg.cpp.

References m_entries, and m_warnings.

00169     : CDialog(CImportFilterDlg::IDD, pParent)
00170 {
00171     //{{AFX_DATA_INIT(CImportFilterDlg)
00172     m_entries = entries;
00173     m_warnings = warnings;
00174     //}}AFX_DATA_INIT
00175 }

Member Function Documentation

void CImportFilterDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 178 of file ImportFilterDlg.cpp.

00179 {
00180     CDialog::DoDataExchange(pDX);
00181     //{{AFX_DATA_MAP(CImportFilterDlg)
00182     DDX_Control(pDX, IDC_LISTENTRIES, m_list);
00183     DDX_Control(pDX, IDC_EDITENTRY, m_edit);
00184     //}}AFX_DATA_MAP
00185 }

void CImportFilterDlg::OnDblclkListentries | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

BN_CLICKED message handler, edit the selected entry.

Definition at line 274 of file ImportFilterDlg.cpp.

References OnEditentry().

00275 {
00276     OnEditentry();
00277     *pResult = 0;
00278 }

void CImportFilterDlg::OnEditentry ( ) [protected]

BN_CLICKED message handler, edit the selected entry.

Definition at line 199 of file ImportFilterDlg.cpp.

References ReportConflict::DisableUserSettings(), ReportConflict::ForceBinary(), ReportConflict::ForceNoKeywords(), ReportConflict::ForceText(), ReportConflict::ForceUnicode(), ReportConflict::GetKindDesc(), ReportConflict::Ignore(), m_entries, m_list, CImportEntry::m_radios, m_warnings, ReportConflict::next, and ReportWarning::next.

Referenced by OnDblclkListentries().

00200 {
00201     // The user wants to edit an entry.
00202     // Start at the top of the list and walk through it until an item
00203     // that is selected is found.
00204     int nItem = m_list.GetNextItem(-1, LVNI_ALL);
00205     while( nItem != -1 )
00206     {
00207         UINT nState = m_list.GetItemState(nItem, LVIS_SELECTED);
00208         if( (nState & LVIS_SELECTED) == LVIS_SELECTED )
00209             break;
00210
00211         nItem = m_list.GetNextItem(nItem, LVNI_ALL);
00212     }
00213
00214     if( nItem == -1 )
00215         return;
00216
00217     int i = 0;
00218     ReportWarning* warn = m_warnings;
00219     while( warn != 0L )
00220     {
00221         if( i == nItem )
00222         {
00223             CImportWarning dlg(warn);
00224             dlg.DoModal();
00225             return;
00226         }
00227
00228         warn = warn->next;
00229         i++;
00230     }
00231
00232     ReportConflict* conf = m_entries;
00233     while( conf != 0L )
00234     {
00235         if( i == nItem )
00236         {
00237             CImportEntry dlg(conf);
00238             if( dlg.DoModal() == IDOK )
00239             {
00240                 switch(dlg.m_radios)
00241                 {
00242                 case 0:
00243                     conf->DisableUserSettings();
00244                     break;
00245                 case 1:
00246                     conf->ForceBinary();
00247                     break;
00248                 case 2:
00249                     conf->ForceUnicode();
00250                     break;
00251                 case 3:
00252                     conf->ForceText();
00253                     break;
00254                 case 4:
00255                     conf->ForceNoKeywords();
00256                     break;
00257                 case 5:
00258                     conf->Ignore();
00259                     break;
00260                 }
00261
00262                 m_list.SetItemText(nItem, COL_KIND, conf->GetKindDesc());
00263             }
00264
00265             return;
00266         }
00267
00268         conf = conf->next;
00269         i++;
00270     }
00271 }

BOOL CImportFilterDlg::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initialize controls.

Definition at line 281 of file ImportFilterDlg.cpp.

References ReportConflict::GetDesc(), ReportWarning::GetDesc(), ReportConflict::GetKindDesc(), ReportConflict::GetStateDesc(), ReportWarning::GetStateDesc(), ReportConflict::HasConflict(), ReportWarning::IsError(), m_entries, m_imageList, m_list, m_warnings, ReportConflict::next, ReportWarning::next, and TRUE.

00282 {
00283     CDialog::OnInitDialog();
00284
00285     // Need to set up to display the little icons next to each entry
00286     if( m_imageList.m_hImageList == 0L )
00287         m_imageList.Create(IDB_IMPORT, 16, 1, RGB(255, 255, 255));
00288
00289     m_list.SetImageList(&m_imageList, LVSIL_SMALL);
00290
00291     // Full row selection
00292     DWORD dwExStyle = m_list.GetExtendedStyle();
00293     dwExStyle |= LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT;
00294     m_list.SetExtendedStyle(dwExStyle);
00295
00296     // Set up columns inside the list view
00297     m_list.InsertColumn(COL_STATE,  _gszColumnLabel[COL_STATE], LVCFMT_LEFT, _gnColumnWidth[COL_STATE]);
00298     m_list.InsertColumn(COL_DESC,   _gszColumnLabel[COL_DESC], LVCFMT_LEFT, _gnColumnWidth[COL_DESC]);
00299     m_list.InsertColumn(COL_KIND,   _gszColumnLabel[COL_KIND], LVCFMT_LEFT, _gnColumnWidth[COL_KIND]);
00300
00301     int i = 0;
00302     ReportWarning* warn = m_warnings;
00303     while( warn != 0L )
00304     {
00305         // Store this information in the list view
00306         m_list.InsertItem(i, "", warn->IsError() ? 0 : 1);
00307
00308         m_list.SetItemText(i, COL_DESC, warn->GetDesc());
00309         m_list.SetItemText(i, COL_STATE, warn->GetStateDesc());
00310
00311         warn = warn->next;
00312         i++;
00313     }
00314
00315     ReportConflict* conf = m_entries;
00316     while( conf != 0L )
00317     {
00318         // Store this information in the list view
00319         m_list.InsertItem(i, "", conf->HasConflict() ? 0 : 1);
00320
00321         m_list.SetItemText(i, COL_STATE, conf->GetStateDesc());
00322         m_list.SetItemText(i, COL_DESC, conf->GetDesc());
00323         m_list.SetItemText(i, COL_KIND, conf->GetKindDesc());
00324
00325         conf = conf->next;
00326         i++;
00327     }
00328
00329     return TRUE;  // return TRUE unless you set the focus to a control
00330                   // EXCEPTION: OCX Property Pages should return FALSE
00331 }

Member Data Documentation

CButton CImportFilterDlg::m_edit

Definition at line 51 of file ImportFilterDlg.h.

ReportConflict* CImportFilterDlg::m_entries [private]

Conflicts

Definition at line 73 of file ImportFilterDlg.h.

Referenced by CImportFilterDlg(), OnEditentry(), and OnInitDialog().

CImageList CImportFilterDlg::m_imageList [private]

Image list

Definition at line 72 of file ImportFilterDlg.h.

Referenced by OnInitDialog().

CListCtrl CImportFilterDlg::m_list

Definition at line 50 of file ImportFilterDlg.h.

Referenced by OnEditentry(), and OnInitDialog().

ReportWarning* CImportFilterDlg::m_warnings [private]

Warnings

Definition at line 74 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 Fri Jan 31 12:16:38 2003 for WinCvs Source by doxygen 1.3-rc2


ImportReport Class Reference

Class to traverse and detect conflicts or warnings for import. More...

#include <ImportFilter.h>

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 ()
std::vector< UStr > & GetIgnoreList ()
Get the ignore list.

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)

Private Attributes

ReportWarning *& warnings
ReportConflict *& conflicts
std::vector< UStr > m_ignlist
CProgress m_progress

Detailed Description

Class to traverse and detect conflicts or warnings for import.

Definition at line 155 of file ImportFilter.h.

Constructor & Destructor Documentation

ImportReport::ImportReport | ( | const char * | path,
 |  | ReportWarning *& | w,
 |  | ReportConflict *& | c
 | ) |

Definition at line 905 of file ImportFilter.cpp.

References BuildIgnoredList(), and kProgressFile.

00906     : warnings(w), conflicts(c), m_progress(true, "Filtering files to import...", kProgressFile)
00907 {
00908     // MN - Apply ignore filter to import file list
00909     BuildIgnoredList(m_ignlist, path);
00910 }

ImportReport::~ImportReport ( ) [virtual]

Definition at line 912 of file ImportFilter.cpp.

00913 {
00914 }

Member Function Documentation

kTraversal ImportReport::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 916 of file ImportFilter.cpp.

References cvs_out(), kContinueTraversal, and kTraversal.

00917 {
00918     cvs_out("Filtering \'%s\'...\n", fullpath);
00919     return kContinueTraversal;
00920 }

kTraversal ImportReport::ExitDirectory ( const char * fullpath ) [virtual]

Reimplemented from TraversalReport.

Definition at line 922 of file ImportFilter.cpp.

References kContinueTraversal, and kTraversal.

00923 {
00924     return kContinueTraversal;
00925 }

std::vector< UStr >& ImportReport::GetIgnoreList ( ) [inline]

Get the ignore list.

Definition at line 174 of file ImportFilter.h.

Referenced by list_add_type().

00174 { return m_ignlist; }

kTraversal ImportReport::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 1018 of file ImportFilter.cpp.

References kContinueTraversal, kTraversal, and list_add_warning().

01020 {
01021     list_add_warning(warnings, kFileIsAlias, fullname);
01022     return kContinueTraversal;
01023 }

kTraversal ImportReport::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 945 of file ImportFilter.cpp.

References kContinueTraversal, kSkipFile, and kTraversal.

00947 {
00948 #if defined(WIN32) || defined(TARGET_OS_MAC)
00949     if(stricmp(name, "CVS") == 0)
00950 #else
00951     if(strcmp(name, "CVS") == 0)
00952 #endif
00953         return kSkipFile;
00954
00955     return kContinueTraversal;
00956 }

kTraversal ImportReport::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 927 of file ImportFilter.cpp.

References kContinueTraversal, kTraversal, and list_add_warning().

00928 {
00929     list_add_warning(warnings, kFileMissing, err);
00930     return kContinueTraversal;
00931 }

kTraversal ImportReport::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

Definition at line 958 of file ImportFilter.cpp.

References FileIsBinary(), FileIsText(), kContinueTraversal, kFileIsOK, kFileType, kFileTypeBin, kFileTypeText, kFileTypeUnicode, kTextBinTYPE, kTextIsBinary, kTextIsUnicode, kTextWrongSig, kTraversal, list_add_type(), list_add_warning(), and UFSSpec.

00960 {
00961     int mac_type = 0;
00962     int mac_creator = 0;
00963
00964 #ifdef TARGET_OS_MAC
00965 #   define MACSPEC , &fsSpec
00966     GUSIFileSpec inspec(fullname);
00967 #   if TARGET_RT_MAC_CFM
00968     mac_type = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdType;
00969     mac_creator = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdCreator;
00970 #   else
00971     FInfo finfo;
00972     memcpy(&finfo, inspec.CatInfo()->Info().finderInfo, 2 * sizeof(OSType));
00973     mac_type = finfo.fdType;
00974     mac_creator = finfo.fdCreator;
00975 #   endif
00976     UFSSpec fsSpec = inspec;
00977 #else /* !TARGET_OS_MAC */
00978 #   define MACSPEC
00979 #endif /* !TARGET_OS_MAC */
00980
00981     kFileType newType = kFileTypeText;
00982     kTextBinTYPE filetype = FileIsText(name, fullpath MACSPEC);
00983
00984     if( kTextIsBinary == filetype || kTextWrongSig == filetype )
00985     {
00986         kTextBinTYPE bintype = FileIsBinary(name, fullpath MACSPEC);
00987         if( kFileIsOK != bintype )
00988         {
00989             list_add_warning(warnings, bintype, fullname);
00990         }
00991         else if( kTextWrongSig == filetype )
00992         {
00993             list_add_warning(warnings, filetype, fullname);
00994             filetype = kTextIsBinary;
00995             newType = kFileTypeBin;
00996         }
00997
00998         if( kFileIsOK == bintype )
00999         {
01000             newType = kFileTypeBin;
01001         }
01002     }
01003     else if( kTextIsUnicode == filetype )
01004     {
01005         newType = kFileTypeUnicode;
01006     }
01007     else if( kFileIsOK != filetype )
01008     {
01009         list_add_warning(warnings, filetype, fullname);
01010     }
01011
01012     // Add the type
01013     list_add_type(this, conflicts, newType, name, fullname, mac_type, mac_creator);
01014
01015     return kContinueTraversal;
01016 }

kTraversal ImportReport::OnIdle ( const char * fullpath ) [virtual]

Reimplemented from TraversalReport.

Definition at line 933 of file ImportFilter.cpp.

References CProgress::HasAborted(), kContinueTraversal, kStopTraversal, kTraversal, m_progress, and CProgress::SetProgress().

00934 {
00935     if( m_progress.HasAborted() )
00936     {
00937         return kStopTraversal;
00938     }
00939
00940     m_progress.SetProgress(fullpath);
00941
00942     return kContinueTraversal;
00943 }

Member Data Documentation

ReportConflict*& ImportReport::conflicts [private]

Conflicts list

Definition at line 165 of file ImportFilter.h.

std::vector< UStr > ImportReport::m_ignlist [private]

Ignore list

Definition at line 166 of file ImportFilter.h.

CProgress ImportReport::m_progress [private]

Progress dialog to allow abort filtering

Definition at line 168 of file ImportFilter.h.

Referenced by OnIdle().

ReportWarning*& ImportReport::warnings [private]

Warnings list

Definition at line 164 of file ImportFilter.h.

The documentation for this class was generated from the following files:
  • common/ImportFilter.h
  • common/ImportFilter.cpp
Generated on Fri Jan 31 12:16:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 85 of file ImportFilterDlg.h.

00085 { IDD = IDD_WARNINGDESC };

Constructor & Destructor Documentation

CImportWarning::CImportWarning | ( | ReportWarning * | warn,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 94 of file ImportFilterDlg.cpp.

References CStr, m_desc, and ReportWarning::PrintOut().

00095     : CDialog(CImportWarning::IDD, pParent)
00096 {
00097     CStr print;
00098     warn->PrintOut(print);
00099     //{{AFX_DATA_INIT(CImportWarning)
00100     m_desc = print;
00101     //}}AFX_DATA_INIT
00102 }

Member Function Documentation

void CImportWarning::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 105 of file ImportFilterDlg.cpp.

00106 {
00107     CDialog::DoDataExchange(pDX);
00108     //{{AFX_DATA_MAP(CImportWarning)
00109     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00110     //}}AFX_DATA_MAP
00111 }

Member Data Documentation

CString CImportWarning::m_desc

Definition at line 86 of file ImportFilterDlg.h.

Referenced by CImportWarning().

The documentation for this class was generated from the following files:
  • common/ImportFilterDlg.h
  • common/ImportFilterDlg.cpp
Generated on Fri Jan 31 12:16:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 (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 51 of file InitDlg.h.

00051 { IDD = IDD_INIT_MAIN };

Constructor & Destructor Documentation

CInit_MAIN::CInit_MAIN ( bool forceRoot )

Definition at line 47 of file InitDlg.cpp.

References m_forceroot, and m_helpinit.

00048     : CPropertyPage(CInit_MAIN::IDD)
00049 {
00050     m_forceroot = forceRoot;
00051     m_helpinit = _T("If the CVSROOT (see next tab) is set to ""local"", "
00052         "the CVSROOT should be a Windows path (i.e. c:\\cvsroot). "
00053         "If the CVSROOT points on a remote machine, the path should be a Unix path "
00054         "(i.e. /fscvs/cvsroot : make sure you got the relevant security rights in "
00055         "order to create such a directory on the remote machine.");
00056 }

Member Function Documentation

void CInit_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 58 of file InitDlg.cpp.

00059 {
00060     CPropertyPage::DoDataExchange(pDX);
00061     //{{AFX_DATA_MAP(CInit_MAIN)
00062     DDX_Check(pDX, IDC_FORCEROOT, m_forceroot);
00063     DDX_Text(pDX, IDC_HELPINIT, m_helpinit);
00064     //}}AFX_DATA_MAP
00065 }

Member Data Documentation

BOOL CInit_MAIN::m_forceroot

Definition at line 52 of file InitDlg.h.

Referenced by CInit_MAIN(), and CompatGetInit().

CString CInit_MAIN::m_helpinit

Definition at line 53 of file InitDlg.h.

Referenced by CInit_MAIN().

The documentation for this class was generated from the following files:
  • common/InitDlg.h
  • common/InitDlg.cpp
Generated on Fri Jan 31 12:16:41 2003 for WinCvs Source by doxygen 1.3-rc2


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, CREV, CSTOP, and CUNDR.

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.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Fri Jan 31 12:16:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:42 2003 for WinCvs Source by doxygen 1.3-rc2


ItemDisplayInfo Class Reference

Class to hold and support data display (e.g. sorting or storing the result for next display). More...

#include <ItemListDlg.h>

Collaboration diagram for ItemDisplayInfo:

[legend]
List of all members.

Public Methods

void | Create (const string &item, const ItemRowInfo &rowInfo)
const string & | GetItem () const
Get item text.

const string & | GetDescription () const
Get the description text.

const string & | GetDescriptionEx () const
Get the extended desription text.

const ItemRowInfo & | GetRowInfo () const
Get the row info.

Private Attributes

string | m_item
string | m_description
string | m_descriptionEx
ItemRowInfo m_rowInfo

Detailed Description

Class to hold and support data display (e.g. sorting or storing the result for next display).

Definition at line 150 of file ItemListDlg.h.

Member Function Documentation

void ItemDisplayInfo::Create | ( | const string & | item,
 |  | const ItemRowInfo & | rowInfo
 | ) |

Create display info

Parameters:
item | Item
rowInfo | Row info for the item

Definition at line 601 of file ItemListDlg.cpp.

References FormatItemDescription(), ItemRowInfo::m_description, m_description, ItemRowInfo::m_descriptionEx, m_descriptionEx, m_item, and m_rowInfo.

Referenced by CItemListDlg::DisplayItems().

00602 {
00603     m_item = item;
00604     m_description = FormatItemDescription(rowInfo.m_description);
00605     m_descriptionEx = FormatItemDescription(rowInfo.m_descriptionEx);
00606
00607     m_rowInfo = rowInfo;
00608 }

const string & ItemDisplayInfo::GetDescription ( ) const

Get the description text.

Definition at line 617 of file ItemListDlg.cpp.

References m_description.

Referenced by CItemListDlg::CompareItems(), CItemListDlg::DisplayItems(), and CItemListDlg::GetImageForItem().

00618 {
00619     return m_description;
00620 }

const string & ItemDisplayInfo::GetDescriptionEx ( ) const

Get the extended desription text.

Definition at line 623 of file ItemListDlg.cpp.

References m_descriptionEx.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::DisplayItems().

00624 {
00625     return m_descriptionEx;
00626 }

const string & ItemDisplayInfo::GetItem ( ) const

Get item text.

Definition at line 611 of file ItemListDlg.cpp.

References m_item.

Referenced by CItemListDlg::CompareItems(), CItemListDlg::DisplayItems(), CItemListDlg::DoDataExchange(), and CItemListDlg::GetImageForItem().

00612 {
00613     return m_item;
00614 }

const ItemRowInfo & ItemDisplayInfo::GetRowInfo ( ) const

Get the row info.

Definition at line 629 of file ItemListDlg.cpp.

References m_rowInfo.

Referenced by CItemListDlg::DoDataExchange().

00630 {
00631     return m_rowInfo;
00632 }

Member Data Documentation

string ItemDisplayInfo::m_description [private]

Description text

Definition at line 155 of file ItemListDlg.h.

Referenced by Create(), and GetDescription().

string ItemDisplayInfo::m_descriptionEx [private]

Extended description text

Definition at line 156 of file ItemListDlg.h.

Referenced by Create(), and GetDescriptionEx().

string ItemDisplayInfo::m_item [private]

Item text

Definition at line 154 of file ItemListDlg.h.

Referenced by Create(), and GetItem().

ItemRowInfo ItemDisplayInfo::m_rowInfo [private]

Original row data after parsing

Definition at line 158 of file ItemListDlg.h.

Referenced by Create(), and GetRowInfo().

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:16:43 2003 for WinCvs Source by doxygen 1.3-rc2


CItemListConsole Class Reference

Base class for item list console. More...

#include <ItemListDlg.h>

Inheritance diagram for CItemListConsole:

[legend]
Collaboration diagram for CItemListConsole:

[legend]
List of all members.

Public Methods

CItemListConsole ()
virtual | ~CItemListConsole ()
virtual long | cvs_out (char *txt, long len)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

virtual void | Parse (int launchRes)=0L
int | GetLaunchRes () const
Get the result of the command launch.

stringstream & | GetCvsErr ()
Get the error result.

const ItemList & | GetItemList () const
Get the parsing result.

Protected Attributes

ItemList m_itemList
stringstream | m_cvsOut
stringstream | m_cvsErr
int | m_launchRes

Detailed Description

Base class for item list console.

Definition at line 87 of file ItemListDlg.h.

Constructor & Destructor Documentation

CItemListConsole::CItemListConsole ( )

Definition at line 92 of file ItemListDlg.cpp.

References m_launchRes.

00093 {
00094     m_launchRes = 0;
00095 }

CItemListConsole::~CItemListConsole ( ) [virtual]

Definition at line 97 of file ItemListDlg.cpp.

References m_itemList.

00098 {
00099     m_itemList.clear();
00100 }

Member Function Documentation

long CItemListConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 108 of file ItemListDlg.cpp.

References cvs_errstr(), and m_cvsErr.

00109 {
00110     cvs_errstr(txt, len);
00111     m_cvsErr << txt;
00112
00113     return len;
00114 }

long CItemListConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 102 of file ItemListDlg.cpp.

References m_cvsOut.

00103 {
00104     m_cvsOut << txt;
00105     return len;
00106 }

stringstream & CItemListConsole::GetCvsErr ( )

Get the error result.

Definition at line 135 of file ItemListDlg.cpp.

References m_cvsErr.

00136 {
00137     return m_cvsErr;
00138 }

const ItemList & CItemListConsole::GetItemList ( ) const

Get the parsing result.

Definition at line 141 of file ItemListDlg.cpp.

References ItemList, and m_itemList.

00142 {
00143     return m_itemList;
00144 }

int CItemListConsole::GetLaunchRes ( ) const

Get the result of the command launch.

Definition at line 129 of file ItemListDlg.cpp.

References m_launchRes.

00130 {
00131     return m_launchRes;
00132 }

void CItemListConsole::Parse ( int launchRes ) [pure virtual]

Virtual overridable to parse the result of browse command

Parameters:
launchRes The result of the command launch
Note:
Call default implementation after parsing is finished to clear the stored command output and store the launch result, the error output is not cleared however to allow further analysis

Implemented in CTagParserConsole, CModuleParserConsole, and CListParserConsole.

Definition at line 122 of file ItemListDlg.cpp.

References m_cvsOut, and m_launchRes.

Referenced by LaunchItemListCommand(), CListParserConsole::Parse(), CModuleParserConsole::Parse(), and CTagParserConsole::Parse().

00123 {
00124     m_launchRes = launchRes;
00125     m_cvsOut.clear();
00126 }

Member Data Documentation

stringstream CItemListConsole::m_cvsErr [protected]

Cvs command result (stderr) used for parsing

Definition at line 100 of file ItemListDlg.h.

Referenced by cvs_err(), and GetCvsErr().

stringstream CItemListConsole::m_cvsOut [protected]

Cvs command result (stdout) used for parsing

Definition at line 99 of file ItemListDlg.h.

Referenced by cvs_out(), and Parse().

ItemList CItemListConsole::m_itemList [protected]

Parsing result

Definition at line 98 of file ItemListDlg.h.

Referenced by GetItemList(), CListParserConsole::Parse(), CModuleParserConsole::Parse(), CTagParserConsole::Parse(), and ~CItemListConsole().

int CItemListConsole::m_launchRes [protected]

The result of the command launch

Definition at line 101 of file ItemListDlg.h.

Referenced by CItemListConsole(), GetLaunchRes(), and Parse().

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:16:43 2003 for WinCvs Source by doxygen 1.3-rc2


CItemListDlg Class Reference

#include <ItemListDlg.h>

Inheritance diagram for CItemListDlg:

[legend]
Collaboration diagram for CItemListDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_ITEM_LIST }

Public Methods

CItemListDlg (const MultiFiles *mf, const char *item, kItemListDlg type, ItemList &itemList, const ListPath *listPath, bool forceCvsroot, const char *rev, const char *date, CWnd *pParent=NULL)
virtual BOOL | PreTranslateMessage (MSG *pMsg)
PreTranslateMessage virtual override, detects the F5 key pressed and refreshes the display.

Public Attributes

CSmartComboBox m_autoRefreshCombo
CButton m_selectionButton
CButton m_cancelButton
CButton m_browseTagButton
CEdit m_itemEdit
CButton m_refreshButton
CButton m_okButton
CButton m_browseReadFromButton
CStatic m_itemLabelStatic
CButton m_hasDateCheck
CButton m_hasRevCheck
CButton m_forceCvsrootCheck
CSmartComboBox m_dateCombo
CSmartComboBox m_revCombo
CButton m_optionCheck
CListCtrl m_itemListCtrl
CSmartComboBox m_readFromCombo
CString | m_readFrom
CString | m_item
BOOL | m_option
BOOL | m_forceCvsroot
BOOL | m_hasRev
CString | m_rev
CString | m_date
BOOL | m_hasDate
ListPath m_listPath

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnRefresh ()
BN_CLICKED message handler, re-reads the data.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initializes controls and triggers data reading if necessary.

virtual void | OnCancel ()
OnCancel virtual override, stop CVS command or cancel dialog.

afx_msg void | OnOption ()
BN_CLICKED message handler, initialize the related controls and sort settings.

afx_msg void | OnCheckrev ()
BN_CLICKED message handler, enable revision combo box.

afx_msg void | OnCheckdate ()
BN_CLICKED message handler, enable date combo box.

afx_msg void | OnBrowseTag ()
BN_CLICKED message handler, browse for tag/branch.

virtual void | OnOK ()
OnOK virtual override, store the persistent data.

afx_msg void | OnDblclkItemlist (NMHDR *pNMHDR, LRESULT *pResult)
NM_DBLCLK message handler, select the item and close dialog for tag/modules browser or navigate directories for directory and files listing.

afx_msg void | OnItemchangedItemlist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_ITEMCHANGED message handler, update the item edit box value as selection is changing.

afx_msg void | OnColumnclickItemlist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_COLUMNCLICK message handler, sort items in response to column click.

afx_msg void | OnDestroy ()
WM_DESTROY message handler, release any memory allocated.

afx_msg void | OnForceroot ()
BN_CLICKED message handler, enable related controls.

afx_msg void | OnBrowseReadfrom ()
BN_CLICKED message handler, browse for file/directory.

afx_msg void | OnSelection ()
BN_CLICKED message handler, browse selection info.

afx_msg void | OnSelchangeAutoRefresh ()
CBN_SELCHANGE message handler, update auto-refresh settings.

Private Types

enum {
kItemImgBlank,
kItemImgUpDir,
kItemImgDir,
kItemImgFile,
kItemImgModule,
kItemImgRevision,
kItemImgBranch,
kItemImgBranchAndRevision
}
Images enum. More...

Private Methods

void | InitListCtrl (const kDisplayType displayType)
void | InitOptionCtrls ()
void | EnableControls (BOOL enable)
bool | EnableDateRev ()
bool | CheckSettings ()
BOOL | PostClickRefresh ()
bool | SelectItem (const char *item)
void | DisplayItems (const ItemList &itemList, const int launchRes, stringstream *cvsErr=NULL, const bool showUpDir=true)
int | GetImageForItem (kItemListDlg type, bool option, const ItemDisplayInfo *displayInfo)
void | DeleteAllItems ()
void | SortItems (int column, bool asc, kItemListDlg type, bool option)

Static Private Methods

int CALLBACK | CompareItems (LPARAM itemData1, LPARAM itemData2, LPARAM lParam)

Private Attributes

const MultiFiles * | m_mf
kItemListDlg m_type
ItemList & m_itemList
bool | m_cvsStopped
CImageList | m_itemsImageList
bool | m_sortAsc
int | m_sortColumn
CSortHeaderCtrl m_headerCtrl

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 187 of file ItemListDlg.h.

00187 { IDD = IDD_ITEM_LIST };

anonymous enum [private]

Images enum.

Enumeration values:
kItemImgBlank | Blank
kItemImgUpDir | Go one directory up
kItemImgDir | Directory
kItemImgFile | File
kItemImgModule | Module
kItemImgRevision | Revision
kItemImgBranch | Branch
kItemImgBranchAndRevision | Branch and revision

Definition at line 269 of file ItemListDlg.h.

00270     {
00271         kItemImgBlank,
00272         kItemImgUpDir,
00273         kItemImgDir,
00274         kItemImgFile,
00275         kItemImgModule,
00276         kItemImgRevision,
00277         kItemImgBranch,
00278         kItemImgBranchAndRevision,
00279     };

Constructor & Destructor Documentation

CItemListDlg::CItemListDlg | ( | const MultiFiles * | mf,
 |  | const char * | item,
 |  | kItemListDlg | type,
 |  | ItemList & | itemList,
 |  | const ListPath * | listPath,
 |  | bool | forceCvsroot,
 |  | const char * | rev,
 |  | const char * | date,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 781 of file ItemListDlg.cpp.

References FALSE, gItemListModuleList, gItemListTagRecurse, kItemListModule, kItemListTag, m_cvsStopped, m_date, m_dateCombo, m_forceCvsroot, m_hasDate, m_hasRev, m_item, m_listPath, m_option, m_readFrom, m_rev, m_revCombo, m_sortAsc, m_sortColumn, m_type, and USmartCombo::SetItems().

00785                            : m_mf(mf), m_itemList(itemList),
00786                            m_readFromCombo(USmartCombo::AutoDropWidth), m_autoRefreshCombo(USmartCombo::AutoDropWidth),
00787                            CDialog(CItemListDlg::IDD, pParent)
00788 {
00789     //{{AFX_DATA_INIT(CItemListDlg)
00790     m_readFrom = _T("");
00791     m_item = _T("");
00792     m_option = FALSE;
00793     m_forceCvsroot = FALSE;
00794     m_hasRev = FALSE;
00795     m_rev = _T("");
00796     m_date = _T("");
00797     m_hasDate = FALSE;
00798     //}}AFX_DATA_INIT
00799
00800     m_item = item;
00801
00802     m_type = type;
00803
00804     switch( m_type )
00805     {
00806     case kItemListTag:
00807         m_option = (bool)gItemListTagRecurse;
00808         break;
00809     case kItemListModule:
00810         m_option = (bool)gItemListModuleList;
00811         break;
00812     default:
00813         // Nothing to do
00814         break;
00815     }
00816
00817     if( listPath )
00818     {
00819         m_listPath = *listPath;
00820     }
00821
00822     m_cvsStopped = false;
00823
00824     m_forceCvsroot = forceCvsroot;
00825     m_rev = rev;
00826     m_date = date;
00827
00828     m_sortAsc = false;
00829     m_sortColumn = 0;
00830
00831     m_revCombo.SetItems(&gRevNames);
00832     m_dateCombo.SetItems(&gDateNames);
00833 }

Member Function Documentation

bool CItemListDlg::CheckSettings ( ) [private]

Verify that the settings are correct to retrieve items

Returns:
true if the settings are correct, false otherwise

Definition at line 1280 of file ItemListDlg.cpp.

References m_dateCombo, m_hasDateCheck, m_hasRevCheck, and m_revCombo.

Referenced by OnRefresh().

01281 {
01282     if( m_hasRevCheck.IsWindowEnabled() && m_hasRevCheck.GetCheck() && !m_revCombo.GetWindowTextLength() )
01283     {
01284         AfxMessageBox("Please enter more than 1 character");
01285         GotoDlgCtrl(&m_revCombo);
01286         return false;
01287     }
01288
01289     if( m_hasDateCheck.IsWindowEnabled() && m_hasDateCheck.GetCheck() && !m_dateCombo.GetWindowTextLength() )
01290     {
01291         AfxMessageBox("Please enter more than 1 character");
01292         GotoDlgCtrl(&m_dateCombo);
01293         return false;
01294     }
01295
01296     return true;
01297 }

int CALLBACK CItemListDlg::CompareItems | ( | LPARAM | itemData1,
 |  | LPARAM | itemData2,
 |  | LPARAM | lParam
 | ) | [static, private]

Callback method used for sorting of items in the list control

Parameters:
itemData1 | ItemDisplayInfo* of the first element
itemData2 | ItemDisplayInfo* of the second element
lParam | CompareInfo* Sort settings
Returns:
1, -1 or 0 depending on the sort settings

Definition at line 643 of file ItemListDlg.cpp.

References ASSERT, GetDateTime(), ItemDisplayInfo::GetDescription(), ItemDisplayInfo::GetDescriptionEx(), ItemDisplayInfo::GetItem(), kItemListModule, kItemListTag, CItemListDlg::CompareInfo::m_asc, CItemListDlg::CompareInfo::m_column, CItemListDlg::CompareInfo::m_option, CItemListDlg::CompareInfo::m_type, STR_ITEMLIST_DIR, and STR_ITEMLIST_UP_DIR.

00644 {
00645     int res = 0;
00646
00647     const CompareInfo* info = (CompareInfo*)lParam;
00648     if( info )
00649     {
00650         ItemDisplayInfo* displayInfo1 = (ItemDisplayInfo*)itemData1;
00651         ItemDisplayInfo* displayInfo2 = (ItemDisplayInfo*)itemData2;
00652
00653         if( displayInfo1 && displayInfo2 )
00654         {
00655             switch( info->m_type )
00656             {
00657             case kItemListTag:
00658                 switch( info->m_column )
00659                 {
00660                 case 0:
00661                     res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00662                     break;
00663                 case 1:
00664                     res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00665                     break;
00666                 default:
00667                     ASSERT(FALSE); // should not come here
00668                     break;
00669                 }
00670                 break;
00671             case kItemListModule:
00672                 if( info->m_option )
00673                 {
00674                     if( strcmp(displayInfo1->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
00675                     {
00676                         res = info->m_asc ? 1 : -1;
00677                     }
00678                     else if( strcmp(displayInfo2->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
00679                     {
00680                         res = info->m_asc ? -1 : 1;
00681                     }
00682                     else
00683                     {
00684                         bool isDir1 = strcmp(displayInfo1->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
00685                         bool isDir2 = strcmp(displayInfo2->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
00686
00687                         if( isDir1 && !isDir2 )
00688                         {
00689                             res = info->m_asc ? 1 : -1;
00690                         }
00691                         else if( !isDir1 && isDir2 )
00692                         {
00693                             res = info->m_asc ? -1 : 1;
00694                         }
00695                         else if( isDir1 && isDir2 )
00696                         {
00697                             res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00698                             if( info->m_column != 0 )
00699                             {
00700                                 if( info->m_asc )
00701                                 {
00702                                     res *= -1;
00703                                 }
00704                             }
00705                         }
00706                         else
00707                         {
00708                             switch( info->m_column )
00709                             {
00710                             case 0:
00711                                 res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00712                                 break;
00713                             case 1:
00714                                 res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00715                                 break;
00716                             case 2:
00717                                 {
00718                                     const time_t time1 = GetDateTime(displayInfo1->GetDescriptionEx().c_str());
00719                                     const time_t time2 = GetDateTime(displayInfo2->GetDescriptionEx().c_str());
00720
00721                                     if( time1 != (time_t)-1 && time2 != (time_t)-1 )
00722                                     {
00723                                         res = time1 < time2 ? -1 : (time1 > time2 ? 1 : 0);
00724                                     }
00725                                     else
00726                                     {
00727                                         res = stricmp(displayInfo1->GetDescriptionEx().c_str(), displayInfo2->GetDescriptionEx().c_str());
00728                                     }
00729                                 }
00730                                 break;
00731                             default:
00732                                 ASSERT(FALSE); // should not come here
00733                                 break;
00734                             }
00735                         }
00736                     }
00737                 }
00738                 else
00739                 {
00740                     switch( info->m_column )
00741                     {
00742                     case 0:
00743                         res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00744                         break;
00745                     case 1:
00746                         res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00747                         break;
00748                     case 2:
00749                         res = stricmp(displayInfo1->GetDescriptionEx().c_str(), displayInfo2->GetDescriptionEx().c_str());
00750                         break;
00751                     default:
00752                         ASSERT(FALSE); // should not come here
00753                         break;
00754                     }
00755                 }
00756
00757                 break;
00758             default:
00759                 ASSERT(FALSE);  // unknown type
00760                 break;
00761             }
00762         }
00763     }
00764
00765     if( res )
00766     {
00767         if( info->m_asc )
00768         {
00769             res *= -1;
00770         }
00771     }
00772
00773     return res;
00774 }

void CItemListDlg::DeleteAllItems ( ) [private]

Remove all items and release associated memory held in Item Data of the list control

Definition at line 1480 of file ItemListDlg.cpp.

References m_itemListCtrl.

Referenced by InitListCtrl(), and OnDestroy().

01481 {
01482     for(int nIndex = 0; nIndex < m_itemListCtrl.GetItemCount(); nIndex++)
01483     {
01484         ItemDisplayInfo* displayInfo = (ItemDisplayInfo*)m_itemListCtrl.GetItemData(nIndex);
01485         delete displayInfo;
01486     }
01487
01488     m_itemListCtrl.DeleteAllItems();
01489 }

void CItemListDlg::DisplayItems | ( | const ItemList & | itemList,
 |  | const int | launchRes,
 |  | stringstream * | cvsErr = NULL,
 |  | const bool | showUpDir = true
 | ) | [private]

Display items in the list

Parameters:
itemList | List of items to display
launchRes | Command launch result
cvsErr | Command error stream, can be NULL
showUpDir | Set to true to show the up-dir(..) in the list if appropriate

Definition at line 1306 of file ItemListDlg.cpp.

References ItemDisplayInfo::Create(), ItemDisplayInfo::GetDescription(), ItemDisplayInfo::GetDescriptionEx(), GetImageForItem(), ItemDisplayInfo::GetItem(), getline(), InitListCtrl(), kItemImgBlank, kItemListModule, kItemListTag, m_cvsStopped, ItemRowInfo::m_description, m_itemListCtrl, m_listPath, m_optionCheck, and m_type.

Referenced by OnInitDialog(), and OnRefresh().

01307 {
01308     if( itemList.size() == 0 )
01309     {
01310         if( !m_cvsStopped )
01311         {
01312             if( launchRes == 0 )
01313             {
01314                 // Show the info if the modules file doesn't contain any modules
01315                 if( kItemListModule == m_type && !m_optionCheck.GetCheck() )
01316                 {
01317                     InitListCtrl(kDisplayInfo);
01318                     m_itemListCtrl.InsertItem(0, "Modules file doesn't contain any modules definitions", kItemImgBlank);
01319                     m_itemListCtrl.EnableWindow(FALSE);
01320                 }
01321             }
01322             else if( cvsErr )
01323             {
01324                 InitListCtrl(kDisplayInfo);
01325
01326                 // Show the error in the list control
01327                 m_itemListCtrl.InsertItem(0, "Command failed:", kItemImgBlank);
01328
01329                 string line;
01330                 while( getline(*cvsErr, line) )
01331                 {
01332                     m_itemListCtrl.InsertItem(m_itemListCtrl.GetItemCount(), line.c_str(), kItemImgBlank);
01333                 }
01334
01335                 m_itemListCtrl.EnableWindow(FALSE);
01336             }
01337         }
01338     }
01339     else
01340     {
01341         // Insert the items
01342         ItemList::const_iterator it = itemList.begin();
01343         while( it != itemList.end() )
01344         {
01345             ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
01346             if( displayInfo )
01347             {
01348                 displayInfo->Create((*it).first, (*it).second);
01349
01350                 const int itemIndex = m_itemListCtrl.InsertItem(m_itemListCtrl.GetItemCount(), displayInfo->GetItem().c_str());
01351                 if( itemIndex > -1 )
01352                 {
01353                     if( kItemListTag == m_type || kItemListModule == m_type )
01354                     {
01355                         m_itemListCtrl.SetItemText(itemIndex, 1, displayInfo->GetDescription().c_str());
01356                     }
01357
01358                     if( kItemListModule == m_type )
01359                     {
01360                         m_itemListCtrl.SetItemText(itemIndex, 2, displayInfo->GetDescriptionEx().c_str());
01361                     }
01362
01363                     if( !m_itemListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
01364                     {
01365                         delete displayInfo;
01366                     }
01367
01368                     const int image = GetImageForItem(m_type, m_optionCheck.GetCheck() != 0, displayInfo);
01369                     if( image > -1 )
01370                     {
01371                         m_itemListCtrl.SetItem(itemIndex, -1, LVIF_IMAGE, NULL, image, 0, 0, 0);
01372                     }
01373                 }
01374                 else
01375                 {
01376                     delete displayInfo;
01377                 }
01378             }
01379
01380             it++;
01381         }
01382     }
01383
01384     if( showUpDir && kItemListModule == m_type && m_optionCheck.GetCheck() && !m_listPath.empty() )
01385     {
01386         // Insert the ".." to move one level up in the directories tree
01387         ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
01388         if( displayInfo )
01389         {
01390             ItemRowInfo rowInfo;
01391             rowInfo.m_description.insert(STR_ITEMLIST_DIR);
01392
01393             displayInfo->Create(string(STR_ITEMLIST_UP_DIR), rowInfo);
01394
01395             const int itemIndex = m_itemListCtrl.InsertItem(0, displayInfo->GetItem().c_str());
01396             if( itemIndex > -1 )
01397             {
01398                 m_itemListCtrl.SetItemText(itemIndex, 1, displayInfo->GetDescription().c_str());
01399
01400                 if( !m_itemListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
01401                 {
01402                     delete displayInfo;
01403                 }
01404
01405                 const int image = GetImageForItem(m_type, m_optionCheck.GetCheck() != 0, displayInfo);
01406                 if( image > -1 )
01407                 {
01408                     m_itemListCtrl.SetItem(itemIndex, -1, LVIF_IMAGE, NULL, image, 0, 0, 0);
01409                 }
01410             }
01411             else
01412             {
01413                 delete displayInfo;
01414             }
01415         }
01416     }
01417 }

void CItemListDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 836 of file ItemListDlg.cpp.

References DDX_ComboMString(), ItemDisplayInfo::GetItem(), ItemDisplayInfo::GetRowInfo(), m_itemList, and m_itemListCtrl.

00837 {
00838     CDialog::DoDataExchange(pDX);
00839     //{{AFX_DATA_MAP(CItemListDlg)
00840     DDX_Control(pDX, IDC_AUTO_REFRESH, m_autoRefreshCombo);
00841     DDX_Control(pDX, IDC_SELECTION, m_selectionButton);
00842     DDX_Control(pDX, IDCANCEL, m_cancelButton);
00843     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00844     DDX_Control(pDX, IDC_ITEM, m_itemEdit);
00845     DDX_Control(pDX, IDC_REFRESH, m_refreshButton);
00846     DDX_Control(pDX, IDOK, m_okButton);
00847     DDX_Control(pDX, IDC_BROWSE_READFROM, m_browseReadFromButton);
00848     DDX_Control(pDX, IDC_ITEMLABEL, m_itemLabelStatic);
00849     DDX_Control(pDX, IDC_CHECKDATE, m_hasDateCheck);
00850     DDX_Control(pDX, IDC_CHECKREV, m_hasRevCheck);
00851     DDX_Control(pDX, IDC_FORCEROOT, m_forceCvsrootCheck);
00852     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00853     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00854     DDX_Control(pDX, IDC_OPTION, m_optionCheck);
00855     DDX_Control(pDX, IDC_ITEMLIST, m_itemListCtrl);
00856     DDX_Control(pDX, IDC_READFROM, m_readFromCombo);
00857     DDX_CBString(pDX, IDC_READFROM, m_readFrom);
00858     DDX_Text(pDX, IDC_ITEM, m_item);
00859     DDX_Check(pDX, IDC_OPTION, m_option);
00860     DDX_Check(pDX, IDC_FORCEROOT, m_forceCvsroot);
00861     DDX_Check(pDX, IDC_CHECKREV, m_hasRev);
00862     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00863     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00864     DDX_Check(pDX, IDC_CHECKDATE, m_hasDate);
00865     //}}AFX_DATA_MAP
00866
00867     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00868     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00869
00870     if( pDX->m_bSaveAndValidate )
00871     {
00872         m_itemList.clear();
00873
00874         for(int nIndex = 0; nIndex < m_itemListCtrl.GetItemCount(); nIndex++)
00875         {
00876             ItemDisplayInfo* displayInfo = (ItemDisplayInfo*)m_itemListCtrl.GetItemData(nIndex);
00877             if( displayInfo )
00878             {
00879                 m_itemList.insert(std::make_pair(displayInfo->GetItem(), displayInfo->GetRowInfo()));
00880             }
00881         }
00882     }
00883 }

void CItemListDlg::EnableControls ( BOOL enable ) [private]

Enable or disable controls

Parameters:
enable Set to TRUE to enable controls, FALSE to disable controls

Definition at line 1156 of file ItemListDlg.cpp.

References InitOptionCtrls(), m_autoRefreshCombo, m_browseReadFromButton, m_browseTagButton, m_dateCombo, m_forceCvsrootCheck, m_hasDateCheck, m_hasRevCheck, m_itemEdit, m_itemListCtrl, m_okButton, m_optionCheck, m_readFromCombo, m_refreshButton, m_revCombo, m_selectionButton, and OnForceroot().

Referenced by OnRefresh().

01157 {
01158     m_okButton.EnableWindow(enable);
01159     m_refreshButton.EnableWindow(enable);
01160     m_readFromCombo.EnableWindow(enable);
01161     m_itemListCtrl.EnableWindow(enable);
01162     m_itemEdit.EnableWindow(enable);
01163     m_selectionButton.EnableWindow(enable);
01164
01165     m_optionCheck.EnableWindow(enable);
01166
01167     m_forceCvsrootCheck.EnableWindow(enable);
01168     m_autoRefreshCombo.EnableWindow(enable);
01169
01170     if( !enable )
01171     {
01172         m_hasRevCheck.EnableWindow(FALSE);
01173         m_revCombo.EnableWindow(FALSE);
01174
01175         m_browseTagButton.EnableWindow(FALSE);
01176
01177         m_hasDateCheck.EnableWindow(FALSE);
01178         m_dateCombo.EnableWindow(FALSE);
01179
01180         m_browseReadFromButton.EnableWindow(FALSE);
01181     }
01182     else
01183     {
01184         InitOptionCtrls();
01185         OnForceroot();
01186     }
01187 }

bool CItemListDlg::EnableDateRev ( ) [private]

int CItemListDlg::GetImageForItem | ( | kItemListDlg | type,
 |  | bool | option,
 |  | const ItemDisplayInfo * | displayInfo
 | ) | [private]

Get the image corresponding to the given item

Parameters:
type | Item list type
option | Item list option
displayInfo | Item info to find the image for
Returns:
The image index in the image list to be used for item or -1 if not image was selected

Definition at line 1426 of file ItemListDlg.cpp.

References ASSERT, ItemDisplayInfo::GetDescription(), ItemDisplayInfo::GetItem(), kItemImgBranch, kItemImgBranchAndRevision, kItemImgDir, kItemImgFile, kItemImgModule, kItemImgRevision, kItemImgUpDir, kItemListModule, kItemListTag, and STR_ITEMLIST_UP_DIR.

Referenced by DisplayItems().

01427 {
01428     int res = -1;
01429
01430     switch( type )
01431     {
01432     case kItemListTag:
01433         {
01434             bool hasRevision = displayInfo->GetDescription().find(STR_ITEMLIST_REVISION) != string::npos;
01435             bool hasBranch = displayInfo->GetDescription().find(STR_ITEMLIST_BRANCH) != string::npos;
01436
01437             if( hasRevision && hasBranch )
01438             {
01439                 res = kItemImgBranchAndRevision;
01440             }
01441             else if( hasBranch )
01442             {
01443                 res = kItemImgBranch;
01444             }
01445             else
01446             {
01447                 res = kItemImgRevision;
01448             }
01449         }
01450         break;
01451     case kItemListModule:
01452         if( option )
01453         {
01454             if( strcmp(displayInfo->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
01455             {
01456                 res = kItemImgUpDir;
01457             }
01458             else
01459             {
01460                 bool isDir = displayInfo->GetDescription().find(STR_ITEMLIST_DIR) != string::npos;
01461                 res = isDir ? kItemImgDir : kItemImgFile;
01462             }
01463         }
01464         else
01465         {
01466             res = kItemImgModule;
01467         }
01468         break;
01469     default:
01470         ASSERT(FALSE);  // unknown type
01471         break;
01472     }
01473
01474     return res;
01475 }

void CItemListDlg::InitListCtrl ( const kDisplayType displayType ) [private]

Set the list control columns appropriate to the dialog type, show prompt message eventually

Parameters:
displayType Display type as specified by kDisplayType enum
Note:
Prompt message will be shown while data are being read

Definition at line 1058 of file ItemListDlg.cpp.

References ASSERT, DeleteAllItems(), kDisplayData, kDisplayInfo, kDisplayWait, kItemListModule, kItemListTag, m_itemListCtrl, and m_optionCheck.

Referenced by DisplayItems(), OnInitDialog(), and OnRefresh().

01059 {
01060     CWndRedrawMngr redrawMngr(&m_itemListCtrl);
01061
01062     // Remove all items and columns
01063     DeleteAllItems();
01064
01065     int columnCount = m_itemListCtrl.GetHeaderCtrl()->GetItemCount();
01066     while( columnCount-- )
01067     {
01068         m_itemListCtrl.DeleteColumn(0);
01069     }
01070
01071     // Get the client area width to properly size columns
01072     CRect rect;
01073     m_itemListCtrl.GetClientRect(rect);
01074
01075     const int listCtrlWidth = rect.Width();
01076
01077     // Set the appropriate columns
01078     switch( displayType )
01079     {
01080     case kDisplayWait:
01081         m_itemListCtrl.InsertColumn(0, "Action", LVCFMT_LEFT, listCtrlWidth);
01082
01083         m_itemListCtrl.InsertItem(0, "Please wait while retrieving data", kItemImgBlank);
01084         m_itemListCtrl.InsertItem(1, "You can press Stop button to cancel the operation", kItemImgBlank);
01085         break;
01086     case kDisplayData:
01087         {
01088             const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
01089
01090             switch( m_type )
01091             {
01092             case kItemListTag:
01093                 m_itemListCtrl.InsertColumn(0, "Tag/branch", LVCFMT_LEFT, 200);
01094                 m_itemListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, listCtrlWidthNoScroll - 200);
01095                 break;
01096             case kItemListModule:
01097                 if( m_optionCheck.GetCheck() )
01098                 {
01099                     m_itemListCtrl.InsertColumn(0, "Module", LVCFMT_LEFT, 200);
01100                     m_itemListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, 120);
01101                     m_itemListCtrl.InsertColumn(2, "Timestamp", LVCFMT_LEFT, listCtrlWidthNoScroll - 120 - 200);
01102                 }
01103                 else
01104                 {
01105                     m_itemListCtrl.InsertColumn(0, "Module", LVCFMT_LEFT, 200);
01106                     m_itemListCtrl.InsertColumn(1, "Options", LVCFMT_LEFT, 60);
01107                     m_itemListCtrl.InsertColumn(2, "Directories / Files", LVCFMT_LEFT, listCtrlWidthNoScroll - 60 - 200);
01108                 }
01109                 break;
01110             default:
01111                 ASSERT(FALSE);  // unknown type
01112                 break;
01113             }
01114         }
01115         break;
01116     case kDisplayInfo:
01117         m_itemListCtrl.InsertColumn(0, "Information", LVCFMT_LEFT, listCtrlWidth);
01118         break;
01119     default:
01120         ASSERT(FALSE);  // unknown display type
01121         break;
01122     }
01123 }

void CItemListDlg::InitOptionCtrls ( ) [private]

Set the controls dependent on the Option state

Definition at line 1128 of file ItemListDlg.cpp.

References gItemListModuleList, gItemListTagRecurse, kItemListModule, kItemListTag, m_hasDateCheck, m_hasRevCheck, m_optionCheck, m_type, OnCheckdate(), and OnCheckrev().

Referenced by EnableControls(), OnInitDialog(), and OnOption().

01129 {
01130     BOOL enableDateRev = (kItemListModule == m_type && !m_optionCheck.GetCheck()) ? false : true;
01131
01132     m_hasRevCheck.EnableWindow(enableDateRev);
01133     m_hasDateCheck.EnableWindow(enableDateRev);
01134
01135     OnCheckrev();
01136     OnCheckdate();
01137
01138     switch( m_type )
01139     {
01140     case kItemListTag:
01141         gItemListTagRecurse = m_optionCheck.GetCheck() != 0;
01142         break;
01143     case kItemListModule:
01144         gItemListModuleList = m_optionCheck.GetCheck() != 0;
01145         break;
01146     default:
01147         // Nothing to do
01148         break;
01149     }
01150 }

void CItemListDlg::OnBrowseReadfrom ( ) [protected]

BN_CLICKED message handler, browse for file/directory.

Definition at line 1606 of file ItemListDlg.cpp.

References CompatGetModuleListItem(), CStr, and m_readFromCombo.

01607 {
01608     CStr moduleName;
01609     if( CompatGetModuleListItem(m_mf, moduleName) )
01610     {
01611         m_readFromCombo.SetWindowText((const char*)moduleName);
01612         GotoDlgCtrl(&m_browseReadFromButton);
01613     }
01614 }

void CItemListDlg::OnBrowseTag ( ) [protected]

BN_CLICKED message handler, browse for tag/branch.

Definition at line 1595 of file ItemListDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

01596 {
01597     CStr tagName;
01598     if( CompatGetTagListItem(m_mf, tagName) )
01599     {
01600         m_rev = (const char*)tagName;
01601         m_revCombo.SetWindowText(m_rev);
01602     }
01603 }

void CItemListDlg::OnCancel ( ) [protected, virtual]

OnCancel virtual override, stop CVS command or cancel dialog.

Definition at line 1537 of file ItemListDlg.cpp.

References CWincvsApp::IsCvsRunning(), CWincvsApp::IsCvsStopping(), m_cvsStopped, m_itemListCtrl, and stopCVS().

01538 {
01539     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01540     if( app && app->IsCvsRunning() && !app->IsCvsStopping() )
01541     {
01542         m_itemListCtrl.DeleteAllItems();
01543         m_itemListCtrl.InsertItem(0, "Stopping...", kItemImgBlank);
01544
01545         m_cvsStopped = true;
01546         stopCVS();
01547         return;
01548     }
01549
01550     CDialog::OnCancel();
01551 }

void CItemListDlg::OnCheckdate ( ) [protected]

BN_CLICKED message handler, enable date combo box.

Definition at line 1587 of file ItemListDlg.cpp.

References kItemListModule, m_dateCombo, m_hasDateCheck, m_optionCheck, and m_type.

Referenced by InitOptionCtrls().

01588 {
01589     bool enable = m_hasDateCheck.GetCheck() && !(kItemListModule == m_type && !m_optionCheck.GetCheck());
01590
01591     m_dateCombo.EnableWindow(enable);
01592 }

void CItemListDlg::OnCheckrev ( ) [protected]

BN_CLICKED message handler, enable revision combo box.

Definition at line 1578 of file ItemListDlg.cpp.

References kItemListModule, m_browseTagButton, m_hasRevCheck, m_optionCheck, m_revCombo, and m_type.

Referenced by InitOptionCtrls().

01579 {
01580     bool enable = m_hasRevCheck.GetCheck() && !(kItemListModule == m_type && !m_optionCheck.GetCheck());
01581
01582     m_revCombo.EnableWindow(enable);
01583     m_browseTagButton.EnableWindow(enable);
01584 }

void CItemListDlg::OnColumnclickItemlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_COLUMNCLICK message handler, sort items in response to column click.

Definition at line 1710 of file ItemListDlg.cpp.

References m_optionCheck, m_sortAsc, m_sortColumn, and SortItems().

01711 {
01712     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01713
01714     if( m_sortColumn != pNMListView->iSubItem )
01715     {
01716         m_sortAsc = false;
01717     }
01718     else
01719     {
01720         m_sortAsc = !m_sortAsc;
01721     }
01722
01723     m_sortColumn = pNMListView->iSubItem;
01724
01725     SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01726
01727     *pResult = 0;
01728 }

void CItemListDlg::OnDblclkItemlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

NM_DBLCLK message handler, select the item and close dialog for tag/modules browser or navigate directories for directory and files listing.

Definition at line 1634 of file ItemListDlg.cpp.

References kItemListModule, m_itemEdit, m_itemListCtrl, m_listPath, m_optionCheck, m_type, OnOK(), PostClickRefresh(), STR_ITEMLIST_DIR, and STR_ITEMLIST_UP_DIR.

01635 {
01636     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01637     if( pNMListView->iItem > -1 )
01638     {
01639         if( kItemListModule == m_type && m_optionCheck.GetCheck() )
01640         {
01641             const CString description = m_itemListCtrl.GetItemText(pNMListView->iItem, 1);
01642             if( description == STR_ITEMLIST_DIR )
01643             {
01644                 const CString item = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01645                 if( item == STR_ITEMLIST_UP_DIR )
01646                 {
01647                     if( !m_listPath.empty() )
01648                     {
01649                         // Set the item for selection in up-level
01650                         const string backItem = m_listPath.back();
01651                         m_itemEdit.SetWindowText(backItem.c_str());
01652
01653                         m_listPath.pop_back();
01654                     }
01655                 }
01656                 else
01657                 {
01658                     // Make it so it's easy to "return" where we came from
01659                     m_itemEdit.SetWindowText(STR_ITEMLIST_UP_DIR);
01660                     m_listPath.push_back((LPCTSTR)item);
01661                 }
01662
01663                 PostClickRefresh();
01664             }
01665         }
01666         else
01667         {
01668             OnOK();
01669         }
01670     }
01671
01672     *pResult = 0;
01673 }

void CItemListDlg::OnDestroy ( ) [protected]

WM_DESTROY message handler, release any memory allocated.

Definition at line 1753 of file ItemListDlg.cpp.

References DeleteAllItems().

01754 {
01755     DeleteAllItems();
01756
01757     CDialog::OnDestroy();
01758 }

void CItemListDlg::OnForceroot ( ) [protected]

BN_CLICKED message handler, enable related controls.

Definition at line 1568 of file ItemListDlg.cpp.

References kItemListModule, kItemListTag, m_browseReadFromButton, m_forceCvsrootCheck, m_optionCheck, m_readFromCombo, and m_type.

Referenced by EnableControls(), and OnInitDialog().

01569 {
01570     bool enableReadFrom = !(kItemListModule == m_type && m_forceCvsrootCheck.GetCheck() && !m_optionCheck.GetCheck());
01571     m_readFromCombo.EnableWindow(enableReadFrom);
01572
01573     bool enableBrowseReadFrom = kItemListTag == m_type && m_forceCvsrootCheck.GetCheck();
01574     m_browseReadFromButton.EnableWindow(enableBrowseReadFrom);
01575 }

BOOL CItemListDlg::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initializes controls and triggers data reading if necessary.

Definition at line 908 of file ItemListDlg.cpp.

References ASSERT, MultiFiles::begin(), CStr, DisplayItems(), UStr::empty(), MultiFiles::end(), UStr::endsWith(), FALSE, MultiFiles::getdir(), gItemListAutoRefreshModule, gItemListAutoRefreshTag, InitListCtrl(), InitOptionCtrls(), kAutoRefreshAlways, kAutoRefreshFirstTime, kItemListAutoRefreshType, kItemListModule, kItemListTag, m_autoRefreshCombo, m_browseReadFromButton, m_headerCtrl, m_item, m_itemLabelStatic, m_itemList, m_itemListCtrl, m_itemsImageList, m_mf, m_optionCheck, m_readFromCombo, m_type, MultiFiles::NumDirs(), OnForceroot(), PostClickRefresh(), SelectItem(), SetListCtrlExtendedStyle(), SortItems(), MultiFiles::TotalNumFiles(), and TRUE.

00909 {
00910     CDialog::OnInitDialog();
00911
00912     // Extra initialization
00913     SetListCtrlExtendedStyle(&m_itemListCtrl, LVS_EX_FULLROWSELECT);
00914
00915     // Setup controls
00916     CHeaderCtrl* headerCtrl = m_itemListCtrl.GetHeaderCtrl();
00917     if( headerCtrl )
00918     {
00919         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00920     }
00921
00922     InitListCtrl(kDisplayData);
00923     InitOptionCtrls();
00924     OnForceroot();
00925
00926     m_itemsImageList.Create(IDR_ITEMLIST, 16, 1, RGB(255, 0, 255));
00927     m_itemListCtrl.SetImageList(&m_itemsImageList, LVSIL_SMALL);
00928
00929     int nReadFromSelection = 0;
00930
00931     if( m_mf )
00932     {
00933         // Add selected directories
00934         for( int nIndex = 0; nIndex < m_mf->NumDirs(); nIndex++ )
00935         {
00936             CStr path;
00937             if( m_mf->getdir(nIndex, path) )
00938             {
00939                 m_readFromCombo.AddString(CString(path));
00940             }
00941         }
00942     }
00943
00944     switch( m_type )
00945     {
00946     case kItemListTag:
00947         // Set windows titles
00948         SetWindowText("Select tag/branch");
00949         m_itemLabelStatic.SetWindowText("&Tag/branch:");
00950         m_optionCheck.SetWindowText("&Recurse");
00951
00952         // The browser selection
00953         if( m_mf && m_mf->TotalNumFiles() )
00954         {
00955             MultiFiles::const_iterator mfi;
00956             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00957             {
00958                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00959                 {
00960                     UStr path;
00961                     UStr fileName;
00962                     UStr currRev;
00963
00964                     mfi->get(nIndex, path, fileName, currRev);
00965                     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00966                         path << kPathDelimiter;
00967
00968                     path << fileName;
00969
00970                     const int nComboIndex = m_readFromCombo.AddString(path);
00971
00972                     // It's better to have a single file selected initially for the performance reasons
00973                     if( 0 == nReadFromSelection )
00974                     {
00975                         nReadFromSelection = nComboIndex;
00976                     }
00977                 }
00978             }
00979         }
00980
00981         break;
00982     case kItemListModule:
00983         // Set windows titles
00984         SetWindowText("Select module");
00985         m_itemLabelStatic.SetWindowText("&Module:");
00986         m_optionCheck.SetWindowText("&List");
00987
00988         m_browseReadFromButton.ShowWindow(SW_HIDE);
00989         break;
00990     default:
00991         ASSERT(FALSE);  // unknown type
00992         EndDialog(IDCANCEL);
00993         return FALSE;
00994     }
00995
00996     // Set the "read from"
00997     if( m_readFromCombo.GetCount() )
00998     {
00999         m_readFromCombo.SetCurSel(nReadFromSelection);
01000     }
01001
01002     // Trigger refresh
01003     kItemListAutoRefreshType autoRefresh = kAutoRefreshFirstTime;
01004
01005     if( kItemListModule == m_type )
01006     {
01007         autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshModule;
01008     }
01009     else if( kItemListTag == m_type )
01010     {
01011         autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshTag;
01012     }
01013     else
01014     {
01015         ASSERT(FALSE); // unknown type
01016     }
01017
01018     m_autoRefreshCombo.SetCurSel(autoRefresh);
01019
01020     if( (kAutoRefreshAlways == autoRefresh) || (kAutoRefreshFirstTime == autoRefresh && m_itemList.empty()) )
01021     {
01022         // Force the window to show itself
01023         ShowWindow(SW_SHOW);
01024         PostClickRefresh();
01025     }
01026     else
01027     {
01028         DisplayItems(m_itemList, 0, NULL, false);
01029         if( m_itemListCtrl.IsWindowEnabled() )
01030         {
01031             SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01032         }
01033
01034         if( !m_item.IsEmpty() )
01035         {
01036             SelectItem(m_item);
01037         }
01038     }
01039
01040     return TRUE;  // return TRUE unless you set the focus to a control
01041                   // EXCEPTION: OCX Property Pages should return FALSE
01042 }

void CItemListDlg::OnItemchangedItemlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_ITEMCHANGED message handler, update the item edit box value as selection is changing.

Definition at line 1676 of file ItemListDlg.cpp.

References FormatListPath(), kItemListModule, m_itemEdit, m_itemListCtrl, m_optionCheck, m_type, and STR_ITEMLIST_UP_DIR.

01677 {
01678     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01679     if( pNMListView->iItem > -1 &&
01680         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
01681     {
01682         CString item;
01683
01684         if( kItemListModule == m_type && m_optionCheck.GetCheck() )
01685         {
01686             item = FormatListPath(m_listPath).c_str();
01687
01688             CString selItem = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01689             if( selItem  != STR_ITEMLIST_UP_DIR )
01690             {
01691                 item += selItem;
01692             }
01693             else
01694             {
01695                 item.TrimRight('/');
01696             }
01697         }
01698         else
01699         {
01700             item = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01701         }
01702
01703         m_itemEdit.SetWindowText(item);
01704     }
01705
01706     *pResult = 0;
01707 }

void CItemListDlg::OnOK ( ) [protected, virtual]

OnOK virtual override, store the persistent data.

Definition at line 1518 of file ItemListDlg.cpp.

References gItemListModuleList, gItemListTagRecurse, kItemListModule, kItemListTag, and m_optionCheck.

Referenced by OnDblclkItemlist(), and OnSelection().

01519 {
01520     switch( m_type )
01521     {
01522     case kItemListTag:
01523         gItemListTagRecurse = m_optionCheck.GetCheck() != 0;
01524         break;
01525     case kItemListModule:
01526         gItemListModuleList = m_optionCheck.GetCheck() != 0;
01527         break;
01528     default:
01529         // Nothing to do
01530         break;
01531     }
01532
01533     CDialog::OnOK();
01534 }

void CItemListDlg::OnOption ( ) [protected]

BN_CLICKED message handler, initialize the related controls and sort settings.

Definition at line 1554 of file ItemListDlg.cpp.

References InitOptionCtrls(), kItemListModule, m_listPath, m_sortAsc, m_sortColumn, and m_type.

01555 {
01556     InitOptionCtrls();
01557
01558     if( m_type == kItemListModule )
01559     {
01560         m_listPath.clear();
01561
01562         m_sortAsc = false;
01563         m_sortColumn = 0;
01564     }
01565 }

void CItemListDlg::OnRefresh ( ) [protected]

BN_CLICKED message handler, re-reads the data.

Definition at line 1190 of file ItemListDlg.cpp.

References CheckSettings(), DisplayItems(), EnableControls(), InitListCtrl(), kItemListModule, LaunchItemListCommand(), m_cancelButton, m_cvsStopped, m_dateCombo, m_forceCvsrootCheck, m_hasDateCheck, m_hasRevCheck, m_itemEdit, m_itemListCtrl, m_listPath, m_optionCheck, m_readFromCombo, m_revCombo, m_type, SelectItem(), and SortItems().

01191 {
01192     m_cvsStopped = false;
01193
01194     // Verify the settings
01195     if( !CheckSettings() )
01196     {
01197         return;
01198     }
01199
01200     // Prepare controls
01201     EnableControls(FALSE);
01202
01203     // Change the Cancel button's name to "Stop"
01204     CString strPrevCancelText;
01205     m_cancelButton.GetWindowText(strPrevCancelText);
01206     m_cancelButton.SetWindowText("Stop");
01207
01208     // Store current item text
01209     CString strItem;
01210     m_itemEdit.GetWindowText(strItem);
01211
01212     // Display the reading data prompt
01213     InitListCtrl(kDisplayWait);
01214
01215     // Select and launch command
01216     CString strReadFrom;
01217     CString revision;
01218     CString date;
01219
01220     m_readFromCombo.GetWindowText(strReadFrom);
01221
01222     if( m_hasRevCheck.GetCheck() )
01223     {
01224         m_revCombo.GetWindowText(revision);
01225     }
01226
01227     if( m_hasDateCheck.GetCheck() )
01228     {
01229         m_dateCombo.GetWindowText(date);
01230     }
01231
01232     const char* readFrom = kItemListModule == m_type &&
01233         m_forceCvsrootCheck.GetCheck() && !m_optionCheck.GetCheck() ? "" : (LPCTSTR)strReadFrom;
01234
01235     std::auto_ptr<CItemListConsole> itemListConsole(LaunchItemListCommand(m_type, m_optionCheck.GetCheck() != 0,
01236         readFrom, m_forceCvsrootCheck.GetCheck() != 0,
01237         revision, date, &m_listPath));
01238
01239     if( !itemListConsole.get() )
01240     {
01241         EndDialog(IDCANCEL);
01242         return;
01243     }
01244
01245     // Initialize list control
01246     InitListCtrl(kDisplayData);
01247
01248     // Restore control's state
01249     EnableControls(TRUE);
01250
01251     // Display data
01252     DisplayItems(itemListConsole->GetItemList(), itemListConsole->GetLaunchRes(), &itemListConsole->GetCvsErr());
01253
01254     // Restore Cancel's button name
01255     m_cancelButton.SetWindowText(strPrevCancelText);
01256
01257     if( m_itemListCtrl.IsWindowEnabled() )
01258     {
01259         // Sort items
01260         SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01261
01262         // Try to select the item
01263         if( strItem.IsEmpty() && m_itemListCtrl.GetItemCount() )
01264         {
01265             strItem = m_itemListCtrl.GetItemText(0, 0);
01266         }
01267
01268         if( !strItem.IsEmpty() )
01269         {
01270             SelectItem(strItem);
01271             GotoDlgCtrl(&m_itemListCtrl);
01272         }
01273     }
01274 }

void CItemListDlg::OnSelchangeAutoRefresh ( ) [protected]

CBN_SELCHANGE message handler, update auto-refresh settings.

Definition at line 1775 of file ItemListDlg.cpp.

References ASSERT, gItemListAutoRefreshModule, gItemListAutoRefreshTag, kItemListModule, kItemListTag, m_autoRefreshCombo, and m_type.

01776 {
01777     const int autoRefresh = m_autoRefreshCombo.GetCurSel();
01778     if( autoRefresh > -1 )
01779     {
01780         if( kItemListModule == m_type )
01781         {
01782              gItemListAutoRefreshModule = autoRefresh;
01783         }
01784         else if( kItemListTag == m_type )
01785         {
01786             gItemListAutoRefreshTag = autoRefresh;
01787         }
01788         else
01789         {
01790             ASSERT(FALSE); // unknown type
01791         }
01792     }
01793 }

void CItemListDlg::OnSelection ( ) [protected]

BN_CLICKED message handler, browse selection info.

Definition at line 1617 of file ItemListDlg.cpp.

References CompatGetSelectionDetails(), CStr, kItemListModule, kSelDetPath, kSelDetRevision, kSelDetType, m_itemEdit, m_type, and OnOK().

01618 {
01619     kSelDetType selDetType = kItemListModule == m_type ? kSelDetPath : kSelDetRevision;
01620     CStr selection;
01621
01622     CString strSelection;
01623     m_itemEdit.GetWindowText(strSelection);
01624     selection = (const char*)strSelection;
01625
01626     if( CompatGetSelectionDetails(m_mf, selDetType, selection) )
01627     {
01628         m_itemEdit.SetWindowText(selection.c_str());
01629         OnOK();
01630     }
01631 }

BOOL CItemListDlg::PostClickRefresh ( ) [private]

"Click" the refresh button by posting the BN_CLICKED message for the refresh button

Returns:
TRUE on success, FALSE otherwise

Definition at line 1048 of file ItemListDlg.cpp.

Referenced by OnDblclkItemlist(), OnInitDialog(), and PreTranslateMessage().

01049 {
01050     return PostMessage(WM_COMMAND, MAKEWPARAM(IDC_REFRESH, BN_CLICKED), (LPARAM)NULL);
01051 }

BOOL CItemListDlg::PreTranslateMessage ( MSG * pMsg ) [virtual]

PreTranslateMessage virtual override, detects the F5 key pressed and refreshes the display.

Definition at line 1761 of file ItemListDlg.cpp.

References PostClickRefresh().

01762 {
01763     if( WM_KEYUP == pMsg->message )
01764     {
01765         if( VK_F5 == pMsg->wParam )
01766         {
01767             PostClickRefresh();
01768         }
01769     }
01770
01771     return CDialog::PreTranslateMessage(pMsg);
01772 }

bool CItemListDlg::SelectItem ( const char * item ) [private]

Find and select the item in the list control

Parameters:
item Item to be found
Returns:
true if the item was found, false otherwise
Note:
Even thought the item state is set to selected and focused it does not set the focus to the list control itself

Definition at line 1497 of file ItemListDlg.cpp.

References FALSE, and m_itemListCtrl.

Referenced by OnInitDialog(), and OnRefresh().

01498 {
01499     bool res = FALSE;
01500
01501     LVFINDINFO findInfo = { 0 };
01502     findInfo.flags = LVFI_STRING | LVFI_PARTIAL;
01503     findInfo.psz = item;
01504
01505     const int index = m_itemListCtrl.FindItem(&findInfo);
01506     if( index > -1 )
01507     {
01508         m_itemListCtrl.EnsureVisible(index, FALSE);
01509         m_itemListCtrl.SetItemState(index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
01510
01511         res = true;
01512     }
01513
01514     return res;
01515 }

void CItemListDlg::SortItems | ( | int | column,
 |  | bool | asc,
 |  | kItemListDlg | type,
 |  | bool | option
 | ) | [private]

Sort items listed in the list control

Parameters:
column | Column to sort items by
asc | Sort ascending or descending
type | List dialog type
option | Option state (recurse or list checkbox)
Note:
Using list control callback CompareItems

Definition at line 1738 of file ItemListDlg.cpp.

References CItemListDlg::CompareInfo::m_asc, CItemListDlg::CompareInfo::m_column, m_headerCtrl, m_itemListCtrl, CItemListDlg::CompareInfo::m_option, CItemListDlg::CompareInfo::m_type, and CSortHeaderCtrl::SetSortImage().

Referenced by OnColumnclickItemlist(), OnInitDialog(), and OnRefresh().

01739 {
01740     m_headerCtrl.SetSortImage(column, asc);
01741
01742     CompareInfo info = { 0 };
01743
01744     info.m_column = column;
01745     info.m_asc = asc;
01746     info.m_type = type;
01747     info.m_option = option;
01748
01749     m_itemListCtrl.SortItems(CompareItems, (DWORD)&info);
01750 }

Member Data Documentation

CSmartComboBox CItemListDlg::m_autoRefreshCombo

Definition at line 188 of file ItemListDlg.h.

Referenced by EnableControls(), OnInitDialog(), and OnSelchangeAutoRefresh().

CButton CItemListDlg::m_browseReadFromButton

Definition at line 195 of file ItemListDlg.h.

Referenced by EnableControls(), OnForceroot(), and OnInitDialog().

CButton CItemListDlg::m_browseTagButton

Definition at line 191 of file ItemListDlg.h.

Referenced by EnableControls(), and OnCheckrev().

CButton CItemListDlg::m_cancelButton

Definition at line 190 of file ItemListDlg.h.

Referenced by OnRefresh().

bool CItemListDlg::m_cvsStopped [private]

Flag indicating that user stopped the command

Definition at line 256 of file ItemListDlg.h.

Referenced by CItemListDlg(), DisplayItems(), OnCancel(), and OnRefresh().

CString CItemListDlg::m_date

Definition at line 211 of file ItemListDlg.h.

Referenced by CItemListDlg(), CompatGetModuleListItem(), and CompatGetTagListItem().

CSmartComboBox CItemListDlg::m_dateCombo

Definition at line 200 of file ItemListDlg.h.

Referenced by CheckSettings(), CItemListDlg(), EnableControls(), OnCheckdate(), and OnRefresh().

BOOL CItemListDlg::m_forceCvsroot

Definition at line 208 of file ItemListDlg.h.

Referenced by CItemListDlg(), CompatGetModuleListItem(), and CompatGetTagListItem().

CButton CItemListDlg::m_forceCvsrootCheck

Definition at line 199 of file ItemListDlg.h.

Referenced by EnableControls(), OnForceroot(), and OnRefresh().

BOOL CItemListDlg::m_hasDate

Definition at line 212 of file ItemListDlg.h.

Referenced by CItemListDlg().

CButton CItemListDlg::m_hasDateCheck

Definition at line 197 of file ItemListDlg.h.

Referenced by CheckSettings(), EnableControls(), InitOptionCtrls(), OnCheckdate(), and OnRefresh().

BOOL CItemListDlg::m_hasRev

Definition at line 209 of file ItemListDlg.h.

Referenced by CItemListDlg().

CButton CItemListDlg::m_hasRevCheck

Definition at line 198 of file ItemListDlg.h.

Referenced by CheckSettings(), EnableControls(), InitOptionCtrls(), OnCheckrev(), and OnRefresh().

CSortHeaderCtrl CItemListDlg::m_headerCtrl [private]

Definition at line 301 of file ItemListDlg.h.

Referenced by OnInitDialog(), and SortItems().

CString CItemListDlg::m_item

Definition at line 206 of file ItemListDlg.h.

Referenced by CItemListDlg(), CompatGetModuleListItem(), CompatGetTagListItem(), and OnInitDialog().

CEdit CItemListDlg::m_itemEdit

Definition at line 192 of file ItemListDlg.h.

Referenced by EnableControls(), OnDblclkItemlist(), OnItemchangedItemlist(), OnRefresh(), and OnSelection().

CStatic CItemListDlg::m_itemLabelStatic

Definition at line 196 of file ItemListDlg.h.

Referenced by OnInitDialog().

ItemList& CItemListDlg::m_itemList [private]

Item's container

Definition at line 255 of file ItemListDlg.h.

Referenced by DoDataExchange(), and OnInitDialog().

CListCtrl CItemListDlg::m_itemListCtrl

Definition at line 203 of file ItemListDlg.h.

Referenced by DeleteAllItems(), DisplayItems(), DoDataExchange(), EnableControls(), InitListCtrl(), OnCancel(), OnDblclkItemlist(), OnInitDialog(), OnItemchangedItemlist(), OnRefresh(), SelectItem(), and SortItems().

CImageList CItemListDlg::m_itemsImageList [private]

Definition at line 281 of file ItemListDlg.h.

Referenced by OnInitDialog().

ListPath CItemListDlg::m_listPath

Path to the current list location

Definition at line 249 of file ItemListDlg.h.

Referenced by CItemListDlg(), CompatGetModuleListItem(), DisplayItems(), OnDblclkItemlist(), OnOption(), and OnRefresh().

const MultiFiles* CItemListDlg::m_mf [private]

Browser selection

Definition at line 252 of file ItemListDlg.h.

Referenced by OnInitDialog().

CButton CItemListDlg::m_okButton

Definition at line 194 of file ItemListDlg.h.

Referenced by EnableControls().

BOOL CItemListDlg::m_option

Definition at line 207 of file ItemListDlg.h.

Referenced by CItemListDlg().

CButton CItemListDlg::m_optionCheck

Definition at line 202 of file ItemListDlg.h.

Referenced by DisplayItems(), EnableControls(), InitListCtrl(), InitOptionCtrls(), OnCheckdate(), OnCheckrev(), OnColumnclickItemlist(), OnDblclkItemlist(), OnForceroot(), OnInitDialog(), OnItemchangedItemlist(), OnOK(), and OnRefresh().

CString CItemListDlg::m_readFrom

Definition at line 205 of file ItemListDlg.h.

Referenced by CItemListDlg().

CSmartComboBox CItemListDlg::m_readFromCombo

Definition at line 204 of file ItemListDlg.h.

Referenced by EnableControls(), OnBrowseReadfrom(), OnForceroot(), OnInitDialog(), and OnRefresh().

CButton CItemListDlg::m_refreshButton

Definition at line 193 of file ItemListDlg.h.

Referenced by EnableControls().

CString CItemListDlg::m_rev

Definition at line 210 of file ItemListDlg.h.

Referenced by CItemListDlg(), CompatGetModuleListItem(), CompatGetTagListItem(), and OnBrowseTag().

CSmartComboBox CItemListDlg::m_revCombo

Definition at line 201 of file ItemListDlg.h.

Referenced by CheckSettings(), CItemListDlg(), EnableControls(), OnBrowseTag(), OnCheckrev(), and OnRefresh().

CButton CItemListDlg::m_selectionButton

Definition at line 189 of file ItemListDlg.h.

Referenced by EnableControls().

bool CItemListDlg::m_sortAsc [private]

Current ascending/descending sorting

Definition at line 299 of file ItemListDlg.h.

Referenced by CItemListDlg(), OnColumnclickItemlist(), and OnOption().

int CItemListDlg::m_sortColumn [private]

Current sort column

Definition at line 300 of file ItemListDlg.h.

Referenced by CItemListDlg(), OnColumnclickItemlist(), and OnOption().

kItemListDlg CItemListDlg::m_type [private]

Dialog type

Definition at line 254 of file ItemListDlg.h.

Referenced by CItemListDlg(), DisplayItems(), InitOptionCtrls(), OnCheckdate(), OnCheckrev(), OnDblclkItemlist(), OnForceroot(), OnInitDialog(), OnItemchangedItemlist(), OnOption(), OnRefresh(), OnSelchangeAutoRefresh(), and OnSelection().

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:16:47 2003 for WinCvs Source by doxygen 1.3-rc2


CItemListDlg::CompareInfo Struct Reference

Structure to hold the sorting settings. More...

Collaboration diagram for CItemListDlg::CompareInfo:

[legend]
List of all members.

Public Attributes

int | m_column
bool | m_asc
kItemListDlg m_type
bool | m_option

Detailed Description

Structure to hold the sorting settings.

Definition at line 291 of file ItemListDlg.h.

Member Data Documentation

bool CItemListDlg::CompareInfo::m_asc

Sort ascending or descending

Definition at line 294 of file ItemListDlg.h.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::SortItems().

int CItemListDlg::CompareInfo::m_column

Sorting column

Definition at line 293 of file ItemListDlg.h.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::SortItems().

bool CItemListDlg::CompareInfo::m_option

Option state

Definition at line 296 of file ItemListDlg.h.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::SortItems().

kItemListDlg CItemListDlg::CompareInfo::m_type

Dialog type

Definition at line 295 of file ItemListDlg.h.

Referenced by CItemListDlg::CompareItems(), and CItemListDlg::SortItems().

The documentation for this struct was generated from the following file:
  • common/ItemListDlg.h
Generated on Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


ItemRowInfo Struct Reference

Structure to hold item's row information. More...

#include <ItemListDlg.h>

Collaboration diagram for ItemRowInfo:

[legend]
List of all members.

Public Attributes

ItemDescription m_description
ItemDescription m_descriptionEx

Detailed Description

Structure to hold item's row information.

Definition at line 73 of file ItemListDlg.h.

Member Data Documentation

ItemDescription ItemRowInfo::m_description

Item's description

Definition at line 75 of file ItemListDlg.h.

Referenced by ItemDisplayInfo::Create(), CItemListDlg::DisplayItems(), CListParserConsole::Parse(), CModuleParserConsole::Parse(), and CTagParserConsole::Parse().

ItemDescription ItemRowInfo::m_descriptionEx

Item's extended description

Definition at line 76 of file ItemListDlg.h.

Referenced by ItemDisplayInfo::Create(), CListParserConsole::Parse(), and CModuleParserConsole::Parse().

The documentation for this struct was generated from the following file:
  • common/ItemListDlg.h
Generated on Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:49 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 212 of file MultiString.cpp.

References Split().

00213 {
00214     UStr key1, key2, val1, val2;
00215     Split(s1, key1, val1);
00216     Split(s2, key2, val2);
00217     return strcmp(key1, key2);
00218 }

void CKeyString::Concatenate | ( | UStr & | res,
 |  | const char * | key,
 |  | const char * | value
 | ) | [static]

Definition at line 171 of file MultiString.cpp.

Referenced by CvsPrefs::SetWhichCvs(), and CvsPrefs::WhichCvs().

00172 {
00173     char c;
00174     while((c = *key++) != '\0')
00175     {
00176         if(c == '@' || c == '\\')
00177             res << '\\';
00178         res << c;
00179     }
00180     res << '@';
00181     while((c = *value++) != '\0')
00182     {
00183         if(c == '@' || c == '\\')
00184             res << '\\';
00185         res << c;
00186     }
00187 }

void CKeyString::Split | ( | const char * | str,
 |  | UStr & | key,
 |  | UStr & | value
 | ) | [static]

Definition at line 189 of file MultiString.cpp.

Referenced by Compare(), and CvsPrefs::WhichCvs().

00190 {
00191     key = "";
00192     value = "";
00193     char c;
00194     bool inKey = true;
00195     while((c = *str++) != 0)
00196     {
00197         if(c == '\\')
00198             c = *str++;
00199         else if(c == '@')
00200         {
00201             inKey = false;
00202             continue;
00203         }
00204
00205         if(inKey)
00206             key << c;
00207         else
00208             value << c;
00209     }
00210 }

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Fri Jan 31 12:16:50 2003 for WinCvs Source by doxygen 1.3-rc2


CKeywordComboBox Class Reference

#include <KeywordComboBox.h>

Inheritance diagram for CKeywordComboBox:

[legend]
Collaboration diagram for CKeywordComboBox:

[legend]
List of all members.

Public Methods

CKeywordComboBox ()
virtual | ~CKeywordComboBox ()
void | SetDescriptionWnd (HWND hDesc)

Protected Methods

virtual void | PreSubclassWindow ()
PreSubclassWindow virtual override, add items to the drop down list.

afx_msg void | OnSelchange ()
CBN_SELCHANGE message handler, set the description for the option.

Private Methods

void | SetDescription ()

Private Attributes

HWND | m_hDesc

Detailed Description

Class to aid the keyword substitution selection

Note:
It supports automatic option description setting if the description window is given

Definition at line 42 of file KeywordComboBox.h.

Constructor & Destructor Documentation

CKeywordComboBox::CKeywordComboBox ( )

Definition at line 59 of file KeywordComboBox.cpp.

References m_hDesc, and NULL.

00060     : CSmartComboBox(USmartCombo::AutoDropWidth)
00061 {
00062     m_hDesc = NULL;
00063 }

CKeywordComboBox::~CKeywordComboBox ( ) [virtual]

Definition at line 65 of file KeywordComboBox.cpp.

00066 {
00067 }

Member Function Documentation

void CKeywordComboBox::OnSelchange ( ) [protected]

CBN_SELCHANGE message handler, set the description for the option.

Definition at line 80 of file KeywordComboBox.cpp.

References SetDescription().

00081 {
00082     SetDescription();
00083 }

void CKeywordComboBox::PreSubclassWindow ( ) [protected, virtual]

PreSubclassWindow virtual override, add items to the drop down list.

Reimplemented from CSmartComboBox.

Definition at line 116 of file KeywordComboBox.cpp.

References KEYWORD_MODE_COUNT, and CSmartComboBox::PreSubclassWindow().

00117 {
00118     CSmartComboBox::PreSubclassWindow();
00119
00120     for(int nIndex = 0; nIndex < KEYWORD_MODE_COUNT; nIndex++)
00121     {
00122         const int itemIndex = AddString(gKeywordModes[nIndex].mode);
00123         if( itemIndex > -1 )
00124         {
00125             SetItemData(itemIndex, (DWORD)gKeywordModes[nIndex].desc);
00126         }
00127     }
00128 }

void CKeywordComboBox::SetDescription ( ) [private]

Set the keyword substitution mode description according to the keywords combo box selection

Note:
The "Current" description is set if no selection is present

Definition at line 89 of file KeywordComboBox.cpp.

References keywordMode::desc, gKeywordModes, and m_hDesc.

Referenced by OnSelchange(), and SetDescriptionWnd().

00090 {
00091     if( m_hDesc && ::IsWindow(m_hDesc) )
00092     {
00093         const char* desc = gKeywordModes[0].desc;
00094         const int selItem = GetCurSel();
00095         if( selItem > -1 )
00096         {
00097             desc = (const char*)GetItemData(selItem);
00098         }
00099
00100         ::SetWindowText(m_hDesc, desc);
00101     }
00102 }

void CKeywordComboBox::SetDescriptionWnd ( HWND hDesc )

Set the description window handle

Parameters:
hDesc Description window handle
Note:
It updates the description window text immediately

Definition at line 109 of file KeywordComboBox.cpp.

References m_hDesc, and SetDescription().

Referenced by CUpdateSticky::OnInitDialog(), CDiff_MAIN::OnInitDialog(), and CCheckout_OPTIONS::OnInitDialog().

00110 {
00111     m_hDesc = hDesc;
00112     SetDescription();
00113 }

Member Data Documentation

HWND CKeywordComboBox::m_hDesc [private]

Description window handle

Definition at line 74 of file KeywordComboBox.h.

Referenced by CKeywordComboBox(), SetDescription(), and SetDescriptionWnd().

The documentation for this class was generated from the following files:
  • common/KeywordComboBox.h
  • common/KeywordComboBox.cpp
Generated on Fri Jan 31 12:16:51 2003 for WinCvs Source by doxygen 1.3-rc2


keywordMode Struct Reference

Structure to hold the keyword modes and their descriptions. More...

Collaboration diagram for keywordMode:

[legend]
List of all members.

Public Attributes

const char * | mode
const char * | desc

Detailed Description

Structure to hold the keyword modes and their descriptions.

Definition at line 34 of file KeywordComboBox.cpp.

Member Data Documentation

const char* keywordMode::desc

Keyword substitution description

Definition at line 37 of file KeywordComboBox.cpp.

Referenced by CKeywordComboBox::SetDescription().

const char* keywordMode::mode

Keyword substitution mode

Definition at line 36 of file KeywordComboBox.cpp.

The documentation for this struct was generated from the following file:
  • common/KeywordComboBox.cpp
Generated on Fri Jan 31 12:16:51 2003 for WinCvs Source by doxygen 1.3-rc2


KiColumn Class Reference

Column descriptor interface. More...

#include <BrowseViewColumn.h>

Inheritance diagram for KiColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const=0
Retrieve setup data.

virtual bool | IsDefaultAscending () const=0
Tells if the column shall be sorted ascending initially.

virtual void | GetText (KoColumnContext *context, EntnodeData *data, char *buffer, int buffersize) const=0
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const=0
Compare two nodes (-1,0,+1).

Detailed Description

Column descriptor interface.

Definition at line 46 of file BrowseViewColumn.h.

Member Function Documentation

virtual int KiColumn::Compare | ( | KoColumnContext * | context,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [pure virtual]

Compare two nodes (-1,0,+1).

Implemented in KoNameColumn, KoPathColumn, KoRevisionColumn, KoOptionColumn, KoStatusColumn, KoTagColumn, KoDateColumn, and KoConflictColumn.

Referenced by _Compare().

virtual void KiColumn::GetSetupData ( LV_COLUMN * lvc ) const [pure virtual]

Retrieve setup data.

Implemented in KoNameColumn, KoPathColumn, KoRevisionColumn, KoOptionColumn, KoStatusColumn, KoTagColumn, KoDateColumn, and KoConflictColumn.

Referenced by CBrowseFileView::AddColumns(), and UCvsFiles::ShowColumns().

virtual void KiColumn::GetText | ( | KoColumnContext * | context,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | buffersize
 | ) | const [pure virtual]

Retrieve formatted text as pertained to a node.

Implemented in KoNameColumn, KoPathColumn, KoRevisionColumn, KoOptionColumn, KoStatusColumn, KoTagColumn, KoDateColumn, and KoConflictColumn.

Referenced by TViewFill::InitItem(), and CBrowseFileView::OnPrint().

virtual bool KiColumn::IsDefaultAscending ( ) const [pure virtual]

Tells if the column shall be sorted ascending initially.

Implemented in KoNameColumn, KoPathColumn, KoRevisionColumn, KoOptionColumn, KoStatusColumn, KoTagColumn, KoDateColumn, and KoConflictColumn.

Referenced by CBrowseFileView::OnColumnclick().

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.h
Generated on Fri Jan 31 12:16:52 2003 for WinCvs Source by doxygen 1.3-rc2


KiColumnModel Class Reference

Columnar model of the data. More...

#include <BrowseViewColumn.h>

Inheritance diagram for KiColumnModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const=0
Gets column descriptor by its index.

virtual int | GetType (int pos) const=0
Gets column type by its index.

virtual int | GetCount () const=0
Returns count of the columns.

virtual int | GetColumn (int type) const
Gets column index by its type.

Static Public Methods

KiColumnModel * | GetRecursiveModel ()
KiColumnModel * | GetRegularModel ()

Detailed Description

Columnar model of the data.

Definition at line 64 of file BrowseViewColumn.h.

Member Function Documentation

virtual const KiColumn* KiColumnModel::GetAt ( int pos ) const [pure virtual]

Gets column descriptor by its index.

Implemented in KoRegularModel, and KoRecursiveModel.

Referenced by CBrowseFileView::AddColumns(), TViewFill::InitItem(), CBrowseFileView::OnColumnclick(), CBrowseFileView::OnPrint(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), CBrowseFileView::Resort(), UCvsFiles::Resort(), and UCvsFiles::ShowColumns().

int KiColumnModel::GetColumn ( int type ) const [virtual]

Gets column index by its type.

Definition at line 587 of file BrowseViewColumn.cpp.

References GetCount(), and GetType().

Referenced by TViewFill::InitItem().

00588 {
00589     int numColumns = GetCount();
00590     for(int i = 0; i < numColumns; i++)
00591     {
00592         if(type == GetType(i))
00593             return i;
00594     }
00595
00596     return 0;
00597 }

virtual int KiColumnModel::GetCount ( ) const [pure virtual]

Returns count of the columns.

Implemented in KoRegularModel, and KoRecursiveModel.

Referenced by CBrowseFileView::AddColumns(), CBrowseFileView::DeleteColumns(), GetColumn(), UCvsFiles::HideColumns(), TViewFill::InitItem(), CBrowseFileView::OnPrint(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), and UCvsFiles::ShowColumns().

KiColumnModel * KiColumnModel::GetRecursiveModel ( ) [static]

Definition at line 577 of file BrowseViewColumn.cpp.

References modelRecursive.

Referenced by CBrowseFileView::SetRecursive(), and UCvsFiles::SetRecursive().

00578 {
00579     return &modelRecursive;
00580 }

KiColumnModel * KiColumnModel::GetRegularModel ( ) [static]

Definition at line 582 of file BrowseViewColumn.cpp.

References modelRegular.

Referenced by CBrowseFileView::SetRecursive(), and UCvsFiles::SetRecursive().

00583 {
00584     return &modelRegular;
00585 }

virtual int KiColumnModel::GetType ( int pos ) const [pure virtual]

Gets column type by its index.

Implemented in KoRegularModel, and KoRecursiveModel.

Referenced by GetColumn().

The documentation for this class was generated from the following files:
  • common/BrowseViewColumn.h
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:16:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 UCvsFiles::OnCreate(), CBrowseFileView::OnDestroy(), UCvsFiles::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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 UCvsFolders::OnCreate(), UCvsFiles::OnCreate(), CWinCvsBrowser::OnDestroy(), CBrowseFileView::OnDestroy(), UCvsFolders::OnDestroy(), UCvsFiles::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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 UCvsFiles::OnCreate(), CBrowseFileView::OnDestroy(), UCvsFiles::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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


KiSelectionHandler Class Reference

Interface describing a handler to process a selection-related command. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KiSelectionHandler:

[legend]
Collaboration diagram for KiSelectionHandler:

[legend]
List of all members.

Public Methods

KiSelectionHandler (const char *strCommand, bool needSelection=true, bool needResetView=false)
virtual | ~KiSelectionHandler ()
kSelType | GetSelType () const
bool | GetNeedSelection () const
bool | GetNeedViewReset () const
virtual void | OnFolder (const char *fullpath)=0
virtual void | OnFiles (MultiFiles *pmf)=0
virtual MultiFiles * | GetSelection ()
virtual bool | NeedsNormalize ()

Protected Attributes

bool | m_needSelection
bool | m_needViewReset

Private Attributes

UStr m_strCommand
MultiFiles * m_pmf
kSelType m_selType
bool | m_autoDelete

Detailed Description

Interface describing a handler to process a selection-related command.

KiSelectionHandler is an abstract class designed to aid processing of a selection-related commands. Create command handlers by deriving from KiSelectionHandler and overriding virtual methods KiSelectionHandler::OnFolder and KiSelectionHandler::OnFiles.

The default value of KiSelectionHandler::m_needSelection can be changed if the command does not require selection to work properly (e.g checkout, import or rtag commands). However it's important to supply the selection whenever available.

The goal of passing the selection is to enable support for additional data retrieval and present the selection information for the user as needed. For example to show the files selected for commit command and enable to perform review of changes using diff command. There are also commands that use the selection information to retrieve the repository data such as modules or tags.

Definition at line 52 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KiSelectionHandler::KiSelectionHandler | ( | const char * | strCommand,
 |  | bool | needSelection = true,
 |  | bool | needViewReset = false
 | ) |

Constructor

Parameters:
strCommand | Command name
needSelection | Need selection indicator

Definition at line 41 of file BrowseViewHandlers.cpp.

References kSelNone, and NULL.

00042     : m_strCommand(strCommand), m_pmf(NULL), m_selType(kSelNone),
00043       m_autoDelete(false), m_needSelection(needSelection), m_needViewReset(needViewReset)
00044 {
00045 }

KiSelectionHandler::~KiSelectionHandler ( ) [virtual]

Definition at line 47 of file BrowseViewHandlers.cpp.

References m_autoDelete, and m_pmf.

00048 {
00049     if( m_autoDelete && m_pmf )
00050     {
00051         delete m_pmf;
00052     }
00053 }

Member Function Documentation

bool KiSelectionHandler::GetNeedSelection ( ) const

Get the need selection flag

Returns:
The need selection flag

Definition at line 68 of file BrowseViewHandlers.cpp.

References m_needSelection.

Referenced by CheckSelectionHandler().

00069 {
00070     return m_needSelection;
00071 }

bool KiSelectionHandler::GetNeedViewReset ( ) const

Get the need view reset

Returns:
The need view reset flag

Definition at line 77 of file BrowseViewHandlers.cpp.

References m_needViewReset.

Referenced by UCvsFiles::ProcessSelectionCommand().

00078 {
00079     return m_needViewReset;
00080 }

MultiFiles * KiSelectionHandler::GetSelection ( ) [virtual]

Get the selection

Returns:
The selection as a pointer to MultiFiles object
Note:
Prompts the user if necessary (controlled by KiSelectionHandler::m_needSelection flag)

Definition at line 117 of file BrowseViewHandlers.cpp.

References _i18n, ASSERT, BrowserGetDirectory(), BrowserGetMultiFiles(), CStr, kSelDir, kSelFiles, m_autoDelete, m_needSelection, m_pmf, m_strCommand, MultiFiles::newdir(), and NULL.

Referenced by CheckSelectionHandler().

00118 {
00119     if( !m_pmf && m_needSelection )
00120     {
00121         switch( m_selType )
00122         {
00123         case kSelFiles:
00124             m_pmf = new MultiFiles;
00125             if( m_pmf )
00126             {
00127                 m_autoDelete = true;
00128
00129                 CStr strPrompt;
00130                 strPrompt << _i18n("Select files for ");
00131                 strPrompt << m_strCommand;
00132
00133                 if( !BrowserGetMultiFiles(strPrompt, *m_pmf, false) )
00134                 {
00135                     delete m_pmf;
00136                     m_pmf = NULL;
00137                 }
00138             }
00139             break;
00140         case kSelDir:
00141             m_pmf = new MultiFiles;
00142             if( m_pmf )
00143             {
00144                 CStr strPrompt;
00145                 strPrompt << _i18n("Select directory to ");
00146                 strPrompt << m_strCommand;
00147
00148                 CStr dir;
00149                 if( BrowserGetDirectory(strPrompt, dir) )
00150                 {
00151                     m_pmf->newdir(dir);
00152                 }
00153                 else
00154                 {
00155                     delete m_pmf;
00156                     m_pmf = NULL;
00157                 }
00158             }
00159             break;
00160         default:
00161 #ifdef WIN32
00162             ASSERT(FALSE);  // type must be set to something if m_needSelection is true
00163 #endif
00164             break;
00165         }
00166     }
00167
00168     return m_pmf;
00169 }

kSelType KiSelectionHandler::GetSelType ( ) const

Get the selection type

Returns:
The selection type

Definition at line 59 of file BrowseViewHandlers.cpp.

References kSelType, and m_selType.

00060 {
00061     return m_selType;
00062 }

bool KiSelectionHandler::NeedsNormalize ( ) [virtual]

Reimplemented in KoGraphHandler, KoAddHandler, KoAddBinaryHandler, and KoAddUnicodeHandler.

Definition at line 171 of file BrowseViewHandlers.cpp.

Referenced by CheckSelectionHandler().

00172 {
00173     return false;
00174 }

void KiSelectionHandler::OnFiles ( MultiFiles * pmf ) [pure virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implemented in KoMoveToTrashHandler, KoUpdateMoveToTrashHandler, KoCreateTagHandler, KoDeleteTagHandler, KoBranchTagHandler, KoEditHandler, KoReservedEditHandler, KoForceEditHandler, KoUneditHandler, KoReleaseHandler, KoWatchersHandler, KoEditorsHandler, KoWatchOnHandler, KoWatchOffHandler, KoDiffHandler, KoGraphDiffHandler, KoLogHandler, KoGraphHandler, KoStatusHandler, KoFileRemoveHandler, KoLockHandler, KoUnlockHandler, KoAddHandler, KoAddBinaryHandler, KoAddUnicodeHandler, KoCommitHandler, KoUpdateHandler, KoQueryUpdateHandler, KoAnnotateHandler, KoCancelChangesHandler, KoCommandLineHandler, KoImportHandler, KoCheckoutHandler, KoRtagCreateHandler, KoRtagDeleteHandler, and KoRtagBranchHandler.

Definition at line 106 of file BrowseViewHandlers.cpp.

References kSelFiles, m_pmf, and m_selType.

Referenced by KoRtagBranchHandler::OnFiles(), KoRtagDeleteHandler::OnFiles(), KoRtagCreateHandler::OnFiles(), KoCheckoutHandler::OnFiles(), KoImportHandler::OnFiles(), KoCommandLineHandler::OnFiles(), KoCancelChangesHandler::OnFiles(), KoAnnotateHandler::OnFiles(), KoQueryUpdateHandler::OnFiles(), KoUpdateHandler::OnFiles(), KoCommitHandler::OnFiles(), KoAddUnicodeHandler::OnFiles(), KoAddBinaryHandler::OnFiles(), KoAddHandler::OnFiles(), KoUnlockHandler::OnFiles(), KoLockHandler::OnFiles(), KoFileRemoveHandler::OnFiles(), KoStatusHandler::OnFiles(), KoGraphHandler::OnFiles(), KoLogHandler::OnFiles(), KoGraphDiffHandler::OnFiles(), KoDiffHandler::OnFiles(), KoWatchOffHandler::OnFiles(), KoWatchOnHandler::OnFiles(), KoEditorsHandler::OnFiles(), KoWatchersHandler::OnFiles(), KoUneditHandler::OnFiles(), KoForceEditHandler::OnFiles(), KoReservedEditHandler::OnFiles(), KoEditHandler::OnFiles(), KoBranchTagHandler::OnFiles(), KoDeleteTagHandler::OnFiles(), KoCreateTagHandler::OnFiles(), KoMoveToTrashHandler::OnFiles(), CBrowseFileView::ProcessSelectionCommand(), and UCvsFiles::ProcessSelectionCommand().

00107 {
00108     m_selType = kSelFiles;
00109     m_pmf = pmf;
00110 }

void KiSelectionHandler::OnFolder ( const char * fullpath ) [pure virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implemented in KoMoveToTrashHandler, KoUpdateMoveToTrashHandler, KoCreateTagHandler, KoDeleteTagHandler, KoBranchTagHandler, KoEditHandler, KoReservedEditHandler, KoForceEditHandler, KoUneditHandler, KoReleaseHandler, KoWatchersHandler, KoEditorsHandler, KoWatchOnHandler, KoWatchOffHandler, KoDiffHandler, KoGraphDiffHandler, KoLogHandler, KoGraphHandler, KoStatusHandler, KoFileRemoveHandler, KoLockHandler, KoUnlockHandler, KoAddHandler, KoAddBinaryHandler, KoAddUnicodeHandler, KoCommitHandler, KoUpdateHandler, KoQueryUpdateHandler, KoAnnotateHandler, KoCancelChangesHandler, KoCommandLineHandler, KoImportHandler, KoCheckoutHandler, KoRtagCreateHandler, KoRtagDeleteHandler, and KoRtagBranchHandler.

Definition at line 87 of file BrowseViewHandlers.cpp.

References kSelDir, m_autoDelete, m_pmf, m_selType, and MultiFiles::newdir().

Referenced by KoRtagBranchHandler::OnFolder(), KoRtagDeleteHandler::OnFolder(), KoRtagCreateHandler::OnFolder(), KoCheckoutHandler::OnFolder(), KoImportHandler::OnFolder(), KoCommandLineHandler::OnFolder(), KoQueryUpdateHandler::OnFolder(), KoUpdateHandler::OnFolder(), KoCommitHandler::OnFolder(), KoAddUnicodeHandler::OnFolder(), KoAddBinaryHandler::OnFolder(), KoAddHandler::OnFolder(), KoUnlockHandler::OnFolder(), KoLockHandler::OnFolder(), KoStatusHandler::OnFolder(), KoLogHandler::OnFolder(), KoDiffHandler::OnFolder(), KoWatchOffHandler::OnFolder(), KoWatchOnHandler::OnFolder(), KoEditorsHandler::OnFolder(), KoWatchersHandler::OnFolder(), KoReleaseHandler::OnFolder(), KoUneditHandler::OnFolder(), KoForceEditHandler::OnFolder(), KoReservedEditHandler::OnFolder(), KoEditHandler::OnFolder(), KoBranchTagHandler::OnFolder(), KoDeleteTagHandler::OnFolder(), KoCreateTagHandler::OnFolder(), CWinCvsBrowser::ProcessSelectionCommand(), CBrowseFileView::ProcessSelectionCommand(), UCvsFolders::ProcessSelectionCommand(), and UCvsFiles::ProcessSelectionCommand().

00088 {
00089     m_selType = kSelDir;
00090     if( fullpath )
00091     {
00092         m_pmf = new MultiFiles;
00093         if( m_pmf )
00094         {
00095             m_autoDelete = true;
00096             m_pmf->newdir(fullpath);
00097         }
00098     }
00099 }

Member Data Documentation

bool KiSelectionHandler::m_autoDelete [private]

Indicates whether to delete the command selection allocated memory

Definition at line 60 of file BrowseViewHandlers.h.

Referenced by GetSelection(), OnFolder(), and ~KiSelectionHandler().

bool KiSelectionHandler::m_needSelection [protected]

Indicates whether the selection is needed for command

Definition at line 63 of file BrowseViewHandlers.h.

Referenced by GetNeedSelection(), and GetSelection().

bool KiSelectionHandler::m_needViewReset [protected]

Indicates whether reseting the view is needed for command

Definition at line 64 of file BrowseViewHandlers.h.

Referenced by GetNeedViewReset().

MultiFiles* KiSelectionHandler::m_pmf [private]

Command selection (files or directory)

Definition at line 57 of file BrowseViewHandlers.h.

Referenced by GetSelection(), OnFiles(), OnFolder(), and ~KiSelectionHandler().

kSelType KiSelectionHandler::m_selType [private]

Command selection type

Definition at line 58 of file BrowseViewHandlers.h.

Referenced by GetSelType(), OnFiles(), and OnFolder().

UStr KiSelectionHandler::m_strCommand [private]

Command name, used when browsing for selection

Definition at line 55 of file BrowseViewHandlers.h.

Referenced by GetSelection().

The documentation for this class was generated from the following files:
  • common/BrowseViewHandlers.h
  • common/BrowseViewHandlers.cpp
Generated on Fri Jan 31 12:16:55 2003 for WinCvs Source by doxygen 1.3-rc2


KoAddBinaryHandler Class Reference

Handles binary addition of the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddBinaryHandler:

[legend]
Collaboration diagram for KoAddBinaryHandler:

[legend]
List of all members.

Public Methods

KoAddBinaryHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)
virtual bool | NeedsNormalize ()

Detailed Description

Handles binary addition of the selected items.

Definition at line 567 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoAddBinaryHandler::KoAddBinaryHandler ( ) [inline]

Definition at line 570 of file BrowseViewHandlers.h.

References _i18n.

00571         : KiSelectionHandler(_i18n("Add Binary"))
00572     {}

Member Function Documentation

virtual bool KoAddBinaryHandler::NeedsNormalize ( ) [inline, virtual]

Reimplemented from KiSelectionHandler.

Definition at line 586 of file BrowseViewHandlers.h.

00587     {
00588         return true;
00589     }

virtual void KoAddBinaryHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 580 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFiles().

00581     {
00582         KiSelectionHandler::OnFiles(pmf);
00583         CvsCmdAdd(*this, kAddBinary);
00584     }

virtual void KoAddBinaryHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 574 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFolder().

00575     {
00576         KiSelectionHandler::OnFolder(fullpath);
00577         CvsCmdAdd(*this);
00578     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:55 2003 for WinCvs Source by doxygen 1.3-rc2


KoAddHandler Class Reference

Handles addition of the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddHandler:

[legend]
Collaboration diagram for KoAddHandler:

[legend]
List of all members.

Public Methods

KoAddHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)
virtual bool | NeedsNormalize ()

Detailed Description

Handles addition of the selected items.

Definition at line 541 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoAddHandler::KoAddHandler ( ) [inline]

Definition at line 544 of file BrowseViewHandlers.h.

References _i18n.

00545         : KiSelectionHandler(_i18n("Add"))
00546     {}

Member Function Documentation

virtual bool KoAddHandler::NeedsNormalize ( ) [inline, virtual]

Reimplemented from KiSelectionHandler.

Definition at line 560 of file BrowseViewHandlers.h.

00561     {
00562         return true;
00563     }

virtual void KoAddHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 554 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFiles().

00555     {
00556         KiSelectionHandler::OnFiles(pmf);
00557         CvsCmdAdd(*this);
00558     }

virtual void KoAddHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 548 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFolder().

00549     {
00550         KiSelectionHandler::OnFolder(fullpath);
00551         CvsCmdAdd(*this);
00552     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:56 2003 for WinCvs Source by doxygen 1.3-rc2


KoAddUnicodeHandler Class Reference

Handles unicode addition of the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAddUnicodeHandler:

[legend]
Collaboration diagram for KoAddUnicodeHandler:

[legend]
List of all members.

Public Methods

KoAddUnicodeHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)
virtual bool | NeedsNormalize ()

Detailed Description

Handles unicode addition of the selected items.

Definition at line 593 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoAddUnicodeHandler::KoAddUnicodeHandler ( ) [inline]

Definition at line 596 of file BrowseViewHandlers.h.

References _i18n.

00597         : KiSelectionHandler(_i18n("Add Unicode"))
00598     {}

Member Function Documentation

virtual bool KoAddUnicodeHandler::NeedsNormalize ( ) [inline, virtual]

Reimplemented from KiSelectionHandler.

Definition at line 612 of file BrowseViewHandlers.h.

00613     {
00614         return true;
00615     }

virtual void KoAddUnicodeHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 606 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFiles().

00607     {
00608         KiSelectionHandler::OnFiles(pmf);
00609         CvsCmdAdd(*this, kAddUnicode);
00610     }

virtual void KoAddUnicodeHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 600 of file BrowseViewHandlers.h.

References CvsCmdAdd(), and KiSelectionHandler::OnFolder().

00601     {
00602         KiSelectionHandler::OnFolder(fullpath);
00603         CvsCmdAdd(*this);
00604     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:57 2003 for WinCvs Source by doxygen 1.3-rc2


KoAnnotateHandler Class Reference

Handles annotate on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoAnnotateHandler:

[legend]
Collaboration diagram for KoAnnotateHandler:

[legend]
List of all members.

Public Methods

KoAnnotateHandler ()
virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles annotate on the selected items.

Definition at line 682 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoAnnotateHandler::KoAnnotateHandler ( ) [inline]

Definition at line 685 of file BrowseViewHandlers.h.

References _i18n.

00686         : KiSelectionHandler(_i18n("Annotate"))
00687     {}

Member Function Documentation

virtual void KoAnnotateHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 694 of file BrowseViewHandlers.h.

References CvsCmdAnnotate(), and KiSelectionHandler::OnFiles().

00695     {
00696         KiSelectionHandler::OnFiles(pmf);
00697         CvsCmdAnnotate(*this);
00698     }

virtual void KoAnnotateHandler::OnFolder ( const char * ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 689 of file BrowseViewHandlers.h.

00690     {
00691         /*we avoid processing directory*/
00692     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:57 2003 for WinCvs Source by doxygen 1.3-rc2


KoBranchTagHandler Class Reference

Handles branch request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoBranchTagHandler:

[legend]
Collaboration diagram for KoBranchTagHandler:

[legend]
List of all members.

Public Methods

KoBranchTagHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles branch request on the selected items.

Definition at line 169 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoBranchTagHandler::KoBranchTagHandler ( ) [inline]

Definition at line 172 of file BrowseViewHandlers.h.

References _i18n.

00173         : KiSelectionHandler(_i18n("Branch"))
00174     {}

Member Function Documentation

virtual void KoBranchTagHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 182 of file BrowseViewHandlers.h.

References CvsCmdTagBranch(), and KiSelectionHandler::OnFiles().

00183     {
00184         KiSelectionHandler::OnFiles(pmf);
00185         CvsCmdTagBranch(*this);
00186     }

virtual void KoBranchTagHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 176 of file BrowseViewHandlers.h.

References CvsCmdTagBranch(), and KiSelectionHandler::OnFolder().

00177     {
00178         KiSelectionHandler::OnFolder(fullpath);
00179         CvsCmdTagBranch(*this);
00180     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:58 2003 for WinCvs Source by doxygen 1.3-rc2


KoCancelChangesHandler Class Reference

Handles cancel changes on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCancelChangesHandler:

[legend]
Collaboration diagram for KoCancelChangesHandler:

[legend]
List of all members.

Public Methods

KoCancelChangesHandler ()
virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles cancel changes on the selected items.

Definition at line 702 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoCancelChangesHandler::KoCancelChangesHandler ( ) [inline]

Definition at line 705 of file BrowseViewHandlers.h.

References _i18n.

00706         : KiSelectionHandler(_i18n("Cancel Changes"))
00707     {}

Member Function Documentation

virtual void KoCancelChangesHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 714 of file BrowseViewHandlers.h.

References CvsCmdCancelChanges(), and KiSelectionHandler::OnFiles().

00715     {
00716         KiSelectionHandler::OnFiles(pmf);
00717         CvsCmdCancelChanges(*this);
00718     }

virtual void KoCancelChangesHandler::OnFolder ( const char * ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 709 of file BrowseViewHandlers.h.

00710     {
00711         /*we avoid processing directory*/
00712     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:59 2003 for WinCvs Source by doxygen 1.3-rc2


KoCheckoutHandler Class Reference

Handles Checkout. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCheckoutHandler:

[legend]
Collaboration diagram for KoCheckoutHandler:

[legend]
List of all members.

Public Methods

KoCheckoutHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Checkout.

Definition at line 764 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoCheckoutHandler::KoCheckoutHandler ( ) [inline]

Definition at line 767 of file BrowseViewHandlers.h.

References _i18n.

00768         : KiSelectionHandler(_i18n("Checkout"))
00769     {}

Member Function Documentation

virtual void KoCheckoutHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 777 of file BrowseViewHandlers.h.

References CvsCmdCheckoutModule(), and KiSelectionHandler::OnFiles().

00778     {
00779         KiSelectionHandler::OnFiles(pmf);
00780         CvsCmdCheckoutModule(*this);
00781     }

virtual void KoCheckoutHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 771 of file BrowseViewHandlers.h.

References CvsCmdCheckoutModule(), and KiSelectionHandler::OnFolder().

Referenced by CExploreBar::OnViewCheckout(), and CBrowseFileView::OnViewCheckout().

00772     {
00773         KiSelectionHandler::OnFolder(fullpath);
00774         CvsCmdCheckoutModule(*this);
00775     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:16:59 2003 for WinCvs Source by doxygen 1.3-rc2


KoColumnContext Class Reference

Context in which a column is accessed. More...

#include <BrowseViewColumn.h>

Collaboration diagram for KoColumnContext:

[legend]
List of all members.

Public Methods

KoColumnContext (const char *path)

Public Attributes

UStr m_path

Detailed Description

Context in which a column is accessed.

Definition at line 25 of file BrowseViewColumn.h.

Constructor & Destructor Documentation

KoColumnContext::KoColumnContext ( const char * path ) [inline]

Definition at line 32 of file BrowseViewColumn.h.

00033     : m_path(path)
00034     {}

Member Data Documentation

UStr KoColumnContext::m_path

Current 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 Fri Jan 31 12:17:00 2003 for WinCvs Source by doxygen 1.3-rc2


KoCommandLineHandler Class Reference

Handles Command Line. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCommandLineHandler:

[legend]
Collaboration diagram for KoCommandLineHandler:

[legend]
List of all members.

Public Methods

KoCommandLineHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Command Line.

Definition at line 722 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoCommandLineHandler::KoCommandLineHandler ( ) [inline]

Definition at line 725 of file BrowseViewHandlers.h.

References _i18n.

00726         : KiSelectionHandler(_i18n("Command Line"), false)
00727     {}

Member Function Documentation

virtual void KoCommandLineHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 735 of file BrowseViewHandlers.h.

References CvsCmdCommandLine(), and KiSelectionHandler::OnFiles().

00736     {
00737         KiSelectionHandler::OnFiles(pmf);
00738         CvsCmdCommandLine(*this);
00739     }

virtual void KoCommandLineHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 729 of file BrowseViewHandlers.h.

References CvsCmdCommandLine(), and KiSelectionHandler::OnFolder().

Referenced by CBrowseFileView::OnAppCmdline().

00730     {
00731         KiSelectionHandler::OnFolder(fullpath);
00732         CvsCmdCommandLine(*this);
00733     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:00 2003 for WinCvs Source by doxygen 1.3-rc2


KoCommitHandler Class Reference

Handles commits of the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCommitHandler:

[legend]
Collaboration diagram for KoCommitHandler:

[legend]
List of all members.

Public Methods

KoCommitHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles commits of the selected items.

Definition at line 619 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoCommitHandler::KoCommitHandler ( ) [inline]

Definition at line 622 of file BrowseViewHandlers.h.

References _i18n.

00623         : KiSelectionHandler(_i18n("Commit"))
00624     {}

Member Function Documentation

virtual void KoCommitHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 632 of file BrowseViewHandlers.h.

References CvsCmdCommit(), and KiSelectionHandler::OnFiles().

00633     {
00634         KiSelectionHandler::OnFiles(pmf);
00635         CvsCmdCommit(*this);
00636     }

virtual void KoCommitHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 626 of file BrowseViewHandlers.h.

References CvsCmdCommit(), and KiSelectionHandler::OnFolder().

00627     {
00628         KiSelectionHandler::OnFolder(fullpath);
00629         CvsCmdCommit(*this);
00630     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:01 2003 for WinCvs Source by doxygen 1.3-rc2


KoConflictColumn Class Reference

Conflict column. More...

Inheritance diagram for KoConflictColumn:

[legend]
Collaboration diagram for KoConflictColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
tells if the column shall be sorted ascending initially

Detailed Description

Conflict column.

Definition at line 464 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoConflictColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 493 of file BrowseViewColumn.cpp.

References EntnodeData::GetConflict().

00494     {
00495         const char* s1 = d1->GetConflict();
00496         const char* s2 = d2->GetConflict();
00497         int res;
00498         if( s1 != 0L && s2 != 0L )
00499             res = strcmp(s1, s2);
00500         else
00501             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00502
00503         return res;
00504     }

virtual void KoConflictColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 470 of file BrowseViewColumn.cpp.

00471     {
00472         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00473         lvc->pszText = _T("Conflict");
00474         lvc->cx = 150;
00475         lvc->fmt = LVCFMT_LEFT;
00476     }

virtual void KoConflictColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 487 of file BrowseViewColumn.cpp.

References EntnodeData::GetConflict(), and SafeCopy().

00488     {
00489         SafeCopy(buffer, data->GetConflict(), bufferSize);
00490     }

virtual bool KoConflictColumn::IsDefaultAscending ( ) const [inline, virtual]

tells if the column shall be sorted ascending initially

Implements KiColumn.

Definition at line 507 of file BrowseViewColumn.cpp.

00508     {
00509         return true;
00510     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:02 2003 for WinCvs Source by doxygen 1.3-rc2


KoCreateTagHandler Class Reference

Handles create tag request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoCreateTagHandler:

[legend]
Collaboration diagram for KoCreateTagHandler:

[legend]
List of all members.

Public Methods

KoCreateTagHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles create tag request on the selected items.

Definition at line 127 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoCreateTagHandler::KoCreateTagHandler ( ) [inline]

Definition at line 130 of file BrowseViewHandlers.h.

References _i18n.

00131         : KiSelectionHandler(_i18n("Create Tag"))
00132     {}

Member Function Documentation

virtual void KoCreateTagHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 140 of file BrowseViewHandlers.h.

References CvsCmdTagCreate(), and KiSelectionHandler::OnFiles().

00141     {
00142         KiSelectionHandler::OnFiles(pmf);
00143         CvsCmdTagCreate(*this);
00144     }

virtual void KoCreateTagHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 134 of file BrowseViewHandlers.h.

References CvsCmdTagCreate(), and KiSelectionHandler::OnFolder().

00135     {
00136         KiSelectionHandler::OnFolder(fullpath);
00137         CvsCmdTagCreate(*this);
00138     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:02 2003 for WinCvs Source by doxygen 1.3-rc2


KoDateColumn Class Reference

Date column. More...

Inheritance diagram for KoDateColumn:

[legend]
Collaboration diagram for KoDateColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Date column.

Definition at line 409 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoDateColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 438 of file BrowseViewColumn.cpp.

References GetDateTime(), and EntnodeFile::kTS.

00439     {
00440         const char* s1 = (*d1)[EntnodeFile::kTS];
00441         const char* s2 = (*d2)[EntnodeFile::kTS];
00442         int res = 0;
00443
00444         if( s1 != 0L && s2 != 0L )
00445         {
00446             time_t t1 = GetDateTime(s1);
00447             time_t t2 = GetDateTime(s2);
00448             res = t1 < t2 ? -1 : (t1 > t2 ? 1 : 0);
00449         }
00450         else
00451             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00452
00453         return res;
00454     }

virtual void KoDateColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 415 of file BrowseViewColumn.cpp.

References IsLargeFonts().

00416     {
00417         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00418         lvc->pszText = _T("Timestamp");
00419         lvc->cx = (IsLargeFonts()) ? 170 : 150;
00420         lvc->fmt = LVCFMT_LEFT;
00421     }

virtual void KoDateColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 432 of file BrowseViewColumn.cpp.

References SafeCopy().

00433     {
00434         SafeCopy(buffer, (*data)[EntnodeFile::kTS], bufferSize);
00435     }

virtual bool KoDateColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 457 of file BrowseViewColumn.cpp.

00458     {
00459         return true;
00460     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:03 2003 for WinCvs Source by doxygen 1.3-rc2


KoDeleteTagHandler Class Reference

Handles delete tag request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoDeleteTagHandler:

[legend]
Collaboration diagram for KoDeleteTagHandler:

[legend]
List of all members.

Public Methods

KoDeleteTagHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles delete tag request on the selected items.

Definition at line 148 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoDeleteTagHandler::KoDeleteTagHandler ( ) [inline]

Definition at line 151 of file BrowseViewHandlers.h.

References _i18n.

00152         : KiSelectionHandler(_i18n("Delete Tag"))
00153     {}

Member Function Documentation

virtual void KoDeleteTagHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 161 of file BrowseViewHandlers.h.

References CvsCmdTagDelete(), and KiSelectionHandler::OnFiles().

00162     {
00163         KiSelectionHandler::OnFiles(pmf);
00164         CvsCmdTagDelete(*this);
00165     }

virtual void KoDeleteTagHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 155 of file BrowseViewHandlers.h.

References CvsCmdTagDelete(), and KiSelectionHandler::OnFolder().

00156     {
00157         KiSelectionHandler::OnFolder(fullpath);
00158         CvsCmdTagDelete(*this);
00159     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:03 2003 for WinCvs Source by doxygen 1.3-rc2


KoDiffHandler Class Reference

Handles diffing on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoDiffHandler:

[legend]
Collaboration diagram for KoDiffHandler:

[legend]
List of all members.

Public Methods

KoDiffHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles diffing on the selected items.

Definition at line 376 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoDiffHandler::KoDiffHandler ( ) [inline]

Definition at line 379 of file BrowseViewHandlers.h.

References _i18n.

00380         : KiSelectionHandler(_i18n("Diff"))
00381     {}

Member Function Documentation

virtual void KoDiffHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 389 of file BrowseViewHandlers.h.

References CvsCmdDiff(), and KiSelectionHandler::OnFiles().

Referenced by CompatGetCommit(), and CCommit_MAIN::OnDiff().

00390     {
00391         KiSelectionHandler::OnFiles(pmf);
00392         CvsCmdDiff(*this, kDiffFile);
00393     }

virtual void KoDiffHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 383 of file BrowseViewHandlers.h.

References CvsCmdDiff(), and KiSelectionHandler::OnFolder().

00384     {
00385         KiSelectionHandler::OnFolder(fullpath);
00386         CvsCmdDiff(*this, kDiffFolder);
00387     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:04 2003 for WinCvs Source by doxygen 1.3-rc2


KoEditHandler Class Reference

Handles edit start request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoEditHandler:

[legend]
Collaboration diagram for KoEditHandler:

[legend]
List of all members.

Public Methods

KoEditHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles edit start request on the selected items.

Definition at line 190 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoEditHandler::KoEditHandler ( ) [inline]

Definition at line 193 of file BrowseViewHandlers.h.

References _i18n.

00194         : KiSelectionHandler(_i18n("Edit"))
00195     {}

Member Function Documentation

virtual void KoEditHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 203 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFiles().

00204     {
00205         KiSelectionHandler::OnFiles(pmf);
00206         CvsCmdEdit(*this);
00207     }

virtual void KoEditHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 197 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFolder().

00198     {
00199         KiSelectionHandler::OnFolder(fullpath);
00200         CvsCmdEdit(*this);
00201     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:05 2003 for WinCvs Source by doxygen 1.3-rc2


KoEditorsHandler Class Reference

Handles editors on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoEditorsHandler:

[legend]
Collaboration diagram for KoEditorsHandler:

[legend]
List of all members.

Public Methods

KoEditorsHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles editors on the selected items.

Definition at line 313 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoEditorsHandler::KoEditorsHandler ( ) [inline]

Definition at line 316 of file BrowseViewHandlers.h.

References _i18n.

00317         : KiSelectionHandler(_i18n("Editors"))
00318     {}

Member Function Documentation

virtual void KoEditorsHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 326 of file BrowseViewHandlers.h.

References CvsCmdEditors(), and KiSelectionHandler::OnFiles().

00327     {
00328         KiSelectionHandler::OnFiles(pmf);
00329         CvsCmdEditors(*this);
00330     }

virtual void KoEditorsHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 320 of file BrowseViewHandlers.h.

References CvsCmdEditors(), and KiSelectionHandler::OnFolder().

00321     {
00322         KiSelectionHandler::OnFolder(fullpath);
00323         CvsCmdEditors(*this);
00324     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:05 2003 for WinCvs Source by doxygen 1.3-rc2


KoFileRemoveHandler Class Reference

Handles file remove requests. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoFileRemoveHandler:

[legend]
Collaboration diagram for KoFileRemoveHandler:

[legend]
List of all members.

Public Methods

KoFileRemoveHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles file remove requests.

Definition at line 482 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoFileRemoveHandler::KoFileRemoveHandler ( ) [inline]

Definition at line 485 of file BrowseViewHandlers.h.

References _i18n.

00486         : KiSelectionHandler(_i18n("Remove"))
00487     {}

Member Function Documentation

virtual void KoFileRemoveHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 492 of file BrowseViewHandlers.h.

References CvsCmdRemove(), and KiSelectionHandler::OnFiles().

00493     {
00494         KiSelectionHandler::OnFiles(pmf);
00495         CvsCmdRemove(*this);
00496     }

virtual void KoFileRemoveHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 489 of file BrowseViewHandlers.h.

00490     { /* folder cannot be removed */ }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:06 2003 for WinCvs Source by doxygen 1.3-rc2


KoFilterModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoFilterModel:

[legend]
Collaboration diagram for KoFilterModel:

[legend]
List of all members.

Public Methods

KoFilterModel ()
virtual | ~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_isMissing
bool | m_isHideUnknown

Constructor & Destructor Documentation

KoFilterModel::KoFilterModel ( )

Definition at line 37 of file BrowseViewModel.cpp.

References persistentAdded, persistentChanged, persistentConflicts, persistentHideUnknown, persistentMissing, persistentRemoved, and persistentUnknown.

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 ( ) [virtual]

Definition at line 47 of file BrowseViewModel.cpp.

References m_isAdded, m_isChanged, m_isConflicts, m_isHideUnknown, m_isMissing, m_isRemoved, m_isUnknown, persistentAdded, persistentChanged, persistentConflicts, persistentHideUnknown, persistentMissing, persistentRemoved, and persistentUnknown.

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(), UCvsFrame::OnFilterMaskEntered(), UCvsFrame::OnHideUnknown(), CMainFrame::OnViewAdded(), UCvsFrame::OnViewAdded(), CMainFrame::OnViewChanged(), UCvsFrame::OnViewChanged(), CMainFrame::OnViewConflict(), UCvsFrame::OnViewConflict(), CMainFrame::OnViewHideunknown(), CMainFrame::OnViewMissing(), UCvsFrame::OnViewMissing(), CMainFrame::OnViewModified(), UCvsFrame::OnViewModified(), CMainFrame::OnViewRemoved(), UCvsFrame::OnViewRemoved(), CMainFrame::OnViewUnknown(), and UCvsFrame::OnViewUnknown().

00165 {
00166     return &m_manager;
00167 }

bool KoFilterModel::IsAdded ( ) const [inline]

Definition at line 262 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewAdded(), and CMainFrame::OnUpdateViewAdded().

00263     {
00264         return m_isAdded;
00265     }

bool KoFilterModel::IsChanged ( ) const [inline]

Definition at line 252 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewChanged(), and CMainFrame::OnUpdateViewChanged().

00253     {
00254         return m_isChanged;
00255     }

bool KoFilterModel::IsConflict ( ) const [inline]

Definition at line 211 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewConflict(), and CMainFrame::OnUpdateViewConflict().

00212     {
00213         return m_isConflicts;
00214     }

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(), UCvsFrame::OnCmdUIHideUnknown(), 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 229 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIHideUnknown(), and CMainFrame::OnUpdateViewHideunknown().

00230     {
00231         return m_isHideUnknown;
00232     }

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 242 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewMissing(), and CMainFrame::OnUpdateViewMissing().

00243     {
00244         return m_isMissing;
00245     }

bool KoFilterModel::IsModified ( ) const

Definition at line 158 of file BrowseViewModel.cpp.

References m_isAdded, m_isChanged, m_isConflicts, and m_isRemoved.

Referenced by UCvsFrame::OnCmdUIViewModified(), 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 272 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewRemoved(), and CMainFrame::OnUpdateViewRemoved().

00273     {
00274         return m_isRemoved;
00275     }

bool KoFilterModel::IsUnknown ( ) const [inline]

Definition at line 220 of file BrowseViewModel.h.

Referenced by UCvsFrame::OnCmdUIViewUnknown(), and CMainFrame::OnUpdateViewUnknown().

00221     {
00222         return m_isUnknown;
00223     }

bool KoFilterModel::SetMask ( const char * mask )

Definition at line 169 of file BrowseViewModel.cpp.

References UStr::empty(), m_mask, and m_match.

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 257 of file BrowseViewModel.h.

Referenced by CMainFrame::OnViewAdded(), and UCvsFrame::OnViewAdded().

00258     {
00259         m_isAdded = !m_isAdded;
00260     }

void KoFilterModel::ToggleChanged ( ) [inline]

Definition at line 247 of file BrowseViewModel.h.

Referenced by CMainFrame::OnViewChanged(), and UCvsFrame::OnViewChanged().

00248     {
00249         m_isChanged = !m_isChanged;
00250     }

void KoFilterModel::ToggleConflict ( ) [inline]

Definition at line 205 of file BrowseViewModel.h.

Referenced by CMainFrame::OnViewConflict(), and UCvsFrame::OnViewConflict().

00206     {
00207         m_isConflicts = !m_isConflicts;
00208     }

void KoFilterModel::ToggleHideUnknown ( )

Definition at line 129 of file BrowseViewModel.cpp.

References m_isHideUnknown, and m_isUnknown.

Referenced by UCvsFrame::OnHideUnknown(), and 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 236 of file BrowseViewModel.h.

Referenced by CMainFrame::OnViewMissing(), and UCvsFrame::OnViewMissing().

00237     {
00238         m_isMissing = !m_isMissing;
00239     }

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(), and UCvsFrame::OnViewModified().

00150 {
00151     m_isAdded =
00152     m_isChanged =
00153     m_isRemoved =
00154     m_isConflicts = !IsModified();
00155 }

void KoFilterModel::ToggleRemoved ( ) [inline]

Definition at line 267 of file BrowseViewModel.h.

Referenced by CMainFrame::OnViewRemoved(), and UCvsFrame::OnViewRemoved().

00268     {
00269         m_isRemoved = !m_isRemoved;
00270     }

void KoFilterModel::ToggleUnknown ( )

Definition at line 139 of file BrowseViewModel.cpp.

References m_isHideUnknown, and m_isUnknown.

Referenced by CMainFrame::OnViewUnknown(), and UCvsFrame::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 167 of file BrowseViewModel.h.

Referenced by IsDefaultMode(), IsMatch(), IsModified(), ToggleModified(), and ~KoFilterModel().

bool KoFilterModel::m_isChanged [protected]

Definition at line 166 of file BrowseViewModel.h.

Referenced by IsDefaultMode(), IsMatch(), IsModified(), ToggleModified(), and ~KoFilterModel().

bool KoFilterModel::m_isConflicts [protected]

Definition at line 169 of file BrowseViewModel.h.

Referenced by IsDefaultMode(), IsMatch(), IsModified(), ToggleModified(), and ~KoFilterModel().

bool KoFilterModel::m_isHideUnknown [protected]

Definition at line 173 of file BrowseViewModel.h.

Referenced by IsMatch(), ToggleHideUnknown(), ToggleUnknown(), and ~KoFilterModel().

bool KoFilterModel::m_isMissing [protected]

Definition at line 172 of file BrowseViewModel.h.

Referenced by IsDefaultMode(), IsMatch(), and ~KoFilterModel().

bool KoFilterModel::m_isRemoved [protected]

Definition at line 168 of file BrowseViewModel.h.

Referenced by IsDefaultMode(), IsMatch(), IsModified(), ToggleModified(), and ~KoFilterModel().

bool KoFilterModel::m_isUnknown [protected]

Definition at line 171 of file BrowseViewModel.h.

Referenced by IsMatch(), ToggleHideUnknown(), ToggleUnknown(), and ~KoFilterModel().

NotificationManager KoFilterModel::m_manager [protected]

Definition at line 163 of file BrowseViewModel.h.

Referenced by GetNotificationManager().

UStr KoFilterModel::m_mask [protected]

Definition at line 164 of file BrowseViewModel.h.

Referenced by SetMask().

std::vector<UStr> KoFilterModel::m_match [protected]

Definition at line 165 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 Fri Jan 31 12:17:08 2003 for WinCvs Source by doxygen 1.3-rc2


KoForceEditHandler Class Reference

Handles force edit start request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoForceEditHandler:

[legend]
Collaboration diagram for KoForceEditHandler:

[legend]
List of all members.

Public Methods

KoForceEditHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles force edit start request on the selected items.

Definition at line 232 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoForceEditHandler::KoForceEditHandler ( ) [inline]

Definition at line 235 of file BrowseViewHandlers.h.

References _i18n.

00236         : KiSelectionHandler(_i18n("Force Edit"))
00237     {}

Member Function Documentation

virtual void KoForceEditHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 245 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFiles().

00246     {
00247         KiSelectionHandler::OnFiles(pmf);
00248         CvsCmdEdit(*this, kEditForce);
00249     }

virtual void KoForceEditHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 239 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFolder().

00240     {
00241         KiSelectionHandler::OnFolder(fullpath);
00242         CvsCmdEdit(*this, kEditForce);
00243     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:08 2003 for WinCvs Source by doxygen 1.3-rc2


KoGraphDiffHandler Class Reference

Handles diffing on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoGraphDiffHandler:

[legend]
Collaboration diagram for KoGraphDiffHandler:

[legend]
List of all members.

Public Methods

KoGraphDiffHandler ()
virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles diffing on the selected items.

Definition at line 397 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoGraphDiffHandler::KoGraphDiffHandler ( ) [inline]

Definition at line 400 of file BrowseViewHandlers.h.

References _i18n.

00401         : KiSelectionHandler(_i18n("Diff"))
00402     {}

Member Function Documentation

virtual void KoGraphDiffHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 407 of file BrowseViewHandlers.h.

References CvsCmdDiff(), and KiSelectionHandler::OnFiles().

Referenced by CGraphView::OnViewDiff().

00408     {
00409         KiSelectionHandler::OnFiles(pmf);
00410         CvsCmdDiff(*this, kDiffGraph);
00411     }

virtual void KoGraphDiffHandler::OnFolder ( const char * ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 404 of file BrowseViewHandlers.h.

00405     {   }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:09 2003 for WinCvs Source by doxygen 1.3-rc2


KoGraphHandler Class Reference

Handles graph log queries on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoGraphHandler:

[legend]
Collaboration diagram for KoGraphHandler:

[legend]
List of all members.

Public Methods

KoGraphHandler ()
virtual void | OnFolder (const char *)
virtual void | OnFiles (MultiFiles *pmf)
virtual bool | NeedsNormalize ()

Detailed Description

Handles graph log queries on the selected items.

Definition at line 436 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoGraphHandler::KoGraphHandler ( ) [inline]

Definition at line 439 of file BrowseViewHandlers.h.

References _i18n.

00440         : KiSelectionHandler(_i18n("Graph"))
00441     {}

Member Function Documentation

virtual bool KoGraphHandler::NeedsNormalize ( ) [inline, virtual]

Reimplemented from KiSelectionHandler.

Definition at line 454 of file BrowseViewHandlers.h.

00455     {
00456         return true;
00457     }

virtual void KoGraphHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 448 of file BrowseViewHandlers.h.

References CvsCmdLog(), and KiSelectionHandler::OnFiles().

00449     {
00450         KiSelectionHandler::OnFiles(pmf);
00451         CvsCmdLog(*this, true);
00452     }

virtual void KoGraphHandler::OnFolder ( const char * ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 443 of file BrowseViewHandlers.h.

00444     {
00445         /*we avoid processing directory*/
00446     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:10 2003 for WinCvs Source by doxygen 1.3-rc2


KoIgnoreModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoIgnoreModel:

[legend]
Collaboration diagram for KoIgnoreModel:

[legend]
List of all members.

Public Methods

KoIgnoreModel ()
virtual | ~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.

References persistentIgnore.

00224 : m_isIgnore(persistentIgnore)
00225 {}

KoIgnoreModel::~KoIgnoreModel ( ) [virtual]

Definition at line 227 of file BrowseViewModel.cpp.

References m_isIgnore, and persistentIgnore.

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(), and UCvsFrame::OnViewIgnored().

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 UCvsFolders::OnCmdUIIgnore(), UCvsFiles::OnCmdUIIgnore(), UCvsFrame::OnCmdUIViewIgnored(), and CMainFrame::OnUpdateViewIgnore().

00233 {
00234     return m_isIgnore;
00235 }

void KoIgnoreModel::ToggleIgnore ( )

Definition at line 242 of file BrowseViewModel.cpp.

References m_isIgnore.

Referenced by UCvsFolders::OnCmdIgnore(), UCvsFiles::OnCmdIgnore(), CMainFrame::OnViewIgnore(), and UCvsFrame::OnViewIgnored().

00243 {
00244     m_isIgnore = !m_isIgnore;
00245 };

Member Data Documentation

bool KoIgnoreModel::m_isIgnore [private]

Definition at line 310 of file BrowseViewModel.h.

Referenced by IsShowIgnored(), ToggleIgnore(), and ~KoIgnoreModel().

NotificationManager KoIgnoreModel::m_manager [private]

Definition at line 307 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 Fri Jan 31 12:17:11 2003 for WinCvs Source by doxygen 1.3-rc2


KoImportHandler Class Reference

Handles Import. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoImportHandler:

[legend]
Collaboration diagram for KoImportHandler:

[legend]
List of all members.

Public Methods

KoImportHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Import.

Definition at line 743 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoImportHandler::KoImportHandler ( ) [inline]

Definition at line 746 of file BrowseViewHandlers.h.

References _i18n.

00747         : KiSelectionHandler(_i18n("Import"))
00748     {}

Member Function Documentation

virtual void KoImportHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 756 of file BrowseViewHandlers.h.

References CvsCmdImportModule(), and KiSelectionHandler::OnFiles().

00757     {
00758         KiSelectionHandler::OnFiles(pmf);
00759         CvsCmdImportModule(*this);
00760     }

virtual void KoImportHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 750 of file BrowseViewHandlers.h.

References CvsCmdImportModule(), and KiSelectionHandler::OnFolder().

Referenced by CExploreBar::OnViewImport(), and CBrowseFileView::OnViewImport().

00751     {
00752         KiSelectionHandler::OnFolder(fullpath);
00753         CvsCmdImportModule(*this);
00754     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:11 2003 for WinCvs Source by doxygen 1.3-rc2


KoLockHandler Class Reference

Handles locking on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoLockHandler:

[legend]
Collaboration diagram for KoLockHandler:

[legend]
List of all members.

Public Methods

KoLockHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles locking on the selected items.

Definition at line 500 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoLockHandler::KoLockHandler ( ) [inline]

Definition at line 503 of file BrowseViewHandlers.h.

References _i18n.

00504         : KiSelectionHandler(_i18n("Lock"))
00505     {}

Member Function Documentation

virtual void KoLockHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 513 of file BrowseViewHandlers.h.

References CvsCmdLock(), and KiSelectionHandler::OnFiles().

00514     {
00515         KiSelectionHandler::OnFiles(pmf);
00516         CvsCmdLock(*this);
00517     }

virtual void KoLockHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 507 of file BrowseViewHandlers.h.

References CvsCmdLock(), and KiSelectionHandler::OnFolder().

00508     {
00509         KiSelectionHandler::OnFolder(fullpath);
00510         CvsCmdLock(*this);
00511     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:12 2003 for WinCvs Source by doxygen 1.3-rc2


KoLogHandler Class Reference

Handles log queries on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoLogHandler:

[legend]
Collaboration diagram for KoLogHandler:

[legend]
List of all members.

Public Methods

KoLogHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles log queries on the selected items.

Definition at line 415 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoLogHandler::KoLogHandler ( ) [inline]

Definition at line 418 of file BrowseViewHandlers.h.

References _i18n.

00419         : KiSelectionHandler(_i18n("Log"))
00420     {}

Member Function Documentation

virtual void KoLogHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 428 of file BrowseViewHandlers.h.

References CvsCmdLog(), and KiSelectionHandler::OnFiles().

00429     {
00430         KiSelectionHandler::OnFiles(pmf);
00431         CvsCmdLog(*this);
00432     }

virtual void KoLogHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 422 of file BrowseViewHandlers.h.

References CvsCmdLog(), and KiSelectionHandler::OnFolder().

00423     {
00424         KiSelectionHandler::OnFolder(fullpath);
00425         CvsCmdLog(*this);
00426     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:13 2003 for WinCvs Source by doxygen 1.3-rc2


KoMoveToTrashHandler Class Reference

Handles moving files to trash. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoMoveToTrashHandler:

[legend]
Collaboration diagram for KoMoveToTrashHandler:

[legend]
List of all members.

Public Methods

KoMoveToTrashHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles moving files to trash.

Definition at line 81 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoMoveToTrashHandler::KoMoveToTrashHandler ( ) [inline]

Definition at line 84 of file BrowseViewHandlers.h.

References _i18n.

00085         : KiSelectionHandler(_i18n("Move To Trash"), true, true)
00086     {}

Member Function Documentation

virtual void KoMoveToTrashHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 91 of file BrowseViewHandlers.h.

References CvsCmdMoveToTrash(), and KiSelectionHandler::OnFiles().

00092     {
00093         KiSelectionHandler::OnFiles(pmf);
00094         CvsCmdMoveToTrash(*this);
00095     }

virtual void KoMoveToTrashHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 88 of file BrowseViewHandlers.h.

00089     { /* ignore */ }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:13 2003 for WinCvs Source by doxygen 1.3-rc2


KoNameColumn Class Reference

Name column. More...

Inheritance diagram for KoNameColumn:

[legend]
Collaboration diagram for KoNameColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Name column.

Definition at line 63 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoNameColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 92 of file BrowseViewColumn.cpp.

References EntnodeData::GetName().

00093     {
00094         int res = stricmp(d1->GetName(), d2->GetName());
00095         return res;
00096     }

virtual void KoNameColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 69 of file BrowseViewColumn.cpp.

00070     {
00071         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00072         lvc->pszText = _T("Name");
00073         lvc->cx = 150;
00074         lvc->fmt = LVCFMT_LEFT;
00075     }

virtual void KoNameColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 86 of file BrowseViewColumn.cpp.

References EntnodeData::GetName(), and SafeCopy().

00087     {
00088         SafeCopy(buffer, data->GetName(), bufferSize);
00089     }

virtual bool KoNameColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 99 of file BrowseViewColumn.cpp.

00100     {
00101         return false;
00102     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:14 2003 for WinCvs Source by doxygen 1.3-rc2


KoOptionColumn Class Reference

Option column. More...

Inheritance diagram for KoOptionColumn:

[legend]
Collaboration diagram for KoOptionColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Option column.

Definition at line 265 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoOptionColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 294 of file BrowseViewColumn.cpp.

References EntnodeFile::kOption.

00295     {
00296         const char* s1 = (*d1)[EntnodeFile::kOption];
00297         const char* s2 = (*d2)[EntnodeFile::kOption];
00298         int res;
00299         if( s1 != 0L && s2 != 0L )
00300             res = strcmp(s1, s2);
00301         else
00302             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00303
00304         return res;
00305     }

virtual void KoOptionColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 271 of file BrowseViewColumn.cpp.

00272     {
00273         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00274         lvc->pszText = _T("Option");
00275         lvc->cx = 50;
00276         lvc->fmt = LVCFMT_LEFT;
00277     }

virtual void KoOptionColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 288 of file BrowseViewColumn.cpp.

References SafeCopy().

00289     {
00290         SafeCopy(buffer, (*data)[EntnodeFile::kOption], bufferSize);
00291     }

virtual bool KoOptionColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 308 of file BrowseViewColumn.cpp.

00309     {
00310         return true;
00311     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:15 2003 for WinCvs Source by doxygen 1.3-rc2


KoPathColumn Class Reference

Path column. More...

Inheritance diagram for KoPathColumn:

[legend]
Collaboration diagram for KoPathColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *context, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *context, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Path column.

Definition at line 106 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoPathColumn::Compare | ( | KoColumnContext * | context,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 160 of file BrowseViewColumn.cpp.

References GetText().

00161     {
00162         char text1[256];
00163         GetText(context, d1, text1, 256);
00164
00165         char text2[256];
00166         GetText(context, d2, text2, 256);
00167
00168         return stricmp(text1, text2);
00169     }

virtual void KoPathColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 112 of file BrowseViewColumn.cpp.

00113     {
00114         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00115         lvc->pszText = _T("Path");
00116         lvc->cx = 150;
00117         lvc->fmt = LVCFMT_LEFT;
00118     }

virtual void KoPathColumn::GetText | ( | KoColumnContext * | context,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 129 of file BrowseViewColumn.cpp.

References EntnodeData::GetFullPathName(), EntnodeData::GetName(), UStr::length(), KoColumnContext::m_path, and SafeCopy().

Referenced by Compare().

00130     {
00131         UStr buf;
00132         const char* fullpath = data->GetFullPathName(buf);
00133         int len = context->m_path.length();
00134         fullpath += len;
00135
00136         if( *fullpath == '\\' )
00137         {
00138             fullpath++;
00139         }
00140
00141         SafeCopy(buffer, fullpath, bufferSize);
00142
00143         const char* name = data->GetName();
00144         if( name )
00145         {
00146             int lenName = strlen(name) + 1;
00147             int lenPath = strlen(buffer);
00148             if( lenPath <= lenName )
00149             {
00150                 strncpy(buffer, ".", bufferSize);
00151             }
00152             else
00153             {
00154                 buffer[lenPath - lenName] = 0;
00155             }
00156         }
00157     }

virtual bool KoPathColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 172 of file BrowseViewColumn.cpp.

00173     {
00174         return false;
00175     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:15 2003 for WinCvs Source by doxygen 1.3-rc2


KoQueryUpdateHandler Class Reference

Handles query updates on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoQueryUpdateHandler:

[legend]
Collaboration diagram for KoQueryUpdateHandler:

[legend]
List of all members.

Public Methods

KoQueryUpdateHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles query updates on the selected items.

Definition at line 661 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoQueryUpdateHandler::KoQueryUpdateHandler ( ) [inline]

Definition at line 664 of file BrowseViewHandlers.h.

References _i18n.

00665         : KiSelectionHandler(_i18n("Query Update"))
00666     {}

Member Function Documentation

virtual void KoQueryUpdateHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 674 of file BrowseViewHandlers.h.

References CvsCmdUpdate(), and KiSelectionHandler::OnFiles().

00675     {
00676         KiSelectionHandler::OnFiles(pmf);
00677         CvsCmdUpdate(*this, true);
00678     }

virtual void KoQueryUpdateHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 668 of file BrowseViewHandlers.h.

References CvsCmdUpdate(), and KiSelectionHandler::OnFolder().

00669     {
00670         KiSelectionHandler::OnFolder(fullpath);
00671         CvsCmdUpdate(*this, true);
00672     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:16 2003 for WinCvs Source by doxygen 1.3-rc2


KoRecursionModel Class Reference

#include <BrowseViewModel.h>

Inheritance diagram for KoRecursionModel:

[legend]
Collaboration diagram for KoRecursionModel:

[legend]
List of all members.

Public Methods

KoRecursionModel ()
virtual | ~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.

References persistentRecursive.

00196 : m_isRecursive(persistentRecursive)
00197 {}

KoRecursionModel::~KoRecursionModel ( ) [virtual]

Definition at line 199 of file BrowseViewModel.cpp.

References m_isRecursive, and persistentRecursive.

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 UCvsFrame::OnCmdUIViewRecursive(), UCvsFolders::OnCmdUIViewRecursive(), UCvsFiles::OnCmdUIViewRecursive(), and 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(), UCvsFolders::OnViewRecursive(), and UCvsFiles::OnViewRecursive().

00215 {
00216     m_isRecursive = !m_isRecursive;
00217 };

Member Data Documentation

bool KoRecursionModel::m_isRecursive [private]

Definition at line 284 of file BrowseViewModel.h.

Referenced by IsShowRecursive(), ToggleRecursion(), and ~KoRecursionModel().

NotificationManager KoRecursionModel::m_manager [private]

Definition at line 281 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 Fri Jan 31 12:17:17 2003 for WinCvs Source by doxygen 1.3-rc2


KoRecursiveModel Class Reference

Recursive columnar model. More...

Inheritance diagram for KoRecursiveModel:

[legend]
Collaboration diagram for KoRecursiveModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const
Gets column descriptor by its index.

virtual int | GetType (int pos) const
Gets column type by its index.

virtual int | GetCount () const
Returns count of the columns.

Detailed Description

Recursive columnar model.

Definition at line 554 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual const KiColumn* KoRecursiveModel::GetAt ( int pos ) const [inline, virtual]

Gets column descriptor by its index.

Implements KiColumnModel.

Definition at line 558 of file BrowseViewColumn.cpp.

References columnsRecursive.

00559     {
00560         return columnsRecursive[pos];
00561     }

virtual int KoRecursiveModel::GetCount ( ) const [inline, virtual]

Returns count of the columns.

Implements KiColumnModel.

Definition at line 568 of file BrowseViewColumn.cpp.

References _countof.

00569     {
00570         return _countof(columnsRecursive);
00571     }

virtual int KoRecursiveModel::GetType ( int pos ) const [inline, virtual]

Gets column type by its index.

Implements KiColumnModel.

Definition at line 563 of file BrowseViewColumn.cpp.

References typesRecursive.

00564     {
00565         return typesRecursive[pos];
00566     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:17 2003 for WinCvs Source by doxygen 1.3-rc2


KoRegularModel Class Reference

Regular columnar model. More...

Inheritance diagram for KoRegularModel:

[legend]
Collaboration diagram for KoRegularModel:

[legend]
List of all members.

Public Methods

virtual const KiColumn * | GetAt (int pos) const
Gets column descriptor by its index.

virtual int | GetType (int pos) const
Gets column type by its index.

virtual int | GetCount () const
Returns count of the columns.

Detailed Description

Regular columnar model.

Definition at line 533 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual const KiColumn* KoRegularModel::GetAt ( int pos ) const [inline, virtual]

Gets column descriptor by its index.

Implements KiColumnModel.

Definition at line 537 of file BrowseViewColumn.cpp.

References columnsRegular.

00538     {
00539         return columnsRegular[pos];
00540     }

virtual int KoRegularModel::GetCount ( ) const [inline, virtual]

Returns count of the columns.

Implements KiColumnModel.

Definition at line 547 of file BrowseViewColumn.cpp.

References _countof.

00548     {
00549         return _countof(columnsRegular);
00550     }

virtual int KoRegularModel::GetType ( int pos ) const [inline, virtual]

Gets column type by its index.

Implements KiColumnModel.

Definition at line 542 of file BrowseViewColumn.cpp.

References typesRegular.

00543     {
00544         return typesRegular[pos];
00545     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:18 2003 for WinCvs Source by doxygen 1.3-rc2


KoReleaseHandler Class Reference

Handles releasing on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoReleaseHandler:

[legend]
Collaboration diagram for KoReleaseHandler:

[legend]
List of all members.

Public Methods

KoReleaseHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *)

Detailed Description

Handles releasing on the selected items.

Definition at line 274 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoReleaseHandler::KoReleaseHandler ( ) [inline]

Definition at line 277 of file BrowseViewHandlers.h.

References _i18n.

00278         : KiSelectionHandler(_i18n("Release"))
00279     {}

Member Function Documentation

virtual void KoReleaseHandler::OnFiles ( MultiFiles * ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 287 of file BrowseViewHandlers.h.

00288     {   }

virtual void KoReleaseHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 281 of file BrowseViewHandlers.h.

References CvsCmdRelease(), and KiSelectionHandler::OnFolder().

00282     {
00283         KiSelectionHandler::OnFolder(fullpath);
00284         CvsCmdRelease(*this);
00285     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:19 2003 for WinCvs Source by doxygen 1.3-rc2


KoReservedEditHandler Class Reference

Handles reserved edit start request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoReservedEditHandler:

[legend]
Collaboration diagram for KoReservedEditHandler:

[legend]
List of all members.

Public Methods

KoReservedEditHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles reserved edit start request on the selected items.

Definition at line 211 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoReservedEditHandler::KoReservedEditHandler ( ) [inline]

Definition at line 214 of file BrowseViewHandlers.h.

References _i18n.

00215         : KiSelectionHandler(_i18n("Reserved Edit"))
00216     {}

Member Function Documentation

virtual void KoReservedEditHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 224 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFiles().

00225     {
00226         KiSelectionHandler::OnFiles(pmf);
00227         CvsCmdEdit(*this, kEditReserved);
00228     }

virtual void KoReservedEditHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 218 of file BrowseViewHandlers.h.

References CvsCmdEdit(), and KiSelectionHandler::OnFolder().

00219     {
00220         KiSelectionHandler::OnFolder(fullpath);
00221         CvsCmdEdit(*this, kEditReserved);
00222     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:20 2003 for WinCvs Source by doxygen 1.3-rc2


KoRevisionColumn Class Reference

Revision column. More...

Inheritance diagram for KoRevisionColumn:

[legend]
Collaboration diagram for KoRevisionColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Static Public Methods

int | revcmp (const char *rev1, const char *rev2)
Compare two revisions.

Detailed Description

Revision column.

Definition at line 179 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoRevisionColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 208 of file BrowseViewColumn.cpp.

References EntnodeFile::kVN, and revcmp().

00209     {
00210         const char* s1 = (*d1)[EntnodeFile::kVN];
00211         const char* s2 = (*d2)[EntnodeFile::kVN];
00212
00213         int res;
00214         if( s1 != 0L && s2 != 0L )
00215             res = revcmp(s1, s2);
00216         else
00217             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00218
00219         return res;
00220     }

virtual void KoRevisionColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 185 of file BrowseViewColumn.cpp.

00186     {
00187         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00188         lvc->pszText = _T("Rev.");
00189         lvc->cx = 50;
00190         lvc->fmt = LVCFMT_LEFT;
00191     }

virtual void KoRevisionColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 202 of file BrowseViewColumn.cpp.

References SafeCopy().

00203     {
00204         SafeCopy(buffer, (*data)[EntnodeFile::kVN], bufferSize);
00205     }

virtual bool KoRevisionColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 258 of file BrowseViewColumn.cpp.

00259     {
00260         return true;
00261     }

int KoRevisionColumn::revcmp | ( | const char * | rev1,
 |  | const char * | rev2
 | ) | [inline, static]

Compare two revisions.

Definition at line 223 of file BrowseViewColumn.cpp.

References CStr.

Referenced by Compare().

00224     {
00225         if( rev1 == 0L && rev2 == 0L )
00226             return 0;
00227         else if( rev1 == 0L || rev2 == 0L )
00228             return rev1 == 0L ? -1 : 1;
00229
00230         CStr r1(rev1), r2(rev2);
00231         CStr q1, q2;
00232         char* tmp;
00233         int v1, v2;
00234
00235         if( (tmp = strchr(r1, '.')) != 0L )
00236         {
00237             tmp[0] = '\0';
00238             q1 = tmp + 1;
00239         }
00240
00241         v1 = atoi(r1);
00242
00243         if( (tmp = strchr(r2, '.')) != 0L )
00244         {
00245             tmp[0] = '\0';
00246             q2 = tmp + 1;
00247         }
00248
00249         v2 = atoi(r2);
00250
00251         if( v1 == v2 )
00252             return revcmp(q1.empty() ? (const char*)0L : q1.c_str(), q2.empty() ? (const char*)0L : q2.c_str());
00253
00254         return v1 < v2 ? -1 : 1;
00255     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:20 2003 for WinCvs Source by doxygen 1.3-rc2


KoRtagBranchHandler Class Reference

Handles Rtag Branch. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoRtagBranchHandler:

[legend]
Collaboration diagram for KoRtagBranchHandler:

[legend]
List of all members.

Public Methods

KoRtagBranchHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Rtag Branch.

Definition at line 827 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoRtagBranchHandler::KoRtagBranchHandler ( ) [inline]

Definition at line 830 of file BrowseViewHandlers.h.

References _i18n.

00831         : KiSelectionHandler(_i18n("Rtag Branch"), false)
00832     {}

Member Function Documentation

virtual void KoRtagBranchHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 840 of file BrowseViewHandlers.h.

References CvsCmdRtagBranch(), and KiSelectionHandler::OnFiles().

00841     {
00842         KiSelectionHandler::OnFiles(pmf);
00843         CvsCmdRtagBranch(*this);
00844     }

virtual void KoRtagBranchHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 834 of file BrowseViewHandlers.h.

References CvsCmdRtagBranch(), and KiSelectionHandler::OnFolder().

Referenced by CBrowseFileView::OnAppRtagbranch().

00835     {
00836         KiSelectionHandler::OnFolder(fullpath);
00837         CvsCmdRtagBranch(*this);
00838     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:21 2003 for WinCvs Source by doxygen 1.3-rc2


KoRtagCreateHandler Class Reference

Handles Rtag Create. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoRtagCreateHandler:

[legend]
Collaboration diagram for KoRtagCreateHandler:

[legend]
List of all members.

Public Methods

KoRtagCreateHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Rtag Create.

Definition at line 785 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoRtagCreateHandler::KoRtagCreateHandler ( ) [inline]

Definition at line 788 of file BrowseViewHandlers.h.

References _i18n.

00789         : KiSelectionHandler(_i18n("Rtag Create"), false)
00790     {}

Member Function Documentation

virtual void KoRtagCreateHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 798 of file BrowseViewHandlers.h.

References CvsCmdRtagCreate(), and KiSelectionHandler::OnFiles().

00799     {
00800         KiSelectionHandler::OnFiles(pmf);
00801         CvsCmdRtagCreate(*this);
00802     }

virtual void KoRtagCreateHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 792 of file BrowseViewHandlers.h.

References CvsCmdRtagCreate(), and KiSelectionHandler::OnFolder().

Referenced by CBrowseFileView::OnAppRtagcreate().

00793     {
00794         KiSelectionHandler::OnFolder(fullpath);
00795         CvsCmdRtagCreate(*this);
00796     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:22 2003 for WinCvs Source by doxygen 1.3-rc2


KoRtagDeleteHandler Class Reference

Handles Rtag Delete. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoRtagDeleteHandler:

[legend]
Collaboration diagram for KoRtagDeleteHandler:

[legend]
List of all members.

Public Methods

KoRtagDeleteHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles Rtag Delete.

Definition at line 806 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoRtagDeleteHandler::KoRtagDeleteHandler ( ) [inline]

Definition at line 809 of file BrowseViewHandlers.h.

References _i18n.

00810         : KiSelectionHandler(_i18n("Rtag Delete"), false)
00811     {}

Member Function Documentation

virtual void KoRtagDeleteHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 819 of file BrowseViewHandlers.h.

References CvsCmdRtagDelete(), and KiSelectionHandler::OnFiles().

00820     {
00821         KiSelectionHandler::OnFiles(pmf);
00822         CvsCmdRtagDelete(*this);
00823     }

virtual void KoRtagDeleteHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 813 of file BrowseViewHandlers.h.

References CvsCmdRtagDelete(), and KiSelectionHandler::OnFolder().

Referenced by CBrowseFileView::OnAppRtagdelete().

00814     {
00815         KiSelectionHandler::OnFolder(fullpath);
00816         CvsCmdRtagDelete(*this);
00817     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:23 2003 for WinCvs Source by doxygen 1.3-rc2


KoStatusColumn Class Reference

Status column. More...

Inheritance diagram for KoStatusColumn:

[legend]
Collaboration diagram for KoStatusColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Status column.

Definition at line 315 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoStatusColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 344 of file BrowseViewColumn.cpp.

00345     {
00346         int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
00347         return res;
00348     }

virtual void KoStatusColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 321 of file BrowseViewColumn.cpp.

00322     {
00323         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00324         lvc->pszText = _T("Status");
00325         lvc->cx = 100;
00326         lvc->fmt = LVCFMT_LEFT;
00327     }

virtual void KoStatusColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 338 of file BrowseViewColumn.cpp.

References SafeCopy().

00339     {
00340         SafeCopy(buffer, (*data)[EntnodeData::kStatus], bufferSize);
00341     }

virtual bool KoStatusColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 351 of file BrowseViewColumn.cpp.

00352     {
00353         return true;
00354     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:24 2003 for WinCvs Source by doxygen 1.3-rc2


KoStatusHandler Class Reference

Handles status queries on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoStatusHandler:

[legend]
Collaboration diagram for KoStatusHandler:

[legend]
List of all members.

Public Methods

KoStatusHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles status queries on the selected items.

Definition at line 461 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoStatusHandler::KoStatusHandler ( ) [inline]

Definition at line 464 of file BrowseViewHandlers.h.

References _i18n.

00465         : KiSelectionHandler(_i18n("Status"))
00466     {}

Member Function Documentation

virtual void KoStatusHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 474 of file BrowseViewHandlers.h.

References CvsCmdStatus(), and KiSelectionHandler::OnFiles().

00475     {
00476         KiSelectionHandler::OnFiles(pmf);
00477         CvsCmdStatus(*this);
00478     }

virtual void KoStatusHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 468 of file BrowseViewHandlers.h.

References CvsCmdStatus(), and KiSelectionHandler::OnFolder().

00469     {
00470         KiSelectionHandler::OnFolder(fullpath);
00471         CvsCmdStatus(*this);
00472     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:25 2003 for WinCvs Source by doxygen 1.3-rc2


KoTagColumn Class Reference

Tag column. More...

Inheritance diagram for KoTagColumn:

[legend]
Collaboration diagram for KoTagColumn:

[legend]
List of all members.

Public Methods

virtual void | GetSetupData (LV_COLUMN *lvc) const
Retrieve column label.

virtual void | GetText (KoColumnContext *, EntnodeData *data, char *buffer, int bufferSize) const
Retrieve formatted text as pertained to a node.

virtual int | Compare (KoColumnContext *, EntnodeData *d1, EntnodeData *d2) const
Compare two nodes (-1,0,+1).

virtual bool | IsDefaultAscending () const
Tells if the column shall be sorted ascending initially.

Detailed Description

Tag column.

Definition at line 358 of file BrowseViewColumn.cpp.

Member Function Documentation

virtual int KoTagColumn::Compare | ( | KoColumnContext * | ,
 |  | EntnodeData * | d1,
 |  | EntnodeData * | d2
 | ) | const [inline, virtual]

Compare two nodes (-1,0,+1).

Implements KiColumn.

Definition at line 387 of file BrowseViewColumn.cpp.

References EntnodeFile::kTag.

00388     {
00389         const char* s1 = (*d1)[EntnodeFile::kTag];
00390         const char* s2 = (*d2)[EntnodeFile::kTag];
00391         int res;
00392         if( s1 != 0L && s2 != 0L )
00393             res = strcmp(s1, s2);
00394         else
00395             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00396
00397         return res;
00398
00399     }

virtual void KoTagColumn::GetSetupData ( LV_COLUMN * lvc ) const [inline, virtual]

Retrieve column label.

Implements KiColumn.

Definition at line 364 of file BrowseViewColumn.cpp.

00365     {
00366         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00367         lvc->pszText = _T("Tag");
00368         lvc->cx = 150;
00369         lvc->fmt = LVCFMT_LEFT;
00370     }

virtual void KoTagColumn::GetText | ( | KoColumnContext * | ,
 |  | EntnodeData * | data,
 |  | char * | buffer,
 |  | int | bufferSize
 | ) | const [inline, virtual]

Retrieve formatted text as pertained to a node.

Implements KiColumn.

Definition at line 381 of file BrowseViewColumn.cpp.

References SafeCopy().

00382     {
00383         SafeCopy(buffer, (*data)[EntnodeFile::kTag], bufferSize);
00384     }

virtual bool KoTagColumn::IsDefaultAscending ( ) const [inline, virtual]

Tells if the column shall be sorted ascending initially.

Implements KiColumn.

Definition at line 402 of file BrowseViewColumn.cpp.

00403     {
00404         return true;
00405     }

The documentation for this class was generated from the following file:
  • common/BrowseViewColumn.cpp
Generated on Fri Jan 31 12:17:25 2003 for WinCvs Source by doxygen 1.3-rc2


KoTraversalContext Class Reference

Context for traversing. More...

#include <BrowseFileView.h>

Collaboration diagram for KoTraversalContext:

[legend]
List of all members.

Public Methods

KoTraversalContext (UCvsFiles *view)
bool | IsRecursive () const
Get the recursive flag.

bool | IsShowIgnored () const
Get the show ignored flag.

bool | IsMatch (EntnodeData *data) const
KoTraversalContext (CBrowseFileView *view)
bool | IsRecursive () const
bool | IsShowIgnored () const
CBrowseFileView * | GetView () const
Get the file view.

bool | IsMatch (EntnodeData *data) const

Public Attributes

UCvsFiles * m_view

Private Attributes

bool | m_isRecursive
bool | m_isShowIgnored
KiFilterModel * m_filter
KiFilterModel * m_filter
CBrowseFileView * m_view

Detailed Description

Context for traversing.

Definition at line 223 of file UCvsFiles.cpp.

Constructor & Destructor Documentation

KoTraversalContext::KoTraversalContext ( UCvsFiles * view ) [inline]

Definition at line 232 of file UCvsFiles.cpp.

References UCvsApp::gApp, and NULL.

00233         : m_isRecursive(false), m_isShowIgnored(false), m_filter(NULL), m_view(view)
00234     {
00235 #ifdef WIN32
00236         CWincvsApp* app = (CWincvsApp *)AfxGetApp()
00237 #elif qUnix
00238         UCvsApp* app = UCvsApp::gApp;
00239 #elif TARGET_RT_MAC_MACHO
00240         CMacCvsApp* app = CMacCvsApp::gApp;
00241 #endif
00242         if (app)
00243         {
00244             m_filter = app->GetFilterModel();
00245             m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00246             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00247         }
00248     }

KoTraversalContext::KoTraversalContext ( CBrowseFileView * view )

Definition at line 99 of file BrowseFileView.cpp.

References CWincvsApp::GetFilterModel(), CWincvsApp::GetIgnoreModel(), CWincvsApp::GetRecursionModel(), KiIgnoreModel::IsShowIgnored(), KiRecursionModel::IsShowRecursive(), m_filter, m_isRecursive, m_isShowIgnored, and NULL.

00100     : m_view(view), m_filter(NULL), m_isRecursive(false), m_isShowIgnored(false)
00101 {
00102     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00103     {
00104         m_filter = app->GetFilterModel();
00105         m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00106         m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00107     }
00108 }

Member Function Documentation

CBrowseFileView * KoTraversalContext::GetView ( ) const

Get the file view.

Definition at line 123 of file BrowseFileView.cpp.

References m_view.

00124 {
00125     return m_view;
00126 }

bool KoTraversalContext::IsMatch ( EntnodeData * data ) const

bool KoTraversalContext::IsMatch ( EntnodeData * data ) const [inline]

Check the node's match

Parameters:
data Node data to be checked
Returns:
true if node matches, false otherwise

Definition at line 260 of file UCvsFiles.cpp.

References KiFilterModel::IsMatch().

Referenced by TViewFill::ExitDirectory(), and TViewFill::OnFile().

00261     {
00262         return m_filter->IsMatch(data);
00263     }

bool KoTraversalContext::IsRecursive ( ) const

bool KoTraversalContext::IsRecursive ( ) const [inline]

Get the recursive flag.

Definition at line 250 of file UCvsFiles.cpp.

Referenced by TViewFill::IsRecursive(), UCvsFiles::OnCreate(), CBrowseFileView::OnInitialUpdate(), CBrowseFileView::ResetView(), and UCvsFiles::ResetView().

00251     {
00252         return m_isRecursive;
00253     }

bool KoTraversalContext::IsShowIgnored ( ) const

bool KoTraversalContext::IsShowIgnored ( ) const [inline]

Get the show ignored flag.

Definition at line 255 of file UCvsFiles.cpp.

Referenced by TViewFill::IsShowIgnored().

00256     {
00257         return m_isShowIgnored;
00258     }

Member Data Documentation

KiFilterModel* KoTraversalContext::m_filter [private]

Filter model

Definition at line 99 of file BrowseFileView.h.

KiFilterModel* KoTraversalContext::m_filter [private]

Definition at line 227 of file UCvsFiles.cpp.

Referenced by KoTraversalContext().

bool KoTraversalContext::m_isRecursive [private]

Recursive flag

Definition at line 97 of file BrowseFileView.h.

Referenced by KoTraversalContext().

bool KoTraversalContext::m_isShowIgnored [private]

Show ignored flag

Definition at line 98 of file BrowseFileView.h.

Referenced by KoTraversalContext().

CBrowseFileView* KoTraversalContext::m_view [private]

File view

Definition at line 101 of file BrowseFileView.h.

UCvsFiles* KoTraversalContext::m_view

Definition at line 230 of file UCvsFiles.cpp.

Referenced by GetView(), and TViewFill::GetView().

The documentation for this class was generated from the following files:
  • common/UCvsFiles.cpp
  • WinCvs/BrowseFileView.h
  • WinCvs/BrowseFileView.cpp
Generated on Fri Jan 31 12:17:27 2003 for WinCvs Source by doxygen 1.3-rc2


KoUneditHandler Class Reference

Handles edit stop request on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUneditHandler:

[legend]
Collaboration diagram for KoUneditHandler:

[legend]
List of all members.

Public Methods

KoUneditHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles edit stop request on the selected items.

Definition at line 253 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoUneditHandler::KoUneditHandler ( ) [inline]

Definition at line 256 of file BrowseViewHandlers.h.

References _i18n.

00257         : KiSelectionHandler(_i18n("Unedit"))
00258     {}

Member Function Documentation

virtual void KoUneditHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 266 of file BrowseViewHandlers.h.

References CvsCmdUnedit(), and KiSelectionHandler::OnFiles().

00267     {
00268         KiSelectionHandler::OnFiles(pmf);
00269         CvsCmdUnedit(*this);
00270     }

virtual void KoUneditHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 260 of file BrowseViewHandlers.h.

References CvsCmdUnedit(), and KiSelectionHandler::OnFolder().

00261     {
00262         KiSelectionHandler::OnFolder(fullpath);
00263         CvsCmdUnedit(*this);
00264     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:27 2003 for WinCvs Source by doxygen 1.3-rc2


KoUnlockHandler Class Reference

Handles unlocking on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUnlockHandler:

[legend]
Collaboration diagram for KoUnlockHandler:

[legend]
List of all members.

Public Methods

KoUnlockHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles unlocking on the selected items.

Definition at line 521 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoUnlockHandler::KoUnlockHandler ( ) [inline]

Definition at line 524 of file BrowseViewHandlers.h.

References _i18n.

00525         : KiSelectionHandler(_i18n("Unlock"))
00526     {}

Member Function Documentation

virtual void KoUnlockHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 533 of file BrowseViewHandlers.h.

References CvsCmdUnlock(), and KiSelectionHandler::OnFiles().

00534     {
00535         KiSelectionHandler::OnFiles(pmf);
00536         CvsCmdUnlock(*this);
00537     }

virtual void KoUnlockHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 527 of file BrowseViewHandlers.h.

References CvsCmdUnlock(), and KiSelectionHandler::OnFolder().

00528     {
00529         KiSelectionHandler::OnFolder(fullpath);
00530         CvsCmdUnlock(*this);
00531     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:28 2003 for WinCvs Source by doxygen 1.3-rc2


KoUpdateHandler Class Reference

Handles updates on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoUpdateHandler:

[legend]
Collaboration diagram for KoUpdateHandler:

[legend]
List of all members.

Public Methods

KoUpdateHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles updates on the selected items.

Definition at line 640 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoUpdateHandler::KoUpdateHandler ( ) [inline]

Definition at line 643 of file BrowseViewHandlers.h.

References _i18n.

00644         : KiSelectionHandler(_i18n("Update"))
00645     {}

Member Function Documentation

virtual void KoUpdateHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 653 of file BrowseViewHandlers.h.

References CvsCmdUpdate(), and KiSelectionHandler::OnFiles().

00654     {
00655         KiSelectionHandler::OnFiles(pmf);
00656         CvsCmdUpdate(*this);
00657     }

virtual void KoUpdateHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 647 of file BrowseViewHandlers.h.

References CvsCmdUpdate(), and KiSelectionHandler::OnFolder().

00648     {
00649         KiSelectionHandler::OnFolder(fullpath);
00650         CvsCmdUpdate(*this);
00651     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:30 2003 for WinCvs Source by doxygen 1.3-rc2


KoUpdateMoveToTrashHandler Class Reference

Handles figuring out if moving files to trash is enabled. More...

#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

Detailed Description

Handles figuring out if moving files to trash is enabled.

Definition at line 99 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoUpdateMoveToTrashHandler::KoUpdateMoveToTrashHandler ( ) [inline]

Definition at line 106 of file BrowseViewHandlers.h.

References _i18n.

00107         : KiSelectionHandler(_i18n("Update Move To Trash")), m_isFolders(false), m_isFiles(false)
00108     {}

Member Function Documentation

bool KoUpdateMoveToTrashHandler::IsEnabled ( ) const [inline]

Definition at line 120 of file BrowseViewHandlers.h.

Referenced by CBrowseFileView::OnUpdateViewTrash().

00121     {
00122         return !m_isFolders && m_isFiles;
00123     }

virtual void KoUpdateMoveToTrashHandler::OnFiles ( MultiFiles * ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 115 of file BrowseViewHandlers.h.

00116     {
00117         m_isFiles = true;
00118     }

virtual void KoUpdateMoveToTrashHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 110 of file BrowseViewHandlers.h.

00111     {
00112         m_isFolders = true;
00113     }

Member Data Documentation

bool KoUpdateMoveToTrashHandler::m_isFiles [private]

Definition at line 103 of file BrowseViewHandlers.h.

bool KoUpdateMoveToTrashHandler::m_isFolders [private]

Definition at line 102 of file BrowseViewHandlers.h.

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:31 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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().

00111     {
00112         KoWatcher* watcher = (KoWatcher*)p;
00113         return watcher->Run();
00114     }

UINT KoWatcher::Run ( ) [private]

Definition at line 35 of file FileViewWatcher.cpp.

References m_eventStartWatching, CWincvsApp::m_isBackgroundProcess, StartWatch(), and StopWatch().

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.

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.

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, 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 StartWatch(), and StopWatch().

CEvent KoWatcher::m_eventStartWatching [private]

Definition at line 35 of file FileViewWatcher.h.

Referenced by Run().

CEvent KoWatcher::m_eventTerminate [private]

Definition at line 38 of file FileViewWatcher.h.

HANDLE KoWatcher::m_handles[3] [private]

Definition at line 53 of file FileViewWatcher.h.

Referenced by StartWatch(), and StopWatch().

HWND KoWatcher::m_hWnd [private]

Definition at line 50 of file FileViewWatcher.h.

bool KoWatcher::m_isRecursive [private]

Definition at line 47 of file FileViewWatcher.h.

Referenced by StartWatch().

TCHAR KoWatcher::m_path[_MAX_PATH] [private]

Definition at line 44 of file FileViewWatcher.h.

CCriticalSection KoWatcher::m_section [private]

Definition at line 41 of file FileViewWatcher.h.

Referenced by StartWatch().

The documentation for this class was generated from the following files:
  • WinCvs/FileViewWatcher.h
  • WinCvs/FileViewWatcher.cpp
Generated on Fri Jan 31 12:17:32 2003 for WinCvs Source by doxygen 1.3-rc2


KoWatchersHandler Class Reference

Handles watchers on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchersHandler:

[legend]
Collaboration diagram for KoWatchersHandler:

[legend]
List of all members.

Public Methods

KoWatchersHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles watchers on the selected items.

Definition at line 292 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoWatchersHandler::KoWatchersHandler ( ) [inline]

Definition at line 295 of file BrowseViewHandlers.h.

References _i18n.

00296         : KiSelectionHandler(_i18n("Watchers"))
00297     {}

Member Function Documentation

virtual void KoWatchersHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 305 of file BrowseViewHandlers.h.

References CvsCmdWatchers(), and KiSelectionHandler::OnFiles().

00306     {
00307         KiSelectionHandler::OnFiles(pmf);
00308         CvsCmdWatchers(*this);
00309     }

virtual void KoWatchersHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 299 of file BrowseViewHandlers.h.

References CvsCmdWatchers(), and KiSelectionHandler::OnFolder().

00300     {
00301         KiSelectionHandler::OnFolder(fullpath);
00302         CvsCmdWatchers(*this);
00303     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:33 2003 for WinCvs Source by doxygen 1.3-rc2


KoWatchOffHandler Class Reference

Handles watch off on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchOffHandler:

[legend]
Collaboration diagram for KoWatchOffHandler:

[legend]
List of all members.

Public Methods

KoWatchOffHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles watch off on the selected items.

Definition at line 355 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoWatchOffHandler::KoWatchOffHandler ( ) [inline]

Definition at line 358 of file BrowseViewHandlers.h.

References _i18n.

00359         : KiSelectionHandler(_i18n("Watch Off"))
00360     {}

Member Function Documentation

virtual void KoWatchOffHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 368 of file BrowseViewHandlers.h.

References CvsCmdWatchOff(), and KiSelectionHandler::OnFiles().

00369     {
00370         KiSelectionHandler::OnFiles(pmf);
00371         CvsCmdWatchOff(*this);
00372     }

virtual void KoWatchOffHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 362 of file BrowseViewHandlers.h.

References CvsCmdWatchOff(), and KiSelectionHandler::OnFolder().

00363     {
00364         KiSelectionHandler::OnFolder(fullpath);
00365         CvsCmdWatchOff(*this);
00366     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:35 2003 for WinCvs Source by doxygen 1.3-rc2


KoWatchOnHandler Class Reference

Handles watch on on the selected items. More...

#include <BrowseViewHandlers.h>

Inheritance diagram for KoWatchOnHandler:

[legend]
Collaboration diagram for KoWatchOnHandler:

[legend]
List of all members.

Public Methods

KoWatchOnHandler ()
virtual void | OnFolder (const char *fullpath)
virtual void | OnFiles (MultiFiles *pmf)

Detailed Description

Handles watch on on the selected items.

Definition at line 334 of file BrowseViewHandlers.h.

Constructor & Destructor Documentation

KoWatchOnHandler::KoWatchOnHandler ( ) [inline]

Definition at line 337 of file BrowseViewHandlers.h.

References _i18n.

00338         : KiSelectionHandler(_i18n("Watch On"))
00339     {}

Member Function Documentation

virtual void KoWatchOnHandler::OnFiles ( MultiFiles * pmf ) [inline, virtual]

Called for selected files

Parameters:
pmf Files selection as MultiFiles
Note:
Tyically you should call the KiSelectionHandler::OnFiles in your override first

Implements KiSelectionHandler.

Definition at line 347 of file BrowseViewHandlers.h.

References CvsCmdWatchOn(), and KiSelectionHandler::OnFiles().

00348     {
00349         KiSelectionHandler::OnFiles(pmf);
00350         CvsCmdWatchOn(*this);
00351     }

virtual void KoWatchOnHandler::OnFolder ( const char * fullpath ) [inline, virtual]

Called for selected folder

Parameters:
fullpath Directory path to add to selection
Note:
Typically you should call the KiSelectionHandler::OnFolder in your override first

Implements KiSelectionHandler.

Definition at line 341 of file BrowseViewHandlers.h.

References CvsCmdWatchOn(), and KiSelectionHandler::OnFolder().

00342     {
00343         KiSelectionHandler::OnFolder(fullpath);
00344         CvsCmdWatchOn(*this);
00345     }

The documentation for this class was generated from the following file:
  • common/BrowseViewHandlers.h
Generated on Fri Jan 31 12:17:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:36 2003 for WinCvs Source by doxygen 1.3-rc2


LCommander Class Reference

Inheritance diagram for LCommander:

[legend]
The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Fri Jan 31 12:17:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 988 of file umain.h.

Referenced by UWidget::OnListGetInfo(), and UCvsFiles::Search().

void* ULIST_INFO::data

Definition at line 990 of file umain.h.

Referenced by UWidget::OnListGetInfo().

int ULIST_INFO::row

Definition at line 988 of file umain.h.

Referenced by UWidget::OnListGetInfo(), and UCvsFiles::Search().

const char* ULIST_INFO::title

Definition at line 989 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 Fri Jan 31 12:17:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 979 of file umain.h.

Referenced by TViewFill::InitItem(), UWidget::OnListInsert(), and UCvsFiles::ResetView().

void* ULIST_INSERT::icon

Definition at line 981 of file umain.h.

Referenced by TViewFill::InitItem(), UWidget::OnListInsert(), and UCvsFiles::ResetView().

int ULIST_INSERT::row

Definition at line 979 of file umain.h.

Referenced by TViewFill::InitItem(), UWidget::OnListInsert(), and UCvsFiles::ResetView().

const char* ULIST_INSERT::title

Definition at line 980 of file umain.h.

Referenced by TViewFill::InitItem(), UWidget::OnListInsert(), and UCvsFiles::ResetView().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:17:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:38 2003 for WinCvs Source by doxygen 1.3-rc2


CListParserConsole Class Reference

Class to parse directories/files (obtained using cvs ls). More...

#include <ItemListDlg.h>

Inheritance diagram for CListParserConsole:

[legend]
Collaboration diagram for CListParserConsole:

[legend]
List of all members.

Public Methods

CListParserConsole ()
virtual | ~CListParserConsole ()
virtual void | Parse (int launchRes)

Detailed Description

Class to parse directories/files (obtained using cvs ls).

Definition at line 130 of file ItemListDlg.h.

Constructor & Destructor Documentation

CListParserConsole::CListParserConsole ( )

Definition at line 361 of file ItemListDlg.cpp.

00362 {
00363 }

CListParserConsole::~CListParserConsole ( ) [virtual]

Definition at line 365 of file ItemListDlg.cpp.

00366 {
00367 }

Member Function Documentation

void CListParserConsole::Parse ( int launchRes ) [virtual]

Virtual overridable to parse the result of browse command

Parameters:
launchRes The result of the command launch
Note:
Call default implementation after parsing is finished to clear the stored command output and store the launch result, the error output is not cleared however to allow further analysis

Implements CItemListConsole.

Definition at line 369 of file ItemListDlg.cpp.

References getline(), ItemRowInfo::m_description, ItemRowInfo::m_descriptionEx, CItemListConsole::m_itemList, and CItemListConsole::Parse().

00370 {
00371     string line;
00372
00373     while( getline(m_cvsOut, line) )
00374     {
00375         if( line.size() > 0 && !isspace(line.c_str()[0]) )
00376         {
00377             const char entrySeparator = '/';
00378             string entryType;
00379             stringstream entry(line);
00380
00381             if( getline(entry, entryType, entrySeparator) )
00382             {
00383                 if( entryType.size() > 0 && entryType.c_str()[0] == 'D' )
00384                 {
00385                     string directory;
00386
00387                     if( getline(entry, directory, entrySeparator) && !directory.empty() )
00388                     {
00389                         ItemRowInfo rowInfo;
00390                         rowInfo.m_description.insert(STR_ITEMLIST_DIR);
00391
00392                         m_itemList.insert(std::make_pair(directory, rowInfo));
00393                     }
00394                 }
00395                 else
00396                 {
00397                     string file;
00398
00399                     if( getline(entry, file, entrySeparator) && !file.empty() )
00400                     {
00401                         string revision;
00402                         string date;
00403
00404                         if( getline(entry, revision, entrySeparator) &&
00405                             getline(entry, date, entrySeparator) )
00406                         {
00407                             ItemRowInfo rowInfo;
00408                             rowInfo.m_description.insert(revision);
00409                             rowInfo.m_descriptionEx.insert(date);
00410
00411                             m_itemList.insert(std::make_pair(file, rowInfo));
00412                         }
00413                     }
00414                 }
00415             }
00416         }
00417     }
00418
00419     CItemListConsole::Parse(launchRes);
00420 }

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:17:40 2003 for WinCvs Source by doxygen 1.3-rc2


CListView Class Reference

Inheritance diagram for CListView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/BrowseFileView.h
Generated on Fri Jan 31 12:17:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:40 2003 for WinCvs Source by doxygen 1.3-rc2


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_COMMAND_START, 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 Fri Jan 31 12:17:41 2003 for WinCvs Source by doxygen 1.3-rc2


CLogFilters Class Reference

Filters log dialog. More...

#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 MultiFiles *mf, const char *sLastDate, const char *sLastRev, const char *sLastUsers, const char *sLastStates)
~CLogFilters ()

Public Attributes

CButton m_hasUserCheck
CButton m_hasStateCheck
CButton m_hasRevCheck
CButton m_hasDateCheck
CButton m_browseTagButton
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 ()
BN_CLICKED message handler, enable date entry window.

afx_msg void | OnRev ()
BN_CLICKED message handler, enable revision entry window.

afx_msg void | OnState ()
BN_CLICKED message handler, enable state entry window.

afx_msg void | OnUser ()
BN_CLICKED message handler, enable user entry window.

afx_msg void | OnBrowseTag ()
BN_CLICKED message handler, browse for branch/tag.

Private Attributes

const MultiFiles * | m_mf

Detailed Description

Filters log dialog.

Definition at line 89 of file LogDlg.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 102 of file LogDlg.h.

00102 { IDD = IDD_LOG_FILTERS };

Constructor & Destructor Documentation

CLogFilters::CLogFilters | ( | const MultiFiles * | mf,
 |  | const char * | sLastDate,
 |  | const char * | sLastRev,
 |  | const char * | sLastUsers,
 |  | const char * | sLastStates
 | ) |

Definition at line 183 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().

00186                          : m_mf(mf), CPropertyPage(CLogFilters::IDD)
00187 {
00188     //{{AFX_DATA_INIT(CLogFilters)
00189     m_date = sLastDate;
00190     m_rev = sLastRev;
00191     m_state = sLastStates;
00192     m_user = sLastUsers;
00193     m_hasDate = FALSE;
00194     m_hasRev = FALSE;
00195     m_hasState = FALSE;
00196     m_hasUser = FALSE;
00197     //}}AFX_DATA_INIT
00198
00199     m_revCombo.SetItems(&gLogRevNames);
00200     m_dateCombo.SetItems(&gLogDateNames);
00201     m_userCombo.SetItems(&gLogUserNames);
00202     m_stateCombo.SetItems(&gLogStateNames);
00203 }

CLogFilters::~CLogFilters ( )

Definition at line 205 of file LogDlg.cpp.

00206 {
00207 }

Member Function Documentation

void CLogFilters::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 209 of file LogDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), OnDate(), OnRev(), OnState(), and OnUser().

00210 {
00211     CPropertyPage::DoDataExchange(pDX);
00212     //{{AFX_DATA_MAP(CLogFilters)
00213     DDX_Control(pDX, IDC_USER, m_hasUserCheck);
00214     DDX_Control(pDX, IDC_STATE, m_hasStateCheck);
00215     DDX_Control(pDX, IDC_REV, m_hasRevCheck);
00216     DDX_Control(pDX, IDC_DATE, m_hasDateCheck);
00217     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00218     DDX_Control(pDX, IDC_COMBOUSER, m_userCombo);
00219     DDX_Control(pDX, IDC_COMBOSTATE, m_stateCombo);
00220     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00221     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00222     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00223     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00224     DDX_CBString(pDX, IDC_COMBOSTATE, m_state);
00225     DDX_CBString(pDX, IDC_COMBOUSER, m_user);
00226     DDX_Check(pDX, IDC_DATE, m_hasDate);
00227     DDX_Check(pDX, IDC_REV, m_hasRev);
00228     DDX_Check(pDX, IDC_STATE, m_hasState);
00229     DDX_Check(pDX, IDC_USER, m_hasUser);
00230     //}}AFX_DATA_MAP
00231
00232     if( m_hasDate )
00233     {
00234         DDV_MinChars(pDX, m_date, 1);
00235     }
00236
00237     if( m_hasState )
00238     {
00239         DDV_MinChars(pDX, m_state, 1);
00240     }
00241
00242     if( !pDX->m_bSaveAndValidate )
00243     {
00244         OnRev();
00245         OnDate();
00246         OnState();
00247         OnUser();
00248     }
00249
00250     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00251     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00252     DDX_ComboMString(pDX, IDC_COMBOUSER, m_userCombo);
00253     DDX_ComboMString(pDX, IDC_COMBOSTATE, m_stateCombo);
00254 }

void CLogFilters::OnBrowseTag ( ) [protected]

BN_CLICKED message handler, browse for branch/tag.

Definition at line 284 of file LogDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

00285 {
00286     CStr tagName;
00287     if( CompatGetTagListItem(m_mf, tagName) )
00288     {
00289         m_rev = tagName.c_str();
00290         m_revCombo.SetWindowText(m_rev);
00291     }
00292 }

void CLogFilters::OnDate ( ) [protected]

BN_CLICKED message handler, enable date entry window.

Definition at line 271 of file LogDlg.cpp.

References m_dateCombo, and m_hasDateCheck.

Referenced by DoDataExchange().

00272 {
00273     m_dateCombo.EnableWindow(m_hasDateCheck.GetCheck());
00274 }

void CLogFilters::OnRev ( ) [protected]

BN_CLICKED message handler, enable revision entry window.

Definition at line 277 of file LogDlg.cpp.

References m_browseTagButton, m_hasRevCheck, and m_revCombo.

Referenced by DoDataExchange().

00278 {
00279     m_revCombo.EnableWindow(m_hasRevCheck.GetCheck());
00280     m_browseTagButton.EnableWindow(m_hasRevCheck.GetCheck());
00281 }

void CLogFilters::OnState ( ) [protected]

BN_CLICKED message handler, enable state entry window.

Definition at line 295 of file LogDlg.cpp.

References m_hasStateCheck, and m_stateCombo.

Referenced by DoDataExchange().

00296 {
00297     m_stateCombo.EnableWindow(m_hasStateCheck.GetCheck());
00298 }

void CLogFilters::OnUser ( ) [protected]

BN_CLICKED message handler, enable user entry window.

Definition at line 301 of file LogDlg.cpp.

References m_hasUserCheck, and m_userCombo.

Referenced by DoDataExchange().

00302 {
00303     m_userCombo.EnableWindow(m_hasUserCheck.GetCheck());
00304 }

Member Data Documentation

CButton CLogFilters::m_browseTagButton

Definition at line 107 of file LogDlg.h.

Referenced by OnRev().

CString CLogFilters::m_date

Definition at line 112 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CSmartComboBox CLogFilters::m_dateCombo

Definition at line 111 of file LogDlg.h.

Referenced by CLogFilters(), and OnDate().

BOOL CLogFilters::m_hasDate

Definition at line 116 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CButton CLogFilters::m_hasDateCheck

Definition at line 106 of file LogDlg.h.

Referenced by OnDate().

BOOL CLogFilters::m_hasRev

Definition at line 117 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CButton CLogFilters::m_hasRevCheck

Definition at line 105 of file LogDlg.h.

Referenced by OnRev().

BOOL CLogFilters::m_hasState

Definition at line 118 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CButton CLogFilters::m_hasStateCheck

Definition at line 104 of file LogDlg.h.

Referenced by OnState().

BOOL CLogFilters::m_hasUser

Definition at line 119 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CButton CLogFilters::m_hasUserCheck

Definition at line 103 of file LogDlg.h.

Referenced by OnUser().

const MultiFiles* CLogFilters::m_mf [private]

Definition at line 142 of file LogDlg.h.

CString CLogFilters::m_rev

Definition at line 113 of file LogDlg.h.

Referenced by CLogFilters(), CompatGetLog(), and OnBrowseTag().

CSmartComboBox CLogFilters::m_revCombo

Definition at line 110 of file LogDlg.h.

Referenced by CLogFilters(), OnBrowseTag(), and OnRev().

CString CLogFilters::m_state

Definition at line 114 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CSmartComboBox CLogFilters::m_stateCombo

Definition at line 109 of file LogDlg.h.

Referenced by CLogFilters(), and OnState().

CString CLogFilters::m_user

Definition at line 115 of file LogDlg.h.

Referenced by CLogFilters(), and CompatGetLog().

CSmartComboBox CLogFilters::m_userCombo

Definition at line 108 of file LogDlg.h.

Referenced by CLogFilters(), and OnUser().

The documentation for this class was generated from the following files:
  • common/LogDlg.h
  • common/LogDlg.cpp
Generated on Fri Jan 31 12:17:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:44 2003 for WinCvs Source by doxygen 1.3-rc2


CLogin_MAIN Class Reference

#include <LoginDlg.h>

Inheritance diagram for CLogin_MAIN:

[legend]
Collaboration diagram for CLogin_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_LOGIN_MAIN }

Public Methods

CLogin_MAIN (bool forceRoot)
~CLogin_MAIN ()

Public Attributes

BOOL | m_forceRoot
CString | m_helpLogin

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 49 of file LoginDlg.h.

00049 { IDD = IDD_LOGIN_MAIN };

Constructor & Destructor Documentation

CLogin_MAIN::CLogin_MAIN ( bool forceRoot )

Definition at line 48 of file LoginDlg.cpp.

References m_forceRoot, and m_helpLogin.

00049     : CPropertyPage(CLogin_MAIN::IDD)
00050 {
00051     //{{AFX_DATA_INIT(CLogin_MAIN)
00052     //}}AFX_DATA_INIT
00053
00054     m_forceRoot = forceRoot;
00055
00056     m_helpLogin = _T("Select \"Force using the CVSROOT\" option to login according to your general preferences settings "
00057         "(otherwise current sandbox settings will be used by CVS client executable).\r\n"
00058         "\r\n"
00059         "Login command is interactive and it will ask you for password.\r\n"
00060         "Entered password will be cached by CVS so you need to login only once for each CVSROOT.\r\n"
00061         "\r\n"
00062         "To remove the password from CVS cache use the logout command.");
00063 }

CLogin_MAIN::~CLogin_MAIN ( )

Definition at line 65 of file LoginDlg.cpp.

00066 {
00067 }

Member Function Documentation

void CLogin_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 69 of file LoginDlg.cpp.

00070 {
00071     CPropertyPage::DoDataExchange(pDX);
00072     //{{AFX_DATA_MAP(CLogin_MAIN)
00073     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00074     DDX_Text(pDX, IDC_HELPLOGIN, m_helpLogin);
00075     //}}AFX_DATA_MAP
00076 }

Member Data Documentation

BOOL CLogin_MAIN::m_forceRoot

Definition at line 50 of file LoginDlg.h.

Referenced by CLogin_MAIN(), and CompatGetLogin().

CString CLogin_MAIN::m_helpLogin

Definition at line 51 of file LoginDlg.h.

Referenced by CLogin_MAIN().

The documentation for this class was generated from the following files:
  • common/LoginDlg.h
  • common/LoginDlg.cpp
Generated on Fri Jan 31 12:17:45 2003 for WinCvs Source by doxygen 1.3-rc2


CLogMain Class Reference

Main log dialog. More...

#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 (bool supress)
~CLogMain ()

Public Attributes

CButton m_headerDescCheck
CButton m_headerOnlyCheck
BOOL | m_supress
BOOL | m_defBranch
BOOL | m_noRecurs
BOOL | m_noTags
BOOL | m_onlyRCS
BOOL | m_headerOnly
BOOL | m_headerDesc

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnHeaders ()
BN_CLICKED message handler, reset headers desc if set.

afx_msg void | OnHeadersdesc ()
BN_CLICKED message handler, reset headers only if set.

Detailed Description

Main log dialog.

Definition at line 47 of file LogDlg.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 58 of file LogDlg.h.

00058 { IDD = IDD_LOG_MAIN };

Constructor & Destructor Documentation

CLogMain::CLogMain ( bool supress )

Definition at line 119 of file LogDlg.cpp.

References FALSE, m_defBranch, m_headerDesc, m_headerOnly, m_noRecurs, m_noTags, m_onlyRCS, and m_supress.

00119                                : CPropertyPage(CLogMain::IDD)
00120 {
00121     //{{AFX_DATA_INIT(CLogMain)
00122     m_supress = supress;
00123     m_defBranch = FALSE;
00124     m_noRecurs = FALSE;
00125     m_noTags = FALSE;
00126     m_onlyRCS = FALSE;
00127     m_headerOnly = FALSE;
00128     m_headerDesc = FALSE;
00129     //}}AFX_DATA_INIT
00130 }

CLogMain::~CLogMain ( )

Definition at line 132 of file LogDlg.cpp.

00133 {
00134 }

Member Function Documentation

void CLogMain::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 136 of file LogDlg.cpp.

00137 {
00138     CPropertyPage::DoDataExchange(pDX);
00139     //{{AFX_DATA_MAP(CLogMain)
00140     DDX_Control(pDX, IDC_HEADERSDESC, m_headerDescCheck);
00141     DDX_Control(pDX, IDC_HEADERS, m_headerOnlyCheck);
00142     DDX_Check(pDX, IDC_SUPRESS, m_supress);
00143     DDX_Check(pDX, IDC_DEFBRANCH, m_defBranch);
00144     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00145     DDX_Check(pDX, IDC_NOTAGS, m_noTags);
00146     DDX_Check(pDX, IDC_ONLYRCS, m_onlyRCS);
00147     DDX_Check(pDX, IDC_HEADERS, m_headerOnly);
00148     DDX_Check(pDX, IDC_HEADERSDESC, m_headerDesc);
00149     //}}AFX_DATA_MAP
00150 }

void CLogMain::OnHeaders ( ) [protected]

BN_CLICKED message handler, reset headers desc if set.

Definition at line 161 of file LogDlg.cpp.

References m_headerDescCheck, and m_headerOnlyCheck.

00162 {
00163     if( m_headerOnlyCheck.GetCheck() && m_headerDescCheck.GetCheck() )
00164     {
00165         m_headerDescCheck.SetCheck(0);
00166     }
00167 }

void CLogMain::OnHeadersdesc ( ) [protected]

BN_CLICKED message handler, reset headers only if set.

Definition at line 170 of file LogDlg.cpp.

References m_headerDescCheck, and m_headerOnlyCheck.

00171 {
00172     if( m_headerDescCheck.GetCheck() && m_headerOnlyCheck.GetCheck() )
00173     {
00174         m_headerOnlyCheck.SetCheck(0);
00175     }
00176 }

Member Data Documentation

BOOL CLogMain::m_defBranch

Definition at line 62 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

BOOL CLogMain::m_headerDesc

Definition at line 67 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

CButton CLogMain::m_headerDescCheck

Definition at line 59 of file LogDlg.h.

Referenced by OnHeaders(), and OnHeadersdesc().

BOOL CLogMain::m_headerOnly

Definition at line 66 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

CButton CLogMain::m_headerOnlyCheck

Definition at line 60 of file LogDlg.h.

Referenced by OnHeaders(), and OnHeadersdesc().

BOOL CLogMain::m_noRecurs

Definition at line 63 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

BOOL CLogMain::m_noTags

Definition at line 64 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

BOOL CLogMain::m_onlyRCS

Definition at line 65 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

BOOL CLogMain::m_supress

Definition at line 61 of file LogDlg.h.

Referenced by CLogMain(), and CompatGetLog().

The documentation for this class was generated from the following files:
  • common/LogDlg.h
  • common/LogDlg.cpp
Generated on Fri Jan 31 12:17:46 2003 for WinCvs Source by doxygen 1.3-rc2


CLogNodeData Class Reference

Inheritance diagram for CLogNodeData:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphView.h
Generated on Fri Jan 31 12:17:46 2003 for WinCvs Source by doxygen 1.3-rc2


CLogoutThread Class Reference

Class to handle auto-logout. More...

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

Detailed Description

Class to handle auto-logout.

Definition at line 126 of file wincvs.cpp.

Constructor & Destructor Documentation

CLogoutThread::CLogoutThread ( )

Definition at line 156 of file wincvs.cpp.

00156                              : m_term(false)
00157 {
00158 }

CLogoutThread::~CLogoutThread ( ) [virtual]

Definition at line 160 of file wincvs.cpp.

00161 {
00162 }

Member Function Documentation

void CLogoutThread::Delete ( ) [virtual]

Definition at line 164 of file wincvs.cpp.

00165 {
00166     CWinThread::Delete();
00167 }

BOOL CLogoutThread::InitInstance ( ) [protected, virtual]

Definition at line 169 of file wincvs.cpp.

References cvs_err(), CvsCmdLogout(), FALSE, CWincvsApp::GetIdleTime(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), CWincvsApp::IsCvsRunning(), and CWincvsApp::ResetIdleTime().

00170 {
00171     for(;;)
00172     {
00173         Sleep(1000);
00174
00175         if(m_term)
00176             return FALSE;
00177
00178         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00179         AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00180
00181         if( !curModel->HasLogin() || !gCvsPrefs.HasLoogedIn() ||
00182             gCvsPrefs.LogoutTimeOut() <= 0 || app->IsCvsRunning() )
00183         {
00184             continue;
00185         }
00186
00187         DWORD time = ::GetTickCount();
00188         if( app->GetIdleTime() != 0 &&
00189             (int)(time - app->GetIdleTime()) >= (gCvsPrefs.LogoutTimeOut() * 60 * 1000) )
00190         {
00191             app->ResetIdleTime();
00192             cvs_err("Making automatic logout after %d minute(s):\n", gCvsPrefs.LogoutTimeOut());
00193             CvsCmdLogout();
00194         }
00195     }
00196
00197     return FALSE;
00198 }

void CLogoutThread::KillThread ( void ) [inline]

Definition at line 135 of file wincvs.cpp.

References m_term.

Referenced by CWincvsApp::SaveAllModified().

00135 { m_term = true; }

Member Data Documentation

bool CLogoutThread::m_term [protected]

Definition at line 144 of file wincvs.cpp.

Referenced by KillThread().

The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


LOutlineTable Class Reference

Inheritance diagram for LOutlineTable:

[legend]
The documentation for this class was generated from the following file:
  • common/MacBinEncoding.h
Generated on Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

int LPseudoDrawAttachment::m_widid [protected]

Definition at line 63 of file UPseudoSupport.cpp.

The documentation for this class was generated from the following file:
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Fri Jan 31 12:17:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 m_lastRect, 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 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 SearchWidID().

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Fri Jan 31 12:17:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 670 of file TclGlue.cpp.

References TCL_OK.

00670 : 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 672 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00673     {
00674         return kContinueTraversal;
00675     }

virtual kTraversal LSReport::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 677 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00678     {
00679         return kContinueTraversal;
00680     }

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 694 of file TclGlue.cpp.

References kSkipFile, kTraversal, and Tcl_AppendResult.

00698     {
00699         Tcl_AppendResult(fInterp, name, "\n", 0L);
00700         return kSkipFile;
00701     }

virtual kTraversal LSReport::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 682 of file TclGlue.cpp.

References kTraversal, kTraversalError, Tcl_AppendResult, and TCL_ERROR.

00683     {
00684         fState = TCL_ERROR;
00685         Tcl_AppendResult(fInterp, err, "\n", 0L);
00686         return kTraversalError;
00687     }

virtual kTraversal LSReport::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 689 of file TclGlue.cpp.

References kContinueTraversal, and kTraversal.

00690     {
00691         return kContinueTraversal;
00692     }

Member Data Documentation

Tcl_Interp* LSReport::fInterp

Definition at line 667 of file TclGlue.cpp.

int LSReport::fState

Definition at line 668 of file TclGlue.cpp.

Referenced by tclDirProc().

The documentation for this class was generated from the following file:
  • common/TclGlue.cpp
Generated on Fri Jan 31 12:17:50 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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(), 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 Fri Jan 31 12:17:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 93 of file MacrosSetup.h.

Referenced by MacroTraversal::OnFile().

00094     {
00095         std::vector<CMacroEntry>::iterator j;
00096
00097         for(j = entries.begin(); j != entries.end(); ++j) {
00098             if( stricmp((*j).name, name) > 0 )
00099                 break;
00100         }
00101
00102         entries.insert(j, CMacroEntry(fullname, name));
00103     }

void CMacroSet::Flush ( void ) [inline]

Definition at line 87 of file MacrosSetup.h.

Referenced by MacrosFlushAll().

00088     {
00089         entries.erase(entries.begin(), entries.end());
00090         invalFlag = true;
00091     }

Member Data Documentation

std::vector<CMacroEntry> CMacroSet::entries

Definition at line 83 of file MacrosSetup.h.

bool CMacroSet::invalFlag

Definition at line 85 of file MacrosSetup.h.

Referenced by CMacroSet().

The documentation for this class was generated from the following file:
  • common/MacrosSetup.h
Generated on Fri Jan 31 12:17:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 181 of file MacrosSetup.cpp.

References cvs_err(), kTraversal, and kTraversalError.

00182     {
00183         cvs_err(err);
00184         cvs_err("\n");
00185         return kTraversalError;
00186     }

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 194 of file MacrosSetup.cpp.

References CMacroSet::Add(), CvsArgs::add(), CvsArgs::Argc(), CvsArgs::Argv(), CStr, cvs_err(), free, getline(), gMacrosAdmin, gMacrosSel, kContinueTraversal, kTraversal, no_argument, and required_argument.

00198 {
00199     if(stricmp(name + strlen(name) - 4, ".tcl"))
00200         return kContinueTraversal;
00201
00202     FILE *fpin = fopen(fullname, "r");
00203     if(fpin == 0L)
00204     {
00205         cvs_err("Impossible to open '%s' (error %d)\n", fullname, errno);
00206         return kContinueTraversal;
00207     }
00208
00209     char *oldline = 0L;
00210     int line_length;
00211     size_t line_chars_allocated = 0;
00212     CvsArgs args(false);
00213     args.add("dummy");
00214
00215     if((line_length = getline (&oldline, &line_chars_allocated, fpin)) > 0 &&
00216         strnicmp(oldline, "#!CVSGUI1.0", strlen("#!CVSGUI1.0")) == 0)
00217     {
00218         char *line = oldline + strlen("#!CVSGUI1.0");
00219
00220         while(*line)
00221         {
00222             int hasQuote = 0;
00223             char *temp;
00224
00225             // Search for the non space char
00226             while(*line && isspace(*line))
00227                 ++line;
00228
00229             // handle the quote
00230             if((*line) == '"')
00231             {
00232                 hasQuote = 1;
00233                 line++;
00234             }
00235             for(temp=line;*line;++line)
00236             {
00237                 if((*line) == '"')
00238                 {
00239                     if(hasQuote)
00240                     {
00241                         hasQuote = 0; /* ok doc */
00242                         break;
00243                     }
00244                 }
00245                 if(isspace(*line) && !hasQuote)
00246                     break;
00247             }
00248             if(hasQuote) /* mismatch quote */
00249                 temp = line;
00250
00251             if(temp != line)
00252             {
00253                 CStr arg;
00254                 arg.set(temp, line - temp);
00255                 args.add(arg);
00256             }
00257         }
00258
00259         static struct option long_options[] =
00260         {
00261             {"admin", no_argument, 0L, 1},
00262             {"selection", no_argument, 0L, 2},
00263             {"name", required_argument, 0L, 3},
00264             {0, 0, 0, 0}
00265         };
00266         bool hasAdmin = false;
00267         bool hasSel = false;
00268         CStr dispname;
00269
00270         optind = 0;
00271         int option_index = 0, c;
00272         while ((c = getopt_long
00273             (args.Argc(), args.Argv(), "+", long_options, &option_index)) != EOF)
00274         {
00275             switch (c)
00276             {
00277             case 1:
00278                 hasAdmin = true;
00279                 break;
00280             case 2:
00281                 hasSel = true;
00282                 break;
00283             case 3:
00284                 dispname = optarg;
00285                 break;
00286             default:
00287                 cvs_err("Warning : unknown option in the file '%s'\n", fullname);
00288                 break;
00289             }
00290         }
00291
00292         if(dispname.empty())
00293         {
00294             dispname = name;
00295         }
00296
00297         if(hasAdmin)
00298         {
00299             gMacrosAdmin.Add(fullname, dispname);
00300         }
00301         else if(hasSel)
00302         {
00303             gMacrosSel.Add(fullname, dispname);
00304         }
00305         else
00306         {
00307             cvs_err("Warning : no option <admin|selection> in the file '%s'\n", fullname);
00308         }
00309     }
00310
00311     free (oldline);
00312
00313     fclose(fpin);
00314
00315     return kContinueTraversal;
00316 }

The documentation for this class was generated from the following file:
  • common/MacrosSetup.cpp
Generated on Fri Jan 31 12:17:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 77 of file MainFrm.h.

References m_browseHist.

Referenced by CWinCvsBrowser::Create(), and CWinCvsBrowser::ResetBrowser().

00077 { 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 76 of file MainFrm.h.

References m_consolebar, and CBarConsole::m_view.

Referenced by CWincvsApp::GetConsoleView().

00076 { return m_consolebar.m_view; }

char * CMainFrame::GetEnvMainThread ( const char * name )

Definition at line 913 of file MainFrm.cpp.

References ASSERT, sAskingMainThread, sGetEnv(), and sGetEnvResult.

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 ( void ) [inline]

Definition at line 86 of file MainFrm.h.

Referenced by CWincvsApp::GetFilterModel().

00087     {
00088         return &m_filter;
00089     }

KiIgnoreModel* CMainFrame::GetIgnoreModel ( void ) [inline]

Definition at line 98 of file MainFrm.h.

Referenced by CWincvsApp::GetIgnoreModel().

00099     {
00100         return &m_ignore;
00101     }

CMDIMenuList& CMainFrame::GetMenuList ( void ) [inline]

Definition at line 74 of file MainFrm.h.

References CMDIMenuList, and CCJMDIFrameWnd::m_menuList.

00074 { return m_menuList; }

KiRecursionModel* CMainFrame::GetRecursionModel ( void ) [inline]

Definition at line 92 of file MainFrm.h.

Referenced by CWincvsApp::GetRecursionModel().

00093     {
00094         return &m_recursion;
00095     }

CStatusBar* CMainFrame::GetStatusBar ( ) [inline]

Definition at line 78 of file MainFrm.h.

References m_wndStatusBar.

Referenced by CWincvsApp::GetStatusBar().

00078 { return &m_wndStatusBar; }

CCJTabCtrlBar* CMainFrame::GetWorkspace ( ) [inline]

Definition at line 73 of file MainFrm.h.

References m_wndWorkspace.

Referenced by CWincvsApp::ActivateBrowserView().

00073 { 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, 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 gMainPlacement, CWinPlacement::hasOne, and CWinPlacement::placement.

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::GetBrowserView(), gMainPlacement, CWincvsApp::IsCvsRunning(), m_state, CCJMDIFrameWnd::OnClose(), CWinCvsBrowser::ResetBrowser(), CCJMDIFrameWnd::SaveBarState(), and CCJWindowPlacement::SaveWindowPos().

00475 {
00476     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00477     if( app->IsCvsRunning() )
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, 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, USmartCombo::SetItems(), and CSplashWnd::ShowSplashScreen().

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, 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, sGetEnv(), and sGetEnvResult.

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 169 of file MainFrm.h.

Referenced by CMainFrame(), OnActivate(), and OnSysCommand().

CHistComboBoxEx CMainFrame::m_browseHist [protected]

Definition at line 120 of file MainFrm.h.

Referenced by ChangeLocation(), GetBrowseHistory(), and OnCreate().

CToolbarCombo CMainFrame::m_comboFilterMask [protected]

Definition at line 121 of file MainFrm.h.

Referenced by FreshenFileMask(), and OnCreate().

CBarConsole CMainFrame::m_consolebar [protected]

Definition at line 123 of file MainFrm.h.

Referenced by GetConsoleView(), and InitializeDockingWindows().

KoFilterModel CMainFrame::m_filter [protected]

Definition at line 51 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 122 of file MainFrm.h.

Referenced by OnCreate().

KoIgnoreModel CMainFrame::m_ignore [protected]

Definition at line 53 of file MainFrm.h.

Referenced by OnUpdateViewIgnore(), and OnViewIgnore().

KoRecursionModel CMainFrame::m_recursion [protected]

Definition at line 52 of file MainFrm.h.

Referenced by OnUpdateViewRecursive(), and OnViewRecursive().

CCJWindowPlacement CMainFrame::m_state [protected]

Definition at line 126 of file MainFrm.h.

Referenced by OnClose(), and OnCreate().

CImageList CMainFrame::m_TabImages [protected]

Definition at line 125 of file MainFrm.h.

Referenced by InitializeDockingWindows().

CToolBar CMainFrame::m_wndBrowser [protected]

Definition at line 115 of file MainFrm.h.

Referenced by OnCreate().

CToolBar CMainFrame::m_wndFilter [protected]

Definition at line 119 of file MainFrm.h.

Referenced by OnCreate().

CToolBar CMainFrame::m_wndList [protected]

Definition at line 118 of file MainFrm.h.

Referenced by OnCreate().

CToolBar CMainFrame::m_wndMultiUser [protected]

Definition at line 116 of file MainFrm.h.

Referenced by OnCreate().

CCvsStatusBar CMainFrame::m_wndStatusBar [protected]

Definition at line 113 of file MainFrm.h.

Referenced by GetStatusBar(), and OnCreate().

CToolBar CMainFrame::m_wndTags [protected]

Definition at line 117 of file MainFrm.h.

Referenced by OnCreate().

CToolBar CMainFrame::m_wndToolBar [protected]

Definition at line 114 of file MainFrm.h.

Referenced by OnCreate().

CCJTabCtrlBar CMainFrame::m_wndWorkspace [protected]

Definition at line 124 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 Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


match_dir Struct Reference

helper functor to compare MultiFilesEntry by directory path More...

Collaboration diagram for match_dir:

[legend]
List of all members.

Public Methods

match_dir (const UStr &inDirPath)
bool | operator() (const MultiFilesEntry &inEntry) const

Public Attributes

const UStr & | dirPath

Detailed Description

helper functor to compare MultiFilesEntry by directory path

Definition at line 220 of file MultiFiles.cpp.

Constructor & Destructor Documentation

match_dir::match_dir ( const UStr & inDirPath ) [inline]

Definition at line 223 of file MultiFiles.cpp.

00223 : dirPath(inDirPath) {}

Member Function Documentation

bool match_dir::operator() ( const MultiFilesEntry & inEntry ) const [inline]

Definition at line 224 of file MultiFiles.cpp.

References MultiFilesEntry::getdir().

00225     {
00226         return dirPath == inEntry.getdir();
00227     }

Member Data Documentation

const UStr& match_dir::dirPath

Definition at line 222 of file MultiFiles.cpp.

The documentation for this struct was generated from the following file:
  • common/MultiFiles.cpp
Generated on Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:04 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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, and UCvsMenubar.

Definition at line 74 of file umenu.cpp.

const UMSGMAP * UMenu::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu, and UCvsMenubar.

Definition at line 76 of file umenu.cpp.

const UMSGMAP * UMenu::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu, and UCvsMenubar.

Definition at line 76 of file umenu.cpp.

const URuntimeClass * UMenu::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu, and UCvsMenubar.

Definition at line 74 of file umenu.cpp.

const UMSGMAP * UMenu::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UMacAppMenu, and UCvsMenubar.

Definition at line 76 of file umenu.cpp.

int UMenu::OnCommands ( int cmd ) [protected]

Definition at line 924 of file umenu.cpp.

References 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(), 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, and UCvsMenubar.

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, and UCvsMenubar.

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 Fri Jan 31 12:18:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:07 2003 for WinCvs Source by doxygen 1.3-rc2


CMfFileDialog Class Reference

Multi-selection file dialog wrapper class. More...

#include <MfFileDialog.h>

Inheritance diagram for CMfFileDialog:

[legend]
Collaboration diagram for CMfFileDialog:

[legend]
List of all members.

Public Methods

CMfFileDialog (MultiFiles &mf, LPCTSTR lpszDefExt=NULL, LPCTSTR lpszFileName=NULL, DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter=NULL, CWnd *pParentWnd=NULL)
virtual int | DoModal ()
DoModal virtual override, overwrite FNERR_BUFFERTOOSMALL error and retrieve the selection.

Private Methods

virtual void | OnFileNameChange ()
OnFileNameChange virtual override, fill in the buffers with new selection.

POSITION | GetStartPosition () const
Hide, use the CMfFileDialog::m_mf instead.

CString | GetNextPathName (POSITION &pos) const
Hide, use the CMfFileDialog::m_mf instead.

Private Attributes

CPathBuffer m_filesBuffer
CPathBuffer m_folderBuffer
MultiFiles & m_mf

Detailed Description

Multi-selection file dialog wrapper class.

Definition at line 59 of file MfFileDialog.h.

Constructor & Destructor Documentation

CMfFileDialog::CMfFileDialog | ( | MultiFiles & | mf,
 |  | LPCTSTR | lpszDefExt = NULL,
 |  | LPCTSTR | lpszFileName = NULL,
 |  | DWORD | dwFlags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
 |  | LPCTSTR | lpszFilter = NULL,
 |  | CWnd * | pParentWnd = NULL
 | ) |

Definition at line 87 of file MfFileDialog.cpp.

References TRUE.

00088                                                              : m_mf(mf),
00089         CFileDialog(TRUE, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
00090 {
00091 }

Member Function Documentation

int CMfFileDialog::DoModal ( ) [virtual]

DoModal virtual override, overwrite FNERR_BUFFERTOOSMALL error and retrieve the selection.

Definition at line 99 of file MfFileDialog.cpp.

References CPathBuffer::Clear(), CPathBuffer::GetBuffer(), getline(), m_filesBuffer, m_folderBuffer, m_mf, MultiFiles::newdir(), and MultiFiles::newfile().

Referenced by BrowserGetMultiFiles().

00100 {
00101     m_filesBuffer.Clear();
00102     m_folderBuffer.Clear();
00103
00104     int modalResult = CFileDialog::DoModal();
00105     if( IDCANCEL == modalResult )
00106     {
00107         // Override the "buffer too small" error since we provide our own buffer
00108         if( CommDlgExtendedError() == FNERR_BUFFERTOOSMALL )
00109         {
00110             modalResult = IDOK;
00111         }
00112     }
00113
00114     if( IDOK == modalResult && m_filesBuffer.GetBuffer() && m_folderBuffer.GetBuffer() )
00115     {
00116         m_mf.newdir(m_folderBuffer.GetBuffer());
00117
00118         // Fill the selection
00119         string selFile;
00120         stringstream filesStream;
00121         filesStream << m_filesBuffer.GetBuffer();
00122
00123         while( getline(filesStream, selFile, '\"') )
00124         {
00125             if( selFile.size() > 0 && !isspace(selFile.c_str()[0]) )
00126             {
00127                 m_mf.newfile(selFile.c_str());
00128             }
00129         }
00130     }
00131
00132     return modalResult;
00133 }

CString CMfFileDialog::GetNextPathName ( POSITION & pos ) const [private]

Hide, use the CMfFileDialog::m_mf instead.

POSITION CMfFileDialog::GetStartPosition ( ) const [private]

Hide, use the CMfFileDialog::m_mf instead.

void CMfFileDialog::OnFileNameChange ( ) [private, virtual]

OnFileNameChange virtual override, fill in the buffers with new selection.

Definition at line 136 of file MfFileDialog.cpp.

References CPathBuffer::GetBuffer(), m_filesBuffer, and m_folderBuffer.

00137 {
00138     const CWnd* pParent = GetParent();
00139     if( pParent )
00140     {
00141         const HWND hParent = pParent->m_hWnd;
00142
00143         // Get the buffer size required
00144         const int filesBufferSize = CommDlg_OpenSave_GetSpec(hParent, NULL, 0);
00145         const int folderBufferSize = CommDlg_OpenSave_GetFolderPath(hParent, NULL, 0);
00146
00147         CommDlg_OpenSave_GetSpec(hParent, m_filesBuffer.GetBuffer(filesBufferSize), filesBufferSize);
00148         CommDlg_OpenSave_GetFolderPath(hParent, m_folderBuffer.GetBuffer(folderBufferSize), folderBufferSize);
00149     }
00150 }

Member Data Documentation

CPathBuffer CMfFileDialog::m_filesBuffer [private]

Files buffer

Definition at line 77 of file MfFileDialog.h.

Referenced by DoModal(), and OnFileNameChange().

CPathBuffer CMfFileDialog::m_folderBuffer [private]

Folder buffer

Definition at line 78 of file MfFileDialog.h.

Referenced by DoModal(), and OnFileNameChange().

MultiFiles& CMfFileDialog::m_mf [private]

Selection

Definition at line 80 of file MfFileDialog.h.

Referenced by DoModal().

The documentation for this class was generated from the following files:
  • WinCvs/MfFileDialog.h
  • WinCvs/MfFileDialog.cpp
Generated on Fri Jan 31 12:18:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 extractcolor().

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.

const char mircAttrCvt::tokens [static, private]

Initial value:

 {
     (char)3 , 0
}

Definition at line 376 of file CTCP2Parse.cpp.

The documentation for this class was generated from the following files:
  • common/CTCP2Parse.hpp
  • common/CTCP2Parse.cpp
Generated on Fri Jan 31 12:18:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 329 of file wincvs_winutil.cpp.

References Insert(), and kNoClass.

00329                                                                                                 :
00330     CPersistent(uniqueName, kNoClass), fMaxStr(maxstr)
00331 {
00332     if(defaultStr != 0L)
00333     {
00334         int i = 0;
00335         while(defaultStr[i] != 0L)
00336         {
00337             Insert(defaultStr[i++]);
00338         }
00339     }
00340 }

CMMenuString::~CMMenuString ( ) [virtual]

Definition at line 342 of file wincvs_winutil.cpp.

00343 {
00344 }

Member Function Documentation

const void * CMMenuString::GetData ( void ) const [virtual]

Implements CPersistent.

Definition at line 358 of file wincvs_winutil.cpp.

References fAllStrs, fBuf, NAMESPACE, and SizeOf().

00359 {
00360     unsigned int thesize = SizeOf(), tmpsize;
00361     ((CMMenuString *)this)->fBuf.AdjustSize(thesize);
00362     char *tmp = ((CMMenuString *)this)->fBuf;
00363     *(int *)tmp = fAllStrs.size();
00364     tmp += sizeof(int) / sizeof(char);
00365
00366     NAMESPACE(std) vector<UStr>::const_iterator i;
00367     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00368     {
00369         tmpsize = (*i).length() + 1;
00370         memcpy(tmp, (const char*)(*i), tmpsize * sizeof(char));
00371         tmp += tmpsize;
00372     }
00373
00374     return (char *)fBuf;
00375 }

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 391 of file wincvs_winutil.cpp.

References fAllStrs, and CPersistent::TouchTimeStamp().

Referenced by CMMenuString().

00392 {
00393     TouchTimeStamp();
00394     fAllStrs.push_back(UStr(newstr));
00395 }

void CMMenuString::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [virtual]

Implements CPersistent.

Definition at line 377 of file wincvs_winutil.cpp.

References fAllStrs, and fMaxStr.

00378 {
00379     const char* tmp = (char *)ptr;
00380     unsigned int thesize;
00381     fAllStrs.erase(fAllStrs.begin(), fAllStrs.end());
00382     thesize = *(int *)tmp;
00383     tmp += sizeof(int) / sizeof(char);
00384     for(unsigned int i = 0; i < thesize && i < fMaxStr; i++)
00385     {
00386         fAllStrs.push_back(UStr(tmp));
00387         tmp += strlen(tmp) + 1;
00388     }
00389 }

unsigned int CMMenuString::SizeOf ( void ) const [virtual]

Implements CPersistent.

Definition at line 346 of file wincvs_winutil.cpp.

References fAllStrs, and NAMESPACE.

Referenced by GetData().

00347 {
00348     NAMESPACE(std) vector<UStr>::const_iterator i;
00349     unsigned int thesize = sizeof(int);
00350
00351     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00352     {
00353         thesize += (*i).length() + 1;
00354     }
00355     return thesize;
00356 }

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 Fri Jan 31 12:18:10 2003 for WinCvs Source by doxygen 1.3-rc2


CModuleParserConsole Class Reference

Class to parse modules (obtained using cvs co -c). More...

#include <ItemListDlg.h>

Inheritance diagram for CModuleParserConsole:

[legend]
Collaboration diagram for CModuleParserConsole:

[legend]
List of all members.

Public Methods

CModuleParserConsole ()
virtual | ~CModuleParserConsole ()
virtual void | Parse (int launchRes)

Detailed Description

Class to parse modules (obtained using cvs co -c).

Definition at line 120 of file ItemListDlg.h.

Constructor & Destructor Documentation

CModuleParserConsole::CModuleParserConsole ( )

Definition at line 249 of file ItemListDlg.cpp.

00250 {
00251 }

CModuleParserConsole::~CModuleParserConsole ( ) [virtual]

Definition at line 253 of file ItemListDlg.cpp.

00254 {
00255 }

Member Function Documentation

void CModuleParserConsole::Parse ( int launchRes ) [virtual]

Virtual overridable to parse the result of browse command

Parameters:
launchRes The result of the command launch
Note:
Call default implementation after parsing is finished to clear the stored command output and store the launch result, the error output is not cleared however to allow further analysis

Implements CItemListConsole.

Definition at line 257 of file ItemListDlg.cpp.

References getline(), ItemRowInfo::m_description, ItemRowInfo::m_descriptionEx, CItemListConsole::m_itemList, and CItemListConsole::Parse().

00258 {
00259     string line;
00260
00261     while( getline(m_cvsOut, line) )
00262     {
00263         if( line.size() > 0 && !isspace(line.c_str()[0]) )
00264         {
00265             stringstream stream;
00266             string module;
00267
00268             stream << line;
00269             stream >> module;
00270
00271             if( !module.empty() )
00272             {
00273                 ItemRowInfo rowInfo;
00274
00275                 string definition = line;
00276                 definition.erase(definition.begin(), definition.begin() + module.size());
00277
00278                 while( !definition.empty() && isspace(definition[0]) )
00279                 {
00280                     definition.erase(definition.begin(), definition.begin() + 1);
00281                 }
00282
00283                 if( !definition.empty() )
00284                 {
00285                     stringstream strDefintion;
00286                     string options;
00287                     string directories;
00288                     string token;
00289
00290                     strDefintion << definition;
00291
00292                     bool hasProg = false;
00293
00294                     do{
00295                         strDefintion >> token;
00296                         if( !token.empty() )
00297                         {
00298                             if( directories.empty() )
00299                             {
00300                                 if( options.empty() )
00301                                 {
00302                                     if( token[0] != '-' )
00303                                     {
00304                                         directories += token;
00305                                         continue;
00306                                     }
00307                                 }
00308
00309                                 if( token[0] == '-' || hasProg )
00310                                 {
00311                                     if( !options.empty() )
00312                                     {
00313                                         options += " ";
00314                                     }
00315
00316                                     options += token;
00317
00318                                     if( hasProg )
00319                                     {
00320                                         hasProg = false;
00321                                     }
00322                                     else if( token == "-d" ||
00323                                         token == "-e" ||
00324                                         token == "-i" ||
00325                                         token == "-o" ||
00326                                         token == "-s" ||
00327                                         token == "-t" ||
00328                                         token == "-u" )
00329                                     {
00330                                         hasProg = true;
00331                                     }
00332                                 }
00333                                 else
00334                                 {
00335                                     directories += token;
00336                                 }
00337                             }
00338                             else
00339                             {
00340                                 directories += " ";
00341                                 directories += token;
00342                             }
00343                         }
00344                     }while( !strDefintion.eof());
00345
00346                     rowInfo.m_description.insert(options.c_str());
00347                     rowInfo.m_descriptionEx.insert(directories.c_str());
00348                 }
00349
00350                 m_itemList.insert(std::make_pair(module, rowInfo));
00351             }
00352         }
00353     }
00354
00355     CItemListConsole::Parse(launchRes);
00356 }

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:18:10 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 169 of file MultiString.cpp.

const URuntimeClass * CMPString::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 169 of file MultiString.cpp.

const URuntimeClass * CMPString::rtCMPString ( void ) [static]

Definition at line 169 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 Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 674 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

const UMSGMAP* UMSGMAP::pBaseMap

Definition at line 673 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 665 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

int UMSGMAP_ENTRY::ext1

Definition at line 666 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

int UMSGMAP_ENTRY::ext2

Definition at line 667 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

int UMSGMAP_ENTRY::nMessage

Definition at line 663 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

UEventParam UMSGMAP_ENTRY::nSig

Definition at line 664 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

UPMSG UMSGMAP_ENTRY::pfn

Definition at line 668 of file umain.h.

Referenced by UCmdTarget::UDispatchMessage().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:18:13 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 168 of file MultiString.cpp.

const URuntimeClass * CMString::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 168 of file MultiString.cpp.

const URuntimeClass * CMString::rtCMString ( void ) [static]

Definition at line 168 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 Fri Jan 31 12:18:14 2003 for WinCvs Source by doxygen 1.3-rc2


MultiFiles Class Reference

Store multiple files by directory. More...

#include <MultiFiles.h>

Collaboration diagram for MultiFiles:

[legend]
List of all members.

Public Types

typedef std::vector< MultiFilesEntry
>::const_iterator 		const_iterator

Public Methods

MultiFiles ()
void | newdir (const char *dir)
Add a new directory.

void | newfile (const char *file, const FSSpec *spec=0L, const char *currRevision=0L)
Add a new file to the current directory.

const_iterator | begin () const
const_iterator | end () const
bool | getdir (int index, UStr &path) const
Get the directory at the specified index, return false if failed.

int | NumDirs (void) const
int | TotalNumFiles (void) const
Get the total number of files.

void | reset ()
Reset for reuse.

bool | Normalize ()
Adjust the file list so that we end up with a list that contains no file entries with partial path names.

Protected Attributes

std::vector< MultiFilesEntry > dirs

Detailed Description

Store multiple files by directory.

Definition at line 90 of file MultiFiles.h.

Member Typedef Documentation

typedef std::vector<MultiFilesEntry>::const_iterator MultiFiles::const_iterator

Definition at line 98 of file MultiFiles.h.

Constructor & Destructor Documentation

MultiFiles::MultiFiles ( )

Definition at line 146 of file MultiFiles.cpp.

00147 {
00148 }

Member Function Documentation

const_iterator MultiFiles::begin ( ) const [inline]

Definition at line 100 of file MultiFiles.h.

References dirs.

Referenced by BrowserGetMultiFiles(), CDiff_MAIN::CDiff_MAIN(), CompatGetCommit(), CompatGetPrefs(), CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdLock(), CvsCmdLog(), CvsCmdMoveToTrash(), CvsCmdRemove(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), CSelectionDetailsDlg::DisplaySelection(), LaunchItemListCommand(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), CGetPrefs_WINCVS::OnExtdiffsel(), CItemListDlg::OnInitDialog(), and CCommit_MAIN::OnInitDialog().

00100 { return dirs.begin(); }

const_iterator MultiFiles::end ( ) const [inline]

Definition at line 101 of file MultiFiles.h.

References dirs.

Referenced by BrowserGetMultiFiles(), CDiff_MAIN::CDiff_MAIN(), CompatGetCommit(), CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdLock(), CvsCmdLog(), CvsCmdMoveToTrash(), CvsCmdRemove(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), CSelectionDetailsDlg::DisplaySelection(), CItemListDlg::OnInitDialog(), and CCommit_MAIN::OnInitDialog().

00101 { return dirs.end(); }

bool MultiFiles::getdir | ( | int | index,
 |  | UStr & | path
 | ) | const

Get the directory at the specified index, return false if failed.

Definition at line 168 of file MultiFiles.cpp.

References MultiFilesEntry::dir, and dirs.

Referenced by CvsCmdRelease(), CSelectionDetailsDlg::DisplaySelection(), CCmdLine_MAIN::OnCheckpath(), and CItemListDlg::OnInitDialog().

00169 {
00170     if( index < 0 || index >= (int)dirs.size() )
00171         return false;
00172
00173     const MultiFilesEntry& entry = dirs[index];
00174
00175     path = entry.dir;
00176
00177     return true;
00178 }

void MultiFiles::newdir ( const char * dir )

Add a new directory.

Definition at line 151 of file MultiFiles.cpp.

References dirs.

Referenced by BrowserGetMultiFiles(), CompatGetCommit(), CMfFileDialog::DoModal(), KiSelectionHandler::GetSelection(), LaunchItemListCommand(), Normalize(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), CCommit_MAIN::OnDiff(), CGetPrefs_WINCVS::OnExtdiffsel(), KiSelectionHandler::OnFolder(), CGraphView::OnViewDiff(), CBrowseFileView::ProcessSelectionCommand(), and UCvsFiles::ProcessSelectionCommand().

00152 {
00153     MultiFilesEntry entry(dir);
00154     dirs.push_back(dir);
00155 }

void MultiFiles::newfile | ( | const char * | file,
 |  | const FSSpec * | spec = 0L,
 |  | const char * | currRevision = 0L
 | ) |

Add a new file to the current directory.

Definition at line 158 of file MultiFiles.cpp.

References MultiFilesEntry::add(), and dirs.

Referenced by BrowserGetMultiFiles(), CompatGetCommit(), CMfFileDialog::DoModal(), LaunchItemListCommand(), Normalize(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), CCommit_MAIN::OnDiff(), CGetPrefs_WINCVS::OnExtdiffsel(), CGraphView::OnViewDiff(), CBrowseFileView::ProcessSelectionCommand(), and UCvsFiles::ProcessSelectionCommand().

00159 {
00160     if( dirs.size() == 0 )
00161         return;
00162
00163     MultiFilesEntry& entry = dirs[dirs.size() - 1];
00164     entry.add(file, spec, currRevision);
00165 }

bool MultiFiles::Normalize ( )

Adjust the file list so that we end up with a list that contains no file entries with partial path names.

Definition at line 231 of file MultiFiles.cpp.

References CStr, dirs, newdir(), newfile(), and split().

Referenced by CheckSelectionHandler().

00232 {
00233     std::vector<MultiFilesEntry>    workingCopy(dirs);
00234     dirs.clear();
00235
00236     for ( std::vector<MultiFilesEntry>::const_iterator i(workingCopy.begin()); i != workingCopy.end(); ++i )
00237       if ( i->files.empty() )
00238       {
00239         // special case for empty directories in MultiFiles:
00240         // just add the directory to our directory list
00241         //
00242             std::vector<MultiFilesEntry>::iterator      found;
00243             found = std::find_if(dirs.begin(), dirs.end(), match_dir(i->dir));
00244             if ( found == dirs.end() )
00245             {
00246                 // directory not found in list -> create new directory
00247                 this->newdir(i->dir);
00248             }
00249       }
00250         else for ( std::vector<FileEntry>::const_iterator j(i->files.begin()); j != i->files.end(); j++ )
00251         {
00252             // split into partial path and name
00253             //
00254             CStr        fullDirPath, dir, name;
00255             if ( split(j->file, dir, name) )
00256             {
00257                 // insert current directory path in front of partial path
00258                 //
00259                 fullDirPath = i->dir;
00260                 if ( !i->dir.endsWith(kPathDelimiter) )
00261                     fullDirPath << kPathDelimiter;
00262                 fullDirPath << dir;
00263             }
00264             else fullDirPath = i->dir; // file does not have a partial path
00265
00266             std::vector<MultiFilesEntry>::iterator      found;
00267             found = std::find_if(dirs.begin(), dirs.end(), match_dir(fullDirPath));
00268             if ( found != dirs.end() )
00269             {
00270                 // directory already in list -> just append the new file entry
00271                 found->add(name, &j->spec, j->currRev);
00272             }
00273             else
00274             {
00275                 // directory not found in list -> create new directory and append the file to the new directory
00276                 this->newdir(fullDirPath);
00277                 this->newfile(name, &j->spec, j->currRev);
00278             }
00279         }
00280
00281     return true;
00282 }

int MultiFiles::NumDirs ( void ) const [inline]

Definition at line 105 of file MultiFiles.h.

References dirs.

Referenced by CCmdLine_MAIN::CCmdLine_MAIN(), CSelectionDetailsDlg::DisplaySelection(), and CItemListDlg::OnInitDialog().

00105 { return dirs.size(); }

void MultiFiles::reset ( )

Reset for reuse.

Definition at line 181 of file MultiFiles.cpp.

References dirs.

Referenced by BrowserGetMultiFiles().

00182 {
00183     dirs.erase(dirs.begin(), dirs.end());
00184 }

int MultiFiles::TotalNumFiles ( void ) const

Get the total number of files.

Definition at line 187 of file MultiFiles.cpp.

References dirs.

Referenced by BrowserGetMultiFiles(), CDiff_MAIN::CDiff_MAIN(), CompatGetCommit(), CvsCmdDiff(), CSelectionDetailsDlg::DisplaySelection(), CItemListDlg::OnInitDialog(), CDiff_MAIN::OnInitDialog(), CCommit_MAIN::OnInitDialog(), CBrowseFileView::ProcessSelectionCommand(), and UCvsFiles::ProcessSelectionCommand().

00188 {
00189     int total = 0;
00190
00191     std::vector<MultiFilesEntry>::const_iterator i;
00192     for(i = dirs.begin(); i != dirs.end(); ++i)
00193     {
00194         total += i->NumFiles();
00195     }
00196
00197     return total;
00198 }

Member Data Documentation

std::vector<MultiFilesEntry> MultiFiles::dirs [protected]

Definition at line 113 of file MultiFiles.h.

Referenced by begin(), end(), getdir(), newdir(), newfile(), Normalize(), NumDirs(), reset(), and TotalNumFiles().

The documentation for this class was generated from the following files:
  • common/MultiFiles.h
  • common/MultiFiles.cpp
Generated on Fri Jan 31 12:18:15 2003 for WinCvs Source by doxygen 1.3-rc2


MultiFilesEntry Class Reference

Used internally. More...

#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)
Set the directory.

void | add (const char *file, const FSSpec *spec=0L, const char *currRevision=0L)
Add file.

bool | get (int index, UStr &path, UStr &fileName, UStr &currRev) const
Get the file in the current directory, return false if failed.

int | NumFiles (void) const
Get the number of files in the current dir.

const char * | getdir () const
Get the current directory.

const char * | add (CvsArgs &args) const
Fill up the arguments with all the files.

Protected Attributes

UStr dir
std::vector< FileEntry > files

Friends

class | MultiFiles

Detailed Description

Used internally.

Definition at line 59 of file MultiFiles.h.

Constructor & Destructor Documentation

MultiFilesEntry::MultiFilesEntry ( )

Definition at line 84 of file MultiFiles.cpp.

00085 {
00086 }

MultiFilesEntry::MultiFilesEntry ( const char * path )

Definition at line 88 of file MultiFiles.cpp.

References dir.

00089 {
00090     dir = path;
00091 }

MultiFilesEntry::MultiFilesEntry ( const MultiFilesEntry & entries )

Definition at line 93 of file MultiFiles.cpp.

00094 {
00095     *this = entries;
00096 }

Member Function Documentation

const char * MultiFilesEntry::add ( CvsArgs & args ) const

Fill up the arguments with all the files.

Definition at line 132 of file MultiFiles.cpp.

References CvsArgs::addfile(), dir, and files.

00133 {
00134     std::vector<FileEntry>::const_iterator i;
00135     for(i = files.begin(); i != files.end(); ++i)
00136     {
00137         args.addfile((*i).file, dir, &(*i).spec, (*i).currRev);
00138     }
00139
00140     return dir;
00141 }

void MultiFilesEntry::add | ( | const char * | file,
 |  | const FSSpec * | spec = 0L,
 |  | const char * | currRevision = 0L
 | ) |

Add file.

Definition at line 112 of file MultiFiles.cpp.

References files.

Referenced by MultiFiles::newfile().

00113 {
00114     FileEntry entry(file, spec, currRevision);
00115     files.push_back(entry);
00116 }

bool MultiFilesEntry::get | ( | int | index,
 |  | UStr & | path,
 |  | UStr & | fileName,
 |  | UStr & | currRev
 | ) | const

Get the file in the current directory, return false if failed.

Definition at line 119 of file MultiFiles.cpp.

References dir, and files.

Referenced by CvsCmdDiff().

00120 {
00121     if( index < 0 || (size_t)index >= files.size() )
00122         return false;
00123
00124     path = dir;
00125     fileName = files[index].file;
00126     currRev = files[index].currRev;
00127
00128     return true;
00129 }

const char* MultiFilesEntry::getdir ( ) const [inline]

Get the current directory.

Definition at line 77 of file MultiFiles.h.

References dir.

Referenced by match_dir::operator()().

00077 { return dir; }

int MultiFilesEntry::NumFiles ( void ) const [inline]

Get the number of files in the current dir.

Definition at line 74 of file MultiFiles.h.

References files.

Referenced by CvsCmdDiff().

00074 { return files.size(); }

MultiFilesEntry & MultiFilesEntry::operator= ( const MultiFilesEntry & entries )

Definition at line 98 of file MultiFiles.cpp.

References dir, and files.

00099 {
00100     dir = entries.dir;
00101     files = entries.files;
00102     return *this;
00103 }

void MultiFilesEntry::setdir ( const char * newdir )

Set the directory.

Definition at line 106 of file MultiFiles.cpp.

References dir.

00107 {
00108     dir = newdir;
00109 }

Friends And Related Function Documentation

friend class MultiFiles [friend]

Definition at line 86 of file MultiFiles.h.

Member Data Documentation

UStr MultiFilesEntry::dir [protected]

Definition at line 83 of file MultiFiles.h.

Referenced by add(), get(), getdir(), MultiFiles::getdir(), MultiFilesEntry(), operator=(), and setdir().

std::vector<FileEntry> MultiFilesEntry::files [protected]

Definition at line 84 of file MultiFiles.h.

Referenced by add(), get(), NumFiles(), and operator=().

The documentation for this class was generated from the following files:
  • common/MultiFiles.h
  • common/MultiFiles.cpp
Generated on Fri Jan 31 12:18:15 2003 for WinCvs Source by doxygen 1.3-rc2


MultiFilesEntryIndex Class Reference

A pair of MultiFiles::const_iterator and index allowing to identify the FileEntry. More...

#include <MultiFiles.h>

Collaboration diagram for MultiFilesEntryIndex:

[legend]
List of all members.

Public Methods

MultiFilesEntryIndex (int index, MultiFiles::const_iterator mfi)
int | GetIndex () const
MultiFiles::const_iterator | GetIterator () const

Private Attributes

int | m_index
MultiFiles::const_iterator m_mfi

Detailed Description

A pair of MultiFiles::const_iterator and index allowing to identify the FileEntry.

Definition at line 117 of file MultiFiles.h.

Constructor & Destructor Documentation

MultiFilesEntryIndex::MultiFilesEntryIndex | ( | int | index,
 |  | MultiFiles::const_iterator | mfi
 | ) | [inline]

Definition at line 120 of file MultiFiles.h.

References m_index, and m_mfi.

00121         : m_index(index), m_mfi(mfi)
00122     {
00123     }

Member Function Documentation

int MultiFilesEntryIndex::GetIndex ( ) const [inline]

Definition at line 125 of file MultiFiles.h.

References m_index.

Referenced by CCommit_MAIN::OnDiff().

00125 { return m_index; }

MultiFiles::const_iterator MultiFilesEntryIndex::GetIterator ( ) const [inline]

Definition at line 126 of file MultiFiles.h.

References m_mfi.

Referenced by CCommit_MAIN::OnDiff().

00126 { return m_mfi; }

Member Data Documentation

int MultiFilesEntryIndex::m_index [private]

Definition at line 129 of file MultiFiles.h.

Referenced by GetIndex(), and MultiFilesEntryIndex().

MultiFiles::const_iterator MultiFilesEntryIndex::m_mfi [private]

Definition at line 130 of file MultiFiles.h.

Referenced by GetIterator(), and MultiFilesEntryIndex().

The documentation for this class was generated from the following file:
  • common/MultiFiles.h
Generated on Fri Jan 31 12:18:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 51 of file ExploreBar.cpp.

References CWincvsApp::IsCvsRunning().

Referenced by OnDeleteitem(), OnItemexpanding(), OnRclick(), and OnSelchanged().

00052 {
00053     CWincvsApp *app = (CWincvsApp*)AfxGetApp();
00054     return app->IsCvsRunning() || gCvsPrefs.empty();
00055 }

void CMyShellTree::OnDeleteitem | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 108 of file ExploreBar.cpp.

References DisableCommon().

00109 {
00110     if(DisableCommon())
00111     {
00112         *pResult = 1;
00113         return;
00114     }
00115
00116     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00117     // TODO: Add your control notification handler code here
00118     CCJShellTree::OnDeleteitem(pNMHDR,pResult);
00119     *pResult = 0;
00120 }

void CMyShellTree::OnItemexpanding | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 57 of file ExploreBar.cpp.

References DisableCommon().

00058 {
00059     if(DisableCommon())
00060     {
00061         *pResult = 1;
00062         return;
00063     }
00064
00065     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00066     CCJShellTree::OnItemexpanding(pNMHDR,pResult);
00067     CCJShellTree::Invalidate();
00068     *pResult = 0;
00069 }

void CMyShellTree::OnRclick | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 95 of file ExploreBar.cpp.

References DisableCommon().

00096 {
00097     if(DisableCommon())
00098     {
00099         *pResult = 1;
00100         return;
00101     }
00102
00103     // TODO: Add your control notification handler code here
00104     CCJShellTree::OnRclick(pNMHDR,pResult);
00105     *pResult = 0;
00106 }

void CMyShellTree::OnSelchanged | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

Definition at line 71 of file ExploreBar.cpp.

References DisableCommon(), CWincvsApp::GetFileView(), and CBrowseFileView::ResetView().

00072 {
00073     if(DisableCommon())
00074     {
00075         *pResult = 1;
00076         return;
00077     }
00078
00079     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00080
00081     CString szPath;
00082     CCJShellTree::OnSelchanged(pNMHDR,pResult);
00083
00084     if(CCJShellTree::GetSelectedFolderPath(szPath))
00085     {
00086         CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00087         CBrowseFileView *view = app->GetFileView();
00088         if(view != 0L)
00089             view->ResetView(szPath);
00090     }
00091
00092     *pResult = 0;
00093 }

The documentation for this class was generated from the following files:
  • WinCvs/ExploreBar.h
  • WinCvs/ExploreBar.cpp
Generated on Fri Jan 31 12:18:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 43 of file NoPython.h.

00043 { IDD = IDD_NOPYTHON };

Constructor & Destructor Documentation

CNoPython::CNoPython ( CWnd * pParent = NULL )

Definition at line 42 of file NoPython.cpp.

References m_remind, and TRUE.

00043     : CDialog(CNoPython::IDD, pParent)
00044 {
00045     //{{AFX_DATA_INIT(CNoPython)
00046     m_remind = TRUE;
00047     //}}AFX_DATA_INIT
00048 }

Member Function Documentation

void CNoPython::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 51 of file NoPython.cpp.

00052 {
00053     CDialog::DoDataExchange(pDX);
00054     //{{AFX_DATA_MAP(CNoPython)
00055     DDX_Control(pDX, IDC_PYTHONURL, m_url);
00056     DDX_Check(pDX, IDC_REMIND, m_remind);
00057     //}}AFX_DATA_MAP
00058 }

BOOL CNoPython::OnInitDialog ( ) [protected, virtual]

Definition at line 69 of file NoPython.cpp.

References m_url, CCJHyperLink::SetURL(), and TRUE.

00070 {
00071     CDialog::OnInitDialog();
00072
00073     m_url.SetURL(_T("http://www.python.org"));
00074
00075     return TRUE;  // return TRUE unless you set the focus to a control
00076                   // EXCEPTION: OCX Property Pages should return FALSE
00077 }

Member Data Documentation

BOOL CNoPython::m_remind

Definition at line 45 of file NoPython.h.

Referenced by CNoPython(), and WarnNoPython().

CCJHyperLink CNoPython::m_url

Definition at line 44 of file NoPython.h.

Referenced by OnInitDialog().

The documentation for this class was generated from the following files:
  • WinCvs/NoPython.h
  • WinCvs/NoPython.cpp
Generated on Fri Jan 31 12:18:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 86 of file BrowseViewModel.h.

00086 {}

Member Function Documentation

void NotificationManager::CheckIn | ( | CObject * | observer,
 |  | FNOBSERVER | handler
 | ) | [inline]

Definition at line 91 of file BrowseViewModel.h.

Referenced by CMainFrame::OnCreate(), UCvsFolders::OnCreate(), UCvsFiles::OnCreate(), CWinCvsBrowser::OnInitialUpdate(), and CBrowseFileView::OnInitialUpdate().

00092     {
00093         m_nodes.push_back(Node(observer, handler));
00094     }

void NotificationManager::CheckOut ( CObject * observer ) [inline]

Definition at line 97 of file BrowseViewModel.h.

Referenced by CWinCvsBrowser::OnDestroy(), CBrowseFileView::OnDestroy(), UCvsFolders::OnDestroy(), and UCvsFiles::OnDestroy().

00098     {
00099         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00100         {
00101             if ((*i).observer == observer)
00102             {
00103                 m_nodes.erase(i);
00104                 break;
00105             }
00106         }
00107     }

void NotificationManager::NotifyAll ( ) [inline]

Definition at line 110 of file BrowseViewModel.h.

References NotificationManager::Node::handler, and NotificationManager::Node::observer.

Referenced by CMainFrame::OnFilterMaskEntered(), UCvsFrame::OnFilterMaskEntered(), UCvsFrame::OnHideUnknown(), CMainFrame::OnViewAdded(), UCvsFrame::OnViewAdded(), CMainFrame::OnViewChanged(), UCvsFrame::OnViewChanged(), CMainFrame::OnViewConflict(), UCvsFrame::OnViewConflict(), CMainFrame::OnViewHideunknown(), CMainFrame::OnViewIgnore(), UCvsFrame::OnViewIgnored(), CMainFrame::OnViewMissing(), UCvsFrame::OnViewMissing(), CMainFrame::OnViewModified(), UCvsFrame::OnViewModified(), CMainFrame::OnViewRecursive(), CMainFrame::OnViewRemoved(), UCvsFrame::OnViewRemoved(), CMainFrame::OnViewUnknown(), UCvsFrame::OnViewUnknown(), and CToolbarCombo::SetText().

00111     {
00112         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00113         {
00114             // make a local copy so that observers can freely unregister during the process
00115             Node & node = *i;
00116             node.handler(node.observer);
00117         }
00118     }

Member Data Documentation

std::vector<Node> NotificationManager::m_nodes [private]

Definition at line 82 of file BrowseViewModel.h.

The documentation for this class was generated from the following file:
  • common/BrowseViewModel.h
Generated on Fri Jan 31 12:18:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 56 of file BrowseViewModel.h.

References NULL.

00057         : observer(NULL), handler(NULL)
00058         {}

NotificationManager::Node::Node | ( | CObject * | o,
 |  | FNOBSERVER | h
 | ) | [inline]

Definition at line 61 of file BrowseViewModel.h.

00062         : observer(o), handler(h)
00063         {}

NotificationManager::Node::Node ( const Node & n ) [inline]

Definition at line 65 of file BrowseViewModel.h.

References handler, and observer.

00066         {
00067             observer = n.observer;
00068             handler = n.handler;
00069         }

Member Function Documentation

Node& NotificationManager::Node::operator= ( const Node & n ) [inline]

Definition at line 71 of file BrowseViewModel.h.

References handler, and observer.

00072         {
00073             observer = n.observer;
00074             handler = n.handler;
00075             return *this;
00076         }

Member Data Documentation

FNOBSERVER NotificationManager::Node::handler

Definition at line 52 of file BrowseViewModel.h.

Referenced by Node(), NotificationManager::NotifyAll(), and operator=().

CObject* NotificationManager::Node::observer

Definition at line 49 of file BrowseViewModel.h.

Referenced by Node(), NotificationManager::NotifyAll(), and operator=().

The documentation for this struct was generated from the following file:
  • common/BrowseViewModel.h
Generated on Fri Jan 31 12:18:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:18 2003 for WinCvs Source by doxygen 1.3-rc2


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, UCmdTarget, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, PCPStr, PCStr, CMString, CMPString, USaveSettings, CPersistent, CPersistentBool, CPersistentInt, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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, UCmdTarget, UMenu, UToolbar, UWidget, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, PCPStr, PCStr, CMString, CMPString, USaveSettings, CPersistent, CPersistentBool, CPersistentInt, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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(), CPersistent::SaveAllSettings(), 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 Fri Jan 31 12:18:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:20 2003 for WinCvs Source by doxygen 1.3-rc2


ControlCvsArgs Class Reference

Base class for control arguments used by add commands (added files are tested appropriate). More...

#include <CvsArgs.h>

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, const char *currRevision=0L)
Add file.

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 override to test the file type.

virtual const char * | TypeDesc ()=0
Virtual override to get the type description.

Private Attributes

bool | m_gotProblem

Detailed Description

Base class for control arguments used by add commands (added files are tested appropriate).

Definition at line 66 of file CvsArgs.h.

Constructor & Destructor Documentation

ControlCvsArgs::ControlCvsArgs ( ) [inline]

Definition at line 69 of file CvsArgs.h.

References m_gotProblem.

00069 : m_gotProblem(false) { }

Member Function Documentation

void ControlCvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L,
 |  | const char * | currRevision = 0L
 | ) | [virtual]

Add file.

Reimplemented from CvsArgs.

Definition at line 304 of file CvsArgs.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(), and TypeDesc().

00306 {
00307     CvsArgs::addfile(arg, dir, spec);
00308
00309     if( !gCvsPrefs.AddControl() )
00310         return;
00311
00312 #if TARGET_RT_MAC_CFM
00313     // here a bug of MSL : it refuses to open a file beginning by
00314     // ".". So we skip this file out of the test and warn the user.
00315     if(arg[0] == '.')
00316     {
00317         cvs_out("Warning : \'%s\' cannot be verified due to a bug in MW MSL, please\n", arg);
00318         cvs_out("          verify manually \'%s\' *is* a %s file\n", arg, TypeDesc());
00319         return;
00320     }
00321 #endif
00322
00323     kTextBinTYPE state = FileIsType(arg, dir, spec);
00324     switch(state)
00325     {
00326     case kFileIsOK:
00327         break;
00328
00329     case kFileMissing:
00330         // we can resurect a file which is missing by re-adding it
00331         break;
00332
00333     case kFileIsAlias:
00334         cvs_err("Warning : \'%s\' is an alias\n", arg);
00335         SetProblem(true);
00336         break;
00337
00338     case kFileInvalidName:
00339         cvs_err("Warning : \'%s\' has an invalid name\n", arg);
00340         SetProblem(true);
00341         break;
00342
00343     case kTextWrongLF:
00344         cvs_err("Warning : \'%s\' seems to have the wrong line feed for this machine, you should correct it first\n", arg);
00345         SetProblem(true);
00346         break;
00347
00348     case kUnicodeIsBinary: // fall thru intentional
00349     case kTextIsBinary:
00350         cvs_err("Warning : \'%s\' seems to be \'binary\', you should use the \'Add binary\' command instead...\n", arg);
00351         SetProblem(true);
00352         break;
00353
00354     case kTextEscapeChar:
00355 #ifdef TARGET_OS_MAC
00356         if(gCvsPrefs.IsoConvert() == ISO8559_none)
00357         {
00358             cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF),\n", arg);
00359             cvs_err("Warning   so you may need to have the ISO8559 translation option set in the preferences\n");
00360             cvs_err("Warning   before commiting\n");
00361         }
00362 #else /* !TARGET_OS_MAC */
00363         cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF), you should correct it first\n", arg);
00364 #endif /* !TARGET_OS_MAC */
00365         break;
00366
00367     case kTextWrongSig:
00368 #if TARGET_RT_MAC_MACHO
00369         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\' or 0, you should correct it first\n", arg);
00370 #else
00371         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\', you should correct it first\n", arg);
00372 #endif
00373         SetProblem(true);
00374         break;
00375
00376     case kUnicodeIsText: // fall thru intentional
00377     case kBinIsText:
00378         cvs_err("Warning : \'%s\' seems to be a text file, you should consider to use the \'Add selection\' command instead\n", arg);
00379         SetProblem(true);
00380         break;
00381
00382     case kBinWrongSig:
00383         cvs_err("Warning : \'%s\' has a file type of \'TEXT\', you should correct it first\n", arg);
00384         SetProblem(true);
00385         break;
00386
00387     case kTextIsUnicode: // fall thru intentional
00388     case kBinIsUnicode:
00389         cvs_err("Warning : \'%s\' seems to be an Unicode file, you should consider to use the \'Add unicode\' command instead\n", arg);
00390         SetProblem(true);
00391         break;
00392
00393     default:
00394         cvs_err("Warning : \'%s\' has some unknown problems\n", arg);
00395         SetProblem(true);
00396         break;
00397     }
00398 }

virtual kTextBinTYPE ControlCvsArgs::FileIsType | ( | const char * | arg,
 |  | const char * | dir,
 |  | const FSSpec * | spec = 0L
 | ) | [protected, pure virtual]

Virtual override to test the file type.

Implemented in AddCvsArgs, AddBinCvsArgs, and AddUnicodeCvsArgs.

Referenced by addfile().

bool ControlCvsArgs::HasProblem ( void ) const

Get the problem indicator

Returns:
true if there is a problem, false if all correct

Definition at line 404 of file CvsArgs.cpp.

References m_gotProblem.

Referenced by CvsCmdAdd().

00405 {
00406     return m_gotProblem;
00407 }

void ControlCvsArgs::SetProblem ( bool newState )

Set the problem indicator

Parameters:
newState New state of the problem indicator

Definition at line 413 of file CvsArgs.cpp.

References m_gotProblem.

Referenced by addfile().

00414 {
00415     m_gotProblem = newState;
00416 }

virtual const char* ControlCvsArgs::TypeDesc ( ) [protected, pure virtual]

Virtual override to get the type description.

Implemented in AddCvsArgs, AddBinCvsArgs, and AddUnicodeCvsArgs.

Referenced by addfile().

Member Data Documentation

bool ControlCvsArgs::m_gotProblem [private]

Problem indicator

Definition at line 85 of file CvsArgs.h.

Referenced by ControlCvsArgs(), HasProblem(), and SetProblem().

The documentation for this class was generated from the following files:
  • common/CvsArgs.h
  • common/CvsArgs.cpp
Generated on Fri Jan 31 12:18:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 ()
DoModal virtual override, check the Shift key and the hide command option settings.

virtual | ~COptionalPropertySheet ()
bool | GetHideCommandDlg ()
Get the hide command option value.

Protected Methods

virtual BOOL | OnCommand (WPARAM wParam, LPARAM lParam)
OnCommand virtual override, save the state of the hide command option checkbox if the OK button was pressed.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, create and add the.

void | GetOptionCheckRect (LPRECT lpRect)

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 42 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

00043     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
00044 {
00045     m_bOptionChecked = bOptionChecked;
00046 }

COptionalPropertySheet::COptionalPropertySheet | ( | bool | bOptionChecked,
 |  | LPCTSTR | pszCaption,
 |  | CWnd * | pParentWnd = NULL,
 |  | UINT | iSelectPage = 0
 | ) |

Definition at line 48 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

00049     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
00050 {
00051     m_bOptionChecked = bOptionChecked;
00052 }

COptionalPropertySheet::~COptionalPropertySheet ( ) [virtual]

Definition at line 54 of file OptionalPropertySheet.cpp.

00055 {
00056 }

Member Function Documentation

int COptionalPropertySheet::DoModal ( ) [virtual]

DoModal virtual override, check the Shift key and the hide command option settings.

Definition at line 146 of file OptionalPropertySheet.cpp.

References IsHideCommandKeyPressed(), and m_bOptionChecked.

Referenced by CompatGetAnnotate(), CompatGetDiff(), CompatGetLog(), CompatGetStatus(), and CompatGetUpdate().

00147 {
00148     return !m_bOptionChecked || (m_bOptionChecked && IsHideCommandKeyPressed()) ? CPropertySheet::DoModal() : IDOK;
00149 }

bool COptionalPropertySheet::GetHideCommandDlg ( )

Get the hide command option value.

Definition at line 164 of file OptionalPropertySheet.cpp.

References m_bOptionChecked.

Referenced by CompatGetAnnotate(), CompatGetDiff(), CompatGetLog(), CompatGetStatus(), and CompatGetUpdate().

00165 {
00166     return m_bOptionChecked;
00167 }

void COptionalPropertySheet::GetOptionCheckRect ( LPRECT lpRect ) [protected]

Calculate the rectangle for the option check box window

Parameters:
lpRect Return rectangle for the option check box window

Definition at line 96 of file OptionalPropertySheet.cpp.

References ASSERT, and IsLargeFonts().

Referenced by OnInitDialog().

00097 {
00098     if( lpRect )
00099     {
00100         CWnd* pOkWnd = GetDlgItem(IDOK);
00101         if( pOkWnd )
00102         {
00103             CRect rectOkWnd;
00104             pOkWnd->GetWindowRect(rectOkWnd);
00105
00106             CRect rectWnd;
00107             GetWindowRect(rectWnd);
00108
00109             const int margin = rectWnd.bottom - rectOkWnd.bottom;
00110             const int height = IsLargeFonts() ? 19 : 16;
00111             const int width = rectOkWnd.left  - rectWnd.left - (margin * 2);
00112
00113             GetClientRect(rectWnd);
00114
00115             lpRect->left = rectWnd.left + margin;
00116             lpRect->right = lpRect->left + width;
00117
00118             lpRect->bottom = rectWnd.bottom - margin - (rectOkWnd.Height() - height) / 4;
00119             lpRect->top = lpRect->bottom - height;
00120         }
00121         else
00122         {
00123             ASSERT(FALSE);  // Can't get the OK button window?
00124
00125             CRect rectWnd;
00126             GetClientRect(rectWnd);
00127
00128             rectWnd.bottom -= 13;
00129             rectWnd.left   += 7;
00130             rectWnd.top     = rectWnd.bottom - (IsLargeFonts() ? 19 : 16);
00131             rectWnd.right   = rectWnd.left   + (IsLargeFonts() ? 235 : 180);
00132
00133             lpRect->bottom = rectWnd.bottom;
00134             lpRect->left = rectWnd.left;
00135             lpRect->top = rectWnd.top;
00136             lpRect->right = rectWnd.right;
00137         }
00138     }
00139     else
00140     {
00141         ASSERT(FALSE);  // Bad pointer
00142     }
00143 }

BOOL COptionalPropertySheet::OnCommand | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected, virtual]

OnCommand virtual override, save the state of the hide command option checkbox if the OK button was pressed.

Definition at line 152 of file OptionalPropertySheet.cpp.

References m_bOptionChecked, and m_optionCheck.

00153 {
00154     if( wParam == IDOK )
00155     {
00156         // Save the check state of the display option
00157         m_bOptionChecked = (m_optionCheck.GetCheck() == 1);
00158     }
00159
00160     return CPropertySheet::OnCommand(wParam, lParam);
00161 }

BOOL COptionalPropertySheet::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, create and add the.

Definition at line 68 of file OptionalPropertySheet.cpp.

References GetOptionCheckRect(), m_optionCheck, and TRUE.

00069 {
00070     CPropertySheet::OnInitDialog();
00071
00072     // Add the option check box
00073     CRect rectWnd;
00074     GetOptionCheckRect(rectWnd);
00075
00076     CString strOptionText;
00077     strOptionText.Format(_T("Display only if %s key is down"), gCvsPrefs.HideCommandDlgUseShift() ? "Shift" : "Ctrl");
00078
00079     m_optionCheck.Create(strOptionText,
00080         WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | WS_TABSTOP,
00081         rectWnd, this, IDC_OPTIONCHECK_BUTTON);
00082
00083     m_optionCheck.SetFont(GetFont());
00084
00085     // Set the checkbox
00086     m_optionCheck.SetCheck(m_bOptionChecked);
00087
00088     return TRUE;  // return TRUE unless you set the focus to a control
00089                   // EXCEPTION: OCX Property Pages should return FALSE
00090 }

Member Data Documentation

bool COptionalPropertySheet::m_bOptionChecked [protected]

The initial state of the option check box

Definition at line 70 of file OptionalPropertySheet.h.

Referenced by COptionalPropertySheet(), DoModal(), GetHideCommandDlg(), and OnCommand().

CButton COptionalPropertySheet::m_optionCheck [protected]

The object wrapping the option check box

Definition at line 71 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 Fri Jan 31 12:18:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:23 2003 for WinCvs Source by doxygen 1.3-rc2


CPathBuffer Class Reference

Support class to handle the selection buffer. More...

#include <MfFileDialog.h>

Collaboration diagram for CPathBuffer:

[legend]
List of all members.

Public Methods

CPathBuffer ()
virtual | ~CPathBuffer ()
void | Clear ()
Release allocated buffer memory.

TCHAR * | GetBuffer (int size=0)

Private Attributes

int | m_bufferSize
TCHAR * | m_buffer

Detailed Description

Support class to handle the selection buffer.

Definition at line 35 of file MfFileDialog.h.

Constructor & Destructor Documentation

CPathBuffer::CPathBuffer ( )

Definition at line 44 of file MfFileDialog.cpp.

References m_buffer, m_bufferSize, and NULL.

00045 {
00046     m_bufferSize = 0;
00047     m_buffer = NULL;
00048 }

CPathBuffer::~CPathBuffer ( ) [virtual]

Definition at line 50 of file MfFileDialog.cpp.

References Clear().

00051 {
00052     Clear();
00053 }

Member Function Documentation

void CPathBuffer::Clear ( ) [inline]

Release allocated buffer memory.

Definition at line 56 of file MfFileDialog.cpp.

References m_buffer, m_bufferSize, and NULL.

Referenced by CMfFileDialog::DoModal(), GetBuffer(), and ~CPathBuffer().

00057 {
00058     m_bufferSize = 0;
00059     delete [] m_buffer;
00060     m_buffer = NULL;
00061 }

TCHAR * CPathBuffer::GetBuffer ( int size = 0 ) [inline]

Get the buffer of the specified size

Parameters:
size Size of the required buffer, specify zero to get the current buffer
Returns:
The pointer to the buffer, NULL on error

Definition at line 68 of file MfFileDialog.cpp.

References Clear(), m_buffer, and m_bufferSize.

Referenced by CMfFileDialog::DoModal(), and CMfFileDialog::OnFileNameChange().

00069 {
00070     if( size > m_bufferSize )
00071     {
00072         Clear();
00073
00074         m_bufferSize = size;
00075         m_buffer = new TCHAR[size];
00076     }
00077
00078     return m_buffer;
00079 }

Member Data Documentation

TCHAR* CPathBuffer::m_buffer [private]

Buffer to hold the selection

Definition at line 45 of file MfFileDialog.h.

Referenced by Clear(), CPathBuffer(), and GetBuffer().

int CPathBuffer::m_bufferSize [private]

Buffer size

Definition at line 44 of file MfFileDialog.h.

Referenced by Clear(), CPathBuffer(), and GetBuffer().

The documentation for this class was generated from the following files:
  • WinCvs/MfFileDialog.h
  • WinCvs/MfFileDialog.cpp
Generated on Fri Jan 31 12:18:23 2003 for WinCvs Source by doxygen 1.3-rc2


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

operator unsigned char * ()
as a P string

operator const char * () const
as a C string

operator char * ()
as a C string

const char * | operator= (const char *newstr)
set to a new C String (0L is OK)

const unsigned char * | operator= (const unsigned char *newstr)
set to a new P String (0L is OK)

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 55 of file CPStr.h.

References CPStr.

00055                                                                                                   : CPStr(),
00056         CPersistent(uniqueName, pclass)
00057     {
00058         if(defValue != 0L)
00059             *(CPStr *)this = defValue;
00060     }

virtual PCPStr::~PCPStr ( ) [inline, virtual]

Definition at line 61 of file CPStr.h.

00062     {
00063     }

Member Function Documentation

const URuntimeClass * PCPStr::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 106 of file Persistent.cpp.

virtual const void* PCPStr::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 70 of file CPStr.h.

References CPStr.

00071     {
00072         const void *res = (const char *)(*(CPStr *)this);
00073         return res == 0L ? "" : res;
00074     }

const URuntimeClass * PCPStr::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 106 of file Persistent.cpp.

PCPStr::operator char * ( ) [inline]

as a C string

Reimplemented from UPStr.

Definition at line 89 of file CPStr.h.

References CPStr, and EGCS_CONST.

00089 { return *(CPStr *)this; }

PCPStr::operator const char * ( ) const [inline]

as a C string

Reimplemented from UPStr.

Definition at line 88 of file CPStr.h.

References CPStr.

00088 { return *(CPStr *)this; }

PCPStr::operator const unsigned char * ( ) const [inline]

as a P string

Reimplemented from UPStr.

Definition at line 82 of file CPStr.h.

References CPStr.

00083         { return *(CPStr *)this; }

PCPStr::operator unsigned char * ( ) [inline]

as a P string

Reimplemented from UPStr.

Definition at line 84 of file CPStr.h.

References CPStr, and EGCS_CONST.

00085         { 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 95 of file CPStr.h.

References CPStr.

00096         { 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 92 of file CPStr.h.

References CPStr.

00093         { return ((CPStr *)this)->operator=(newstr); }

const URuntimeClass * PCPStr::rtPCPStr ( void ) [static]

Definition at line 106 of file Persistent.cpp.

virtual void PCPStr::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 76 of file CPStr.h.

References CPStr.

00077     {
00078         if(strlen((const char *)ptr) == (size - 1))
00079             *(CPStr *)this = (const char *)ptr;
00080     }

virtual unsigned int PCPStr::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 65 of file CPStr.h.

References UPStr::length(), and UPStr::str.

00066     {
00067         return str != 0L ? length() + 1 : 1;
00068     }

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 Fri Jan 31 12:18:24 2003 for WinCvs Source by doxygen 1.3-rc2


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

operator char * ()
as a C string

const char * | operator= (const char *newstr)
set from a C String (0L is OK)

const char * | operator= (const unsigned char *newstr)
set from a P String (0L is OK)

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 104 of file CPStr.h.

References CStr.

00104                                                                                                  : CStr(),
00105         CPersistent(uniqueName, pclass)
00106     {
00107         if(defValue != 0L)
00108             *(CStr *)this = defValue;
00109     }

virtual PCStr::~PCStr ( ) [inline, virtual]

Definition at line 110 of file CPStr.h.

00111     {
00112     }

Member Function Documentation

const URuntimeClass * PCStr::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 105 of file Persistent.cpp.

virtual const void* PCStr::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 119 of file CPStr.h.

References CStr.

00120     {
00121         const void *res = (const char *)(*(CStr *)this);
00122         return res == 0L ? "" : res;
00123     }

const URuntimeClass * PCStr::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 105 of file Persistent.cpp.

PCStr::operator char * ( ) [inline]

as a C string

Reimplemented from UStr.

Definition at line 132 of file CPStr.h.

References CStr, and EGCS_CONST.

00132 { return *(CStr *)this; }

PCStr::operator const char * ( ) const [inline]

as a C string

Reimplemented from UStr.

Definition at line 131 of file CPStr.h.

References CStr.

00131 { 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 141 of file CPStr.h.

References CStr, and CPersistent::TouchTimeStamp().

00142     {
00143         TouchTimeStamp();
00144         return ((CStr *)this)->operator=(newstr);
00145     }

const char* PCStr::operator= ( const char * newstr ) [inline]

set from a C String (0L is OK)

Reimplemented from UStr.

Definition at line 135 of file CPStr.h.

References CStr, and CPersistent::TouchTimeStamp().

00136     {
00137         TouchTimeStamp();
00138         return ((CStr *)this)->operator=(newstr);
00139     }

const URuntimeClass * PCStr::rtPCStr ( void ) [static]

Definition at line 105 of file Persistent.cpp.

virtual void PCStr::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 125 of file CPStr.h.

References CStr.

00126     {
00127         if(strlen((const char *)ptr) == (size - 1))
00128             *(CStr *)this = (const char *)ptr;
00129     }

virtual unsigned int PCStr::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 114 of file CPStr.h.

References UStr::length(), and UStr::str.

00115     {
00116         return str != 0L ? length() + 1 : 0;
00117     }

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 Fri Jan 31 12:18:26 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 Fri Jan 31 12:18:26 2003 for WinCvs Source by doxygen 1.3-rc2


CPersistent Class Reference

Abstract class to access the persistent data to load/save. More...

#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 (const char *only=0L)
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)

Detailed Description

Abstract class to access the persistent data to load/save.

Definition at line 70 of file Persistent.h.

Constructor & Destructor Documentation

CPersistent::CPersistent | ( | const char * | uniqueName,
 |  | kClassPersistent | pclass
 | ) |

Definition at line 108 of file Persistent.cpp.

References Register(), and TouchTimeStamp().

00108                                                                         : fTimeStamp(0)
00109 {
00110     Register(this, uniqueName, pclass);
00111     TouchTimeStamp();
00112 }

CPersistent::~CPersistent ( ) [virtual]

Definition at line 114 of file Persistent.cpp.

References UnRegister().

00115 {
00116     UnRegister(this);
00117 }

Member Function Documentation

const URuntimeClass * CPersistent::_GetBaseClass ( ) [static, protected]

Reimplemented from UObject.

Reimplemented in PCPStr, PCStr, CMString, CMPString, CPersistentBool, and CPersistentInt.

Definition at line 102 of file Persistent.cpp.

CPersistent::CPersistentEntry * CPersistent::Find ( const char * uniqueName ) [static]

Definition at line 644 of file Persistent.cpp.

References fAllEntries, and CPersistent::CPersistentEntry::fUniqueName.

Referenced by _loadPersistentSettings().

00645 {
00646     std::vector<CPersistentEntry>::iterator i;
00647     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00648     {
00649         CPersistentEntry& entry = *i;
00650         if( !strcmp(uniqueName, entry.fUniqueName) )
00651             return &entry;
00652     }
00653
00654     return 0L;
00655 }

virtual const void* CPersistent::GetData ( void ) const [pure virtual]

Implemented in PCPStr, PCStr, TMPersistent< T >, TMString< T >, CPersistentT< T >, CMMenuString, CWinPlacement, TMString< UStr >, TMString< UPStr >, CPersistentT< int >, and CPersistentT< bool >.

Referenced by SaveAll().

const URuntimeClass * CPersistent::GetRuntimeClass ( ) const [virtual]

Reimplemented from UObject.

Reimplemented in PCPStr, PCStr, CMString, CMPString, CPersistentBool, and CPersistentInt.

Definition at line 102 of file Persistent.cpp.

long CPersistent::GetTimeStamp ( ) const [inline]

Definition at line 102 of file Persistent.h.

References fTimeStamp.

00102 { return fTimeStamp; }

bool CPersistent::LoadAll ( const char * only = 0L ) [static]

Definition at line 480 of file Persistent.cpp.

References CStaticAllocT< T >::AdjustSize(), CPStr, CStr, cvs_err(), err, fAllEntries, FSSpec, CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, NUM_CVSROOT, ResetTimeStamp(), and SetData().

Referenced by PyPersistent::Create(), and CvsPrefs::load().

00481 {
00482     bool found_one = false;
00483     std::vector<CPersistentEntry>::iterator i;
00484 #ifdef TARGET_OS_MAC
00485     FSSpec thePrefFile;
00486     short FRef, oldRef;
00487     OSErr err;
00488
00489     err = GetPreferencesFile(thePrefFile);
00490
00491     if( err != noErr )
00492         return false;
00493
00494     oldRef = CurResFile();
00495     FRef = FSpOpenResFile(&thePrefFile, fsRdPerm);
00496     if( FRef < 0 )
00497         return false;
00498
00499     CPStr name;
00500     UseResFile(FRef);
00501
00502     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00503     {
00504         CPersistentEntry& entry = *i;
00505         name = entry.fUniqueName;
00506
00507         Handle hdl = Get1NamedResource(kCVS_prefID, name);
00508         if( hdl == 0L || (only && strcmp(only, name) != 0) )
00509             continue;
00510
00511         HLock(hdl);
00512         found_one = true;
00513         entry.fValue->SetData(*hdl, GetHandleSize(hdl));
00514         entry.fValue->ResetTimeStamp();
00515         HUnlock(hdl);
00516     }
00517
00518     // migrate to the new gOldCvsroots container
00519     if( gOldCvsroots.GetList().size() == 0 && only == 0L )
00520     {
00521         for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00522         {
00523             char tmp[20];
00524             sprintf(tmp, "P_Cvsroot%d", nIndex);
00525
00526             CPStr pstr(tmp);
00527             Handle hdl = Get1NamedResource(kCVS_prefID, pstr);
00528             if( hdl == 0L )
00529                 continue;
00530
00531             CStr root((char*)*hdl);
00532             if( !root.empty() )
00533                 gOldCvsroots.Insert(root);
00534         }
00535     }
00536
00537     CloseResFile(FRef);
00538     UseResFile(oldRef);
00539 #endif /* TARGET_OS_MAC */
00540 #ifdef WIN32
00541     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00542     {
00543         CPersistentEntry & entry = *i;
00544         BYTE* ppData;
00545         UINT pBytes;
00546
00547         if( only && strcmp(only, entry.fUniqueName) != 0 )
00548             continue;
00549
00550         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, entry.fUniqueName, &ppData, &pBytes))
00551         {
00552             continue;
00553         }
00554
00555         found_one = true;
00556         entry.fValue->SetData(ppData, pBytes);
00557         entry.fValue->ResetTimeStamp();
00558
00559         delete ppData;
00560     }
00561 #endif /* WIN32 */
00562 #ifdef qUnix
00563     CStr home;
00564     bool error     = false;
00565
00566     home = gCvsPrefs.Home();
00567     if( !home.endsWith(kPathDelimiter) )
00568         home << kPathDelimiter;
00569
00570     home << ".gcvsrc";
00571
00572     FILE* out = fopen(home, "rb");
00573     if( out == 0L )
00574         return false;
00575
00576     int version;
00577     int numEntries;
00578     CStaticAllocT<char> alloc;
00579
00580     fread(&version, sizeof(int), 1, out);
00581     if( version != 1 )
00582     {
00583         cvs_err("Unexpected version %d in the file '%s'\n", version, (char*)home);
00584         error = true;
00585     } else {
00586         fread(&numEntries, sizeof(int), 1, out);
00587         if( numEntries < 0 )
00588         {
00589             cvs_err("Unexpected # %d in the file '%s'\n", numEntries, (char*)home);
00590             error = true;
00591         }
00592     }
00593
00594     /* something has gone wrong !!!! */
00595     if( error ) {
00596         fclose(out);
00597         return false;
00598     }
00599
00600     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00601     {
00602         CStr name;
00603         while( !feof(out) && !ferror(out) )
00604         {
00605             int c = getc(out);
00606             name << (char)c;
00607             if( c == '\0' )
00608                 break;
00609         }
00610
00611         if( feof(out) )
00612             cvs_err("Unexpected end of file in '%s'\n", (char*)home);
00613
00614         if( ferror(out) )
00615             cvs_err("Unexpected error %d in '%s'\n", errno, (char*)home);
00616
00617         if( feof(out) || ferror(out) ) {
00618             continue;
00619         }
00620
00621         CPersistentEntry& entry = *i;
00622         unsigned int size;
00623         fread(&size, sizeof(unsigned int), 1, out);
00624
00625         alloc.AdjustSize(size);
00626         fread((char*)alloc, 1, size, out);
00627         if( only && strcmp(only, entry.fUniqueName) != 0 )
00628             continue;
00629
00630         found_one = true;
00631         entry.fValue->SetData((char*)alloc, size);
00632         entry.fValue->ResetTimeStamp();
00633     }
00634
00635     if( ferror(out) )
00636         cvs_err("Error while reading '%s' (error %d)", (char*)home, errno);
00637
00638     fclose(out);
00639 #endif /* qUnix */
00640
00641     return found_one;
00642 }

bool CPersistent::NeedSave ( bool onlySettings = false ) [static]

Definition at line 657 of file Persistent.cpp.

References fAllEntries, CPersistent::CPersistentEntry::fClass, fTimeStamp, CPersistent::CPersistentEntry::fValue, and kAddSettings.

Referenced by CvsPrefs::save().

00658 {
00659     std::vector<CPersistentEntry>::const_iterator i;
00660     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00661     {
00662         const CPersistentEntry& entry = *i;
00663         if( onlySettings && (entry.fClass & kAddSettings) == 0 )
00664             continue;
00665
00666         if( entry.fValue->fTimeStamp != 0 )
00667             return true;
00668     }
00669
00670     return false;
00671 }

void CPersistent::Register | ( | CPersistent * | value,
 |  | const char * | uniqueName,
 |  | kClassPersistent | pclass
 | ) | [static, private]

Definition at line 119 of file Persistent.cpp.

References fAllEntries, CPersistent::CPersistentEntry::fClass, CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, NEW, and UAppConsole().

Referenced by CPersistent().

00120 {
00121     std::vector<CPersistentEntry>::const_iterator i;
00122     if( fAllEntries == 0L )
00123         fAllEntries = NEW std::vector<CPersistentEntry>;
00124
00125     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00126     {
00127         if(strcmp(uniqueName, (*i).fUniqueName) == 0)
00128         {
00129             UAppConsole("Error : duplicate persistent %s !\n", uniqueName);
00130         }
00131     }
00132
00133     CPersistentEntry newentry;
00134     newentry.fClass = pclass;
00135     newentry.fUniqueName = uniqueName;
00136     newentry.fValue = value;
00137
00138     fAllEntries->push_back(newentry);
00139 }

void CPersistent::ResetTimeStamp ( ) [inline]

Definition at line 101 of file Persistent.h.

References fTimeStamp.

Referenced by LoadAll(), and SaveAll().

00101 { fTimeStamp = 0; }

const URuntimeClass * CPersistent::rtCPersistent ( void ) [static]

Definition at line 102 of file Persistent.cpp.

void CPersistent::SaveAll ( void ) [static]

Definition at line 345 of file Persistent.cpp.

References CPStr, CStr, cvs_err(), err, fAllEntries, FSSpec, CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, GetData(), ResetTimeStamp(), and SizeOf().

Referenced by CvsPrefs::save().

00346 {
00347 #ifdef TARGET_OS_MAC
00348     short FRef, oldRef;
00349     OSErr err;
00350     FSSpec thePrefFile;
00351
00352     err = GetPreferencesFile(thePrefFile);
00353
00354     if( err != noErr )
00355     {
00356         cvs_err("Error while searching preference folder (error %d)!\n", err);
00357         return;
00358     }
00359
00360     oldRef = CurResFile();
00361
00362     FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00363     if( FRef < 0 )
00364     {
00365         ::FSpCreateResFile (&thePrefFile, 'mCVS', 'pref', smRoman);
00366         FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00367         if( FRef < 0 )
00368         {
00369             cvs_err("Error while saving preferences (error %d)!\n", ResError());
00370             return;
00371         }
00372     }
00373
00374     UseResFile (FRef);
00375     CPStr name;
00376
00377     std::vector<CPersistentEntry>::iterator i;
00378     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00379     {
00380         CPersistentEntry & entry = *i;
00381         int size = entry.fValue->SizeOf();
00382         if( size <= 0 )
00383             continue;
00384
00385         //short id = Unique1ID(kCVS_prefID);
00386         name = entry.fUniqueName;
00387
00388         Handle removing = Get1NamedResource(kCVS_prefID, name);
00389
00390         if( removing != nil )
00391         {
00392             RemoveResource(removing);
00393             Assert_(ResError() == noErr);
00394             DisposeHandle(removing);
00395         }
00396
00397         short theID;
00398         do
00399         {
00400             theID = Unique1ID(kCVS_prefID);
00401         }
00402         while( theID <= 127 );
00403
00404         Handle hdl = NewHandle(size);
00405         Assert_(hdl != 0L);
00406         HLock(hdl);
00407         BlockMove(entry.fValue->GetData(), *hdl, size);
00408         HUnlock(hdl);
00409         AddResource(hdl, kCVS_prefID, theID, name);
00410         Assert_(ResError() == noErr);
00411         UpdateResFile(FRef);
00412         Assert_(ResError() == noErr);
00413         ReleaseResource(hdl);
00414         Assert_(ResError() == noErr);
00415     }
00416
00417     UseResFile(oldRef);
00418     Assert_(ResError() == noErr);
00419     CloseResFile (FRef);
00420     Assert_(ResError() == noErr);
00421 #endif /* TARGET_OS_MAC */
00422 #ifdef WIN32
00423     std::vector<CPersistentEntry>::iterator i;
00424     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00425     {
00426         CPersistentEntry& entry = *i;
00427         unsigned int size = entry.fValue->SizeOf();
00428         if( size == 0 )
00429             continue;
00430
00431         if( !AfxGetApp()->WriteProfileBinary(PROFILE_NAME, entry.fUniqueName, (BYTE*)entry.fValue->GetData(), size) )
00432         {
00433             cvs_err("Error while saving preferences !\n");
00434             break;
00435         }
00436     }
00437 #endif /* WIN32 */
00438 #ifdef qUnix
00439     CStr home;
00440     home = gCvsPrefs.Home();
00441     if( !home.endsWith(kPathDelimiter) )
00442         home << kPathDelimiter;
00443
00444     home << ".gcvsrc";
00445     FILE* out = fopen(home, "wb");
00446     if( out == 0L )
00447     {
00448         cvs_err("Unable to open '%s' for writing (error %d)", (char*)home, errno);
00449         return;
00450     }
00451
00452     int version = 1;
00453     fwrite(&version, sizeof(int), 1, out);
00454     int numEntries = fAllEntries->size();
00455     fwrite(&numEntries, sizeof(int), 1, out);
00456     std::vector<CPersistentEntry>::iterator i;
00457     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00458     {
00459         CPersistentEntry& entry = *i;
00460         unsigned int size = entry.fValue->SizeOf();
00461
00462         fwrite(entry.fUniqueName, sizeof(char), strlen(entry.fUniqueName) + 1, out);
00463         fwrite(&size, sizeof(unsigned int), 1, out);
00464         fwrite(entry.fValue->GetData(), 1, size, out);
00465     }
00466
00467     if( ferror(out) )
00468         cvs_err("Error while writing '%s' (error %d)", (char*)home, errno);
00469
00470     fclose(out);
00471 #endif /* qUnix */
00472
00473     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00474     {
00475         CPersistentEntry& entry = *i;
00476         entry.fValue->ResetTimeStamp();
00477     }
00478 }

bool CPersistent::SaveAllSettings | ( | const char * | settingFileName,
 |  | const char * | forPath
 | ) | [static]

Definition at line 206 of file Persistent.cpp.

References cvs_err(), UStr::endsWith(), fAllEntries, CPersistent::CPersistentEntry::fClass, CPersistent::CPersistentEntry::fUniqueName, CPersistent::CPersistentEntry::fValue, UObject::IsKindOf(), kAddSettings, UStr::length(), simple_diff(), and URUNTIME_CLASS.

Referenced by SaveAsPersistentSettings(), and SavePersistentSettings().

00207 {
00208     UStr tmpSettingsFile(settingFileName);
00209     tmpSettingsFile << "__";
00210     FILE* fd = fopen(tmpSettingsFile, "w");
00211     if( fd == 0L )
00212     {
00213         cvs_err("Failed to open the setting file '%s' for writing (error %d)", (const char*)tmpSettingsFile, errno);
00214         return false;
00215     }
00216
00217     fprintf(fd, "VERSION=%d\n", 1);
00218
00219     UStr path(forPath);
00220     if( path.endsWith(kPathDelimiter) )
00221         path[path.length() - 1] = '\0';
00222
00223     fprintf(fd, "PATH=%s\n", (const char*)path);
00224     fprintf(fd, "AUTHENTICATION=%s\n", (const char*)Authen::kindToToken(gAuthen.kind()));
00225     fprintf(fd, "CVSROOT=%s\n", (const char*)gCvsPrefs);
00226
00227     std::vector<CPersistentEntry>::const_iterator i;
00228     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00229     {
00230         const CPersistentEntry& entry = *i;
00231         if( (entry.fClass & kAddSettings) == 0 )
00232             continue;
00233
00234         if( entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)) )
00235         {
00236             CPersistentBool* pbool = (CPersistentBool*)entry.fValue;
00237             bool state = *pbool;
00238             fprintf(fd, "%s=%s\n", entry.fUniqueName, state ? "true" : "false");
00239         }
00240         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)) )
00241         {
00242             CPersistentInt* pint = (CPersistentInt*)entry.fValue;
00243             int val = *pint;
00244             fprintf(fd, "%s=%d\n", entry.fUniqueName, val);
00245         }
00246         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(PCStr)) )
00247         {
00248             PCStr* pstr = (PCStr*)entry.fValue;
00249             const char* str = *pstr;
00250             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char*)(str == 0L ? "" : str));
00251         }
00252         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(PCPStr)) )
00253         {
00254             PCPStr* pstr = (PCPStr*)entry.fValue;
00255             const char* str = *pstr;
00256             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char*)(str == 0L ? "" : str));
00257         }
00258         else
00259         {
00260             cvs_err("Unknown persistent value '%s'\n", entry.fUniqueName);
00261         }
00262     }
00263
00264     fclose(fd);
00265
00266     if( simple_diff(tmpSettingsFile, settingFileName) == 0 )
00267     {
00268         if( unlink(tmpSettingsFile) != 0 && errno != ENOENT )
00269             cvs_err("Could not remove file '%s' (error %d)\n", (const char*)tmpSettingsFile, errno);
00270
00271         return false;
00272     }
00273
00274     if( unlink(settingFileName) != 0 && errno != ENOENT )
00275     {
00276         cvs_err("Could not remove file '%s' (error %d)\n", (const char*)settingFileName, errno);
00277         return false;
00278     }
00279
00280     if( rename(tmpSettingsFile, settingFileName) != 0 )
00281     {
00282         cvs_err("Could not rename file '%s' (error %d)\n", (const char*)tmpSettingsFile, errno);
00283         return false;
00284     }
00285
00286     return true;
00287 }

virtual void CPersistent::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [pure virtual]

Implemented in PCPStr, PCStr, TMPersistent< T >, TMString< T >, CPersistentT< T >, CMMenuString, CWinPlacement, TMString< UStr >, TMString< UPStr >, CPersistentT< int >, and CPersistentT< bool >.

Referenced by LoadAll().

virtual unsigned int CPersistent::SizeOf ( void ) const [pure virtual]

Implemented in PCPStr, PCStr, TMPersistent< T >, TMString< T >, CPersistentT< T >, CMMenuString, CWinPlacement, TMString< UStr >, TMString< UPStr >, CPersistentT< int >, and CPersistentT< bool >.

Referenced by SaveAll().

void CPersistent::TouchTimeStamp ( ) [inline]

Definition at line 103 of file Persistent.h.

References fTimeStamp.

Referenced by CPersistent(), CMMenuString::GetList(), CMMenuString::Insert(), TMString< T >::Insert(), CWinPlacement::operator=(), PCStr::operator=(), and TMString< T >::Remove().

00103 { fTimeStamp++; }

void CPersistent::UnRegister ( CPersistent * value ) [static, private]

Definition at line 141 of file Persistent.cpp.

References fAllEntries, and UAppConsole().

Referenced by ~CPersistent().

00142 {
00143     std::vector<CPersistentEntry>::iterator i;
00144     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00145     {
00146         if( value == (*i).fValue )
00147             break;
00148     }
00149
00150     if( i == fAllEntries->end() )
00151     {
00152         UAppConsole("Error : Unknown persistent value !\n");
00153         return;
00154     }
00155
00156     fAllEntries->erase(i);
00157     if( fAllEntries->size() == 0 )
00158     {
00159         delete fAllEntries;
00160         fAllEntries = 0L;
00161     }
00162 }

Member Data Documentation

const URuntimeClass CPersistent::classCPersistent [static, protected]

std::vector< CPersistent::CPersistentEntry > * CPersistent::fAllEntries = 0L [static, protected]

Definition at line 100 of file Persistent.cpp.

Referenced by Find(), LoadAll(), NeedSave(), Register(), SaveAll(), SaveAllSettings(), and UnRegister().

long CPersistent::fTimeStamp [protected]

Definition at line 114 of file Persistent.h.

Referenced by GetTimeStamp(), NeedSave(), ResetTimeStamp(), and TouchTimeStamp().

The documentation for this class was generated from the following files:
  • common/Persistent.h
  • common/Persistent.cpp
Generated on Fri Jan 31 12:18:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 95 of file Persistent.h.

Referenced by CPersistent::NeedSave(), CPersistent::Register(), and CPersistent::SaveAllSettings().

const char* CPersistent::CPersistentEntry::fUniqueName

Definition at line 93 of file Persistent.h.

Referenced by _loadPersistentSettings(), CPersistent::Find(), CPersistent::LoadAll(), CPersistent::Register(), CPersistent::SaveAll(), and CPersistent::SaveAllSettings().

CPersistent* CPersistent::CPersistentEntry::fValue

Definition at line 94 of file Persistent.h.

Referenced by _loadPersistentSettings(), CPersistent::LoadAll(), CPersistent::NeedSave(), CPersistent::Register(), CPersistent::SaveAll(), and CPersistent::SaveAllSettings().

The documentation for this struct was generated from the following file:
  • common/Persistent.h
Generated on Fri Jan 31 12:18:29 2003 for WinCvs Source by doxygen 1.3-rc2


CPersistentBool Class Reference

bool type persistant specialization More...

#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
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

Detailed Description

bool type persistant specialization

Definition at line 147 of file Persistent.h.

Constructor & Destructor Documentation

CPersistentBool::CPersistentBool | ( | const char * | uniqueName,
 |  | bool | defValue,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 151 of file Persistent.h.

00152                                             :
00153       CPersistentT<bool>(uniqueName, defValue, pclass)
00154     {
00155     }

virtual CPersistentBool::~CPersistentBool ( ) [inline, virtual]

Definition at line 157 of file Persistent.h.

00158     {
00159     }

Member Function Documentation

const URuntimeClass * CPersistentBool::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 104 of file Persistent.cpp.

const URuntimeClass * CPersistentBool::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 104 of file Persistent.cpp.

CPersistentBool::operator const bool & ( ) const [inline]

Definition at line 161 of file Persistent.h.

00165 : public CPersistentT<int>

bool& CPersistentBool::operator= ( const bool & val ) [inline]

Reimplemented from CPersistentT< bool >.

Definition at line 161 of file Persistent.h.

00165 : public CPersistentT<int>

bool CPersistentBool::operator== ( const bool & val ) const [inline]

Reimplemented from CPersistentT< bool >.

Definition at line 161 of file Persistent.h.

00165 : public CPersistentT<int>

const URuntimeClass * CPersistentBool::rtCPersistentBool ( void ) [static]

Definition at line 104 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 Fri Jan 31 12:18:30 2003 for WinCvs Source by doxygen 1.3-rc2


CPersistentInt Class Reference

int type persistant specialization More...

#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
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

Detailed Description

int type persistant specialization

Definition at line 165 of file Persistent.h.

Constructor & Destructor Documentation

CPersistentInt::CPersistentInt | ( | const char * | uniqueName,
 |  | int | defValue,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 169 of file Persistent.h.

00170                                             :
00171             CPersistentT<int>(uniqueName, defValue, pclass)
00172     {
00173     }

virtual CPersistentInt::~CPersistentInt ( ) [inline, virtual]

Definition at line 175 of file Persistent.h.

00176     {
00177     }

Member Function Documentation

const URuntimeClass * CPersistentInt::_GetBaseClass ( ) [static, protected]

Reimplemented from CPersistent.

Definition at line 103 of file Persistent.cpp.

const URuntimeClass * CPersistentInt::GetRuntimeClass ( ) const [virtual]

Reimplemented from CPersistent.

Definition at line 103 of file Persistent.cpp.

CPersistentInt::operator const int & ( ) const [inline]

Definition at line 179 of file Persistent.h.

int& CPersistentInt::operator= ( const int & val ) [inline]

Reimplemented from CPersistentT< int >.

Definition at line 179 of file Persistent.h.

bool CPersistentInt::operator== ( const int & val ) const [inline]

Reimplemented from CPersistentT< int >.

Definition at line 179 of file Persistent.h.

const URuntimeClass * CPersistentInt::rtCPersistentInt ( void ) [static]

Definition at line 103 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 Fri Jan 31 12:18:32 2003 for WinCvs Source by doxygen 1.3-rc2


TemplateCPersistentT< T > class Reference

CPersistentT< T > Class Template Reference

Template class for persistant values. More...

#include <Persistent.h>

Inheritance diagram for CPersistentT< T >:

[legend]
Collaboration diagram for CPersistentT< T >:

[legend]
List of all members.

Public Methods

CPersistentT (const char *uniqueName, T defValue, kClassPersistent pclass)
virtual | ~CPersistentT ()
operator const T & () 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

Detailed Description

template<class T>
class CPersistentT< T >

Template class for persistant values.

Definition at line 120 of file Persistent.h.

Constructor & Destructor Documentation

template<class T>
CPersistentT< T >::CPersistentT | ( | const char * | uniqueName,
 |  | T | defValue,
 |  | kClassPersistent | pclass
 | ) | [inline]

Definition at line 123 of file Persistent.h.

00123                                                                               : CPersistent(uniqueName, pclass)
00124     {
00125         fValue = fDefValue = defValue;
00126     }

template<class T>
virtual CPersistentT< T >::~CPersistentT ( ) [inline, virtual]

Definition at line 128 of file Persistent.h.

00129     {
00130     }

Member Function Documentation

template<class T>
virtual const void* CPersistentT< T >::GetData ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 135 of file Persistent.h.

00135 {return &fValue;}

template<class T>
CPersistentT< T >::operator const T & ( ) const [inline]

Definition at line 132 of file Persistent.h.

00134 {return sizeof(T);}

template<class T>
T& CPersistentT< T >::operator= ( const T & val ) [inline]

Reimplemented in CPersistentBool, and CPersistentInt.

Definition at line 132 of file Persistent.h.

00134 {return sizeof(T);}

template<class T>
bool CPersistentT< T >::operator== ( const T & val ) const [inline]

Reimplemented in CPersistentBool, and CPersistentInt.

Definition at line 132 of file Persistent.h.

00134 {return sizeof(T);}

template<class T>
virtual void CPersistentT< T >::SetData | ( | const void * | ptr,
 |  | unsigned int | size
 | ) | [inline, virtual]

Implements CPersistent.

Definition at line 136 of file Persistent.h.

00137     {
00138         if( size == sizeof(T) )
00139             memcpy(&fValue, ptr, size);
00140     }

template<class T>
virtual unsigned int CPersistentT< T >::SizeOf ( void ) const [inline, virtual]

Implements CPersistent.

Definition at line 134 of file Persistent.h.

00134 {return sizeof(T);}

Member Data Documentation

template<class T>
T CPersistentT< T >::fDefValue [protected]

Definition at line 143 of file Persistent.h.

Referenced by CPersistentT< bool >::CPersistentT().

template<class T>
T CPersistentT< T >::fValue [protected]

Definition at line 143 of file Persistent.h.

Referenced by CPersistentT< bool >::CPersistentT(), and CPersistentT< bool >::GetData().

The documentation for this class was generated from the following file:
  • common/Persistent.h
Generated on Fri Jan 31 12:18:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 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, and UPoint().

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().

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, and UPoint().

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 Fri Jan 31 12:18:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 946 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 946 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 Fri Jan 31 12:18:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:38 2003 for WinCvs Source by doxygen 1.3-rc2


CProgress Class Reference

Progress indicator wrapper class. More...

#include <ProgressDlg.h>

Collaboration diagram for CProgress:

[legend]
List of all members.

Public Methods

CProgress (bool interruptable, const char *title=0L, kProgressType progressType=kProgressBar)
virtual | ~CProgress ()
bool | HasAborted (void) const
void | SetProgress (int percent)
void | SetProgress (const char *text)

Private Methods

void | ForceAbort (void)

Private Attributes

bool | m_abort
CProgressDlg * m_dlg

Detailed Description

Progress indicator wrapper class.

Definition at line 46 of file ProgressDlg.h.

Constructor & Destructor Documentation

CProgress::CProgress | ( | bool | interruptable,
 |  | const char * | title = 0L,
 |  | kProgressType | progressType = kProgressBar
 | ) |

Definition at line 42 of file ProgressDlg.cpp.

References CProgressDlg::Create(), cvs_err(), and m_dlg.

00043     : m_abort(false)
00044 {
00045 #ifdef WIN32
00046     m_dlg = new CProgressDlg(m_abort, interruptable, title, progressType);
00047     if( !m_dlg || !m_dlg->Create() )
00048     {
00049         cvs_err("Failed to create Progress dialog\n");
00050
00051         delete m_dlg;
00052         m_dlg = 0L;
00053
00054         return;
00055     }
00056
00057     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00058 #endif /* WIN32 */
00059 }

CProgress::~CProgress ( ) [virtual]

Definition at line 61 of file ProgressDlg.cpp.

References m_dlg.

00062 {
00063 #ifdef WIN32
00064     if( m_dlg != 0L )
00065         m_dlg->DestroyWindow();
00066 #endif /* WIN32 */
00067 }

Member Function Documentation

void CProgress::ForceAbort ( void ) [private]

Force the progress indicator to abort

Note:
Normally the user aborts the operation, use this method in the exceptional cases only

Definition at line 107 of file ProgressDlg.cpp.

References m_dlg.

00108 {
00109 #ifdef WIN32
00110     if( m_dlg != 0L )
00111     {
00112         m_dlg->DestroyWindow();
00113     }
00114
00115     m_dlg = 0L;
00116 #endif /* WIN32 */
00117 }

bool CProgress::HasAborted ( void ) const [inline]

Check the value of the abort flag

Returns:
true if the operation was aborted, false otherwise

Definition at line 71 of file ProgressDlg.h.

Referenced by ImportReport::OnIdle(), and CGraphView::OnViewDelrev().

00071 { return m_abort; }

void CProgress::SetProgress ( const char * text )

Set the progress indicator

Parameters:
text Value, as a text, to be set

Definition at line 90 of file ProgressDlg.cpp.

References m_dlg, and CProgressDlg::SetProgress().

00091 {
00092 #ifdef WIN32
00093     if( m_dlg == 0L )
00094         return;
00095
00096     m_dlg->SetProgress(text);
00097
00098     if( m_abort )
00099         m_dlg = 0L;
00100 #endif /* WIN32 */
00101 }

void CProgress::SetProgress ( int percent )

Set the progress indicator

Parameters:
percent Value, as a percentage, to be set

Definition at line 73 of file ProgressDlg.cpp.

References m_dlg, and CProgressDlg::SetProgress().

Referenced by ImportReport::OnIdle(), and CGraphView::OnViewDelrev().

00074 {
00075 #ifdef WIN32
00076     if( m_dlg == 0L )
00077         return;
00078
00079     m_dlg->SetProgress(percent);
00080
00081     if( m_abort )
00082         m_dlg = 0L;
00083 #endif /* WIN32 */
00084 }

Member Data Documentation

bool CProgress::m_abort [private]

Flag indicating that the operation was cancelled by the user

Definition at line 55 of file ProgressDlg.h.

CProgressDlg* CProgress::m_dlg [private]

Progress dialog

Definition at line 58 of file ProgressDlg.h.

Referenced by CProgress(), ForceAbort(), SetProgress(), and ~CProgress().

The documentation for this class was generated from the following files:
  • common/ProgressDlg.h
  • common/ProgressDlg.cpp
Generated on Fri Jan 31 12:18:38 2003 for WinCvs Source by doxygen 1.3-rc2


CProgressDlg Class Reference

Progress dialog, should be dynamically allocated. More...

#include <ProgressDlg.h>

Inheritance diagram for CProgressDlg:

[legend]
Collaboration diagram for CProgressDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_PROGRESS }

Public Methods

CProgressDlg (bool &abort, bool interruptable, const char *title=NULL, kProgressType progressType=kProgressBar, CWnd *pParent=NULL)
BOOL | Create ()
void | SetProgress (int percent)
void | SetProgress (const char *text)

Public Attributes

CButton m_cancelButton
CProgressCtrl | m_progressCtrl
CStatic m_progressTextStatic

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual void | PostNcDestroy ()
PostNcDestroy virtual override, restore the active window and release the allocated memory.

virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, enable and show appropriate controls.

virtual void | OnOK ()
OnOK virtual override, set the abort flag to true and destroy the progress dialog window.

Static Private Methods

void | FlushDisplay (const CDialog *dlg, const bool &abort)

Private Attributes

bool & | m_abort
bool | m_interruptable
CString | m_title
kProgressType m_progressType
CWnd * m_pParent
HWND | m_hWndParent

Detailed Description

Progress dialog, should be dynamically allocated.

Definition at line 82 of file ProgressDlg.h.

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 92 of file ProgressDlg.h.

00092 { IDD = IDD_PROGRESS };

Constructor & Destructor Documentation

CProgressDlg::CProgressDlg | ( | bool & | abort,
 |  | bool | interruptable,
 |  | const char * | title = NULL,
 |  | kProgressType | progressType = kProgressBar,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 124 of file ProgressDlg.cpp.

00127     : m_abort(abort), m_interruptable(interruptable),
00128     m_title(title), m_progressType(progressType),
00129     m_pParent(pParent), m_hWndParent(0L),
00130     CDialog(CProgressDlg::IDD, pParent)
00131 {
00132     //{{AFX_DATA_INIT(CProgressDlg)
00133     //}}AFX_DATA_INIT
00134 }

Member Function Documentation

BOOL CProgressDlg::Create ( )

Create the progress dialog

Returns:
TRUE on success, FALSE otherwise

Definition at line 160 of file ProgressDlg.cpp.

References m_hWndParent.

Referenced by CProgress::CProgress().

00161 {
00162     m_hWndParent = PreModal();
00163     return CDialog::Create(CProgressDlg::IDD, m_pParent);
00164 }

void CProgressDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 137 of file ProgressDlg.cpp.

00138 {
00139     CDialog::DoDataExchange(pDX);
00140     //{{AFX_DATA_MAP(CProgressDlg)
00141     DDX_Control(pDX, IDOK, m_cancelButton);
00142     DDX_Control(pDX, IDC_PROGRESS, m_progressCtrl);
00143     DDX_Control(pDX, IDC_PROGRESS_TEXT, m_progressTextStatic);
00144     //}}AFX_DATA_MAP
00145 }

void CProgressDlg::FlushDisplay | ( | const CDialog * | dlg,
 |  | const bool & | abort
 | ) | [static, private]

Peek and pump application messages, flush the messages if the dialog was aborted

Parameters:
dlg | Dialog
abort | Abort flag

Definition at line 266 of file ProgressDlg.cpp.

References TRUE.

Referenced by SetProgress().

00267 {
00268     MSG msg;
00269     while( PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_NOREMOVE) == TRUE )
00270     {
00271         AfxGetApp()->PumpMessage();
00272     }
00273
00274     while( PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) == TRUE )
00275     {
00276         CPoint pt(LOWORD(msg.lParam), HIWORD(msg.lParam));
00277         ::ClientToScreen(msg.hwnd, &pt);
00278
00279         CWnd* wnd = CWnd::WindowFromPoint(pt);
00280
00281         if( !abort && wnd && dlg && (wnd->GetSafeHwnd() == dlg->GetSafeHwnd() || dlg->IsChild(wnd)) )
00282         {
00283             AfxGetApp()->PumpMessage();
00284         }
00285         else
00286         {
00287             PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE);
00288         }
00289     }
00290 }

BOOL CProgressDlg::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, enable and show appropriate controls.

Definition at line 167 of file ProgressDlg.cpp.

References kProgressBar, kProgressFile, kProgressText, m_cancelButton, m_progressCtrl, m_progressTextStatic, m_progressType, m_title, and TRUE.

00168 {
00169     CenterWindow();
00170
00171     CDialog::OnInitDialog();
00172
00173     // Enable/disable controls
00174     m_cancelButton.EnableWindow(m_interruptable);
00175
00176     // Show progress indicator
00177     switch( m_progressType )
00178     {
00179     default:
00180     case kProgressBar:
00181         m_progressTextStatic.ShowWindow(SW_HIDE);
00182         break;
00183     case kProgressText:
00184     case kProgressFile:
00185         m_progressCtrl.ShowWindow(SW_HIDE);
00186
00187         if( kProgressText == m_progressType )
00188         {
00189             m_progressTextStatic.ModifyStyle(0, SS_ENDELLIPSIS);
00190         }
00191         else if( kProgressFile == m_progressType )
00192         {
00193             m_progressTextStatic.ModifyStyle(0, SS_PATHELLIPSIS);
00194         }
00195
00196         break;
00197     }
00198
00199     // Set the window title
00200     if( !m_title.IsEmpty() )
00201     {
00202         SetWindowText(m_title);
00203     }
00204
00205     // Show the main window
00206     ShowWindow(SW_SHOW);
00207
00208     return TRUE;  // return TRUE unless you set the focus to a control
00209 }

void CProgressDlg::OnOK ( ) [protected, virtual]

OnOK virtual override, set the abort flag to true and destroy the progress dialog window.

Definition at line 212 of file ProgressDlg.cpp.

References m_abort.

00213 {
00214     m_abort = true;
00215     DestroyWindow();
00216 }

void CProgressDlg::PostNcDestroy ( ) [protected, virtual]

PostNcDestroy virtual override, restore the active window and release the allocated memory.

Definition at line 219 of file ProgressDlg.cpp.

References m_hWndParent, NULL, and TRUE.

00220 {
00221     MSG msg;
00222     if( m_hWndParent != NULL && ::GetActiveWindow() == m_hWnd )
00223     {
00224         ::SetActiveWindow(m_hWndParent);
00225     }
00226
00227     PostModal();
00228
00229     while( PeekMessage(&msg, m_hWnd, 0, 0, PM_NOREMOVE) == TRUE )
00230     {
00231         AfxGetApp()->PumpMessage();
00232     }
00233
00234     delete this;
00235 }

void CProgressDlg::SetProgress ( const char * text )

Set the progress text indicator

Parameters:
text Value to be set

Definition at line 253 of file ProgressDlg.cpp.

References FlushDisplay(), and m_progressTextStatic.

00254 {
00255     m_progressTextStatic.SetWindowText(text);
00256
00257     CProgressDlg::FlushDisplay(this, m_abort);
00258     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00259 }

void CProgressDlg::SetProgress ( int percent )

Set the progress bar indicator

Parameters:
percent Value to be set

Definition at line 241 of file ProgressDlg.cpp.

References FlushDisplay(), and m_progressCtrl.

Referenced by CProgress::SetProgress().

00242 {
00243     m_progressCtrl.SetPos(percent);
00244
00245     CProgressDlg::FlushDisplay(this, m_abort);
00246     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00247 }

Member Data Documentation

bool& CProgressDlg::m_abort [private]

Flag indicating that the operation was cancelled by the user

Definition at line 117 of file ProgressDlg.h.

Referenced by OnOK().

CButton CProgressDlg::m_cancelButton

Definition at line 93 of file ProgressDlg.h.

Referenced by OnInitDialog().

HWND CProgressDlg::m_hWndParent [private]

Parent window handle (activated after progress dialog closes

Definition at line 123 of file ProgressDlg.h.

Referenced by Create(), and PostNcDestroy().

bool CProgressDlg::m_interruptable [private]

Flag indicating that the operation can be stopped by pressing the Cancel button

Definition at line 118 of file ProgressDlg.h.

CWnd* CProgressDlg::m_pParent [private]

Parent dialog (used at the creation time

Definition at line 122 of file ProgressDlg.h.

CProgressCtrl CProgressDlg::m_progressCtrl

Definition at line 94 of file ProgressDlg.h.

Referenced by OnInitDialog(), and SetProgress().

CStatic CProgressDlg::m_progressTextStatic

Definition at line 95 of file ProgressDlg.h.

Referenced by OnInitDialog(), and SetProgress().

kProgressType CProgressDlg::m_progressType [private]

Progress dialog type

Definition at line 120 of file ProgressDlg.h.

Referenced by OnInitDialog().

CString CProgressDlg::m_title [private]

Progress dialog title

Definition at line 119 of file ProgressDlg.h.

Referenced by OnInitDialog().

The documentation for this class was generated from the following files:
  • common/ProgressDlg.h
  • common/ProgressDlg.cpp
Generated on Fri Jan 31 12:18:40 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 132 of file AskYesNo.cpp.

00133     {
00134         kOK = EV_COMMAND_START, // 0
00135         kCancel,                // 1
00136         kMsg                    // 2
00137     };

Constructor & Destructor Documentation

UPromptMessage::UPromptMessage | ( | const char * | msg,
 |  | const char * | title,
 |  | const char * | def,
 |  | const char * | cncl
 | ) | [inline]

Definition at line 124 of file AskYesNo.cpp.

References m_cncl, m_msg, m_ok, and m_title.

00125                           : UWidget(UEventGetWidID()), m_msg(msg), m_title(title),
00126         m_ok(def), m_cncl(cncl)
00127     {
00128     }

virtual UPromptMessage::~UPromptMessage ( ) [inline, virtual]

Definition at line 130 of file AskYesNo.cpp.

00130 {}

Member Function Documentation

const URuntimeClass * UPromptMessage::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 162 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 139 of file AskYesNo.cpp.

References UStr::c_str(), UCmdTarget::GetWidID(), m_cncl, m_msg, m_ok, m_title, and UEventSendMessage().

Referenced by UEditMessage::DoDataExchange().

00140     {
00141         if(fill)
00142         {
00143             UEventSendMessage(GetWidID(), EV_SETTEXT, kOK, (void *)m_ok.c_str());
00144             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)m_title.c_str());
00145             UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void *)m_cncl.c_str());
00146             UEventSendMessage(GetWidID(), EV_SETTEXT, kMsg, (void *)m_msg.c_str());
00147         }
00148         else
00149         {
00150         }
00151     }

const UMSGMAP * UPromptMessage::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 164 of file AskYesNo.cpp.

const UMSGMAP * UPromptMessage::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 164 of file AskYesNo.cpp.

const URuntimeClass * UPromptMessage::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 162 of file AskYesNo.cpp.

const UMSGMAP * UPromptMessage::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Reimplemented in UEditMessage.

Definition at line 164 of file AskYesNo.cpp.

int UPromptMessage::OnCancel ( void ) [protected]

Definition at line 175 of file AskYesNo.cpp.

References UWidget::EndModal().

00176 {
00177     EndModal(false);
00178     return 0;
00179 }

int UPromptMessage::OnOK ( void ) [protected]

Definition at line 169 of file AskYesNo.cpp.

References UWidget::EndModal().

00170 {
00171     EndModal(true);
00172     return 0;
00173 }

const URuntimeClass * UPromptMessage::rtUPromptMessage ( void ) [static]

Definition at line 162 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 164 of file AskYesNo.cpp.

const URuntimeClass UPromptMessage::classUPromptMessage [static, protected]

UStr UPromptMessage::m_cncl [protected]

Definition at line 154 of file AskYesNo.cpp.

Referenced by DoDataExchange(), and UPromptMessage().

UStr UPromptMessage::m_msg [protected]

Definition at line 154 of file AskYesNo.cpp.

Referenced by DoDataExchange(), and UPromptMessage().

UStr UPromptMessage::m_ok [protected]

Definition at line 154 of file AskYesNo.cpp.

Referenced by DoDataExchange(), and UPromptMessage().

UStr UPromptMessage::m_title [protected]

Definition at line 154 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 164 of file AskYesNo.cpp.

The documentation for this class was generated from the following file:
  • common/AskYesNo.cpp
Generated on Fri Jan 31 12:18:43 2003 for WinCvs Source by doxygen 1.3-rc2


CPropertyPage Class Reference

Inheritance diagram for CPropertyPage:

[legend]
The documentation for this class was generated from the following file:
  • common/RtagDlg.h
Generated on Fri Jan 31 12:18:43 2003 for WinCvs Source by doxygen 1.3-rc2


CPropertySheet Class Reference

Inheritance diagram for CPropertySheet:

[legend]
The documentation for this class was generated from the following file:
  • common/OptionalPropertySheet.h
Generated on Fri Jan 31 12:18:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 Fri Jan 31 12:18:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 38 of file PseudoDraw.cpp.

00038                                                    : m_pseudo(pseudo), m_cmdid(cmdid)
00039 {
00040 }

CPseudoDraw::~CPseudoDraw ( ) [virtual]

Definition at line 42 of file PseudoDraw.cpp.

00043 {
00044 }

Member Function Documentation

void CPseudoDraw::OnPaint ( ) [protected]

Definition at line 56 of file PseudoDraw.cpp.

References EV_CUSTOM_DRAW, UCmdTarget::GetWidID(), m_cmdid, m_pseudo, and UEventSendMessage().

00057 {
00058     CPaintDC dc(this); // device context for painting
00059
00060     if(m_pseudo != 0L)
00061         UEventSendMessage(m_pseudo->GetWidID(), EV_CUSTOM_DRAW, m_cmdid, &dc);
00062 }

Member Data Documentation

int CPseudoDraw::m_cmdid

Definition at line 44 of file PseudoDraw.h.

Referenced by OnPaint().

UWidget* CPseudoDraw::m_pseudo

Definition at line 43 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 Fri Jan 31 12:18:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 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 Fri Jan 31 12:18:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 m_texts, 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 m_texts, 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.

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.

The documentation for this class was generated from the following files:
  • rf/support/powerplant/UPseudoSupport.h
  • rf/support/powerplant/UPseudoSupport.cpp
Generated on Fri Jan 31 12:18:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 37 of file PseudoList.cpp.

00037                                          : m_wid(wid), m_cmd(cmd)
00038 {
00039 }

CPseudoList::~CPseudoList ( ) [virtual]

Definition at line 41 of file PseudoList.cpp.

00042 {
00043 }

Member Function Documentation

void CPseudoList::OnLButtonDblClk | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

Definition at line 55 of file PseudoList.cpp.

References UEventSendMessage(), and UMAKEINT.

00056 {
00057     UINT pFlags;
00058     int nItem = HitTest(point, &pFlags);
00059     if(nItem != -1)
00060     {
00061         CString s = GetItemText(nItem, 0);
00062
00063         UEventSendMessage(m_wid, EV_LIST_DBLCLICK, UMAKEINT(m_cmd, nItem),
00064             (void *)(const char *)s);
00065     }
00066
00067     CListCtrl::OnLButtonDblClk(nFlags, point);
00068 }

Member Data Documentation

int CPseudoList::m_cmd [protected]

Definition at line 56 of file pseudolist.h.

int CPseudoList::m_wid [protected]

Definition at line 56 of file pseudolist.h.

The documentation for this class was generated from the following files:
  • rf/support/mfc/pseudolist.h
  • rf/support/mfc/PseudoList.cpp
Generated on Fri Jan 31 12:18:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 Fri Jan 31 12:18:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 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(), 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 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 Fri Jan 31 12:18:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:53 2003 for WinCvs Source by doxygen 1.3-rc2


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, and m_disbitmaps.

Referenced by LoadXPMs(), and UWidget::OnSetState().

00202 {
00203     if(index < 0 || index > (int)m_bitmaps.size() || index > (int)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.

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 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().

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 Fri Jan 31 12:18:54 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by SetState().

00153 { return m_group; }

int CPseudoToggle::GetState ( void ) const [inline]

Definition at line 146 of file PseudoButton.h.

Referenced by UWidget::OnGetState(), and ToggleBtn().

00146 { return m_flag;}

bool CPseudoToggle::IsRadio ( void ) const [inline]

Definition at line 151 of file PseudoButton.h.

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.

00152 { m_group = group; }

void CPseudoToggle::SetRadio ( bool state ) [inline]

Definition at line 150 of file PseudoButton.h.

00150 { m_radio = state; }

void CPseudoToggle::SetState ( int state ) [virtual]

Definition at line 233 of file PseudoButton.cpp.

References GetGroup(), IsRadio(), m_flag, and m_group.

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(), and SetState().

CString CPseudoToggle::m_group [protected]

Definition at line 137 of file PseudoButton.h.

Referenced by SetState().

bool CPseudoToggle::m_radio [protected]

Definition at line 136 of file PseudoButton.h.

Referenced by CPseudoToggle().

The documentation for this class was generated from the following files:
  • rf/support/mfc/PseudoButton.h
  • rf/support/mfc/PseudoButton.cpp
Generated on Fri Jan 31 12:18:55 2003 for WinCvs Source by doxygen 1.3-rc2


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)

const unsigned char * | operator= (const unsigned char *newstr)
set to a new P String (0L is OK)

const UPStr & | operator= (const UPStr &newstr)
set according to another UPStr

const UPStr & | set (const char *buf, unsigned int len)
set from a buffer

operator const char * () const
as a C string

operator char * ()
as a C string

const char * | c_str () const
as a C string

operator const unsigned char * () const
as a P string

operator unsigned char * ()
as a P string

const unsigned char * | p_str () const
as a P string

UPStr & | operator<< (const char *addToStr)
concatenate

UPStr & | operator<< (char addToStr)
concatenate

UPStr & | operator<< (int addToStr)
concatenate

bool | endsWith (char c) const
const UPStr & | replace (char which, char bywhich)
replace a character

Protected Methods

void | flush (void)

Protected Attributes

char * | str
the String

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 Fri Jan 31 12:18:57 2003 for WinCvs Source by doxygen 1.3-rc2


TemplatePyAutoObject< T > class Reference

PyAutoObject< T > Class Template Reference

#include <PythonContainer.h>

Collaboration diagram for PyAutoObject< T >:

[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 102 of file PythonContainer.h.

References PyAutoObject< T >::m_o, and NULL.

00102                           : m_o(NULL)
00103     {
00104     }

template<class T>
PyAutoObject< T >::PyAutoObject ( T * o ) [inline]

Definition at line 106 of file PythonContainer.h.

References PyAutoObject< T >::m_o, and PyAutoObject< T >::Ref().

00106                               : m_o(o)
00107     {
00108         Ref();
00109     }

template<class T>
PyAutoObject< T >::PyAutoObject ( PyObject * o ) [inline]

Definition at line 111 of file PythonContainer.h.

References PyAutoObject< T >::m_o, and PyAutoObject< T >::Ref().

00111                                      : m_o((T *)o)
00112     {
00113         Ref();
00114     }

template<class T>
PyAutoObject< T >::PyAutoObject ( PyAutoObject< T > & obj ) [inline]

Definition at line 116 of file PythonContainer.h.

References PyAutoObject< T >::CopyReturn(), and PyAutoObject< T >::m_o.

00116                                             : m_o((T *)obj.CopyReturn())
00117     {
00118     }

template<class T>
PyAutoObject< T >::~PyAutoObject ( ) [inline]

Definition at line 122 of file PythonContainer.h.

References PyAutoObject< T >::UnRef().

00123     {
00124         UnRef();
00125     }

Member Function Documentation

template<class T>
PyObject* PyAutoObject< T >::CopyReturn ( void ) [inline]

Definition at line 150 of file PythonContainer.h.

References PyAutoObject< T >::m_o, and PyAutoObject< T >::Ref().

Referenced by PyMenuMgr::AddPulldown(), PyPersistent::Create(), PyCmdUI::Create(), PyMenuMgr::Create(), PyColorConsole::Create(), PyCvsEntry::Create(), cvsgui_GetCvsEntries(), cvsgui_GetSelection(), cvsgui_GetTopMacroAdminMenu(), cvsgui_GetTopMacroSelectionMenu(), PyAutoObject< T >::operator=(), and PyAutoObject< T >::PyAutoObject().

00151     {
00152         Ref();
00153         return (PyObject *)m_o;
00154     }

template<class T>
bool PyAutoObject< T >::IsValid ( void ) [inline]

Definition at line 156 of file PythonContainer.h.

References PyAutoObject< T >::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().

00157     {
00158         return m_o != 0L;
00159     }

template<class T>
PyAutoObject< T >::operator T * ( void ) const [inline]

Definition at line 120 of file PythonContainer.h.

References PyAutoObject< T >::m_o.

00120 { return m_o; }

template<class T>
T* PyAutoObject< T >::operator-> ( void ) [inline]

Definition at line 161 of file PythonContainer.h.

References PyAutoObject< T >::m_o.

00162     {
00163         return m_o;
00164     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( PyAutoObject< T > & obj ) [inline]

Definition at line 143 of file PythonContainer.h.

References PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::m_o, and PyAutoObject< T >::UnRef().

00144     {
00145         UnRef();
00146         m_o = (T *)obj.CopyReturn();
00147         return *this;
00148     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( PyObject * o ) [inline]

Definition at line 135 of file PythonContainer.h.

References PyAutoObject< T >::m_o, PyAutoObject< T >::Ref(), and PyAutoObject< T >::UnRef().

00136     {
00137         UnRef();
00138         m_o = (T *)o;
00139         Ref();
00140         return *this;
00141     }

template<class T>
PyAutoObject& PyAutoObject< T >::operator= ( T * o ) [inline]

Definition at line 127 of file PythonContainer.h.

References PyAutoObject< T >::m_o, PyAutoObject< T >::Ref(), and PyAutoObject< T >::UnRef().

00128     {
00129         UnRef();
00130         m_o = o;
00131         Ref();
00132         return *this;
00133     }

template<class T>
void PyAutoObject< T >::Ref ( void ) [inline, protected]

Definition at line 167 of file PythonContainer.h.

Referenced by PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::operator=(), and PyAutoObject< T >::PyAutoObject().

00168     {
00169         if(m_o)
00170             Py_INCREF(m_o);
00171     }

template<class T>
void PyAutoObject< T >::UnRef ( void ) [inline, protected]

Definition at line 173 of file PythonContainer.h.

References PyAutoObject< T >::m_o, and NULL.

Referenced by PyAutoObject< T >::operator=(), and PyAutoObject< T >::~PyAutoObject().

00174     {
00175         if(m_o)
00176         {
00177             Py_DECREF(m_o);
00178             m_o = NULL;
00179         }
00180     }

Member Data Documentation

template<class T>
T* PyAutoObject< T >::m_o [protected]

Definition at line 182 of file PythonContainer.h.

Referenced by PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::IsValid(), PyAutoObject< T >::operator T *(), PyAutoObject< T >::operator->(), PyAutoObject< T >::operator=(), PyAutoObject< T >::PyAutoObject(), and PyAutoObject< T >::UnRef().

The documentation for this class was generated from the following file:
  • common/PythonContainer.h
Generated on Fri Jan 31 12:18:58 2003 for WinCvs Source by doxygen 1.3-rc2


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.

00100 :

PyObject* PyCmdUI::_SetCheck | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 98 of file PythonImpl.h.

00100 :

PyObject* PyCmdUI::_SetText | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 99 of file PythonImpl.h.

00100 :

PyObject * PyCmdUI::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 335 of file PythonImpl.cpp.

References PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::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().

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().

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().

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 Fri Jan 31 12:19:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:00 2003 for WinCvs Source by doxygen 1.3-rc2


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.

00056 :

PyObject * PyColorConsole::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 124 of file PythonImpl.cpp.

References PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::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 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().

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 Fri Jan 31 12:19:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 82 of file PythonContainer.h.

00082 {}

virtual PyContainer::~PyContainer ( ) [inline, virtual]

Definition at line 83 of file PythonContainer.h.

00083 {}

Member Function Documentation

PyObject* PyContainer::False ( ) [inline, static]

Definition at line 89 of file PythonContainer.h.

References GetPyFalse().

Referenced by cvsgui_PromptMessage(), and PyCvsEntry::GetAttr().

00089 { Py_INCREF(GetPyFalse()); return GetPyFalse(); }

virtual PyObject* PyContainer::GetAttr ( char * name ) [inline, virtual]

Reimplemented in PyCvsEntry.

Definition at line 85 of file PythonContainer.h.

References NULL.

00085 { return NULL; }

void PyContainer::RegisterValue | ( | PyObject * | d,
 |  | char * | name,
 |  | int | value
 | ) | [static]

Definition at line 96 of file PythonContainer.cpp.

References NULL, 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 88 of file PythonContainer.h.

References GetPyTrue().

Referenced by cvsgui_PromptMessage(), and PyCvsEntry::GetAttr().

00088 { Py_INCREF(GetPyTrue()); return GetPyTrue(); }

PyObject* PyContainer::Void ( ) [inline, static]

Definition at line 90 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().

00090 { Py_INCREF(GetPyNone()); return GetPyNone(); }

The documentation for this class was generated from the following files:
  • common/PythonContainer.h
  • common/PythonContainer.cpp
Generated on Fri Jan 31 12:19:03 2003 for WinCvs Source by doxygen 1.3-rc2


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)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

Public Attributes

CBuffer m_out
CBuffer m_err

Constructor & Destructor Documentation

CPyCvsConsole::CPyCvsConsole ( ) [inline]

Definition at line 518 of file PythonGlue.cpp.

00518 {}

virtual CPyCvsConsole::~CPyCvsConsole ( ) [inline, virtual]

Definition at line 519 of file PythonGlue.cpp.

00519 {}

Member Function Documentation

virtual long CPyCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 527 of file PythonGlue.cpp.

References CBuffer::append(), and m_err.

00528     {
00529         m_err.append(txt, len);
00530         return len;
00531     }

virtual long CPyCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 521 of file PythonGlue.cpp.

References CBuffer::append(), and m_out.

00522     {
00523         m_out.append(txt, len);
00524         return len;
00525     }

Member Data Documentation

CBuffer CPyCvsConsole::m_err

Definition at line 534 of file PythonGlue.cpp.

Referenced by cvs_err(), and cvsgui_RunCvs().

CBuffer CPyCvsConsole::m_out

Definition at line 533 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 Fri Jan 31 12:19:04 2003 for WinCvs Source by doxygen 1.3-rc2


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< T >::CopyReturn(), PyAutoObject< T >::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 Fri Jan 31 12:19:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:06 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

00080 :

PyObject* PyMenuMgr::_AddPulldown | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 72 of file PythonImpl.h.

00080 :

PyObject* PyMenuMgr::_AddSeparator | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 75 of file PythonImpl.h.

00080 :

PyObject* PyMenuMgr::_AddToggle | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 73 of file PythonImpl.h.

00080 :

PyObject* PyMenuMgr::_Count | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 78 of file PythonImpl.h.

00080 :

PyObject* PyMenuMgr::_Delete | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 76 of file PythonImpl.h.

00080 :

PyObject* PyMenuMgr::_DeleteByCmd | ( | obj_t * | self,
 |  | PyObject * | args
 | ) | [inline, static, protected]

Definition at line 77 of file PythonImpl.h.

00080 :

PyObject * PyMenuMgr::AddButton ( PyObject * args )

Definition at line 266 of file PythonImpl.cpp.

References NULL, PyArg_ParseTuple, UMenuAddButton(), and PyContainer::Void().

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< T >::CopyReturn(), PyAutoObject< T >::IsValid(), New(), NULL, PyArg_ParseTuple, PyMenuMgr(), and UMenuAddPulldown().

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 NULL, PyArg_ParseTuple, UMenuAddSeparator(), and PyContainer::Void().

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 NULL, PyArg_ParseTuple, UMenuAddToggle(), and PyContainer::Void().

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 NULL, PyArg_ParseTuple, PyInt_FromLong, and UMenuCount().

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< T >::CopyReturn(), PyAutoObject< T >::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 NULL, PyArg_ParseTuple, UMenuDelete(), and PyContainer::Void().

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 NULL, PyArg_ParseTuple, UMenuDeleteByCmd(), and PyContainer::Void().

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 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 Fri Jan 31 12:19:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

00118 :

PyObject * PyPersistent::Create | ( | PyObject * | selfptr,
 |  | PyObject * | args
 | ) | [static]

Definition at line 407 of file PythonImpl.cpp.

References PyAutoObject< T >::CopyReturn(), PyAutoObject< T >::IsValid(), CPersistent::LoadAll(), 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         CPersistent::LoadAll(uniqueName);
00426     }
00427     CATCH_ALL(e)
00428     {
00429         PyHandleCvsguiError(e);
00430         return NULL;
00431     }
00432     END_CATCH_ALL
00433
00434     return self.CopyReturn();
00435 }

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 454 of file PythonImpl.cpp.

References NULL, PyArg_ParseTuple, and PyString_FromString.

00455 {
00456     if (!PyArg_ParseTuple(args, ""))
00457         return NULL;
00458
00459     return PyString_FromString(m_cstr);
00460 }

void PyPersistent::InitValues ( PyObject * d ) [static]

Definition at line 437 of file PythonImpl.cpp.

00438 {
00439 }

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 441 of file PythonImpl.cpp.

References m_cstr, NULL, PyArg_ParseTuple, and PyContainer::Void().

00442 {
00443     char *s;
00444
00445     if (!PyArg_ParseTuple(args, "s", &s))
00446         return NULL;
00447
00448     m_cstr = s;
00449     gCvsPrefs.save();
00450
00451     return Void();
00452 }

Member Data Documentation

PCStr PyPersistent::m_cstr [protected]

Definition at line 129 of file PythonImpl.h.

Referenced by 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 Fri Jan 31 12:19:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:14 2003 for WinCvs Source by doxygen 1.3-rc2


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, and m_type.

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 69 of file PythonContainer.h.

Referenced by RegisterAllObjects().

const char* PyRegistry::m_doc [protected]

Definition at line 70 of file PythonContainer.h.

Referenced by RegisterAllObjects().

PyRegistry* PyRegistry::m_next [protected]

Definition at line 67 of file PythonContainer.h.

Referenced by CallInitValues(), PyRegistry(), and RegisterAllObjects().

PyTypeObject PyRegistry::m_type

Definition at line 57 of file PythonContainer.h.

Referenced by PyRegistry(), and RegisterAllObjects().

PyRegistry_InitValues PyRegistry::m_v [protected]

Definition at line 68 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 Fri Jan 31 12:19:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 949 of file PythonGlue.cpp.

References cvs_err(), fInterp, InitializeInterp(), IsAvail(), m_mainInterpreter, NULL, and Py_NewInterpreter.

00950 {
00951     fInterp = 0L;
00952
00953 #if USE_PYTHON
00954     if(!CPython_Interp::IsAvail())
00955     {
00956         cvs_err("Python is not available !\n");
00957         return;
00958     }
00959
00960     if(mainInterp)
00961     {
00962         fInterp = m_mainInterpreter;
00963         gCvsPrefs.SetTclFileRunning(true);
00964         return;
00965     }
00966
00967     {
00968         CPyThreadState lock(0L);
00969
00970         fInterp = Py_NewInterpreter();
00971         if(fInterp == NULL)
00972             return;
00973     }
00974
00975     InitializeInterp(fInterp);
00976     gCvsPrefs.SetTclFileRunning(true);
00977 #endif
00978 }

CPython_Interp::~CPython_Interp ( )

Definition at line 980 of file PythonGlue.cpp.

References fInterp, m_mainInterpreter, and Py_EndInterpreter.

00981 {
00982 #if USE_PYTHON
00983     if(fInterp != 0L)
00984     {
00985         gCvsPrefs.SetTclFileRunning(false);
00986
00987         if(fInterp != m_mainInterpreter)
00988         {
00989             CPyThreadState lock(fInterp);
00990
00991             Py_EndInterpreter(fInterp);
00992         }
00993     }
00994 #endif
00995 }

Member Function Documentation

void CPython_Interp::ClosePythonSupport ( void ) [static]

Definition at line 1192 of file PythonGlue.cpp.

References IsAvail(), m_mainInterpreter, Py_Finalize, PyInvalUICache(), and PyThreadState_Swap.

Referenced by CWincvsView::~CWincvsView().

01193 {
01194 #if USE_PYTHON
01195     if(!CPython_Interp::IsAvail())
01196         return;
01197
01198     PyThreadState_Swap(m_mainInterpreter);
01199 //  PyEval_ReleaseLock();
01200
01201     PyInvalUICache();
01202
01203     Py_Finalize();
01204     m_mainInterpreter = 0L;
01205 #endif
01206 }

int CPython_Interp::DoFile ( const char * file )

Definition at line 1127 of file PythonGlue.cpp.

References fInterp, and PyRun_SimpleFile.

01128 {
01129 #if USE_PYTHON
01130     if(fInterp == 0L)
01131         return -1;
01132
01133     CPyThreadState lock(fInterp);
01134
01135     FILE *f = fopen(file, "r");
01136     if(f)
01137     {
01138         PyRun_SimpleFile(f, (char *)file);
01139         fclose(f);
01140     }
01141
01142     return 0;
01143 #else
01144     return -1;
01145 #endif
01146 }

int CPython_Interp::DoScript ( const char * script )

Definition at line 1092 of file PythonGlue.cpp.

References fInterp, and PyRun_SimpleString.

Referenced by DoScriptVar(), and CWincvsView::OnKeyDown().

01093 {
01094 #if USE_PYTHON
01095     if(fInterp == 0L)
01096         return -1;
01097
01098     CPyThreadState lock(fInterp);
01099
01100     PyRun_SimpleString((char *)script);
01101
01102     return 0;
01103 #else
01104     return -1;
01105 #endif
01106 }

int CPython_Interp::DoScriptVar | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 1108 of file PythonGlue.cpp.

References DoScript(), and fInterp.

Referenced by PyDoCmdUI(), PyDoPython(), and PyMacrosReloadAll().

01109 {
01110 #if USE_PYTHON
01111     if(fInterp == 0L)
01112         return -1;
01113
01114     va_list args;
01115     char script[1024] = {'\0'};
01116
01117     va_start (args, format);
01118     vsprintf (script, format, args);
01119     va_end (args);
01120
01121     return DoScript(script);
01122 #else
01123     return -1;
01124 #endif
01125 }

void CPython_Interp::InitPythonSupport ( void ) [static]

Definition at line 1154 of file PythonGlue.cpp.

References InitializeInterp(), IsAvail(), m_mainInterpreter, Py_Initialize, Py_SetProgramName, PyEval_InitThreads, and PyThreadState_Swap.

Referenced by CWincvsApp::InitInstance().

01155 {
01156 #if USE_PYTHON
01157     if(!CPython_Interp::IsAvail())
01158         return;
01159
01160 #ifdef WIN32
01161     Py_SetProgramName("wincvs");
01162     Py_Initialize();
01163 #elif TARGET_RT_MAC_CFM
01164     console_output_state = 1;
01165
01166     PyMac_SetConsoleHandler(PyMac_DummyReadHandler, PyMac_DummyWriteHandler,
01167         PyMac_DummyWriteHandler);
01168
01169     PyMacSchedParams scp;
01170
01171     PyMac_GetSchedParams(&scp);
01172     scp.process_events = 0;
01173     PyMac_SetSchedParams(&scp);
01174
01175     Py_SetProgramName("maccvs");
01176     PyMac_Initialize();
01177 #elif TARGET_RT_MAC_MACHO
01178     Py_SetProgramName("maccvsX");
01179     Py_Initialize();
01180 #else
01181     Py_SetProgramName("gcvs");
01182     Py_Initialize();
01183 #endif
01184
01185     PyEval_InitThreads();
01186     m_mainInterpreter = PyThreadState_Swap(NULL);
01187
01188     InitializeInterp(m_mainInterpreter);
01189 #endif
01190 }

bool CPython_Interp::IsAvail ( void ) [static]

Definition at line 997 of file PythonGlue.cpp.

References CompatConnectID, CompatLoadLibrary(), PyThreadState_Swap, and WarnNoPython().

Referenced by ClosePythonSupport(), CPython_Interp(), CWincvsApp::InitInstance(), InitPythonSupport(), and CWincvsView::OnKeyDown().

00998 {
00999 #if USE_PYTHON
01000 #   if TARGET_RT_MAC_CFM
01001     return PyThreadState_Swap != 0L;
01002 #   elif (defined(WIN32) && !qCvsDebug) || TARGET_RT_MAC_MACHO
01003     static bool firstTime = true;
01004     static bool pyAvail = false;
01005     if(firstTime)
01006     {
01007 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01008         CompatConnectID connID;
01009 #   endif
01010
01011 #   ifdef WIN32
01012         if(!pyAvail)
01013             pyAvail = CompatLoadLibrary(&connID, "python21.dll") != 0 ||
01014                 CompatLoadLibrary(&connID, "python22.dll") != 0;
01015 #   endif
01016
01017 #   if TARGET_RT_MAC_MACHO
01018         pyAvail = CompatLoadLibrary(&connID, "/Library/Frameworks/Python.framework") ||
01019             CompatLoadLibrary(&connID, "/System/Library/Frameworks/Python.framework");
01020 #   endif
01021
01022 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01023 #   define LOAD_CODEFRAG(name) \
01024         if(pyAvail) \
01025             pyAvail = (*(void **)&name##_glue = \
01026                 _CompatCallLibrary(connID, #name)) != 0L
01027 #   endif
01028 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01029         LOAD_CODEFRAG(PyThreadState_Swap);
01030         LOAD_CODEFRAG(PyDict_SetItemString);
01031         LOAD_CODEFRAG(PyErr_Clear);
01032         LOAD_CODEFRAG(PyInt_FromLong);
01033         LOAD_CODEFRAG(PyErr_SetString);
01034         LOAD_CODEFRAG(PyArg_ParseTuple);
01035         LOAD_CODEFRAG(PyTuple_New);
01036         LOAD_CODEFRAG(Py_BuildValue);
01037         LOAD_CODEFRAG(PyFile_AsFile);
01038         LOAD_CODEFRAG(PyString_AsString);
01039         LOAD_CODEFRAG(PyTuple_Size);
01040         LOAD_CODEFRAG(PyRun_SimpleString);
01041         LOAD_CODEFRAG(PyRun_SimpleFile);
01042         LOAD_CODEFRAG(Py_SetProgramName);
01043         LOAD_CODEFRAG(Py_Initialize);
01044         LOAD_CODEFRAG(Py_Finalize);
01045         LOAD_CODEFRAG(Py_IsInitialized);
01046         LOAD_CODEFRAG(Py_NewInterpreter);
01047         LOAD_CODEFRAG(Py_EndInterpreter);
01048         LOAD_CODEFRAG(PyString_FromString);
01049         LOAD_CODEFRAG(PyErr_NewException);
01050         LOAD_CODEFRAG(PyModule_GetDict);
01051         LOAD_CODEFRAG(Py_InitModule4);
01052         LOAD_CODEFRAG(PyEval_InitThreads);
01053         LOAD_CODEFRAG(Py_FindMethod);
01054         LOAD_CODEFRAG(_PyObject_New);
01055 #   if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3
01056         LOAD_CODEFRAG(_PyObject_Del);
01057 #   else
01058         LOAD_CODEFRAG(PyObject_Free);
01059 #   endif
01060         LOAD_CODEFRAG(PySys_SetPath);
01061         LOAD_CODEFRAG(Py_GetPath);
01062
01063         LOAD_CODEFRAG(PyType_Type);
01064         LOAD_CODEFRAG(PyFile_Type);
01065         LOAD_CODEFRAG(PyString_Type);
01066         LOAD_CODEFRAG(PyTuple_Type);
01067         LOAD_CODEFRAG(PyInt_Type);
01068         LOAD_CODEFRAG(_Py_NoneStruct);
01069         LOAD_CODEFRAG(_Py_ZeroStruct);
01070         LOAD_CODEFRAG(_Py_TrueStruct);
01071
01072 #       ifdef WIN32
01073         if(!pyAvail)
01074         {
01075             WarnNoPython();
01076         }
01077 #       endif
01078 #   endif /* WIN32 */
01079
01080         firstTime = false;
01081     }
01082
01083     return pyAvail;
01084 #   else
01085     return true;
01086 #   endif
01087 #else // !USE_PYTHON
01088     return false;
01089 #endif // !USE_PYTHON
01090 }

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 90 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 Fri Jan 31 12:19:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 98 of file PythonGlue.cpp.

References m_p, and PyThreadState_Swap.

00098                                      : m_p(p)
00099     {
00100         m_p = PyThreadState_Swap(p);
00101     }

CPyThreadState::~CPyThreadState ( ) [inline]

Definition at line 102 of file PythonGlue.cpp.

References PyThreadState_Swap.

00103     {
00104         PyThreadState_Swap(m_p);
00105     }

Member Data Documentation

PyThreadState* CPyThreadState::m_p [protected]

Definition at line 107 of file PythonGlue.cpp.

Referenced by CPyThreadState().

The documentation for this class was generated from the following file:
  • common/PythonGlue.cpp
Generated on Fri Jan 31 12:19:16 2003 for WinCvs Source by doxygen 1.3-rc2


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.

Referenced by CWinLogData::Update(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogHeaderData::UpdateSelf(), and CWinLogRevData::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.

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.

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(), and CWinLogData::Update().

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 Fri Jan 31 12:19:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 951 of file umain.h.

Referenced by EqualRect(), URect::Height(), InflateRect(), IntersectRect(), URect::IsRectEmpty(), IsRectEmpty(), URect::IsRectNull(), OffsetRect(), UWidget::OnGetLoc(), UWidget::OnSetLoc(), PtInRect(), SetRect(), SetRectEmpty(), UDC::TextOutClipped(), UnionRect(), URect::URect(), and TPseudoWinAdorner::ViewChangedFrame().

int URECT::left

Definition at line 951 of file umain.h.

Referenced by EqualRect(), InflateRect(), IntersectRect(), URect::IsRectEmpty(), IsRectEmpty(), URect::IsRectNull(), OffsetRect(), UWidget::OnGetLoc(), UWidget::OnSetLoc(), PtInRect(), UDC::Rectangle(), UDC::RoundRect(), SetRect(), SetRectEmpty(), UDC::TextOutClipped(), UnionRect(), CWinLogRevData::UpdateSelf(), URect::URect(), TPseudoWinAdorner::ViewChangedFrame(), and URect::Width().

int URECT::right

Definition at line 951 of file umain.h.

Referenced by EqualRect(), InflateRect(), IntersectRect(), URect::IsRectEmpty(), IsRectEmpty(), URect::IsRectNull(), OffsetRect(), UWidget::OnGetLoc(), UWidget::OnSetLoc(), PtInRect(), SetRect(), SetRectEmpty(), UnionRect(), URect::URect(), TPseudoWinAdorner::ViewChangedFrame(), and URect::Width().

int URECT::top

Definition at line 951 of file umain.h.

Referenced by EqualRect(), URect::Height(), InflateRect(), IntersectRect(), URect::IsRectEmpty(), IsRectEmpty(), URect::IsRectNull(), OffsetRect(), UWidget::OnGetLoc(), UWidget::OnSetLoc(), PtInRect(), UDC::Rectangle(), UDC::RoundRect(), SetRect(), SetRectEmpty(), UnionRect(), URect::URect(), and TPseudoWinAdorner::ViewChangedFrame().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:19:19 2003 for WinCvs Source by doxygen 1.3-rc2


CRectTracker Class Reference

Inheritance diagram for CRectTracker:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/GraphView.h
Generated on Fri Jan 31 12:19:20 2003 for WinCvs Source by doxygen 1.3-rc2


CRecursionLock Class Reference

Class to prevent the recursive calls. More...

#include <BrowseFileView.h>

Collaboration diagram for CRecursionLock:

[legend]
List of all members.

Public Methods

CRecursionLock (bool &semaphore)
virtual | ~CRecursionLock ()

Private Attributes

bool & | m_semaphore

Detailed Description

Class to prevent the recursive calls.

Definition at line 73 of file BrowseFileView.h.

Constructor & Destructor Documentation

CRecursionLock::CRecursionLock ( bool & semaphore )

Definition at line 85 of file BrowseFileView.cpp.

References m_semaphore.

00086     : m_semaphore(semaphore)
00087 {
00088     m_semaphore = true;
00089 }

CRecursionLock::~CRecursionLock ( ) [virtual]

Definition at line 91 of file BrowseFileView.cpp.

References m_semaphore.

00092 {
00093     m_semaphore = false;
00094 }

Member Data Documentation

bool& CRecursionLock::m_semaphore [private]

Definition at line 82 of file BrowseFileView.h.

Referenced by CRecursionLock(), and ~CRecursionLock().

The documentation for this class was generated from the following files:
  • WinCvs/BrowseFileView.h
  • WinCvs/BrowseFileView.cpp
Generated on Fri Jan 31 12:19:20 2003 for WinCvs Source by doxygen 1.3-rc2


CRelease_MAIN Class Reference

#include <ReleaseDlg.h>

Inheritance diagram for CRelease_MAIN:

[legend]
Collaboration diagram for CRelease_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_RELEASE_MAIN }

Public Methods

CRelease_MAIN (const char *dir)
~CRelease_MAIN ()
kReleaseDelType | GetRemoveDirectoryOption () const

Public Attributes

CButton m_delDirCheck
CButton m_delCvsInfoCheck
CButton m_delAllCheck
CString | m_dir

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDelall ()
BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

afx_msg void | OnDelcvsinfo ()
BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

afx_msg void | OnDeldir ()
BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

Private Attributes

kReleaseDelType m_removeDirectoryOption

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 61 of file ReleaseDlg.h.

00061 { IDD = IDD_RELEASE_MAIN };

Constructor & Destructor Documentation

CRelease_MAIN::CRelease_MAIN ( const char * dir )

Definition at line 49 of file ReleaseDlg.cpp.

References kReleaseNoDel, m_dir, and m_removeDirectoryOption.

00050     : CPropertyPage(CRelease_MAIN::IDD)
00051 {
00052     //{{AFX_DATA_INIT(CRelease_MAIN)
00053     m_dir = dir;
00054     //}}AFX_DATA_INIT
00055
00056     m_removeDirectoryOption = kReleaseNoDel;
00057 }

CRelease_MAIN::~CRelease_MAIN ( )

Definition at line 59 of file ReleaseDlg.cpp.

00060 {
00061 }

Member Function Documentation

void CRelease_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 63 of file ReleaseDlg.cpp.

References kReleaseDelAll, kReleaseDelCvsInfo, kReleaseDelDir, m_delAllCheck, m_delCvsInfoCheck, m_delDirCheck, and m_removeDirectoryOption.

00064 {
00065     CPropertyPage::DoDataExchange(pDX);
00066     //{{AFX_DATA_MAP(CRelease_MAIN)
00067     DDX_Control(pDX, IDC_DELDIR, m_delDirCheck);
00068     DDX_Control(pDX, IDC_DELCVSINFO, m_delCvsInfoCheck);
00069     DDX_Control(pDX, IDC_DELALL, m_delAllCheck);
00070     DDX_Text(pDX, IDC_DIRECTORY, m_dir);
00071     //}}AFX_DATA_MAP
00072
00073     if( pDX->m_bSaveAndValidate )
00074     {
00075         if( m_delAllCheck.GetCheck() )
00076         {
00077             m_removeDirectoryOption = kReleaseDelAll;
00078         }
00079         else if( m_delCvsInfoCheck.GetCheck() )
00080         {
00081             m_removeDirectoryOption = kReleaseDelCvsInfo;
00082         }
00083         else if( m_delDirCheck.GetCheck() )
00084         {
00085             m_removeDirectoryOption = kReleaseDelDir;
00086         }
00087     }
00088 }

kReleaseDelType CRelease_MAIN::GetRemoveDirectoryOption ( ) const

Get the remove directory option

Returns:
The remove directory option

Definition at line 106 of file ReleaseDlg.cpp.

References kReleaseDelType, and m_removeDirectoryOption.

Referenced by CompatGetRelease().

00107 {
00108     return m_removeDirectoryOption;
00109 }

void CRelease_MAIN::OnDelall ( ) [protected]

BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

Definition at line 112 of file ReleaseDlg.cpp.

References m_delAllCheck, m_delCvsInfoCheck, and m_delDirCheck.

00113 {
00114     if( m_delAllCheck.GetCheck() )
00115     {
00116         m_delCvsInfoCheck.SetCheck(0);
00117         m_delDirCheck.SetCheck(0);
00118     }
00119 }

void CRelease_MAIN::OnDelcvsinfo ( ) [protected]

BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

Definition at line 122 of file ReleaseDlg.cpp.

References m_delAllCheck, m_delCvsInfoCheck, and m_delDirCheck.

00123 {
00124     if( m_delCvsInfoCheck.GetCheck() )
00125     {
00126         m_delAllCheck.SetCheck(0);
00127         m_delDirCheck.SetCheck(0);
00128     }
00129 }

void CRelease_MAIN::OnDeldir ( ) [protected]

BN_CLICKED message handler, uncheck other remove directory options if this one is selected.

Definition at line 132 of file ReleaseDlg.cpp.

References m_delAllCheck, m_delCvsInfoCheck, and m_delDirCheck.

00133 {
00134     if( m_delDirCheck.GetCheck() )
00135     {
00136         m_delCvsInfoCheck.SetCheck(0);
00137         m_delAllCheck.SetCheck(0);
00138     }
00139 }

Member Data Documentation

CButton CRelease_MAIN::m_delAllCheck

Definition at line 64 of file ReleaseDlg.h.

Referenced by DoDataExchange(), OnDelall(), OnDelcvsinfo(), and OnDeldir().

CButton CRelease_MAIN::m_delCvsInfoCheck

Definition at line 63 of file ReleaseDlg.h.

Referenced by DoDataExchange(), OnDelall(), OnDelcvsinfo(), and OnDeldir().

CButton CRelease_MAIN::m_delDirCheck

Definition at line 62 of file ReleaseDlg.h.

Referenced by DoDataExchange(), OnDelall(), OnDelcvsinfo(), and OnDeldir().

CString CRelease_MAIN::m_dir

Definition at line 65 of file ReleaseDlg.h.

Referenced by CRelease_MAIN().

kReleaseDelType CRelease_MAIN::m_removeDirectoryOption [private]

Remove directory option

Definition at line 87 of file ReleaseDlg.h.

Referenced by CRelease_MAIN(), DoDataExchange(), and GetRemoveDirectoryOption().

The documentation for this class was generated from the following files:
  • common/ReleaseDlg.h
  • common/ReleaseDlg.cpp
Generated on Fri Jan 31 12:19:21 2003 for WinCvs Source by doxygen 1.3-rc2


RemoveCvsArgs Class Reference

Class to remove files. More...

#include <CvsArgs.h>

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, const char *currRevision=0L)
Add file.

Detailed Description

Class to remove files.

Definition at line 146 of file CvsArgs.h.

Member Function Documentation

void RemoveCvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L,
 |  | const char * | currRevision = 0L
 | ) | [virtual]

Add file.

Reimplemented from CvsArgs.

Definition at line 422 of file CvsArgs.cpp.

References CvsArgs::addfile(), CompatMoveToTrash(), CStr, cvs_err(), cvs_out(), and stat.

00424 {
00425     CvsArgs::addfile(arg, dir, spec);
00426
00427     CStr fullpath(dir);
00428     if( !fullpath.endsWith(kPathDelimiter) )
00429         fullpath << kPathDelimiter;
00430
00431     fullpath << arg;
00432
00433     // check the file is not already deleted
00434     struct stat sb;
00435     if( stat(dir, &sb) != -1 && S_ISDIR(sb.st_mode) &&
00436         stat(fullpath, &sb) == -1 && errno == ENOENT )
00437     {
00438         return;
00439     }
00440
00441     if( !CompatMoveToTrash(arg, dir, spec) )
00442 #ifdef WIN32
00443         cvs_err("Unable to send '%s' to the recycle bin\n", arg);
00444     else
00445         cvs_out("'%s' has been moved successfully to the recycle bin...\n", arg);
00446 #else
00447         cvs_err("Unable to send '%s' to the trash\n", arg);
00448     else
00449         cvs_out("'%s' has been moved successfully to the trash...\n", arg);
00450 #endif
00451 }

The documentation for this class was generated from the following files:
  • common/CvsArgs.h
  • common/CvsArgs.cpp
Generated on Fri Jan 31 12:19:22 2003 for WinCvs Source by doxygen 1.3-rc2


ReportConflict Class Reference

Class to represent file type and help handle possible import conflicts. More...

#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
}
Status enum. More...

Public Methods

ReportConflict (int mac_type, int mac_creator)
virtual | ~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)
UPStr | GetStateDesc () const
UPStr | GetDesc () const
UPStr | GetKindDesc () const
void | PrintOut (UStr &out) const

Public Attributes

ReportConflict * | next

Protected Attributes

int | status
UStr pattern
UStr sample1
UStr sample2
int | ftype
int | fcreator

Detailed Description

Class to represent file type and help handle possible import conflicts.

Definition at line 53 of file ImportFilter.h.

Member Enumeration Documentation

anonymous enum

Status enum.

Enumeration values:
noConflict | No conflict
hasConflict | There is a conflict
hasExtension | Has an extension
isBinary | Binary
forceBinary | Force binary
forceText | Force text
hasIgnore | Ignore
hasTypeCreatorConflict | Type creator conflict, mac only
forceNoKeywords | For no keyword expansion
isUnicode | Unicode
forceUnicode | Force unicode
userFlags | Mask of all user flags

Definition at line 62 of file ImportFilter.h.

00063     {
00064         noConflict =                0x0000,
00065         hasConflict =               0x0001,
00066         hasExtension =              0x0002,
00067         isBinary =                  0x0004,
00068         forceBinary =               0x0008,
00069         forceText =                 0x0010,
00070         hasIgnore =                 0x0020,
00071         hasTypeCreatorConflict =    0x0040,
00072         forceNoKeywords =           0x0080,
00073         isUnicode =                 0x0100,
00074         forceUnicode =              0x0200,
00075         userFlags = forceText | forceBinary | forceUnicode | hasIgnore | forceNoKeywords
00076     };

Constructor & Destructor Documentation

ReportConflict::ReportConflict | ( | int | mac_type,
 |  | int | mac_creator
 | ) |

Definition at line 271 of file ImportFilter.cpp.

References fcreator, ftype, next, noConflict, and status.

00272 {
00273     next = 0L;
00274     status = noConflict;
00275     ftype = mac_type;
00276     fcreator = mac_creator;
00277 }

ReportConflict::~ReportConflict ( ) [virtual]

Definition at line 336 of file ImportFilter.cpp.

00337 {
00338 }

Member Function Documentation

void ReportConflict::AddPattern | ( | const char * | newpat,
 |  | kFileType | fileType,
 |  | bool | isExt,
 |  | const char * | sample
 | ) |

Add new pattern

Parameters:
newpat | Pattern to add
fileType | File type
isExt | Flag indicating whether the file has an extension
sample | Sample

Definition at line 347 of file ImportFilter.cpp.

References isBinary, isUnicode, kFileTypeBin, kFileTypeUnicode, and status.

Referenced by list_add_type().

00348 {
00349     pattern = newpat;
00350     sample1 = sample;
00351
00352     switch( fileType )
00353     {
00354     case kFileTypeBin:
00355         status |= isBinary;
00356         break;
00357     case kFileTypeUnicode:
00358         status |= isUnicode;
00359         break;
00360     default:
00361         // nothing to do
00362         break;
00363     }
00364
00365     if( isExt )
00366         status |= hasExtension;
00367 }

void ReportConflict::DisableUserSettings ( void )

Erase any user settings (force binary, force text etc.)

Definition at line 590 of file ImportFilter.cpp.

References status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry().

00591 {
00592     status &= ~(int)userFlags;
00593 }

void ReportConflict::ForceBinary ( void )

Force binary status

Definition at line 500 of file ImportFilter.cpp.

References forceBinary, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry().

00501 {
00502     status &= ~(int)userFlags;
00503     status |= (int)forceBinary;
00504 }

void ReportConflict::ForceNoKeywords ( void )

Force no keyword expansion status

Definition at line 536 of file ImportFilter.cpp.

References forceNoKeywords, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry().

00537 {
00538     status &= ~(int)userFlags;
00539     status |= (int)forceNoKeywords;
00540 }

void ReportConflict::ForceText ( void )

Force text status

Definition at line 509 of file ImportFilter.cpp.

References forceText, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry().

00510 {
00511     status &= ~(int)userFlags;
00512     status |= (int)forceText;
00513 }

void ReportConflict::ForceUnicode ( void )

Force unicode status

Definition at line 518 of file ImportFilter.cpp.

References forceUnicode, status, and userFlags.

Referenced by CImportFilterDlg::OnEditentry().

00519 {
00520     status &= ~(int)userFlags;
00521     status |= (int)forceUnicode;
00522 }

UPStr ReportConflict::GetDesc ( ) const

Get the description

Returns:
The description as CPStr

Definition at line 608 of file ImportFilter.cpp.

References CPStr, GetPattern(), and IsExtension().

Referenced by CImportFilterDlg::OnInitDialog().

00609 {
00610     CPStr desc;
00611
00612     desc << "Type ";
00613     desc << (IsExtension() ? "*" : "");
00614     desc << GetPattern();
00615
00616     return desc;
00617 }

UPStr ReportConflict::GetKindDesc ( ) const

Get the kind description

Returns:
The kind description as CPStr

Definition at line 623 of file ImportFilter.cpp.

References CPStr, HasForceBinary(), HasForceNoKeywords(), HasForceText(), HasForceUnicode(), HasIgnore(), IsBinary(), and IsUnicode().

Referenced by CImportFilterDlg::OnEditentry(), and CImportFilterDlg::OnInitDialog().

00624 {
00625     if( HasForceBinary() )
00626     {
00627         return "FORCE BINARY";
00628     }
00629     else if( HasForceUnicode() )
00630     {
00631         return "FORCE UNICODE";
00632     }
00633     else if( HasForceText() )
00634     {
00635         return "FORCE TEXT";
00636     }
00637     else if( HasForceNoKeywords() )
00638     {
00639         return "FORCE NO KEYWORDS";
00640     }
00641     else if( HasIgnore() )
00642     {
00643         return "IGNORE";
00644     }
00645     else if( IsBinary() )
00646     {
00647         return "BINARY";
00648     }
00649     else if( IsUnicode() )
00650     {
00651         return "UNICODE";
00652     }
00653
00654     return "TEXT";
00655 }

int ReportConflict::GetMacCreator ( void ) const

Get the mac creator

Returns:
The mac creator
Note:
Mac only

Definition at line 492 of file ImportFilter.cpp.

References fcreator.

Referenced by list_add_type().

00493 {
00494     return fcreator;
00495 }

int ReportConflict::GetMacType ( void ) const

Get the mac type

Returns:
The mac type
Note:
Mac only

Definition at line 482 of file ImportFilter.cpp.

References ftype.

Referenced by list_add_type().

00483 {
00484     return ftype;
00485 }

const char * ReportConflict::GetPattern ( void ) const

Get the pattern

Returns:
The pattern

Definition at line 472 of file ImportFilter.cpp.

Referenced by CvsCmdImportModule(), and GetDesc().

00473 {
00474     return pattern;
00475 }

UPStr ReportConflict::GetStateDesc ( ) const

Get the state description

Returns:
The state description as CPStr

Definition at line 599 of file ImportFilter.cpp.

References CPStr, and HasConflict().

Referenced by CImportFilterDlg::OnInitDialog().

00600 {
00601     return HasConflict() ? "Error" : "OK";
00602 }

bool ReportConflict::HasConflict ( void ) const

Get the conflist status

Returns:
true if there is a conflict, false otherwise

Definition at line 426 of file ImportFilter.cpp.

References hasConflict, and status.

Referenced by GetStateDesc(), list_add_type(), CImportFilterDlg::OnInitDialog(), PrintOut(), SetConflict(), and SetTypeCreatorConflict().

00427 {
00428     return (status & hasConflict) != 0;
00429 }

bool ReportConflict::HasForceBinary ( void ) const

Get the force binary status

Returns:
true if force binary is set

Definition at line 546 of file ImportFilter.cpp.

References forceBinary, and status.

Referenced by CImportEntry::CImportEntry(), CvsCmdImportModule(), and GetKindDesc().

00547 {
00548     return (status & forceBinary) != 0;
00549 }

bool ReportConflict::HasForceNoKeywords ( void ) const

Get the force no keyword expansion status

Returns:
true if force no keyword expansion is set

Definition at line 582 of file ImportFilter.cpp.

References forceNoKeywords, and status.

Referenced by CImportEntry::CImportEntry(), CvsCmdImportModule(), and GetKindDesc().

00583 {
00584     return (status & forceNoKeywords) != 0;
00585 }

bool ReportConflict::HasForceText ( void ) const

Get the force text status

Returns:
true if force text is set

Definition at line 555 of file ImportFilter.cpp.

References forceText, and status.

Referenced by CImportEntry::CImportEntry(), CvsCmdImportModule(), and GetKindDesc().

00556 {
00557     return (status & forceText) != 0;
00558 }

bool ReportConflict::HasForceUnicode ( void ) const

Get the force unicode status

Returns:
true if force unicode is set

Definition at line 564 of file ImportFilter.cpp.

References forceUnicode, and status.

Referenced by CImportEntry::CImportEntry(), CvsCmdImportModule(), and GetKindDesc().

00565 {
00566     return (status & forceUnicode) != 0;
00567 }

bool ReportConflict::HasIgnore ( void ) const

Get the ignore status

Returns:
true if ignore is set

Definition at line 573 of file ImportFilter.cpp.

References hasIgnore, and status.

Referenced by CImportEntry::CImportEntry(), CvsCmdImportModule(), and GetKindDesc().

00574 {
00575     return (status & hasIgnore) != 0;
00576 }

bool ReportConflict::HasTypeCreatorConflict ( void ) const

Get the type creator conflist status

Returns:
true if there is a type creator conflict, false otherwise
Note:
Mac only

Definition at line 436 of file ImportFilter.cpp.

References hasTypeCreatorConflict, and status.

Referenced by PrintOut(), and SetTypeCreatorConflict().

00437 {
00438     return (status & hasTypeCreatorConflict) != 0;
00439 }

void ReportConflict::Ignore ( void )

Mark conflict for ignore

Definition at line 527 of file ImportFilter.cpp.

References hasIgnore, status, and userFlags.

Referenced by list_add_type(), and CImportFilterDlg::OnEditentry().

00528 {
00529     status &= ~(int)userFlags;
00530     status |= (int)hasIgnore;
00531 }

bool ReportConflict::IsBinary ( void ) const

Get the binary status

Returns:
true if the status is binary, false otherwise

Definition at line 445 of file ImportFilter.cpp.

References isBinary, and status.

Referenced by CvsCmdImportModule(), GetKindDesc(), and list_add_type().

00446 {
00447     return (status & isBinary) != 0;
00448 }

bool ReportConflict::IsExtension ( void ) const

Check whether conflict has an extension

Returns:
true if conflict has an extension

Definition at line 463 of file ImportFilter.cpp.

References status.

Referenced by CvsCmdImportModule(), and GetDesc().

00464 {
00465     return (status & hasExtension) != 0;
00466 }

bool ReportConflict::IsUnicode ( void ) const

Get the unicode status

Returns:
true if the status is unicode, false otherwise

Definition at line 454 of file ImportFilter.cpp.

References isUnicode, and status.

Referenced by CvsCmdImportModule(), GetKindDesc(), and list_add_type().

00455 {
00456     return (status & isUnicode) != 0;
00457 }

bool ReportConflict::Match ( const char * pat )

Match the pattern

Parameters:
pat
Returns:
true if pattern matches, false otherwise
Note:
Since it is the server who compares against the pattern that might be a case compare

Definition at line 375 of file ImportFilter.cpp.

References status.

Referenced by list_add_type().

00376 {
00377     if( pat == 0L || pattern.empty() )
00378         return false;
00379
00380     int len = strlen(pat);
00381     int patlen = pattern.length();
00382
00383     if( status & hasExtension )
00384     {
00385         if( len < patlen )
00386             return false;
00387
00388         return strcmp(pattern, pat + len - patlen) == 0;
00389     }
00390
00391     return strcmp(pattern, pat) == 0;
00392 }

void ReportConflict::PrintOut ( UStr & out ) const

Definition at line 279 of file ImportFilter.cpp.

References UStr::empty(), HasConflict(), HasTypeCreatorConflict(), lf, sample1, and sample2.

Referenced by CImportEntry::CImportEntry().

00280 {
00281     out = "";
00282     if( HasConflict() )
00283     {
00284         out << "Text/Binary conflict, at least these files :";
00285         out << lf;
00286
00287         if( !sample1.empty() && !sample2.empty() )
00288         {
00289             out << "    ";
00290             out << sample1;
00291             out << " and ";
00292             out << sample2;
00293             out << lf;
00294         }
00295     }
00296     else if( HasTypeCreatorConflict() )
00297     {
00298         out << "Mac signature mismatch for this type, at least these files :";
00299         out << lf;
00300
00301         if( !sample1.empty() && !sample2.empty() )
00302         {
00303             out << "    ";
00304             out << sample1;
00305             out << " and ";
00306             out << sample2;
00307             out << lf;
00308         }
00309     }
00310 }

void ReportConflict::SetConflict ( const char * sample )

Mark conflict

Parameters:
sample Sample

Definition at line 398 of file ImportFilter.cpp.

References hasConflict, HasConflict(), sample2, and status.

Referenced by list_add_type().

00399 {
00400     // one is enough !
00401     if( HasConflict() )
00402         return;
00403
00404     sample2 = sample;
00405     status |= hasConflict;
00406 }

void ReportConflict::SetTypeCreatorConflict ( const char * sample )

Set type creator conflict

Parameters:
sample Sample

Definition at line 412 of file ImportFilter.cpp.

References HasConflict(), hasTypeCreatorConflict, HasTypeCreatorConflict(), sample2, and status.

Referenced by list_add_type().

00413 {
00414     // one is enough !
00415     if( HasTypeCreatorConflict() || HasConflict() )
00416         return;
00417
00418     sample2 = sample;
00419     status |= hasTypeCreatorConflict;
00420 }

Member Data Documentation

int ReportConflict::fcreator [protected]

File creator, mac only

Definition at line 121 of file ImportFilter.h.

Referenced by GetMacCreator(), and ReportConflict().

int ReportConflict::ftype [protected]

File type, mac only

Definition at line 120 of file ImportFilter.h.

Referenced by GetMacType(), and ReportConflict().

ReportConflict* ReportConflict::next

Next element

Definition at line 59 of file ImportFilter.h.

Referenced by CvsCmdImportModule(), free_list_types(), list_add_type(), CImportFilterDlg::OnEditentry(), CImportFilterDlg::OnInitDialog(), and ReportConflict().

UStr ReportConflict::pattern [protected]

An extension or a whole name (hasExtension)

Definition at line 117 of file ImportFilter.h.

UStr ReportConflict::sample1 [protected]

Sample for this entry

Definition at line 118 of file ImportFilter.h.

Referenced by PrintOut().

UStr ReportConflict::sample2 [protected]

Another sample (if hasConflict)

Definition at line 119 of file ImportFilter.h.

Referenced by PrintOut(), SetConflict(), and SetTypeCreatorConflict().

int ReportConflict::status [protected]

Status

Definition at line 116 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 Fri Jan 31 12:19:24 2003 for WinCvs Source by doxygen 1.3-rc2


ReportWarning Class Reference

Class to represent a warning (wrong line feed, escape characters etc.) and a set of files which illustrates this warning. More...

#include <ImportFilter.h>

Collaboration diagram for ReportWarning:

[legend]
List of all members.

Public Methods

ReportWarning (kTextBinTYPE akind)
virtual | ~ReportWarning ()
void | AddWarning (const char *sample)
kTextBinTYPE | Kind (void) const
bool | IsError () const
UPStr | GetStateDesc () const
UPStr | GetDesc () 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 | tooManyWarnings

Detailed Description

Class to represent a warning (wrong line feed, escape characters etc.) and a set of files which illustrates this warning.

Definition at line 125 of file ImportFilter.h.

Constructor & Destructor Documentation

ReportWarning::ReportWarning ( kTextBinTYPE akind )

Definition at line 662 of file ImportFilter.cpp.

References kind, next, and tooManyWarnings.

00663 {
00664     kind = akind;
00665     next = 0L;
00666     tooManyWarnings = false;
00667 }

ReportWarning::~ReportWarning ( ) [virtual]

Definition at line 669 of file ImportFilter.cpp.

00670 {
00671 }

Member Function Documentation

void ReportWarning::AddWarning ( const char * sample )

Add warning

Parameters:
sample Sample

Definition at line 806 of file ImportFilter.cpp.

References CStr, maxWarnings, samples, and tooManyWarnings.

Referenced by list_add_warning().

00807 {
00808     // it's enough !
00809     if( samples.size() >= maxWarnings )
00810     {
00811         tooManyWarnings = true;
00812         return;
00813     }
00814
00815     samples.push_back(CStr(sample));
00816 }

UPStr ReportWarning::GetDesc ( ) const

Get the description

Returns:
The description as CPStr

Definition at line 855 of file ImportFilter.cpp.

References CPStr, kBinIsUnicode, kBinWrongSig, kFileInvalidName, kFileIsAlias, kFileIsOK, kFileMissing, Kind(), kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, and kTextWrongSig.

Referenced by CImportFilterDlg::OnInitDialog().

00856 {
00857     CPStr desc;
00858
00859     switch( Kind() )
00860     {
00861     case kFileIsOK:
00862         desc = "File is OK";
00863         break;
00864     case kFileMissing:
00865         desc = "File is missing or unreadable";
00866         break;
00867     case kFileIsAlias:
00868         desc = "File is an alias";
00869         break;
00870     case kFileInvalidName:
00871         desc = "File has an invalid name";
00872         break;
00873     case kTextWrongLF:
00874         desc = "File has the wrong line feed for this machine";
00875         break;
00876     case kTextIsBinary:
00877         desc = "File seems to be binary, while expecting text";
00878         break;
00879     case kTextEscapeChar:
00880         desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
00881         break;
00882     case kTextIsUnicode:
00883         desc = "File seems to be unicode, while expecting text";
00884         break;
00885     case kBinIsUnicode:
00886         desc = "File seems to be unicode, while expecting binary";
00887         break;
00888     case kTextWrongSig:
00889         desc = "Text File has a wrong mac signature";
00890         break;
00891     case kBinWrongSig:
00892         desc = "Binary File has a wrong mac signature";
00893         break;
00894     default:
00895         desc = "File has some unknown problem";
00896         break;
00897     }
00898
00899     return desc;
00900 }

UPStr ReportWarning::GetStateDesc ( ) const

Get the state description

Returns:
The state description as CPStr

Definition at line 841 of file ImportFilter.cpp.

References CPStr, and IsError().

Referenced by CImportFilterDlg::OnInitDialog().

00842 {
00843     if( IsError() )
00844     {
00845         return "Error";
00846     }
00847
00848     return "Warning";
00849 }

bool ReportWarning::IsError ( ) const

Check whether item represents an error

Returns:
true if item is an error, false if it is warning
Note:
Item kind kFileIsOK should not happen and is considered an error

Definition at line 832 of file ImportFilter.cpp.

References kFileIsOK, Kind(), and kTextEscapeChar.

Referenced by GetStateDesc(), and CImportFilterDlg::OnInitDialog().

00833 {
00834     return Kind() == kFileIsOK || Kind() == kTextEscapeChar;
00835 }

kTextBinTYPE ReportWarning::Kind ( void ) const

Get the warning type

Returns:
The warning type

Definition at line 822 of file ImportFilter.cpp.

References kind, and kTextBinTYPE.

Referenced by GetDesc(), IsError(), and list_add_warning().

00823 {
00824     return kind;
00825 }

void ReportWarning::PrintOut ( UStr & out ) const

Get the text description for warning type

Parameters:
out Return warning's description

Definition at line 677 of file ImportFilter.cpp.

References kBinIsText, kBinIsUnicode, kBinWrongSig, kFileInvalidName, kFileIsAlias, kFileIsOK, kFileMissing, kTextEscapeChar, kTextIsBinary, kTextIsUnicode, kTextWrongLF, kTextWrongSig, lf, and samples.

Referenced by CImportWarning::CImportWarning().

00678 {
00679     out = "";
00680
00681     if( samples.size() == 0 )
00682         return;
00683
00684     out = "Warning : ";
00685     switch(kind)
00686     {
00687     default:
00688     case kFileIsOK:
00689         out << "Files are OK";
00690         break;
00691     case kFileMissing:
00692         out << "Files are missing or unreadable";
00693         break;
00694     case kFileIsAlias:
00695         out << "Files are aliases";
00696         break;
00697     case kFileInvalidName:
00698         out << "Files have invalid name";
00699         break;
00700     case kTextWrongLF:
00701         out << "Files have the wrong line feed";
00702         break;
00703     case kTextIsBinary:
00704         out << "Files are binary";
00705         break;
00706     case kTextEscapeChar:
00707         out << "Files have escape characters in it";
00708         break;
00709     case kTextWrongSig:
00710         out << "Text files have the wrong signature";
00711         break;
00712     case kBinIsText:
00713         out << "Files are text, should be binary";
00714         break;
00715     case kBinWrongSig:
00716         out << "Binary files have the wrong signature";
00717         break;
00718     case kTextIsUnicode:
00719         out << "Files are unicode, should be text";
00720         break;
00721     case kBinIsUnicode:
00722         out << "Files are unicode, should be binary";
00723         break;
00724     }
00725
00726     out << lf;
00727
00728     std::vector<CStr>::const_iterator i;
00729     for(i = samples.begin(); i != samples.end(); ++i)
00730     {
00731         out << "    ";
00732         out << *i;
00733         out << lf;
00734     }
00735
00736     if( tooManyWarnings )
00737     {
00738         out << "    More files follow";
00739         out << lf;
00740     }
00741 }

Member Data Documentation

kTextBinTYPE ReportWarning::kind [protected]

Definition at line 148 of file ImportFilter.h.

Referenced by Kind(), and ReportWarning().

const size_t ReportWarning::maxWarnings = 10 [static]

Maximum number of wanings

Definition at line 660 of file ImportFilter.cpp.

Referenced by AddWarning().

ReportWarning* ReportWarning::next

Next element

Definition at line 131 of file ImportFilter.h.

Referenced by free_list_types(), list_add_warning(), CImportFilterDlg::OnEditentry(), CImportFilterDlg::OnInitDialog(), and ReportWarning().

std::vector< UStr > ReportWarning::samples [protected]

Samples container

Definition at line 150 of file ImportFilter.h.

Referenced by AddWarning(), and PrintOut().

bool ReportWarning::tooManyWarnings [protected]

Flag to indicate too many warnings

Definition at line 151 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 Fri Jan 31 12:19:25 2003 for WinCvs Source by doxygen 1.3-rc2


CRevisionConsole Class Reference

Console used to retrieve a specific revision. More...

#include <GraphView.h>

Inheritance diagram for CRevisionConsole:

[legend]
Collaboration diagram for CRevisionConsole:

[legend]
List of all members.

Public Methods

CRevisionConsole ()
virtual | ~CRevisionConsole ()
bool | init (LPCTSTR path, LPCTSTR fname)
virtual long | cvs_out (char *txt, long len)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

Protected Attributes

FILE * | m_fOut

Detailed Description

Console used to retrieve a specific revision.

Definition at line 284 of file GraphView.h.

Constructor & Destructor Documentation

CRevisionConsole::CRevisionConsole ( )

Definition at line 1055 of file GraphView.cpp.

References NULL.

01056     : m_fOut(NULL)
01057 {
01058 }

CRevisionConsole::~CRevisionConsole ( ) [virtual]

Definition at line 1060 of file GraphView.cpp.

01061 {
01062     if(m_fOut)
01063     {
01064         fclose(m_fOut);
01065     }
01066 }

Member Function Documentation

long CRevisionConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 1089 of file GraphView.cpp.

References cvs_errstr().

01090 {
01091     cvs_errstr(txt, len);
01092     return len;
01093 }

long CRevisionConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 1083 of file GraphView.cpp.

01084 {
01085     fwrite(txt, sizeof(char), len, m_fOut);
01086     return len;
01087 }

bool CRevisionConsole::init | ( | LPCTSTR | path,
 |  | LPCTSTR | fname
 | ) |

Initialize console

Parameters:
path | File path
fname | File name
Returns:
true on success, false otherwise

Definition at line 1074 of file GraphView.cpp.

References m_fOut, and NULL.

Referenced by CGraphView::OnViewRetrieve().

01075 {
01076     TCHAR buf[_MAX_PATH];
01077     _tmakepath(buf, NULL, path, fname, NULL);
01078     m_fOut = fopen(buf, "w+");
01079
01080     return m_fOut != NULL;
01081 }

Member Data Documentation

FILE* CRevisionConsole::m_fOut [protected]

Definition at line 293 of file GraphView.h.

Referenced by init().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:19:26 2003 for WinCvs Source by doxygen 1.3-rc2


CRichEditView Class Reference

Inheritance diagram for CRichEditView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvsView.h
Generated on Fri Jan 31 12:19:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, kRtagDlgType type, const char *sLastModule, const char *sLastTag, bool noRecurs, bool lookAttic, bool overwriteExist=false)
~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 ()
afx_msg void | OnBrowseTag ()
afx_msg void | OnBrowseModules ()

Private Attributes

const MultiFiles * | m_mf
kRtagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 79 of file RtagDlg.h.

00079 { IDD = IDD_RTAG_MAIN };

Constructor & Destructor Documentation

CRtag_MAIN::CRtag_MAIN | ( | const MultiFiles * | mf,
 |  | kRtagDlgType | type,
 |  | const char * | sLastModule,
 |  | const char * | sLastTag,
 |  | bool | noRecurs,
 |  | bool | lookAttic,
 |  | bool | overwriteExist = false
 | ) |

Definition at line 69 of file RtagDlg.cpp.

References m_lookAttic, m_moduleCombo, m_moduleName, m_noRecurs, m_overwriteExisting, m_tagCombo, m_tagName, m_type, and USmartCombo::SetItems().

00073                        : m_mf(mf), CPropertyPage(CRtag_MAIN::IDD)
00074 {
00075     m_type = type;
00076
00077     m_tagName = sLastTag;
00078     m_moduleName = sLastModule;
00079     m_noRecurs = noRecurs;
00080     m_lookAttic = lookAttic;
00081     m_overwriteExisting = overwriteExist;
00082
00083     m_moduleCombo.SetItems(&gOldModules);
00084     m_tagCombo.SetItems(&gRevNames);
00085 }

CRtag_MAIN::~CRtag_MAIN ( )

Definition at line 87 of file RtagDlg.cpp.

00088 {
00089 }

Member Function Documentation

void CRtag_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 91 of file RtagDlg.cpp.

References DDV_MinChars(), and DDX_ComboMString().

00092 {
00093     CPropertyPage::DoDataExchange(pDX);
00094     //{{AFX_DATA_MAP(CRtag_MAIN)
00095     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00096     DDX_Control(pDX, IDC_MODULEDESC_TEXT, m_moduleDescStatic);
00097     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00098     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00099     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00100     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00101     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00102     DDX_CBString(pDX, IDC_MODNAME, m_moduleName);
00103     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00104     DDX_Check(pDX, IDC_ATTIC, m_lookAttic);
00105     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00106     //}}AFX_DATA_MAP
00107
00108     DDV_MinChars(pDX, m_moduleName, 1);
00109     DDV_MinChars(pDX, m_tagName, 1);
00110
00111     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00112     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00113 }

void CRtag_MAIN::OnBrowseModules ( ) [protected]

Definition at line 178 of file RtagDlg.cpp.

References CompatGetModuleListItem(), CStr, m_moduleCombo, and m_moduleName.

00179 {
00180     CStr moduleName;
00181     if( CompatGetModuleListItem(m_mf, moduleName) )
00182     {
00183         m_moduleName = (const char*)moduleName;
00184         m_moduleCombo.SetWindowText(m_moduleName);
00185     }
00186 }

void CRtag_MAIN::OnBrowseTag ( ) [protected]

Definition at line 168 of file RtagDlg.cpp.

References CompatGetTagListItem(), CStr, m_tagCombo, and m_tagName.

00169 {
00170     CStr tagName;
00171     if( CompatGetTagListItem(m_mf, tagName) )
00172     {
00173         m_tagName = (const char*)tagName;
00174         m_tagCombo.SetWindowText(m_tagName);
00175     }
00176 }

BOOL CRtag_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 126 of file RtagDlg.cpp.

References ASSERT, kRtagAdd, kRtagDelete, kRtagFork, m_grpBox, m_moduleDescStatic, m_overwriteExistingCheck, m_tagDescStatic, and TRUE.

00127 {
00128     CPropertyPage::OnInitDialog();
00129
00130     // set the type-specific data
00131     CString strGrpBox;
00132     CString strTagDesc;
00133     CString strmoduleDesc;
00134
00135     switch( m_type )
00136     {
00137     case kRtagAdd:
00138         strGrpBox = "Enter the tag name and which module to tag:";
00139         strTagDesc = "New &tag name:";
00140         strmoduleDesc = "&Module to tag:";
00141         break;
00142     case kRtagDelete:
00143         strGrpBox = "Enter the tag name to delete and which module to untag:";
00144         strTagDesc = "Delete &tag name:";
00145         strmoduleDesc = "&Module to untag:";
00146
00147         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00148         break;
00149     case kRtagFork:
00150         strGrpBox = "Enter the branch name and which module to fork:";
00151         strTagDesc = "New &branch name:";
00152         strmoduleDesc = "&Module to fork:";
00153
00154         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00155         break;
00156     default:
00157         ASSERT(FALSE); //unknown type
00158     }
00159
00160     m_grpBox.SetWindowText(strGrpBox);
00161     m_tagDescStatic.SetWindowText(strTagDesc);
00162     m_moduleDescStatic.SetWindowText(strmoduleDesc);;
00163
00164     return TRUE;  // return TRUE unless you set the focus to a control
00165                   // EXCEPTION: OCX Property Pages should return FALSE
00166 }

Member Data Documentation

CButton CRtag_MAIN::m_grpBox

Definition at line 83 of file RtagDlg.h.

Referenced by OnInitDialog().

BOOL CRtag_MAIN::m_lookAttic

Definition at line 89 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), and CRtag_MAIN().

const MultiFiles* CRtag_MAIN::m_mf [private]

Definition at line 111 of file RtagDlg.h.

CSmartComboBox CRtag_MAIN::m_moduleCombo

Definition at line 84 of file RtagDlg.h.

Referenced by CRtag_MAIN(), and OnBrowseModules().

CStatic CRtag_MAIN::m_moduleDescStatic

Definition at line 81 of file RtagDlg.h.

Referenced by OnInitDialog().

CString CRtag_MAIN::m_moduleName

Definition at line 87 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CRtag_MAIN(), and OnBrowseModules().

BOOL CRtag_MAIN::m_noRecurs

Definition at line 88 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), and CRtag_MAIN().

BOOL CRtag_MAIN::m_overwriteExisting

Definition at line 90 of file RtagDlg.h.

Referenced by CompatRtagCreate(), and CRtag_MAIN().

CButton CRtag_MAIN::m_overwriteExistingCheck

Definition at line 80 of file RtagDlg.h.

Referenced by OnInitDialog().

CSmartComboBox CRtag_MAIN::m_tagCombo

Definition at line 85 of file RtagDlg.h.

Referenced by CRtag_MAIN(), and OnBrowseTag().

CStatic CRtag_MAIN::m_tagDescStatic

Definition at line 82 of file RtagDlg.h.

Referenced by OnInitDialog().

CString CRtag_MAIN::m_tagName

Definition at line 86 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), CompatRtagDelete(), CRtag_MAIN(), and OnBrowseTag().

kRtagDlgType CRtag_MAIN::m_type [private]

Definition at line 112 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 Fri Jan 31 12:19:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, 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 ()
afx_msg void | OnBrowseTag ()

Private Attributes

const MultiFiles * | m_mf
kRtagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 134 of file RtagDlg.h.

00134 { IDD = IDD_RTAG_OPTIONS };

Constructor & Destructor Documentation

CRtag_OPTIONS::CRtag_OPTIONS | ( | const MultiFiles * | mf,
 |  | kRtagDlgType | type,
 |  | bool | hasDate,
 |  | bool | hasRev,
 |  | const char * | sLastDate,
 |  | const char * | sLastRev,
 |  | bool | useMostRecent
 | ) |

Definition at line 193 of file RtagDlg.cpp.

References m_date, m_dateCombo, m_hasDate, m_hasRev, m_rev, m_revCombo, m_type, m_useMostRecent, and USmartCombo::SetItems().

00198                              : m_mf(mf), CPropertyPage(CRtag_OPTIONS::IDD)
00199 {
00200     m_type = type;
00201
00202     m_date = sLastDate;
00203     m_rev = sLastRev;
00204     m_hasDate = hasDate;
00205     m_hasRev = hasRev;
00206     m_useMostRecent = useMostRecent;
00207
00208     m_revCombo.SetItems(&gRevNames);
00209     m_dateCombo.SetItems(&gDateNames);
00210 }

CRtag_OPTIONS::CRtag_OPTIONS ( )

Definition at line 212 of file RtagDlg.cpp.

References FALSE, m_date, m_hasDate, m_hasRev, m_rev, and m_useMostRecent.

00212                              : CPropertyPage(CRtag_OPTIONS::IDD)
00213 {
00214     //{{AFX_DATA_INIT(CRtag_OPTIONS)
00215     m_date = _T("");
00216     m_rev = _T("");
00217     m_hasDate = FALSE;
00218     m_hasRev = FALSE;
00219     m_useMostRecent = FALSE;
00220     //}}AFX_DATA_INIT
00221 }

CRtag_OPTIONS::~CRtag_OPTIONS ( )

Definition at line 223 of file RtagDlg.cpp.

00224 {
00225 }

Member Function Documentation

void CRtag_OPTIONS::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 227 of file RtagDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), OnDate(), and OnRev().

00228 {
00229     CPropertyPage::DoDataExchange(pDX);
00230     //{{AFX_DATA_MAP(CRtag_OPTIONS)
00231     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00232     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00233     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00234     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00235     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00236     DDX_Check(pDX, IDC_DATE, m_hasDate);
00237     DDX_Check(pDX, IDC_REV, m_hasRev);
00238     DDX_Check(pDX, IDC_MATCH, m_useMostRecent);
00239     //}}AFX_DATA_MAP
00240
00241     if( m_hasRev )
00242     {
00243         DDV_MinChars(pDX, m_rev, 1);
00244     }
00245
00246     if( m_hasDate )
00247     {
00248         DDV_MinChars(pDX, m_date, 1);
00249     }
00250
00251     if( !pDX->m_bSaveAndValidate )
00252     {
00253         OnDate();
00254         OnRev();
00255     }
00256
00257     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00258     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00259 }

void CRtag_OPTIONS::OnBrowseTag ( ) [protected]

Definition at line 315 of file RtagDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

00316 {
00317     CStr tagName;
00318     if( CompatGetTagListItem(m_mf, tagName) )
00319     {
00320         m_rev = (const char*)tagName;
00321         m_revCombo.SetWindowText(m_rev);
00322     }
00323 }

void CRtag_OPTIONS::OnDate ( ) [protected]

Definition at line 273 of file RtagDlg.cpp.

Referenced by DoDataExchange().

00274 {
00275     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00276     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00277     wnd->EnableWindow(but->GetCheck() == 1);
00278 }

BOOL CRtag_OPTIONS::OnInitDialog ( ) [protected, virtual]

Definition at line 287 of file RtagDlg.cpp.

References ASSERT, kRtagAdd, kRtagDelete, kRtagFork, m_grpBox, and TRUE.

00288 {
00289     CPropertyPage::OnInitDialog();
00290
00291     // set the type-specific data
00292     CString strGrpBox;
00293
00294     switch( m_type )
00295     {
00296     case kRtagAdd:
00297         strGrpBox = "Optionally use this revision/tag/date to create the tag:";
00298         break;
00299     case kRtagDelete:
00300         ASSERT(FALSE); //delete tag has no options
00301         break;
00302     case kRtagFork:
00303         strGrpBox = "Optionally use this revision/tag/date to create the branch:";
00304         break;
00305     default:
00306         ASSERT(FALSE); //unknown type
00307     }
00308
00309     m_grpBox.SetWindowText(strGrpBox);
00310
00311     return TRUE;  // return TRUE unless you set the focus to a control
00312                   // EXCEPTION: OCX Property Pages should return FALSE
00313 }

void CRtag_OPTIONS::OnRev ( ) [protected]

Definition at line 280 of file RtagDlg.cpp.

Referenced by DoDataExchange().

00281 {
00282     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00283     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00284     wnd->EnableWindow(but->GetCheck() == 1);
00285 }

Member Data Documentation

CString CRtag_OPTIONS::m_date

Definition at line 138 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), and CRtag_OPTIONS().

CSmartComboBox CRtag_OPTIONS::m_dateCombo

Definition at line 136 of file RtagDlg.h.

Referenced by CRtag_OPTIONS().

CButton CRtag_OPTIONS::m_grpBox

Definition at line 137 of file RtagDlg.h.

Referenced by OnInitDialog().

BOOL CRtag_OPTIONS::m_hasDate

Definition at line 140 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), and CRtag_OPTIONS().

BOOL CRtag_OPTIONS::m_hasRev

Definition at line 141 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), and CRtag_OPTIONS().

const MultiFiles* CRtag_OPTIONS::m_mf [private]

Definition at line 164 of file RtagDlg.h.

CString CRtag_OPTIONS::m_rev

Definition at line 139 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), CRtag_OPTIONS(), and OnBrowseTag().

CSmartComboBox CRtag_OPTIONS::m_revCombo

Definition at line 135 of file RtagDlg.h.

Referenced by CRtag_OPTIONS(), and OnBrowseTag().

kRtagDlgType CRtag_OPTIONS::m_type [private]

Definition at line 165 of file RtagDlg.h.

Referenced by CRtag_OPTIONS().

BOOL CRtag_OPTIONS::m_useMostRecent

Definition at line 142 of file RtagDlg.h.

Referenced by CompatRtagBranch(), CompatRtagCreate(), and CRtag_OPTIONS().

The documentation for this class was generated from the following files:
  • common/RtagDlg.h
  • common/RtagDlg.cpp
Generated on Fri Jan 31 12:19:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:31 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 780 of file Persistent.cpp.

00781     {
00782 #if qUnix
00783         kOK = EV_COMMAND_START,
00784         kCancel,
00785         kSettingName,
00786 #else
00787         kSettingName = EV_COMMAND_START,
00788 #endif
00789         kCopyPath,
00790         kCopyFrom,
00791         kCopyList
00792     };

Constructor & Destructor Documentation

USaveSettings::USaveSettings | ( | const char * | path,
 |  | const char * | oldname
 | ) |

Definition at line 835 of file Persistent.cpp.

00835                                                                   :
00836     UWidget(::UEventGetWidID()), m_path(path), m_oldname(oldname)
00837 {
00838 }

USaveSettings::~USaveSettings ( ) [virtual]

Definition at line 840 of file Persistent.cpp.

00841 {
00842 }

Member Function Documentation

const URuntimeClass * USaveSettings::_GetBaseClass ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 811 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 846 of file Persistent.cpp.

References UStr::empty(), GetAllPersistentSettings(), UCmdTarget::GetWidID(), m_copyFromPath, m_list, m_oldname, SplitPath(), UEventSendMessage(), and UMAKEINT.

00847 {
00848     if( fill )
00849     {
00850         UEventSendMessage(GetWidID(), EV_SETTEXT, kCopyPath, (void*)(const char*)m_path);
00851
00852         UStr defname;
00853         if( m_oldname.empty() )
00854         {
00855             UStr uppath;
00856             SplitPath(m_path, uppath, defname);
00857         }
00858         else
00859             defname = m_oldname;
00860
00861         UEventSendMessage(GetWidID(), EV_SETTEXT, kSettingName, (void*)(const char*)defname);
00862
00863         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, 0), 0L);
00864
00865         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCopyList, 0L);
00866
00867         if(GetAllPersistentSettings(m_list))
00868         {
00869             std::map<UStr, UStr>::const_iterator i;
00870             for(i = m_list.begin(); i != m_list.end(); ++i)
00871             {
00872                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kCopyList,
00873                     (void*)(const char*)(*i).first);
00874             }
00875         }
00876     }
00877     else
00878     {
00879         UEventSendMessage(GetWidID(), EV_GETTEXT, kSettingName, &m_settingName);
00880
00881         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00882         if( state )
00883         {
00884             UStr what;
00885             UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCopyList, &what);
00886
00887             std::map<UStr, UStr>::const_iterator i;
00888             i = m_list.find(what);
00889             if(i != m_list.end())
00890             {
00891                 m_copyFromPath = (*i).second;
00892             }
00893         }
00894     }
00895 }

const UMSGMAP * USaveSettings::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 813 of file Persistent.cpp.

const UMSGMAP * USaveSettings::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UWidget.

Definition at line 813 of file Persistent.cpp.

const URuntimeClass * USaveSettings::GetRuntimeClass ( ) const [virtual]

Reimplemented from UWidget.

Definition at line 811 of file Persistent.cpp.

const UMSGMAP * USaveSettings::GetThisMessageMap ( ) [static, protected]

Reimplemented from UWidget.

Definition at line 813 of file Persistent.cpp.

int USaveSettings::OnCopyFrom ( void ) [protected]

Definition at line 897 of file Persistent.cpp.

References UCmdTarget::GetWidID(), UEventSendMessage(), and UMAKEINT.

00898 {
00899     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00900     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, state), 0L);
00901     return 1;
00902 }

const URuntimeClass * USaveSettings::rtUSaveSettings ( void ) [static]

Definition at line 811 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 813 of file Persistent.cpp.

const URuntimeClass USaveSettings::classUSaveSettings [static, protected]

UStr USaveSettings::m_copyFromPath

Definition at line 795 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings(), and DoDataExchange().

std::map<UStr, UStr> USaveSettings::m_list [protected]

Definition at line 800 of file Persistent.cpp.

Referenced by DoDataExchange().

UStr USaveSettings::m_oldname [protected]

Definition at line 799 of file Persistent.cpp.

Referenced by DoDataExchange().

UStr USaveSettings::m_path [protected]

Definition at line 798 of file Persistent.cpp.

UStr USaveSettings::m_settingName

Definition at line 794 of file Persistent.cpp.

Referenced by AskCreatePersistentSettings().

const UMSGMAP USaveSettings::messageMap = { UWidget ::GetThisMessageMap(), & USaveSettings ::_messageEntries[0] } [static, protected]

Reimplemented from UWidget.

Definition at line 813 of file Persistent.cpp.

The documentation for this class was generated from the following file:
  • common/Persistent.cpp
Generated on Fri Jan 31 12:19:33 2003 for WinCvs Source by doxygen 1.3-rc2


CScrollView Class Reference

#include <UCvsGraph.h>

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 38 of file UCvsGraph.h.

Referenced by CGraphRectTracker::OnChangedRect(), CGraphView::OnContextMenu(), CGraphView::OnLButtonDown(), and CWinLogData::SetSelected().

00038 { return UPoint(0, 0); }

void CScrollView::InvalidateRect ( const URECT * r ) [inline]

Definition at line 39 of file UCvsGraph.h.

Referenced by CWinLogData::SetSelected().

00039 {}

The documentation for this class was generated from the following file:
  • common/UCvsGraph.h
Generated on Fri Jan 31 12:19:33 2003 for WinCvs Source by doxygen 1.3-rc2


CSelectionChangeNotifier Class Reference

#include <WinCvsBrowser.h>

Collaboration diagram for CSelectionChangeNotifier:

[legend]
List of all members.

Public Methods

CSelectionChangeNotifier (CWinCvsBrowser *view, bool notify)
virtual | ~CSelectionChangeNotifier ()

Private Attributes

bool | m_notify
bool | m_wasLocked
CWinCvsBrowser * m_view

Detailed Description

Class to ensure that selection notification is properly issued
Note:
Constructor can be configured either to issue notification or discard it

Definition at line 43 of file WinCvsBrowser.h.

Constructor & Destructor Documentation

CSelectionChangeNotifier::CSelectionChangeNotifier | ( | CWinCvsBrowser * | view,
 |  | bool | notify
 | ) |

Definition at line 135 of file WinCvsBrowser.cpp.

References m_view, m_wasLocked, CWinCvsBrowser::SetSelectionChanged(), and CWinCvsBrowser::SetSelectionNotificationLocked().

00136     : m_notify(notify), m_view(view), m_wasLocked(view->GetSelectionNotificationLocked())
00137 {
00138     if( !m_wasLocked )
00139     {
00140         m_view->SetSelectionChanged(false);
00141         m_view->SetSelectionNotificationLocked(true);
00142     }
00143 }

CSelectionChangeNotifier::~CSelectionChangeNotifier ( ) [virtual]

Definition at line 145 of file WinCvsBrowser.cpp.

References m_view, m_wasLocked, CWinCvsBrowser::NotifySelectionChange(), CWinCvsBrowser::SetSelectionChanged(), and CWinCvsBrowser::SetSelectionNotificationLocked().

00146 {
00147     m_view->SetSelectionNotificationLocked(m_wasLocked);
00148     if( !m_wasLocked )
00149     {
00150         if( m_notify )
00151         {
00152             m_view->NotifySelectionChange();
00153         }
00154
00155         m_view->SetSelectionChanged(false);
00156     }
00157 }

Member Data Documentation

bool CSelectionChangeNotifier::m_notify [private]

If true, the object will issue proper selection notification when going out of scope

Definition at line 52 of file WinCvsBrowser.h.

CWinCvsBrowser* CSelectionChangeNotifier::m_view [private]

View to change the state

Definition at line 54 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier(), and ~CSelectionChangeNotifier().

bool CSelectionChangeNotifier::m_wasLocked [private]

Flag to indicate whether the view was already locked at the time of initialization

Definition at line 53 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier(), and ~CSelectionChangeNotifier().

The documentation for this class was generated from the following files:
  • WinCvs/WinCvsBrowser.h
  • WinCvs/WinCvsBrowser.cpp
Generated on Fri Jan 31 12:19:34 2003 for WinCvs Source by doxygen 1.3-rc2


CSelectionDetailsDlg Class Reference

#include <SelectionDetailsDlg.h>

Inheritance diagram for CSelectionDetailsDlg:

[legend]
Collaboration diagram for CSelectionDetailsDlg:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_SELECTION_DETAILS }

Public Methods

CSelectionDetailsDlg (const MultiFiles *mf, const kSelDetType selDetType, const char *selection, CWnd *pParent=NULL)

Public Attributes

CButton m_revisionCheck
CButton m_fileNameCheck
CButton m_pathCheck
CEdit m_selectionEdit
CSpinButtonCtrl | m_revisionSpinCtrl
CListCtrl m_selectionListCtrl
CString | m_selection
int | m_selDetType

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initializes controls and displays data.

afx_msg void | OnDblclkSelectionlist (NMHDR *pNMHDR, LRESULT *pResult)
NM_DBLCLK message handler, select the item and close dialog.

afx_msg void | OnColumnclickSelectionlist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_COLUMNCLICK message handler, sort items in response to column click.

afx_msg void | OnItemchangedSelectionlist (NMHDR *pNMHDR, LRESULT *pResult)
LVN_ITEMCHANGED message handler, update the item edit box value as selection is changing.

afx_msg void | OnDeltaposRevisionSpin (NMHDR *pNMHDR, LRESULT *pResult)
UDN_DELTAPOS notification handler, for the revision type move the revision up or down.

afx_msg void | OnFilename ()
BN_CLICKED message handler, update the controls.

afx_msg void | OnPath ()
BN_CLICKED message handler, update the controls.

afx_msg void | OnRevision ()
BN_CLICKED message handler, update the controls.

afx_msg void | OnDestroy ()
WM_DESTROY message handler, release any memory allocated.

Private Methods

void | DisplaySelection ()
void | DeleteAllItems ()
void | EnableControls ()
void | UpdateSelect (int item)
void | SortItems (int column, bool asc)

Static Private Methods

int CALLBACK | CompareItems (LPARAM itemData1, LPARAM itemData2, LPARAM lParam)

Private Attributes

const MultiFiles * | m_mf
bool | m_sortAsc
int | m_sortColumn
CSortHeaderCtrl m_headerCtrl

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 80 of file SelectionDetailsDlg.h.

00080 { IDD = IDD_SELECTION_DETAILS };

Constructor & Destructor Documentation

CSelectionDetailsDlg::CSelectionDetailsDlg | ( | const MultiFiles * | mf,
 |  | const kSelDetType | selDetType,
 |  | const char * | selection,
 |  | CWnd * | pParent = NULL
 | ) |

Definition at line 132 of file SelectionDetailsDlg.cpp.

References m_selDetType, m_selection, m_sortAsc, and m_sortColumn.

00134     : m_mf(mf), CDialog(CSelectionDetailsDlg::IDD, pParent)
00135 {
00136     //{{AFX_DATA_INIT(CSelectionDetailsDlg)
00137     m_selection = selection;
00138     m_selDetType = selDetType;
00139     //}}AFX_DATA_INIT
00140
00141     m_sortAsc = false;
00142     m_sortColumn = 0;
00143 }

Member Function Documentation

int CALLBACK CSelectionDetailsDlg::CompareItems | ( | LPARAM | itemData1,
 |  | LPARAM | itemData2,
 |  | LPARAM | lParam
 | ) | [static, private]

Callback method used for sorting of items in the list control

Parameters:
itemData1 | SelectionDisplayInfo* of the first element
itemData2 | SelectionDisplayInfo* of the second element
lParam | CompareInfo* Sort settings
Returns:
1, -1 or 0 depending on the sort settings

Definition at line 88 of file SelectionDetailsDlg.cpp.

References ASSERT, SelectionDisplayInfo::GetFileName(), SelectionDisplayInfo::GetPath(), SelectionDisplayInfo::GetRevision(), CSelectionDetailsDlg::CompareInfo::m_asc, and CSelectionDetailsDlg::CompareInfo::m_column.

00089 {
00090     int res = 0;
00091
00092     const CompareInfo* info = (CompareInfo*)lParam;
00093     if( info )
00094     {
00095         SelectionDisplayInfo* displayInfo1 = (SelectionDisplayInfo*)itemData1;
00096         SelectionDisplayInfo* displayInfo2 = (SelectionDisplayInfo*)itemData2;
00097
00098         if( displayInfo1 && displayInfo2 )
00099         {
00100             switch( info->m_column )
00101             {
00102             case 0:
00103                 res = stricmp(displayInfo1->GetFileName().c_str(), displayInfo2->GetFileName().c_str());
00104                 break;
00105             case 1:
00106                 res = stricmp(displayInfo1->GetRevision().c_str(), displayInfo2->GetRevision().c_str());
00107                 break;
00108             case 2:
00109                 res = stricmp(displayInfo1->GetPath().c_str(), displayInfo2->GetPath().c_str());
00110                 break;
00111             default:
00112                 ASSERT(FALSE); // should not come here
00113                 break;
00114             }
00115         }
00116     }
00117
00118     if( res )
00119     {
00120         if( info->m_asc )
00121         {
00122             res *= -1;
00123         }
00124     }
00125
00126     return res;
00127 }

void CSelectionDetailsDlg::DeleteAllItems ( ) [private]

Remove all items and release associated memory held in Item Data of the list control

Definition at line 289 of file SelectionDetailsDlg.cpp.

References m_selectionListCtrl.

Referenced by OnDestroy().

00290 {
00291     for(int nIndex = 0; nIndex < m_selectionListCtrl.GetItemCount(); nIndex++)
00292     {
00293         SelectionDisplayInfo* displayInfo = (SelectionDisplayInfo*)m_selectionListCtrl.GetItemData(nIndex);
00294         delete displayInfo;
00295     }
00296
00297     m_selectionListCtrl.DeleteAllItems();
00298 }

void CSelectionDetailsDlg::DisplaySelection ( ) [private]

Insert columns and display the selection items

Definition at line 206 of file SelectionDetailsDlg.cpp.

References MultiFiles::begin(), SelectionDisplayInfo::Create(), CStr, MultiFiles::end(), MultiFiles::getdir(), m_mf, m_selectionListCtrl, MultiFiles::NumDirs(), and MultiFiles::TotalNumFiles().

Referenced by OnInitDialog().

00207 {
00208     CWndRedrawMngr redrawMngr(&m_selectionListCtrl);
00209
00210     // Get the client area width to properly size columns
00211     CRect rect;
00212     m_selectionListCtrl.GetClientRect(rect);
00213
00214     const int listCtrlWidth = rect.Width();
00215     const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
00216
00217     // Insert columns
00218     m_selectionListCtrl.InsertColumn(0, "Filename", LVCFMT_LEFT, 200);
00219     m_selectionListCtrl.InsertColumn(1, "Revision", LVCFMT_LEFT, 60);
00220     m_selectionListCtrl.InsertColumn(2, "Path", LVCFMT_LEFT, listCtrlWidthNoScroll - 60 - 200);
00221
00222     // The browser selection
00223     if( m_mf )
00224     {
00225         if( m_mf->TotalNumFiles() )
00226         {
00227             MultiFiles::const_iterator mfi;
00228             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00229             {
00230                 for(int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++)
00231                 {
00232                     CStr fileName;
00233                     CStr currRev;
00234                     CStr path;
00235
00236                     if( mfi->get(nIndex, path, fileName, currRev) )
00237                     {
00238                         const int itemIndex = m_selectionListCtrl.InsertItem(m_selectionListCtrl.GetItemCount(), fileName.c_str());
00239                         if( itemIndex > -1 )
00240                         {
00241                             m_selectionListCtrl.SetItemText(itemIndex, 1, currRev.c_str());
00242                             m_selectionListCtrl.SetItemText(itemIndex, 2, path.c_str());
00243
00244                             SelectionDisplayInfo* displayInfo = new SelectionDisplayInfo;
00245                             if( displayInfo )
00246                             {
00247                                 displayInfo->Create(string(fileName.c_str()), string(currRev.c_str()), string(path.c_str()));
00248                                 if( !m_selectionListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
00249                                 {
00250                                     delete displayInfo;
00251                                 }
00252                             }
00253                         }
00254                     }
00255                 }
00256             }
00257         }
00258         else if( m_mf->NumDirs() )
00259         {
00260             for(int nIndex = 0; nIndex < m_mf->NumDirs(); nIndex++)
00261             {
00262                 CStr path;
00263                 if( m_mf->getdir(nIndex, path) )
00264                 {
00265                     const int itemIndex = m_selectionListCtrl.InsertItem(m_selectionListCtrl.GetItemCount(), "");
00266                     if( itemIndex > -1 )
00267                     {
00268                         m_selectionListCtrl.SetItemText(itemIndex, 2, path.c_str());
00269
00270                         SelectionDisplayInfo* displayInfo = new SelectionDisplayInfo;
00271                         if( displayInfo )
00272                         {
00273                             displayInfo->Create(string(""), string(""), string(path.c_str()));
00274                             if( !m_selectionListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
00275                             {
00276                                 delete displayInfo;
00277                             }
00278                         }
00279                     }
00280                 }
00281             }
00282         }
00283     }
00284 }

void CSelectionDetailsDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 146 of file SelectionDetailsDlg.cpp.

00147 {
00148     CDialog::DoDataExchange(pDX);
00149     //{{AFX_DATA_MAP(CSelectionDetailsDlg)
00150     DDX_Control(pDX, IDC_REVISION, m_revisionCheck);
00151     DDX_Control(pDX, IDC_FILENAME, m_fileNameCheck);
00152     DDX_Control(pDX, IDC_PATH, m_pathCheck);
00153     DDX_Control(pDX, IDC_SELECTION, m_selectionEdit);
00154     DDX_Control(pDX, IDC_REVISION_SPIN, m_revisionSpinCtrl);
00155     DDX_Control(pDX, IDC_SELECTIONLIST, m_selectionListCtrl);
00156     DDX_Text(pDX, IDC_SELECTION, m_selection);
00157     DDX_Radio(pDX, IDC_FILENAME, m_selDetType);
00158     //}}AFX_DATA_MAP
00159 }

void CSelectionDetailsDlg::EnableControls ( ) [private]

Enable/disable controls

Definition at line 429 of file SelectionDetailsDlg.cpp.

References m_revisionCheck, and m_revisionSpinCtrl.

Referenced by OnFilename(), OnInitDialog(), OnPath(), and OnRevision().

00430 {
00431     m_revisionSpinCtrl.EnableWindow(m_revisionCheck.GetCheck());
00432 }

void CSelectionDetailsDlg::OnColumnclickSelectionlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_COLUMNCLICK message handler, sort items in response to column click.

Definition at line 321 of file SelectionDetailsDlg.cpp.

References m_sortAsc, m_sortColumn, and SortItems().

00322 {
00323     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00324
00325     if( m_sortColumn != pNMListView->iSubItem )
00326     {
00327         m_sortAsc = false;
00328     }
00329     else
00330     {
00331         m_sortAsc = !m_sortAsc;
00332     }
00333
00334     m_sortColumn = pNMListView->iSubItem;
00335
00336     SortItems(m_sortColumn, m_sortAsc);
00337
00338     *pResult = 0;
00339 }

void CSelectionDetailsDlg::OnDblclkSelectionlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

NM_DBLCLK message handler, select the item and close dialog.

Definition at line 309 of file SelectionDetailsDlg.cpp.

00310 {
00311     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00312     if( pNMListView->iItem > -1 )
00313     {
00314         OnOK();
00315     }
00316
00317     *pResult = 0;
00318 }

void CSelectionDetailsDlg::OnDeltaposRevisionSpin | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

UDN_DELTAPOS notification handler, for the revision type move the revision up or down.

Definition at line 373 of file SelectionDetailsDlg.cpp.

References m_revisionCheck, and m_selectionEdit.

00374 {
00375     NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
00376
00377     if( m_revisionCheck.GetCheck() )
00378     {
00379         CString selection;
00380         m_selectionEdit.GetWindowText(selection);
00381
00382         const int dotPos = selection.ReverseFind('.');
00383         if( dotPos > 0 && dotPos < selection.GetLength() - 1 )
00384         {
00385             CString revLast = selection.Mid(dotPos + 1);
00386             int revLastNum = atoi(revLast);
00387             if( revLastNum > 0 )
00388             {
00389                 revLastNum += pNMUpDown->iDelta;
00390                 if( revLastNum > 0 )
00391                 {
00392                     revLast.Format("%d", revLastNum);
00393                     selection = selection.Left(dotPos + 1) + revLast;
00394
00395                     m_selectionEdit.SetWindowText(selection);
00396                 }
00397             }
00398         }
00399     }
00400
00401     // We do not allow to change position
00402     *pResult = 1;
00403 }

void CSelectionDetailsDlg::OnDestroy ( ) [protected]

WM_DESTROY message handler, release any memory allocated.

Definition at line 301 of file SelectionDetailsDlg.cpp.

References DeleteAllItems().

00302 {
00303     DeleteAllItems();
00304
00305     CDialog::OnDestroy();
00306 }

void CSelectionDetailsDlg::OnFilename ( ) [protected]

BN_CLICKED message handler, update the controls.

Definition at line 406 of file SelectionDetailsDlg.cpp.

References EnableControls(), and UpdateSelect().

00407 {
00408     EnableControls();
00409     UpdateSelect(-1);
00410 }

BOOL CSelectionDetailsDlg::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initializes controls and displays data.

Definition at line 179 of file SelectionDetailsDlg.cpp.

References DisplaySelection(), EnableControls(), m_headerCtrl, m_revisionSpinCtrl, m_selectionListCtrl, SetListCtrlExtendedStyle(), and TRUE.

00180 {
00181     CDialog::OnInitDialog();
00182
00183     // Extra initialization
00184     SetListCtrlExtendedStyle(&m_selectionListCtrl, LVS_EX_FULLROWSELECT);
00185     m_revisionSpinCtrl.SetRange(0, 100);
00186
00187     // Setup controls
00188     CHeaderCtrl* headerCtrl = m_selectionListCtrl.GetHeaderCtrl();
00189     if( headerCtrl )
00190     {
00191         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00192     }
00193
00194     EnableControls();
00195
00196     // Display items
00197     DisplaySelection();
00198
00199     return TRUE;  // return TRUE unless you set the focus to a control
00200                   // EXCEPTION: OCX Property Pages should return FALSE
00201 }

void CSelectionDetailsDlg::OnItemchangedSelectionlist | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

LVN_ITEMCHANGED message handler, update the item edit box value as selection is changing.

Definition at line 360 of file SelectionDetailsDlg.cpp.

References UpdateSelect().

00361 {
00362     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00363     if( pNMListView->iItem > -1 &&
00364         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
00365     {
00366         UpdateSelect(pNMListView->iItem);
00367     }
00368
00369     *pResult = 0;
00370 }

void CSelectionDetailsDlg::OnPath ( ) [protected]

BN_CLICKED message handler, update the controls.

Definition at line 413 of file SelectionDetailsDlg.cpp.

References EnableControls(), and UpdateSelect().

00414 {
00415     EnableControls();
00416     UpdateSelect(-1);
00417 }

void CSelectionDetailsDlg::OnRevision ( ) [protected]

BN_CLICKED message handler, update the controls.

Definition at line 420 of file SelectionDetailsDlg.cpp.

References EnableControls(), and UpdateSelect().

00421 {
00422     EnableControls();
00423     UpdateSelect(-1);
00424 }

void CSelectionDetailsDlg::SortItems | ( | int | column,
 |  | bool | asc
 | ) | [private]

Sort items listed in the list control

Parameters:
column | Column to sort items by
asc | Sort ascending or descending
Note:
Using list control callback CompareItems

Definition at line 347 of file SelectionDetailsDlg.cpp.

References CSelectionDetailsDlg::CompareInfo::m_asc, CSelectionDetailsDlg::CompareInfo::m_column, m_headerCtrl, m_selectionListCtrl, and CSortHeaderCtrl::SetSortImage().

Referenced by OnColumnclickSelectionlist().

00348 {
00349     m_headerCtrl.SetSortImage(column, asc);
00350
00351     CompareInfo info = { 0 };
00352
00353     info.m_column = column;
00354     info.m_asc = asc;
00355
00356     m_selectionListCtrl.SortItems(CompareItems, (DWORD)&info);
00357 }

void CSelectionDetailsDlg::UpdateSelect ( int item ) [private]

Update the select edit box to the data from given list item

Parameters:
item Item to update to, -1 to update to the currently selected item

Definition at line 438 of file SelectionDetailsDlg.cpp.

References m_pathCheck, m_revisionCheck, m_selectionEdit, and m_selectionListCtrl.

Referenced by OnFilename(), OnItemchangedSelectionlist(), OnPath(), and OnRevision().

00439 {
00440     if( item < 0 )
00441     {
00442         // Get the currently selected item
00443         POSITION pos = m_selectionListCtrl.GetFirstSelectedItemPosition();
00444         if( pos )
00445         {
00446             item = m_selectionListCtrl.GetNextSelectedItem(pos);
00447         }
00448     }
00449
00450     if( item > -1 && item < m_selectionListCtrl.GetItemCount() )
00451     {
00452         // Update the select edit box
00453         int subItem = 0;
00454
00455         if( m_revisionCheck.GetCheck() )
00456         {
00457             subItem = 1;
00458         }
00459         else if( m_pathCheck.GetCheck() )
00460         {
00461             subItem = 2;
00462         }
00463
00464         m_selectionEdit.SetWindowText(m_selectionListCtrl.GetItemText(item, subItem));
00465     }
00466 }

Member Data Documentation

CButton CSelectionDetailsDlg::m_fileNameCheck

Definition at line 82 of file SelectionDetailsDlg.h.

CSortHeaderCtrl CSelectionDetailsDlg::m_headerCtrl [private]

Definition at line 137 of file SelectionDetailsDlg.h.

Referenced by OnInitDialog(), and SortItems().

const MultiFiles* CSelectionDetailsDlg::m_mf [private]

Browser selection

Definition at line 117 of file SelectionDetailsDlg.h.

Referenced by DisplaySelection().

CButton CSelectionDetailsDlg::m_pathCheck

Definition at line 83 of file SelectionDetailsDlg.h.

Referenced by UpdateSelect().

CButton CSelectionDetailsDlg::m_revisionCheck

Definition at line 81 of file SelectionDetailsDlg.h.

Referenced by EnableControls(), OnDeltaposRevisionSpin(), and UpdateSelect().

CSpinButtonCtrl CSelectionDetailsDlg::m_revisionSpinCtrl

Definition at line 85 of file SelectionDetailsDlg.h.

Referenced by EnableControls(), and OnInitDialog().

int CSelectionDetailsDlg::m_selDetType

Definition at line 88 of file SelectionDetailsDlg.h.

Referenced by CompatGetSelectionDetails(), and CSelectionDetailsDlg().

CString CSelectionDetailsDlg::m_selection

Definition at line 87 of file SelectionDetailsDlg.h.

Referenced by CompatGetSelectionDetails(), and CSelectionDetailsDlg().

CEdit CSelectionDetailsDlg::m_selectionEdit

Definition at line 84 of file SelectionDetailsDlg.h.

Referenced by OnDeltaposRevisionSpin(), and UpdateSelect().

CListCtrl CSelectionDetailsDlg::m_selectionListCtrl

Definition at line 86 of file SelectionDetailsDlg.h.

Referenced by DeleteAllItems(), DisplaySelection(), OnInitDialog(), SortItems(), and UpdateSelect().

bool CSelectionDetailsDlg::m_sortAsc [private]

Current ascending/descending sorting

Definition at line 135 of file SelectionDetailsDlg.h.

Referenced by CSelectionDetailsDlg(), and OnColumnclickSelectionlist().

int CSelectionDetailsDlg::m_sortColumn [private]

Current sort column

Definition at line 136 of file SelectionDetailsDlg.h.

Referenced by CSelectionDetailsDlg(), and OnColumnclickSelectionlist().

The documentation for this class was generated from the following files:
  • common/SelectionDetailsDlg.h
  • common/SelectionDetailsDlg.cpp
Generated on Fri Jan 31 12:19:36 2003 for WinCvs Source by doxygen 1.3-rc2


CSelectionDetailsDlg::CompareInfo Struct Reference

Structure to hold the sorting settings. More...

Collaboration diagram for CSelectionDetailsDlg::CompareInfo:

[legend]
List of all members.

Public Attributes

int | m_column
bool | m_asc

Detailed Description

Structure to hold the sorting settings.

Definition at line 129 of file SelectionDetailsDlg.h.

Member Data Documentation

bool CSelectionDetailsDlg::CompareInfo::m_asc

Sort ascending or descending

Definition at line 132 of file SelectionDetailsDlg.h.

Referenced by CSelectionDetailsDlg::CompareItems(), and CSelectionDetailsDlg::SortItems().

int CSelectionDetailsDlg::CompareInfo::m_column

Sorting column

Definition at line 131 of file SelectionDetailsDlg.h.

Referenced by CSelectionDetailsDlg::CompareItems(), and CSelectionDetailsDlg::SortItems().

The documentation for this struct was generated from the following file:
  • common/SelectionDetailsDlg.h
Generated on Fri Jan 31 12:19:37 2003 for WinCvs Source by doxygen 1.3-rc2


SelectionDisplayInfo Class Reference

Class to hold and support data display (e.g. sorting). More...

#include <SelectionDetailsDlg.h>

Collaboration diagram for SelectionDisplayInfo:

[legend]
List of all members.

Public Methods

void | Create (const string &fileName, const string &revision, const string &path)
const string & | GetFileName () const
Get filename.

const string & | GetRevision () const
Get revision.

const string & | GetPath () const
Get path.

Private Attributes

string | m_fileName
string | m_revision
string | m_path

Detailed Description

Class to hold and support data display (e.g. sorting).

Definition at line 51 of file SelectionDetailsDlg.h.

Member Function Documentation

void SelectionDisplayInfo::Create | ( | const string & | fileName,
 |  | const string & | revision,
 |  | const string & | path
 | ) |

Create display info

Parameters:
fileName | Filename
revision | Revision
path | Path

Definition at line 55 of file SelectionDetailsDlg.cpp.

References m_fileName, m_path, and m_revision.

Referenced by CSelectionDetailsDlg::DisplaySelection().

00056 {
00057     m_fileName = fileName;
00058     m_revision = revision;
00059     m_path = path;
00060 }

const string & SelectionDisplayInfo::GetFileName ( ) const

Get filename.

Definition at line 63 of file SelectionDetailsDlg.cpp.

References m_fileName.

Referenced by CSelectionDetailsDlg::CompareItems().

00064 {
00065     return m_fileName;
00066 }

const string & SelectionDisplayInfo::GetPath ( ) const

Get path.

Definition at line 75 of file SelectionDetailsDlg.cpp.

References m_path.

Referenced by CSelectionDetailsDlg::CompareItems().

00076 {
00077     return m_path;
00078 }

const string & SelectionDisplayInfo::GetRevision ( ) const

Get revision.

Definition at line 69 of file SelectionDetailsDlg.cpp.

References m_revision.

Referenced by CSelectionDetailsDlg::CompareItems().

00070 {
00071     return m_revision;
00072 }

Member Data Documentation

string SelectionDisplayInfo::m_fileName [private]

Filename

Definition at line 55 of file SelectionDetailsDlg.h.

Referenced by Create(), and GetFileName().

string SelectionDisplayInfo::m_path [private]

Path

Definition at line 57 of file SelectionDetailsDlg.h.

Referenced by Create(), and GetPath().

string SelectionDisplayInfo::m_revision [private]

Revision

Definition at line 56 of file SelectionDetailsDlg.h.

Referenced by Create(), and GetRevision().

The documentation for this class was generated from the following files:
  • common/SelectionDetailsDlg.h
  • common/SelectionDetailsDlg.cpp
Generated on Fri Jan 31 12:19:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 773 of file umain.h.

References m_didSetSemaphore, m_enteredTwice, and m_semaphore.

00773                                  : m_semaphore(semaphore), m_didSetSemaphore(false),
00774         m_enteredTwice(false)
00775     {
00776         if(m_semaphore)
00777         {
00778             m_enteredTwice = true;
00779             return;
00780         }
00781         m_semaphore = true;
00782         m_didSetSemaphore = true;
00783     }

USemaphore::~USemaphore ( ) [inline]

Definition at line 785 of file umain.h.

References m_semaphore.

00786     {
00787         if(m_didSetSemaphore)
00788             m_semaphore = false;
00789     }

Member Function Documentation

bool USemaphore::IsEnteredTwice ( ) const [inline]

Definition at line 791 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().

00791 { return m_enteredTwice; }

Member Data Documentation

bool USemaphore::m_didSetSemaphore [protected]

Definition at line 795 of file umain.h.

Referenced by USemaphore().

bool USemaphore::m_enteredTwice [protected]

Definition at line 796 of file umain.h.

Referenced by IsEnteredTwice(), and USemaphore().

bool& USemaphore::m_semaphore [protected]

Definition at line 794 of file umain.h.

Referenced by USemaphore(), and ~USemaphore().

The documentation for this class was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:19:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 941 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 941 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 Fri Jan 31 12:19:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 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().

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 Fri Jan 31 12:19:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 929 of file umain.h.

Referenced by UWidget::OnGetSliderProperty(), and UWidget::OnSetSliderProperty().

int USLIDER::max

Definition at line 927 of file umain.h.

Referenced by UWidget::OnGetSliderProperty(), and UWidget::OnSetSliderProperty().

int USLIDER::min

Definition at line 928 of file umain.h.

Referenced by UWidget::OnGetSliderProperty(), and UWidget::OnSetSliderProperty().

int USLIDER::pos

Definition at line 930 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 Fri Jan 31 12:19:39 2003 for WinCvs Source by doxygen 1.3-rc2


USmartCombo Class Reference

#include <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.

virtual | ~USmartCombo ()
Destructor.

void | SetFeature (int feature)
bool | HasFeature (int feature) const
void | SetItems (CMString *pstrItems)
CMString * GetItems ()
virtual int | CalcDroppedWidth ()
virtual void | SetReadOnly (bool readOnly=true)
virtual bool | RemoveItem (const char *strItem)

Private Attributes

int | m_feature
CMString * m_pstrItems

Detailed Description

Abstract class for Smart Combo Box (CSmartComboBox)

Use as a base class to derive the Smart Combo Box for different platforms

Note:
To set the desired features support by Smart Combo Box objects use the combinations of values enumerated under USmartCombo::Feature

Definition at line 40 of file SmartComboBox.h.

Member Enumeration Documentation

enum USmartCombo::Feature

Feature enum.

Enum to specify the desired features for Smart Combo Box object

Enumeration values:
None | No features, just standard Combo Box.
AutoDropWidth | Automatically adjust the width of the drop-down list 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 54 of file SmartComboBox.h.

00054                 {
00055         None =          0x00,
00056         AutoDropWidth = 0x01,
00057         RemoveItems =   0x02,
00058         ReadOnly =      0x04,
00059         //
00060         DefaultFeature = AutoDropWidth | RemoveItems
00061     };

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

Returns:
The width of the dropped items list
Note:
The default implementation does nothing, you should override that method to perform the real calculation

Reimplemented in CSmartComboBox, and CHistComboBoxEx.

Definition at line 113 of file SmartComboBox.cpp.

00114 {
00115     return 0;
00116 }

CMString * USmartCombo::GetItems ( )

Get the items persistent collection

Returns:
pointer to CMString that contains the items persistent collection, can be NULL
Note:
Used to populate combo box in DDX routine etc.

Definition at line 103 of file SmartComboBox.cpp.

References m_pstrItems.

Referenced by DDX_ComboMString(), CHistComboBoxEx::DelKeyTest(), CSmartComboBox::DelKeyTest(), and CHistComboBoxEx::NewRoot().

00104 {
00105     return m_pstrItems;
00106 }

bool USmartCombo::HasFeature ( int feature ) const

Test whether the feature is supported

Parameters:
feature Feature pattern to be tested
Returns:
true if the feature is set, false otherwise

Definition at line 72 of file SmartComboBox.cpp.

References m_feature.

Referenced by CHistComboBoxEx::OnDropdown(), CSmartComboBox::OnDropdown(), CSmartComboBox::PreSubclassWindow(), CHistComboBoxEx::PreTranslateMessage(), and CSmartComboBox::PreTranslateMessage().

00073 {
00074     return (m_feature & feature) != 0;
00075 }

bool USmartCombo::RemoveItem ( const char * strItem ) [virtual]

Remove the item from the list

Parameters:
strItem Item to be removed
Returns:
true if item removed, false otherwise
Note:
Prompts the user before removing the item

Definition at line 141 of file SmartComboBox.cpp.

References CvsAlert(), m_pstrItems, and TMString< UStr >::Remove().

Referenced by CHistComboBoxEx::DelKeyTest(), and CSmartComboBox::DelKeyTest().

00142 {
00143     UStr prompt("Do you want to remove that item from the list?\n");
00144     prompt << "Item: ";
00145     prompt << strItem;
00146
00147     bool res = CvsAlert(prompt, "Yes", "No");
00148     if( res )
00149     {
00150         m_pstrItems->Remove(strItem);
00151     }
00152
00153     return res;
00154 }

void USmartCombo::SetFeature ( int feature )

Set the features

Parameters:
feature Feature pattern to be set
Note:
Reflects the read-only state appropriate

Definition at line 61 of file SmartComboBox.cpp.

References m_feature, and SetReadOnly().

Referenced by CDiff_MAIN::CDiff_MAIN(), and CSmartComboBox::OnSetFeature().

00062 {
00063     m_feature = feature;
00064     SetReadOnly(0 != (m_feature & USmartCombo::ReadOnly));
00065 }

void USmartCombo::SetItems ( CMString * pstrItems )

Set the items persistent collection

Parameters:
pstrItems pointer to CMString class object so that it can be removed with Del key when the drop-down list is dropped down
Returns:
true on success, false otherwise
Note:
It will also set the feature member appropriate:
  • if pstrItems is NULL it will remove
  • if it's valid then it will add the USmartCombo::RemoveItems feature.

Definition at line 85 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(), CItemListDlg::CItemListDlg(), 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().

00086 {
00087     m_pstrItems = pstrItems;
00088     if( m_pstrItems )
00089     {
00090         m_feature |= USmartCombo::RemoveItems;
00091     }
00092     else
00093     {
00094         m_feature &= ~USmartCombo::RemoveItems;
00095     }
00096 }

void USmartCombo::SetReadOnly ( bool readOnly = true ) [virtual]

Set the read-only feature

Parameters:
readOnly true to turn on the read-only feature, false to turn if off
Note:
Call the base class first when you override USmartCombo::SetReadOnly

Reimplemented in CSmartComboBox.

Definition at line 123 of file SmartComboBox.cpp.

References m_feature, and ReadOnly.

Referenced by SetFeature(), and CSmartComboBox::SetReadOnly().

00124 {
00125     if( readOnly )
00126     {
00127         m_feature |= USmartCombo::ReadOnly;
00128     }
00129     else
00130     {
00131         m_feature &= ~USmartCombo::ReadOnly;
00132     }
00133 }

Member Data Documentation

int USmartCombo::m_feature [private]

Pattern of used features

Definition at line 48 of file SmartComboBox.h.

Referenced by HasFeature(), SetFeature(), SetItems(), and SetReadOnly().

CMString* USmartCombo::m_pstrItems [private]

Items collection

Definition at line 49 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 Fri Jan 31 12:19:41 2003 for WinCvs Source by doxygen 1.3-rc2


CSmartComboBox Class Reference

#include <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, if the USmartCombo::RemoveItems feature is set perform the key test to determine whether to delete item.

virtual | ~CSmartComboBox ()
virtual void | SetReadOnly (bool readOnly=true)

Protected Methods

virtual void | PreSubclassWindow ()
PreSubclassWindow virtual override, sets the read-only state if the USmartCombo::ReadOnly feature is set.

afx_msg void | OnDropdown ()
CBN_DROPDOWN message handler, calculates the width of the drop-down list if the USmartCombo::AutoDropWidth feature is set.

afx_msg LRESULT | OnSetFeature (WPARAM wParam, LPARAM lParam)
afx_msg LRESULT | OnSetItems (WPARAM wParam, LPARAM lParam)
afx_msg LRESULT | OnSetReadOnly (WPARAM wParam, LPARAM lParam)

Private Methods

virtual int | CalcDroppedWidth ()
CalcDroppedWidth virtual override, calculate drop-down list width and make sure it doesn't go off-screen as well.

BOOL | DelKeyTest (MSG *pMsg)

Detailed Description

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 drop-down list is dropped down you need to also call CSmartComboBox::SetItems method to setup appropriate 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 appropriate features and data members are provided (WM_SMCB_SETFEATURE, WM_SMCB_SETITEMS and WM_SMCB_SETREADONLY).

Definition at line 104 of file SmartComboBox.h.

Constructor & Destructor Documentation

CSmartComboBox::CSmartComboBox ( int feature = USmartCombo::DefaultFeature )

Definition at line 160 of file SmartComboBox.cpp.

00161     : USmartCombo(feature)
00162 {
00163 }

CSmartComboBox::~CSmartComboBox ( ) [virtual]

Definition at line 165 of file SmartComboBox.cpp.

00166 {
00167 }

Member Function Documentation

int CSmartComboBox::CalcDroppedWidth ( ) [private, virtual]

CalcDroppedWidth virtual override, calculate drop-down list width and make sure it doesn't go off-screen as well.

Reimplemented from USmartCombo.

Definition at line 206 of file SmartComboBox.cpp.

Referenced by OnDropdown().

00207 {
00208     int maxSize = 0;
00209
00210     CClientDC ClientDC(this);
00211     int savedDC = ClientDC.SaveDC();
00212     ClientDC.SelectObject(GetFont());
00213
00214     CString strLBText;
00215     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00216     {
00217         GetLBText( nIndex, strLBText );
00218         CSize size = ClientDC.GetTextExtent(strLBText);
00219
00220         if( size.cx > maxSize )
00221         {
00222             maxSize = size.cx;
00223         }
00224     }
00225     ClientDC.RestoreDC(savedDC);
00226
00227     maxSize += ::GetSystemMetrics(SM_CXVSCROLL) + 3*::GetSystemMetrics(SM_CXEDGE);
00228
00229     CRect rect;
00230     GetWindowRect(rect);
00231     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00232
00233     return maxSize;
00234 }

BOOL CSmartComboBox::DelKeyTest ( MSG * pMsg ) [private]

Test if the Del key is pressed and remove the item if the drop-down list is dropped down

Parameters:
pMsg Message to test
Returns:
TRUE if the drop-down list was dropped and Del key was pressed
Note:
Make sure the items collection is set earlier (call USmartCombo::SetItems to set the collection)

Definition at line 242 of file SmartComboBox.cpp.

References ASSERT, FALSE, USmartCombo::GetItems(), USmartCombo::RemoveItem(), and TRUE.

Referenced by PreTranslateMessage().

00243 {
00244     CMString* pstrItems = GetItems();
00245     ASSERT(pstrItems != NULL);
00246
00247     BOOL bRes = FALSE;
00248
00249     if( WM_KEYDOWN == pMsg->message &&
00250         VK_DELETE == (int)pMsg->wParam &&
00251         pstrItems &&
00252         GetDroppedState() )
00253     {
00254         int sel = GetCurSel();
00255         if( CB_ERR < sel )
00256         {
00257             CString strItem;
00258             GetLBText(sel, strItem);
00259
00260             if( RemoveItem(strItem) )
00261             {
00262                 DeleteString(sel);
00263             }
00264
00265             //we have to prevent it going to another window
00266             bRes = TRUE;
00267         }
00268     }
00269
00270     return bRes;
00271 }

void CSmartComboBox::OnDropdown ( ) [protected]

CBN_DROPDOWN message handler, calculates the width of the drop-down list if the USmartCombo::AutoDropWidth feature is set.

Definition at line 183 of file SmartComboBox.cpp.

References 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

Parameters:
wParam | Value or a combinations of values enumerated under USmartCombo::Feature
lParam | Unused
Returns:
0

Definition at line 309 of file SmartComboBox.cpp.

References USmartCombo::SetFeature().

00310 {
00311     SetFeature((int)wParam);
00312     return 0;
00313 }

LRESULT CSmartComboBox::OnSetItems | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

WM_SMCB_SETITEMS private message handler

Parameters:
wParam | Pointer to persistent collection of items
lParam | Unused
Returns:
0

Definition at line 321 of file SmartComboBox.cpp.

References USmartCombo::SetItems().

00322 {
00323     SetItems((CMString*)wParam);
00324     return 0;
00325 }

LRESULT CSmartComboBox::OnSetReadOnly | ( | WPARAM | wParam,
 |  | LPARAM | lParam
 | ) | [protected]

WM_SMCB_SETREADONLY private message handler

Parameters:
wParam | Boolean value to set the read-only state
lParam | Unused
Returns:
0

Definition at line 333 of file SmartComboBox.cpp.

References SetReadOnly().

00334 {
00335     SetReadOnly(0 != wParam);
00336     return 0;
00337 }

void CSmartComboBox::PreSubclassWindow ( ) [protected, virtual]

PreSubclassWindow virtual override, sets the read-only state if the USmartCombo::ReadOnly feature is set.

Reimplemented in CKeywordComboBox.

Definition at line 274 of file SmartComboBox.cpp.

References USmartCombo::HasFeature(), and SetReadOnly().

Referenced by CKeywordComboBox::PreSubclassWindow().

00275 {
00276     if( HasFeature(USmartCombo::ReadOnly) )
00277     {
00278         SetReadOnly();
00279     }
00280
00281     CComboBox::PreSubclassWindow();
00282 }

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 192 of file SmartComboBox.cpp.

References DelKeyTest(), USmartCombo::HasFeature(), and TRUE.

00193 {
00194     if( HasFeature(USmartCombo::RemoveItems) )
00195     {
00196         if( DelKeyTest(pMsg) )
00197         {
00198             return TRUE;
00199         }
00200     }
00201
00202     return CComboBox::PreTranslateMessage(pMsg);
00203 }

void CSmartComboBox::SetReadOnly ( bool readOnly = true ) [virtual]

Set the read-only state (edit part of combo box)

Parameters:
readOnly true to set the read-only state, false otherwise
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 289 of file SmartComboBox.cpp.

References USmartCombo::SetReadOnly().

Referenced by CDiff_MAIN::OnInitDialog(), OnSetReadOnly(), and PreSubclassWindow().

00290 {
00291     USmartCombo::SetReadOnly(readOnly);
00292
00293     if( IsWindow(m_hWnd) )
00294     {
00295         CEdit* pEdit = (CEdit*)GetDlgItem(1001);
00296         if( pEdit && IsWindow(pEdit->m_hWnd) )
00297         {
00298             pEdit->SetReadOnly(readOnly);
00299         }
00300     }
00301 }

The documentation for this class was generated from the following files:
  • common/SmartComboBox.h
  • common/SmartComboBox.cpp
Generated on Fri Jan 31 12:19:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 34 of file SortHeaderCtrl.cpp.

References m_bSortAsc, m_nSortCol, and TRUE.

00035 {
00036     m_bSortAsc  = TRUE;
00037     m_nSortCol  = -1;
00038 }

CSortHeaderCtrl::~CSortHeaderCtrl ( ) [virtual]

Definition at line 40 of file SortHeaderCtrl.cpp.

00041 {
00042 }

Member Function Documentation

void CSortHeaderCtrl::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct ) [virtual]

Definition at line 65 of file SortHeaderCtrl.cpp.

References m_nSortCol.

00066 {
00067     CDC dc;
00068
00069     dc.Attach( lpDrawItemStruct->hDC );
00070
00071     // Get the column rect
00072     CRect rcLabel( lpDrawItemStruct->rcItem );
00073
00074     // Save DC
00075     int nSavedDC = dc.SaveDC();
00076
00077     // Set clipping region to limit drawing within column
00078     CRgn rgn;
00079     rgn.CreateRectRgnIndirect( &rcLabel );
00080     dc.SelectObject( &rgn );
00081     rgn.DeleteObject();
00082
00083     // Draw the background
00084     dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
00085
00086     // Labels are offset by a certain amount
00087     // This offset is related to the width of a space character
00088     int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2;
00089
00090     // Get the column text and format
00091     TCHAR buf[256];
00092     HD_ITEM hditem;
00093
00094     hditem.mask = HDI_TEXT | HDI_FORMAT;
00095     hditem.pszText = buf;
00096     hditem.cchTextMax = 255;
00097
00098     GetItem( lpDrawItemStruct->itemID, &hditem );
00099
00100     // Determine format for drawing column label
00101     UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
00102                         | DT_VCENTER | DT_END_ELLIPSIS ;
00103
00104     if( hditem.fmt & HDF_CENTER)
00105         uFormat |= DT_CENTER;
00106     else if( hditem.fmt & HDF_RIGHT)
00107         uFormat |= DT_RIGHT;
00108     else
00109         uFormat |= DT_LEFT;
00110
00111     // Adjust the rect if the mouse button is pressed on it
00112     if( lpDrawItemStruct->itemState == ODS_SELECTED )
00113     {
00114         rcLabel.left++;
00115         rcLabel.top += 2;
00116         rcLabel.right++;
00117     }
00118
00119     // Adjust the rect further if Sort arrow is to be displayed
00120     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00121     {
00122         rcLabel.right -= 3 * offset;
00123     }
00124
00125     rcLabel.left += offset;
00126     rcLabel.right -= offset;
00127
00128     // Draw column label
00129     if( rcLabel.left < rcLabel.right )
00130         dc.DrawText(buf,-1,rcLabel, uFormat);
00131
00132     // Draw the Sort arrow
00133     if( lpDrawItemStruct->itemID == (UINT)m_nSortCol )
00134     {
00135         CRect rcIcon( lpDrawItemStruct->rcItem );
00136
00137         // Set up pens to use for drawing the triangle
00138         CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
00139         CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
00140         CPen *pOldPen = dc.SelectObject( &penLight );
00141
00142         offset = (rcIcon.bottom - rcIcon.top) / 4;
00143         if (m_bSortAsc)
00144         {
00145             // Draw triangle pointing upwards
00146             dc.MoveTo( rcIcon.right - 2* offset, offset);
00147             dc.LineTo( rcIcon.right - offset, rcIcon.bottom - offset-1 );
00148             dc.LineTo( rcIcon.right - 3*offset-2, rcIcon.bottom - offset-1 );
00149             dc.MoveTo( rcIcon.right - 3*offset-1, rcIcon.bottom - offset-1 );
00150             dc.SelectObject( &penShadow );
00151             dc.LineTo( rcIcon.right - 2*offset, offset-1);
00152         }
00153         else
00154         {
00155             // Draw triangle pointing downwards
00156             dc.MoveTo( rcIcon.right - offset-1, offset);
00157             dc.LineTo( rcIcon.right - 2*offset-1, rcIcon.bottom - offset );
00158             dc.MoveTo( rcIcon.right - 2*offset-2, rcIcon.bottom - offset );
00159             dc.SelectObject( &penShadow );
00160             dc.LineTo( rcIcon.right - 3*offset-1, offset );
00161             dc.LineTo( rcIcon.right - offset-1, offset);
00162         }
00163
00164         // Restore the pen
00165         dc.SelectObject( pOldPen );
00166     }
00167
00168     // Restore dc
00169     dc.RestoreDC( nSavedDC );
00170
00171     // Detach the dc before returning
00172     dc.Detach();
00173 }

int CSortHeaderCtrl::SetSortImage | ( | int | nCol,
 |  | BOOL | bAsc
 | ) | [virtual]

Definition at line 44 of file SortHeaderCtrl.cpp.

References m_bSortAsc, and m_nSortCol.

Referenced by CBrowseFileView::Resort(), CSelectionDetailsDlg::SortItems(), CItemListDlg::SortItems(), and CDiff_Options::SortItems().

00045 {
00046     int nPrevCol = m_nSortCol;
00047
00048     m_nSortCol = nCol;
00049     m_bSortAsc = bAsc;
00050
00051     // Change the item to ownder drawn
00052     HD_ITEM hditem;
00053
00054     hditem.mask = HDI_FORMAT;
00055     GetItem( nCol, &hditem );
00056     hditem.fmt |= HDF_OWNERDRAW;
00057     SetItem( nCol, &hditem );
00058
00059     // Invalidate header control so that it gets redrawn
00060     Invalidate();
00061
00062     return nPrevCol;
00063 }

Member Data Documentation

BOOL CSortHeaderCtrl::m_bSortAsc [protected]

Definition at line 39 of file SortHeaderCtrl.h.

Referenced by CSortHeaderCtrl(), and SetSortImage().

int CSortHeaderCtrl::m_nSortCol [protected]

Definition at line 38 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 Fri Jan 31 12:19:44 2003 for WinCvs Source by doxygen 1.3-rc2


TemplateCSortList< T > class Reference

CSortList< T > Class Template Reference

#include <SortList.h>

Inheritance diagram for CSortList< T >:

[legend]
Collaboration diagram for CSortList< T >:

[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< T >::QsortMethod)(const T &, const T &)

Definition at line 48 of file SortList.h.

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< T >::fDef [private]

Definition at line 210 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList(), and CSortList< ENTNODE >::Insert().

template<class T>
T* CSortList< T >::fElems [private]

Definition at line 213 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList(), CSortList< ENTNODE >::Delete(), CSortList< ENTNODE >::Insert(), CSortList< ENTNODE >::Reset(), and CSortList< ENTNODE >::Result().

template<class T>
int CSortList< T >::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< T >::fMethod [private]

Definition at line 209 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList(), and CSortList< ENTNODE >::Location().

template<class T>
bool CSortList< T >::fNewOne [private]

Definition at line 214 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList(), CSortList< ENTNODE >::Insert(), CSortList< ENTNODE >::Inside(), and CSortList< ENTNODE >::InsideAndInsert().

template<class T>
int CSortList< T >::fNum [private]

Definition at line 211 of file SortList.h.

Referenced by CSortList< ENTNODE >::CSortList(), CSortList< ENTNODE >::Delete(), CSortList< ENTNODE >::Insert(), 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 Fri Jan 31 12:19:45 2003 for WinCvs Source by doxygen 1.3-rc2


CSortParam Struct Reference

Sort parameters. More...

#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

Detailed Description

Sort parameters.

Definition at line 87 of file BrowseViewColumn.h.

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_column(column)
00091     , m_columnAlt(columnAlt)
00092     , m_context(context)
00093     , m_fAccendant(fAccendant)
00094     , m_fGroupSubDir(fGroupSubDir)
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 Fri Jan 31 12:19:46 2003 for WinCvs Source by doxygen 1.3-rc2


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)

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 49 of file Splash.cpp.

00050 {
00051 }

CSplashWnd::~CSplashWnd ( )

Definition at line 53 of file Splash.cpp.

References ASSERT, c_pSplashWnd, and NULL.

00054 {
00055     // Clear the static window pointer.
00056     ASSERT(c_pSplashWnd == this);
00057     c_pSplashWnd = NULL;
00058 }

Member Function Documentation

BOOL CSplashWnd::Create ( CWnd * pParentWnd = NULL ) [protected]

Definition at line 108 of file Splash.cpp.

References FALSE, m_bitmap, and NULL.

Referenced by ShowSplashScreen().

00109 {
00110     if (!m_bitmap.LoadBitmap(IDB_SPLASH))
00111         return FALSE;
00112
00113     BITMAP bm;
00114     m_bitmap.GetBitmap(&bm);
00115
00116     return CreateEx(0,
00117         AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
00118         NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
00119 }

void CSplashWnd::EnableSplashScreen ( BOOL bEnable = TRUE ) [static]

Definition at line 68 of file Splash.cpp.

References c_bShowSplashWnd.

Referenced by CWincvsApp::InitInstance().

00069 {
00070     c_bShowSplashWnd = bEnable;
00071 }

void CSplashWnd::HideSplashScreen ( ) [protected]

Definition at line 121 of file Splash.cpp.

Referenced by OnTimer(), and PreTranslateAppMessage().

00122 {
00123     // Destroy the window, and update the mainframe.
00124     DestroyWindow();
00125     AfxGetMainWnd()->UpdateWindow();
00126 }

int CSplashWnd::OnCreate ( LPCREATESTRUCT lpCreateStruct ) [protected]

Definition at line 134 of file Splash.cpp.

00135 {
00136     if (CWnd::OnCreate(lpCreateStruct) == -1)
00137         return -1;
00138
00139     // Center the window.
00140     CenterWindow();
00141
00142     // Set a timer to destroy the splash screen.
00143     SetTimer(1, 750, NULL);
00144
00145     return 0;
00146 }

void CSplashWnd::OnPaint ( ) [protected]

Definition at line 148 of file Splash.cpp.

References CStr, CWincvsApp::GetAppVersion(), and m_bitmap.

00149 {
00150     CPaintDC dc(this);
00151
00152     CDC dcImage;
00153     if (!dcImage.CreateCompatibleDC(&dc))
00154         return;
00155
00156     BITMAP bm;
00157     m_bitmap.GetBitmap(&bm);
00158
00159     // Paint the image.
00160     CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
00161     dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
00162     dcImage.SelectObject(pOldBitmap);
00163
00164     // Get version information from the application
00165     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00166     CStr vers;
00167
00168     if(app->GetAppVersion(vers))
00169     {
00170         dc.SetBkMode(TRANSPARENT);
00171         dc.SetTextAlign(TA_RIGHT | TA_TOP);
00172         dc.TextOut(bm.bmWidth - gc_nBitmapRightMargin - 10, 219, vers, vers.length());
00173     }
00174 }

void CSplashWnd::OnTimer ( UINT nIDEvent ) [protected]

Definition at line 176 of file Splash.cpp.

References HideSplashScreen().

00177 {
00178     // Destroy the splash screen window.
00179     HideSplashScreen();
00180 }

void CSplashWnd::PostNcDestroy ( ) [virtual]

Definition at line 128 of file Splash.cpp.

00129 {
00130     // Free the C++ class.
00131     delete this;
00132 }

BOOL CSplashWnd::PreTranslateAppMessage ( MSG * pMsg ) [static]

Definition at line 86 of file Splash.cpp.

References c_pSplashWnd, FALSE, HideSplashScreen(), NULL, and TRUE.

Referenced by CWincvsApp::PreTranslateMessage().

00087 {
00088     if (c_pSplashWnd == NULL)
00089         return FALSE;
00090
00091     // If we get a keyboard or mouse message, hide the splash screen.
00092     if (pMsg->message == WM_KEYDOWN ||
00093         pMsg->message == WM_SYSKEYDOWN ||
00094         pMsg->message == WM_LBUTTONDOWN ||
00095         pMsg->message == WM_RBUTTONDOWN ||
00096         pMsg->message == WM_MBUTTONDOWN ||
00097         pMsg->message == WM_NCLBUTTONDOWN ||
00098         pMsg->message == WM_NCRBUTTONDOWN ||
00099         pMsg->message == WM_NCMBUTTONDOWN)
00100     {
00101         c_pSplashWnd->HideSplashScreen();
00102         return TRUE;    // message handled here
00103     }
00104
00105     return FALSE;   // message not handled
00106 }

void CSplashWnd::ShowSplashScreen ( CWnd * pParentWnd = NULL ) [static]

Definition at line 73 of file Splash.cpp.

References c_bShowSplashWnd, c_pSplashWnd, Create(), and NULL.

Referenced by CMainFrame::OnCreate().

00074 {
00075     if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
00076         return;
00077
00078     // Allocate a new splash screen, and create the window.
00079     c_pSplashWnd = new CSplashWnd;
00080     if (!c_pSplashWnd->Create(pParentWnd))
00081         delete c_pSplashWnd;
00082     else
00083         c_pSplashWnd->UpdateWindow();
00084 }

Member Data Documentation

BOOL CSplashWnd::c_bShowSplashWnd [static, protected]

Definition at line 47 of file Splash.cpp.

Referenced by EnableSplashScreen(), and ShowSplashScreen().

CSplashWnd * CSplashWnd::c_pSplashWnd [static, protected]

Definition at line 48 of file Splash.cpp.

Referenced by PreTranslateAppMessage(), ShowSplashScreen(), and ~CSplashWnd().

CBitmap CSplashWnd::m_bitmap

Definition at line 40 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 Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


CStackThreadLock Struct Reference

Critical section used for cvs process stack operations. More...

List of all members.

Public Methods

CStackThreadLock ()
~CStackThreadLock ()

Detailed Description

Critical section used for cvs process stack operations.

Definition at line 187 of file cvsgui_process.cpp.

Constructor & Destructor Documentation

CStackThreadLock::CStackThreadLock ( ) [inline]

Definition at line 190 of file cvsgui_process.cpp.

00191     {
00192         EnterCriticalSection(&CDummyInit::m_stacklock);
00193     }

CStackThreadLock::~CStackThreadLock ( ) [inline]

Definition at line 195 of file cvsgui_process.cpp.

00196     {
00197         LeaveCriticalSection(&CDummyInit::m_stacklock);
00198     }

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.cpp
Generated on Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


TemplateCStaticAllocT< T > class Reference

CStaticAllocT< T > Class Template Reference

#include <CPStr.h>

Inheritance diagram for CStaticAllocT< T >:

[legend]
Collaboration diagram for CStaticAllocT< T >:

[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 154 of file CPStr.h.

00155     {
00156         buf = 0L;
00157         numbuf = 0;
00158     }

template<class T>
CStaticAllocT< T >::~CStaticAllocT ( ) [inline]

Definition at line 160 of file CPStr.h.

00161     {
00162         if(buf != 0L)
00163             free(buf);
00164     }

Member Function Documentation

template<class T>
void CStaticAllocT< T >::AdjustSize ( size_t size ) [inline]

Definition at line 166 of file CPStr.h.

Referenced by CleanupLogMsg(), and CPersistent::LoadAll().

00167     {
00168         if(numbuf < size)
00169         {
00170             if(buf == 0L)
00171                 buf = (T *)malloc(size * sizeof(T));
00172             else
00173                 buf = (T *)realloc(buf, size * sizeof(T));
00174             if(buf == 0L)
00175                 throw std::bad_alloc();
00176             numbuf = size;
00177         }
00178     }

template<class T>
CStaticAllocT< T >::operator const T * ( void ) const [inline]

Definition at line 181 of file CPStr.h.

00181 { return buf; }

template<class T>
CStaticAllocT< T >::operator T * ( void ) const [inline]

Definition at line 180 of file CPStr.h.

00180 { return buf; }

template<class T>
size_t CStaticAllocT< T >::size ( ) const [inline]

Definition at line 187 of file CPStr.h.

00187 { return numbuf; }

Member Data Documentation

template<class T>
T* CStaticAllocT< T >::buf [protected]

Definition at line 189 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< T >::numbuf [protected]

Definition at line 190 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 Fri Jan 31 12:19:48 2003 for WinCvs Source by doxygen 1.3-rc2


CStatus_MAIN Class Reference

#include <StatusDlg.h>

Inheritance diagram for CStatus_MAIN:

[legend]
Collaboration diagram for CStatus_MAIN:

[legend]
List of all members.

Public Types

enum | { IDD = IDD_STATUS_MAIN }

Public Methods

CStatus_MAIN (bool noRecurs, STATUSOUTPUT_TYPE outputType)
~CStatus_MAIN ()

Public Attributes

BOOL | m_noRecurs
int | m_outputType

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 54 of file StatusDlg.h.

00054 { IDD = IDD_STATUS_MAIN };

Constructor & Destructor Documentation

CStatus_MAIN::CStatus_MAIN | ( | bool | noRecurs,
 |  | STATUSOUTPUT_TYPE | outputType
 | ) |

Definition at line 65 of file StatusDlg.cpp.

References m_noRecurs, and m_outputType.

00066     : CPropertyPage(CStatus_MAIN::IDD)
00067 {
00068     m_noRecurs = noRecurs;
00069     m_outputType = (int)outputType;
00070 }

CStatus_MAIN::~CStatus_MAIN ( )

Definition at line 72 of file StatusDlg.cpp.

00073 {
00074 }

Member Function Documentation

void CStatus_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 76 of file StatusDlg.cpp.

00077 {
00078     CPropertyPage::DoDataExchange(pDX);
00079     //{{AFX_DATA_MAP(CStatus_MAIN)
00080     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00081     DDX_Radio(pDX, IDC_OUTPUT_STANDARD, m_outputType);
00082     //}}AFX_DATA_MAP
00083 }

Member Data Documentation

BOOL CStatus_MAIN::m_noRecurs

Definition at line 55 of file StatusDlg.h.

Referenced by CompatGetStatus(), and CStatus_MAIN().

int CStatus_MAIN::m_outputType

Definition at line 56 of file StatusDlg.h.

Referenced by CompatGetStatus(), and CStatus_MAIN().

The documentation for this class was generated from the following files:
  • common/StatusDlg.h
  • common/StatusDlg.cpp
Generated on Fri Jan 31 12:19:49 2003 for WinCvs Source by doxygen 1.3-rc2


CStatusBar Class Reference

Inheritance diagram for CStatusBar:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CvsStatusBar.h
Generated on Fri Jan 31 12:19:49 2003 for WinCvs Source by doxygen 1.3-rc2


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)

const char * | operator= (const unsigned char *newstr)
set from a P String (0L is OK)

const UStr & | operator= (const UStr &newstr)
set according to another UStr

const UStr & | set (const char *buf, unsigned int len)
set from a buffer

bool | operator< (const UStr &str) const
compare, provided to compile with STL

bool | operator> (const UStr &str) const
compare, provided to compile with STL

bool | operator== (const UStr &str) const
compare, provided to compile with STL

bool | operator== (const char *str) const
compare, provided to compile with STL

bool | operator!= (const UStr &str) const
compare, provided to compile with STL

bool | operator!= (const char *str) const
compare, provided to compile with STL

operator const char * () const
as a C string

operator char * ()
as a C string

const char * | c_str () const
as a C string

UStr & | operator<< (const char *addToStr)
concatenate

UStr & | operator<< (char addToStr)
concatenate

UStr & | operator<< (int addToStr)
concatenate

UStr & | operator+= (int addToStr)
concatenate

UStr & | operator+= (char *addToStr)
concatenate

UStr & | operator+= (const char *addToStr)
concatenate

UStr & | operator+= (const UStr &addToStr)
concatenate

int | compare (const char *thestr) const
compare

bool | endsWith (char c) const
const UStr & | replace (char which, char bywhich)
replace a character

const int | find (const char *thestr) const
find a string

const int | rfind (const char *thestr) const
const int | find (char thechar) const
find a character

const int | rfind (char thechar) const
char * | substr (int idx, int len) const
get substring

UStr & | substr (int idx, int len, UStr &subStr) const
get substring in an UStr; returns input reference for convenience

Protected Methods

void | flush (void)

Protected Attributes

char * | str
the String

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 CDiff_MAIN::CDiff_MAIN(), CompatGetPrefs(), CvsCmdMoveToTrash(), 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 187 of file ustr.h.

Referenced by CMacroEntry::operator==().

00187 { 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(), CompatGetCommit(), 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(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), UCvsFolders::OnCreate(), AuthenSSH::OnGetEnv(), CItemListDlg::OnInitDialog(), CCommit_MAIN::OnInitDialog(), AuthenRhosts::OnRestoreEnv(), AuthenPserver::OnRestoreEnv(), AuthenSSH::OnRestoreEnv(), AuthenModel::OnRestoreEnv(), AuthenSSH::OnSetupEnv(), CCommit_MAIN::OnTemplate(), ReportConflict::PrintOut(), CWinCvsBrowser::ResetBrowser(), UCvsFolders::ResetBrowser(), UCvsFolders::ResetView(), AuthenSSH::RsaIdentityFile(), CvsPrefs::RshName(), SaveAsPersistentSettings(), SavePersistentSettings(), CvsPrefs::SetHome(), KoFilterModel::SetMask(), CvsPrefs::SettingsFolder(), CvsPrefs::SetWhichCvs(), CvsPrefs::Viewer(), and CvsPrefs::WhichCvs().

00134 {return str == 0L || str[0] == '\0';}

bool UStr::endsWith ( char c ) const [inline]

Definition at line 189 of file ustr.h.

Referenced by BuildIgnoredList(), CCommit_MAIN::CCommit_MAIN(), CFindSettings::CFindSettings(), CompatGetCommit(), CompatGetPrefs(), CvsCmdMoveToTrash(), Entries_Open(), EntnodePath::GetFullPathName(), UCvsFolders::GetItemByLocation(), getLoc(), CvsPrefs::Home(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CItemListDlg::OnInitDialog(), CCommit_MAIN::OnInitDialog(), UCvsFolders::OnUpdateGeneric(), CWinCvsBrowser::ResetBrowser(), UCvsFolders::ResetBrowser(), UCvsFolders::RetrievePath(), CPersistent::SaveAllSettings(), SaveAsPersistentSettings(), CvsPrefs::SetHome(), UCvsFolders::StepToLocation(), and CvsPrefs::WhichCvs().

00189 {return !length() ? false : str[length()-1] == c;}

const int UStr::find ( char thechar ) const

find a character

Definition at line 375 of file ustr.cpp.

References NULL, and str.

00376 {
00377     char* buf;
00378     buf = strchr(str, thechar);
00379
00380     if(buf != NULL)
00381         return buf - str;
00382
00383     return 0;
00384 }

const int UStr::find ( const char * thestr ) const

find a string

Definition at line 363 of file ustr.cpp.

References NULL, and str.

00364 {
00365     if(thestr != NULL) {
00366         char* buf;
00367         buf = strstr(str, thestr);
00368
00369         if(buf != NULL)
00370             return buf - str;
00371     }
00372
00373     return 0;
00374 }

void UStr::flush ( void ) [protected]

Definition at line 184 of file ustr.cpp.

References free, and str.

Referenced by operator=(), set(), and substr().

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(), operator<<(), CBrowseFileView::ProcessSelectionCommand(), UCvsFiles::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 359 of file ustr.cpp.

00360 {
00361     return strcmp(*this, str) != 0;
00362 }

bool UStr::operator!= ( const UStr & str ) const

compare, provided to compile with STL

Definition at line 354 of file ustr.cpp.

00355 {
00356     return strcmp(*this, str) != 0;
00357 }

UStr & UStr::operator+= ( const UStr & addToStr )

concatenate

Definition at line 324 of file ustr.cpp.

00325 {
00326     return *this << (const char *)addToStr;
00327 }

UStr & UStr::operator+= ( const char * addToStr )

concatenate

Definition at line 319 of file ustr.cpp.

00320 {
00321     return *this << addToStr;
00322 }

UStr & UStr::operator+= ( char * addToStr )

concatenate

Definition at line 314 of file ustr.cpp.

00315 {
00316     return *this << addToStr;
00317 }

UStr & UStr::operator+= ( int addToStr )

concatenate

Definition at line 329 of file ustr.cpp.

00330 {
00331     return *this << addToStr;
00332 }

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 }

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 349 of file ustr.cpp.

00350 {
00351     return strcmp(*this, str) == 0;
00352 }

bool UStr::operator== ( const UStr & str ) const

compare, provided to compile with STL

Definition at line 344 of file ustr.cpp.

00345 {
00346     return strcmp(*this, str) == 0;
00347 }

bool UStr::operator> ( const UStr & str ) const

compare, provided to compile with STL

Definition at line 339 of file ustr.cpp.

00340 {
00341     return strcmp(*this, str) > 0;
00342 }

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 int UStr::rfind ( char thechar ) const

Definition at line 405 of file ustr.cpp.

References NULL, and str.

00406 {
00407     char* buf;
00408     buf = strrchr(str, thechar);
00409
00410     if(buf != NULL)
00411         return buf - str;
00412
00413     return 0;
00414 }

const int UStr::rfind ( const char * thestr ) const

Definition at line 385 of file ustr.cpp.

References NULL, and str.

00386 {
00387     if(thestr != NULL) {
00388         char* buf = str;
00389         char* last_buf = NULL;
00390
00391         while (buf) {
00392             last_buf = buf;
00393             buf++;
00394
00395             buf = strstr(buf, thestr);
00396         }
00397
00398         if(last_buf != NULL)
00399             return last_buf - str;
00400     }
00401
00402     return 0;
00403 }

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 }

UStr & UStr::substr | ( | int | idx,
 |  | int | len,
 |  | UStr & | subStr
 | ) | const

get substring in an UStr; returns input reference for convenience

Definition at line 433 of file ustr.cpp.

References flush(), str, and substr().

00434 {
00435   subStr.flush();
00436   subStr.str = this->substr(idx, len);
00437   return subStr;
00438 }

char * UStr::substr | ( | int | idx,
 |  | int | len
 | ) | const

get substring

Definition at line 417 of file ustr.cpp.

References malloc, str, and UTHROW.

Referenced by substr().

00418 {
00419     char *newvalue = (char *)malloc((len + 1) * sizeof(char));
00420
00421     if(newvalue == 0L)
00422         UTHROW(std::bad_alloc());
00423
00424     for(int i=0; i<len; i++) {
00425         newvalue[i] = str[i+idx];
00426     }
00427
00428     newvalue[len] = '\0';
00429
00430     return newvalue;
00431 }

Member Data Documentation

char* UStr::str [protected]

the String

Definition at line 210 of file ustr.h.

Referenced by find(), flush(), operator<<(), operator=(), replace(), rfind(), set(), PCStr::SizeOf(), and substr().

The documentation for this class was generated from the following files:
  • rf/ustr.h
  • rf/ustr.cpp
Generated on Fri Jan 31 12:19:50 2003 for WinCvs Source by doxygen 1.3-rc2


CStreamConsole Class Reference

Class to implement stream console. More...

#include <AppGlue.h>

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)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

Protected Attributes

FILE * | m_fOut

Detailed Description

Class to implement stream console.

Definition at line 81 of file AppGlue.h.

Constructor & Destructor Documentation

CStreamConsole::CStreamConsole ( FILE * out )

Definition at line 730 of file AppGlue.cpp.

00731     : m_fOut(out)
00732 {
00733 }

Member Function Documentation

long CStreamConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 741 of file AppGlue.cpp.

References cvs_errstr().

00742 {
00743     cvs_errstr(txt, len);
00744     return len;
00745 }

long CStreamConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 735 of file AppGlue.cpp.

00736 {
00737     fwrite(txt, sizeof(char), len, m_fOut);
00738     return len;
00739 }

Member Data Documentation

FILE* CStreamConsole::m_fOut [protected]

Out file handle

Definition at line 90 of file AppGlue.h.

The documentation for this class was generated from the following files:
  • common/AppGlue.h
  • common/AppGlue.cpp
Generated on Fri Jan 31 12:19:51 2003 for WinCvs Source by doxygen 1.3-rc2


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().

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 | hwnd,
 |  | UINT | msg,
 |  | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [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 Fri Jan 31 12:19:52 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 Fri Jan 31 12:19:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, kTagDlgType type, const char *sLastTag, bool noRecurs, bool checkUnmod=false, bool overwriteExisting=false)
~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 ()
afx_msg void | OnBrowseTag ()

Private Attributes

const MultiFiles * | m_mf
kTagDlgType m_type

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 75 of file TagDlg.h.

00075 { IDD = IDD_TAG_MAIN };

Constructor & Destructor Documentation

CTag_MAIN::CTag_MAIN | ( | const MultiFiles * | mf,
 |  | kTagDlgType | type,
 |  | const char * | sLastTag,
 |  | bool | noRecurs,
 |  | bool | checkUnmod = false,
 |  | bool | overwriteExisting = false
 | ) |

Definition at line 69 of file TagDlg.cpp.

References m_checkUnmod, m_noRecurs, m_overwriteExisting, m_tagCombo, m_tagName, m_type, and USmartCombo::SetItems().

00073                      : m_mf(mf), CPropertyPage(CTag_MAIN::IDD)
00074 {
00075     m_type = type;
00076
00077     m_noRecurs = noRecurs;
00078     m_checkUnmod = checkUnmod;
00079     m_overwriteExisting = overwriteExisting;
00080     m_tagName = sLastTag;
00081
00082     m_tagCombo.SetItems(&gRevNames);
00083 }

CTag_MAIN::~CTag_MAIN ( )

Definition at line 85 of file TagDlg.cpp.

00086 {
00087 }

Member Function Documentation

void CTag_MAIN::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 89 of file TagDlg.cpp.

References DDV_MinChars(), and DDX_ComboMString().

00090 {
00091     CPropertyPage::DoDataExchange(pDX);
00092     //{{AFX_DATA_MAP(CTag_MAIN)
00093     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00094     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00095     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00096     DDX_Control(pDX, IDC_CHECKUNMOD, m_checkUnmodCheck);
00097     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00098     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00099     DDX_Check(pDX, IDC_CHECKUNMOD, m_checkUnmod);
00100     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00101     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00102     //}}AFX_DATA_MAP
00103
00104     DDV_MinChars(pDX, m_tagName, 1);
00105     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00106 }

void CTag_MAIN::OnBrowseTag ( ) [protected]

Definition at line 156 of file TagDlg.cpp.

References CompatGetTagListItem(), CStr, m_tagCombo, and m_tagName.

00157 {
00158     CStr tagName;
00159     if( CompatGetTagListItem(m_mf, tagName) )
00160     {
00161         m_tagName = (const char*)tagName;
00162         m_tagCombo.SetWindowText(m_tagName);
00163     }
00164 }

BOOL CTag_MAIN::OnInitDialog ( ) [protected, virtual]

Definition at line 118 of file TagDlg.cpp.

References ASSERT, kTagAdd, kTagBranch, kTagDelete, m_checkUnmodCheck, m_grpBox, m_overwriteExistingCheck, m_tagDescStatic, and TRUE.

00119 {
00120     CPropertyPage::OnInitDialog();
00121
00122     // set the type-specific data
00123     CString strGrpBox;
00124     CString strTagDesc;
00125
00126     switch( m_type )
00127     {
00128     case kTagAdd:
00129         strGrpBox = "Enter the tag name to create:";
00130         strTagDesc = "New tag &name:";
00131         break;
00132     case kTagDelete:
00133         strGrpBox = "Enter the tag name to delete:";
00134         strTagDesc = "Delete tag &name:";
00135
00136         m_checkUnmodCheck.ShowWindow(SW_HIDE);
00137         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00138         break;
00139     case kTagBranch:
00140         strGrpBox = "Enter the branch name to create:";
00141         strTagDesc = "New branch &name:";
00142
00143         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00144         break;
00145     default:
00146         ASSERT(FALSE); //unknown type
00147     }
00148
00149     m_grpBox.SetWindowText(strGrpBox);
00150     m_tagDescStatic.SetWindowText(strTagDesc);
00151
00152     return TRUE;  // return TRUE unless you set the focus to a control
00153                   // EXCEPTION: OCX Property Pages should return FALSE
00154 }

Member Data Documentation

BOOL CTag_MAIN::m_checkUnmod

Definition at line 82 of file TagDlg.h.

Referenced by CompatTagBranch(), CompatTagCreate(), and CTag_MAIN().

CButton CTag_MAIN::m_checkUnmodCheck

Definition at line 79 of file TagDlg.h.

Referenced by OnInitDialog().

CButton CTag_MAIN::m_grpBox

Definition at line 77 of file TagDlg.h.

Referenced by OnInitDialog().

const MultiFiles* CTag_MAIN::m_mf [private]

Definition at line 104 of file TagDlg.h.

BOOL CTag_MAIN::m_noRecurs

Definition at line 81 of file TagDlg.h.

Referenced by CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), and CTag_MAIN().

BOOL CTag_MAIN::m_overwriteExisting

Definition at line 83 of file TagDlg.h.

Referenced by CompatTagCreate(), and CTag_MAIN().

CButton CTag_MAIN::m_overwriteExistingCheck

Definition at line 78 of file TagDlg.h.

Referenced by OnInitDialog().

CSmartComboBox CTag_MAIN::m_tagCombo

Definition at line 80 of file TagDlg.h.

Referenced by CTag_MAIN(), and OnBrowseTag().

CStatic CTag_MAIN::m_tagDescStatic

Definition at line 76 of file TagDlg.h.

Referenced by OnInitDialog().

CString CTag_MAIN::m_tagName

Definition at line 84 of file TagDlg.h.

Referenced by CompatTagBranch(), CompatTagCreate(), CompatTagDelete(), CTag_MAIN(), and OnBrowseTag().

kTagDlgType CTag_MAIN::m_type [private]

Definition at line 105 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 Fri Jan 31 12:19:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:55 2003 for WinCvs Source by doxygen 1.3-rc2


CTagParserConsole Class Reference

Class to parse tags/branches (obtained using cvs log or cvs rlog). More...

#include <ItemListDlg.h>

Inheritance diagram for CTagParserConsole:

[legend]
Collaboration diagram for CTagParserConsole:

[legend]
List of all members.

Public Methods

CTagParserConsole ()
virtual | ~CTagParserConsole ()
virtual void | Parse (int launchRes)

Detailed Description

Class to parse tags/branches (obtained using cvs log or cvs rlog).

Definition at line 110 of file ItemListDlg.h.

Constructor & Destructor Documentation

CTagParserConsole::CTagParserConsole ( )

Definition at line 149 of file ItemListDlg.cpp.

00150 {
00151 }

CTagParserConsole::~CTagParserConsole ( ) [virtual]

Definition at line 153 of file ItemListDlg.cpp.

00154 {
00155 }

Member Function Documentation

void CTagParserConsole::Parse ( int launchRes ) [virtual]

Virtual overridable to parse the result of browse command

Parameters:
launchRes The result of the command launch
Note:
Call default implementation after parsing is finished to clear the stored command output and store the launch result, the error output is not cleared however to allow further analysis

Implements CItemListConsole.

Definition at line 157 of file ItemListDlg.cpp.

References getline(), ItemRowInfo::m_description, CItemListConsole::m_itemList, CItemListConsole::Parse(), STR_ITEMLIST_BRANCH, and STR_ITEMLIST_REVISION.

00158 {
00159     bool btag = false;
00160
00161     string line;
00162
00163     while( getline(m_cvsOut, line) )
00164     {
00165         if( btag )
00166         {
00167             if( line.size() == 0 || line.find("keyword substitution:") != -1 )
00168             {
00169                 btag = false;
00170             }
00171             else
00172             {
00173                 stringstream stream;
00174                 string tag;
00175
00176                 stream << line;
00177                 stream >> tag;
00178
00179                 tag.erase(tag.find(':'), tag.size());
00180
00181                 if( !tag.empty() )
00182                 {
00183                     ItemRowInfo rowInfo;
00184                     string type;
00185
00186                     stream >> type;
00187
00188                     if( type.size() > 0 )
00189                     {
00190                         bool isBranch = false;
00191
00192                         const int dotsCount = count(type.begin(), type.end(), '.');
00193                         if( dotsCount > 2 && dotsCount % 2 )
00194                         {
00195                             // If we have even and greater than two number of separated integers
00196                             // then check if it's a magic branch
00197                             string magicTest = type;
00198                             magicTest.erase(magicTest.find_last_of('.'), magicTest.size());
00199                             magicTest.erase(0, magicTest.find_last_of('.') + 1);
00200
00201                             if( !magicTest.empty() && magicTest[0] == '0' )
00202                             {
00203                                 isBranch = true;
00204                             }
00205                         }
00206                         else if( dotsCount > 1 && !(dotsCount % 2) )
00207                         {
00208                             // We have an odd and greater than one number of integers, surely a branch
00209                             isBranch = true;
00210                         }
00211
00212                         // Set the type appropriate to findings
00213                         type = isBranch ? STR_ITEMLIST_BRANCH : STR_ITEMLIST_REVISION;
00214                     }
00215
00216                     ItemList::iterator i = m_itemList.find(tag);
00217                     if( i != m_itemList.end() )
00218                     {
00219                         if( !type.empty() )
00220                         {
00221                             (*i).second.m_description.insert(type);
00222                         }
00223                     }
00224                     else
00225                     {
00226                         if( !type.empty() )
00227                         {
00228                             rowInfo.m_description.insert(type);
00229                         }
00230
00231                         m_itemList.insert(std::make_pair(tag, rowInfo));
00232                     }
00233                 }
00234             }
00235         }
00236
00237         if( line.find("symbolic names:") != -1 )
00238         {
00239             btag = true;
00240         }
00241     }
00242
00243     CItemListConsole::Parse(launchRes);
00244 }

The documentation for this class was generated from the following files:
  • common/ItemListDlg.h
  • common/ItemListDlg.cpp
Generated on Fri Jan 31 12:19:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 913 of file umain.h.

Referenced by UToolbar::OnTbButton(), UToolbar::OnTbCheckBtn(), and UToolbar::OnTbDropDown().

UTB_DROP UTB_BUTTON::drop

Definition at line 915 of file umain.h.

const void* UTB_BUTTON::icon

Definition at line 912 of file umain.h.

Referenced by UToolbar::OnTbButton(), UToolbar::OnTbCheckBtn(), and UToolbar::OnTbDropDown().

const char* UTB_BUTTON::tooltip

Definition at line 916 of file umain.h.

Referenced by UToolbar::OnTbButton(), UToolbar::OnTbCheckBtn(), and UToolbar::OnTbDropDown().

UTB_VAR UTB_BUTTON::varcode

Definition at line 914 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 Fri Jan 31 12:19:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 922 of file umain.h.

Referenced by UToolbar::OnTbDropDown().

int UTB_DROPDOWN::initialcmd

Definition at line 921 of file umain.h.

Referenced by UToolbar::OnTbDropDown().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:19:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 893 of file umain.h.

Referenced by CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainToolbar(), and UToolbar::OnTbInit().

const char* UTB_INIT::title

Definition at line 894 of file umain.h.

Referenced by CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainToolbar(), and UToolbar::OnTbInit().

int UTB_INIT::widthbtn

Definition at line 893 of file umain.h.

Referenced by CreateBrowseToolbar(), CreateFilterToolbar(), CreateMainToolbar(), and UToolbar::OnTbInit().

int UTB_INIT::winid

Definition at line 896 of file umain.h.

Referenced by UToolbar::OnTbInit().

The documentation for this struct was generated from the following file:
  • rf/umain.h
Generated on Fri Jan 31 12:19:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 41 of file TbEdit.h.

00041 { WM_CONTENTCHANGE = WM_APP + 56};

Constructor & Destructor Documentation

CTbEdit::CTbEdit ( )

Definition at line 37 of file TbEdit.cpp.

00038 {
00039 }

CTbEdit::~CTbEdit ( ) [virtual]

Definition at line 41 of file TbEdit.cpp.

00042 {
00043 }

Member Function Documentation

BOOL CTbEdit::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 55 of file TbEdit.cpp.

00056 {
00057     if (pMsg->message == WM_KEYDOWN)
00058     {
00059         int nVirtKey = (int) pMsg->wParam;
00060         switch (nVirtKey)
00061         {
00062             case VK_ESCAPE:
00063                 GetOwner()->PostMessage(WM_CONTENTCHANGE, FALSE);
00064                 break;
00065             case VK_RETURN:
00066                 GetOwner()->PostMessage(WM_CONTENTCHANGE, TRUE);
00067                 break;
00068         }
00069     }
00070     return CEdit::PreTranslateMessage(pMsg);
00071 }

The documentation for this class was generated from the following files:
  • WinCvs/TbEdit.h
  • WinCvs/TbEdit.cpp
Generated on Fri Jan 31 12:19:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:58 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:19:58 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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 Fri Jan 31 12:19:59 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:20:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:01 2003 for WinCvs Source by doxygen 1.3-rc2


TBrowserFill Class Reference

Class to create an item with all the subdirectories inside for a given path and a root item. More...

#include <WinCvsBrowser.h>

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)

Public Attributes

UTREEITEM m_root
UTREEITEM m_item
UCvsFolders * m_treeCtrl
CSortList< ENTNODE > & m_entries
std::vector< UStr > m_ignlist
bool | m_isShowIgnored

Private 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 | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Private Attributes

HTREEITEM | m_root
HTREEITEM | m_item
CTreeCtrl & m_treeCtrl
bool | m_hascvs
CSortList< ENTNODE > & m_entries
vector< UStr > | m_ignlist

Detailed Description

Class to create an item with all the subdirectories inside for a given path and a root item.

Definition at line 354 of file UCvsFolders.cpp.

Constructor & Destructor Documentation

TBrowserFill::TBrowserFill | ( | UCvsFolders * | treeCtrl,
 |  | UTREEITEM | root,
 |  | UTREEITEM | item,
 |  | CSortList< ENTNODE > & | entries
 | ) | [inline]

Definition at line 364 of file UCvsFolders.cpp.

References UCvsApp::gApp, UCvsApp::GetIgnoreModel(), and KiIgnoreModel::IsShowIgnored().

00364                                                                                                       :
00365             m_root(root), m_item(item), m_treeCtrl(treeCtrl),
00366             m_entries(entries), m_isShowIgnored(false)
00367     {
00368         if( UCvsApp* app = UCvsApp::gApp )
00369             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00370     }

virtual TBrowserFill::~TBrowserFill ( ) [inline, virtual]

Definition at line 372 of file UCvsFolders.cpp.

00372 {}

TBrowserFill::TBrowserFill | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | root,
 |  | HTREEITEM | item,
 |  | CSortList< ENTNODE > & | entries
 | ) |

Definition at line 245 of file WinCvsBrowser.cpp.

References CWincvsApp::GetIgnoreModel(), KiIgnoreModel::IsShowIgnored(), and m_isShowIgnored.

00246     : m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_hascvs(false), m_entries(entries), m_isShowIgnored(false)
00247 {
00248     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
00249     {
00250         m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00251     }
00252 }

Member Function Documentation

virtual kTraversal TBrowserFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 374 of file UCvsFolders.cpp.

References ASSERT, BuildIgnoredList(), Entries_Open(), kContinueTraversal, and kTraversal.

00375     {
00376         ASSERT(m_item != 0L);
00377
00378         // assign the entries to this item
00379         Entries_Open (m_entries, fullpath);
00380         BuildIgnoredList(m_ignlist, fullpath);
00381
00382         return kContinueTraversal;
00383     }

virtual kTraversal TBrowserFill::ExitDirectory ( const char * fullpath ) [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 385 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, and UEventSendMessage().

00386     {
00387         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00388
00389         UTREE_INFO query;
00390         query.item = m_item;
00391         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00392         query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, true, (EntnodeData *)query.data);
00393         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00394
00395         return kContinueTraversal;
00396     }

virtual kTraversal TBrowserFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [private, virtual]

Reimplemented from TraversalReport.

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 408 of file UCvsFolders.cpp.

References Entries_SetVisited(), EV_TREE_SETICON, FileTraverse(), GetIcon(), UCmdTarget::GetWidID(), UTREE_INFO::icon, EntnodeData::IsIgnored(), UTREE_INFO::item, kSkipFile, kTraversal, kUMainWidget, TBrowserFillDummy::m_item, and UEventSendMessage().

00412     {
00413 #if qUnix
00414         if(strcmp(name, "CVS") == 0)
00415 #else
00416         if(stricmp(name, "cvs") == 0)
00417 #endif
00418             return kSkipFile;
00419
00420         // is the sub-directory ignored ?
00421         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00422         if(!m_isShowIgnored && data->IsIgnored())
00423             return kSkipFile;
00424
00425         // create the item for the sub-directory
00426         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00427         /*kTraversal res = */FileTraverse(fullname, traverse);
00428
00429         // assign the icon regarding our Entries info
00430         if(traverse.m_item != 0L)
00431         {
00432             UTREE_INFO query;
00433             query.item = traverse.m_item;
00434             query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, false, data);
00435             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00436         }
00437
00438         return kSkipFile;
00439     }

virtual kTraversal TBrowserFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 398 of file UCvsFolders.cpp.

References kTraversal, and kTraversalError.

00399     {
00400         return kTraversalError;
00401     }

virtual kTraversal TBrowserFill::OnIdle ( const char * fullpath ) [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 403 of file UCvsFolders.cpp.

References kContinueTraversal, and kTraversal.

00404     {
00405         return kContinueTraversal;
00406     }

Member Data Documentation

CSortList<ENTNODE>& TBrowserFill::m_entries [private]

Entries list

Definition at line 101 of file WinCvsBrowser.h.

CSortList<ENTNODE>& TBrowserFill::m_entries

Definition at line 360 of file UCvsFolders.cpp.

bool TBrowserFill::m_hascvs [private]

CVS meta-data flag

Definition at line 100 of file WinCvsBrowser.h.

vector< UStr > TBrowserFill::m_ignlist [private]

Ignore list

Definition at line 102 of file WinCvsBrowser.h.

std::vector<UStr> TBrowserFill::m_ignlist

Definition at line 361 of file UCvsFolders.cpp.

bool TBrowserFill::m_isShowIgnored

Show ignored flag

Definition at line 103 of file WinCvsBrowser.h.

Referenced by TBrowserFill().

HTREEITEM TBrowserFill::m_item [private]

Current item handle

Definition at line 98 of file WinCvsBrowser.h.

UTREEITEM TBrowserFill::m_item

Definition at line 358 of file UCvsFolders.cpp.

HTREEITEM TBrowserFill::m_root [private]

Root item handle

Definition at line 97 of file WinCvsBrowser.h.

UTREEITEM TBrowserFill::m_root

Definition at line 357 of file UCvsFolders.cpp.

CTreeCtrl& TBrowserFill::m_treeCtrl [private]

Tree control

Definition at line 99 of file WinCvsBrowser.h.

UCvsFolders* TBrowserFill::m_treeCtrl

Definition at line 359 of file UCvsFolders.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFolders.cpp
  • WinCvs/WinCvsBrowser.h
  • WinCvs/WinCvsBrowser.cpp
Generated on Fri Jan 31 12:20:03 2003 for WinCvs Source by doxygen 1.3-rc2


TBrowserFillDummy Class Reference

Class to create an item with a dummy item inside if and only if the folder is not empty. More...

#include <WinCvsBrowser.h>

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)
HTREEITEM | GetItem () const
Get the current item.

Public Attributes

UTREEITEM m_root
UTREEITEM m_item
UCvsFolders * m_treeCtrl
bool | m_empty
bool | m_hascvs
EntnodeData * m_data
UStr m_dirname

Private 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 | OnDirectory (const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec)

Private Attributes

HTREEITEM | m_root
HTREEITEM | m_item
CTreeCtrl & m_treeCtrl
EntnodeData * m_data

Detailed Description

Class to create an item with a dummy item inside if and only if the folder is not empty.

Definition at line 239 of file UCvsFolders.cpp.

Constructor & Destructor Documentation

TBrowserFillDummy::TBrowserFillDummy | ( | UCvsFolders * | treeCtrl,
 |  | UTREEITEM | root,
 |  | UTREEITEM | item,
 |  | EntnodeData * | data
 | ) | [inline]

Definition at line 250 of file UCvsFolders.cpp.

00250                                                                                                 :
00251         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00252         m_hascvs(false), m_data(data) {}

virtual TBrowserFillDummy::~TBrowserFillDummy ( ) [inline, virtual]

Definition at line 254 of file UCvsFolders.cpp.

00254 {}

TBrowserFillDummy::TBrowserFillDummy | ( | CTreeCtrl & | treeCtrl,
 |  | HTREEITEM | root,
 |  | HTREEITEM | item,
 |  | EntnodeData * | data
 | ) |

Definition at line 162 of file WinCvsBrowser.cpp.

00163     : m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true), m_data(data), m_hascvs(false)
00164 {
00165 }

Member Function Documentation

virtual kTraversal TBrowserFillDummy::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFillDummy::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 256 of file UCvsFolders.cpp.

References UStr::empty(), kContinueTraversal, and kTraversal.

00257     {
00258         m_dirname = dirname;
00259 #if qUnix
00260         if(m_dirname.empty())
00261             m_dirname = fullpath; // '/'
00262 #endif
00263         return kContinueTraversal;
00264     }

virtual kTraversal TBrowserFillDummy::ExitDirectory ( const char * fullpath ) [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFillDummy::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 266 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, UTREE_INSERT::parent, EntnodeData::Ref(), UTREE_INSERT::result, UTREE_INSERT::title, UEventSendMessage(), and EntnodeData::UnRef().

00267     {
00268         if(m_item == 0L)
00269         {
00270             UTREE_INSERT insert;
00271             insert.parent = m_root;
00272             insert.icon = GetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00273             insert.title = m_dirname;
00274             insert.data = 0L;
00275             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00276             m_item = insert.result;
00277         }
00278
00279         // assign the entries to this item
00280         UTREE_INFO query;
00281         query.item = m_item;
00282         if(m_data != 0L)
00283         {
00284             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00285             EntnodeData *data = (EntnodeData *)query.data;
00286
00287             if(m_data != 0L)
00288                 m_data->Ref();
00289
00290             query.data = m_data;
00291             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETDATA, kUMainWidget, &query);
00292
00293             if(data != 0L)
00294                 data->UnRef();
00295         }
00296         else
00297         {
00298             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00299             m_data = (EntnodeData *)query.data;
00300         }
00301
00302         if(m_empty)
00303             return kContinueTraversal;
00304
00305         // add a dummy item to simulate the folder
00306         // is not empty. This dummy item will be
00307         // replaced by a complete listing when the
00308         // node is expanding...
00309
00310         UTREE_INSERT insert;
00311         insert.parent = m_item;
00312         insert.icon = 0L;
00313         insert.title = gDummyFile;
00314         insert.data = 0L;
00315         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00316
00317         return kContinueTraversal;
00318     }

HTREEITEM TBrowserFillDummy::GetItem ( ) const [inline]

Get the current item.

Definition at line 85 of file WinCvsBrowser.h.

00085 { return m_item; };

virtual kTraversal TBrowserFillDummy::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [private, virtual]

Reimplemented from TraversalReport.

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 334 of file UCvsFolders.cpp.

References kSkipFile, and kTraversal.

00338     {
00339 #if qUnix
00340         if(strcmp(name, "CVS") == 0)
00341 #else
00342         if(stricmp(name, "cvs") == 0)
00343 #endif
00344             m_hascvs = true;
00345         else
00346             m_empty = false;
00347
00348         return kSkipFile;
00349     }

virtual kTraversal TBrowserFillDummy::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFillDummy::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 320 of file UCvsFolders.cpp.

References cvs_err(), kTraversal, and kTraversalError.

00321     {
00322     cvs_err(err);
00323     cvs_err("\n");
00324     cvs_err(strerror(errcode));
00325     cvs_err("\n");
00326         return kTraversalError;
00327     }

virtual kTraversal TBrowserFillDummy::OnIdle ( const char * fullpath ) [private, virtual]

Reimplemented from TraversalReport.

kTraversal TBrowserFillDummy::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 329 of file UCvsFolders.cpp.

References kContinueTraversal, and kTraversal.

00330     {
00331         return kContinueTraversal;
00332     }

Member Data Documentation

EntnodeData* TBrowserFillDummy::m_data [private]

Node data

Definition at line 71 of file WinCvsBrowser.h.

EntnodeData* TBrowserFillDummy::m_data

Definition at line 247 of file UCvsFolders.cpp.

UStr TBrowserFillDummy::m_dirname

Definition at line 248 of file UCvsFolders.cpp.

bool TBrowserFillDummy::m_empty

Empty flag

Definition at line 69 of file WinCvsBrowser.h.

bool TBrowserFillDummy::m_hascvs

CVS meta-data flag

Definition at line 70 of file WinCvsBrowser.h.

HTREEITEM TBrowserFillDummy::m_item [private]

Current item handle

Definition at line 67 of file WinCvsBrowser.h.

UTREEITEM TBrowserFillDummy::m_item

Definition at line 243 of file UCvsFolders.cpp.

Referenced by TBrowserFill::OnDirectory(), and UCvsFolders::ResetBrowser().

HTREEITEM TBrowserFillDummy::m_root [private]

Root item handle

Definition at line 66 of file WinCvsBrowser.h.

UTREEITEM TBrowserFillDummy::m_root

Definition at line 242 of file UCvsFolders.cpp.

CTreeCtrl& TBrowserFillDummy::m_treeCtrl [private]

Tree control

Definition at line 68 of file WinCvsBrowser.h.

UCvsFolders* TBrowserFillDummy::m_treeCtrl

Definition at line 244 of file UCvsFolders.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFolders.cpp
  • WinCvs/WinCvsBrowser.h
  • WinCvs/WinCvsBrowser.cpp
Generated on Fri Jan 31 12:20:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 955 of file TclGlue.cpp.

References _TCL_CALLBACK, CStr, cvs_err(), fExitOnError, fInterp, fLastErrorCode, IsAvail(), MacrosGetLoc(), myTcl_CreateInterp(), Tcl_CreateCommand, Tcl_Init, Tcl_SetVar, and Tcl_SourceRCFile.

00956 {
00957     fInterp = 0L;
00958
00959     fExitOnError = true;
00960     fLastErrorCode = 0;
00961
00962 #if USE_TCL
00963     if(!CTcl_Interp::IsAvail())
00964     {
00965         cvs_err("TCL is not available !\n");
00966         return;
00967     }
00968
00969     fInterp = myTcl_CreateInterp();
00970     if(fInterp == 0L)
00971     {
00972         cvs_err("Unable to create a new TCL interpreter !\n");
00973         return;
00974     }
00975
00976     Tcl_Command cmd;
00977
00978     // this parameter is used to get access to CTcl_Interp::SetCvsLastErrorCode
00979     // in tclCvsProc method
00980     cmd = Tcl_CreateCommand (fInterp, "cvs", _TCL_CALLBACK(tclCvsProc),
00981         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00982
00983     cmd = Tcl_CreateCommand (fInterp, "help", _TCL_CALLBACK(tclHelpProc),
00984         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00985     cmd = Tcl_CreateCommand (fInterp, "cvsout", _TCL_CALLBACK(tclCvsOutProc),
00986         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00987     cmd = Tcl_CreateCommand (fInterp, "cvserr", _TCL_CALLBACK(tclCvsErrProc),
00988         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00989     cmd = Tcl_CreateCommand (fInterp, "cvsbrowser", _TCL_CALLBACK(tclCvsBrowserProc),
00990         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00991     cmd = Tcl_CreateCommand (fInterp, "cvsentries", _TCL_CALLBACK(tclCvsEntriesProc),
00992         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00993 #ifdef WIN32
00994     cmd = Tcl_CreateCommand (fInterp, "ls", _TCL_CALLBACK(tclDirProc),
00995         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00996     cmd = Tcl_CreateCommand (fInterp, "dir", _TCL_CALLBACK(tclDirProc),
00997         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00998 #endif /* WIN32 */
00999     cmd = Tcl_CreateCommand (fInterp, "trash", _TCL_CALLBACK(tclSafeRemove),
01000         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
01001
01002     cmd = Tcl_CreateCommand (fInterp, "cvsexitonerror", _TCL_CALLBACK(tclCvsExitOnErrorProc),
01003         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01004
01005     cmd = Tcl_CreateCommand (fInterp, "cvslasterrorcode", _TCL_CALLBACK(tclCvsLastErrorCodeProc),
01006         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01007 #if defined(WIN32)
01008     cmd = Tcl_CreateCommand (fInterp, "cvssetdebugmask", _TCL_CALLBACK(tclSetDebugMaskProc),
01009         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01010     cmd = Tcl_CreateCommand (fInterp, "cvsgetdebugmask", _TCL_CALLBACK(tclGetDebugMaskProc),
01011         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01012     cmd = Tcl_CreateCommand (fInterp, "cvsfilemodtime", _TCL_CALLBACK(tclGetFileModTimeProc),
01013         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01014 #endif  // defined(WIN32)
01015
01016     CStr rcfile;
01017     MacrosGetLoc(rcfile);
01018     if(!rcfile.endsWith(kPathDelimiter))
01019         rcfile << kPathDelimiter;
01020     rcfile << "startup.tcl";
01021     Tcl_SetVar(fInterp, "tcl_rcFileName", rcfile, TCL_GLOBAL_ONLY);
01022     Tcl_SetVar(fInterp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
01023     Tcl_Init(fInterp);
01024     Tcl_SourceRCFile(fInterp);
01025 #endif
01026 }

CTcl_Interp::~CTcl_Interp ( )

Definition at line 1028 of file TclGlue.cpp.

References fInterp, and Tcl_DeleteInterp.

01029 {
01030 #if USE_TCL
01031     if(fInterp != 0L)
01032         Tcl_DeleteInterp(fInterp);
01033 #endif
01034 }

Member Function Documentation

void CTcl_Interp::Deunixfy ( UStr & path ) [static]

Definition at line 1244 of file TclGlue.cpp.

References kTCLPathDelimiter.

Referenced by CTCLBrowserEnt::GetNormalized(), CTCLBrowserEnt::IsSamePath(), tclCvsEntriesProc(), and tclSafeRemove().

01245 {
01246   if ( kTCLPathDelimiter != kPathDelimiter )
01247   {
01248     char *ptr = path;
01249     while((ptr = strchr(ptr, kTCLPathDelimiter)) != 0L)
01250     {
01251         *ptr++ = kPathDelimiter;
01252     }
01253   }
01254 }

kTclRes CTcl_Interp::DoFile ( const char * file )

Definition at line 1202 of file TclGlue.cpp.

References cvs_errstr(), cvs_outstr(), fInterp, kTclRes, TCL_ERROR, and Tcl_EvalFile.

01203 {
01204 #if USE_TCL
01205     if(fInterp == 0L)
01206         return false;
01207
01208     int exitc = Tcl_EvalFile(fInterp, (char *)file);
01209     size_t len = strlen(fInterp->result);
01210     if(exitc == TCL_ERROR)
01211     {
01212         cvs_errstr(fInterp->result, len);
01213         if(len != 0 && fInterp->result[len - 1] != '\n')
01214             cvs_errstr("\n", 1);
01215     }
01216     else
01217     {
01218         cvs_outstr(fInterp->result, len);
01219         if(len != 0 && fInterp->result[len - 1] != '\n')
01220             cvs_outstr("\n", 1);
01221     }
01222
01223     return exitc;
01224 #else
01225     return false;
01226 #endif
01227 }

kTclRes CTcl_Interp::DoScript ( const char * script )

Definition at line 1144 of file TclGlue.cpp.

References cvs_errstr(), cvs_outstr(), fInterp, kTclRes, TCL_ERROR, and Tcl_Eval.

Referenced by DoScriptVar(), and CWincvsView::OnKeyDown().

01145 {
01146 #if USE_TCL
01147     bool bTclFileStarted;
01148
01149     if(fInterp == 0L)
01150         return false;
01151
01152     // If script cmd begins with "source " then this
01153     // must be TCL file execution.
01154     bTclFileStarted = (strncmp(script, "source ", 7) == 0);
01155     if(bTclFileStarted)
01156         gCvsPrefs.SetTclFileRunning(true);
01157
01158     int exitc = Tcl_Eval(fInterp, (char *)script);
01159
01160     if(bTclFileStarted)
01161         gCvsPrefs.SetTclFileRunning(false);
01162
01163     size_t len = strlen(fInterp->result);
01164     if(exitc == TCL_ERROR)
01165     {
01166         cvs_errstr(fInterp->result, len);
01167         if(len != 0 && fInterp->result[len - 1] != '\n')
01168             cvs_errstr("\n", 1);
01169     }
01170     else
01171     {
01172         cvs_outstr(fInterp->result, len);
01173         if(len != 0 && fInterp->result[len - 1] != '\n')
01174             cvs_outstr("\n", 1);
01175     }
01176
01177     return exitc;
01178 #else
01179     return false;
01180 #endif
01181 }

kTclRes CTcl_Interp::DoScriptVar | ( | const char * | format,
 |  | ... |
 | ) |

Definition at line 1183 of file TclGlue.cpp.

References DoScript(), fInterp, and kTclRes.

Referenced by CvsCmdMacrosAdmin(), cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), and UCvsFiles::OnMacroSel().

01184 {
01185 #if USE_TCL
01186     if(fInterp == 0L)
01187         return false;
01188
01189     va_list args;
01190     char script[1024] = {'\0'};
01191
01192     va_start (args, format);
01193     vsprintf (script, format, args);
01194     va_end (args);
01195
01196     return DoScript(script);
01197 #else
01198     return false;
01199 #endif
01200 }

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 1036 of file TclGlue.cpp.

References CompatConnectID, CompatLoadLibrary(), findTcl(), myTcl_CreateInterp(), Tcl_CreateInterp, Tcl_DeleteInterp, and Tcl_Init.

Referenced by CTcl_Interp(), CvsCmdMacrosAdmin(), cvsgui_LaunchTclMacro(), CWincvsApp::InitInstance(), CWincvsView::OnKeyDown(), CWincvsDoc::OnUpdateMacroAdmin(), and UCvsApp::SayWelcome().

01037 {
01038 #if USE_TCL
01039 #if defined(TARGET_OS_MAC) && !qCarbon
01040     return Tcl_CreateInterp != 0L;
01041 #else /* !TARGET_OS_MAC */
01042     static bool firstTime = true;
01043     static bool tclAvail = false;
01044     if(firstTime)
01045     {
01046 #   if defined(WIN32) || qCarbon
01047         CompatConnectID connID;
01048 #   endif
01049
01050 #   ifdef WIN32
01051         extern char *findTcl (char *_minVer, int _exact, int _dbgOnly);
01052         char *tclver = 0L;
01053         try
01054         {
01055             tclver = findTcl("8.1", 0, 0);
01056         }
01057         catch(...)
01058         {
01059         }
01060
01061         if(tclver != 0L)
01062             tclAvail = CompatLoadLibrary(&connID, tclver) != 0;
01063
01064         if(!tclAvail)
01065             tclAvail = CompatLoadLibrary(&connID, "tcl87.dll") != 0 ||
01066             CompatLoadLibrary(&connID, "tcl86.dll") != 0 ||
01067             CompatLoadLibrary(&connID, "tcl85.dll") != 0 ||
01068             CompatLoadLibrary(&connID, "tcl84.dll") != 0 ||
01069             CompatLoadLibrary(&connID, "tcl83.dll") != 0 ||
01070             CompatLoadLibrary(&connID, "tcl82.dll") != 0 ||
01071             CompatLoadLibrary(&connID, "tcl81.dll") != 0;
01072 #   endif
01073
01074 #   if TARGET_RT_MAC_CFM
01075         if (UEnvironment::GetOSVersion() >= 0x1000)
01076             tclAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01077         else
01078             tclAvail = CompatLoadLibrary(&connID, "tcl8.3");
01079 #   endif
01080 #   if TARGET_RT_MAC_MACHO
01081         tclAvail = CompatLoadLibrary(&connID, "/usr/lib/libtcl.dylib");
01082 #   endif
01083
01084 #   if defined(WIN32) || qCarbon
01085 #   define LOAD_CODEFRAG(name) \
01086         if(tclAvail) \
01087             tclAvail = (*(void **)&name##_glue = \
01088                 _CompatCallLibrary(connID, #name)) != 0L
01089 #   endif
01090 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01091         LOAD_CODEFRAG(Tcl_CreateCommand);
01092         LOAD_CODEFRAG(Tcl_CreateInterp);
01093         LOAD_CODEFRAG(Tcl_AppendResult);
01094         LOAD_CODEFRAG(Tcl_SetResult);
01095         LOAD_CODEFRAG(Tcl_DeleteInterp);
01096         LOAD_CODEFRAG(Tcl_Eval);
01097         LOAD_CODEFRAG(Tcl_EvalFile);
01098         LOAD_CODEFRAG(Tcl_Alloc);
01099         LOAD_CODEFRAG(Tcl_Free);
01100         LOAD_CODEFRAG(Tcl_Realloc);
01101         LOAD_CODEFRAG(Tcl_ExprLong);
01102         LOAD_CODEFRAG(Tcl_Concat);
01103         LOAD_CODEFRAG(Tcl_SetVar2);
01104         LOAD_CODEFRAG(Tcl_DStringStartSublist);
01105         LOAD_CODEFRAG(Tcl_DStringEndSublist);
01106         LOAD_CODEFRAG(Tcl_DStringFree);
01107         LOAD_CODEFRAG(Tcl_DStringInit);
01108         LOAD_CODEFRAG(Tcl_DStringResult);
01109         LOAD_CODEFRAG(Tcl_DStringAppendElement);
01110         LOAD_CODEFRAG(TclFreeObj);
01111         LOAD_CODEFRAG(Tcl_SetObjResult);
01112         LOAD_CODEFRAG(Tcl_NewStringObj);
01113         LOAD_CODEFRAG(Tcl_NewListObj);
01114         LOAD_CODEFRAG(Tcl_ListObjAppendElement);
01115         LOAD_CODEFRAG(Tcl_SourceRCFile);
01116         LOAD_CODEFRAG(Tcl_Init);
01117         LOAD_CODEFRAG(Tcl_SetVar);
01118         LOAD_CODEFRAG(Tcl_FindExecutable);
01119
01120         if(!tclAvail)
01121             return false;
01122 #   endif /* WIN32 */
01123
01124         Tcl_Interp *interp = myTcl_CreateInterp();
01125         tclAvail = interp != 0L;
01126         if (!tclAvail)
01127             return false;
01128
01129         Tcl_Init(interp);
01130
01131         /* Destroy the interp we needed just for this */
01132         Tcl_DeleteInterp(interp);
01133
01134         firstTime = false;
01135     }
01136
01137     return tclAvail;
01138 #endif /* !TARGET_OS_MAC */
01139 #else
01140     return false;
01141 #endif
01142 }

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 1229 of file TclGlue.cpp.

References kTCLPathDelimiter.

Referenced by CvsCmdMacrosAdmin(), cvsgui_LaunchTclMacro(), UCvsFolders::OnCmdMacrosSel(), UCvsFiles::OnMacroSel(), and tclCvsBrowserProc().

01230 {
01231     char *ptr = path;
01232   if ( kTCLPathDelimiter != kPathDelimiter )
01233     while((ptr = strchr(ptr, kPathDelimiter)) != 0L)
01234     {
01235         *ptr++ = kTCLPathDelimiter;
01236     }
01237     ptr = (char *)path + path.length() - 1;
01238     if(*ptr == kTCLPathDelimiter)
01239     {
01240         *ptr = '\0';
01241     }
01242 }

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 Fri Jan 31 12:20:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 242 of file TclGlue.cpp.

00243     {}

CTCLBrowserEnt::CTCLBrowserEnt ( EntnodeData * data ) [inline]

Definition at line 245 of file TclGlue.cpp.

References node.

00246     : node(data)
00247     {}

CTCLBrowserEnt::CTCLBrowserEnt ( const CTCLBrowserEnt & ent ) [inline]

Definition at line 249 of file TclGlue.cpp.

References node.

00250     : node(ent.node)
00251     {}

CTCLBrowserEnt::~CTCLBrowserEnt ( ) [inline]

Definition at line 253 of file TclGlue.cpp.

00254     {}

Member Function Documentation

EntnodeData* CTCLBrowserEnt::GetData ( void ) const [inline]

Definition at line 274 of file TclGlue.cpp.

References ENTNODE::Data(), and node.

00275     {
00276         return node.Data();
00277     }

void CTCLBrowserEnt::GetNormalized | ( | UStr & | path,
 |  | UStr & | fname
 | ) | const [inline]

Definition at line 280 of file TclGlue.cpp.

References CStr, ENTNODE::Data(), CTcl_Interp::Deunixfy(), EntnodeData::GetFullPathName(), node, and SplitPath().

00281     {
00282         CStr file;
00283         node.Data()->GetFullPathName(file);
00284         CTcl_Interp::Deunixfy(file);
00285         SplitPath(file, path, fname);
00286     }

bool CTCLBrowserEnt::IsSamePath ( const char * pathstr ) const [inline]

Definition at line 262 of file TclGlue.cpp.

References CStr, ENTNODE::Data(), CTcl_Interp::Deunixfy(), EntnodeData::GetFullPathName(), and node.

00263     {
00264         CStr path = pathstr;
00265         CTcl_Interp::Deunixfy(path);
00266
00267         CStr file;
00268         node.Data()->GetFullPathName(file);
00269         CTcl_Interp::Deunixfy(file);
00270
00271         return path.compare(file) == 0;
00272     }

CTCLBrowserEnt& CTCLBrowserEnt::operator= ( const CTCLBrowserEnt & ent ) [inline]

Definition at line 256 of file TclGlue.cpp.

References node.

00257     {
00258         node = ent.node;
00259         return *this;
00260     }

Member Data Documentation

ENTNODE CTCLBrowserEnt::node [private]

Definition at line 289 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 Fri Jan 31 12:20:07 2003 for WinCvs Source by doxygen 1.3-rc2


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)
Stdout handler.

virtual long | cvs_err (char *txt, long len)
Stderr handler.

Protected Attributes

Tcl_Interp * | fInterp
int | fLen
char * | fAlloc

Constructor & Destructor Documentation

CTCLCvsConsole::CTCLCvsConsole ( Tcl_Interp * interp ) [inline]

Definition at line 297 of file TclGlue.cpp.

References fAlloc, fInterp, fLen, and malloc.

00297                                        : fInterp(interp)
00298     {
00299         fLen = 100;
00300         fAlloc = (char *)malloc((fLen + 1) * sizeof(char));
00301     }

virtual CTCLCvsConsole::~CTCLCvsConsole ( ) [inline, virtual]

Definition at line 302 of file TclGlue.cpp.

References fAlloc, and free.

00303     {
00304         if(fAlloc != 0L)
00305             free(fAlloc);
00306     }

Member Function Documentation

virtual long CTCLCvsConsole::cvs_err | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Stderr handler.

Implements CCvsConsole.

Definition at line 328 of file TclGlue.cpp.

References cvs_out().

00329     {
00330         return cvs_out(txt, len);
00331     }

virtual long CTCLCvsConsole::cvs_out | ( | char * | txt,
 |  | long | len
 | ) | [inline, virtual]

Stdout handler.

Implements CCvsConsole.

Definition at line 308 of file TclGlue.cpp.

References fAlloc, fLen, realloc, and Tcl_AppendResult.

Referenced by cvs_err().

00309     {
00310         if(fAlloc == 0L)
00311             return 0;
00312
00313         if(len > fLen)
00314         {
00315             fLen = len;
00316             fAlloc = (char *)realloc(fAlloc, (fLen + 1) * sizeof(char));
00317         }
00318         if(fAlloc == 0L)
00319             return 0;
00320
00321         memcpy(fAlloc, txt, len * sizeof(char));
00322         fAlloc[len] = '\0';
00323
00324         Tcl_AppendResult(fInterp, fAlloc, 0L);
00325         return len;
00326     }

Member Data Documentation

char* CTCLCvsConsole::fAlloc [protected]

Definition at line 335 of file TclGlue.cpp.

Referenced by CTCLCvsConsole(), cvs_out(), and ~CTCLCvsConsole().

Tcl_Interp* CTCLCvsConsole::fInterp [protected]

Definition at line 333 of file TclGlue.cpp.

Referenced by CTCLCvsConsole().

int CTCLCvsConsole::fLen [protected]

Definition at line 334 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 Fri Jan 31 12:20:07 2003 for WinCvs Source by doxygen 1.3-rc2


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, 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().

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 Fri Jan 31 12:20:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 150 of file UCvsFolders.cpp.

References m_didSetIt, and m_value.

00150                                   : m_value(value), m_didSetIt(false)
00151     {
00152         if(!m_value)
00153         {
00154             m_didSetIt = true;
00155             m_value = true;
00156         }
00157     }

CTempToggleBool::~CTempToggleBool ( ) [inline]

Definition at line 159 of file UCvsFolders.cpp.

References m_value.

00160     {
00161         if(m_didSetIt)
00162             m_value = false;
00163     }

Member Data Documentation

bool CTempToggleBool::m_didSetIt [protected]

Definition at line 166 of file UCvsFolders.cpp.

Referenced by CTempToggleBool().

bool& CTempToggleBool::m_value [protected]

Definition at line 165 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 Fri Jan 31 12:20:12 2003 for WinCvs Source by doxygen 1.3-rc2


TGraph Class Reference

Base traverse class. More...

#include <GraphView.h>

Inheritance diagram for TGraph:

[legend]
List of all members.

Public Methods

kTGraph | TraverseGraph (CLogNode *node)
virtual kTGraph | TraverseNode (CLogNode *node)=0

Detailed Description

Base traverse class.

Definition at line 180 of file GraphView.h.

Member Function Documentation

kTGraph TGraph::TraverseGraph ( CLogNode * node )

Traverse the graph

Parameters:
node Node
Returns:
kTGraph

Definition at line 839 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().

00840 {
00841     kTGraph res = TraverseNode(node);
00842     if( res == kTStop )
00843         return kTStop;
00844
00845     if( res == kTGetDown )
00846     {
00847         vector<CLogNode*>::iterator i;
00848         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00849         {
00850             res = TraverseGraph(*i);
00851             if( res == kTStop )
00852                 return kTStop;
00853         }
00854     }
00855
00856     if( node->Next() != 0L )
00857     {
00858         res = TraverseGraph(node->Next());
00859         if( res == kTStop )
00860             return kTStop;
00861     }
00862
00863     return kTContinue;
00864 };

virtual kTGraph TGraph::TraverseNode ( CLogNode * node ) [pure virtual]

Implemented in TGraphRectSelect, TGraphCmdStatus, TGraphDelCmd, and TGraphSelNonSig.

Referenced by TraverseGraph().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:20:13 2003 for WinCvs Source by doxygen 1.3-rc2


TGraphCmdStatus Class Reference

Graph command status class. More...

#include <GraphView.h>

Inheritance diagram for TGraphCmdStatus:

[legend]
Collaboration diagram for TGraphCmdStatus:

[legend]
List of all members.

Public Methods

TGraphCmdStatus ()
Construction.

virtual kTGraph | TraverseNode (CLogNode *node)
int | GetSelCount () const
CWinLogData * | GetSel1 () const
CWinLogData * | GetSel2 () const

Private Attributes

CWinLogData * m_fSel1
CWinLogData * m_fSel2
int | m_selCount

Detailed Description

Graph command status class.

Definition at line 207 of file GraphView.h.

Constructor & Destructor Documentation

TGraphCmdStatus::TGraphCmdStatus ( )

Construction.

Definition at line 905 of file GraphView.cpp.

00906     : m_fSel1(0L), m_fSel2(0L), m_selCount(0)
00907 {
00908 }

Member Function Documentation

CWinLogData * TGraphCmdStatus::GetSel1 ( ) const

Get the first selection

Returns:
The first selection

Definition at line 940 of file GraphView.cpp.

References m_fSel1.

Referenced by CGraphView::IsSelSingleNode(), CGraphView::OnContextMenu(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnQueryAnnotate(), CGraphView::OnUpdateViewDiff(), CGraphView::OnViewDiff(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), and CGraphView::OnViewUnlockf().

00941 {
00942     return m_fSel1;
00943 }

CWinLogData * TGraphCmdStatus::GetSel2 ( ) const

Get the second selection

Returns:
The second selection

Definition at line 949 of file GraphView.cpp.

References m_fSel2.

Referenced by CGraphView::OnUpdateViewDiff(), and CGraphView::OnViewDiff().

00950 {
00951     return m_fSel2;
00952 }

int TGraphCmdStatus::GetSelCount ( ) const

Get the selection count

Returns:
The selection count

Definition at line 931 of file GraphView.cpp.

References m_selCount.

Referenced by CGraphView::IsSelSingleNode(), CGraphView::OnContextMenu(), CGraphView::OnUpdateViewDiff(), CGraphView::OnUpdateViewTag(), and CGraphView::OnViewDiff().

00932 {
00933     return m_selCount;
00934 }

kTGraph TGraphCmdStatus::TraverseNode ( CLogNode * node ) [virtual]

Implements TGraph.

Definition at line 910 of file GraphView.cpp.

References kTGetDown, kTGraph, m_fSel1, m_fSel2, m_selCount, and CWinLogData::Selected().

00911 {
00912     CWinLogData* data = (CWinLogData*)node->GetUserData();
00913
00914     if( data->Selected() )
00915     {
00916         if( m_fSel1 == 0L )
00917             m_fSel1 = data;
00918         else if( m_fSel2 == 0L )
00919             m_fSel2 = data;
00920
00921         m_selCount++;
00922     }
00923
00924     return kTGetDown;
00925 }

Member Data Documentation

CWinLogData* TGraphCmdStatus::m_fSel1 [private]

First selected item log data

Definition at line 215 of file GraphView.h.

Referenced by GetSel1(), and TraverseNode().

CWinLogData* TGraphCmdStatus::m_fSel2 [private]

Second selected item log data

Definition at line 216 of file GraphView.h.

Referenced by GetSel2(), and TraverseNode().

int TGraphCmdStatus::m_selCount [private]

Selection count

Definition at line 217 of file GraphView.h.

Referenced by GetSelCount(), and TraverseNode().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:20:14 2003 for WinCvs Source by doxygen 1.3-rc2


TGraphDelCmd Class Reference

Graph command delete revisions class. More...

#include <GraphView.h>

Inheritance diagram for TGraphDelCmd:

[legend]
Collaboration diagram for TGraphDelCmd:

[legend]
List of all members.

Public Methods

TGraphDelCmd ()
virtual kTGraph | TraverseNode (CLogNode *node)
int | GetCountSel () const
bool | GetOnlyRev () const
std::vector< CStr > & | GetAllRevs ()

Private Attributes

int | m_countSel
bool | m_onlyRev
std::vector< CStr > | m_allRevs

Detailed Description

Graph command delete revisions class.

Definition at line 246 of file GraphView.h.

Constructor & Destructor Documentation

TGraphDelCmd::TGraphDelCmd ( )

Definition at line 982 of file GraphView.cpp.

00983     : m_countSel(0), m_onlyRev(true)
00984 {
00985 }

Member Function Documentation

std::vector< UStr > & TGraphDelCmd::GetAllRevs ( )

Get all revisions

Returns:
All revisions

Definition at line 1026 of file GraphView.cpp.

References m_allRevs.

Referenced by CGraphView::OnViewDelrev().

01027 {
01028     return m_allRevs;
01029 }

int TGraphDelCmd::GetCountSel ( ) const

Get the selection count

Returns:
The selection count

Definition at line 1008 of file GraphView.cpp.

References m_countSel.

Referenced by CGraphView::OnUpdateViewDelrev().

01009 {
01010     return m_countSel;
01011 }

bool TGraphDelCmd::GetOnlyRev ( ) const

Get only revisions flag

Returns:
The only revisions flag

Definition at line 1017 of file GraphView.cpp.

References m_onlyRev.

Referenced by CGraphView::OnUpdateViewDelrev().

01018 {
01019     return m_onlyRev;
01020 }

kTGraph TGraphDelCmd::TraverseNode ( CLogNode * node ) [virtual]

Implements TGraph.

Definition at line 987 of file GraphView.cpp.

References CStr, CWinLogData::GetStr(), CWinLogData::GetType(), kTGetDown, kTGraph, m_allRevs, m_countSel, m_onlyRev, and CWinLogData::Selected().

00988 {
00989     CWinLogData* data = (CWinLogData*)node->GetUserData();
00990
00991     if( data->Selected() )
00992     {
00993         if( data->GetType() != kNodeRev )
00994             m_onlyRev = false;
00995         else
00996             m_allRevs.push_back(CStr(data->GetStr()));
00997
00998         m_countSel++;
00999     }
01000
01001     return kTGetDown;
01002 }

Member Data Documentation

std::vector<CStr> TGraphDelCmd::m_allRevs [private]

Definition at line 256 of file GraphView.h.

Referenced by GetAllRevs(), and TraverseNode().

int TGraphDelCmd::m_countSel [private]

Definition at line 254 of file GraphView.h.

Referenced by GetCountSel(), and TraverseNode().

bool TGraphDelCmd::m_onlyRev [private]

Definition at line 255 of file GraphView.h.

Referenced by GetOnlyRev(), and TraverseNode().

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:20:15 2003 for WinCvs Source by doxygen 1.3-rc2


TGraphRectSelect Class Reference

Graph traverse class. More...

#include <GraphView.h>

Inheritance diagram for TGraphRectSelect:

[legend]
Collaboration diagram for TGraphRectSelect:

[legend]
List of all members.

Public Methods

TGraphRectSelect (bool shiftOn, CGraphView *view, CRect &rect)
virtual kTGraph | TraverseNode (CLogNode *node)

Protected Attributes

bool | m_shiftOn
CGraphView * m_view
CRect & | m_rect

Detailed Description

Graph traverse class.

Definition at line 189 of file GraphView.h.

Constructor & Destructor Documentation

TGraphRectSelect::TGraphRectSelect | ( | bool | shiftOn,
 |  | CGraphView * | view,
 |  | CRect & | rect
 | ) |

Definition at line 869 of file GraphView.cpp.

00870     : m_shiftOn(shiftOn), m_view(view), m_rect(rect)
00871 {
00872 }

Member Function Documentation

kTGraph TGraphRectSelect::TraverseNode ( CLogNode * node ) [virtual]

Implements TGraph.

Definition at line 874 of file GraphView.cpp.

References CWinLogData::Bounds(), kTContinue, kTGetDown, kTGraph, m_rect, m_shiftOn, CWinLogData::Selected(), CWinLogData::SelfBounds(), and CWinLogData::SetSelected().

00875 {
00876     CWinLogData* data = (CWinLogData*)node->GetUserData();
00877
00878     // No need to go further
00879     CRect inter;
00880     if( !inter.IntersectRect(m_rect, data->Bounds()) )
00881     {
00882         return kTContinue;
00883     }
00884
00885     // Self enclosed in the tracker ?
00886     CRect& boundsRect = data->SelfBounds();
00887     if( m_rect.PtInRect(boundsRect.TopLeft()) && m_rect.PtInRect(boundsRect.BottomRight()) )
00888     {
00889         if( !m_shiftOn )
00890         {
00891             if( !data->Selected() )
00892                 data->SetSelected(m_view, true);
00893         }
00894         else
00895             data->SetSelected(m_view, !data->Selected());
00896     }
00897
00898     // Traverse childrens
00899     return kTGetDown;
00900 }

Member Data Documentation

CRect& TGraphRectSelect::m_rect [protected]

Rectangle

Definition at line 199 of file GraphView.h.

Referenced by TraverseNode().

bool TGraphRectSelect::m_shiftOn [protected]

Flag to indicate the shift key state

Definition at line 197 of file GraphView.h.

Referenced by TraverseNode().

CGraphView* TGraphRectSelect::m_view [protected]

View

Definition at line 198 of file GraphView.h.

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:20:15 2003 for WinCvs Source by doxygen 1.3-rc2


TGraphSelNonSig Class Reference

Select non-significant revisions. More...

#include <GraphView.h>

Inheritance diagram for TGraphSelNonSig:

[legend]
Collaboration diagram for TGraphSelNonSig:

[legend]
List of all members.

Public Methods

TGraphSelNonSig (CGraphView *view)
virtual kTGraph TraverseNode (CLogNode *node)

Private Attributes

CGraphView * m_view

Detailed Description

Select non-significant revisions.

Definition at line 268 of file GraphView.h.

Constructor & Destructor Documentation

TGraphSelNonSig::TGraphSelNonSig ( CGraphView * view )

Definition at line 1034 of file GraphView.cpp.

01035     : m_view(view)
01036 {
01037 }

Member Function Documentation

kTGraph TGraphSelNonSig::TraverseNode ( CLogNode * node ) [virtual]

Implements TGraph.

Definition at line 1039 of file GraphView.cpp.

References CWinLogData::GetType(), kTGetDown, kTGraph, and CWinLogData::SetSelected().

01040 {
01041     CWinLogData* data = (CWinLogData*)node->GetUserData();
01042
01043     if( data->GetType() == kNodeRev )
01044     {
01045         if( node->Next() != 0L && node->Childs().size() == 0 )
01046             data->SetSelected(m_view, true);
01047     }
01048
01049     return kTGetDown;
01050 }

Member Data Documentation

CGraphView* TGraphSelNonSig::m_view [private]

View

Definition at line 276 of file GraphView.h.

The documentation for this class was generated from the following files:
  • WinCvs/GraphView.h
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:20:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 49 of file TipDlg.cpp.

References CStr, CWincvsApp::GetAppPath(), GetNextTipString(), IDD_TIP, m_bStartup, m_pStream, m_strTip, NULL, and TRUE.

00050     : CDialog(IDD_TIP, pParent)
00051 {
00052     //{{AFX_DATA_INIT(CTipDlg)
00053     m_bStartup = TRUE;
00054     //}}AFX_DATA_INIT
00055
00056     // We need to find out what the startup and file position parameters are
00057     // If startup does not exist, we assume that the Tips on startup is checked TRUE.
00058     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00059     m_bStartup = !pApp->GetProfileInt(szSection, szIntStartup, 0);
00060     UINT iFilePos = pApp->GetProfileInt(szSection, szIntFilePos, 0);
00061     CStr tips;
00062     pApp->GetAppPath(tips);
00063     if(!tips.empty() && !tips.endsWith(kPathDelimiter))
00064     {
00065         tips << kPathDelimiter;
00066     }
00067     tips << "tips.txt";
00068
00069     // Now try to open the tips file
00070     m_pStream = fopen(tips, "r");
00071 #if qCvsDebug
00072     if(m_pStream == 0L)
00073         m_pStream = fopen("c:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00074     if(m_pStream == 0L)
00075         m_pStream = fopen("d:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00076     if(m_pStream == 0L)
00077         m_pStream = fopen("e:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00078     if(m_pStream == 0L)
00079         m_pStream = fopen("f:\\cvsgui\\wincvs\\hlp\\tips.txt", "r");
00080 #endif
00081     if (m_pStream == NULL)
00082     {
00083         m_strTip.LoadString(CG_IDS_FILE_ABSENT);
00084         return;
00085     }
00086
00087     // If the timestamp in the INI file is different from the timestamp of
00088     // the tips file, then we know that the tips file has been modified
00089     // Reset the file position to 0 and write the latest timestamp to the
00090     // ini file
00091     struct _stat buf;
00092     _fstat(_fileno(m_pStream), &buf);
00093     CString strCurrentTime = ctime(&buf.st_ctime);
00094     strCurrentTime.TrimRight();
00095     CString strStoredTime =
00096         pApp->GetProfileString(szSection, szTimeStamp, NULL);
00097     if (strCurrentTime != strStoredTime)
00098     {
00099         iFilePos = 0;
00100         pApp->WriteProfileString(szSection, szTimeStamp, strCurrentTime);
00101     }
00102
00103     if (fseek(m_pStream, iFilePos, SEEK_SET) != 0)
00104     {
00105         AfxMessageBox(CG_IDP_FILE_CORRUPT);
00106     }
00107     else
00108     {
00109         GetNextTipString(m_strTip);
00110     }
00111 }

CTipDlg::~CTipDlg ( ) [virtual]

Definition at line 113 of file TipDlg.cpp.

References m_pStream, and NULL.

00114 {
00115     // This destructor is executed whether the user had pressed the escape key
00116     // or clicked on the close button. If the user had pressed the escape key,
00117     // it is still required to update the filepos in the ini file with the
00118     // latest position so that we don't repeat the tips!
00119
00120     // But make sure the tips file existed in the first place....
00121     if (m_pStream != NULL)
00122     {
00123         CWinApp* pApp = AfxGetApp();
00124         pApp->WriteProfileInt(szSection, szIntFilePos, ftell(m_pStream));
00125         fclose(m_pStream);
00126     }
00127 }

Member Function Documentation

void CTipDlg::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 129 of file TipDlg.cpp.

00130 {
00131     CDialog::DoDataExchange(pDX);
00132     //{{AFX_DATA_MAP(CTipDlg)
00133     DDX_Check(pDX, IDC_STARTUP, m_bStartup);
00134     DDX_Text(pDX, IDC_TIPSTRING, m_strTip);
00135     //}}AFX_DATA_MAP
00136 }

void CTipDlg::GetNextTipString ( CString & strNext ) [protected]

Definition at line 155 of file TipDlg.cpp.

References FALSE, NULL, and TRUE.

Referenced by CTipDlg(), and OnNextTip().

00156 {
00157     LPTSTR lpsz = strNext.GetBuffer(MAX_BUFLEN);
00158
00159     // This routine identifies the next string that needs to be
00160     // read from the tips file
00161     BOOL bStop = FALSE;
00162     while (!bStop)
00163     {
00164         if (_fgetts(lpsz, MAX_BUFLEN, m_pStream) == NULL)
00165         {
00166             // We have either reached EOF or enocuntered some problem
00167             // In both cases reset the pointer to the beginning of the file
00168             // This behavior is same as VC++ Tips file
00169             if (fseek(m_pStream, 0, SEEK_SET) != 0)
00170                 AfxMessageBox(CG_IDP_FILE_CORRUPT);
00171         }
00172         else
00173         {
00174             if (*lpsz != ' ' && *lpsz != '\t' &&
00175                 *lpsz != '\n' && *lpsz != ';')
00176             {
00177                 // There should be no space at the beginning of the tip
00178                 // This behavior is same as VC++ Tips file
00179                 // Comment lines are ignored and they start with a semicolon
00180                 bStop = TRUE;
00181             }
00182         }
00183     }
00184     strNext.ReleaseBuffer();
00185 }

HBRUSH CTipDlg::OnCtlColor | ( | CDC * | pDC,
 |  | CWnd * | pWnd,
 |  | UINT | nCtlColor
 | ) | [protected]

Definition at line 187 of file TipDlg.cpp.

References IDC_TIPSTRING.

00188 {
00189     if (pWnd->GetDlgCtrlID() == IDC_TIPSTRING)
00190         return (HBRUSH)GetStockObject(WHITE_BRUSH);
00191
00192     return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
00193 }

BOOL CTipDlg::OnInitDialog ( ) [protected, virtual]

Definition at line 204 of file TipDlg.cpp.

References m_pStream, NULL, and TRUE.

00205 {
00206     CDialog::OnInitDialog();
00207
00208     // If Tips file does not exist then disable NextTip
00209     if (m_pStream == NULL)
00210         GetDlgItem(IDC_NEXTTIP)->EnableWindow(FALSE);
00211
00212     return TRUE;  // return TRUE unless you set the focus to a control
00213 }

void CTipDlg::OnNextTip ( ) [protected]

Definition at line 149 of file TipDlg.cpp.

References GetNextTipString().

00150 {
00151     GetNextTipString(m_strTip);
00152     UpdateData(FALSE);
00153 }

void CTipDlg::OnOK ( ) [protected, virtual]

Definition at line 195 of file TipDlg.cpp.

00196 {
00197     CDialog::OnOK();
00198
00199     // Update the startup information stored in the INI file
00200     CWinApp* pApp = AfxGetApp();
00201     pApp->WriteProfileInt(szSection, szIntStartup, !m_bStartup);
00202 }

void CTipDlg::OnPaint ( ) [protected]

Definition at line 215 of file TipDlg.cpp.

00216 {
00217     CPaintDC dc(this); // device context for painting
00218
00219     // Get paint area for the big static control
00220     CWnd* pStatic = GetDlgItem(IDC_BULB);
00221     CRect rect;
00222     pStatic->GetWindowRect(&rect);
00223     ScreenToClient(&rect);
00224
00225     // Paint the background white.
00226     CBrush brush;
00227     brush.CreateStockObject(WHITE_BRUSH);
00228     dc.FillRect(rect, &brush);
00229
00230     // Load bitmap and get dimensions of the bitmap
00231     CBitmap bmp;
00232     bmp.LoadBitmap(IDB_LIGHTBULB);
00233     BITMAP bmpInfo;
00234     bmp.GetBitmap(&bmpInfo);
00235
00236     // Draw bitmap in top corner and validate only top portion of window
00237     CDC dcTmp;
00238     dcTmp.CreateCompatibleDC(&dc);
00239     dcTmp.SelectObject(&bmp);
00240     rect.bottom = bmpInfo.bmHeight + rect.top;
00241     dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(),
00242         &dcTmp, 0, 0, SRCCOPY);
00243
00244     // Draw out "Did you know..." message next to the bitmap
00245     CString strMessage;
00246     strMessage.LoadString(CG_IDS_DIDYOUKNOW);
00247     rect.left += bmpInfo.bmWidth;
00248     dc.DrawText(strMessage, rect, DT_VCENTER | DT_SINGLELINE);
00249
00250     // Do not call CDialog::OnPaint() for painting messages
00251 }

Member Data Documentation

BOOL CTipDlg::m_bStartup

Definition at line 38 of file TipDlg.h.

Referenced by CTipDlg(), and CWincvsApp::ShowTipAtStartup().

FILE* CTipDlg::m_pStream

Definition at line 42 of file TipDlg.h.

Referenced by CTipDlg(), OnInitDialog(), and ~CTipDlg().

CString CTipDlg::m_strTip

Definition at line 39 of file TipDlg.h.

Referenced by CTipDlg().

The documentation for this class was generated from the following files:
  • WinCvs/TipDlg.h
  • WinCvs/TipDlg.cpp
Generated on Fri Jan 31 12:20:18 2003 for WinCvs Source by doxygen 1.3-rc2


TemplateTMPersistent< T > class Reference

TMPersistent< T > Class Template Reference

#include <MultiString.h>

Inheritance diagram for TMPersistent< T >:

[legend]
Collaboration diagram for TMPersistent< T >:

[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< T >::list_t

Definition at line 45 of file MultiString.h.

Constructor & Destructor Documentation

template<class T>
TMPersistent< T >::TMPersistent | ( | const char * | uniqueName,
 |  | kClassPersistent | pclass = kNoClass
 | ) | [inline]

Definition at line 47 of file MultiString.h.

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(), TMPersistent< T >::fAllItems, TMPersistent< T >::fBuf, and TMPersistent< T >::SizeOf().

00054         {
00055             fBuf.AdjustSize(SizeOf());
00056             char *tmp = fBuf;
00057             *(int *) tmp = fAllItems.size();
00058             tmp += sizeof(int) / sizeof(char);
00059
00060             for(typename 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 TMPersistent< T >::fAllItems.

00084 { return fAllItems; }

template<class T>
const list_t& TMPersistent< T >::GetList ( void ) const [inline]

Definition at line 83 of file MultiString.h.

References TMPersistent< T >::fAllItems.

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 TMPersistent< T >::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 TMPersistent< T >::fAllItems.

Referenced by TMPersistent< T >::GetData().

00052 {return sizeof (int) + sizeof (T) * fAllItems.size ();};

Member Data Documentation

template<class T>
list_t TMPersistent< T >::fAllItems [protected]

Definition at line 87 of file MultiString.h.

Referenced by TMPersistent< T >::GetData(), TMPersistent< T >::GetList(), TMPersistent< T >::SetData(), and TMPersistent< T >::SizeOf().

template<class T>
CStaticAllocT<char> TMPersistent< T >::fBuf [mutable, protected]

Definition at line 88 of file MultiString.h.

Referenced by TMPersistent< T >::GetData().

The documentation for this class was generated from the following file:
  • common/MultiString.h
Generated on Fri Jan 31 12:20:19 2003 for WinCvs Source by doxygen 1.3-rc2


CTmpFiles Class Reference

Class to support the clean up of any temporary files created. More...

#include <AppGlue.h>

Collaboration diagram for CTmpFiles:

[legend]
List of all members.

Public Methods

CTmpFiles ()
virtual | ~CTmpFiles ()
const char * | push_back (const char *file)

Protected Attributes

std::vector< CStr > | m_allfiles

Detailed Description

Class to support the clean up of any temporary files created.

Definition at line 102 of file AppGlue.h.

Constructor & Destructor Documentation

CTmpFiles::CTmpFiles ( )

Definition at line 767 of file AppGlue.cpp.

00768 {
00769 }

CTmpFiles::~CTmpFiles ( ) [virtual]

Definition at line 771 of file AppGlue.cpp.

References m_allfiles.

00772 {
00773     std::vector<CStr>::const_iterator i;
00774     for(i = m_allfiles.begin(); i != m_allfiles.end(); ++i)
00775     {
00776         const char* file = *i;
00777         unlink((char*)file);
00778     }
00779 }

Member Function Documentation

const char * CTmpFiles::push_back ( const char * file ) [inline]

Definition at line 781 of file AppGlue.cpp.

References m_allfiles.

Referenced by launchCVS().

00782 {
00783     m_allfiles.push_back(file);
00784
00785     return m_allfiles[m_allfiles.size() - 1];
00786 }

Member Data Documentation

std::vector<CStr> CTmpFiles::m_allfiles [protected]

Files collection

Definition at line 109 of file AppGlue.h.

Referenced by push_back(), and ~CTmpFiles().

The documentation for this class was generated from the following files:
  • common/AppGlue.h
  • common/AppGlue.cpp
Generated on Fri Jan 31 12:20:20 2003 for WinCvs Source by doxygen 1.3-rc2


TemplateTMString< T > class Reference

TMString< T > Class Template Reference

#include <MultiString.h>

Inheritance diagram for TMString< T >:

[legend]
Collaboration diagram for TMString< T >:

[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< T >::list_t

Definition at line 95 of file MultiString.h.

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 TMString< T >::Insert().

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 TMString< T >::Find(), TMString< T >::Insert(), and TMString< T >::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 TMString< T >::Compare(), and TMString< T >::fAllStrs.

00112 {
00113 #if (__GNUC__ > 2)
00114     // prevent compiler warnings if gcc 3.x is used
00115     typename TMString<T>::list_t::const_iterator i;
00116 #else
00117     TMString<T>::list_t::const_iterator i;
00118 #endif
00119     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00120         if(Compare(*i, instr) == 0) break;
00121
00122     return i;
00123 }

template<class T>
const void * TMString< T >::GetData ( void ) const [virtual]

Implements CPersistent.

Definition at line 75 of file MultiString.cpp.

References TMString< T >::fAllStrs, TMString< T >::fBuf, NAMESPACE, and TMString< T >::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     typename 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 126 of file MultiString.cpp.

References TMString< T >::Compare(), TMString< T >::fAllStrs, TMString< T >::fMaxStr, NAMESPACE, and CPersistent::TouchTimeStamp().

Referenced by TMString< T >::TMString().

00127 {
00128     TouchTimeStamp();
00129
00130     typename NAMESPACE(std) vector<T>::iterator i;
00131     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00132     {
00133         if(Compare(*i, newstr) == 0)
00134         {
00135             fAllStrs.erase(i);
00136             fAllStrs.insert(fAllStrs.begin(), T(newstr));
00137             return;
00138         }
00139     }
00140     fAllStrs.insert(fAllStrs.begin(), T(newstr));
00141     if(fAllStrs.size() > fMaxStr)
00142     {
00143         fAllStrs.erase(fAllStrs.begin() + fMaxStr, fAllStrs.end());
00144     }
00145 }

template<class T>
bool TMString< T >::Remove ( const char * newstr )

Definition at line 148 of file MultiString.cpp.

References TMString< T >::Compare(), TMString< T >::fAllStrs, NAMESPACE, and CPersistent::TouchTimeStamp().

00149 {
00150
00151     typename NAMESPACE(std) vector<T>::iterator i;
00152     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00153     {
00154         if(Compare(*i, newstr) == 0)
00155         {
00156             TouchTimeStamp();
00157             fAllStrs.erase(i);
00158             return true;
00159         }
00160     }
00161
00162     return false;
00163 }

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 TMString< T >::fAllStrs, and TMString< T >::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 TMString< T >::fAllStrs, and NAMESPACE.

Referenced by TMString< T >::GetData().

00063 {
00064     typename 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< T >::fAllStrs [protected]

Definition at line 127 of file MultiString.h.

Referenced by TMString< T >::Find(), TMString< T >::GetData(), TMString< UPStr >::GetList(), TMString< T >::Insert(), TMString< T >::Remove(), TMString< T >::SetData(), and TMString< T >::SizeOf().

template<class T>
CStaticAllocT<char> TMString< T >::fBuf [mutable, protected]

Definition at line 128 of file MultiString.h.

Referenced by TMString< T >::GetData().

template<class T>
unsigned int TMString< T >::fMaxStr [protected]

Definition at line 129 of file MultiString.h.

Referenced by TMString< T >::Insert(), and TMString< T >::SetData().

The documentation for this class was generated from the following files:
  • common/MultiString.h
  • common/MultiString.cpp
Generated on Fri Jan 31 12:20:21 2003 for WinCvs Source by doxygen 1.3-rc2


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

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.

int | OnCommands (int cmd)
void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid.

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 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, UWidget::GetWidget(), UCmdTarget::GetWidID(), UTB_BUTTON::icon, m_winInfo, 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, UWidget::GetWidget(), UCmdTarget::GetWidID(), UTB_BUTTON::icon, m_winInfo, 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, 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, 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(), m_winInfo, 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, 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, tbeButton, tbeDropDown, tbeSeparator, UCMD_to_WINCMD, 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 && styles.size())
00515     {
00516         // create the Win32 toolbar
00517         m_wndToolBar->SetButtons(&styles.begin()[0], 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 OnTbInit(), 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 Fri Jan 31 12:20:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 46 of file ToolbarCombo.cpp.

00047 {
00048 }

CToolbarCombo::~CToolbarCombo ( ) [virtual]

Definition at line 50 of file ToolbarCombo.cpp.

00051 {
00052 }

Member Function Documentation

BOOL CToolbarCombo::Create | ( | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID
 | ) |

Definition at line 54 of file ToolbarCombo.cpp.

References FALSE, m_edit, and TRUE.

Referenced by CMainFrame::OnCreate().

00055 {
00056     if (!CComboBoxEx::Create(dwStyle, rect, pParentWnd, nID))
00057     {
00058         return FALSE;
00059     }
00060     SetExtendedStyle(CBES_EX_CASESENSITIVE, CBES_EX_CASESENSITIVE);
00061     m_edit.SubclassWindow(GetEditCtrl()->m_hWnd);
00062     m_edit.SetOwner(this);
00063     return TRUE;
00064 }

void CToolbarCombo::GetItemText | ( | int | pos,
 |  | LPTSTR | buffer,
 |  | int | count
 | ) |

Definition at line 121 of file ToolbarCombo.cpp.

References VERIFY.

Referenced by OnSelendok(), and SetText().

00122 {
00123     COMBOBOXEXITEM item;
00124     item.mask = CBEIF_TEXT;
00125     item.pszText = buffer;
00126     item.cchTextMax = count;
00127     item.iItem = pos;
00128     VERIFY(GetItem(&item));
00129 }

NotificationManager* CToolbarCombo::GetManager ( ) [inline]

Definition at line 52 of file ToolbarCombo.h.

Referenced by CMainFrame::OnCreate().

00053     {
00054         return &m_manager;
00055     }

const CString& CToolbarCombo::GetText ( ) [inline]

Definition at line 57 of file ToolbarCombo.h.

00058     {
00059         return m_text;
00060     }

LRESULT CToolbarCombo::OnContentChange | ( | WPARAM | wp,
 |  | LPARAM | lp
 | ) | [protected]

Definition at line 66 of file ToolbarCombo.cpp.

References m_edit, ResetText(), and SetText().

00067 {
00068     bool complete = wp != 0;
00069     if (complete)
00070     {
00071         CString text;
00072         m_edit.GetWindowText(text);
00073         SetText(text);
00074     }
00075     else
00076     {
00077         // restore previous text
00078         ResetText();
00079     }
00080     return 0;
00081 }

void CToolbarCombo::OnSelendcancel ( ) [protected]

Definition at line 144 of file ToolbarCombo.cpp.

References ResetText().

00145 {
00146     ResetText();
00147 }

void CToolbarCombo::OnSelendok ( ) [protected]

Definition at line 131 of file ToolbarCombo.cpp.

References GetItemText(), ResetText(), and SetText().

00132 {
00133     CComboBox* combo = GetComboBoxCtrl();
00134     int pos = combo->GetCurSel();
00135     if (pos >= 0)
00136     {
00137         TCHAR buffer[256];
00138         GetItemText(pos, buffer, 256);
00139         SetText(buffer);
00140         ResetText();
00141     }
00142 }

void CToolbarCombo::ResetText ( ) [protected]

Definition at line 83 of file ToolbarCombo.cpp.

References m_edit.

Referenced by OnContentChange(), OnSelendcancel(), and OnSelendok().

00084 {
00085     m_edit.SetWindowText(m_text);
00086 }

void CToolbarCombo::SetText ( const CString & text ) [protected]

Definition at line 88 of file ToolbarCombo.cpp.

References GetItemText(), m_manager, m_text, and NotificationManager::NotifyAll().

Referenced by OnContentChange(), and OnSelendok().

00089 {
00090     if (m_text.Compare(text) != 0)
00091     {
00092         m_text = text;
00093
00094         // append selection to combo box
00095         int count = GetCount();
00096         for (int i = count - 1; i >= 0 ; i--)
00097         {
00098             TCHAR buffer[256];
00099             GetItemText(i, buffer, 256);
00100             if (text.Compare(buffer) == 0)
00101             {
00102                 DeleteItem(i);
00103             }
00104         }
00105         COMBOBOXEXITEM item;
00106         item.mask = CBEIF_TEXT;
00107         item.iItem = 0;
00108         item.pszText = (LPTSTR)(LPCTSTR)text;
00109         InsertItem(&item);
00110         count = GetCount();
00111         while (count > 8)
00112         {
00113             count--;
00114             DeleteItem(count);
00115         }
00116
00117         m_manager.NotifyAll();
00118     }
00119 }

Member Data Documentation

CTbEdit CToolbarCombo::m_edit [private]

Definition at line 44 of file ToolbarCombo.h.

Referenced by Create(), OnContentChange(), and ResetText().

NotificationManager CToolbarCombo::m_manager [private]

Definition at line 45 of file ToolbarCombo.h.

Referenced by SetText().

CString CToolbarCombo::m_text [private]

Definition at line 46 of file ToolbarCombo.h.

Referenced by SetText().

The documentation for this class was generated from the following files:
  • WinCvs/ToolbarCombo.h
  • WinCvs/ToolbarCombo.cpp
Generated on Fri Jan 31 12:20:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:26 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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 Fri Jan 31 12:20:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 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 Fri Jan 31 12:20:27 2003 for WinCvs Source by doxygen 1.3-rc2


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(), 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 Fri Jan 31 12:20:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 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, 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.

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(), and SetValue().

double TPseudoDoubleNumberText::fMinimum [protected]

Definition at line 242 of file UPseudoSupport.h.

Referenced by GetValidationError(), and SetValue().

short TPseudoDoubleNumberText::fPrecision [protected]

Definition at line 244 of file UPseudoSupport.h.

Referenced by ReadFields().

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 Fri Jan 31 12:20:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:32 2003 for WinCvs Source by doxygen 1.3-rc2


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.

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.

int TPseudoScrollBar::fPageStep [private]

Definition at line 36 of file UPseudoSupport.h.

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 Fri Jan 31 12:20:33 2003 for WinCvs Source by doxygen 1.3-rc2


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.

References DoMouseCommand_SelectCells().

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().

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 DoKeyEvent(), and 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.

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 Fri Jan 31 12:20:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 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, 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 Fri Jan 31 12:20:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 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 Fri Jan 31 12:20:36 2003 for WinCvs Source by doxygen 1.3-rc2


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, CFillPyEntries, CFillTclEntries, LSReport, TViewFill, TBrowserFillDummy, TBrowserFill, TViewFill, TBrowserFillDummy, and TBrowserFill.

Definition at line 91 of file FileTraversal.h.

References kContinueTraversal, and kTraversal.

Referenced by FileTraverse().

00092     {
00093         return kContinueTraversal;
00094     }

virtual kTraversal TraversalReport::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented in ImportReport, CFillPyEntries, CFillTclEntries, LSReport, TViewFill, TBrowserFillDummy, TBrowserFill, TViewFill, TBrowserFillDummy, and TBrowserFill.

Definition at line 96 of file FileTraversal.h.

References kContinueTraversal, and 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, CFillPyEntries, CFillTclEntries, TViewFill, and TViewFill.

Definition at line 135 of file FileTraversal.h.

References kTraversal, and OnAnyDevice().

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, and kTraversal.

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, CFillPyEntries, CFillTclEntries, TViewFill, TBrowserFillDummy, TBrowserFill, TViewFill, TBrowserFillDummy, and TBrowserFill.

Definition at line 119 of file FileTraversal.h.

References kTraversal, and OnAnyDevice().

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, MacroTraversal, CFindSettings, CFillPyEntries, CFillTclEntries, LSReport, TViewFill, TBrowserFillDummy, TBrowserFill, TViewFill, TBrowserFillDummy, and TBrowserFill.

Definition at line 101 of file FileTraversal.h.

References 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, MacroTraversal, CFindSettings, CFillPyEntries, CFillTclEntries, TViewFill, and TViewFill.

Definition at line 127 of file FileTraversal.h.

References kTraversal, and OnAnyDevice().

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, CFillPyEntries, CFillTclEntries, LSReport, TViewFill, TBrowserFillDummy, TBrowserFill, TViewFill, TBrowserFillDummy, and TBrowserFill.

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.

The documentation for this class was generated from the following files:
  • common/FileTraversal.h
  • common/FileTraversal.cpp
Generated on Fri Jan 31 12:20:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 970 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems(), UCvsFolders::GetItemByLocation(), UWidget::OnTreeGetInfo(), UCvsFolders::StepToLocation(), and UCvsFolders::StoreExpanded().

void* UTREE_INFO::data

Definition at line 971 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 974 of file umain.h.

Referenced by UWidget::OnTreeGetInfo(), and UCvsFolders::StoreExpanded().

void* UTREE_INFO::icon

Definition at line 973 of file umain.h.

Referenced by TBrowserFill::ExitDirectory(), TBrowserFill::OnDirectory(), UWidget::OnTreeGetInfo(), and UWidget::OnTreeSetIcon().

UTREEITEM UTREE_INFO::item

Definition at line 967 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 969 of file umain.h.

Referenced by UCvsFolders::DeleteAllItems(), UCvsFolders::GetItemByLocation(), UWidget::OnTreeGetInfo(), UCvsFolders::StepToLocation(), and UCvsFolders::StoreExpanded().

UTREEITEM UTREE_INFO::parent

Definition at line 968 of file umain.h.

Referenced by UWidget::OnTreeGetInfo(), and UCvsFolders::RetrievePath().

char* UTREE_INFO::title

Definition at line 972 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 Fri Jan 31 12:20:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 962 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory(), UCvsFolders::OnTreeExpanding(), and UWidget::OnTreeInsert().

void* UTREE_INSERT::icon

Definition at line 961 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory(), UCvsFolders::OnTreeExpanding(), and UWidget::OnTreeInsert().

UTREEITEM UTREE_INSERT::parent

Definition at line 959 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory(), UCvsFolders::OnTreeExpanding(), and UWidget::OnTreeInsert().

UTREEITEM UTREE_INSERT::result

Definition at line 960 of file umain.h.

Referenced by TBrowserFillDummy::ExitDirectory(), and UWidget::OnTreeInsert().

const char* UTREE_INSERT::title

Definition at line 958 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 Fri Jan 31 12:20:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:38 2003 for WinCvs Source by doxygen 1.3-rc2


CTreeView Class Reference

Inheritance diagram for CTreeView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/WinCvsBrowser.h
Generated on Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


TViewFill Class Reference

Fill the view. More...

#include <BrowseFileView.h>

Inheritance diagram for TViewFill:

[legend]
Collaboration diagram for TViewFill:

[legend]
List of all members.

Public Methods

TViewFill (const KoTraversalContext *context)
TViewFill (const KoTraversalContext *context, CSortList< ENTNODE > &entries)
virtual | ~TViewFill ()
UCvsFiles * | GetView () const
Get the context view.

int | GetListCtrl () const
Get the list control.

bool | IsRecursive () const
Get the context recursive flag.

bool | IsShowIgnored () const
Get the context show ignored flag.

int | InitItem (EntnodeData *data, void *iImage, const char *tag=0L)
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)
int | InitItem (EntnodeData *data, int iImage, const char *tag=0L)
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)
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
::vector< UStr > | m_ignlist
const KoTraversalContext * | m_context
bool | m_isShowIgnored

Private Attributes

CSortList< ENTNODE > m_entries
vector< UStr > | m_ignlist
const KoTraversalContext * | m_context

Detailed Description

Fill the view.

Definition at line 266 of file UCvsFiles.cpp.

Constructor & Destructor Documentation

TViewFill::TViewFill ( const KoTraversalContext * context ) [inline]

Definition at line 275 of file UCvsFiles.cpp.

00275                                                  :
00276         m_entries(200, ENTNODE::Compare), m_context(context) {}

TViewFill::TViewFill | ( | const KoTraversalContext * | context,
 |  | CSortList< ENTNODE > & | entries
 | ) | [inline]

Definition at line 278 of file UCvsFiles.cpp.

00278                                                                                :
00279         m_entries(entries), m_context(context) {}

virtual TViewFill::~TViewFill ( ) [inline, virtual]

Definition at line 282 of file UCvsFiles.cpp.

00282 {}

TViewFill::TViewFill ( const KoTraversalContext * context )

Member Function Documentation

virtual kTraversal TViewFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

kTraversal TViewFill::EnterDirectory | ( | const char * | fullpath,
 |  | const char * | dirname,
 |  | const FSSpec * | macspec
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 361 of file UCvsFiles.cpp.

References BuildIgnoredList(), Entries_Open(), kContinueTraversal, and kTraversal.

00362     {
00363         Entries_Open (m_entries, fullpath);
00364         BuildIgnoredList(m_ignlist, fullpath);
00365
00366         return kContinueTraversal;
00367     }

virtual kTraversal TViewFill::ExitDirectory ( const char * fullpath ) [virtual]

Reimplemented from TraversalReport.

kTraversal TViewFill::ExitDirectory ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 369 of file UCvsFiles.cpp.

References ENTNODE::Data(), ENT_FILE, Entries_SetMissing(), CSortList< T >::Get(), EntnodeData::GetType(), InitItem(), KoTraversalContext::IsMatch(), EntnodeData::IsMissing(), IsRecursive(), kContinueTraversal, kTraversal, and CSortList< T >::NumOfElements().

00370     {
00371         // add the missing files
00372         Entries_SetMissing(m_entries);
00373
00374         int numEntries = m_entries.NumOfElements();
00375         for(int i = 0; i < numEntries; i++)
00376         {
00377             const ENTNODE & theNode = m_entries.Get(i);
00378             EntnodeData *data = theNode.Data();
00379             if (data->IsMissing() && m_context->IsMatch(data))
00380             {
00381                 if (!IsRecursive() || data->GetType() == ENT_FILE)
00382                 {
00383                     InitItem(data, UCvsFiles::GetImageForEntry(data));
00384                 }
00385             }
00386         }
00387
00388         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00389         return kContinueTraversal;
00390     }

CListCtrl& TViewFill::GetListCtrl ( ) const

CListCtrl & TViewFill::GetListCtrl ( ) const [inline]

Get the list control.

Definition at line 289 of file UCvsFiles.cpp.

References GetView(), and UCmdTarget::GetWidID().

Referenced by InitItem().

00290     {
00291         return GetView()->GetWidID();
00292     }

CBrowseFileView* TViewFill::GetView ( ) const

CBrowseFileView * TViewFill::GetView ( ) const [inline]

Get the context view.

Definition at line 284 of file UCvsFiles.cpp.

References KoTraversalContext::m_view.

Referenced by GetListCtrl(), and InitItem().

00285     {
00286         return m_context->m_view;
00287     }

int TViewFill::InitItem | ( | EntnodeData * | data,
 |  | int | iImage,
 |  | const char * | tag = 0L
 | ) |

Initialize and add new item to list view

Parameters:
data | Node to be added
iImage | Image for the node
tag | Tag
Returns:
Index of the new inserted item

Definition at line 211 of file BrowseFileView.cpp.

References KiColumnModel::GetAt(), UCvsFiles::GetColumnModel(), KiColumnModel::GetCount(), GetListCtrl(), KiColumn::GetText(), GetView(), and IsRecursive().

00212 {
00213     CListCtrl& listCtrl = GetListCtrl();
00214     KoColumnContext context(GetView()->GetPath());
00215
00216     TCHAR buf[256];
00217     GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00218
00219     LV_ITEM lvi;
00220     lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
00221     lvi.iItem = listCtrl.GetItemCount();
00222     lvi.iSubItem = 0;
00223     lvi.pszText = buf;
00224     lvi.iImage = iImage;
00225     lvi.lParam = (LPARAM)(LPVOID)data;
00226     int pos = listCtrl.InsertItem(&lvi);
00227     if( pos >= 0 )
00228     {
00229         // Note ownership addition
00230         data->Ref();
00231
00232         // Set item text for additional columns
00233         KiColumnModel* model = GetView()->GetColumnModel();
00234         int columnCount = model->GetCount();
00235         for(int j = 1; j < columnCount; j++)
00236         {
00237             TCHAR buf[256];
00238             model->GetAt(j)->GetText(&context, data, buf, 256);
00239             listCtrl.SetItemText(pos, j, buf);
00240         }
00241
00242         if( tag != 0L && tag[0] != '\0' && !IsRecursive() )
00243             listCtrl.SetItemText(pos, EntnodeFile::kTag, tag);
00244     }
00245
00246     return pos;
00247 }

int TViewFill::InitItem | ( | EntnodeData * | data,
 |  | void * | iImage,
 |  | const char * | tag = 0L
 | ) | [inline]

Definition at line 306 of file UCvsFiles.cpp.

References ULIST_INSERT::col, KiColumnModel::GetAt(), KiColumnModel::GetColumn(), UCvsFiles::GetColumnModel(), KiColumnModel::GetCount(), EntnodeData::GetDesc(), GetListCtrl(), KiColumn::GetText(), GetView(), ULIST_INSERT::icon, EntnodeData::IsLocked(), IsRecursive(), EntnodeData::Ref(), ULIST_INSERT::row, ULIST_INSERT::title, UEventSendMessage(), and UMAKEINT.

Referenced by ExitDirectory(), OnDirectory(), OnFile(), and UCvsFiles::ResetView().

00307     {
00308             KoColumnContext context(GetView()->GetPath());
00309             char buf[256];
00310             GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00311
00312             int rownum;
00313             UEventSendMessage(GetListCtrl(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00314             UEventSendMessage(GetListCtrl(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00315             ULIST_INSERT entry;
00316             entry.row = rownum;
00317             entry.col = 0;
00318             entry.title = buf;
00319             entry.icon = /*UCvsFiles::GetImageForEntry(data);*/iImage;
00320             UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00321
00322             entry.icon = 0L;
00323
00324             if(rownum >= 0) {
00325                 data->Ref();
00326
00327 #if 0 /* TODO */
00328             lvi.state = data->IsLocked() ?
00329                 INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00330 #endif
00331
00332                 // set item text for additional columns
00333                 KiColumnModel* model = GetView()->GetColumnModel();
00334                 int columnCount = model->GetCount();
00335                 for(int j = 1; j < columnCount; j++)
00336                 {
00337                     char buf[256];
00338                     model->GetAt(j)->GetText(&context, data, buf, 256);
00339
00340                     if(buf[0] != 0L)
00341                     {
00342                         entry.col = j;
00343                         entry.title = buf;
00344                         UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00345                     }
00346                 }
00347
00348                 entry.col = model->GetColumn(EntnodeData::kStatus);
00349                 entry.title = data->GetDesc();
00350                 UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00351
00352                 if(tag != 0L && tag[0] != '\0' && !IsRecursive()) {
00353                     entry.col = model->GetColumn(EntnodeFile::kTag);
00354                     entry.title = tag == 0L ? "" : (const char *)tag;
00355                     UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00356                 }
00357             }
00358             return rownum;
00359     }

bool TViewFill::IsRecursive ( ) const

bool TViewFill::IsRecursive ( ) const [inline]

Get the context recursive flag.

Definition at line 294 of file UCvsFiles.cpp.

References KoTraversalContext::IsRecursive().

Referenced by ExitDirectory(), InitItem(), and OnDirectory().

00295     {
00296         //fprintf(stderr, "context_recur: %d\n", m_context->IsRecursive());
00297         return m_context->IsRecursive();
00298     }

bool TViewFill::IsShowIgnored ( ) const

bool TViewFill::IsShowIgnored ( ) const [inline]

Get the context show ignored flag.

Definition at line 300 of file UCvsFiles.cpp.

References KoTraversalContext::IsShowIgnored().

Referenced by OnDirectory(), and OnFile().

00301     {
00302         return m_context->IsShowIgnored();
00303     }

virtual kTraversal TViewFill::OnAlias | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

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 445 of file UCvsFiles.cpp.

References kTraversal, and OnFile().

00449     {
00450         return OnFile(fullpath, fullname, name, dir, macspec);
00451     }

virtual kTraversal TViewFill::OnDirectory | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

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 402 of file UCvsFiles.cpp.

References CStr, Entries_SetVisited(), FileTraverse(), InitItem(), EntnodeData::IsIgnored(), EntnodeData::IsMissing(), IsRecursive(), IsShowIgnored(), EntnodeData::IsUnknown(), kSkipFile, kTraversal, kTraversalError, and Tag_Open().

00406     {
00407 #if qUnix
00408         if(strcmp(name, "CVS") == 0)
00409 #else
00410         if(stricmp(name, "CVS") == 0)
00411 #endif
00412             return kSkipFile;
00413
00414         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00415         if(!IsShowIgnored() && data->IsIgnored())
00416             return kSkipFile;
00417
00418         if (IsRecursive())
00419         {
00420             if (!data->IsIgnored() && !data->IsUnknown() && !data->IsMissing())
00421             {
00422                 TViewFill traverse(m_context);
00423                 FileTraverse(fullname, traverse);
00424             }
00425             return kSkipFile;
00426         }
00427
00428         // get the tag
00429         CStr subCVS;
00430         CStr tagName;
00431         subCVS = fullname;
00432         if(!subCVS.endsWith(kPathDelimiter))
00433             subCVS << kPathDelimiter;
00434         subCVS << "CVS";
00435         if(chdir(subCVS) == 0)
00436             Tag_Open(tagName, subCVS);
00437         if(chdir(fullpath) != 0)
00438             return kTraversalError;
00439
00440         InitItem(data, UCvsFiles::GetImageForEntry(data), tagName);
00441
00442         return kSkipFile;
00443     }

virtual kTraversal TViewFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [virtual]

Reimplemented from TraversalReport.

kTraversal TViewFill::OnError | ( | const char * | err,
 |  | int | errcode
 | ) | [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 392 of file UCvsFiles.cpp.

References kTraversal, and kTraversalError.

00393     {
00394         return kTraversalError;
00395     }

virtual kTraversal TViewFill::OnFile | ( | const char * | fullpath,
 |  | const char * | fullname,
 |  | const char * | name,
 |  | const struct stat & | dir,
 |  | const FSSpec * | macspec
 | ) | [virtual]

Reimplemented from TraversalReport.

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 453 of file UCvsFiles.cpp.

References Entries_SetVisited(), InitItem(), EntnodeData::IsIgnored(), KoTraversalContext::IsMatch(), IsShowIgnored(), kContinueTraversal, and kTraversal.

Referenced by OnAlias().

00457     {
00458         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00459         if(!IsShowIgnored() && data->IsIgnored())
00460             return kContinueTraversal;
00461
00462         if( m_context->IsMatch(data) )
00463         {
00464             InitItem(data, UCvsFiles::GetImageForEntry(data));
00465         }
00466
00467         return kContinueTraversal;
00468     }

virtual kTraversal TViewFill::OnIdle ( const char * fullpath ) [virtual]

Reimplemented from TraversalReport.

kTraversal TViewFill::OnIdle ( const char * fullpath ) [inline, virtual]

Reimplemented from TraversalReport.

Definition at line 397 of file UCvsFiles.cpp.

References kContinueTraversal, and kTraversal.

00398     {
00399         return kContinueTraversal;
00400     }

Member Data Documentation

const KoTraversalContext* TViewFill::m_context [private]

Traversal context

Definition at line 126 of file BrowseFileView.h.

const KoTraversalContext* TViewFill::m_context

Definition at line 272 of file UCvsFiles.cpp.

CSortList<ENTNODE> TViewFill::m_entries [private]

Entries list

Definition at line 124 of file BrowseFileView.h.

CSortList<ENTNODE> TViewFill::m_entries

Definition at line 269 of file UCvsFiles.cpp.

vector< UStr > TViewFill::m_ignlist [private]

Ignore list

Definition at line 125 of file BrowseFileView.h.

:: vector< UStr > TViewFill::m_ignlist

Definition at line 271 of file UCvsFiles.cpp.

bool TViewFill::m_isShowIgnored

Definition at line 273 of file UCvsFiles.cpp.

The documentation for this class was generated from the following files:
  • common/UCvsFiles.cpp
  • WinCvs/BrowseFileView.h
  • WinCvs/BrowseFileView.cpp
Generated on Fri Jan 31 12:20:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 66 of file UpdateDlg.h.

00066 { IDD = IDD_UPDATE_MAIN };

Constructor & Destructor Documentation

CUpdateMain::CUpdateMain ( )

Definition at line 106 of file UpdateDlg.cpp.

References FALSE, m_createmissdir, m_delsticky, m_getcleancopy, m_norecurs, and m_stdout.

00106                          : CPropertyPage(CUpdateMain::IDD)
00107 {
00108     //{{AFX_DATA_INIT(CUpdateMain)
00109     m_delsticky = FALSE;
00110     m_norecurs = FALSE;
00111     m_stdout = FALSE;
00112     m_createmissdir = FALSE;
00113     m_getcleancopy = FALSE;
00114     //}}AFX_DATA_INIT
00115 }

CUpdateMain::~CUpdateMain ( )

Definition at line 117 of file UpdateDlg.cpp.

00118 {
00119 }

Member Function Documentation

void CUpdateMain::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 121 of file UpdateDlg.cpp.

00122 {
00123     CPropertyPage::DoDataExchange(pDX);
00124     //{{AFX_DATA_MAP(CUpdateMain)
00125     DDX_Check(pDX, IDC_DELSTICKY, m_delsticky);
00126     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00127     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00128     DDX_Check(pDX, IDC_CREATEMISSDIR, m_createmissdir);
00129     DDX_Check(pDX, IDC_CLEANCOPY, m_getcleancopy);
00130     //}}AFX_DATA_MAP
00131 }

Member Data Documentation

BOOL CUpdateMain::m_createmissdir

Definition at line 70 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateMain().

BOOL CUpdateMain::m_delsticky

Definition at line 67 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateMain().

BOOL CUpdateMain::m_getcleancopy

Definition at line 71 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateMain().

BOOL CUpdateMain::m_norecurs

Definition at line 68 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateMain().

BOOL CUpdateMain::m_stdout

Definition at line 69 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateMain().

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Fri Jan 31 12:20:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 (const MultiFiles *mf, bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2)
~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 ()
afx_msg void | OnBrowseTag1 ()
afx_msg void | OnBrowseTag2 ()

Private Attributes

const MultiFiles * | m_mf
bool | m_isCheckout

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 105 of file UpdateDlg.h.

00105 { IDD = IDD_UPDATE_MERGE };

Constructor & Destructor Documentation

CUpdateMerge::CUpdateMerge | ( | const MultiFiles * | mf,
 |  | bool | isCheckout,
 |  | const char * | rev1,
 |  | const char * | rev2,
 |  | const char * | date1,
 |  | const char * | date2
 | ) |

Definition at line 256 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().

00259                            : m_mf(mf), CPropertyPage(CUpdateMerge::IDD)
00260 {
00261     //{{AFX_DATA_INIT(CUpdateMerge)
00262     m_rev1 = rev1;
00263     m_rev2 = rev2;
00264     m_merge = 0;
00265     m_hasDate1 = FALSE;
00266     m_hasDate2 = FALSE;
00267     m_date1 = _T("");
00268     m_date2 = _T("");
00269     //}}AFX_DATA_INIT
00270
00271     m_isCheckout = isCheckout;
00272
00273     m_rev1Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00274     m_rev2Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00275     m_date1Combo.SetItems(&gDateNames);
00276     m_date2Combo.SetItems(&gDateNames);
00277 }

CUpdateMerge::~CUpdateMerge ( )

Definition at line 279 of file UpdateDlg.cpp.

00280 {
00281 }

Member Function Documentation

void CUpdateMerge::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 283 of file UpdateDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), m_merge, and OnMerge().

00284 {
00285     CPropertyPage::DoDataExchange(pDX);
00286     //{{AFX_DATA_MAP(CUpdateMerge)
00287     DDX_Control(pDX, IDC_COMBODATE2, m_date2Combo);
00288     DDX_Control(pDX, IDC_COMBODATE1, m_date1Combo);
00289     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00290     DDX_Control(pDX, IDC_COMBOREV, m_rev1Combo);
00291     DDX_CBString(pDX, IDC_COMBOREV, m_rev1);
00292     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00293     DDX_Radio(pDX, IDC_MERGE, m_merge);
00294     DDX_Check(pDX, IDC_CHECKDATE1, m_hasDate1);
00295     DDX_Check(pDX, IDC_CHECKDATE2, m_hasDate2);
00296     DDX_CBString(pDX, IDC_COMBODATE1, m_date1);
00297     DDX_CBString(pDX, IDC_COMBODATE2, m_date2);
00298     //}}AFX_DATA_MAP
00299
00300     if( m_merge == 1 || m_merge == 2 )
00301     {
00302         DDV_MinChars(pDX, m_rev1, 1);
00303         if( m_hasDate1 )
00304         {
00305             DDV_MinChars(pDX, m_date1, 1);
00306         }
00307     }
00308
00309     if( m_merge == 2 )
00310     {
00311         DDV_MinChars(pDX, m_rev2, 1);
00312         if( m_hasDate2 )
00313         {
00314             DDV_MinChars(pDX, m_date2, 1);
00315         }
00316     }
00317
00318     if( !pDX->m_bSaveAndValidate )
00319     {
00320         OnMerge();
00321     }
00322
00323     DDX_ComboMString(pDX, IDC_COMBOREV, m_rev1Combo);
00324     DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00325     DDX_ComboMString(pDX, IDC_COMBODATE1, m_date1Combo);
00326     DDX_ComboMString(pDX, IDC_COMBODATE2, m_date2Combo);
00327 }

void CUpdateMerge::OnBrowseTag1 ( ) [protected]

Definition at line 391 of file UpdateDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev1, and m_rev1Combo.

00392 {
00393     CStr tagName;
00394     if( CompatGetTagListItem(m_mf, tagName) )
00395     {
00396         m_rev1 = (const char*)tagName;
00397         m_rev1Combo.SetWindowText(m_rev1);
00398     }
00399 }

void CUpdateMerge::OnBrowseTag2 ( ) [protected]

Definition at line 401 of file UpdateDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev2, and m_rev2Combo.

00402 {
00403     CStr tagName;
00404     if( CompatGetTagListItem(m_mf, tagName) )
00405     {
00406         m_rev2 = (const char*)tagName;
00407         m_rev2Combo.SetWindowText(m_rev2);
00408     }
00409 }

void CUpdateMerge::OnCheckdate1 ( ) [protected]

Definition at line 381 of file UpdateDlg.cpp.

References OnMerge().

00382 {
00383     OnMerge();
00384 }

void CUpdateMerge::OnCheckdate2 ( ) [protected]

Definition at line 386 of file UpdateDlg.cpp.

References OnMerge().

00387 {
00388     OnMerge();
00389 }

void CUpdateMerge::OnMerge ( ) [protected]

Definition at line 329 of file UpdateDlg.cpp.

Referenced by DoDataExchange(), OnCheckdate1(), OnCheckdate2(), OnMerge1(), and OnMerge2().

00330 {
00331     CButton* chkMerge1 = (CButton*)GetDlgItem(IDC_MERGE1);
00332     CButton* chkMerge2 = (CButton*)GetDlgItem(IDC_MERGE2);
00333     CWnd* wndRev1 = GetDlgItem(IDC_COMBOREV);
00334     CWnd* wndRev2 = GetDlgItem(IDC_COMBOREV2);
00335     CWnd* wndBrowseTag1 = GetDlgItem(IDC_BROWSE_TAG1);
00336     CWnd* wndBrowseTag2 = GetDlgItem(IDC_BROWSE_TAG2);
00337
00338     CButton* chkDate1 = (CButton*)GetDlgItem(IDC_CHECKDATE1);
00339     CButton* chkDate2 = (CButton*)GetDlgItem(IDC_CHECKDATE2);
00340     CWnd* wndDate1 = GetDlgItem(IDC_COMBODATE1);
00341     CWnd* wndDate2 = GetDlgItem(IDC_COMBODATE2);
00342
00343     if( chkMerge1->GetCheck() == 1 )
00344     {
00345         wndRev1->EnableWindow(TRUE);
00346         wndRev2->EnableWindow(FALSE);
00347         wndBrowseTag1->EnableWindow(TRUE);
00348         wndBrowseTag2->EnableWindow(FALSE);
00349     }
00350     else if( chkMerge2->GetCheck() == 1 )
00351     {
00352         wndRev1->EnableWindow(TRUE);
00353         wndRev2->EnableWindow(TRUE);
00354         wndBrowseTag1->EnableWindow(TRUE);
00355         wndBrowseTag2->EnableWindow(TRUE);
00356     }
00357     else
00358     {
00359         wndRev1->EnableWindow(FALSE);
00360         wndRev2->EnableWindow(FALSE);
00361         wndBrowseTag1->EnableWindow(FALSE);
00362         wndBrowseTag2->EnableWindow(FALSE);
00363     }
00364
00365     chkDate1->EnableWindow(wndRev1->IsWindowEnabled());
00366     chkDate2->EnableWindow(wndRev2->IsWindowEnabled());
00367     wndDate1->EnableWindow(wndRev1->IsWindowEnabled() && chkDate1->GetCheck());
00368     wndDate2->EnableWindow(wndRev2->IsWindowEnabled() && chkDate2->GetCheck());
00369 }

void CUpdateMerge::OnMerge1 ( ) [protected]

Definition at line 371 of file UpdateDlg.cpp.

References OnMerge().

00372 {
00373     OnMerge();
00374 }

void CUpdateMerge::OnMerge2 ( ) [protected]

Definition at line 376 of file UpdateDlg.cpp.

References OnMerge().

00377 {
00378     OnMerge();
00379 }

Member Data Documentation

CString CUpdateMerge::m_date1

Definition at line 115 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), and CUpdateMerge().

CSmartComboBox CUpdateMerge::m_date1Combo

Definition at line 107 of file UpdateDlg.h.

Referenced by CUpdateMerge().

CString CUpdateMerge::m_date2

Definition at line 116 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), and CUpdateMerge().

CSmartComboBox CUpdateMerge::m_date2Combo

Definition at line 106 of file UpdateDlg.h.

Referenced by CUpdateMerge().

BOOL CUpdateMerge::m_hasDate1

Definition at line 113 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), and CUpdateMerge().

BOOL CUpdateMerge::m_hasDate2

Definition at line 114 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), and CUpdateMerge().

bool CUpdateMerge::m_isCheckout [private]

Definition at line 142 of file UpdateDlg.h.

Referenced by CUpdateMerge().

int CUpdateMerge::m_merge

Definition at line 112 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), CUpdateMerge(), and DoDataExchange().

const MultiFiles* CUpdateMerge::m_mf [private]

Definition at line 141 of file UpdateDlg.h.

CString CUpdateMerge::m_rev1

Definition at line 110 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), CUpdateMerge(), and OnBrowseTag1().

CSmartComboBox CUpdateMerge::m_rev1Combo

Definition at line 109 of file UpdateDlg.h.

Referenced by CUpdateMerge(), and OnBrowseTag1().

CString CUpdateMerge::m_rev2

Definition at line 111 of file UpdateDlg.h.

Referenced by CompatGetCheckout(), CompatGetUpdate(), CUpdateMerge(), and OnBrowseTag2().

CSmartComboBox CUpdateMerge::m_rev2Combo

Definition at line 108 of file UpdateDlg.h.

Referenced by CUpdateMerge(), and OnBrowseTag2().

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Fri Jan 31 12:20:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 MultiFiles *mf, const char *rev, const char *date, const char *keyword)
~CUpdateSticky ()

Public Attributes

CKeywordComboBox m_keywordCombo
CStatic m_keywordDescStatic
CSmartComboBox m_dateCombo
CSmartComboBox m_revCombo
CString | m_date
CString | m_rev
BOOL | m_hasdate
BOOL | m_hasrev
BOOL | m_match
CString | m_keyword

Protected Methods

virtual void | DoDataExchange (CDataExchange *pDX)
afx_msg void | OnDate ()
afx_msg void | OnRev ()
afx_msg void | OnBrowseTag ()
virtual BOOL | OnInitDialog ()
OnInitDialog virtual override, initialize the controls.

Private Attributes

const MultiFiles * | m_mf

Member Enumeration Documentation

anonymous enum

Enumeration values:
IDD

Definition at line 157 of file UpdateDlg.h.

00157 { IDD = IDD_UPDATE_STICKY };

Constructor & Destructor Documentation

CUpdateSticky::CUpdateSticky | ( | const MultiFiles * | mf,
 |  | const char * | rev,
 |  | const char * | date,
 |  | const char * | keyword
 | ) |

Definition at line 142 of file UpdateDlg.cpp.

References FALSE, m_date, m_dateCombo, m_hasdate, m_hasrev, m_keyword, m_match, m_rev, m_revCombo, and USmartCombo::SetItems().

00144                              : m_mf(mf), CPropertyPage(CUpdateSticky::IDD)
00145 {
00146     //{{AFX_DATA_INIT(CUpdateSticky)
00147     m_date = date;
00148     m_rev = rev;
00149     m_hasdate = FALSE;
00150     m_hasrev = FALSE;
00151     m_match = FALSE;
00152     m_keyword = keyword;
00153     //}}AFX_DATA_INIT
00154
00155     m_revCombo.SetItems(&gRevNames);
00156     m_dateCombo.SetItems(&gDateNames);
00157 }

CUpdateSticky::~CUpdateSticky ( )

Definition at line 159 of file UpdateDlg.cpp.

00160 {
00161 }

Member Function Documentation

void CUpdateSticky::DoDataExchange ( CDataExchange * pDX ) [protected, virtual]

Definition at line 163 of file UpdateDlg.cpp.

References DDV_MinChars(), DDX_ComboMString(), OnDate(), and OnRev().

00164 {
00165     CPropertyPage::DoDataExchange(pDX);
00166     //{{AFX_DATA_MAP(CUpdateSticky)
00167     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00168     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00169     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00170     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00171     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00172     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00173     DDX_Check(pDX, IDC_DATE, m_hasdate);
00174     DDX_Check(pDX, IDC_REV, m_hasrev);
00175     DDX_Check(pDX, IDC_MATCH, m_match);
00176     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00177     //}}AFX_DATA_MAP
00178
00179     if( m_hasrev )
00180     {
00181         DDV_MinChars(pDX, m_rev, 1);
00182     }
00183
00184     if( m_hasdate )
00185     {
00186         DDV_MinChars(pDX, m_date, 1);
00187     }
00188
00189     if( !pDX->m_bSaveAndValidate )
00190     {
00191         OnDate();
00192         OnRev();
00193     }
00194
00195     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00196     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00197 }

void CUpdateSticky::OnBrowseTag ( ) [protected]

Definition at line 244 of file UpdateDlg.cpp.

References CompatGetTagListItem(), CStr, m_rev, and m_revCombo.

00245 {
00246     CStr tagName;
00247     if( CompatGetTagListItem(m_mf, tagName) )
00248     {
00249         m_rev = (const char*)tagName;
00250         m_revCombo.SetWindowText(m_rev);
00251     }
00252 }

void CUpdateSticky::OnDate ( ) [protected]

Definition at line 220 of file UpdateDlg.cpp.

Referenced by DoDataExchange().

00221 {
00222     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00223     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00224     wnd->EnableWindow(but->GetCheck() == 1);
00225 }

BOOL CUpdateSticky::OnInitDialog ( ) [protected, virtual]

OnInitDialog virtual override, initialize the controls.

Definition at line 209 of file UpdateDlg.cpp.

References m_keywordCombo, m_keywordDescStatic, CKeywordComboBox::SetDescriptionWnd(), and TRUE.

00210 {
00211     CPropertyPage::OnInitDialog();
00212
00213     // Extra initialization
00214     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00215
00216     return TRUE;  // return TRUE unless you set the focus to a control
00217                   // EXCEPTION: OCX Property Pages should return FALSE
00218 }

void CUpdateSticky::OnRev ( ) [protected]

Definition at line 227 of file UpdateDlg.cpp.

Referenced by DoDataExchange().

00228 {
00229     CButton* but = (CButton*)GetDlgItem(IDC_REV);
00230
00231     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00232     if( wnd )
00233     {
00234         wnd->EnableWindow(but->GetCheck());
00235     }
00236
00237     wnd = GetDlgItem(IDC_BROWSE_TAG);
00238     if( wnd )
00239     {
00240         wnd->EnableWindow(but->GetCheck());
00241     }
00242 }

Member Data Documentation

CString CUpdateSticky::m_date

Definition at line 162 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateSticky().

CSmartComboBox CUpdateSticky::m_dateCombo

Definition at line 160 of file UpdateDlg.h.

Referenced by CUpdateSticky().

BOOL CUpdateSticky::m_hasdate

Definition at line 164 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateSticky().

BOOL CUpdateSticky::m_hasrev

Definition at line 165 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateSticky().

CString CUpdateSticky::m_keyword

Definition at line 167 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateSticky().

CKeywordComboBox CUpdateSticky::m_keywordCombo

Definition at line 158 of file UpdateDlg.h.

Referenced by OnInitDialog().

CStatic CUpdateSticky::m_keywordDescStatic

Definition at line 159 of file UpdateDlg.h.

Referenced by OnInitDialog().

BOOL CUpdateSticky::m_match

Definition at line 166 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), and CUpdateSticky().

const MultiFiles* CUpdateSticky::m_mf [private]

Definition at line 189 of file UpdateDlg.h.

CString CUpdateSticky::m_rev

Definition at line 163 of file UpdateDlg.h.

Referenced by CompatGetUpdate(), CUpdateSticky(), and OnBrowseTag().

CSmartComboBox CUpdateSticky::m_revCombo

Definition at line 161 of file UpdateDlg.h.

Referenced by CUpdateSticky(), and OnBrowseTag().

The documentation for this class was generated from the following files:
  • common/UpdateDlg.h
  • common/UpdateDlg.cpp
Generated on Fri Jan 31 12:20:46 2003 for WinCvs Source by doxygen 1.3-rc2


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::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 Fri Jan 31 12:20:46 2003 for WinCvs Source by doxygen 1.3-rc2


vector Class Reference

Inheritance diagram for vector:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/CustomizeMenus.cpp
Generated on Fri Jan 31 12:20:46 2003 for WinCvs Source by doxygen 1.3-rc2


CView Class Reference

Inheritance diagram for CView:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/BrowserBar.h
Generated on Fri Jan 31 12:20:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:47 2003 for WinCvs Source by doxygen 1.3-rc2


CvsArgs Class Reference

Class to handle cvs arguments, append "cvs" and misc options defined by preferences ("-z9" for example). More...

#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)
Add arguments.

virtual void | addfile (const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L)
Add file.

void | addcvsroot ()
Add current CVSROOT.

void | reset (bool defargs=true)
void | print (const char *indirectory=0L)
char *const * | Argv (void) const
Get the arguments list.

int | Argc (void) const
Get the arguments count.

Protected Attributes

char ** | argv
int | argc

Detailed Description

Class to handle cvs arguments, append "cvs" and misc options defined by preferences ("-z9" for example).

Definition at line 37 of file CvsArgs.h.

Constructor & Destructor Documentation

CvsArgs::CvsArgs ( bool defargs = true )

Definition at line 120 of file CvsArgs.cpp.

References argc, argv, NULL, and reset().

00121 {
00122     argv = NULL;
00123     argc = 0;
00124
00125     reset(defargs);
00126 }

CvsArgs::CvsArgs | ( | char *const * | fromargv,
 |  | int | fromargc
 | ) |

Definition at line 128 of file CvsArgs.cpp.

References add(), argc, argv, NULL, and reset().

00129 {
00130     argv = NULL;
00131     argc = 0;
00132
00133     reset(false);
00134
00135     for(int i = 0; i < fromargc; i++)
00136     {
00137         add(fromargv[i]);
00138     }
00139 }

CvsArgs::~CvsArgs ( ) [virtual]

Definition at line 141 of file CvsArgs.cpp.

References reset().

00142 {
00143     reset(false);
00144 }

Member Function Documentation

void CvsArgs::add ( const char * arg ) [virtual]

Add arguments.

Definition at line 255 of file CvsArgs.cpp.

References argc, argv, malloc, mystrdup(), and realloc.

Referenced by addcvsroot(), addfile(), CvsArgs(), CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLog(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), cvsgui_RunCvs(), UCvsFiles::EditSel(), UCvsApp::Execute(), LaunchDiff(), LaunchItemListCommand(), UCvsFolders::OnCmdExplore(), MacroTraversal::OnFile(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnQueryAnnotate(), CGraphView::OnViewDelrev(), CGraphView::OnViewReload(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), CGraphView::OnViewUpdate(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), and tclCvsProc().

00256 {
00257     if(argv == 0L)
00258         argv = (char**)malloc(2 * sizeof(char*));
00259     else
00260         argv = (char**)realloc(argv, (argc + 2) * sizeof(char*));
00261
00262     argv[argc++] = arg != 0L ? mystrdup(arg) : 0L;
00263     argv[argc] = 0L;
00264 }

void CvsArgs::addcvsroot ( )

Add current CVSROOT.

Definition at line 273 of file CvsArgs.cpp.

References add(), CStr, and Authen::skiptoken().

Referenced by CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdInit(), CvsCmdLogin(), and LaunchItemListCommand().

00274 {
00275     // Extract from the cvsroot
00276     const char* ccvsroot = gCvsPrefs;
00277     ccvsroot = Authen::skiptoken(ccvsroot);
00278
00279     CStr root;
00280
00281     root = gAuthen.token();
00282     root << ccvsroot;
00283
00284     add("-d");
00285     add(root);
00286 }

void CvsArgs::addfile | ( | const char * | arg,
 |  | const char * | dir = 0L,
 |  | const FSSpec * | spec = 0L,
 |  | const char * | currRevision = 0L
 | ) | [virtual]

Add file.

Reimplemented in ControlCvsArgs, and RemoveCvsArgs.

Definition at line 267 of file CvsArgs.cpp.

References add().

Referenced by MultiFilesEntry::add(), RemoveCvsArgs::addfile(), and ControlCvsArgs::addfile().

00268 {
00269     add(arg);
00270 }

int CvsArgs::Argc ( void ) const

Get the arguments count.

Definition at line 295 of file CvsArgs.cpp.

References argc.

Referenced by CvsCmdAdd(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), cvsgui_RunCvs(), UCvsFiles::EditSel(), UCvsApp::Execute(), launchCVS(), LaunchDiff(), LaunchItemListCommand(), UCvsFolders::OnCmdExplore(), MacroTraversal::OnFile(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnViewDelrev(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), CGraphView::OnViewUpdate(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), and tclCvsProc().

00296 {
00297     return argc;
00298 }

char *const * CvsArgs::Argv ( void ) const

Get the arguments list.

Definition at line 289 of file CvsArgs.cpp.

References argv.

Referenced by CompatGetPrefs(), CvsCmdAdd(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), cvsgui_RunCvs(), UCvsFiles::EditSel(), UCvsApp::Execute(), launchCVS(), LaunchDiff(), LaunchItemListCommand(), CGetPrefs_CVS::OnAltcvssel(), UAuthen_SSH::OnBtnName(), UAuthen_SSH::OnBtnRSA(), CGetPrefs_WINCVS::OnBtnviewer(), UCvsFolders::OnCmdExplore(), CGetPrefs_WINCVS::OnExtdiffsel(), MacroTraversal::OnFile(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnViewDelrev(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), CGraphView::OnViewUpdate(), CBrowseFileView::ResetView(), UCvsFiles::ResetView(), and tclCvsProc().

00290 {
00291     return argv;
00292 }

void CvsArgs::print ( const char * indirectory = 0L )

Print the command line to the console

Parameters:
indirectory The directory for the command

Definition at line 217 of file CvsArgs.cpp.

References argc, argv, buf, CStr, cvs_out(), cvs_outstr(), expandLF(), MAX_PRINT_ARG, NULL, and reduceString().

Referenced by CvsCmdAdd(), CvsCmdAnnotate(), CvsCmdCancelChanges(), CvsCmdCheckoutModule(), CvsCmdCommandLine(), CvsCmdCommit(), CvsCmdDiff(), CvsCmdEdit(), CvsCmdEditors(), CvsCmdImportModule(), CvsCmdInit(), CvsCmdLock(), CvsCmdLog(), CvsCmdLogin(), CvsCmdLogout(), CvsCmdRelease(), CvsCmdRemove(), CvsCmdRtagBranch(), CvsCmdRtagCreate(), CvsCmdRtagDelete(), CvsCmdStatus(), CvsCmdTagBranch(), CvsCmdTagCreate(), CvsCmdTagDelete(), CvsCmdUnedit(), CvsCmdUnlock(), CvsCmdUpdate(), CvsCmdWatchers(), CvsCmdWatchOff(), CvsCmdWatchOn(), LaunchItemListCommand(), CGraphView::OnGraphChangelogmessage(), CGraphView::OnGraphSetdescription(), CGraphView::OnGraphSetstate(), CGraphView::OnQueryAnnotate(), CGraphView::OnViewDelrev(), CGraphView::OnViewReload(), CGraphView::OnViewRetrieve(), CGraphView::OnViewTag(), CGraphView::OnViewUnlockf(), and CGraphView::OnViewUpdate().

00218 {
00219     static CStaticAllocT<char> buf;
00220
00221     for(int i = 0; i < argc; i++)
00222     {
00223         CStr newarg;
00224         newarg = argv[i];
00225         bool hasLF = strchr(newarg, '\n') != 0L;
00226         size_t len = newarg.length();
00227
00228         if( len > MAX_PRINT_ARG )
00229             newarg = reduceString(newarg, buf);
00230
00231         if( hasLF )
00232             newarg = expandLF(newarg, buf);
00233
00234         bool hasSpace = strchr(newarg, ' ') != 0L;
00235         if( hasSpace )
00236             cvs_out("\"");
00237
00238         cvs_outstr(newarg, newarg.length());
00239
00240         if( hasSpace )
00241             cvs_out("\"");
00242
00243         cvs_out(" ");
00244     }
00245
00246     if( indirectory != NULL && strlen(indirectory) )
00247     {
00248         cvs_out("(in directory %s)", indirectory);
00249     }
00250
00251     cvs_out("\n");
00252 }

void CvsArgs::reset ( bool defargs = true )

Reset the arguments

Parameters:
defargs Add default arguments from preferences

Definition at line 150 of file CvsArgs.cpp.

References argc, argv, CStr, free, AuthenModel::GetInstance(), AuthenModel::HasEncryption(), malloc, mystrdup(), NULL, and Authen::skiptoken().

Referenced by CvsArgs(), CBrowseFileView::ResetView(), and ~CvsArgs().

00151 {
00152     if( argv != 0L )
00153     {
00154         for(int i = 0; i < argc; i++)
00155         {
00156             if( argv[i] != 0L )
00157                 free(argv[i]);
00158         }
00159
00160         free(argv);
00161     }
00162
00163     argc = 0;
00164     argv = NULL;
00165
00166     if( defargs )
00167     {
00168         int numargs = 1;
00169
00170         if( gCvsPrefs.Z9Option() )
00171             numargs++;
00172
00173         if( gCvsPrefs.QuietOption() )
00174             numargs++;
00175
00176         AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00177         bool encrypt = gCvsPrefs.EncryptCommunication() && curModel->HasEncryption();
00178         if( encrypt )
00179             numargs++;
00180
00181         if( gCvsPrefs.AlwaysUseCvsroot() )
00182             numargs += 2;
00183
00184         argv = (char**)malloc(numargs * sizeof(char*));
00185         argv[argc++] = mystrdup(CVS_CMD);
00186
00187         if( gCvsPrefs.AlwaysUseCvsroot() )
00188         {
00189             argv[argc++] = mystrdup("-d");
00190             CStr root;
00191             const char* ccvsroot = gCvsPrefs;
00192             ccvsroot = Authen::skiptoken(ccvsroot);
00193             root = gAuthen.token();
00194             root << ccvsroot;
00195             argv[argc++] = mystrdup(root);
00196         }
00197
00198         if( gCvsPrefs.Z9Option() )
00199         {
00200             CStr zlev("-z");
00201             zlev << gCvsPrefs.ZLevel();
00202             argv[argc++] = mystrdup(zlev);
00203         }
00204
00205         if( gCvsPrefs.QuietOption() )
00206             argv[argc++] = mystrdup("-q");
00207
00208         if( encrypt )
00209             argv[argc++] = mystrdup("-x");
00210     }
00211 }

Member Data Documentation

int CvsArgs::argc [protected]

Arguments count

Definition at line 59 of file CvsArgs.h.

Referenced by add(), Argc(), CvsArgs(), print(), and reset().

char** CvsArgs::argv [protected]

Arguments list

Definition at line 58 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 Fri Jan 31 12:20:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 ASSERT, CATCH_EXCEPTIONS, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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, CVS_E_FAILED, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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, CVS_E_FAILED_CLOSE_PROJECT, LOG_API_FN, LOG_API_N, and PREAMBLE.

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, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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(), LOG_API_FN, LOG_API_N, and LOG_API_S.

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, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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, LOG_API_FN, LOG_API_N, LOG_API_S, and PREAMBLE.

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(), CvsProject::getProjectHandle(), CvsProject::getProjectHome(), CvsProject::getProjectName(), LOG_API_FN, LOG_API_N, and LOG_API_S.

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, LOG_API_FN, LOG_API_N, and PREAMBLE.

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 qTRACE_FN.

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, and CvsProject::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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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, and PREAMBLE.

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 Fri Jan 31 12:20:49 2003 for WinCvs Source by doxygen 1.3-rc2


CVS_COWORKERLib::CvsCoworker Class Reference

import "CVS_Coworker.idl";

The documentation for this class was generated from the following file:
  • WinCvs/CoWorker/CVS_Coworker.idl
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 | HideCommandDlgStatus (void) const
bool | HideCommandDlgUseShift (void) const
SHELL_KIND | GetUseShell (void) const
bool | DisableSplashScreen (void) const
STATUSOUTPUT_TYPE | StatusOutputType (void) const
const char * | SettingsFolder (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 | SetHideCommandDlgStatus (bool newState)
void | SetHideCommandDlgUseShift (bool newState)
void | SetUseShell (SHELL_KIND shell)
void | SetDisableSplashScreen (bool newState)
void | SetStatusOutputType (STATUSOUTPUT_TYPE outputType)
void | SetSettingsFolder (const char *settingsFolder)
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 109 of file CvsPrefs.h.

References fCvsRunningCounter, fHasLoggedIn, and fTclFileRunningCounter.

00109                       : fHasLoggedIn(false),
00110         fCvsRunningCounter(0), fTclFileRunningCounter(0) {}

CvsPrefs::~CvsPrefs ( ) [inline]

Definition at line 111 of file CvsPrefs.h.

00111 {}

Member Function Documentation

bool CvsPrefs::AddControl ( void ) const

Definition at line 186 of file CvsPrefs.cpp.

References gAddBinControl.

00186 {return gAddBinControl;}

bool CvsPrefs::AlwaysUseCvsroot ( void ) const

Definition at line 250 of file CvsPrefs.cpp.

References gAlwaysUseCvsroot.

00250 {return gAlwaysUseCvsroot;}

const char * CvsPrefs::Browser ( void ) const

Definition at line 240 of file CvsPrefs.cpp.

References UStr::empty(), and gBrowser.

00241 {
00242     return gBrowser.empty() ? 0L : (const char*)gBrowser;
00243 }

bool CvsPrefs::CheckoutRO ( void ) const

Definition at line 173 of file CvsPrefs.cpp.

References gCheckoutRO.

00173 {return gCheckoutRO;}

bool CvsPrefs::CvsConsole ( void ) const

Definition at line 258 of file CvsPrefs.cpp.

References gCvsConsole.

00258 {return gCvsConsole;}

int CvsPrefs::CvsVersion ( void ) const

Definition at line 257 of file CvsPrefs.cpp.

References gCvsVersion.

00257 {return gCvsVersion;}

bool CvsPrefs::DirtySupport ( void ) const

Definition at line 248 of file CvsPrefs.cpp.

References gDirtySupport.

00248 {return gDirtySupport;}

bool CvsPrefs::DisableSplashScreen ( void ) const

Definition at line 261 of file CvsPrefs.cpp.

References gDisableSplashScreen.

00261 {return gDisableSplashScreen;}

bool CvsPrefs::empty ( void ) const

Definition at line 341 of file CvsPrefs.cpp.

References UPStr::empty(), and gCvsroot.

Referenced by save().

00341 {   return gCvsroot.empty();  }

bool CvsPrefs::EncryptCommunication ( void ) const

Definition at line 201 of file CvsPrefs.cpp.

References gEncryptCommunication.

00201 {return gEncryptCommunication;}

const char * CvsPrefs::ExtDiff ( void ) const

Definition at line 244 of file CvsPrefs.cpp.

References UStr::empty(), and gExtdiff.

00245 {
00246     return gExtdiff.empty() ? 0L : (const char*)gExtdiff;
00247 }

SHELL_KIND CvsPrefs::GetUseShell ( void ) const

Definition at line 260 of file CvsPrefs.cpp.

References gUseShell, and SHELL_KIND.

00260 {return (SHELL_KIND)(int)gUseShell;}

bool CvsPrefs::HasLoogedIn ( void ) const [inline]

Definition at line 230 of file CvsPrefs.h.

References fHasLoggedIn.

00230 { return fHasLoggedIn; }

const char * CvsPrefs::Helper ( void ) const

Definition at line 236 of file CvsPrefs.cpp.

References UStr::empty(), and gHelper.

00237 {
00238     return gHelper.empty() ? 0L : (const char*)gHelper;
00239 }

bool CvsPrefs::HideCommandDlgAnnotate ( void ) const

Definition at line 277 of file CvsPrefs.cpp.

References gHideCommandDlgAnnotate.

00277 {return gHideCommandDlgAnnotate;}

bool CvsPrefs::HideCommandDlgDiff ( void ) const

Definition at line 274 of file CvsPrefs.cpp.

References gHideCommandDlgDiff.

00274 {return gHideCommandDlgDiff;}

bool CvsPrefs::HideCommandDlgGraph ( void ) const

Definition at line 276 of file CvsPrefs.cpp.

References gHideCommandDlgGraph.

00276 {return gHideCommandDlgGraph;}

bool CvsPrefs::HideCommandDlgLog ( void ) const

Definition at line 275 of file CvsPrefs.cpp.

References gHideCommandDlgLog.

00275 {return gHideCommandDlgLog;}

bool CvsPrefs::HideCommandDlgStatus ( void ) const

Definition at line 278 of file CvsPrefs.cpp.

References gHideCommandDlgStatus.

00278 {return gHideCommandDlgStatus;}

bool CvsPrefs::HideCommandDlgUpdate ( void ) const

Definition at line 273 of file CvsPrefs.cpp.

References gHideCommandDlgUpdate.

00273 {return gHideCommandDlgUpdate;}

bool CvsPrefs::HideCommandDlgUseShift ( void ) const

Definition at line 279 of file CvsPrefs.cpp.

References gHideCommandDlgUseShift.

00279 {return gHideCommandDlgUseShift;}

const char * CvsPrefs::Home ( void ) const

Definition at line 203 of file CvsPrefs.cpp.

References CStr, UStr::empty(), UStr::endsWith(), getenv, gHome, and UStr::length().

00204 {
00205 #if !qUnix && !TARGET_RT_MAC_MACHO
00206 #   ifdef WIN32
00207     // Windows 98 doesn't like C:\/.cvspass
00208     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00209     {
00210         gHome[gHome.length() - 1] = '\0';
00211     }
00212 #   endif
00213     return gHome.empty() ? 0L : (const char*)gHome;
00214 #else /* qUnix */
00215     static CStr home;
00216     if (!home.empty())
00217         return home;
00218
00219     char *env = getenv ("HOME");
00220     struct passwd *pw;
00221     if (env)
00222         home = env;
00223     else if ((pw = (struct passwd *) getpwuid (getuid ()))
00224              && pw->pw_dir)
00225         home = pw->pw_dir;
00226     else
00227         return 0L;
00228
00229     return home;
00230 #endif /* qUnix */
00231 }

bool CvsPrefs::ICTextOption ( void ) const

Definition at line 185 of file CvsPrefs.cpp.

References gICTextOption.

00185 {return gICTextOption;}

bool CvsPrefs::IsCvsRunning ( void ) const

Definition at line 671 of file CvsPrefs.cpp.

References fCvsRunningCounter.

00672 {
00673     return(fCvsRunningCounter > 0);
00674 }

ISO8559 CvsPrefs::IsoConvert ( void ) const

Definition at line 184 of file CvsPrefs.cpp.

References gIsoConvert, and ISO8559.

00184 {return (ISO8559)(int)gIsoConvert;}

bool CvsPrefs::IsTclFileRunning ( void ) const

Definition at line 686 of file CvsPrefs.cpp.

References fTclFileRunningCounter.

00687 {
00688     return(fTclFileRunningCounter > 0);
00689 }

int CvsPrefs::KserverPort ( void ) const

Definition at line 189 of file CvsPrefs.cpp.

References gKserverPort.

00189 {return gKserverPort;}

const char * CvsPrefs::LastWorkingDir ( void ) const

Definition at line 268 of file CvsPrefs.cpp.

References UStr::empty(), and gLastWorkingDir.

00269 {
00270     return gLastWorkingDir.empty() ? 0L : (const char*)gLastWorkingDir;
00271 }

int CvsPrefs::length ( void ) const

Definition at line 342 of file CvsPrefs.cpp.

References gCvsroot, and UPStr::length().

00342 {   return gCvsroot.length(); }

void CvsPrefs::load ( void )

Definition at line 467 of file CvsPrefs.cpp.

References err, FSSpec, gPersistentShema, TMString< UStr >::Insert(), CPersistent::LoadAll(), MacGetPrefsFolder(), MigrateCvsrootList(), NULL, NUM_CVSROOT, SCHEMA_0, SetAddControl(), SetCheckoutRO(), SetICTextOption(), SetIsoConvert(), SetPruneOption(), SetQuietOption(), and SetZ9Option().

00468 {
00469 // migration
00470 #ifndef MIGRATECVSROOTLIST
00471     // flush the CVSROOT list, it will be filled later
00472     flush_list();
00473 #endif
00474
00475     bool loaded = CPersistent::LoadAll();
00476
00477     if( loaded )
00478     {
00479         if( SCHEMA_0 == gPersistentShema )
00480         {
00481             MigrateCvsrootList();
00482         }
00483
00484         return;
00485     }
00486
00487     // backward compatibility
00488 #ifdef WIN32
00489     UINT value;
00490
00491     CString cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, "CVSROOT");
00492     if(!cstr.IsEmpty())
00493         *this = (const char*)cstr;
00494
00495     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "CheckoutRO", -1)) != -1)
00496         SetCheckoutRO(value ? 1 : 0);
00497     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Z9Option", -1)) != -1)
00498         SetZ9Option(value ? 1 : 0);
00499     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "QuietOption", -1)) != -1)
00500         SetQuietOption(value ? 1 : 0);
00501     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "PruneOption", -1)) != -1)
00502         SetPruneOption(value ? 1 : 0);
00503     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Authentication", -1)) != -1)
00504         gAuthen.setkind((AuthenKind)value);
00505     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "AddControl", -1)) != -1)
00506         SetAddControl(value ? 1 : 0);
00507
00508     char tmp[20];
00509     for(int i = 0; i < NUM_CVSROOT; i++)
00510     {
00511         sprintf(tmp, "CVSROOTLIST%d", i);
00512         cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, tmp);
00513         if(!cstr.IsEmpty())
00514             gOldCvsroots.Insert((const char*)cstr);
00515     }
00516
00517 #endif /* WIN32 */
00518
00519 #if defined(TARGET_OS_MAC) && !TARGET_API_MAC_CARBON
00520     FSSpec theFolder;
00521     short FRef;
00522     Handle hdl;
00523     OSErr err;
00524     Str255 thePath;
00525
00526     err = MacGetPrefsFolder(theFolder, thePath);
00527     if(err != noErr)
00528         return;
00529
00530     err = HSetVol(NULL, theFolder.vRefNum, theFolder.parID);
00531     FRef = OpenResFile(PCVS);
00532     if(FRef < 0)
00533         return;
00534
00535     hdl = GetResource('CVS ', 128);
00536     if(hdl != NULL)
00537     {
00538         Str255 str;
00539         HLock(hdl);
00540         BlockMove(*hdl, str, (*hdl)[0] + 1);
00541         str[str[0] + 1] = '\0';
00542         *this = (const char*)str + 1;
00543         HUnlock(hdl);
00544     }
00545     hdl = GetResource('CHRO', 128);
00546     if(hdl != NULL)
00547     {
00548         SetCheckoutRO(**hdl);
00549     }
00550     hdl = GetResource('Z9OP', 128);
00551     if(hdl != NULL)
00552     {
00553         SetZ9Option(**hdl);
00554     }
00555     hdl = GetResource('QUIE', 128);
00556     if(hdl != NULL)
00557     {
00558         SetQuietOption(**hdl);
00559     }
00560     hdl = GetResource('POPT', 128);
00561     if(hdl != NULL)
00562     {
00563         SetPruneOption(**hdl);
00564     }
00565     hdl = GetResource('AUTH', 128);
00566     if(hdl != NULL)
00567     {
00568         gAuthen.setkind((AuthenKind)**hdl);
00569     }
00570     hdl = GetResource('ISOC', 128);
00571     if(hdl != NULL)
00572     {
00573         SetIsoConvert((ISO8559)**hdl);
00574     }
00575     hdl = GetResource('ICTO', 128);
00576     if(hdl != NULL)
00577     {
00578         SetICTextOption(**hdl);
00579     }
00580     hdl = GetResource('ACTL', 128);
00581     if(hdl != NULL)
00582     {
00583         SetAddControl(**hdl);
00584     }
00585
00586     for(int i = 0; i < NUM_CVSROOT; i++)
00587     {
00588         hdl = GetResource('CROL', 128 + i);
00589         if(hdl != NULL)
00590         {
00591             HLock(hdl);
00592             get_cvsroot_list(i) = (const char*)*hdl;
00593             HUnlock(hdl);
00594         }
00595     }
00596     CloseResFile (FRef);
00597 #endif /* TARGET_OS_MAC && !TARGET_API_MAC_CARBON */
00598 }

int CvsPrefs::LogoutTimeOut ( void ) const

Definition at line 249 of file CvsPrefs.cpp.

References gLogoutTimeOut.

00249 {return gLogoutTimeOut;}

MACENCODING CvsPrefs::MacBinEncoding ( void ) const

Definition at line 188 of file CvsPrefs.cpp.

References gMacBinEncoding, and MACENCODING.

00188 {return (MACENCODING)(int)gMacBinEncoding;}

bool CvsPrefs::MacLF ( void ) const

Definition at line 255 of file CvsPrefs.cpp.

References gMacLF.

00255 {return gMacLF;}

CvsPrefs::operator const char * ( ) const

Definition at line 343 of file CvsPrefs.cpp.

References gCvsroot.

00343 {   return (const char*)gCvsroot; }

CvsPrefs::operator const unsigned char * ( ) const

Definition at line 344 of file CvsPrefs.cpp.

References gCvsroot.

00344 {return (const unsigned char *)gCvsroot;}

const unsigned char * CvsPrefs::operator= ( const unsigned char * newstr )

Definition at line 346 of file CvsPrefs.cpp.

References gCvsroot.

00346 {   return gCvsroot = newstr; }

const char * CvsPrefs::operator= ( const char * newstr )

Definition at line 345 of file CvsPrefs.cpp.

References gCvsroot.

00345 {   return gCvsroot = newstr; }

const char * CvsPrefs::ProxyHost ( void ) const

Definition at line 251 of file CvsPrefs.cpp.

References gProxyHost.

00251 {return gProxyHost;}

int CvsPrefs::ProxyPort ( void ) const

Definition at line 252 of file CvsPrefs.cpp.

References gProxyPort.

00252 {return gProxyPort;}

bool CvsPrefs::PruneOption ( void ) const

Definition at line 182 of file CvsPrefs.cpp.

References gPruneOption.

00182 {return gPruneOption;}

int CvsPrefs::PserverPort ( void ) const

Definition at line 190 of file CvsPrefs.cpp.

References gPserverPort.

00190 {return gPserverPort;}

bool CvsPrefs::QuietOption ( void ) const

Definition at line 183 of file CvsPrefs.cpp.

References gQuietOption.

00183 {return gQuietOption;}

int CvsPrefs::RhostPort ( void ) const

Definition at line 191 of file CvsPrefs.cpp.

References gRhostPort.

00191 {return gRhostPort;}

const char * CvsPrefs::RshName ( void ) const

Definition at line 197 of file CvsPrefs.cpp.

References UStr::empty(), and gRshName.

00198 {
00199     return gRshName.empty() ? 0L : (const char*)gRshName;
00200 }

void CvsPrefs::save ( void )

Definition at line 427 of file CvsPrefs.cpp.

References empty(), UCvsApp::gApp, UCvsApp::GetBrowserView(), CWincvsApp::GetBrowserView(), UCvsFolders::GetRoot(), CWinCvsBrowser::GetRoot(), gPersistentShema, CPersistent::NeedSave(), CPersistent::SaveAll(), SavePersistentSettings(), and SCHEMA_1.

00428 {
00429     if(empty())
00430         return;
00431
00432     if( SCHEMA_1 != gPersistentShema )
00433     {
00434         gPersistentShema = SCHEMA_1;
00435     }
00436
00437     bool needSave = CPersistent::NeedSave();
00438     bool needSaveSettings = CPersistent::NeedSave(true);
00439     if(!needSave)
00440         return;
00441
00442 // migration
00443 #ifndef MIGRATECVSROOTLIST
00444     // update the CVSROOT list
00445     insert_cvsroot_in_list((const char*)*this);
00446 #endif
00447
00448     CPersistent::SaveAll();
00449
00450     if(!needSaveSettings)
00451         return;
00452
00453 #ifdef WIN32
00454     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00455     SavePersistentSettings(app->GetBrowserView()->GetRoot());
00456 #endif
00457 #ifdef qMacCvsPP
00458     CMacCvsApp::SavePersistentSettings();
00459 #endif /* qMacCvsPP */
00460 #if qUnix
00461     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00462     if(browser != 0L && browser->GetRoot() != 0L)
00463         SavePersistentSettings(browser->GetRoot());
00464 #endif
00465 }

const char * CvsPrefs::ServerName ( void ) const

Definition at line 193 of file CvsPrefs.cpp.

References UPStr::empty(), and gServerName.

00194 {
00195     return gServerName.empty() ? 0L : (const char*)gServerName;
00196 }

void CvsPrefs::SetAddControl ( bool newState )

Definition at line 287 of file CvsPrefs.cpp.

References gAddBinControl.

Referenced by load().

00287 {gAddBinControl = newState;}

void CvsPrefs::SetAlwaysUseCvsroot ( bool newState )

Definition at line 317 of file CvsPrefs.cpp.

References gAlwaysUseCvsroot.

00317 {gAlwaysUseCvsroot = newState;}

void CvsPrefs::SetBrowser ( const char * newbrowser )

Definition at line 312 of file CvsPrefs.cpp.

References gBrowser.

00312 {gBrowser = newviewer;}

void CvsPrefs::SetCheckoutRO ( bool newState )

Definition at line 281 of file CvsPrefs.cpp.

References gCheckoutRO.

Referenced by load().

00281 {gCheckoutRO = newState;}

void CvsPrefs::SetCvsConsole ( bool console )

Definition at line 325 of file CvsPrefs.cpp.

References gCvsConsole.

00325 {gCvsConsole = console;}

int CvsPrefs::SetCvsRunning ( bool launched )

Definition at line 676 of file CvsPrefs.cpp.

References fCvsRunningCounter.

00677 {
00678     if(launched)
00679         fCvsRunningCounter++;
00680     else if(fCvsRunningCounter > 0)
00681         fCvsRunningCounter--;
00682
00683     return fCvsRunningCounter;
00684 }

void CvsPrefs::SetCvsVersion ( int version )

Definition at line 324 of file CvsPrefs.cpp.

References gCvsVersion.

00324 {gCvsVersion = vers;}

void CvsPrefs::SetDirtySupport ( bool newState )

Definition at line 315 of file CvsPrefs.cpp.

References gDirtySupport.

00315 {gDirtySupport = newState;}

void CvsPrefs::SetDisableSplashScreen ( bool newState )

Definition at line 329 of file CvsPrefs.cpp.

References gDisableSplashScreen.

00329 {gDisableSplashScreen = newState;}

void CvsPrefs::SetEncryptCommunication ( bool newState )

Definition at line 295 of file CvsPrefs.cpp.

References gEncryptCommunication.

00295 {gEncryptCommunication = newState;}

void CvsPrefs::SetExtDiff ( const char * newdiff )

Definition at line 314 of file CvsPrefs.cpp.

References gExtdiff.

00314 {gExtdiff = newdiff;}

void CvsPrefs::SetHasLoogedIn ( bool newstate ) [inline]

Definition at line 231 of file CvsPrefs.h.

References fHasLoggedIn.

00231 { fHasLoggedIn = newstate; }

void CvsPrefs::SetHelper ( const char * newhelper )

Definition at line 313 of file CvsPrefs.cpp.

References gHelper.

00313 {gHelper = newviewer;}

void CvsPrefs::SetHideCommandDlgAnnotate ( bool newState )

Definition at line 337 of file CvsPrefs.cpp.

References gHideCommandDlgAnnotate.

00337 {gHideCommandDlgAnnotate = newState;}

void CvsPrefs::SetHideCommandDlgDiff ( bool newState )

Definition at line 334 of file CvsPrefs.cpp.

References gHideCommandDlgDiff.

00334 {gHideCommandDlgDiff = newState;}

void CvsPrefs::SetHideCommandDlgGraph ( bool newState )

Definition at line 336 of file CvsPrefs.cpp.

References gHideCommandDlgGraph.

00336 {gHideCommandDlgGraph = newState;}

void CvsPrefs::SetHideCommandDlgLog ( bool newState )

Definition at line 335 of file CvsPrefs.cpp.

References gHideCommandDlgLog.

00335 {gHideCommandDlgLog = newState;}

void CvsPrefs::SetHideCommandDlgStatus ( bool newState )

Definition at line 338 of file CvsPrefs.cpp.

References gHideCommandDlgStatus.

00338 {gHideCommandDlgStatus = newState;}

void CvsPrefs::SetHideCommandDlgUpdate ( bool newState )

Definition at line 333 of file CvsPrefs.cpp.

References gHideCommandDlgUpdate.

00333 {gHideCommandDlgUpdate = newState;}

void CvsPrefs::SetHideCommandDlgUseShift ( bool newState )

Definition at line 339 of file CvsPrefs.cpp.

References gHideCommandDlgUseShift.

00339 {gHideCommandDlgUseShift = newState;}

void CvsPrefs::SetHome ( const char * newhome )

Definition at line 297 of file CvsPrefs.cpp.

References UStr::empty(), UStr::endsWith(), gHome, and UStr::length().

00298 {
00299 #ifndef qUnix
00300     gHome = newhome;
00301 #   ifdef WIN32
00302     // Windows 98 doesn't like C:\/.cvspass
00303     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00304     {
00305         gHome[gHome.length() - 1] = '\0';
00306     }
00307 #   endif
00308 #endif /* !qUnix */
00309 }

void CvsPrefs::SetICTextOption ( bool newState )

Definition at line 286 of file CvsPrefs.cpp.

References gICTextOption.

Referenced by load().

00286 {gICTextOption = newState;}

void CvsPrefs::SetIsoConvert ( ISO8559 newState )

Definition at line 285 of file CvsPrefs.cpp.

References gIsoConvert.

Referenced by load().

00285 {gIsoConvert = (int)newState;}

void CvsPrefs::SetKserverPort ( int newState )

Definition at line 290 of file CvsPrefs.cpp.

References gKserverPort.

00290 {gKserverPort = newState;}

void CvsPrefs::SetLastWorkingDir ( const char * workdir )

Definition at line 327 of file CvsPrefs.cpp.

References gLastWorkingDir.

00327 {gLastWorkingDir = workdir;}

void CvsPrefs::SetLogoutTimeOut ( int newTimeout )

Definition at line 316 of file CvsPrefs.cpp.

References gLogoutTimeOut.

00316 {gLogoutTimeOut = newTimeout;}

void CvsPrefs::SetMacBinEncoding ( MACENCODING newState )

Definition at line 289 of file CvsPrefs.cpp.

References gMacBinEncoding.

00289 {gMacBinEncoding = (int)newState;}

void CvsPrefs::SetMacLF ( bool useit )

Definition at line 320 of file CvsPrefs.cpp.

References gMacLF.

00320 {gMacLF = useit;}

void CvsPrefs::SetProxyHost ( const char * newhost )

Definition at line 322 of file CvsPrefs.cpp.

References gProxyHost.

00322 {gProxyHost = newhost;}

void CvsPrefs::SetProxyPort ( int newport )

Definition at line 323 of file CvsPrefs.cpp.

References gProxyPort.

00323 {gProxyPort = newport;}

void CvsPrefs::SetPruneOption ( bool newState )

Definition at line 283 of file CvsPrefs.cpp.

References gPruneOption.

Referenced by load().

00283 {gPruneOption = newState;}

void CvsPrefs::SetPserverPort ( int newState )

Definition at line 291 of file CvsPrefs.cpp.

References gPserverPort.

00291 {gPserverPort = newState;}

void CvsPrefs::SetQuietOption ( bool newState )

Definition at line 284 of file CvsPrefs.cpp.

References gQuietOption.

Referenced by load().

00284 {gQuietOption = newState;}

void CvsPrefs::SetRhostPort ( int newState )

Definition at line 292 of file CvsPrefs.cpp.

References gRhostPort.

00292 {gRhostPort = newState;}

void CvsPrefs::SetRshName ( const char * newrshname )

Definition at line 294 of file CvsPrefs.cpp.

References gRshName.

00294 {gRshName = newrshname;}

void CvsPrefs::SetServerName ( const char * newservername )

Definition at line 293 of file CvsPrefs.cpp.

References gServerName.

00293 {gServerName = newservername;}

void CvsPrefs::SetSettingsFolder ( const char * settingsFolder )

Definition at line 331 of file CvsPrefs.cpp.

References gSettingsFolder.

00331 {gSettingsFolder = settingsFolder;};

void CvsPrefs::SetStatusOutputType ( STATUSOUTPUT_TYPE outputType )

Definition at line 330 of file CvsPrefs.cpp.

References gStatusOutputType.

00330 {gStatusOutputType = outputType;}

int CvsPrefs::SetTclFileRunning ( bool launched )

Definition at line 691 of file CvsPrefs.cpp.

References fTclFileRunningCounter.

00692 {
00693     if(launched)
00694         fTclFileRunningCounter++;
00695     else if(fTclFileRunningCounter > 0)
00696         fTclFileRunningCounter--;
00697
00698     return fTclFileRunningCounter;
00699 }

const char * CvsPrefs::SettingsFolder ( void ) const

Definition at line 263 of file CvsPrefs.cpp.

References UStr::empty(), and gSettingsFolder.

00263 {return gSettingsFolder.empty() ? 0L : (const char*)gSettingsFolder;};

void CvsPrefs::SetUnixLF ( bool useit )

Definition at line 319 of file CvsPrefs.cpp.

References gUnixLF.

00319 {gUnixLF = useit;}

void CvsPrefs::SetUseAltCvs ( bool useIt )

Definition at line 702 of file CvsPrefs.cpp.

References gUseAltCvs.

00702 {gUseAltCvs = useit;}

void CvsPrefs::SetUseProxy ( bool useit )

Definition at line 318 of file CvsPrefs.cpp.

References gUseProxy.

00318 {gUseProxy = useit;}

void CvsPrefs::SetUseShell ( SHELL_KIND shell )

Definition at line 328 of file CvsPrefs.cpp.

References gUseShell.

00328 {gUseShell = shell;}

void CvsPrefs::SetUseViewerAlways ( bool newState )

Definition at line 288 of file CvsPrefs.cpp.

References gUseViewerAlways.

00288 {gUseViewerAlways = newState;}

void CvsPrefs::SetViewer ( const char * newviewer )

Definition at line 311 of file CvsPrefs.cpp.

References gViewer.

00311 {gViewer = newviewer;}

void CvsPrefs::SetWhichCvs ( const char * cvsPath )

Definition at line 704 of file CvsPrefs.cpp.

References CKeyString::Concatenate(), UStr::empty(), gWhichCvs, and TMString< UStr >::Insert().

00705 {
00706     UStr appPath;
00707
00708 #ifdef WIN32
00709     HINSTANCE hInst = ::AfxGetInstanceHandle();
00710     char apath[512];
00711     DWORD len;
00712     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
00713     {
00714         CString tmp(apath);
00715         tmp.MakeLower();
00716         appPath = tmp;
00717     }
00718 #elif qUnix
00719     appPath << EXECLIB << "/" << "cvs";
00720 #elif TARGET_RT_MAC_MACHO
00721     appPath = CMacCvsApp::gApp->GetAppPath();
00722 #endif
00723
00724     if(!appPath.empty()) {
00725         UStr value;
00726         gWhichCvs.Concatenate(value, appPath, cvsPath);
00727         gWhichCvs.Insert(value);
00728     } else {
00729         gWhichCvs.Insert( cvsPath );
00730     }
00731 }

void CvsPrefs::SetWordWrapLogMsg ( int wordwrap )

Definition at line 326 of file CvsPrefs.cpp.

References gWordWrapLogMsg.

00326 {gWordWrapLogMsg = wordwrap;}

void CvsPrefs::SetZ9Option ( bool newState )

Definition at line 282 of file CvsPrefs.cpp.

References gZ9Option.

Referenced by load().

00282 {gZ9Option = newState;}

void CvsPrefs::SetZLevel ( int level )

Definition at line 321 of file CvsPrefs.cpp.

References gZLevel.

00321 {gZLevel = level;}

STATUSOUTPUT_TYPE CvsPrefs::StatusOutputType ( void ) const

Definition at line 262 of file CvsPrefs.cpp.

References gStatusOutputType, and STATUSOUTPUT_TYPE.

00262 {return (STATUSOUTPUT_TYPE)(int)gStatusOutputType;}

bool CvsPrefs::UnixLF ( void ) const

Definition at line 254 of file CvsPrefs.cpp.

References gUnixLF.

00254 {return gUnixLF;}

bool CvsPrefs::UseAltCvs ( void ) const

Definition at line 701 of file CvsPrefs.cpp.

References gUseAltCvs.

00701 {return gUseAltCvs;}

bool CvsPrefs::UseKeyChain ( void ) const

Definition at line 1120 of file Authen.cpp.

01121 {
01122 #if TARGET_RT_MAC_CFM
01123     return (bool)AuthenLSH::gLSHKeychain;
01124 #else
01125     return false;
01126 #endif
01127 }

bool CvsPrefs::UseProxy ( void ) const

Definition at line 253 of file CvsPrefs.cpp.

References gUseProxy.

00253 {return gUseProxy;}

bool CvsPrefs::UseViewerAlways ( void ) const

Definition at line 187 of file CvsPrefs.cpp.

References gUseViewerAlways.

00187 {return gUseViewerAlways;}

const char * CvsPrefs::Viewer ( void ) const

Definition at line 232 of file CvsPrefs.cpp.

References UStr::empty(), and gViewer.

00233 {
00234     return gViewer.empty() ? 0L : (const char*)gViewer;
00235 }

const char * CvsPrefs::WhichCvs | ( | UStr & | path,
 |  | bool | userOnly = false
 | ) | const

Definition at line 733 of file CvsPrefs.cpp.

References UStr::c_str(), CKeyString::Concatenate(), UStr::empty(), TMString< UStr >::end(), UStr::endsWith(), TMString< UStr >::Find(), gCvsPrefs, CWincvsApp::GetAppPath(), gWhichCvs, kWin32, CKeyString::Split(), stat, and WhichVersion().

00734 {
00735     path = "";
00736
00737     UStr appPath = "";
00738
00739 #ifdef WIN32
00740     HINSTANCE hInst = ::AfxGetInstanceHandle();
00741     char apath[512];
00742     DWORD len;
00743     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
00744     {
00745         CString tmp(apath);
00746         tmp.MakeLower();
00747         appPath = tmp;
00748     }
00749 #elif qUnix
00750     appPath << EXECLIB << "/" << "cvs";
00751 #elif TARGET_RT_MAC_MACHO
00752     appPath = CMacCvsApp::gApp->GetAppPath();
00753 #endif
00754
00755     // search if beside the default cvs, the user defined one to use
00756     // with this application only.
00757     UStr candidate;
00758     if(!appPath.empty())
00759     {
00760         UStr value;
00761         gWhichCvs.Concatenate(value, appPath, "");
00762         TMString<UStr>::list_t::const_iterator i = gWhichCvs.Find(value);
00763         if(i != gWhichCvs.end())
00764         {
00765             UStr key;
00766             gWhichCvs.Split(*i, key, candidate);
00767         }
00768     }
00769
00770     // verify this cvs exe is still there
00771     struct stat sb;
00772     if(!candidate.empty() && stat(candidate, &sb) != -1 && S_ISREG(sb.st_mode))
00773     {
00774         path = candidate;
00775         return path.c_str();
00776     }
00777
00778     // fallback to the default one.
00779     if(userOnly)
00780         return 0L;
00781
00782 #ifdef WIN32
00783     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00784
00785     app->GetAppPath(path);
00786     if(!path.endsWith(kPathDelimiter))
00787         path << kPathDelimiter;
00788     path << (gCvsPrefs.WhichVersion() == kWin32 ? "cvs95.exe" : "cvs.exe");
00789 #elif qUnix
00790     if( path.empty() )
00791         path = EXECLIB;
00792
00793     if(!path.endsWith(kPathDelimiter))
00794         path << kPathDelimiter;
00795
00796     path << "cvs";
00797 #elif TARGET_RT_MAC_MACHO
00798     path = CMacCvsApp::gApp->GetAppResourcesPath();
00799     if(!path.endsWith(kPathDelimiter))
00800         path << kPathDelimiter;
00801     path << "cvsgui";
00802 #endif
00803
00804     return path.c_str();
00805 }

kWinVersion CvsPrefs::WhichVersion ( )

Definition at line 635 of file CvsPrefs.cpp.

References kWin16, kWin32, kWinNT35, kWinNT4, and kWinVersion.

Referenced by WhichCvs().

00636 {
00637     DWORD dwVersion = GetVersion(); // Get major and minor version numbers of Windows
00638     DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
00639     DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
00640     DWORD dwBuild;
00641
00642     // Get build numbers for Windows NT or Win32s
00643     if (dwVersion < 0x80000000)                // Windows NT
00644     {
00645         dwBuild = (DWORD)(HIWORD(dwVersion));
00646         return dwWindowsMajorVersion == 3 ? kWinNT35 : kWinNT4;
00647     }
00648     else if (dwWindowsMajorVersion < 4)        // Win16s
00649     {
00650         dwBuild = (DWORD)(HIWORD(dwVersion));
00651         return kWin16;
00652     }
00653
00654     // Windows 95 -- No build numbers provided    dwBuild =  0;
00655     return kWin32;
00656 }

int CvsPrefs::WordWrapLogMsg ( void ) const

Definition at line 259 of file CvsPrefs.cpp.

References gWordWrapLogMsg.

00259 {return gWordWrapLogMsg;}

bool CvsPrefs::Z9Option ( void ) const

Definition at line 174 of file CvsPrefs.cpp.

References gZ9Option.

00175 {
00176 #if TARGET_RT_MAC_CFM
00177     // because of the problem with LSH...
00178     return true;
00179 #endif
00180     return gZ9Option;
00181 }

int CvsPrefs::ZLevel ( void ) const

Definition at line 256 of file CvsPrefs.cpp.

References gZLevel.

00256 {return gZLevel;}

Member Data Documentation

int CvsPrefs::fCvsRunningCounter [protected]

Definition at line 254 of file CvsPrefs.h.

Referenced by CvsPrefs(), IsCvsRunning(), and SetCvsRunning().

bool CvsPrefs::fHasLoggedIn [protected]

Definition at line 252 of file CvsPrefs.h.

Referenced by CvsPrefs(), HasLoogedIn(), and SetHasLoogedIn().

int CvsPrefs::fTclFileRunningCounter [protected]

Definition at line 255 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 Fri Jan 31 12:20:56 2003 for WinCvs Source by doxygen 1.3-rc2


CvsProcessCallbacks Struct Reference

Structure to hold cvsgui protocol callbacks. More...

#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)

Detailed Description

Structure to hold cvsgui protocol callbacks.

Definition at line 41 of file cvsgui_process.h.

Member Data Documentation

long(* CvsProcessCallbacks::consoleerr)(char* txt, long len)

Get cvs stderr

Referenced by cvs_process_handle_message(), and GetChldError().

long(* CvsProcessCallbacks::consoleout)(char* txt, long len)

Get cvs stdout

Referenced by cvs_process_handle_message(), and GetChldOutput().

void(* CvsProcessCallbacks::exit)(int code)

Tells the exit code

Referenced by cvs_process_handle_message().

const char*(* CvsProcessCallbacks::getenv)(char* name)

Ask about env. variable

Referenced by cvs_process_handle_message().

The documentation for this struct was generated from the following file:
  • common/cvsgui_process.h
Generated on Fri Jan 31 12:20:56 2003 for WinCvs Source by doxygen 1.3-rc2


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, and g_pProjects.

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.

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 g_pProjects, 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().

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 Fri Jan 31 12:20:58 2003 for WinCvs Source by doxygen 1.3-rc2


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_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 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.

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.

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(), and resize().

char* CvsString::m_sBuffer [protected]

Definition at line 46 of file CvsString.h.

Referenced by CvsString(), getBuffer(), operator const char *(), operator[](), resize(), strcat(), strcpy(), strncpy(), and ~CvsString().

The documentation for this class was generated from the following files:
  • WinCvs/CoWorker/CvsString.h
  • WinCvs/CoWorker/CvsString.cpp
Generated on Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


UWaitCursor Class Reference

#include <UCvsFrame.h>

List of all members.

Public Methods

UWaitCursor ()
virtual ~UWaitCursor ()

Constructor & Destructor Documentation

UWaitCursor::UWaitCursor ( ) [inline]

Definition at line 128 of file UCvsFrame.h.

References UEventSendMessage(), and UMAKEINT.

00129     {
00130         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursWatch), 0L);
00131     }

virtual UWaitCursor::~UWaitCursor ( ) [inline, virtual]

Definition at line 132 of file UCvsFrame.h.

References UEventSendMessage(), and UMAKEINT.

00133     {
00134         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursArrow), 0L);
00135     }

The documentation for this class was generated from the following file:
  • common/UCvsFrame.h
Generated on Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


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

virtual | ~UWidget ()
virtual void | AddListener (UCmdTarget *listener)
  • listener has the widget events broadcasted to it.

virtual int | UDispatchMessage (int evt, int arg1, void *arg2, UDispatchInfo &dispatchInfo)
this is overided in order to broadcast to the listeners

void * | GetWidget (int cmd) const
return a sub-widget as inserted by EV_INIT_WIDGET
  • cmd the sub-widget identifier.

std::map< int, void * > & | GetWidgets (void)
return all the sub-widgets inserted by EV_INIT_WIDGET

bool | WidgetIsActive (int cmd) const
return true if a widget has the focus ...

const char * | GetTooltip (int cmd) const
return the tooltip (i.e.

void | AddTooltip (int cmd, const char *tooltipID)
associate a tooltip with a sub-widget
  • cmd the sub-widget identifier.

void | AddTimer (long lap, int cmd)
timer handling - add a timer.

void | RemoveTimer (int cmd)
timer handling - remove a timer.

std::vector< UTimer > & | GetTimers (void)
timer handling - get the timers. Used internally by the event mamanger.

bool | DoModal (int id=0)
modality : works only on the top widget and if it is a window
  • id associated dialog id.

void | EndModal (bool result)
while modaling, allows to quit the interaction
  • result set the return value for DoModal.

virtual void | DoDataExchange (bool)
while modaling, allows to fill/read the dialog content.

virtual void | Dismiss (void)
while modaling, allows to detect when the user cancels the dialog.

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.

bool | HasFocus (void)
tells if the pseudo-widget has the focus

bool | HasFocus (int cmdid)
tells if the pseudo-widget and the sub-widget have the focus

void | OnBlockHandler (void *widget, int cmd, int event)
blocks a eventhandler

void | OnUnblockHandler (void *widget, int cmd, int event)
unblocks a eventhandler

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.

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.

bool | IsUIValid ()
update user interface handling : check validation says if at this moment the UI is valid (i.e.

void | DoValidUI (bool how)
update user interface handling : invalidate/validate UI
  • how determines if the UI will be valid.

int | GetFocus (void)
returns the current pseudo-widget which has the focus

int | GetFocusCmd (void)

Protected Methods

int | OnGetState (int cmd)
EV_QUERYSTATE message handling
  • cmd the sub-widget.

void | OnSetState (int cmd, int state)
EV_SETSTATE message handling
  • cmd the sub-widget
  • state of the widget to set (pushed/checked...).

void | OnEnableCmd (int cmd, int state)
EV_ENABLECMD message handling
  • cmd the sub-widget
  • state of the widget to enable/disable (grayed).

void | OnChgFocus (int cmd)
EV_CHGFOCUS UWidget message handling
  • cmd the sub-widget to change focus to.

void | OnInvalidate (int cmd)
EV_INVALIDATE UWidget message handling
  • cmd the sub-widget to redraw (delayed).

void | OnRedraw (int cmd)
EV_REDRAW UWidget message handling
  • cmd the sub-widget to redraw *now*.

void | OnSetText (int cmd, const char *text)
EV_SETTEXT message handling
  • cmd the sub-widget
  • text the c-string caption to set.

void | OnGetText (int cmd, UStr *text)
EV_GETTEXT message handling
  • cmd the sub-widget
  • text is filled with the widget caption.

void | OnSetFloat (int cmd, const float *f)
EV_SETFLOAT UWidget message handling
  • cmd the sub-widget
  • f the float value the to set.

void | OnGetFloat (int cmd, float *f)
EV_GETFLOAT UWidget message handling
  • cmd the sub-widget
  • f the float value the to get.

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.

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.

void | OnShowWidget (int cmd, int state)
EV_SHOW message handling
  • cmd the sub-widget
  • state of the widget to show/hide.

void | OnSetSlider (int cmd, int pos)
EV_SET_SLIDER UWidget message handling
  • cmd the sub-widget
  • pos is the position to set.

void | OnGetSliderProperty (int cmd, USLIDER *prop)
EV_GET_SLIDERPROP UWidget message handling
  • cmd the sub-widget
  • prop get the informations about this scroller/slider.

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.

void | OnSetTooltip (int cmd, UCmdUI *pCmdUI)
EV_USETTOOLTIP message handling.

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.

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.

void | OnChgCursor (int cmd, UCURSOR cursor)
EV_CHGCURSOR UWidget message handling
  • cmd the sub-widget
  • cursor to use in this sub-widget.

void | OnUpdateUI (void)
EV_UPDATEUI is a notification sent to all the widgets when the user interface is invalid.

void | OnTreeResetAll (int cmd)
EV_TREE_RESETALL UWidget message handling.

void | OnTreeInsert (int cmd, UTREE_INSERT *data)
EV_TREE_INSERT UWidget message handling.

void | OnTreeGetInfo (int cmd, UTREE_INFO *data)
EV_TREE_GETINFO UWidget message handling.

void | OnTreeSetData (int cmd, UTREE_INFO *data)
EV_TREE_SETDATA UWidget message handling.

void | OnTreeSetIcon (int cmd, UTREE_INFO *data)
EV_TREE_SETICON UWidget message handling.

void | OnTreeDelete (int cmd, UTREEITEM item)
EV_TREE_DELETE UWidget message handling.

void | OnTreeExpand (int cmd, int collapse, UTREEITEM item)
EV_TREE_EXPAND UWidget message handling.

void | OnTreeSelect (int cmd, int deselect, UTREEITEM item)
EV_TREE_SELECT UWidget message handling.

void | OnTreeGetSel (int cmd, UTREEITEM *item)
EV_TREE_GETSEL UWidget message handling.

void | OnListAddColumns (int cmd, int num)
EV_LIST_ADDCOLUMNS UWidget message handling.

void | OnListShowColumns (int cmd, int num)
EV_LIST_SHOWCOLUMNS UWidget message handling.

void | OnListHideColumns (int cmd, int num)
EV_LIST_DELCOLUMNS UWidget message handling.

void | OnListSetColTitle (int cmd, int num, const char *title)
EV_LIST_SETCOLTITLE UWidget message handling.

void | OnListSetColWidth (int cmd, int num, int width)
EV_LIST_SETCOLWIDTH UWidget message handling.

void | OnListResetAll (int cmd)
EV_LIST_RESETALL UWidget message handling.

void | OnListAddSel (int cmd, int entry)
EV_LIST_ADDSEL UWidget message handling.

void | OnListPopup (int cmd, int entry)
EV_LIST_POPUP UWidget message handling.

void | OnListDelRow (int cmd, int row)
EV_LIST_DELROW UWidget message handling.

void | OnListSetFeedback (int cmd, int turnOn)
EV_LIST_SETFEEDBACK UWidget message handling.

void | OnListNewRow (int cmd, int *num)
EV_LIST_NEWROW UWidget message handling.

void | OnListRowSetData (int cmd, int row, void *data)
EV_LIST_ROWSETDATA UWidget message handling.

void | OnListRowGetData (int cmd, int row, void **data)
EV_LIST_ROWGETDATA UWidget message handling.

void | OnListInsert (int cmd, ULIST_INSERT *data)
EV_LIST_INSERT UWidget message handling.

void | OnListGetInfo (int cmd, ULIST_INFO *desc)
EV_LIST_GETINFO UWidget message handling.

int | OnListGetNextSel (int cmd, int selectedCell)
EV_LIST_GETNEXTSEL UWidget message handling.

int | OnListGetNext (int cmd, int whichCell)
EV_LIST_GETNEXT UWidget message handling.

void | OnListResort (int cmd, int column, UListSorter s)
EV_LIST_RESORT UWidget message handling.

void | OnListSetSortDir (int cmd, int column, bool dir)
ON_LIST_SETSORTDIR UWidget message handling.

void | OnComboResetAll (int cmd)
EV_COMBO_RESETALL UWidget message handling.

void | OnComboAppend (int cmd, const char *txt)
EV_COMBO_APPEND UWidget message handling.

void | OnComboSetPos (int cmd, int sel)
EV_COMBO_SETSEL UWidget message handling.

int | OnComboGetPos (int cmd, UStr *txt)
EV_COMBO_GETSEL UWidget message handling.

int | OnComboGetCount (int cmd)
EV_COMBO_GETCOUNT UWidget message handling.

void | OnComboDelSel (int cmd, int sel)
EV_COMBO_DELSEL UWidget message handling.

void | OnComboEnableSel (int cmd, int sel, int state)
EV_COMBO_ENABLESEL UWidget message handling.

void | OnComboGetMenu (int cmd, UMENU *menu)
EV_COMBO_ENABLESEL UWidget message handling.

void | OnSmartComboSetFeature (int cmd, int feature)
EV_SMARTCOMBO_SETFEATURE UWidget message handling.

void | OnSmartComboSetItems (int cmd, CMString *items)
EV_SMARTCOMBO_SETITEMS UWidget message handling.

void | OnSmartComboSetReadOnly (int cmd, bool readOnly)
EV_SMARTCOMBO_SETREADONLY UWidget message handling.

int | OnUpdateFocus (int leave, void *widget)
EV_UPDATEFOCUS UWidget message handling.

int | OnFetchCmd (int cmd, void *widget)
EV_FETCHCMD UWidget message handling.

void | OnPageChanged (int cmd, int pagenum)
EV_PAGE UWidget message handling.

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 756 of file uwidget.cpp.

References qMacPP.

00756                           : UCmdTarget(widid), m_currentPage(-1)
00757 #if qGTK || qMacPP
00758     , m_modalLoop(false)
00759 #endif
00760 #ifdef WIN32
00761     , m_curModal(0L), m_noDispatch(false)
00762 #endif
00763 {
00764 #if qMacAPP
00765     static bool firstTime = true;
00766     if(firstTime)
00767     {
00768         firstTime = false;
00769         gDispatcher->AddBehavior(new TPseudoAppBehavior);
00770             // this behavior takes care about menu routing and giving time
00771             // to the pseudo-events.
00772         new UMacAppMenu();
00773             // for MacApp, we can create automatically the pseudo menu handling.
00774     }
00775 #endif
00776 #if qMacPP
00777     static bool firstTime = true;
00778     if(firstTime && LCommander::GetTopCommander() != 0L)
00779     {
00780         firstTime = false;
00781         LCommander::GetTopCommander()->AddAttachment(NEW LMainPseudoAttachment());
00782     }
00783 #endif
00784 }

UWidget::~UWidget ( ) [virtual]

Definition at line 786 of file uwidget.cpp.

References HasFocus(), m_listeners, m_tabs, and sFocusWidID.

00787 {
00788     std::vector<UCmdTarget *>::iterator i;
00789     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00790     {
00791         delete *i;
00792     }
00793     std::map<int, UWidget *>::iterator j;
00794     for(j = m_tabs.begin(); j != m_tabs.end(); ++j)
00795     {
00796         delete (*j).second;
00797     }
00798     if(HasFocus())
00799         sFocusWidID = -1;
00800 }

Member Function Documentation

const URuntimeClass * UWidget::_GetBaseClass ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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 802 of file uwidget.cpp.

References m_listeners.

00803 {
00804     m_listeners.push_back(listener);
00805 }

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 3741 of file uwidget.cpp.

References EV_INIT_TAB_WIDGET, GetWidget(), UCmdTarget::GetWidID(), m_tabs, UEventSendMessage(), and UMAKEINT.

03742 {
03743     void *wid = GetWidget(kUMainWidget);
03744     if(wid == 0L)
03745         return;
03746
03747     UEventSendMessage(page->GetWidID(), EV_INIT_TAB_WIDGET, UMAKEINT(pagecmd, num_page), wid);
03748     std::map<int, UWidget *>::value_type val(UMAKEINT(pagecmd, num_page), page);
03749     m_tabs.insert(val);
03750
03751 #if qMacPP
03752     // emulate the click in tab 1
03753     if(num_page == 0)
03754     {
03755         // emulate the click in tab 1
03756         UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(pagecmd, num_page), 0L);
03757     }
03758 #endif /* qMacPP */
03759 }

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 1993 of file uwidget.cpp.

References m_timers, and UTickCount().

Referenced by UCvsApp::UCvsApp().

01994 {
01995     UTimer timer(lap, ::UTickCount(), cmd);
01996     m_timers.push_back(timer);
01997 }

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 960 of file uwidget.cpp.

References m_tooltips.

00961 {
00962     std::map<int, UStr>::value_type val(cmd, UStr(tooltipID));
00963     m_tooltips.insert(val);
00964 }

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, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, and USaveSettings.

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 2039 of file uwidget.cpp.

References Dismiss(), DoDataExchange(), GetWidget(), UCmdTarget::GetWidID(), m_curModal, m_modalRes, m_tabs, UAppConsole(), UEventSendMessage(), UHIWORD, ULOWORD, and UMAKEINT.

Referenced by AskCreatePersistentSettings(), AuthenSspi::DoSettings(), AuthenGserver::DoSettings(), AuthenKserver::DoSettings(), AuthenRhosts::DoSettings(), AuthenPserver::DoSettings(), and AuthenSSH::DoSettings().

02040 {
02041     bool result = false;
02042
02043 #if !defined(qMacAPP) && !defined(qMacPP) && !defined(WIN32)
02044     void *w = GetWidget(kUMainWidget);
02045     if(w == 0L)
02046     {
02047         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", kUMainWidget, __FILE__, __LINE__);
02048         return result;
02049     }
02050 #endif // !qMacAPP && !WIN32
02051
02052 #if qGTK || qMacPP
02053     if(m_modalLoop)
02054     {
02055         UAppConsole("Trying to break a modal state\n");
02056         return result;
02057     }
02058 #endif
02059
02060 #ifdef WIN32
02061     CPseudoDlg dlg(id, this);
02062     m_curModal = &dlg;
02063     result = dlg.DoModal() == IDOK;
02064     if(!result)
02065         Dismiss();
02066     m_curModal = 0L;
02067 #endif
02068 #if qMacAPP
02069     TWindow *view = gViewServer->NewTemplateWindow(id, nil);
02070     ThrowIfNULL_AC(view);
02071
02072     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, view);
02073
02074     DoDataExchange(true);
02075     IDType resid = view->PoseModally();
02076
02077     TDialogBehavior* dlgb;
02078     if((dlgb = view->GetDialogBehavior()) != 0L)
02079     {
02080         result = resid == dlgb->fDefaultItem;
02081     }
02082
02083     if(result)
02084         DoDataExchange(false);
02085     else
02086         Dismiss();
02087
02088     view->Close();
02089 #endif
02090 #if qMacPP
02091     StDialogHandler theHandler(id, LCommander::GetTopCommander());
02092     LWindow *theDialog = theHandler.GetDialog();
02093
02094     if(theDialog != 0L)
02095     {
02096         UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, theDialog);
02097
02098         DoDataExchange(true);
02099         theDialog->Show();
02100         theHandler.SetSleepTime(0);
02101
02102         m_modalLoop = true;
02103         MessageT hitMessage;
02104         while (m_modalLoop)
02105         {       // Let DialogHandler process events
02106             hitMessage = theHandler.DoDialog();
02107
02108             if (hitMessage == msg_OK || hitMessage == msg_Cancel)
02109                 break;
02110         }
02111
02112         result = m_modalLoop ? hitMessage == msg_OK : m_modalRes;
02113
02114         if(result)
02115             DoDataExchange(false);
02116         else
02117             Dismiss();
02118
02119         //theDialog->Hide();
02120         //theDialog->DoClose();
02121     }
02122 #endif
02123 #if qGTK
02124     if(GTK_IS_WINDOW(w))
02125     {
02126         // emulate the click in tab 1
02127         std::map<int, UWidget *>::iterator i;
02128         for(i = m_tabs.begin(); i != m_tabs.end(); ++i)
02129         {
02130             int cmdid = ULOWORD((*i).first);
02131             int pagenum = UHIWORD((*i).first);
02132             if(pagenum == 0)
02133             {
02134                 UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(cmdid, pagenum), 0L);
02135                 break;
02136             }
02137         }
02138         gtk_signal_connect(GTK_OBJECT(w),"delete_event", GTK_SIGNAL_FUNC(gtkcancel), this);
02139         DoDataExchange(true);
02140         gtk_widget_show(GTK_WIDGET(w));
02141         m_modalLoop = true;
02142         gtk_grab_add (GTK_WIDGET(w));
02143         while (m_modalLoop)
02144         {
02145             if( gtk_main_iteration_do(TRUE))
02146                 break;
02147         }
02148         gtk_grab_remove (GTK_WIDGET(w));
02149         result = m_modalRes;
02150         m_modalLoop = false; // sanity...
02151         if(result)
02152         {
02153             UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(0, -1), 0L);
02154             DoDataExchange(false);
02155         }
02156         else
02157         {
02158             Dismiss();
02159         }
02160         gtk_widget_destroy(GTK_WIDGET(w));
02161     }
02162     else
02163         g_warning("Trying to modal on a non-window\n");
02164 #endif
02165
02166     return result;
02167 }

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 157 of file uwidget.cpp.

References sValidMenu.

Referenced by TPseudoAppBehavior::DoSetupMenus(), LMainPseudoAttachment::ExecuteSelf(), UCvsApp::OnMainTimer(), UEventGiveTime(), and UWinPseudoWindowProc().

00157 { sValidMenu = how; }

void UWidget::EndModal ( bool result )

while modaling, allows to quit the interaction

  • result set the return value for DoModal.

Definition at line 2169 of file uwidget.cpp.

References GetWidget(), m_curModal, m_modalRes, and UAppConsole().

Referenced by UPromptMessage::OnCancel(), and UPromptMessage::OnOK().

02170 {
02171     m_modalRes = result;
02172 #if qGTK || qMacPP
02173     if(!m_modalLoop)
02174         UAppConsole("EndModal called twice\n");
02175
02176     m_modalLoop = false;
02177 #endif
02178 #if qMacAPP
02179     void *w = GetWidget(kUMainWidget);
02180     if(w == 0L)
02181         return;
02182
02183     TWindow *wind = (TWindow *)w;
02184     TDialogBehavior* dlgb;
02185     if(MA_MEMBER(wind, TWindow) && (dlgb = wind->GetDialogBehavior()) != 0L)
02186     {
02187         wind->Dismiss(result ? dlgb->fDefaultItem : dlgb->fCancelItem, result);
02188     }
02189 #endif
02190 #ifdef WIN32
02191     if(m_curModal != 0L)
02192     {
02193         if (result && !m_curModal->UpdateData(TRUE))
02194         {
02195             TRACE0("UpdateData failed during dialog termination.\n");
02196             // the UpdateData routine will set focus to correct item
02197             return;
02198         }
02199         m_curModal->EndDialog(result ? IDOK : IDCANCEL);
02200     }
02201 #endif
02202 }

const UMSGMAP * UWidget::GetBaseMessageMap ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 85 of file uwidget.cpp.

CDialog* UWidget::GetCurModal ( ) const [inline]

Definition at line 230 of file uwidget.h.

00230 { 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 158 of file uwidget.cpp.

References sFocusWidID.

Referenced by LMainPseudoAttachment::ExecuteSelf(), and UMacAppMenu::OnUpdateUI().

00158 { return sFocusWidID; }

int UWidget::GetFocusCmd ( void ) [static]

Definition at line 159 of file uwidget.cpp.

References sFocusCmdID.

00159 { return sFocusCmdID; }

const UMSGMAP * UWidget::GetMessageMap ( ) const [protected, virtual]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 85 of file uwidget.cpp.

std::map<int, CRuntimeClass *>& UWidget::GetOverideList ( void ) [inline]

Definition at line 226 of file uwidget.h.

Referenced by WinInitWidgets().

00226 { return m_overide; }

const URuntimeClass * UWidget::GetRuntimeClass ( ) const [virtual]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 83 of file uwidget.cpp.

const UMSGMAP * UWidget::GetThisMessageMap ( ) [static, protected]

Reimplemented from UCmdTarget.

Reimplemented in UMacAppMenu, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

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 2012 of file uwidget.cpp.

References m_timers.

Referenced by UEventGiveTime().

02013 {
02014     // removed the delayed items
02015     std::vector<UTimer>::iterator i;
02016     for(i = m_timers.begin(); i != m_timers.end(); ++i)
02017     {
02018         if((*i).m_cmd == 0)
02019         {
02020             m_timers.erase(i);
02021             break;
02022         }
02023     }
02024
02025     return m_timers;
02026 }

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 834 of file uwidget.cpp.

References m_tooltips, and UAppConsole().

Referenced by OnSetTooltip().

00835 {
00836     std::map<int, UStr>::const_iterator i = m_tooltips.find(cmd);
00837     if(i == m_tooltips.end())
00838     {
00839         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00840 #ifdef DEBUG
00841         printf( "Valid Ids are:\n");
00842         for ( i = m_tooltips.begin(); i != m_tooltips.end(); ++i) {
00843             printf( "    Id: %d, Str: '%s'\n", (*i).first, (*i).second.c_str());
00844         }
00845 #endif
00846         return 0L;
00847     }
00848     return (*i).second;
00849 }

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 817 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(), OnListHideColumns(), OnListInsert(), OnListNewRow(), OnListResetAll(), OnListResort(), OnListRowGetData(), OnListRowSetData(), OnListSetColTitle(), OnListSetColWidth(), OnListSetFeedback(), OnListSetSortDir(), OnListShowColumns(), 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().

00818 {
00819     std::map<int, void *>::const_iterator i = m_widgets.find(cmd);
00820     if(i == m_widgets.end())
00821     {
00822         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00823 #ifdef DEBUG
00824         printf( "Valid Ids are:\n");
00825         for ( i = m_widgets.begin(); i != m_widgets.end(); ++i) {
00826             printf( "    Id: %d, Addr: 0x%x\n", (*i).first, (*i).second);
00827         }
00828 #endif
00829         return 0L;
00830     }
00831     return (*i).second;
00832 }

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 3711 of file uwidget.cpp.

References UObject::IsKindOf(), STD, UEventGetTargets(), and URUNTIME_CLASS.

03712 {
03713 #if qGTK
03714     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
03715     STD map<int, UCmdTarget *>::const_iterator i;
03716     for(i = targets.begin(); i != targets.end(); ++i)
03717     {
03718         UCmdTarget *target = (*i).second;
03719         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
03720             continue;
03721
03722         UWidget *wid = (UWidget *)target;
03723         if(wid->m_modalLoop)
03724             return true;
03725     }
03726 #endif
03727     return false;
03728 }

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 156 of file uwidget.cpp.

References sValidMenu.

Referenced by UEventGiveTime().

00156 { return sValidMenu; }

void UWidget::OnBlockHandler | ( | void * | widget,
 |  | int | cmd,
 |  | int | event
 | ) |

blocks a eventhandler

Definition at line 1147 of file uwidget.cpp.

References UCmdTarget::GetWidID(), and UMAKEINT.

Referenced by UCvsGraph::OnDrawing().

01148 {
01149 #ifdef qGTK
01150     if(event == GDK_EXPOSE) {
01151         gtk_signal_handler_block_by_func( GTK_OBJECT(widget),
01152                                           GTK_SIGNAL_FUNC (gtkexposeevent),
01153                                           (gpointer)UMAKEINT(GetWidID(), cmd) );
01154     }
01155 #endif
01156 }

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 2204 of file uwidget.cpp.

References GetWidget(), uCursArrow, and uCursWatch.

02205 {
02206     void *w = GetWidget(cmd);
02207     if(w == 0L)
02208         return;
02209
02210 #if qGTK
02211     if(GTK_IS_WIDGET(w) && GTK_WIDGET(w)->window != 0L)
02212     {
02213         static GdkCursor *cursor_arrow=0L;
02214         static GdkCursor *cursor_watch=0L;
02215         if(cursor_arrow == 0L)
02216         {
02217             cursor_arrow = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
02218             cursor_watch = gdk_cursor_new (GDK_WATCH);
02219         }
02220         if(cursor == uCursArrow)
02221             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_arrow);
02222         else if(cursor == uCursWatch)
02223             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_watch);
02224     }
02225 #endif
02226 }

void UWidget::OnChgFocus ( int cmd ) [protected]

EV_CHGFOCUS UWidget message handling

  • cmd the sub-widget to change focus to.

Definition at line 1534 of file uwidget.cpp.

References GetWidget().

01535 {
01536     void *w = GetWidget(cmd);
01537     if(w == 0L)
01538         return;
01539
01540 #if qMacPP
01541     LPane *pane = (LPane *)w;
01542     LCommander *target = dynamic_cast<LCommander *>(pane);
01543     if(target != 0L)
01544     {
01545         LCommander::SwitchTarget(target);
01546     }
01547 #endif
01548 #if qMacAPP
01549     TView *view = (TView *)w;
01550     if(MA_MEMBER(view, TView))
01551     {
01552         if(view->GetWindow() != 0L)
01553             view->GetWindow()->SetWindowTarget(view);
01554     }
01555 #endif
01556 #if qGTK
01557     if(GTK_IS_WIDGET(w))
01558     {
01559         gtk_widget_grab_focus(GTK_WIDGET(w)); // TODO doesn't work
01560     }
01561 #endif
01562 #ifdef WIN32
01563     CWnd *wnd = (CWnd *)w;
01564
01565     wnd->SetFocus();
01566 #endif
01567 }

void UWidget::OnComboAppend | ( | int | cmd,
 |  | const char * | txt
 | ) | [protected]

EV_COMBO_APPEND UWidget message handling.

Definition at line 2536 of file uwidget.cpp.

References GetWidget(), UCmdTarget::GetWidID(), strdup(), and UMAKEINT.

02537 {
02538     void *w = GetWidget(cmd);
02539     if(w == 0L)
02540         return;
02541
02542 #ifdef WIN32
02543     CWnd *wnd = (CWnd *)w;
02544
02545     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02546     {
02547         CComboBox *combo = (CComboBox *)wnd;
02548         combo->InsertString(-1, txt);
02549     }
02550 #endif
02551 #if qGTK
02552     if(GTK_IS_COMBO(w))
02553     {
02554         GtkWidget *list = GTK_COMBO(w)->list;
02555         GtkWidget *list_item = gtk_list_item_new_with_label(txt);
02556         gtk_container_add( GTK_CONTAINER(list), list_item );
02557         gtk_widget_show( list_item );
02558
02559         gtk_signal_connect( GTK_OBJECT(list_item), "select",
02560                             GTK_SIGNAL_FUNC(gtkcomboclicked), (gpointer)UMAKEINT(GetWidID(), cmd) );
02561     }
02562     else if(GTK_IS_OPTION_MENU(w))
02563     {
02564         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02565         GtkWidget *item = gtk_menu_item_new_with_label(txt);
02566         // fix me: where to find the label of the item ?
02567         gtk_object_set_data_full(GTK_OBJECT(item), "rf_menuitemtext", strdup(txt), (GtkDestroyNotify)free);
02568         gtk_signal_connect (GTK_OBJECT(item), "activate",
02569             GTK_SIGNAL_FUNC(gtkmenuactivated), (gpointer)UMAKEINT(GetWidID(), cmd));
02570         gtk_widget_show(item);
02571         gtk_menu_append(GTK_MENU(menu), item);
02572     }
02573 #endif
02574 #if qMacPP
02575     LPane *view = (LPane *)w;
02576     LMenuController *popup;
02577     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02578     {
02579         USemaphore policeman(gTurnOffBroadcast);
02580
02581         if(strcmp(txt, "-") == 0)
02582             popup->InsertMenuItem("\p(-", max_Int16, false);
02583         else
02584             popup->InsertMenuItem(LStr255(txt), max_Int16);
02585     }
02586 #endif
02587 #if qMacAPP
02588     TView *view = (TView *)w;
02589     if(MA_MEMBER(view, TPopup))
02590     {
02591         TPopup *popup = (TPopup *)view;
02592         if(strcmp(txt, "-") == 0)
02593             popup->AddSeparator();
02594         else
02595             popup->AddItem(CStr255_AC(txt));
02596     }
02597 #endif
02598 }

void UWidget::OnComboDelSel | ( | int | cmd,
 |  | int | sel
 | ) | [protected]

EV_COMBO_DELSEL UWidget message handling.

Definition at line 2647 of file uwidget.cpp.

References GetWidget().

02648 {
02649     void *w = GetWidget(cmd);
02650     if(w == 0L)
02651         return;
02652
02653 #ifdef WIN32
02654     CWnd *wnd = (CWnd *)w;
02655
02656     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02657     {
02658         CComboBox *combo = (CComboBox *)wnd;
02659         combo->DeleteString(sel);
02660     }
02661 #endif
02662 #if qMacPP
02663     LPane *view = (LPane *)w;
02664     LMenuController *popup;
02665     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02666     {
02667         USemaphore policeman(gTurnOffBroadcast);
02668
02669         popup->DeleteMenuItem(sel + 1);
02670     }
02671 #endif
02672 }

void UWidget::OnComboEnableSel | ( | int | cmd,
 |  | int | sel,
 |  | int | state
 | ) | [protected]

EV_COMBO_ENABLESEL UWidget message handling.

Warning:
not implemented on Win32

Definition at line 2674 of file uwidget.cpp.

References GetWidget().

02675 {
02676     void *w = GetWidget(cmd);
02677     if(w == 0L)
02678         return;
02679
02680 #ifdef WIN32
02681     CWnd *wnd = (CWnd *)w;
02682
02683     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02684     {
02685     }
02686 #endif
02687 #if qMacPP
02688     LPane *view = (LPane *)w;
02689     LMenuController *popup;
02690     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02691     {
02692         if(state)
02693             ::EnableMenuItem(popup->GetMacMenuH(), sel + 1);
02694         else
02695             ::DisableMenuItem(popup->GetMacMenuH(), sel + 1);
02696     }
02697 #endif
02698 }

int UWidget::OnComboGetCount ( int cmd ) [protected]

EV_COMBO_GETCOUNT UWidget message handling.

Definition at line 2789 of file uwidget.cpp.

References GetWidget().

02790 {
02791     int res = 0; // sanity
02792
02793     void *w = GetWidget(cmd);
02794     if(w == 0L)
02795         return res;
02796
02797 #ifdef WIN32
02798     CWnd *wnd = (CWnd *)w;
02799
02800     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02801     {
02802         CComboBox *combo = (CComboBox *)wnd;
02803         res = combo->GetCount();
02804     }
02805 #endif
02806 #if qGTK
02807     if(GTK_IS_COMBO(w))
02808     {
02809         GtkList *list = GTK_LIST(GTK_COMBO(w)->list);
02810         if ( list)
02811         {
02812             GList *tmp_list;
02813             for( tmp_list = list->children; tmp_list; tmp_list = tmp_list->next)
02814                 ++res;
02815         }
02816     }
02817     else if(GTK_IS_OPTION_MENU(w))
02818     {
02819         GtkMenu *mm = GTK_MENU(gtk_option_menu_get_menu( GTK_OPTION_MENU(w)));
02820         if ( mm)
02821         {
02822             GList *tmp_list;
02823             for( tmp_list = mm->menu_shell.children; tmp_list; tmp_list = tmp_list->next)
02824                 ++res;
02825         }
02826     }
02827
02828 #endif
02829 #if qMacAPP
02830     TView *view = (TView *)w;
02831     if(MA_MEMBER(view, TPopup))
02832     {
02833         TPopup *popup = (TPopup *)view;
02834         res = popup->GetNumberOfItems();
02835     }
02836 #endif
02837 #if qMacPP
02838     LPane *view = (LPane *)w;
02839     LMenuController *popup;
02840     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02841     {
02842         res = ::CountMenuItems(popup->GetMacMenuH());
02843     }
02844 #endif
02845
02846     return res;
02847 }

void UWidget::OnComboGetMenu | ( | int | cmd,
 |  | UMENU * | menu
 | ) | [protected]

EV_COMBO_ENABLESEL UWidget message handling.

Definition at line 2700 of file uwidget.cpp.

References GetWidget(), and UMENU_NULL.

02701 {
02702     *menu = UMENU_NULL; // sanity
02703
02704     void *w = GetWidget(cmd);
02705     if(w == 0L)
02706         return;
02707
02708 #ifdef WIN32
02709     CWnd *wnd = (CWnd *)w;
02710
02711     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02712     {
02713     }
02714 #endif
02715 #if qMacPP
02716     LPane *view = (LPane *)w;
02717     LMenuController *popup;
02718     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02719     {
02720         MenuHandle hdl = popup->GetMacMenuH();
02721         if(hdl != 0L)
02722 #   if ACCESSOR_CALLS_ARE_FUNCTIONS
02723             *menu = GetMenuID(hdl);
02724 #   else
02725             *menu = (**hdl).menuID;
02726 #   endif
02727     }
02728 #endif
02729 }

int UWidget::OnComboGetPos | ( | int | cmd,
 |  | UStr * | txt
 | ) | [protected]

EV_COMBO_GETSEL UWidget message handling.

Definition at line 2731 of file uwidget.cpp.

References GetWidget().

02732 {
02733     int res = -1; // sanity
02734     if(txt != 0L)
02735         *txt = "";
02736
02737     void *w = GetWidget(cmd);
02738     if(w == 0L)
02739         return res;
02740
02741 #ifdef WIN32
02742     CWnd *wnd = (CWnd *)w;
02743
02744     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02745     {
02746         CComboBox *combo = (CComboBox *)wnd;
02747         res = combo->GetCurSel();
02748         if(res != -1 && txt != 0L)
02749         {
02750             CString s;
02751             combo->GetLBText(res, s);
02752             *txt = s;
02753         }
02754     }
02755 #endif
02756 #if qMacAPP
02757     TView *view = (TView *)w;
02758     if(MA_MEMBER(view, TPopup))
02759     {
02760         TPopup *popup = (TPopup *)view;
02761         res = popup->GetCurrentItem() - 1;
02762         if(txt != 0L)
02763         {
02764             CStr255_AC pstr = popup->GetItemText(res + 1);
02765             *txt = pstr;
02766         }
02767     }
02768 #endif
02769 #if qMacPP
02770     LPane *view = (LPane *)w;
02771     LMenuController *popup;
02772     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02773     {
02774         res = popup->GetCurrentMenuItem() - 1;
02775         if(txt != 0L)
02776         {
02777             LStr255 pstr;
02778             popup->GetMenuItemText(res + 1, pstr);
02779             *txt = pstr;
02780         }
02781     }
02782 #endif
02783
02784     return res;
02785 }

void UWidget::OnComboResetAll ( int cmd ) [protected]

EV_COMBO_RESETALL UWidget message handling.

Definition at line 2479 of file uwidget.cpp.

References GetWidget().

02480 {
02481     void *w = GetWidget(cmd);
02482     if(w == 0L)
02483         return;
02484
02485 #ifdef WIN32
02486     CWnd *wnd = (CWnd *)w;
02487
02488     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02489     {
02490         CComboBox *combo = (CComboBox *)wnd;
02491         combo->ResetContent();
02492     }
02493 #endif
02494 #if qGTK
02495     if(GTK_IS_COMBO(w))
02496     {
02497         GtkList *listbox = GTK_LIST( GTK_COMBO(w)->list );
02498         if(listbox && listbox->children != 0L)
02499             gtk_list_remove_items( listbox, g_list_copy(listbox->children));
02500     }
02501     else if(GTK_IS_OPTION_MENU(w))
02502     {
02503         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02504         GList *list = g_list_copy(GTK_MENU_SHELL(menu)->children);
02505         GList *head = list;
02506         while(list != 0L)
02507         {
02508             GtkWidget *wid = GTK_WIDGET(list->data);
02509             gtk_container_remove(GTK_CONTAINER(menu), wid);
02510             list = (GList *)g_list_next(list);
02511         }
02512         g_list_free(head);
02513     }
02514 #endif
02515 #if qMacPP
02516     LPane *view = (LPane *)w;
02517     LMenuController *popup;
02518     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02519     {
02520         USemaphore policeman(gTurnOffBroadcast);
02521
02522         popup->DeleteAllMenuItems();
02523     }
02524 #endif
02525 #if qMacAPP
02526     TView *view = (TView *)w;
02527     if(MA_MEMBER(view, TPopup))
02528     {
02529         TPopup *popup = (TPopup *)view;
02530         while(popup->GetNumberOfItems() > 0)
02531             popup->DeleteItem(1);
02532     }
02533 #endif
02534 }

void UWidget::OnComboSetPos | ( | int | cmd,
 |  | int | sel
 | ) | [protected]

EV_COMBO_SETSEL UWidget message handling.

Definition at line 2600 of file uwidget.cpp.

References GetWidget().

02601 {
02602     void *w = GetWidget(cmd);
02603     if(w == 0L)
02604         return;
02605
02606 #ifdef WIN32
02607     CWnd *wnd = (CWnd *)w;
02608
02609     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02610     {
02611         CComboBox *combo = (CComboBox *)wnd;
02612         combo->SetCurSel(sel);
02613     }
02614 #endif
02615 #if qGTK
02616     if(GTK_IS_COMBO(w))
02617     {
02618         GtkWidget *list = GTK_COMBO(w)->list;
02619         gtk_list_select_item(GTK_LIST(list), sel);
02620     }
02621     else if(GTK_IS_OPTION_MENU(w))
02622     {
02623         gtk_option_menu_set_history (GTK_OPTION_MENU(w), sel);
02624     }
02625
02626 #endif
02627 #if qMacAPP
02628     TView *view = (TView *)w;
02629     if(MA_MEMBER(view, TPopup))
02630     {
02631         TPopup *popup = (TPopup *)view;
02632         popup->SetCurrentItem(sel + 1, true);
02633     }
02634 #endif
02635 #if qMacPP
02636     LPane *view = (LPane *)w;
02637     LMenuController *popup;
02638     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02639     {
02640         USemaphore policeman(gTurnOffBroadcast);
02641
02642         popup->SetCurrentMenuItem(sel + 1);
02643     }
02644 #endif
02645 }

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 1501 of file uwidget.cpp.

References GetWidget().

01502 {
01503     void *w = GetWidget(cmd);
01504     if(w == 0L)
01505         return;
01506
01507 #if qMacPP
01508     LPane *view = (LPane *)w;
01509     if(state)
01510         view->Enable();
01511     else
01512         view->Disable();
01513 #endif
01514 #if qMacAPP
01515     TView *view = (TView *)w;
01516     if(MA_MEMBER(view, TView))
01517     {
01518         view->SetActiveState(state != 0, true);
01519     }
01520 #endif
01521 #if qGTK
01522     if(GTK_IS_WIDGET(w))
01523     {
01524         gtk_widget_set_sensitive(GTK_WIDGET(w), state != 0);
01525     }
01526 #endif
01527 #ifdef WIN32
01528     CWnd *wnd = (CWnd *)w;
01529
01530     wnd->EnableWindow(state != 0);
01531 #endif
01532 }

int UWidget::OnFetchCmd | ( | int | cmd,
 |  | void * | widget
 | ) | [protected]

EV_FETCHCMD UWidget message handling.

Definition at line 3730 of file uwidget.cpp.

References m_widgets.

03731 {
03732     std::map<int, void *>::const_iterator i;
03733     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03734     {
03735         if(widget == (*i).second)
03736             return (*i).first;
03737     }
03738     return -1;
03739 }

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 1292 of file uwidget.cpp.

References TPseudoDoubleNumberText::GetValue(), GetWidget(), and stat.

01293 {
01294     *f = 0.0; // sanity
01295
01296     void *w = GetWidget(cmd);
01297     if(w == 0L)
01298         return;
01299
01300 #if qMacPP
01301     LPane *view = (LPane *)w;
01302     LEditText *edit;
01303     LStaticText *stat;
01304     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01305     {
01306         LStr255 pstr;
01307         edit->GetText(pstr);
01308         *f = (double)pstr;
01309     }
01310     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01311     {
01312         LStr255 pstr;
01313         stat->GetText(pstr);
01314         *f = (double)pstr;
01315     }
01316 #endif
01317 #if qMacAPP
01318     TView *view = (TView *)w;
01319     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01320     {
01321         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01322         *f = num->GetValue();
01323     }
01324 #endif
01325 #ifdef WIN32
01326     CWnd *wnd = (CWnd *)w;
01327
01328     CString s;
01329     wnd->GetWindowText(s);
01330     sscanf(s, "%f", f);
01331 #endif
01332 }

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 851 of file uwidget.cpp.

References URECT::bottom, GetWidget(), URECT::left, URECT::right, and URECT::top.

00852 {
00853     r->left = 0; // sanity
00854     r->right = 0;
00855     r->top = 0;
00856     r->bottom = 0;
00857
00858     void *w = GetWidget(cmd);
00859     if(w == 0L)
00860         return;
00861
00862 #if qMacAPP
00863     TView *view = (TView *)w;
00864     CViewRect mr = view->GetFrame();
00865     view->SuperViewToLocal(mr);
00866     view->LocalToRootView(mr);
00867     r->left = mr.left;
00868     r->right = mr.right;
00869     r->top = mr.top;
00870     r->bottom = mr.bottom;
00871 #endif
00872 #if qMacPP
00873     LPane *view = (LPane *)w;
00874     SPoint32 outLocation;
00875     SDimension16 outSize;
00876     view->GetFrameLocation(outLocation);
00877     view->GetFrameSize(outSize);
00878
00879     *r = URect(UPoint(outLocation.h, outLocation.v), USize(outSize.width, outSize.height));
00880 #endif
00881 #ifdef WIN32
00882     CRect mr;
00883     CWnd *wnd = (CWnd *)w;
00884     wnd->GetClientRect(mr);
00885     CWnd *parent = wnd->GetParent();
00886     if(parent != 0L)
00887     {
00888         wnd->ClientToScreen(mr);
00889         parent->ScreenToClient(mr);
00890     }
00891     r->left = mr.left;
00892     r->right = mr.right;
00893     r->top = mr.top;
00894     r->bottom = mr.bottom;
00895 #endif
00896 }

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 1876 of file uwidget.cpp.

References LPseudoWinAttachment::GetPageValue(), GetWidget(), USLIDER::inc, macpp_getattachwindow(), USLIDER::max, USLIDER::min, USLIDER::pos, and VERIFY.

01877 {
01878     void *w = GetWidget(cmd);
01879     if(w == 0L)
01880         return;
01881
01882 #ifdef WIN32
01883     CWnd *wnd = (CWnd *)w;
01884
01885     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01886     {
01887         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01888         prop->max = slider->GetRangeMax();
01889         prop->min = slider->GetRangeMin();
01890         prop->inc = slider->GetPageSize();
01891         prop->pos = slider->GetPos();
01892     }
01893     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01894     {
01895         SCROLLINFO info;
01896         CScrollBar *scroll = (CScrollBar *)wnd;
01897         VERIFY(scroll->GetScrollInfo(&info));
01898         prop->max = info.nMax;
01899         prop->min = info.nMin;
01900         prop->inc = info.nPage;
01901         prop->pos = info.nPos;
01902     }
01903 #endif
01904 #if qMacAPP
01905     TView *view = (TView *)w;
01906     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01907     {
01908         TCtlMgr *ctrl = (TCtlMgr *)view;
01909         prop->max = ctrl->GetMaximum();
01910         prop->min = ctrl->GetMinimum();
01911         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01912             prop->inc = ((TPseudoScrollBar *)ctrl)->fPageStep;
01913         else
01914             prop->inc = 1;
01915         prop->pos = ctrl->GetValue();
01916     }
01917 #endif
01918 #if qMacPP
01919     LPane *view = (LPane *)w;
01920     LControl *ctrl;
01921     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01922     {
01923         prop->max = ctrl->GetMaxValue();
01924         prop->min = ctrl->GetMinValue();
01925         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01926         prop->inc = attach != 0L ? attach->GetPageValue(cmd) : 1;
01927         prop->pos = ctrl->GetValue();
01928     }
01929 #endif
01930 }

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 1169 of file uwidget.cpp.

References gchar, CPseudoRotButton::GetCurrent(), UPseudoRotButton::GetCurrentState(), CPseudoToggle::GetState(), GetWidget(), and stat.

01170 {
01171     void *w = GetWidget(cmd);
01172     if(w == 0L)
01173         return 0;
01174
01175     int state = 0; // sanity
01176
01177 #ifdef WIN32
01178     CWnd *wnd = (CWnd *)w;
01179
01180     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01181     {
01182         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01183         state = btn->GetCurrent();
01184     }
01185     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01186     {
01187         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01188         state = btn->GetState();
01189     }
01190     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01191     {
01192         CButton *btn = (CButton *)wnd;
01193         state = btn->GetCheck() != 0;
01194     }
01195     else
01196     {
01197         CString s;
01198         wnd->GetWindowText(s);
01199         sscanf(s, "%d", &state);
01200     }
01201 #endif
01202 #if qGTK
01203     if(GTK_IS_TOGGLE_BUTTON(w))
01204     {
01205         state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) != 0;
01206     }
01207     else if(GTK_IS_ENTRY(w))
01208     {
01209         gchar *text = gtk_entry_get_text(GTK_ENTRY(w));
01210         sscanf(text, "%d", &state);
01211     }
01212 #endif
01213 #if qMacPP
01214     LPane *view = (LPane *)w;
01215     LCheckBox *check;
01216     LRadioButton *rad;
01217     LEditText *edit;
01218     LStaticText *stat;
01219     LBevelButton *bevel;
01220     UPseudoRotButton *rot;
01221     LCheckBoxGroupBox *groupbox;
01222     LPageController *tabctrl;
01223     LTabsControl *tabctrl2;
01224     LControl *ctrl;
01225     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01226     {
01227         state = check->GetValue() == Button_On ? 1 : 0;
01228     }
01229     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01230     {
01231         state = rad->GetValue() == Button_On ? 1 : 0;
01232     }
01233     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01234     {
01235         LStr255 pstr;
01236         edit->GetText(pstr);
01237         state = (SInt32)pstr;
01238     }
01239     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01240     {
01241         LStr255 pstr;
01242         stat->GetText(pstr);
01243         state = (SInt32)pstr;
01244     }
01245     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01246     {
01247         state = groupbox->GetValue() == Button_On ? 1 : 0;
01248     }
01249     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01250     {
01251         state = rot->GetCurrentState();
01252     }
01253     else if((bevel = dynamic_cast<LBevelButton *>(view)) != 0L)
01254     {
01255         state = bevel->GetValue() == Button_On ? 1 : 0;
01256     }
01257     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01258     {
01259         state = tabctrl->GetCurrentPageIndex() - 1;
01260     }
01261     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01262     {
01263         state = tabctrl2->GetValue() - 1;
01264     }
01265     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01266     {
01267         state = ctrl->GetValue();
01268     }
01269 #endif
01270 #if qMacAPP
01271     TView *view = (TView *)w;
01272     if(MA_MEMBER(view, TCheckBox))
01273     {
01274         TCheckBox *check = (TCheckBox *)view;
01275         state = check->GetState();
01276     }
01277     else if(MA_MEMBER(view, TRadio))
01278     {
01279         TRadio *rad = (TRadio *)view;
01280         state = rad->GetState();
01281     }
01282     else if(MA_MEMBER(view, TNumberText))
01283     {
01284         TNumberText *num = (TNumberText *)view;
01285         state = num->GetValue();
01286     }
01287 #endif
01288
01289     return state;
01290 }

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 1703 of file uwidget.cpp.

References gchar, getLabelFromContainer(), GetWidget(), and UStr::set().

01704 {
01705     *text = ""; // sanity
01706
01707     void *w = GetWidget(cmd);
01708     if(w == 0L)
01709         return;
01710
01711 #ifdef WIN32
01712     CWnd *wnd = (CWnd *)w;
01713
01714     CString s;
01715     wnd->GetWindowText(s);
01716     *text = s;
01717 #endif
01718 #if qGTK
01719     if(GTK_IS_WINDOW(w))
01720     {
01721         *text = GTK_WINDOW(w)->title;
01722     }
01723     else if(GTK_IS_BUTTON(w))
01724     {
01725         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01726         if(label != 0L)
01727         {
01728             gchar *str;
01729             gtk_label_get(label, &str);
01730
01731             if(str != 0L)
01732                                 *text = str;
01733         }
01734         else
01735             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01736     }
01737     else if(GTK_IS_ENTRY(w))
01738     {
01739         *text = gtk_entry_get_text(GTK_ENTRY(w));
01740     }
01741     else if(GTK_IS_COMBO(w))
01742     {
01743         *text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w)->entry));
01744     }
01745     else if(GTK_IS_TEXT(w))
01746     {
01747         GtkText *t = GTK_TEXT(w);
01748         size_t size = gtk_text_get_length(t);
01749         size_t idx;
01750
01751         for (idx = 0; idx < size; idx++) {
01752             *text << (char)GTK_TEXT_INDEX(t,idx);
01753         }
01754     }
01755     else if(GTK_IS_LABEL(w))
01756     {
01757         GtkLabel *t = GTK_LABEL(w);
01758         gchar *str;
01759         gtk_label_get(t, &str);
01760         if(str != 0L)
01761             *text = str;
01762     }
01763 #endif
01764 #if qMacPP
01765     LPane *view = (LPane *)w;
01766     LTextEditView *txt;
01767     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01768     {
01769         LStr255 pstr;
01770         Handle hdl = txt->GetTextHandle();
01771         text->set((const char *)*hdl, ::GetHandleSize(hdl));
01772     }
01773     else
01774     {
01775         LStr255 pstr;
01776         view->GetDescriptor(pstr);
01777         *text = pstr;
01778     }
01779 #endif
01780 #if qMacAPP
01781     TView *view = (TView *)w;
01782     if(MA_MEMBER(view, TCtlMgr))
01783     {
01784         TCtlMgr *ctrl = (TCtlMgr *)view;
01785         CStr255_AC pstr = ctrl->GetText();
01786         *text = pstr;
01787     }
01788     else if(MA_MEMBER(view, TStaticText))
01789     {
01790         TStaticText *ctrl = (TStaticText *)view;
01791         CStr255_AC pstr = ctrl->GetText();
01792         *text = pstr;
01793     }
01794     else if(MA_MEMBER(view, TWindow))
01795     {
01796         TWindow *ctrl = (TWindow *)view;
01797         CStr255_AC pstr = ctrl->GetTitle();
01798         *text = pstr;
01799     }
01800 #endif
01801 }

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 1135 of file uwidget.cpp.

References UCmdTarget::GetWidID().

01136 {
01137 #if qGTK
01138     if(GTK_IS_WIDGET(widget))
01139     {
01140         // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01141         _dataTabForeach data = {GetWidID(), cmd, page};
01142         g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataTabForeach, (gpointer)&data);
01143     }
01144 #endif /* qGTK */
01145 }

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 966 of file uwidget.cpp.

References UCmdTarget::GetWidID(), USemaphore::IsEnteredTwice(), kUMainWidget, m_widgets, macpp_fecthview(), macpp_linkbroadcasters(), NEW, TPseudoWinAdorner::SetPseudoWidget(), TPseudoWinBehavior::SetPseudoWidget(), UEventSendMessage(), and UMAKEINT.

00967 {
00968     std::map<int, void *>::value_type val(cmd, widget);
00969     m_widgets.insert(val);
00970
00971 #ifdef WIN32
00972
00973 #endif
00974 #if qMacPP
00975     LPane *view = (LPane *)widget;
00976     if(view != 0L)
00977     {
00978         // fetch the inside widgets and add them the the widget list
00979         static bool sSemaphore = false;
00980         USemaphore policeman(sSemaphore);
00981         if(!policeman.IsEnteredTwice())
00982         {
00983             macpp_fecthview(GetWidID(), view);
00984         }
00985
00986         LWindow *wind = dynamic_cast<LWindow*>(view);
00987         if(wind != 0L)
00988         {
00989             LPseudoWinAttachment *attach = NEW LPseudoWinAttachment(GetWidID());
00990             wind->AddAttachment(attach);
00991             macpp_linkbroadcasters(wind, attach);
00992
00993             SPaneInfo inPaneInfo;
00994             memset(&inPaneInfo, 0, sizeof(SPaneInfo));
00995             inPaneInfo.superView = wind;
00996             NEW UPseudoFakePane(inPaneInfo, attach);
00997
00998             // call the create callback
00999             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01000         }
01001     }
01002 #endif
01003 #if qMacAPP
01004     TView *view = (TView *)widget;
01005     if(MA_MEMBER(view, TView))
01006     {
01007         // fetch the inside widgets and add them the the widget list
01008         static bool sSemaphore = false;
01009         USemaphore policeman(sSemaphore);
01010         if(!policeman.IsEnteredTwice())
01011         {
01012             macapp_fecthview(GetWidID(), view);
01013             //macapp_workaround_adlib_bug(view);
01014         }
01015
01016         if(MA_MEMBER(view, TWindow))
01017         {
01018             // add the pseudo behaviour which re-routes the events to the pseudo-widget
01019             TPseudoWinBehavior *psbehavior = dynamic_cast_AC(TPseudoWinBehavior*,
01020                 view->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
01021
01022             if(psbehavior == 0L)
01023             {
01024                 psbehavior = TH_new TPseudoWinBehavior;
01025                 view->AddBehavior(psbehavior);
01026             }
01027             psbehavior->SetPseudoWidget(GetWidID());
01028
01029             // add the pseudo adorner which intercepts the frame size changes
01030             TPseudoWinAdorner *psadorner = dynamic_cast_AC(TPseudoWinAdorner*,
01031                 view->AdornerWithID(TPseudoWinAdorner::kPseudoWinAdorner));
01032
01033             if(psadorner == 0L)
01034             {
01035                 psadorner = TH_new TPseudoWinAdorner;
01036                 view->AddAdorner(psadorner, kAdornLast, false);
01037             }
01038             psadorner->SetPseudoWidget(GetWidID());
01039
01040             // call the create callback
01041             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01042         }
01043     }
01044 #endif
01045 #if qGTK
01046     static bool firstTime = true;
01047     if(firstTime)
01048     {
01049         // for the disable/enable handling notification (EV_UPDATEUI)
01050         gdk_event_handler_set((GdkEventFunc)gtkmaindoevent, NULL, NULL);
01051
01052         // listen focus events
01053         focus_in_signal_id = gtk_signal_lookup ("focus_in_event", GTK_TYPE_WIDGET);
01054         gtk_signal_add_emission_hook (focus_in_signal_id, gtkeventwatcher, NULL);
01055         focus_out_signal_id = gtk_signal_lookup ("focus_out_event", GTK_TYPE_WIDGET);
01056         gtk_signal_add_emission_hook (focus_out_signal_id, gtkeventwatcher, NULL);
01057
01058         firstTime = false;
01059     }
01060
01061     // so for every widget mapped, we'll be able to find the pseudo-widget associated with.
01062     gtk_object_set_data(GTK_OBJECT(widget), kUgtkDataToken, (gpointer)UMAKEINT(GetWidID(), cmd));
01063
01064     // we are only interesting about the main widgets here
01065     if(GTK_IS_WIDGET(widget))
01066     {
01067         if(cmd == kUMainWidget)
01068         {
01069             // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01070             g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataForeach, (gpointer)GetWidID());
01071
01072             // map the destroy callback
01073             gtk_signal_connect (GTK_OBJECT(widget), "destroy",
01074                                 GTK_SIGNAL_FUNC(gtkdestroy), (gpointer)this);
01075
01076             gtk_signal_connect (GTK_OBJECT (widget), "key_press_event",
01077                                 GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
01078
01079             // call the create callback
01080             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01081         }
01082     }
01083
01084     if(GTK_IS_NOTEBOOK(widget))
01085     {
01086         gtk_signal_connect (GTK_OBJECT (widget), "switch_page",
01087                             GTK_SIGNAL_FUNC(gtkswitchpage),
01088                             (gpointer)UMAKEINT(GetWidID(), cmd));
01089     }
01090
01091     if(GTK_IS_BUTTON(widget))
01092     {
01093         gtk_signal_connect (GTK_OBJECT(widget), "clicked",
01094             GTK_SIGNAL_FUNC(gtkclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01095     }
01096
01097     if(GTK_IS_MENU_ITEM(widget))
01098     {
01099         gtk_signal_connect(GTK_OBJECT(widget), "activate",
01100             GTK_SIGNAL_FUNC(gtkmenuitemactivate), (gpointer)UMAKEINT(GetWidID(), cmd));
01101     }
01102
01103     if(GTK_IS_CLIST(widget))
01104     {
01105         gtk_signal_connect (GTK_OBJECT(widget), "select_row",
01106             GTK_SIGNAL_FUNC(gtkselectclist), (gpointer)UMAKEINT(GetWidID(), cmd));
01107
01108         gtk_signal_connect (GTK_OBJECT(widget), "click_column",
01109             GTK_SIGNAL_FUNC(gtkselectclistcolumn), (gpointer)UMAKEINT(GetWidID(), cmd));
01110
01111         gtk_signal_connect_after (GTK_OBJECT (widget), "button_press_event",
01112                                   GTK_SIGNAL_FUNC (gtkclistdblclick), (gpointer)UMAKEINT(GetWidID(), cmd));
01113     }
01114
01115     if(GTK_IS_DRAWING_AREA(widget))
01116     {
01117         gtk_signal_connect_after (GTK_OBJECT(widget), "button_press_event",
01118                                   GTK_SIGNAL_FUNC(gtklayoutclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01119         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01120                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01121         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01122     }
01123
01124     if(GTK_IS_LAYOUT(widget))
01125     {
01126         gtk_signal_connect_after (GTK_OBJECT(widget), "button_press_event",
01127                                   GTK_SIGNAL_FUNC(gtklayoutclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01128         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01129                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01130         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01131     }
01132 #endif /* qGTK */
01133 }

void UWidget::OnInvalidate ( int cmd ) [protected]

EV_INVALIDATE UWidget message handling

  • cmd the sub-widget to redraw (delayed).

Definition at line 1569 of file uwidget.cpp.

References GetWidget().

01570 {
01571     void *w = GetWidget(cmd);
01572     if(w == 0L)
01573         return;
01574
01575 #if qMacAPP
01576     TView *view = (TView *)w;
01577     if(MA_MEMBER(view, TView))
01578     {
01579         view->ForceRedraw();
01580     }
01581 #endif
01582 #if qMacPP
01583     LPane *pane = (LPane *)w;
01584     pane->Refresh();
01585 #endif
01586 #ifdef WIN32
01587     CWnd *wnd = (CWnd *)w;
01588
01589     wnd->Invalidate();
01590 #endif
01591 }

void UWidget::OnListAddColumns | ( | int | cmd,
 |  | int | num
 | ) | [protected]

EV_LIST_ADDCOLUMNS UWidget message handling.

Definition at line 2942 of file uwidget.cpp.

References GetWidget(), and macpp_preparetable().

02943 {
02944     void *w = GetWidget(cmd);
02945     if(w == 0L)
02946         return;
02947
02948 #if qGTK
02949     if(!GTK_IS_CLIST(w))
02950         return;
02951
02952     //GtkCList *list = GTK_CLIST(w);
02953         // don't know how to do that, for now it relies on glade settings
02954
02955 #endif
02956 #ifdef WIN32
02957     CWnd *wnd = (CWnd *)w;
02958
02959     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02960     {
02961         CListCtrl *list = (CListCtrl *)wnd;
02962         DWORD dwExStyle = ListView_GetExtendedListViewStyle(list->m_hWnd);
02963         dwExStyle |= LVS_EX_FULLROWSELECT;
02964         ListView_SetExtendedListViewStyle(list->m_hWnd, dwExStyle);
02965
02966         while(num--)
02967             list->InsertColumn(0, "", LVCFMT_LEFT, 80);
02968     }
02969 #endif
02970 #if qMacPP
02971     LPane *view = (LPane *)w;
02972     LOutlineTable *table;
02973     LTextTableView *tabtext;
02974     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02975     {
02976         macpp_preparetable(table);
02977         table->InsertCols( num, 0, nil, nil, false );
02978     }
02979     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02980     {
02981         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02982         tabtext->InsertCols( num, 0, nil, nil, false );
02983     }
02984 #endif
02985 }

void UWidget::OnListAddSel | ( | int | cmd,
 |  | int | entry
 | ) | [protected]

EV_LIST_ADDSEL UWidget message handling.

Definition at line 3117 of file uwidget.cpp.

References GetWidget(), and VERIFY.

03118 {
03119     void *w = GetWidget(cmd);
03120     if(w == 0L)
03121         return;
03122
03123 #if qMacAPP
03124     TView *view = (TView *)w;
03125     if(MA_MEMBER(view, TPseudoTextListView))
03126     {
03127         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03128         txt->SelectItem(entry + 1, false, true, true);
03129     }
03130 #endif
03131 #if qGTK
03132     if(!GTK_IS_CLIST(w))
03133         return;
03134
03135     GtkCList *list = GTK_CLIST(w);
03136     gtk_clist_select_row(list, entry, 0);
03137 #endif
03138 #ifdef WIN32
03139     CWnd *wnd = (CWnd *)w;
03140
03141     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03142     {
03143         CListCtrl *list = (CListCtrl *)wnd;
03144         VERIFY(list->SetItemState(entry, LVIS_SELECTED, LVIS_SELECTED));
03145         VERIFY(list->EnsureVisible(entry, true));
03146     }
03147 #endif
03148 #if qMacPP
03149     LPane *view = (LPane *)w;
03150     LTableView *table;
03151     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03152     {
03153         STableCell cell(entry + 1, 1);
03154         table->SelectCell(cell);
03155         table->ScrollCellIntoFrame(cell);
03156     }
03157 #endif
03158 }

void UWidget::OnListDelRow | ( | int | cmd,
 |  | int | row
 | ) | [protected]

EV_LIST_DELROW UWidget message handling.

Definition at line 3160 of file uwidget.cpp.

References TPseudoTextListView::DelItemAt(), GetWidget(), and VERIFY.

03161 {
03162     void *w = GetWidget(cmd);
03163     if(w == 0L)
03164         return;
03165
03166 #if qMacAPP
03167     TView *view = (TView *)w;
03168     if(MA_MEMBER(view, TPseudoTextListView))
03169     {
03170         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03171         txt->DelItemAt(entry + 1, 1);
03172     }
03173 #endif
03174 #if qGTK
03175     if(!GTK_IS_CLIST(w))
03176         return;
03177
03178     GtkCList *list = GTK_CLIST(w);
03179     gtk_clist_remove(list, entry);
03180 #endif
03181 #ifdef WIN32
03182     CWnd *wnd = (CWnd *)w;
03183
03184     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03185     {
03186         CListCtrl *list = (CListCtrl *)wnd;
03187         VERIFY(list->DeleteItem(entry));
03188     }
03189 #endif
03190 #if qMacPP
03191     LPane *view = (LPane *)w;
03192     LOutlineTable *table;
03193     LTextTableView *tabtext;
03194     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03195     {
03196         LOutlineItem* item = table->FindItemForRow(entry + 1);
03197         if(item != 0L)
03198         {
03199             table->RemoveItem(item);
03200         }
03201     }
03202     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03203     {
03204         tabtext->RemoveRows(1, entry + 1, true);
03205     }
03206 #endif
03207 }

void UWidget::OnListGetInfo | ( | int | cmd,
 |  | ULIST_INFO * | desc
 | ) | [protected]

EV_LIST_GETINFO UWidget message handling.

Definition at line 3569 of file uwidget.cpp.

References ULIST_INFO::col, ULIST_INFO::data, TPseudoTextListView::GetItemText(), GetWidget(), CPseudoItem::m_data, CPseudoItem::m_texts, ULIST_INFO::row, UStr::set(), and ULIST_INFO::title.

03570 {
03571     // sanity
03572     desc->data = 0L;
03573     desc->title = 0L;
03574
03575     void *w = GetWidget(cmd);
03576     if(w == 0L)
03577         return;
03578
03579 #if qMacAPP
03580     TView *view = (TView *)w;
03581     if(MA_MEMBER(view, TPseudoTextListView))
03582     {
03583         static UStr cstr; // no good
03584
03585         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03586         CStr255_AC name = txt->GetItemText(desc->row + 1);
03587         cstr = name;
03588         desc->title = cstr;
03589     }
03590 #endif
03591 #if qGTK
03592     if(!GTK_IS_CLIST(w))
03593         return;
03594
03595     GtkCList *list = GTK_CLIST(w);
03596     desc->data = gtk_clist_get_row_data(list, desc->row);
03597     gtk_clist_get_text_is_buggy(list, desc->row, desc->col, (gchar **)&desc->title);
03598 #endif
03599 #ifdef WIN32
03600     CWnd *wnd = (CWnd *)w;
03601
03602     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03603     {
03604         CListCtrl *list = (CListCtrl *)wnd;
03605
03606         desc->data = (void *)list->GetItemData(desc->row);
03607         static CString s;
03608         s = list->GetItemText(desc->row, desc->col);
03609         desc->title = s;
03610     }
03611 #endif
03612 #if qMacPP
03613     LPane *view = (LPane *)w;
03614     LOutlineTable *table;
03615     LTextTableView *tabtext;
03616     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03617     {
03618         LOutlineItem *item = table->FindItemForRow(desc->row + 1);
03619         CPseudoItem *theItem;
03620         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03621         {
03622             std::map<int, UStr>::iterator i = theItem->m_texts.find(desc->col + 1);
03623             if(i != theItem->m_texts.end())
03624             {
03625                 desc->title = (*i).second;
03626             }
03627             desc->data = theItem->m_data;
03628         }
03629     }
03630     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03631     {
03632         STableCell cell(desc->row + 1, desc->col + 1);
03633         UInt32 ioDataSize = 255;
03634         char tmp[255];
03635         tabtext->GetCellData(cell, tmp, ioDataSize);
03636         static UStr res;
03637         res.set(tmp, ioDataSize);
03638         desc->title = res;
03639     }
03640 #endif
03641 }

int UWidget::OnListGetNext | ( | int | cmd,
 |  | int | whichCell
 | ) | [protected]

EV_LIST_GETNEXT UWidget message handling.

Definition at line 3433 of file uwidget.cpp.

References GetWidget().

03434 {
03435     void *w = GetWidget(cmd);
03436     if(w == 0L)
03437         return -1;
03438
03439 #if qGTK
03440     if(!GTK_IS_CLIST(w))
03441         return -1;
03442
03443     if(whichCell == -1)
03444         whichCell = 0;
03445     else
03446         whichCell++;
03447
03448     if(whichCell >= GTK_CLIST(w)->rows)
03449         whichCell = -1;
03450
03451     return whichCell;
03452 #endif
03453 #ifdef WIN32
03454     CWnd *wnd = (CWnd *)w;
03455
03456     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03457     {
03458         CListCtrl *list = (CListCtrl *)wnd;
03459         return list->GetNextItem(whichCell, LVNI_ALL);
03460     }
03461 #endif
03462 #if qMacPP
03463     LPane *view = (LPane *)w;
03464     LTableView *table;
03465     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03466     {
03467         STableCell sel;
03468
03469         if(whichCell != -1)
03470         {
03471             sel.row = whichCell + 1;
03472             sel.col = 1;
03473         }
03474
03475         while(table->GetNextCell(sel))
03476         {
03477             if(sel.row != whichCell + 1)
03478                 return sel.row - 1;
03479         }
03480     }
03481 #endif
03482
03483     return -1;
03484 }

int UWidget::OnListGetNextSel | ( | int | cmd,
 |  | int | selectedCell
 | ) | [protected]

EV_LIST_GETNEXTSEL UWidget message handling.

Definition at line 3350 of file uwidget.cpp.

References GetWidget(), and gint.

03351 {
03352     void *w = GetWidget(cmd);
03353     if(w == 0L)
03354         return -1;
03355
03356 #if qGTK
03357     if(!GTK_IS_CLIST(w))
03358         return -1;
03359
03360     GList *sel = GTK_CLIST(w)->selection;
03361     if(sel == 0L)
03362         return -1;
03363
03364     while(sel != 0L)
03365     {
03366         gint row = GPOINTER_TO_INT(sel->data);
03367         if(selectedCell == -1)
03368             return row;
03369
03370         sel = (GList *)g_list_next(sel);
03371
03372         if(selectedCell == row)
03373         {
03374             return sel == 0L ? -1 : GPOINTER_TO_INT(sel->data);
03375         }
03376     }
03377 #endif
03378 #if qMacAPP
03379     TView *view = (TView *)w;
03380     if(MA_MEMBER(view, TPseudoTextListView))
03381     {
03382         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03383         if(txt->FirstSelectedItem() == 0)
03384             return -1;
03385
03386         for(GridCoordinate c = 0; c < txt->GetNumOfRows(); ++c)
03387         {
03388             if(!txt->IsItemSelected(c + 1))
03389                 continue;
03390
03391             if(selectedCell == -1)
03392                 return c;
03393
03394             if(selectedCell == c)
03395                 selectedCell = -1; // so the next pick is the one
03396         }
03397     }
03398 #endif
03399 #ifdef WIN32
03400     CWnd *wnd = (CWnd *)w;
03401
03402     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03403     {
03404         CListCtrl *list = (CListCtrl *)wnd;
03405         return list->GetNextItem(selectedCell, LVNI_SELECTED);
03406     }
03407 #endif
03408 #if qMacPP
03409     LPane *view = (LPane *)w;
03410     LTableView *table;
03411     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03412     {
03413         STableCell sel;
03414         if(selectedCell == -1)
03415         {
03416             sel = table->GetFirstSelectedCell();
03417             return sel.row - 1;
03418         }
03419
03420         sel.row = selectedCell + 1;
03421         sel.col = 1;
03422         while(table->GetNextSelectedCell(sel))
03423         {
03424             if(sel.row != selectedCell + 1)
03425                 return sel.row - 1;
03426         }
03427     }
03428 #endif
03429
03430     return -1;
03431 }

void UWidget::OnListHideColumns | ( | int | cmd,
 |  | int | num
 | ) | [protected]

EV_LIST_DELCOLUMNS UWidget message handling.

Definition at line 2906 of file uwidget.cpp.

References GetWidget().

02907 {
02908     void *w = GetWidget(cmd);
02909     if(w == 0L)
02910         return;
02911
02912 #if qGTK
02913     if(!GTK_IS_CLIST(w))
02914         return;
02915
02916     GtkCList *list = GTK_CLIST(w);
02917
02918     // one must always be visible. We use the first one
02919     for(int i=1; i< num; i++)
02920         gtk_clist_set_column_visibility (list, i, false);
02921 #endif
02922 }

void UWidget::OnListInsert | ( | int | cmd,
 |  | ULIST_INSERT * | data
 | ) | [protected]

EV_LIST_INSERT UWidget message handling.

Definition at line 3486 of file uwidget.cpp.

References ULIST_INSERT::col, GetWidget(), ULIST_INSERT::icon, TPseudoTextListView::InsStringLast(), CPseudoItem::m_texts, ULIST_INSERT::row, and ULIST_INSERT::title.

03487 {
03488     void *w = GetWidget(cmd);
03489     if(w == 0L)
03490         return;
03491
03492 #if qGTK
03493     if(!GTK_IS_CLIST(w))
03494         return;
03495
03496     GtkCList *list = GTK_CLIST(w);
03497
03498     if(data->title == 0L && data->icon == 0L)
03499         g_warning("Got an empty cell !\n");
03500     else if(data->title == 0L)
03501     {
03502         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03503         gtk_clist_set_pixmap(list, data->row, data->col, pix->pixmap, pix->mask);
03504     }
03505     else if(data->icon == 0L)
03506     {
03507         gtk_clist_set_text(list, data->row, data->col, data->title);
03508     }
03509     else
03510     {
03511         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03512         gtk_clist_set_pixtext(list, data->row, data->col, data->title, 2, pix->pixmap, pix->mask);
03513     }
03514 #endif
03515 #if qMacAPP
03516     TView *view = (TView *)w;
03517     if(MA_MEMBER(view, TPseudoTextListView))
03518     {
03519         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03520         //txt->InsStringBefore(data->row + 1, data->title);
03521         txt->InsStringLast(data->title);
03522     }
03523 #endif
03524 #ifdef WIN32
03525     CWnd *wnd = (CWnd *)w;
03526
03527     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03528     {
03529         CListCtrl *list = (CListCtrl *)wnd;
03530         if(data->col == 0)
03531         {
03532             LV_ITEM lvi;
03533             memset(&lvi, 0, sizeof(lvi));
03534             lvi.mask = LVIF_TEXT;
03535             lvi.iItem = data->row;
03536             lvi.iSubItem = 0;
03537             lvi.pszText = (char *)data->title;
03538
03539             list->InsertItem(&lvi);
03540         }
03541         else
03542         {
03543             list->SetItemText(data->row, data->col, data->title);
03544         }
03545     }
03546 #endif
03547 #if qMacPP
03548     LPane *view = (LPane *)w;
03549     LOutlineTable *table;
03550     LTextTableView *tabtext;
03551     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03552     {
03553         LOutlineItem *item = table->FindItemForRow(data->row + 1);
03554         CPseudoItem *theItem;
03555         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03556         {
03557             std::map<int, UStr>::value_type val(data->col + 1, UStr(data->title));
03558             theItem->m_texts.insert(val);
03559         }
03560     }
03561     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03562     {
03563         STableCell cell(data->row + 1, data->col + 1);
03564         tabtext->SetCellData(cell, data->title, strlen(data->title));
03565     }
03566 #endif
03567 }

void UWidget::OnListNewRow | ( | int | cmd,
 |  | int * | num
 | ) | [protected]

EV_LIST_NEWROW UWidget message handling.

Definition at line 3227 of file uwidget.cpp.

References gchar, GetWidget(), UCmdTarget::GetWidID(), and NEW.

03228 {
03229     *num = 0; // sanity
03230
03231     void *w = GetWidget(cmd);
03232     if(w == 0L)
03233         return;
03234
03235 #if qGTK
03236     if(!GTK_IS_CLIST(w))
03237         return;
03238
03239     gchar *emptyTxts[] = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
03240
03241     GtkCList *list = GTK_CLIST(w);
03242     *num = gtk_clist_append  (list, emptyTxts);
03243 #endif
03244 #if qMacAPP
03245     TView *view = (TView *)w;
03246     if(MA_MEMBER(view, TPseudoTextListView))
03247     {
03248         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03249         *num = txt->GetNumOfRows();
03250     }
03251 #endif
03252 #ifdef WIN32
03253     CWnd *wnd = (CWnd *)w;
03254
03255     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03256     {
03257         CListCtrl *list = (CListCtrl *)wnd;
03258         *num = list->GetItemCount();
03259     }
03260 #endif
03261 #if qMacPP
03262     LPane *view = (LPane *)w;
03263     LOutlineTable *table;
03264     LTextTableView *tabtext;
03265     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03266     {
03267         // Store this information in the list view
03268         CPseudoItem *theItem = NEW CPseudoItem(GetWidID(), cmd);
03269         if(theItem != 0L)
03270         {
03271             TableIndexT outRows, outCols;
03272             table->GetTableSize(outRows, outCols);
03273             // and insert it at the end of the table
03274             LOutlineItem *lastItem = table->FindItemForRow(outRows);
03275             table->InsertItem( theItem, nil, lastItem );
03276             *num = outRows;
03277         }
03278     }
03279     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03280     {
03281         TableIndexT outRows, outCols;
03282         tabtext->GetTableSize(outRows, outCols);
03283         tabtext->InsertRows(1, outRows);
03284         tabtext->AdjustImageSize(false);
03285         *num = outRows;
03286     }
03287 #endif
03288 }

void UWidget::OnListPopup | ( | int | cmd,
 |  | int | entry
 | ) | [protected]

EV_LIST_POPUP UWidget message handling.

void UWidget::OnListResetAll ( int cmd ) [protected]

EV_LIST_RESETALL UWidget message handling.

Definition at line 3062 of file uwidget.cpp.

References GetWidget(), macpp_preparetable(), TPseudoTextListView::RemoveAll(), and VERIFY.

03063 {
03064     void *w = GetWidget(cmd);
03065     if(w == 0L)
03066         return;
03067
03068 #if qGTK
03069     if(!GTK_IS_CLIST(w))
03070         return;
03071
03072     GtkCList *list = GTK_CLIST(w);
03073     gtk_clist_clear(list);
03074 #endif
03075 #if qMacAPP
03076     TView *view = (TView *)w;
03077     if(MA_MEMBER(view, TPseudoTextListView))
03078     {
03079         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03080         txt->RemoveAll();
03081     }
03082 #endif
03083 #if qMacPP
03084     LPane *view = (LPane *)w;
03085     LOutlineTable *table;
03086     LTextTableView *tabtext;
03087     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03088     {
03089         macpp_preparetable(table);
03090         LArrayIterator iter(table->GetFirstLevelItems());
03091         LOutlineItem* item;
03092         while (iter.Next(&item))
03093         {
03094             table->RemoveItem(item, false, false);
03095         }
03096         table->AdjustImageSize(false);
03097         table->Refresh();
03098     }
03099     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03100     {
03101         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
03102         tabtext->RemoveAllRows(false);
03103         tabtext->Refresh();
03104     }
03105 #endif
03106 #ifdef WIN32
03107     CWnd *wnd = (CWnd *)w;
03108
03109     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03110     {
03111         CListCtrl *list = (CListCtrl *)wnd;
03112         VERIFY(list->DeleteAllItems());
03113     }
03114 #endif
03115 }

void UWidget::OnListResort | ( | int | cmd,
 |  | int | column,
 |  | UListSorter | s
 | ) | [protected]

EV_LIST_RESORT UWidget message handling.

Definition at line 3643 of file uwidget.cpp.

References GetWidget().

03644 {
03645     void *w = GetWidget(cmd);
03646     if(w == 0L)
03647         return;
03648
03649 #if qGTK
03650     if(!GTK_IS_CLIST(w))
03651         return;
03652
03653     GtkCList *list = GTK_CLIST(w);
03654
03655     sGtkClistDiff = s;
03656     sGtkClistWid = this;
03657     gtk_clist_set_compare_func(list, gtkclistdefcompare);
03658     gtk_clist_set_sort_column(list, column);
03659     gtk_clist_sort(list);
03660     gtk_clist_set_compare_func(list, 0L);
03661 #endif
03662 }

void UWidget::OnListRowGetData | ( | int | cmd,
 |  | int | row,
 |  | void ** | data
 | ) | [protected]

EV_LIST_ROWGETDATA UWidget message handling.

Definition at line 3319 of file uwidget.cpp.

References GetWidget(), and CPseudoItem::m_data.

03320 {
03321     *data = 0L; // sanity
03322
03323     void *w = GetWidget(cmd);
03324     if(w == 0L)
03325         return;
03326
03327 #if qGTK
03328     if(!GTK_IS_CLIST(w))
03329         return;
03330
03331     GtkCList *list = GTK_CLIST(w);
03332     *data = gtk_clist_get_row_data(list, row);
03333 #endif
03334 #if qMacPP
03335     LPane *view = (LPane *)w;
03336     LOutlineTable *table;
03337     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03338     {
03339         // Store this information in the list view
03340         LOutlineItem *item = table->FindItemForRow(row + 1);
03341         CPseudoItem *theItem;
03342         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03343         {
03344             *data = theItem->m_data;
03345         }
03346     }
03347 #endif
03348 }

void UWidget::OnListRowSetData | ( | int | cmd,
 |  | int | row,
 |  | void * | data
 | ) | [protected]

EV_LIST_ROWSETDATA UWidget message handling.

Definition at line 3290 of file uwidget.cpp.

References GetWidget(), and CPseudoItem::m_data.

03291 {
03292     void *w = GetWidget(cmd);
03293     if(w == 0L)
03294         return;
03295
03296 #if qGTK
03297     if(!GTK_IS_CLIST(w))
03298         return;
03299
03300     GtkCList *list = GTK_CLIST(w);
03301     gtk_clist_set_row_data(list, num, data);
03302 #endif
03303 #if qMacPP
03304     LPane *view = (LPane *)w;
03305     LOutlineTable *table;
03306     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03307     {
03308         // Store this information in the list view
03309         LOutlineItem *item = table->FindItemForRow(num + 1);
03310         CPseudoItem *theItem;
03311         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03312         {
03313             theItem->m_data = data;
03314         }
03315     }
03316 #endif
03317 }

void UWidget::OnListSetColTitle | ( | int | cmd,
 |  | int | num,
 |  | const char * | title
 | ) | [protected]

EV_LIST_SETCOLTITLE UWidget message handling.

Definition at line 2987 of file uwidget.cpp.

References GetWidget(), and VERIFY.

02988 {
02989     void *w = GetWidget(cmd);
02990     if(w == 0L)
02991         return;
02992
02993 #if qGTK
02994     if(!GTK_IS_CLIST(w))
02995         return;
02996
02997     GtkCList *list = GTK_CLIST(w);
02998     gtk_clist_set_column_title (list, num, title);
02999 #endif
03000 #ifdef WIN32
03001     CWnd *wnd = (CWnd *)w;
03002
03003     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03004     {
03005         CListCtrl *list = (CListCtrl *)wnd;
03006         LVCOLUMN col;
03007         memset(&col, 0, sizeof(col));
03008         col.mask = LVCF_TEXT;
03009         col.pszText = (char *)title;
03010         VERIFY(list->SetColumn(num, &col));
03011     }
03012 #endif
03013 }

void UWidget::OnListSetColWidth | ( | int | cmd,
 |  | int | num,
 |  | int | width
 | ) | [protected]

EV_LIST_SETCOLWIDTH UWidget message handling.

Definition at line 3015 of file uwidget.cpp.

References GetWidget(), macpp_preparetable(), and VERIFY.

03016 {
03017     void *w = GetWidget(cmd);
03018     if(w == 0L)
03019         return;
03020
03021 #if qGTK
03022     if(!GTK_IS_CLIST(w))
03023         return;
03024
03025     GtkCList *list = GTK_CLIST(w);
03026     gtk_clist_set_column_width(list, num, width);
03027 #endif
03028 #ifdef WIN32
03029     CWnd *wnd = (CWnd *)w;
03030
03031     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03032     {
03033         CListCtrl *list = (CListCtrl *)wnd;
03034         LVCOLUMN col;
03035         memset(&col, 0, sizeof(col));
03036         col.mask = LVCF_WIDTH;
03037         col.cx = width;
03038         VERIFY(list->SetColumn(num, &col));
03039     }
03040 #endif
03041 #if qMacPP
03042     LPane *view = (LPane *)w;
03043     LOutlineTable *table;
03044     LTextTableView *tabtext;
03045     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03046     {
03047         macpp_preparetable(table);
03048         LTableGeometry *geom = table->GetTableGeometry();
03049         if(geom != 0L)
03050             geom->SetColWidth(width, num + 1, num + 1);
03051     }
03052     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03053     {
03054         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
03055         LTableGeometry *geom = tabtext->GetTableGeometry();
03056         if(geom != 0L)
03057             geom->SetColWidth(width, num + 1, num + 1);
03058     }
03059 #endif
03060 }

void UWidget::OnListSetFeedback | ( | int | cmd,
 |  | int | turnOn
 | ) | [protected]

EV_LIST_SETFEEDBACK UWidget message handling.

Definition at line 3209 of file uwidget.cpp.

References GetWidget().

03210 {
03211     void *w = GetWidget(cmd);
03212     if(w == 0L)
03213         return;
03214
03215 #if qGTK
03216     if(!GTK_IS_CLIST(w))
03217         return;
03218
03219     GtkCList *list = GTK_CLIST(w);
03220     if(turnOn)
03221         gtk_clist_thaw(list);
03222     else
03223         gtk_clist_freeze(list);
03224 #endif
03225 }

void UWidget::OnListSetSortDir | ( | int | cmd,
 |  | int | column,
 |  | bool | dir
 | ) | [protected]

ON_LIST_SETSORTDIR UWidget message handling.

Definition at line 3664 of file uwidget.cpp.

References gchar, GetWidget(), and guint8.

03665 {
03666     void *w = GetWidget(cmd);
03667     if(w == 0L)
03668         return;
03669
03670 #if qGTK
03671     if(!GTK_IS_CLIST(w))
03672         return;
03673
03674     GtkCList *list = GTK_CLIST(w);
03675     gchar *text;
03676     guint8 spacing;
03677     GdkPixmap *pixmap;
03678     GdkBitmap *mask;
03679
03680     gtk_clist_get_pixtext (list, 0, column, &text, &spacing, &pixmap, &mask);
03681     gtk_clist_set_pixtext (list, 0, column, text, spacing, pixmap, mask);
03682 #endif
03683 }

void UWidget::OnListShowColumns | ( | int | cmd,
 |  | int | num
 | ) | [protected]

EV_LIST_SHOWCOLUMNS UWidget message handling.

Definition at line 2924 of file uwidget.cpp.

References GetWidget().

02925 {
02926     void *w = GetWidget(cmd);
02927     if(w == 0L)
02928         return;
02929
02930 #if qGTK
02931     if(!GTK_IS_CLIST(w))
02932         return;
02933
02934     GtkCList *list = GTK_CLIST(w);
02935
02936     // one must always be visible. We use the first one
02937     for(int i=1; i< num; i++)
02938         gtk_clist_set_column_visibility (list, i, true);
02939 #endif
02940 }

void UWidget::OnPageChanged | ( | int | cmd,
 |  | int | pagenum
 | ) | [protected]

EV_PAGE UWidget message handling.

Definition at line 3761 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.

03762 {
03763     if(m_currentPage == UMAKEINT(cmdid, num_page))
03764         return;
03765
03766     std::map<int, UWidget *>::iterator i;
03767     if(m_currentPage != -1)
03768     {
03769         i = m_tabs.find(m_currentPage);
03770         if(i != m_tabs.end())
03771         {
03772             UWidget *tab = (*i).second;
03773             tab->DoDataExchange(false);
03774
03775 #if qMacPP
03776             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03777             if(attach != 0L)
03778             {
03779                 attach->InvalidCache(tab);
03780             }
03781
03782             tab->m_widgets.erase(tab->m_widgets.begin(), tab->m_widgets.end());
03783 #endif /* qMacPP */
03784         }
03785     }
03786
03787     if(num_page == -1)
03788     {
03789         m_currentPage = -1;
03790         return;
03791     }
03792
03793     i = m_tabs.find(UMAKEINT(cmdid, num_page));
03794     if(i != m_tabs.end())
03795     {
03796         UWidget *tab = (*i).second;
03797
03798 #if qMacPP
03799         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder *>((LPane *)GetWidget(cmdid));
03800         if(holder != 0L)
03801         {
03802             macpp_fecthview(tab->GetWidID(), holder->GetCurrentView());
03803
03804             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03805             if(attach != 0L)
03806             {
03807                 macpp_linkbroadcasters(holder->GetCurrentView(), attach);
03808             }
03809         }
03810 #endif /* qMacPP */
03811
03812         tab->DoDataExchange(true);
03813     }
03814     m_currentPage = UMAKEINT(cmdid, num_page);
03815 }

void UWidget::OnRedraw ( int cmd ) [protected]

EV_REDRAW UWidget message handling

  • cmd the sub-widget to redraw *now*.

Definition at line 1593 of file uwidget.cpp.

References GetWidget().

01594 {
01595     void *w = GetWidget(cmd);
01596     if(w == 0L)
01597         return;
01598
01599 #if qMacAPP
01600     TView *view = (TView *)w;
01601     if(MA_MEMBER(view, TView))
01602     {
01603         view->ForceRedraw();
01604     }
01605 #endif
01606 #if qMacPP
01607     LPane *pane = (LPane *)w;
01608     pane->Draw(nil);
01609 #endif
01610 #ifdef WIN32
01611     CWnd *wnd = (CWnd *)w;
01612
01613     wnd->Invalidate();
01614 #endif
01615 }

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 1460 of file uwidget.cpp.

References GetWidget(), TPseudoDoubleNumberText::SetValue(), and stat.

01461 {
01462     void *w = GetWidget(cmd);
01463     if(w == 0L)
01464         return;
01465
01466 #if qMacAPP
01467     TView *view = (TView *)w;
01468     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01469     {
01470         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01471         num->SetValue(*f, true);
01472     }
01473 #endif
01474 #if qMacPP
01475     USemaphore policeman(gTurnOffBroadcast);
01476
01477     LPane *view = (LPane *)w;
01478     LEditText *edit;
01479     LStaticText *stat;
01480     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01481     {
01482         LStr255 pstr((long double)*f, "\p#####.##");
01483         edit->SetText(pstr);
01484     }
01485     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01486     {
01487         LStr255 pstr((long double)*f, "\p#####.##");
01488         stat->SetText(pstr);
01489     }
01490 #endif
01491 #ifdef WIN32
01492     USemaphore policeman(m_noDispatch);
01493     CWnd *wnd = (CWnd *)w;
01494
01495     char tmp[100];
01496     sprintf(tmp, "%f", *f);
01497     wnd->SetWindowText(tmp);
01498 #endif
01499 }

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 898 of file uwidget.cpp.

References URECT::bottom, GetWidget(), URect::Height(), URECT::left, URECT::right, URECT::top, URect::TopLeft(), URect::Width(), UPOINT::x, and UPOINT::y.

00899 {
00900     void *w = GetWidget(cmd);
00901     if(w == 0L)
00902         return;
00903
00904 #if qMacAPP
00905     TView *view = (TView *)w;
00906     CViewRect mr(r->left, r->top, r->right, r->bottom);
00907     if(mr.right < mr.left)
00908         mr.right = mr.left;
00909     if(mr.bottom < mr.top)
00910         mr.bottom = mr.top;
00911     view->RootViewToLocal(mr);
00912     view->LocalToSuperView(mr);
00913     view->SetFrame(mr, true);
00914 #endif
00915 #if qMacPP
00916     LPane *view = (LPane *)w;
00917     SPoint32 oldLocation;
00918     view->GetFrameLocation(oldLocation);
00919     URect newDim(*r);
00920     UPoint offset = newDim.TopLeft() - UPoint(oldLocation.h, oldLocation.v);
00921     view->ResizeFrameTo(newDim.Width(), newDim.Height(), true);
00922     view->MoveBy(offset.x, offset.y, true);
00923 #endif
00924 #ifdef WIN32
00925     CRect wr(r->left, r->top, r->right, r->bottom);
00926     CWnd *wnd = (CWnd *)w;
00927     wnd->MoveWindow(wr, TRUE);
00928 #endif
00929 }

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 1835 of file uwidget.cpp.

References GetWidget().

01836 {
01837     void *w = GetWidget(cmd);
01838     if(w == 0L)
01839         return;
01840
01841 #ifdef WIN32
01842     CWnd *wnd = (CWnd *)w;
01843
01844     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01845     {
01846         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01847         slider->SetPos(pos);
01848     }
01849     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01850     {
01851         CScrollBar *scroll = (CScrollBar *)wnd;
01852         scroll->SetScrollPos(pos);
01853     }
01854 #endif
01855 #if qMacAPP
01856     TView *view = (TView *)w;
01857     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01858     {
01859         TCtlMgr *ctrl = (TCtlMgr *)view;
01860         ctrl->SetValue(pos, true);
01861     }
01862 #endif
01863 #if qMacPP
01864     USemaphore policeman(gTurnOffBroadcast);
01865
01866     LPane *view = (LPane *)w;
01867     LControl *ctrl;
01868     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01869     {
01870         ctrl->SetValue(pos);
01871     }
01872 #endif
01873 }

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 1932 of file uwidget.cpp.

References GetWidget(), USLIDER::inc, macpp_getattachwindow(), USLIDER::max, USLIDER::min, USLIDER::pos, LPseudoWinAttachment::SetPageValue(), and VERIFY.

01933 {
01934     void *w = GetWidget(cmd);
01935     if(w == 0L)
01936         return;
01937
01938 #ifdef WIN32
01939     CWnd *wnd = (CWnd *)w;
01940
01941     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01942     {
01943         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01944         slider->SetRange(prop->min, prop->max);
01945         slider->SetPos(prop->pos);
01946         slider->SetPageSize(prop->inc);
01947     }
01948     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01949     {
01950         SCROLLINFO info;
01951         memset(&info, 0, sizeof(info));
01952         info.cbSize = sizeof(info);
01953         info.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_POS | SIF_RANGE;
01954         info.nMax = prop->max;
01955         info.nMin = prop->min;
01956         info.nPos = prop->pos;
01957         info.nPage = prop->inc;
01958         if(info.nPage > (UINT)(info.nMax - info.nMin))
01959             info.nPage = (UINT)(info.nMax - info.nMin) / 2;
01960         CScrollBar *scroll = (CScrollBar *)wnd;
01961         VERIFY(scroll->SetScrollInfo(&info));
01962         if(prop->max != prop->min)
01963             scroll->EnableWindow(TRUE);
01964     }
01965 #endif
01966 #if qMacAPP
01967     TView *view = (TView *)w;
01968     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01969     {
01970         TCtlMgr *ctrl = (TCtlMgr *)view;
01971         ctrl->SetValues(prop->pos, prop->min, prop->max, true);
01972         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01973             ((TPseudoScrollBar *)ctrl)->fPageStep = prop->inc;
01974     }
01975 #endif
01976 #if qMacPP
01977     USemaphore policeman(gTurnOffBroadcast);
01978
01979     LPane *view = (LPane *)w;
01980     LControl *ctrl;
01981     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01982     {
01983         ctrl->SetMaxValue(prop->max);
01984         ctrl->SetMinValue(prop->min);
01985         ctrl->SetValue(prop->pos);
01986         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01987         if(attach != 0L)
01988             attach->SetPageValue(cmd, prop->inc);
01989     }
01990 #endif
01991 }

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 1334 of file uwidget.cpp.

References TPseudoRotateIconButton::DoRotate(), UPseudoRotButton::DoRotate(), CPseudoRotButton::DoRotate(), GetWidget(), CPseudoToggle::SetState(), and stat.

01335 {
01336     void *w = GetWidget(cmd);
01337     if(w == 0L)
01338         return;
01339
01340 #ifdef WIN32
01341     CWnd *wnd = (CWnd *)w;
01342
01343     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01344     {
01345         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01346         btn->DoRotate(state);
01347     }
01348     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01349     {
01350         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01351         btn->SetState(state);
01352     }
01353     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01354     {
01355         CButton *btn = (CButton *)wnd;
01356         btn->SetCheck(state != 0);
01357     }
01358     else
01359     {
01360         USemaphore policeman(m_noDispatch);
01361         char tmp[100];
01362         sprintf(tmp, "%d", state);
01363         wnd->SetWindowText(tmp);
01364     }
01365 #endif
01366 #if qGTK
01367     if(GTK_IS_TOGGLE_BUTTON(w))
01368     {
01369         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), state != 0);
01370     }
01371     else if(GTK_IS_ENTRY(w))
01372     {
01373         char tmp[20];
01374         sprintf(tmp, "%d", state);
01375         gtk_entry_set_text(GTK_ENTRY(w), tmp);
01376     }
01377 #endif
01378 #if qMacPP
01379     USemaphore policeman(gTurnOffBroadcast);
01380
01381     LPane *view = (LPane *)w;
01382     LCheckBox *check;
01383     LRadioButton *rad;
01384     LEditText *edit;
01385     LStaticText *stat;
01386     UPseudoRotButton *rot;
01387     LCheckBoxGroupBox *groupbox;
01388     LPageController *tabctrl;
01389     LTabsControl *tabctrl2;
01390     LControl *ctrl;
01391     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01392     {
01393         check->SetValue(state ? Button_On : Button_Off);
01394     }
01395     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01396     {
01397         rad->SetValue(state ? Button_On : Button_Off);
01398     }
01399     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01400     {
01401         groupbox->SetValue(state ? Button_On : Button_Off);
01402     }
01403     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01404     {
01405         LStr255 pstr((SInt32)state);
01406         edit->SetText(pstr);
01407     }
01408     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01409     {
01410         LStr255 pstr((SInt32)state);
01411         stat->SetText(pstr);
01412     }
01413     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01414     {
01415         rot->DoRotate(state);
01416     }
01417     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01418     {
01419         tabctrl->SetSelectedPageButtonByIndex(state + 1, false);
01420     }
01421     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01422     {
01423         tabctrl2->SetValue(state + 1);
01424     }
01425     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01426     {
01427         ctrl->SetValue(state);
01428     }
01429 #endif
01430 #if qMacAPP
01431     TView *view = (TView *)w;
01432     if(MA_MEMBER(view, TCheckBox))
01433     {
01434         TCheckBox *check = (TCheckBox *)view;
01435         check->SetState(state, true);
01436     }
01437     else if(MA_MEMBER(view, TRadio))
01438     {
01439         TRadio *rad = (TRadio *)view;
01440         rad->SetState(state, true);
01441     }
01442     else if(MA_MEMBER(view, TNumberText))
01443     {
01444         TNumberText *num = (TNumberText *)view;
01445         num->SetValue(state, true);
01446     }
01447     else if(MA_MEMBER(view, TPseudoRotateIconButton))
01448     {
01449         TPseudoRotateIconButton *rot = (TPseudoRotateIconButton *)view;
01450         rot->DoRotate(state);
01451     }
01452     else if(MA_MEMBER(view, TProgressIndicator))
01453     {
01454         TProgressIndicator *progress = (TProgressIndicator *)view;
01455         progress->SetValue(state, true);
01456     }
01457 #endif
01458 }

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 1617 of file uwidget.cpp.

References getLabelFromContainer(), and GetWidget().

01618 {
01619     void *w = GetWidget(cmd);
01620     if(w == 0L)
01621         return;
01622
01623 #ifdef WIN32
01624     USemaphore policeman(m_noDispatch);
01625     CWnd *wnd = (CWnd *)w;
01626     wnd->SetWindowText(text);
01627 #endif
01628 #if qGTK
01629     if(GTK_IS_WINDOW(w))
01630     {
01631         gtk_window_set_title(GTK_WINDOW(w), text);
01632     }
01633     else if(GTK_IS_BUTTON(w))
01634     {
01635         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01636         if(label != 0L)
01637             gtk_label_set_text(label, text);
01638         else
01639             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01640     }
01641     else if(GTK_IS_TEXT(w))
01642     {
01643         GtkText *t = GTK_TEXT(w);
01644         gtk_text_set_point(t, 0);
01645         gtk_text_forward_delete(t, gtk_text_get_length(t));
01646         gtk_text_insert(t, 0L, 0L, 0L, text, -1);
01647     }
01648     else if(GTK_IS_ENTRY(w))
01649     {
01650         gtk_entry_set_text(GTK_ENTRY(w), text);
01651     }
01652     else if(GTK_IS_COMBO(w))
01653     {
01654         gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry), text);
01655     }
01656     else if(GTK_IS_LABEL(w))
01657     {
01658         GtkLabel *t = GTK_LABEL(w);
01659         gtk_label_set_text(t, text);
01660     }
01661 #endif
01662 #if qMacPP
01663     USemaphore policeman(gTurnOffBroadcast);
01664
01665     LPane *view = (LPane *)w;
01666     LTextEditView *txt;
01667     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01668     {
01669         txt->SetTextPtr((Ptr)text, strlen(text));
01670     }
01671     else
01672     {
01673         LStr255 pstr(text);
01674         LStr255 oldstr;
01675         view->GetDescriptor(oldstr);
01676         if(oldstr != pstr)
01677             view->SetDescriptor(pstr);
01678     }
01679 #endif
01680 #if qMacAPP
01681     TView *view = (TView *)w;
01682     if(MA_MEMBER(view, TCtlMgr))
01683     {
01684         TCtlMgr *ctrl = (TCtlMgr *)view;
01685         CStr255_AC pstr(text);
01686         ctrl->SetText(pstr, true);
01687     }
01688     else if(MA_MEMBER(view, TStaticText))
01689     {
01690         TStaticText *ctrl = (TStaticText *)view;
01691         CStr255_AC pstr(text);
01692         ctrl->SetText(pstr, true);
01693     }
01694     else if(MA_MEMBER(view, TWindow))
01695     {
01696         TWindow *ctrl = (TWindow *)view;
01697         CStr255_AC pstr(text);
01698         ctrl->SetTitle(pstr);
01699     }
01700 #endif
01701 }

void UWidget::OnSetTooltip | ( | int | cmd,
 |  | UCmdUI * | pCmdUI
 | ) | [protected]

EV_USETTOOLTIP message handling.

Warning:
not documented

Reimplemented in UToolbar.

Definition at line 931 of file uwidget.cpp.

References GetTooltip(), and UCmdUI::SetTooltip().

00932 {
00933     const char *tooltip = GetTooltip(cmd);
00934     if(tooltip == 0L)
00935         return;
00936
00937     pCmdUI->SetTooltip(tooltip);
00938 }

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 1803 of file uwidget.cpp.

References GetWidget().

01804 {
01805     void *w = GetWidget(cmd);
01806     if(w == 0L)
01807         return;
01808
01809 #ifdef WIN32
01810     CWnd *wnd = (CWnd *)w;
01811
01812     wnd->ShowWindow(state ? SW_SHOWNORMAL : SW_HIDE);
01813 #endif
01814 #if qGTK
01815     GtkWidget *wid = (GtkWidget *)w;
01816     if(state)
01817         gtk_widget_show(wid);
01818     else
01819         gtk_widget_hide(wid);
01820 #endif
01821 #if qMacAPP
01822     TView *view = (TView *)w;
01823     view->Show(state != 0, true);
01824 #endif
01825 #if qMacPP
01826     LPane *view = (LPane *)w;
01827     if(state)
01828         view->Show();
01829     else
01830         view->Hide();
01831 #endif
01832 }

void UWidget::OnSmartComboSetFeature | ( | int | cmd,
 |  | int | feature
 | ) | [protected]

EV_SMARTCOMBO_SETFEATURE UWidget message handling.

Definition at line 2849 of file uwidget.cpp.

References GetWidget().

02850 {
02851     void *w = GetWidget(cmd);
02852     if( w == 0L )
02853         return;
02854
02855 #ifdef WIN32
02856     CWnd* wnd = (CWnd*)w;
02857
02858     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02859     {
02860         CComboBox* combo = (CComboBox*)wnd;
02861         combo->SendMessage(WM_SMCB_SETFEATURE, WPARAM(feature));
02862     }
02863 #endif
02864 #if qMacPP
02865 #endif
02866 }

void UWidget::OnSmartComboSetItems | ( | int | cmd,
 |  | CMString * | items
 | ) | [protected]

EV_SMARTCOMBO_SETITEMS UWidget message handling.

Definition at line 2868 of file uwidget.cpp.

References GetWidget().

02869 {
02870     void *w = GetWidget(cmd);
02871     if( w == 0L )
02872         return;
02873
02874 #ifdef WIN32
02875     CWnd* wnd = (CWnd*)w;
02876
02877     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02878     {
02879         CComboBox* combo = (CComboBox*)wnd;
02880         combo->SendMessage(WM_SMCB_SETITEMS, WPARAM(items));
02881     }
02882 #endif
02883 #if qMacPP
02884 #endif
02885 }

void UWidget::OnSmartComboSetReadOnly | ( | int | cmd,
 |  | bool | readOnly
 | ) | [protected]

EV_SMARTCOMBO_SETREADONLY UWidget message handling.

Definition at line 2887 of file uwidget.cpp.

References GetWidget().

02888 {
02889     void *w = GetWidget(cmd);
02890     if( w == 0L )
02891         return;
02892
02893 #ifdef WIN32
02894     CWnd* wnd = (CWnd*)w;
02895
02896     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02897     {
02898         CComboBox* combo = (CComboBox*)wnd;
02899         combo->SendMessage(WM_SMCB_SETREADONLY, WPARAM(readOnly));
02900     }
02901 #endif
02902 #if qMacPP
02903 #endif
02904 }

void UWidget::OnTreeDelete | ( | int | cmd,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_DELETE UWidget message handling.

Definition at line 2406 of file uwidget.cpp.

References GetWidget().

02407 {
02408     // sanity
02409     void *w = GetWidget(cmd);
02410     if(w == 0L)
02411         return;
02412
02413 #if qGTK
02414     if(!GTK_IS_TREE(w) || item == 0L)
02415         return;
02416
02417     GtkTreeItem *i = GTK_TREE_ITEM(item);
02418
02419     GtkTree *parent = GTK_TREE(GTK_WIDGET(i)->parent);
02420     if (parent == 0L)
02421         return;
02422
02423     gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(i));
02424 #endif
02425 }

void UWidget::OnTreeExpand | ( | int | cmd,
 |  | int | collapse,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_EXPAND UWidget message handling.

Definition at line 2427 of file uwidget.cpp.

References GetWidget().

02428 {
02429     // sanity
02430     void *w = GetWidget(cmd);
02431     if(w == 0L)
02432         return;
02433
02434 #if qGTK
02435   if(!GTK_IS_TREE(w) || item == 0L)
02436         return;
02437
02438   GtkTreeItem *i = GTK_TREE_ITEM(item);
02439
02440   gtktreesort(GTK_TREE(i->subtree));
02441
02442     int collapsed = !i->expanded;
02443     if((collapsed != 0) ^ (collapse != 0))
02444     {
02445         if(!collapse)
02446             gtk_tree_item_expand(i);
02447         else
02448             gtk_tree_item_collapse(i);
02449     }
02450 #endif
02451 }

void UWidget::OnTreeGetInfo | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_GETINFO UWidget message handling.

Definition at line 2349 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.

02350 {
02351     // sanity
02352     desc->parent = 0L;
02353     desc->next = 0L;
02354     desc->child = 0L;
02355     desc->data = 0L;
02356     desc->title = 0L;
02357     desc->icon = 0L;
02358     desc->expanded = 0;
02359
02360     void *w = GetWidget(cmd);
02361     if(w == 0L)
02362         return;
02363
02364 #if qGTK
02365     if(!GTK_IS_TREE(w))
02366         return;
02367
02368     GtkTreeItem *item;
02369     if(desc->item == 0L)
02370     {
02371         GList *list = g_list_first(GTK_TREE(w)->children);
02372         GList *next = g_list_next(list);
02373         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02374         desc->item = item;
02375         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02376     }
02377     else
02378     {
02379         GtkTree *parent = GTK_TREE(GTK_WIDGET(desc->item)->parent);
02380         GList *list = g_list_find(GTK_TREE(parent)->children, desc->item);
02381         GList *next = g_list_next(list);
02382         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02383         desc->item = item;
02384         // the only way I found to guess the TREE_ITEM parent
02385         desc->parent = parent == w ? 0L : GTK_TREE_ITEM(gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent"));
02386         g_assert(desc->parent == 0L || GTK_IS_TREE_ITEM(desc->parent));
02387         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02388     }
02389     if(item != 0L)
02390     {
02391         if(item->subtree != 0L)
02392         {
02393             GtkTree *subtree = GTK_TREE(item->subtree);
02394             GList *list = g_list_first(GTK_TREE(subtree)->children);
02395             desc->child = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02396         }
02397         desc->data = gtk_object_get_data(GTK_OBJECT(item), "rf_treeitemdata");
02398         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
02399         if(label != 0L)
02400             gtk_label_get(label, &desc->title);
02401         desc->expanded = item->expanded;
02402     }
02403 #endif
02404 }

void UWidget::OnTreeGetSel | ( | int | cmd,
 |  | UTREEITEM * | item
 | ) | [protected]

EV_TREE_GETSEL UWidget message handling.

Definition at line 2329 of file uwidget.cpp.

References GetWidget().

02330 {
02331     *item = 0L; // sanity
02332
02333     void *w = GetWidget(cmd);
02334     if(w == 0L)
02335         return;
02336
02337 #if qGTK
02338     if(!GTK_IS_TREE(w))
02339         return;
02340
02341     GList *sel = GTK_TREE(w)->selection;
02342     if(sel == 0L || !GTK_IS_TREE_ITEM(sel->data))
02343         return;
02344
02345     *item = sel->data;
02346 #endif
02347 }

void UWidget::OnTreeInsert | ( | int | cmd,
 |  | UTREE_INSERT * | data
 | ) | [protected]

EV_TREE_INSERT UWidget message handling.

Definition at line 2251 of file uwidget.cpp.

References UTREE_INSERT::data, GetWidget(), UCmdTarget::GetWidID(), UTREE_INSERT::icon, UTREE_INSERT::parent, UTREE_INSERT::result, UTREE_INSERT::title, and UMAKEINT.

02252 {
02253     data->result = 0L; // sanity
02254
02255     void *w = GetWidget(cmd);
02256     if(w == 0L)
02257         return;
02258
02259 #if qGTK
02260   if(!GTK_IS_TREE(w))
02261         return;
02262
02263     GtkTree *root;
02264     if(data->parent == 0L)
02265         root = GTK_TREE(w);
02266     else
02267     {
02268         GtkTreeItem *item = GTK_TREE_ITEM(data->parent);
02269
02270         if(item->subtree != 0L) {
02271             root = GTK_TREE(item->subtree);
02272         }
02273         else
02274         {
02275             root = GTK_TREE(gtk_tree_new());
02276             gtk_object_set_data(GTK_OBJECT(root), "rf_treeparent", item);
02277             gtk_tree_set_selection_mode (root, GTK_SELECTION_BROWSE); // TODO : find out it with the root
02278             gtk_tree_set_view_mode (root, GTK_TREE_VIEW_ITEM); // TODO : find out it with the root
02279             gtk_tree_item_set_subtree (item, GTK_WIDGET(root));
02280         }
02281     }
02282
02283   GtkTreeItem *item = gtknewtreeitem(data->title, data->icon == 0L ? 0L : GTK_PIXMAP(data->icon));
02284     gtk_object_set_data(GTK_OBJECT(item), "rf_treeitemdata", data->data);
02285     gtk_signal_connect(GTK_OBJECT(item), "select",
02286                        GTK_SIGNAL_FUNC(gtktreeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02287     gtk_signal_connect(GTK_OBJECT(item), "deselect",
02288                        GTK_SIGNAL_FUNC(gtktreedeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02289     gtk_signal_connect (GTK_OBJECT(item), "expand",
02290                         GTK_SIGNAL_FUNC(gtktreeexpand), (gpointer)UMAKEINT(GetWidID(), cmd));
02291     gtk_signal_connect (GTK_OBJECT(item), "collapse",
02292                         GTK_SIGNAL_FUNC(gtktreecollapse), (gpointer)UMAKEINT(GetWidID(), cmd));
02293
02294     gtk_tree_append(GTK_TREE(root), GTK_WIDGET(item));
02295   gtk_widget_show (GTK_WIDGET(item));
02296
02297     data->result = (UTREEITEM)item;
02298 #endif
02299 }

void UWidget::OnTreeResetAll ( int cmd ) [protected]

EV_TREE_RESETALL UWidget message handling.

Definition at line 2228 of file uwidget.cpp.

References GetWidget().

02229 {
02230     void *w = GetWidget(cmd);
02231     if(w == 0L)
02232         return;
02233
02234 #if qGTK
02235     if(!GTK_IS_TREE(w))
02236         return;
02237
02238     GtkTree *tree = GTK_TREE(w);
02239     GList *list = g_list_copy(tree->children);
02240     GList *head = list;
02241     while(list != 0L)
02242     {
02243         GtkWidget *wid = GTK_WIDGET(list->data);
02244         gtk_container_remove(GTK_CONTAINER(tree), wid);
02245         list = (GList *)g_list_next(list);
02246     }
02247     g_list_free(head);
02248 #endif
02249 }

void UWidget::OnTreeSelect | ( | int | cmd,
 |  | int | deselect,
 |  | UTREEITEM | item
 | ) | [protected]

EV_TREE_SELECT UWidget message handling.

Definition at line 2453 of file uwidget.cpp.

References GetWidget().

02454 {
02455     // sanity
02456     void *w = GetWidget(cmd);
02457     if(w == 0L)
02458         return;
02459
02460 #if qGTK
02461     if(!GTK_IS_TREE(w) || item == 0L)
02462         return;
02463
02464     GList *sel = GTK_TREE(w)->selection;
02465     while(sel)
02466     {
02467         gtk_tree_item_deselect(GTK_TREE_ITEM(sel->data));
02468         sel = g_list_next(sel);
02469     }
02470
02471     GtkWidget *i = GTK_WIDGET(item);
02472     if(!deselect)
02473         gtk_tree_select_child(GTK_TREE(w), i);
02474     else
02475         gtk_tree_unselect_child(GTK_TREE(w), i);
02476 #endif
02477 }

void UWidget::OnTreeSetData | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_SETDATA UWidget message handling.

Definition at line 2301 of file uwidget.cpp.

References UTREE_INFO::data, GetWidget(), and UTREE_INFO::item.

02302 {
02303     void *w = GetWidget(cmd);
02304     if(w == 0L)
02305         return;
02306
02307 #if qGTK
02308     if(!GTK_IS_TREE(w))
02309         return;
02310
02311     gtk_object_set_data(GTK_OBJECT(data->item), "rf_treeitemdata", data->data);
02312 #endif
02313 }

void UWidget::OnTreeSetIcon | ( | int | cmd,
 |  | UTREE_INFO * | data
 | ) | [protected]

EV_TREE_SETICON UWidget message handling.

Definition at line 2315 of file uwidget.cpp.

References GetWidget(), UTREE_INFO::icon, and UTREE_INFO::item.

02316 {
02317     void *w = GetWidget(cmd);
02318     if(w == 0L)
02319         return;
02320
02321 #if qGTK
02322     if(!GTK_IS_TREE(w))
02323         return;
02324
02325     gtksettreeitemicon(GTK_TREE_ITEM(data->item), GTK_PIXMAP(data->icon));
02326 #endif
02327 }

void UWidget::OnUnblockHandler | ( | void * | widget,
 |  | int | cmd,
 |  | int | event
 | ) |

unblocks a eventhandler

Definition at line 1158 of file uwidget.cpp.

References UCmdTarget::GetWidID(), and UMAKEINT.

Referenced by UCvsGraph::OnDrawing().

01159 {
01160 #ifdef qGTK
01161     if(event == GDK_EXPOSE) {
01162         gtk_signal_handler_unblock_by_func( GTK_OBJECT(widget),
01163                                             GTK_SIGNAL_FUNC (gtkexposeevent),
01164                                             (gpointer)UMAKEINT(GetWidID(), cmd));
01165     }
01166 #endif
01167 }

int UWidget::OnUpdateFocus | ( | int | leave,
 |  | void * | widget
 | ) | [protected]

EV_UPDATEFOCUS UWidget message handling.

Definition at line 3685 of file uwidget.cpp.

References UCmdTarget::GetWidID(), m_widgets, sFocusCmdID, and sFocusWidID.

03686 {
03687     std::map<int, void *>::const_iterator i;
03688
03689     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03690     {
03691         if((*i).second == widget)
03692             break;
03693     }
03694     if(i == m_widgets.end())
03695         return 0; // continue notification
03696
03697     if(leave)
03698     {
03699         if(sFocusWidID == GetWidID())
03700             sFocusWidID = -1;
03701     }
03702     else
03703     {
03704         sFocusWidID = GetWidID();
03705         sFocusCmdID = (*i).first;
03706     }
03707
03708     return 1; // stop notification
03709 }

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, UMenu, and UToolbar.

Definition at line 2028 of file uwidget.cpp.

References UCmdTarget::GetWidID(), UCmdUI::m_nID, UCmdUI::m_widget, m_widgets, and UEventSendMessage().

02029 {
02030     std::map<int, void *>::const_iterator i;
02031     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
02032     {
02033         UCmdUI pUI((*i).first);
02034         pUI.m_widget = (*i).second;
02035         UEventSendMessage(GetWidID(), EV_UPDTCMD, pUI.m_nID, &pUI);
02036     }
02037 }

void UWidget::OverideMapWidget | ( | int | cmdid,
 |  | CRuntimeClass * | widClass
 | ) |

Definition at line 3818 of file uwidget.cpp.

References m_overide.

03819 {
03820     std::map<int, CRuntimeClass *>::value_type val(cmdid, widClass);
03821     m_overide.insert(val);
03822 }

void UWidget::RemoveTimer ( int cmd )

timer handling - remove a timer.

  • cmd associated with the timer.

Definition at line 1999 of file uwidget.cpp.

References m_timers.

02000 {
02001     std::vector<UTimer>::iterator i;
02002     for(i = m_timers.begin(); i != m_timers.end(); i++)
02003     {
02004         if((*i).m_cmd == cmd)
02005         {
02006             (*i).m_cmd = 0; // delay removing
02007             break;
02008         }
02009     }
02010 }

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 807 of file uwidget.cpp.

References m_listeners, and UCmdTarget::UDispatchMessage().

Referenced by UToolbar::UDispatchMessage().

00808 {
00809     std::vector<UCmdTarget *>::iterator i;
00810     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00811     {
00812         (*i)->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00813     }
00814     return UCmdTarget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00815 }

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 940 of file uwidget.cpp.

References GetWidget().

00941 {
00942     void *w = GetWidget(cmd);
00943     if(w == 0L)
00944         return false;
00945
00946 #ifdef WIN32
00947     CWnd *wnd = (CWnd *)w;
00948
00949     bool res = false;
00950
00951     CWnd* parent = wnd->GetOwner();
00952     if(parent && (HWND)*parent->GetFocus() == (HWND)*wnd)
00953         res = true;
00954
00955     return res;
00956 #endif
00957     return false;
00958 }

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, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 85 of file uwidget.cpp.

const URuntimeClass UWidget::classUWidget [static, protected]

CDialog* UWidget::m_curModal [protected]

Definition at line 251 of file uwidget.h.

Referenced by DoModal(), and EndModal().

int UWidget::m_currentPage [protected]

Definition at line 246 of file uwidget.h.

Referenced by OnPageChanged().

std::vector<UCmdTarget *> UWidget::m_listeners [protected]

Definition at line 239 of file uwidget.h.

Referenced by AddListener(), UDispatchMessage(), and ~UWidget().

bool UWidget::m_modalRes [protected]

Definition at line 245 of file uwidget.h.

Referenced by DoModal(), and EndModal().

bool UWidget::m_noDispatch [protected]

Definition at line 253 of file uwidget.h.

Referenced by UWinPseudoWindowProc().

std::map<int, CRuntimeClass *> UWidget::m_overide [protected]

Definition at line 252 of file uwidget.h.

Referenced by OverideMapWidget().

std::map<int, UWidget *> UWidget::m_tabs [protected]

Definition at line 243 of file uwidget.h.

Referenced by AddPage(), DoModal(), OnPageChanged(), LPseudoWinAttachment::SearchWidID(), and ~UWidget().

std::vector<UTimer> UWidget::m_timers [protected]

Definition at line 242 of file uwidget.h.

Referenced by AddTimer(), GetTimers(), and RemoveTimer().

std::map<int, UStr> UWidget::m_tooltips [protected]

Definition at line 241 of file uwidget.h.

Referenced by AddTooltip(), and GetTooltip().

std::map<int, void *> UWidget::m_widgets [protected]

Definition at line 240 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, UMenu, UToolbar, UPromptMessage, UEditMessage, UAuthen_SSH, UAuthen_Pserver, UAuthen_Rhosts, UAuthen_Kserver, UAuthen_Gserver, UAuthen_Sspi, USaveSettings, UCvsApp, UCvsConsole, UCvsFiles, UCvsFolders, UCvsFrame, UCvsGraph, UCvsMenubar, and UCvsToolbar.

Definition at line 85 of file uwidget.cpp.

int UWidget::sFocusCmdID [static, protected]

Definition at line 154 of file uwidget.cpp.

Referenced by GetFocusCmd(), and OnUpdateFocus().

int UWidget::sFocusWidID = -1 [static, protected]

Definition at line 153 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 152 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 Fri Jan 31 12:21:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:10 2003 for WinCvs Source by doxygen 1.3-rc2


CWinApp Class Reference

Inheritance diagram for CWinApp:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvs.h
Generated on Fri Jan 31 12:21:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 (bool doIdle)
void | SetCvsProcess (CvsProcess *proc)
CvsProcess * | GetCvsProcess (void)
void | SetCvsRunning (bool state)
bool | IsCvsRunning (void)
void | SetCvsStopping (bool state)
bool | IsCvsStopping (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

CMultiDocTemplate * | gLogTempl
CMultiDocTemplate * | gLogGraph
CMultiDocTemplate * | gLogHtml
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)

Private Attributes

_CvsProcess * m_CvsProcess
bool | m_CvsRunning
bool | m_CvsStopping
int | m_LastCvsResult

Constructor & Destructor Documentation

CWincvsApp::CWincvsApp ( )

Definition at line 234 of file wincvs.cpp.

References FALSE, m_bATLInited, m_CvsProcess, m_CvsRunning, m_CvsStopping, m_idletime, and m_LastCvsResult.

00234                        : m_isBackgroundProcess(false)
00235 {
00236     m_CvsRunning = false;
00237     m_CvsStopping = false;
00238     m_LastCvsResult = 0;
00239     m_idletime = 0;
00240     m_bATLInited = FALSE;
00241     m_CvsProcess = 0L;
00242 }

Member Function Documentation

void CWincvsApp::ActivateBrowserView ( void )

Definition at line 791 of file wincvs.cpp.

References CMainFrame::GetWorkspace(), m_mainFrame, and CCJTabCtrlBar::SetActiveView().

Referenced by CMainFrame::ChangeLocation().

00792 {
00793     if(m_mainFrame == 0L)
00794         return;
00795
00796     m_mainFrame->GetWorkspace()->SetActiveView(RUNTIME_CLASS(CBrowserBar));
00797 }

int CWincvsApp::ExitInstance ( ) [virtual]

Definition at line 992 of file wincvs.cpp.

References _Module, CCvsThreadLock::Delete(), and LogCleanup().

00993 {
00994     // Save existing preferences. This will save, for example,
00995     // the current working directory as "LastWorkingDir" property.
00996     gCvsPrefs.save();
00997
00998     CCvsThreadLock::Delete();
00999
01000     if (m_bATLInited)
01001     {
01002 #ifdef SCC_COWORKER
01003         LogCleanup();
01004         _Module.RevokeClassObjects();
01005         _Module.Term();
01006 #endif
01007         CoUninitialize();
01008     }
01009
01010     return CWinApp::ExitInstance();
01011 }

void CWincvsApp::GetAppModule ( UStr & module ) const

Definition at line 1135 of file wincvs.cpp.

Referenced by myTcl_CreateInterp().

01136 {
01137     module = "";
01138     HINSTANCE hInst = ::AfxGetInstanceHandle();
01139     if(hInst != 0L)
01140     {
01141         char apath[512];
01142         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01143         if(len > 0)
01144         {
01145             module = apath;
01146         }
01147     }
01148 }

void CWincvsApp::GetAppPath ( UStr & path ) const

Definition at line 1118 of file wincvs.cpp.

References CStr.

Referenced by CTipDlg::CTipDlg(), FormatDefaultSettingsLoc(), getLoc(), LookForResourceFile(), and CvsPrefs::WhichCvs().

01119 {
01120     path = "";
01121     HINSTANCE hInst = ::AfxGetInstanceHandle();
01122     if(hInst != 0L)
01123     {
01124         char apath[512];
01125         DWORD len = ::GetModuleFileName(hInst, apath, 512);
01126         CStr uppath;
01127         CStr exefile;
01128         if(len > 0 && ::SplitPath(apath, uppath, exefile))
01129         {
01130             path = uppath;
01131         }
01132     }
01133 }

bool CWincvsApp::GetAppVersion ( UStr & vers ) const

Definition at line 1202 of file wincvs.cpp.

References NULL.

Referenced by CAboutDlg::CAboutDlg(), InitInstance(), OnAppCredits(), and CSplashWnd::OnPaint().

01203 {
01204     bool bRet=false;
01205     char  szFullPath[_MAX_PATH];
01206     DWORD len = ::GetModuleFileName(AfxGetInstanceHandle(), szFullPath, sizeof(szFullPath));
01207     DWORD dwVerHnd;
01208     DWORD dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
01209     if (dwVerInfoSize && len)
01210     {
01211         // If we were able to get the information, process it:
01212         HANDLE  hMem;
01213         LPVOID  lpvMem;
01214         char    szGetName[256];
01215         int     cchRoot;
01216
01217         hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
01218         lpvMem = GlobalLock(hMem);
01219         GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem);
01220         lstrcpy(szGetName, "\\StringFileInfo\\040904b0\\");
01221         cchRoot = lstrlen(szGetName);
01222
01223         BOOL  fRet;
01224         UINT  cchVer = 0;
01225         LPVOID lszVer = NULL;
01226
01227         lstrcpy(&szGetName[cchRoot], "ProductVersion");
01228         fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer);
01229
01230         if (fRet && cchVer && lszVer)
01231         {
01232             vers = (char *)lszVer;
01233             bRet = true;
01234         }
01235         GlobalUnlock(hMem);
01236         GlobalFree(hMem);
01237     }
01238     return bRet;
01239 }

CWinCvsBrowser * CWincvsApp::GetBrowserView ( void )

Definition at line 772 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().

00773 {
00774     if(m_mainFrame == 0L)
00775         return 0L;
00776
00777     return m_mainFrame->GetBrowserView();
00778 }

CWincvsView * CWincvsApp::GetConsoleView ( void )

Definition at line 756 of file wincvs.cpp.

References CMainFrame::GetConsoleView(), and m_mainFrame.

Referenced by CGraphConsole::CGraphConsole(), CMainFrame::OnBroadcastCmdMsg(), CGraphView::OnLButtonDown(), and OnLogWindowIsPresent().

00757 {
00758     if(m_mainFrame == 0L)
00759         return 0L;
00760
00761     return m_mainFrame->GetConsoleView();
00762 }

CvsProcess* CWincvsApp::GetCvsProcess ( void ) [inline]

Definition at line 89 of file wincvs.h.

References m_CvsProcess.

Referenced by stopCVS(), and WaitForCvs().

00089 { return m_CvsProcess; }

CDocument * CWincvsApp::GetDocument ( void )

Definition at line 836 of file wincvs.cpp.

References ASSERT, and NULL.

Referenced by InitInstance(), and CBrowseFileView::ResetView().

00837 {
00838     CWinApp *app = AfxGetApp();
00839     POSITION post = app->GetFirstDocTemplatePosition();
00840     CDocTemplate* tmpl;
00841     while(post != NULL)
00842     {
00843         tmpl = app->GetNextDocTemplate(post);
00844         POSITION posd = tmpl->GetFirstDocPosition();
00845         CDocument* doc;
00846         while(posd != NULL)
00847         {
00848             doc = tmpl->GetNextDoc(posd);
00849             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00850                 continue;
00851             return doc;
00852         }
00853     }
00854     ASSERT(0);
00855     return 0L;
00856 }

char * CWincvsApp::GetEnvMainThread ( const char * name )

Definition at line 1273 of file wincvs.cpp.

References CMainFrame::GetEnvMainThread(), and m_mainFrame.

Referenced by glue_getenv().

01274 {
01275     return m_mainFrame->GetEnvMainThread(name);
01276 }

CCJShellTree * CWincvsApp::GetExplorerView ( void )

Definition at line 799 of file wincvs.cpp.

References CMainFrame::GetExplorerView(), and m_mainFrame.

Referenced by CMainFrame::OnBroadcastCmdMsg().

00800 {
00801     if(m_mainFrame == 0L)
00802         return 0L;
00803
00804     return m_mainFrame->GetExplorerView();
00805 }

CBrowseFileView * CWincvsApp::GetFileView ( void )

Definition at line 807 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().

00808 {
00809     POSITION post = GetFirstDocTemplatePosition();
00810     CDocTemplate* tmpl;
00811     while(post != NULL)
00812     {
00813         tmpl = GetNextDocTemplate(post);
00814         if(!tmpl->IsKindOf(RUNTIME_CLASS(CMultiDocTemplate)))
00815             continue;
00816         POSITION posd = tmpl->GetFirstDocPosition();
00817         CDocument* doc;
00818         while(posd != NULL)
00819         {
00820             doc = tmpl->GetNextDoc(posd);
00821             if(!doc->IsKindOf(RUNTIME_CLASS(CWincvsDoc)))
00822                 continue;
00823             POSITION posv = doc->GetFirstViewPosition();
00824             CView* view;
00825             while(posv != NULL)
00826             {
00827                 view = doc->GetNextView(posv);
00828                 if(view->IsKindOf(RUNTIME_CLASS(CBrowseFileView)))
00829                     return (CBrowseFileView *)view;
00830             }
00831         }
00832     }
00833     return NULL;
00834 }

KiFilterModel * CWincvsApp::GetFilterModel ( ) const

Definition at line 1420 of file wincvs.cpp.

References CMainFrame::GetFilterModel(), and m_mainFrame.

Referenced by KoTraversalContext::KoTraversalContext(), CBrowseFileView::OnDestroy(), and CBrowseFileView::OnInitialUpdate().

01421 {
01422     return m_mainFrame->GetFilterModel();
01423 }

DWORD CWincvsApp::GetIdleTime ( void ) const [inline]

Definition at line 113 of file wincvs.h.

References m_idletime.

Referenced by CLogoutThread::InitInstance().

00113 { return m_idletime; }

KiIgnoreModel * CWincvsApp::GetIgnoreModel ( ) const

Definition at line 1431 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().

01432 {
01433     return m_mainFrame->GetIgnoreModel();
01434 }

CMainFrame* CWincvsApp::GetMainFrame ( void ) [inline]

Definition at line 82 of file wincvs.h.

References m_mainFrame.

Referenced by CWinCvsBrowser::Create(), CHistComboBoxEx::DelKeyTest(), CLogFrame::OnCmdMsg(), CGraphFrame::OnCmdMsg(), and CWinCvsBrowser::ResetBrowser().

00082 { return m_mainFrame; }

KiRecursionModel * CWincvsApp::GetRecursionModel ( ) const

Definition at line 1426 of file wincvs.cpp.

References CMainFrame::GetRecursionModel(), and m_mainFrame.

Referenced by KoTraversalContext::KoTraversalContext(), CBrowseFileView::OnDestroy(), and CBrowseFileView::OnInitialUpdate().

01427 {
01428     return m_mainFrame->GetRecursionModel();
01429 }

CString CWincvsApp::GetRoot ( )

Definition at line 780 of file wincvs.cpp.

References GetBrowserView(), and CWinCvsBrowser::GetRoot().

Referenced by CCheckout_MAIN::CCheckout_MAIN(), CBrowseFileView::OnUpdateViewUpone(), and CBrowseFileView::OnViewUpone().

00781 {
00782     CString root;
00783     CWinCvsBrowser* view = GetBrowserView();
00784     if (view)
00785     {
00786         root = view->GetRoot();
00787     }
00788     return root;
00789 }

CStatusBar * CWincvsApp::GetStatusBar ( )

Definition at line 764 of file wincvs.cpp.

References CMainFrame::GetStatusBar(), and m_mainFrame.

Referenced by IdleCvsProgress().

00765 {
00766     if(m_mainFrame == 0L)
00767         return 0L;
00768
00769     return m_mainFrame->GetStatusBar();
00770 }

void CWincvsApp::IdleCvsProgress ( void )

Definition at line 1278 of file wincvs.cpp.

References CBrowseFileView::CheckChanges(), cvs_process_is_active(), GetFileView(), GetStatusBar(), m_CvsProcess, m_CvsRunning, and m_CvsStopping.

Referenced by PreTranslateMessage().

01279 {
01280     static bool bWasCvsRunning = false; //to restore the idle message once CVS has stoped
01281
01282     if( !m_CvsRunning )
01283     {
01284         if( bWasCvsRunning )
01285         {
01286             bWasCvsRunning = false;
01287
01288             CString strIdleString;
01289             strIdleString.LoadString(AFX_IDS_IDLEMESSAGE);
01290
01291             CStatusBar *bar = GetStatusBar();
01292             if(bar != 0L)
01293                 bar->SetWindowText(strIdleString);
01294         }
01295
01296         return;
01297     }
01298
01299     if( m_CvsProcess != 0L )
01300     {
01301         if( !cvs_process_is_active(m_CvsProcess) )
01302         {
01303             m_CvsRunning = false;
01304             m_CvsStopping = false;
01305             m_CvsProcess = 0L;
01306             GetFileView()->CheckChanges();
01307         }
01308     }
01309
01310     bWasCvsRunning = true;
01311
01312     DWORD whatTimeIsIt = ::GetTickCount();
01313     static DWORD lastTime = 0;
01314     // let's make some stuff every second while cvs is idling
01315     if( (whatTimeIsIt - lastTime) < 1000 )
01316         return;
01317
01318     lastTime = whatTimeIsIt;
01319     char path[_MAX_PATH];
01320     getcwd(path, _MAX_PATH);
01321     CStatusBar* bar = GetStatusBar();
01322
01323     if( bar != 0L )
01324         bar->SetWindowText(path);
01325 }

BOOL CWincvsApp::InitATL ( ) [protected]

Definition at line 1353 of file wincvs.cpp.

References _Module, DEBUG_MESSAGE, CCVS_CoworkerModule::dwThreadID, FALSE, CCVS_CoworkerModule::FindOneOf(), m_bATLInited, MatchToken(), NULL, and TRUE.

Referenced by InitInstance().

01354 {
01355     m_bATLInited = TRUE;
01356
01357 #if _WIN32_WINNT >= 0x0400
01358     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
01359 #else
01360     HRESULT hRes = CoInitialize(NULL);
01361 #endif
01362
01363     if (FAILED(hRes))
01364     {
01365         m_bATLInited = FALSE;
01366         return FALSE;
01367     }
01368
01369 #ifdef SCC_COWORKER
01370     _Module.Init(ObjectMap, AfxGetInstanceHandle());
01371     _Module.dwThreadID = GetCurrentThreadId();
01372
01373     LPTSTR lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
01374     TCHAR szTokens[] = _T("-/");
01375     BOOL bRun = TRUE;
01376
01377     LPCTSTR lpszToken = _Module.FindOneOf(lpCmdLine, szTokens);
01378     while (lpszToken != NULL)
01379     {
01380         if (MatchToken(lpszToken,_T("UnregServer"))) {
01381             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, FALSE);
01382             _Module.UnregisterServer(TRUE); //TRUE means typelib is unreg'd
01383             bRun = FALSE;
01384             DEBUG_MESSAGE(_T("Now UNREGISTERED"));
01385             break;
01386         }
01387         if (MatchToken(lpszToken,_T("RegServer"))) {
01388             //RegisterLogging();  // specific to CVS_Coworker
01389             _Module.UpdateRegistryFromResource(IDR_CVS_COWORKER, TRUE);
01390             _Module.RegisterServer(TRUE);
01391             bRun = FALSE;
01392             DEBUG_MESSAGE(_T("REGISTERED"));
01393             break;
01394         }
01395         lpszToken = _Module.FindOneOf(lpszToken, szTokens);
01396     }
01397
01398     if (!bRun)
01399     {
01400         m_bATLInited = FALSE;
01401         _Module.Term();
01402         CoUninitialize();
01403         return FALSE;
01404     }
01405
01406     //StartLogging();         // specific to CVS_Coworker
01407     hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,REGCLS_MULTIPLEUSE);
01408     if (FAILED(hRes))
01409     {
01410         m_bATLInited = FALSE;
01411         CoUninitialize();
01412         return FALSE;
01413     }
01414 #endif
01415
01416     return TRUE;
01417 }

BOOL CWincvsApp::InitInstance ( ) [virtual]

Definition at line 324 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, IDR_BROWSER, IDR_FILELIST, IDR_FILTER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, InitATL(), CCvsThreadLock::Initialize(), CPython_Interp::InitPythonSupport(), CPython_Interp::IsAvail(), CTcl_Interp::IsAvail(), IsValidHandle(), kBold, kNL, kNormal, kUnderline, m_mainFrame, m_server, PyMacrosReloadAll(), CWinCvsBrowser::ResetBrowser(), CBrowseFileView::ResetView(), SHELL_PYTHON, SHELL_TCL, ShowTipAtStartup(), sLogout, CWinCvsBrowser::StepToLocation(), TRUE, and VERIFY.

00325 {
00326 #if qCvsDebug
00327     int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
00328     tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
00329     _CrtSetDbgFlag(tmpDbgFlag);
00330 #endif
00331     CStr lastWorkingDir;
00332
00333     // David Gravereaux <davygrvy@interwoven.com> suggests this might
00334     // be a work around to the bug #42 (I love the bug number,
00335     // really fits the bug description ;-))
00336 #if 0
00337     if (!IsValidHandle(GetStdHandle(STD_OUTPUT_HANDLE)))
00338     {
00339         SetStdHandle(STD_OUTPUT_HANDLE, 0L);
00340     }
00341 #endif
00342
00343     // CG: The following block was added by the Splash Screen component.
00344     {
00345         CCommandLineInfo cmdInfo;
00346         ParseCommandLine(cmdInfo);
00347
00348         CSplashWnd::EnableSplashScreen(
00349             (!(m_nCmdShow & SW_SHOWMINIMIZED)) && cmdInfo.m_bShowSplash);
00350     }
00351
00352     if (!AfxSocketInit())
00353     {
00354         AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
00355         return FALSE;
00356     }
00357
00358 #ifdef SCC_COWORKER
00359     if (!InitATL())
00360         return FALSE;
00361 #endif
00362
00363     // Initialize OLE libraries
00364     if (!AfxOleInit())
00365     {
00366         AfxMessageBox(IDP_OLE_INIT_FAILED);
00367         return FALSE;
00368     }
00369
00370     AfxEnableControlContainer();
00371
00372     // Standard initialization
00373     // If you are not using these features and wish to reduce the size
00374     //  of your final executable, you should remove from the following
00375     //  the specific initialization routines you do not need.
00376
00377 #if _MFC_VER < 0x700
00378 #ifdef _AFXDLL
00379     Enable3dControls();         // Call this when using MFC in a shared DLL
00380 #else
00381     Enable3dControlsStatic();   // Call this when linking to MFC statically
00382 #endif
00383 #endif
00384
00385     CCvsThreadLock::Initialize();
00386
00387     // Change the registry key under which our settings are stored.
00388     // You should modify this string to be something appropriate
00389     // such as the name of your company or organization.
00390     SetRegistryKey(_T("WinCvs"));
00391
00392     LoadStdProfileSettings(5);  // Load standard INI file options (including MRU)
00393     gCvsPrefs.load();
00394
00395     CSplashWnd::EnableSplashScreen(!gCvsPrefs.DisableSplashScreen());
00396
00397     CStr strVersion;
00398     GetAppVersion(strVersion);
00399     WriteProfileString(_T(""), _T("Current Version"), strVersion);
00400
00401     //
00402     // We need to make a temp local copy of LastWorkingDir property here,
00403     // because CWinCvsBrowser::OnSelchanging event would override
00404     // LastWorkingDir preference when browser window is created.
00405     //
00406     lastWorkingDir = gCvsPrefs.LastWorkingDir();
00407
00408     // Register the application's document templates.  Document templates
00409     //  serve as the connection between documents, frame windows and views.
00410
00411     gLogTempl = new CMultiDocTemplate(
00412         IDR_MAINFRAME,
00413         RUNTIME_CLASS(CWincvsDoc),
00414         RUNTIME_CLASS(CLogFrame),
00415         RUNTIME_CLASS(CBrowseFileView));
00416     AddDocTemplate(gLogTempl);
00417
00418     gLogGraph = new CMultiDocTemplate(
00419         IDR_GRAPH,
00420         RUNTIME_CLASS(CGraphDoc),
00421         RUNTIME_CLASS(CGraphFrame),
00422         RUNTIME_CLASS(CGraphView));
00423     AddDocTemplate(gLogGraph);
00424
00425     /*gLogHtml = new CMultiDocTemplate(
00426         IDR_GRAPH,
00427         RUNTIME_CLASS(CDocument),
00428         RUNTIME_CLASS(CMDIChildWnd),
00429         RUNTIME_CLASS(CGraphView));
00430     AddDocTemplate(gLogGraph);*/
00431
00432     // Connect the COleTemplateServer to the document template.
00433     //  The COleTemplateServer creates new documents on behalf
00434     //  of requesting OLE containers by using information
00435     //  specified in the document template.
00436     m_server.ConnectTemplate(clsid, gLogTempl, TRUE);
00437         // Note: SDI applications register server objects only if /Embedding
00438         //   or /Automation is present on the command line.
00439
00440     // Register all OLE server factories as running.  This enables the
00441     //  OLE libraries to create objects from other applications.
00442     COleTemplateServer::RegisterAll();
00443         // Note: MDI applications register all server objects without regard
00444         //  to the /Embedding or /Automation on the command line.
00445
00446     // create main MDI Frame window
00447     m_mainFrame = new CMainFrame;
00448     if (!m_mainFrame->LoadFrame(IDR_CNTR_INPLACE))
00449         return FALSE;
00450     m_pMainWnd = m_mainFrame;
00451
00452     // Initialize the cool menus...
00453 #if 0
00454     UINT barIds[] = {IDR_BROWSER, IDR_MAINFRAME, IDR_MULTIUSER, IDR_TAGS, IDR_FILELIST, IDR_FILTER};
00455     m_mainFrame->InitializeMenu(gLogTempl,
00456         IDR_MAINFRAME, barIds, _countof(barIds), IDR_MAINFRAME);
00457     m_mainFrame->InitializeMenu(gLogGraph,
00458         IDR_GRAPH, barIds, _countof(barIds), IDR_GRAPH);
00459 #endif
00460
00461     // Parse command line for standard shell commands, DDE, file open
00462     CCommandLineInfo cmdInfo;
00463     ParseCommandLine(cmdInfo);
00464
00465     // Check to see if launched as OLE server
00466     if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
00467     {
00468 #if 0
00469         // Register all OLE server (factories) as running.  This enables the
00470         //  OLE libraries to create objects from other applications.
00471         COleTemplateServer::RegisterAll();
00472 #endif
00473
00474         // Application was run with /Embedding or /Automation.  Don't show the
00475         //  main window in this case.
00476         return TRUE;
00477     }
00478
00479     // When a server application is launched stand-alone, it is a good idea
00480     //  to update the system registry in case it has been damaged.
00481     m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
00482     COleObjectFactory::UpdateRegistryAll();
00483
00484     //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)
00485     if( -1 != cmdInfo.m_strFileName.Find('~') )
00486     {
00487         CString strLongFileName;
00488         CString strTempTileName = cmdInfo.m_strFileName;
00489
00490         SHFILEINFO sFileInfo;
00491         int nSlashPos = -1;
00492
00493         BOOL bError = FALSE;
00494
00495         while( -1 != (nSlashPos = strTempTileName.ReverseFind(kPathDelimiter)) )
00496         {
00497             if( SHGetFileInfo((LPCTSTR)strTempTileName, 0, &sFileInfo, sizeof(sFileInfo), SHGFI_DISPLAYNAME) )
00498             {
00499                 CString strFileNameBit = strTempTileName.Mid(nSlashPos + 1);
00500
00501                 strLongFileName = sFileInfo.szDisplayName + strLongFileName;
00502                 strLongFileName = kPathDelimiter + strLongFileName;
00503                 strTempTileName = strTempTileName.Left(nSlashPos);
00504             }
00505             else
00506             {
00507                 bError = TRUE;
00508                 break;  //we need it or we get the dead loop
00509             }
00510         }//end while
00511
00512         if( !bError )
00513         {
00514             cmdInfo.m_strFileName = strTempTileName + strLongFileName;
00515         }
00516     }
00517
00518     //JK - open in the directory, so remove the file
00519     CString strOpenDirectory;
00520     CString strSelectFile;
00521     if( !cmdInfo.m_strFileName.IsEmpty() )
00522     {
00523         TCHAR fullpath[_MAX_PATH];
00524         _tfullpath(fullpath, cmdInfo.m_strFileName, _MAX_PATH);
00525         if( GetFileAttributes(cmdInfo.m_strFileName) != 0xFFFFFFFF )
00526         {
00527             cmdInfo.m_strFileName.Replace('/', kPathDelimiter); //normalize path
00528             TCHAR drive[_MAX_DRIVE];
00529             TCHAR dir[_MAX_DIR];
00530             _tsplitpath(fullpath, drive, dir, NULL, NULL);
00531             strSelectFile = fullpath;
00532             _tmakepath(fullpath, drive, dir, NULL, NULL);
00533             strOpenDirectory = fullpath;
00534         }
00535     }
00536
00537     // Dispatch commands specified on the command line
00538     //JK - we need to trick the ProcessShellCommand a bit
00539     //because we might get a directory as a parameter we don't want it to check after the file...
00540     cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew;
00541     if (!ProcessShellCommand(cmdInfo))
00542         return FALSE;
00543
00544     // The one and only window has been initialized, so show and update it.
00545     m_mainFrame/*m_pMainWnd*/->InitialShowWindow(m_nCmdShow);
00546     m_mainFrame/*m_pMainWnd*/->UpdateWindow();
00547
00548     m_mainFrame/*m_pMainWnd*/->DragAcceptFiles();
00549     //CWincvsView *cons = GetConsoleView();
00550     //if(cons != 0L)
00551     //  cons->DragAcceptFiles();
00552
00553
00554     CWinCvsBrowser *browser = GetBrowserView();
00555     CWincvsDoc *doc = (CWincvsDoc *)GetDocument();
00556     if(doc != 0L && browser != 0L)
00557         doc->SetTitle(browser->GetRoot());
00558     CBrowseFileView *fileView = GetFileView();
00559     if(fileView != 0L)
00560     {
00561         if( strOpenDirectory.IsEmpty() )
00562         {
00563             // Goto the last working directory, which was selected
00564             // when WinCVS was closed
00565             if( !lastWorkingDir.empty() && browser->StepToLocation(lastWorkingDir) )
00566             {
00567                 fileView->ResetView(lastWorkingDir, false, (LPCTSTR) 0L);
00568                 gCvsPrefs.SetLastWorkingDir(lastWorkingDir);
00569             }
00570             else
00571                 fileView->ResetView(browser->GetRoot());
00572         }
00573         else
00574         {
00575             CColorConsole out;
00576             out << kBold << "Locating: " << kNormal << kUnderline << cmdInfo.m_strFileName << kNormal <<  kNormal << kNL;
00577
00578             //search the browse location (will create a new location if not found)
00579             extern CMString gHistoryLocs;
00580             CString bestRoot = CHistComboBoxEx::FindBestRoot(gHistoryLocs, strOpenDirectory);
00581             if( !bestRoot.IsEmpty() )
00582             {
00583                 browser->ResetBrowser((LPCTSTR)bestRoot);
00584             }
00585
00586             if( browser->StepToLocation((LPCTSTR)strOpenDirectory) )
00587             {
00588                 fileView->ResetView( (LPCTSTR)strOpenDirectory, false, (LPCTSTR)strSelectFile );
00589             }
00590             else
00591             {
00592                 fileView->ResetView( browser->GetRoot() );
00593             }
00594         }
00595     }
00596
00597     CPython_Interp::InitPythonSupport();
00598
00599     //MacrosReloadAll();
00600     PyMacrosReloadAll();
00601
00602     //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
00603     if( strOpenDirectory.IsEmpty() )
00604     {
00605         // CG: This line inserted by 'Tip of the Day' component.
00606         ShowTipAtStartup();
00607     }
00608
00609     // auto-logout thread
00610     sLogout = new CLogoutThread();
00611     if (sLogout == 0L)
00612     {
00613         cvs_err("Impossible to create the auto-logout thread !\n");
00614     }
00615     else
00616     {
00617         ASSERT_VALID(sLogout);
00618
00619         // Create Thread in a suspended state so we can set the Priority
00620         // before it starts getting away from us
00621         if (!sLogout->CreateThread(CREATE_SUSPENDED))
00622         {
00623             cvs_err("Impossible to start the auto-logout thread (error %d)!\n", GetLastError());
00624             delete sLogout;
00625             sLogout = 0L;
00626         }
00627
00628         if(sLogout != 0L)
00629         {
00630             // If you want to make the sample more sprightly, set the thread priority here
00631             // a little higher. It has been set at idle priority to keep from bogging down
00632             // other apps that may also be running.
00633             VERIFY(sLogout->SetThreadPriority(THREAD_PRIORITY_NORMAL));
00634             // Now the thread can run wild
00635             sLogout->ResumeThread();
00636         }
00637     }
00638
00639     // load preferences. If CVSROOT is not defined
00640     // then prompt first preferences dialog.
00641     if(gCvsPrefs.empty())
00642         SendMessage(*m_mainFrame, WM_COMMAND, ID_APP_PREFERENCES, 0L);
00643         //doc->OnAppPreferences();
00644     else
00645         cvs_out("CVSROOT: %s (%s)\n", (const char *)gCvsPrefs, gAuthen.kindstr());
00646
00647     bool hasTCL = CTcl_Interp::IsAvail();
00648     bool hasPY = CPython_Interp::IsAvail();
00649
00650     if(gCvsPrefs.GetUseShell() == SHELL_PYTHON && !hasPY && hasTCL)
00651     {
00652         gCvsPrefs.SetUseShell(SHELL_TCL);
00653     }
00654     else if(gCvsPrefs.GetUseShell() == SHELL_TCL && hasPY && !hasTCL)
00655     {
00656         gCvsPrefs.SetUseShell(SHELL_PYTHON);
00657     }
00658
00659     if(gCvsPrefs.GetUseShell() == SHELL_TCL)
00660     {
00661         cvs_out("TCL is available, shell is enabled : help (select and press enter)\n");
00662     }
00663
00664     if(!hasTCL && !hasPY)
00665     {
00666         cvs_err("TCL or Python are *not* available, shell is disabled\n");
00667     }
00668
00669     //make sure the current directory is properly setup
00670     if( 0L != fileView )
00671     {
00672         chdir( fileView->GetPath() );
00673     }
00674
00675     return TRUE;
00676 }

bool CWincvsApp::IsCvsRunning ( void ) [inline]

Definition at line 92 of file wincvs.h.

References m_CvsRunning.

Referenced by CWinCvsBrowser::DisableCommon(), CGraphView::DisableCommon(), CExploreBar::DisableCommon(), CMyShellTree::DisableCommon(), CBrowseFileView::DisableCommon(), CCvsStatusBar::DrawItem(), CLogoutThread::InitInstance(), IsAppEnabled(), CItemListDlg::OnCancel(), CMainFrame::OnClose(), CWinCvsBrowser::OnContextMenu(), CWinCvsBrowser::OnItemexpanding(), CBrowseFileView::OnKeydown(), CBrowseFileView::OnLButtonDblClk(), CWinCvsBrowser::OnRButtonDown(), CWinCvsBrowser::OnSelchanging(), CWinCvsBrowser::OnSetCursor(), CBrowseFileView::OnSetCursor(), CCvsStatusBar::OnTimer(), CBrowseFileView::OnTimer(), CWincvsDoc::OnUpdateCvsCmd(), CBrowseFileView::OnUpdateCvsCmd(), CWincvsDoc::OnUpdateMacroAdmin(), CWincvsDoc::OnUpdatePrefs(), CWincvsDoc::OnUpdateSavesettings(), CWincvsDoc::OnUpdateStopcvs(), CWinCvsBrowser::OnUpdateViewReload(), CBrowseFileView::OnUpdateViewReload(), and CBrowseFileView::OnUpdateViewUpone().

00092 { return m_CvsRunning; }

bool CWincvsApp::IsCvsStopping ( void ) [inline]

Definition at line 95 of file wincvs.h.

References m_CvsStopping.

Referenced by CItemListDlg::OnCancel(), and CWincvsDoc::OnUpdateStopcvs().

00095 { return m_CvsStopping; }

void CWincvsApp::LookForResourceFile | ( | const char * | what,
 |  | UStr & | path
 | ) | [protected]

Definition at line 1150 of file wincvs.cpp.

References CStr, GetAppPath(), SplitPath(), and stat.

Referenced by OnHelpCvs(), and OnHelpCvsclient().

01151 {
01152     path = "";
01153     GetAppPath(path);
01154
01155     CString appPath = path;
01156     // first the macro folder may be ./macro
01157     CString test = appPath;
01158     test.TrimRight('\\');
01159     test += "\\";
01160     test += what;
01161
01162     struct stat sb;
01163     if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01164     {
01165         path = test;
01166         return;
01167     }
01168
01169     CStr uppath, file;
01170     while(SplitPath(appPath, uppath, file) && !uppath.empty())
01171     {
01172         test = uppath;
01173         test.TrimRight('\\');
01174         test += "\\";
01175         test += what;
01176
01177         if(stat(test, &sb) != -1 && S_ISREG(sb.st_mode))
01178         {
01179             path = test;
01180             return;
01181         }
01182         appPath = uppath;
01183     }
01184     path = test;
01185 }

void CWincvsApp::OnAppAbout ( ) [protected]

Definition at line 750 of file wincvs.cpp.

00751 {
00752     CAboutDlg aboutDlg;
00753     aboutDlg.DoModal();
00754 }

void CWincvsApp::OnAppCopyrights ( ) [protected]

Definition at line 1013 of file wincvs.cpp.

References cvs_out().

01014 {
01015     cvs_out("\nBoth WinCVS and CVS are distributed under the terms of\n");
01016     cvs_out("the GNU General Public Licence (GPL).\n\n");
01017     cvs_out("* MacCVS/WinCvs : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n");
01018     cvs_out("* WinCvs documentation : Copyright © 1999 Don Harper <don@lamrc.com>.\n");
01019     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
01020     cvs_out("        Jeff Polk, and other authors\n");
01021     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n");
01022     cvs_out("* Kerberos : Copyright © 1997 the Massachusetts Institute of Technology\n");
01023     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
01024     cvs_out("* Python : Copyright © Guido van Rossum\n");
01025     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
01026     cvs_out("\nSome others copyrights may apply, check the source code for details.\n");
01027 }

void CWincvsApp::OnAppCredits ( ) [protected]

Definition at line 1029 of file wincvs.cpp.

References AUTHORS_COUNT, AUTHORS_PERMUTATIONS, CStr, cvs_out(), and GetAppVersion().

01030 {
01031     // WinCvs version
01032     CStr vers;
01033
01034     if( GetAppVersion(vers) )
01035         cvs_out("\n%s - Client/Local\n", (const char*)vers);
01036     else
01037         cvs_out("\nWinCvs 1.3 - Client/Local\n");
01038
01039     // Authors in random order
01040     cvs_out("- WinCvs is developed by:\n");
01041
01042     srand((unsigned)time(NULL));
01043     const int option = rand() % AUTHORS_PERMUTATIONS;
01044
01045     for(int index = 0; index < AUTHORS_COUNT; index++)
01046     {
01047         cvs_out(gAuthors[gAuthorsPermutations[option][index]]);
01048     }
01049
01050     cvs_out("\t* Other contributors (see the ChangeLog)\n");
01051
01052     // More info
01053     cvs_out("- WinCvs page : http://www.wincvs.org or http://cvsgui.sourceforge.net/\n");
01054     cvs_out("- cvs page : http://www.cvshome.org\n");
01055     cvs_out("- WinCvs documentation : Don Harper <don@lamrc.com>.\n");
01056     cvs_out("- WinHelp cvs documentation : Norbert Klamann.\n");
01057
01058     cvs_out("- Special thanks to :\n");
01059     cvs_out("\t* The Strata Inc. developpers who are so patients with WinCvs\n");
01060     cvs_out("\t  and help to identify a lot of problems.\n");
01061     cvs_out("\t* All the people who are submitting bugs, patches and\n");
01062     cvs_out("\t  answer the cvsgui mailing list.\n");
01063
01064     cvs_out("- Bug reports, suggestions :\n");
01065     cvs_out("\t* Richard Wesley, Alain Aslag Roy, Eric Aubourg and many others\n");
01066     cvs_out("- Cvs contributors :\n");
01067     cvs_out("\t* Too many to be listed here, see the 'ChangeLog' instead !\n");
01068 }

void CWincvsApp::OnFileNew ( ) [protected]

Definition at line 249 of file wincvs.cpp.

References gLogTempl.

00250 {
00251     gLogTempl->OpenDocumentFile(NULL);
00252 }

void CWincvsApp::OnHelpCvs ( ) [protected]

Definition at line 1188 of file wincvs.cpp.

References CStr, and LookForResourceFile().

01189 {
01190     CStr hlp;
01191     LookForResourceFile("cvs.hlp", hlp);
01192     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01193 }

void CWincvsApp::OnHelpCvsclient ( ) [protected]

Definition at line 1195 of file wincvs.cpp.

References CStr, and LookForResourceFile().

01196 {
01197     CStr hlp;
01198     LookForResourceFile("cvscli.hlp", hlp);
01199     ::WinHelp(*AfxGetMainWnd(), hlp, HELP_CONTENTS, 0L);
01200 }

void CWincvsApp::OnLogWindowIsPresent ( CCmdUI * pCmdUI ) [protected]

Definition at line 244 of file wincvs.cpp.

References GetConsoleView().

00245 {
00246     pCmdUI->Enable(GetConsoleView() != 0L);
00247 }

void CWincvsApp::PeekPumpAndIdle ( bool doIdle )

Definition at line 1454 of file wincvs.cpp.

References NULL.

01455 {
01456     MSG Msg;
01457     while( ::PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE) )
01458     {
01459         PumpMessage();
01460     }
01461
01462     if( doIdle )
01463     {
01464         LONG lIdle = 0;
01465         while( OnIdle(lIdle++) )
01466             ;
01467     }
01468 }

BOOL CWincvsApp::PreTranslateMessage ( MSG * pMsg ) [virtual]

Definition at line 1092 of file wincvs.cpp.

References IdleCvsProgress(), m_idletime, CSplashWnd::PreTranslateAppMessage(), PyInvalUICache(), and TRUE.

01093 {
01094     // CG: The following lines were added by the Splash Screen component.
01095     if (CSplashWnd::PreTranslateAppMessage(pMsg))
01096         return TRUE;
01097
01098     DWORD time = ::GetTickCount();
01099     if (m_idletime == 0 ||
01100         pMsg->message == WM_KEYDOWN ||
01101         pMsg->message == WM_SYSKEYDOWN ||
01102         pMsg->message == WM_LBUTTONDOWN ||
01103         pMsg->message == WM_RBUTTONDOWN ||
01104         pMsg->message == WM_MBUTTONDOWN ||
01105         pMsg->message == WM_NCLBUTTONDOWN ||
01106         pMsg->message == WM_NCRBUTTONDOWN ||
01107         pMsg->message == WM_NCMBUTTONDOWN)
01108     {
01109         m_idletime = time;
01110         PyInvalUICache();
01111     }
01112
01113     IdleCvsProgress();
01114
01115     return CWinApp::PreTranslateMessage(pMsg);
01116 }

void CWincvsApp::ResetIdleTime ( void ) [inline]

Definition at line 114 of file wincvs.h.

References m_idletime.

Referenced by CLogoutThread::InitInstance().

00114 { m_idletime = 0; }

BOOL CWincvsApp::SaveAllModified ( ) [virtual]

Definition at line 1241 of file wincvs.cpp.

References cvs_err(), CvsCmdLogout(), AuthenModel::GetInstance(), AuthenModel::HasLogin(), CLogoutThread::KillThread(), m_CvsStopping, sLogout, TRUE, and WaitForCvs().

01242 {
01243     // prevent from exiting when cvs is running
01244     if( m_CvsRunning )
01245     {
01246         m_CvsStopping = true;
01247         return TRUE;
01248     }
01249
01250     if( sLogout != 0L )
01251     {
01252         HANDLE hdl = sLogout->m_hThread;
01253         sLogout->KillThread();
01254         WaitForSingleObject(hdl, INFINITE);
01255         //delete sLogout;
01256         sLogout = 0L;
01257     }
01258
01259     // auto-logout
01260     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
01261
01262     if( curModel->HasLogin() && gCvsPrefs.HasLoogedIn() &&
01263         gCvsPrefs.LogoutTimeOut() > 0 )
01264     {
01265         cvs_err("Making automatic logout before quitting:\n");
01266         CvsCmdLogout();
01267         WaitForCvs();
01268     }
01269
01270     return CWinApp::SaveAllModified();
01271 }

void CWincvsApp::SetCvsProcess ( CvsProcess * proc ) [inline]

Definition at line 88 of file wincvs.h.

References m_CvsProcess.

00088 { m_CvsProcess = proc; };

void CWincvsApp::SetCvsRunning ( bool state ) [inline]

Definition at line 91 of file wincvs.h.

References m_CvsRunning.

00091 { m_CvsRunning = state; };

void CWincvsApp::SetCvsStopping ( bool state ) [inline]

Definition at line 94 of file wincvs.h.

References m_CvsStopping.

Referenced by stopCVS().

00094 { m_CvsStopping = state; };

void CWincvsApp::ShowTipAtStartup ( void ) [private]

Definition at line 1070 of file wincvs.cpp.

References CTipDlg::m_bStartup, and NULL.

Referenced by InitInstance().

01071 {
01072     // CG: This function added by 'Tip of the Day' component.
01073
01074     CCommandLineInfo cmdInfo;
01075     ParseCommandLine(cmdInfo);
01076     if (cmdInfo.m_bShowSplash)
01077     {
01078         CTipDlg dlg( IsWindow(m_pMainWnd->GetSafeHwnd()) ? m_pMainWnd : NULL );
01079         if (dlg.m_bStartup)
01080             dlg.DoModal();
01081     }
01082 }

void CWincvsApp::ShowTipOfTheDay ( void ) [private]

Definition at line 1084 of file wincvs.cpp.

01085 {
01086     // CG: This function added by 'Tip of the Day' component.
01087
01088     CTipDlg dlg;
01089     dlg.DoModal();
01090 }

void CWincvsApp::UpdateAllDocsView ( )

Definition at line 1436 of file wincvs.cpp.

Referenced by CGraphOptDlg::OnApply(), and CGraphView::OnGraphGraphoptions().

01437 {
01438     POSITION pos = GetFirstDocTemplatePosition();
01439     while( pos )
01440     {
01441         CDocTemplate* pTemplate = GetNextDocTemplate(pos);
01442         POSITION pos2 = pTemplate->GetFirstDocPosition();
01443         while(pos2)
01444         {
01445             CDocument* pDocument;
01446             if(pDocument = pTemplate->GetNextDoc(pos2))
01447             {
01448                 pDocument->UpdateAllViews(NULL);
01449             }
01450         }
01451     }
01452 }

Member Data Documentation

CMultiDocTemplate* CWincvsApp::gLogGraph

Definition at line 98 of file wincvs.h.

Referenced by CvsLogParse(), and InitInstance().

CMultiDocTemplate* CWincvsApp::gLogHtml

Definition at line 99 of file wincvs.h.

CMultiDocTemplate* CWincvsApp::gLogTempl

Definition at line 97 of file wincvs.h.

Referenced by InitInstance(), and OnFileNew().

BOOL CWincvsApp::m_bATLInited [protected]

Definition at line 153 of file wincvs.h.

Referenced by CWincvsApp(), and InitATL().

struct _CvsProcess* CWincvsApp::m_CvsProcess [private]

Current cvs process

Definition at line 172 of file wincvs.h.

Referenced by CWincvsApp(), GetCvsProcess(), IdleCvsProgress(), and SetCvsProcess().

bool CWincvsApp::m_CvsRunning [private]

CVS command is running

Definition at line 173 of file wincvs.h.

Referenced by CWincvsApp(), IdleCvsProgress(), IsCvsRunning(), and SetCvsRunning().

bool CWincvsApp::m_CvsStopping [private]

CVS command is about to stop

Definition at line 174 of file wincvs.h.

Referenced by CWincvsApp(), IdleCvsProgress(), IsCvsStopping(), SaveAllModified(), and SetCvsStopping().

DWORD CWincvsApp::m_idletime [protected]

Definition at line 151 of file wincvs.h.

Referenced by CWincvsApp(), GetIdleTime(), PreTranslateMessage(), and ResetIdleTime().

bool CWincvsApp::m_isBackgroundProcess

Definition at line 142 of file wincvs.h.

Referenced by CMainFrame::OnActivate(), and KoWatcher::Run().

int CWincvsApp::m_LastCvsResult [private]

Last know exit() return value of cvs command

Definition at line 175 of file wincvs.h.

Referenced by CWincvsApp().

CMainFrame* CWincvsApp::m_mainFrame [protected]

Definition at line 152 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 156 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 Fri Jan 31 12:21:15 2003 for WinCvs Source by doxygen 1.3-rc2


CWinCvsBrowser Class Reference

#include <WinCvsBrowser.h>

Inheritance diagram for CWinCvsBrowser:

[legend]
Collaboration diagram for CWinCvsBrowser:

[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)
Create virtual override, initialize browser tree control.

virtual void | OnInitialUpdate ()
OnInitialUpdate virtual override, expand the root item and register ignore notification function.

void | ResetView (bool forceReload=false, bool notifyView=false)
bool | StepToLocation (const char *path, bool notifyView=false)
void | ResetBrowser (const char *path, bool notifyView=false)
void | OnIgnoreChanged ()
Ignore changed notification handler, post reset view message.

void | NotifySelectionChange ()
const UStr & | GetRoot (void) const
Get the current root.

bool | GetSelectionNotificationLocked () const
Get the selection notification locked state.

SetSelectionNotificationLocked (bool selectionNotificationLocked)
Set the selection notification locked state.

bool | GetSelectionChanged () const
Get the selection changed state.

SetSelectionChanged (bool selectionChanged)
Set the selection changed state.

Protected Methods

CWinCvsBrowser ()
virtual | ~CWinCvsBrowser ()
virtual void | OnDraw (CDC *pDC)
OnDraw virtual override, no drawing code needed.

virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
PreCreateWindow virtual override, modify the window style.

afx_msg void | OnItemexpanding (NMHDR *pNMHDR, LRESULT *pResult)
TVN_ITEMEXPANDING notification handler, expand the selected node.

afx_msg void | OnSelchanging (NMHDR *pNMHDR, LRESULT *pResult)
TVN_SELCHANGING notification handler, prevent the selection of the missing item.

afx_msg void | OnUpdateViewAdd (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewUpdate (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewAdd ()
WM_COMMAND message handler, cvs add selection.

afx_msg void | OnViewCommit ()
WM_COMMAND message handler, cvs commit selection.

afx_msg void | OnViewUpdate ()
WM_COMMAND message handler, cvs update selection.

afx_msg void | OnViewQueryUpdate ()
WM_COMMAND message handler, cvs -n update selection.

afx_msg void | OnViewDiff ()
WM_COMMAND message handler, [cvs] diff selection.

afx_msg void | OnViewLog ()
WM_COMMAND message handler, cvs log selection.

afx_msg void | OnViewStatus ()
WM_COMMAND message handler, cvs status selection.

afx_msg void | OnViewUnlock ()
WM_COMMAND message handler, cvs admin -u selection.

afx_msg void | OnViewWatchOn ()
WM_COMMAND message handler, cvs watch add selection.

afx_msg void | OnViewWatchOff ()
WM_COMMAND message handler, cvs watch remove selection.

afx_msg void | OnViewEdit ()
WM_COMMAND message handler, cvs edit selection.

afx_msg void | OnViewUnedit ()
WM_COMMAND message handler, cvs unedit selection.

afx_msg void | OnViewWatchers ()
WM_COMMAND message handler, cvs watchers selection.

afx_msg void | OnViewEditors ()
WM_COMMAND message handler, cvs editors selection.

afx_msg void | OnViewRelease ()
WM_COMMAND message handler, cvs release selection.

afx_msg void | OnViewTagNew ()
WM_COMMAND message handler, cvs tag selection.

afx_msg void | OnViewTagDelete ()
WM_COMMAND message handler, cvs tag -d selection.

afx_msg void | OnViewTagBranch ()
WM_COMMAND message handler, cvs tag -b selection.

afx_msg void | OnViewExplore ()
WM_COMMAND message handler, open the explorer.

afx_msg void | OnUpdateViewExplore (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnUpdateViewReload (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewReload ()
WM_COMMAND message handler, refresh view.

afx_msg void | OnViewCheckout ()
WM_COMMAND message handler, cvs checkout.

afx_msg void | OnUpdateViewCheckout (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnViewImport ()
WM_COMMAND message handler, cvs import.

afx_msg void | OnUpdateViewImport (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message)
WM_SETCURSOR message handler, set the hourglass cursor during CVS commands.

afx_msg void | OnSelchanged (NMHDR *pNMHDR, LRESULT *pResult)
TVN_SELCHANGED notification handler, notify the views.

afx_msg void | OnDestroy ()
WM_DESTROY message handler, unregister ignore notification function.

afx_msg void | OnViewReservededit ()
WM_COMMAND message handler, cvs edit -c selection.

afx_msg void | OnViewForceedit ()
WM_COMMAND message handler, cvs edit -f selection.

afx_msg void | OnAppCmdline ()
WM_COMMAND message handler, display command line dialog.

afx_msg void | OnAppRtagbranch ()
WM_COMMAND message handler, cvs rtag -b.

afx_msg void | OnAppRtagcreate ()
WM_COMMAND message handler, cvs rtag.

afx_msg void | OnAppRtagdelete ()
WM_COMMAND message handler, cvs rtag -d.

afx_msg void | OnUpdateAppCmdline (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point)
WM_CONTEXTMENU message handler, display the custom menu.

afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
WM_RBUTTONDOWN message handler, select the clicked item.

afx_msg void | OnUpdateMacro (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg BOOL | OnMacro (UINT nID)
WM_COMMAND message handler, invoke macro.

afx_msg void | OnUpdateCustomize (CCmdUI *pCmdUI)
UPDATE_COMMAND_UI handler.

afx_msg BOOL | OnCustomize (UINT nID)
WM_COMMAND message handler, display the customize dialog.

afx_msg LRESULT | OnResetView (WPARAM, LPARAM)
WM_RESETVIEW message handler, reset view.

Private Methods

void | StoreExpanded (std::vector< UStr > &allExpanded, HTREEITEM root=0L)
bool | DisableCommon ()
void | OnUpdateCmd (CCmdUI *pCmdUI, BOOL needCvsInfos)
void | SetNewStyle (long lStyleMask, BOOL bSetBits)
HTREEITEM | GetItemByLocation (const char *path)
void | DeleteAllItems (HTREEITEM root=0L)
void | RetrievePath (HTREEITEM item, UStr &path)
bool | ProcessSelectionCommand (KiSelectionHandler *handler)

Private Attributes

UStr m_root
bool | m_selectionNotificationLocked
bool | m_selectionChanged
bool | m_resetViewPending

Static Private Attributes

CImageList | m_imageList

Constructor & Destructor Documentation

CWinCvsBrowser::CWinCvsBrowser ( ) [protected]

Definition at line 389 of file WinCvsBrowser.cpp.

00390     : m_selectionNotificationLocked(false), m_selectionChanged(false), m_resetViewPending(false)
00391 {
00392 }

CWinCvsBrowser::~CWinCvsBrowser ( ) [protected, virtual]

Definition at line 394 of file WinCvsBrowser.cpp.

00395 {
00396 }

Member Function Documentation

BOOL CWinCvsBrowser::Create | ( | LPCTSTR | lpszClassName,
 |  | LPCTSTR | lpszWindowName,
 |  | DWORD | dwStyle,
 |  | const RECT & | rect,
 |  | CWnd * | pParentWnd,
 |  | UINT | nID,
 |  | CCreateContext * | pContext = NULL
 | ) | [virtual]

Create virtual override, initialize browser tree control.

Definition at line 426 of file WinCvsBrowser.cpp.

References CStr, FALSE, CMainFrame::GetBrowseHistory(), CWincvsApp::GetMainFrame(), CHistComboBoxEx::GetOldLoc(), m_imageList, ResetBrowser(), SetNewStyle(), and TRUE.

Referenced by CBrowserBar::Create().

00427 {
00428     if( !CTreeView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext) )
00429     {
00430         return FALSE;
00431     }
00432
00433     if( m_imageList.m_hImageList == 0L )
00434         m_imageList.Create(IDB_MODULES, 16, 1, RGB(255, 255, 255));
00435
00436     CTreeCtrl& treeCtrl = GetTreeCtrl();
00437     treeCtrl.SetImageList(&m_imageList, TVSIL_NORMAL);
00438
00439     // Set the initial root
00440     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00441     CMainFrame* mainFrm = app->GetMainFrame();
00442     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00443     CStr newpath((const char*)hist.GetOldLoc());
00444     ResetBrowser(newpath, true);
00445
00446     SetNewStyle(TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, TRUE);
00447
00448     return TRUE;
00449 }

void CWinCvsBrowser::DeleteAllItems ( HTREEITEM root = 0L ) [private]

Delete all items and handle the associated item data

Parameters:
root If root != 0L then delete all childs of root (except root), if root == 0L then delete all

Definition at line 455 of file WinCvsBrowser.cpp.

References ASSERT, EntnodeData::UnRef(), and VERIFY.

Referenced by OnItemexpanding(), and ResetBrowser().

00456 {
00457     // We don't want the file view to be notified when things get deleted
00458     // process selection after we are done with all that jazz below
00459     CSelectionChangeNotifier notifier(this, true);
00460
00461     CTreeCtrl& treeCtrl = GetTreeCtrl();
00462     bool eraseRoot = false;
00463     if( root == 0L )
00464     {
00465         root = treeCtrl.GetRootItem( );
00466         eraseRoot = true;
00467     }
00468
00469     if( root == 0L )
00470         return;
00471
00472     HTREEITEM childItem = treeCtrl.GetNextItem(root, TVGN_CHILD);
00473
00474     // Erase all the childs
00475     while( childItem != 0L )
00476     {
00477         EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
00478         if( data != 0L )
00479         {
00480             treeCtrl.SetItemData(childItem,0L); //So that subsequent references after UnRef() won't SEGV
00481             data->UnRef();  //Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00482         }
00483
00484         DeleteAllItems(childItem);
00485
00486         HTREEITEM nextItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
00487         VERIFY(treeCtrl.DeleteItem(childItem));
00488         childItem = nextItem;
00489     }
00490
00491     // Erase the root only if initially root was 0L
00492     if( eraseRoot )
00493     {
00494         EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(root);
00495         ASSERT(data == 0L);
00496
00497         VERIFY(treeCtrl.DeleteItem(root));
00498     }
00499 }

bool CWinCvsBrowser::DisableCommon ( ) [private]

Check whether the commands should be disabled

Returns:
true if commands should be disabled, false otherwise

Definition at line 1398 of file WinCvsBrowser.cpp.

References CWincvsApp::IsCvsRunning().

Referenced by OnUpdateAppCmdline(), OnUpdateCmd(), OnUpdateMacro(), OnUpdateViewCheckout(), OnUpdateViewExplore(), and OnUpdateViewImport().

01399 {
01400     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01401     return app->IsCvsRunning() || gCvsPrefs.empty();
01402 }

HTREEITEM CWinCvsBrowser::GetItemByLocation ( const char * path ) [private]

Find the tree item corresponding to the given path

Parameters:
path Path to find the item for
Returns:
Handle to the item for a given location, NULL if not found

Definition at line 1168 of file WinCvsBrowser.cpp.

References CStr.

Referenced by ResetView().

01169 {
01170     CStr root(m_root);
01171     if( !root.endsWith(kPathDelimiter) )
01172         root << kPathDelimiter;
01173
01174     CStr subpath(path);
01175     if( !subpath.endsWith(kPathDelimiter) )
01176         subpath << kPathDelimiter;
01177
01178     // Check if it is a sub-path
01179     if( strncmp(root, subpath, root.length()) != 0 )
01180         return 0L;
01181
01182     CTreeCtrl& treeCtrl = GetTreeCtrl();
01183     HTREEITEM item = treeCtrl.GetRootItem();
01184     if( item == 0L )
01185         return 0L;
01186
01187     // Step inside synchronized
01188     const char* tmp = (const char*)subpath + root.length() - 1;
01189     while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
01190     {
01191         const char* name = ++tmp;
01192         if( name[0] == '\0' )
01193             break;
01194
01195         CStr subname;
01196         const char* tmp2 = strchr(name, kPathDelimiter);
01197         if( tmp2 == 0L )
01198             subname = name;
01199         else
01200             subname.set(name, tmp2 - name);
01201
01202         HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01203
01204         // Find the subitem which matches this name
01205         while( childItem != 0L )
01206         {
01207             EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
01208             if( data != 0L )
01209             {
01210                 if( _stricmp((*data)[EntnodeData::kName], subname) == 0 )
01211                 {
01212                     item = childItem;
01213                     break;
01214                 }
01215             }
01216
01217             childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01218         }
01219
01220         if( childItem == 0L )
01221             return 0L;
01222     }
01223
01224     return item;
01225 }

const UStr& CWinCvsBrowser::GetRoot ( void ) const [inline]

Get the current root.

Definition at line 236 of file WinCvsBrowser.h.

References CStr.

Referenced by CWincvsApp::GetRoot(), CWincvsApp::InitInstance(), CWincvsDoc::OnSavesettings(), and CvsPrefs::save().

00236 { return m_root; }

bool CWinCvsBrowser::GetSelectionChanged ( ) const [inline]

Get the selection changed state.

Definition at line 245 of file WinCvsBrowser.h.

00245 { return m_selectionChanged; };

bool CWinCvsBrowser::GetSelectionNotificationLocked ( ) const [inline]

Get the selection notification locked state.

Definition at line 239 of file WinCvsBrowser.h.

00239 { return m_selectionNotificationLocked; }

void CWinCvsBrowser::NotifySelectionChange ( )

Issues notification on selected item change

Definition at line 819 of file WinCvsBrowser.cpp.

References CStr, CWincvsApp::GetFileView(), m_selectionNotificationLocked, CBrowseFileView::ResetView(), and RetrievePath().

Referenced by OnSelchanged(), and CSelectionChangeNotifier::~CSelectionChangeNotifier().

00820 {
00821     if( !m_selectionNotificationLocked )
00822     {
00823         if( m_selectionChanged )
00824         {
00825             CStr path;
00826             HTREEITEM item = GetTreeCtrl().GetSelectedItem();
00827             if( item )
00828             {
00829                 RetrievePath(item, path);
00830                 CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00831                 CBrowseFileView* fileView = app->GetFileView();
00832                 if( fileView )
00833                 {
00834                     fileView->ResetView(path);
00835                 }
00836
00837                 gCvsPrefs.SetLastWorkingDir(path);
00838             }
00839         }
00840     }
00841 }

void CWinCvsBrowser::OnAppCmdline ( ) [protected]

WM_COMMAND message handler, display command line dialog.

Definition at line 1499 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01500 {
01501     KoCommandLineHandler handler;
01502     ProcessSelectionCommand(&handler);
01503 }

void CWinCvsBrowser::OnAppRtagbranch ( ) [protected]

WM_COMMAND message handler, cvs rtag -b.

Definition at line 1506 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01507 {
01508     KoRtagBranchHandler handler;
01509     ProcessSelectionCommand(&handler);
01510 }

void CWinCvsBrowser::OnAppRtagcreate ( ) [protected]

WM_COMMAND message handler, cvs rtag.

Definition at line 1513 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01514 {
01515     KoRtagCreateHandler handler;
01516     ProcessSelectionCommand(&handler);
01517 }

void CWinCvsBrowser::OnAppRtagdelete ( ) [protected]

WM_COMMAND message handler, cvs rtag -d.

Definition at line 1520 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01521 {
01522     KoRtagDeleteHandler handler;
01523     ProcessSelectionCommand(&handler);
01524 }

void CWinCvsBrowser::OnContextMenu | ( | CWnd * | pWnd,
 |  | CPoint | point
 | ) | [protected]

WM_CONTEXTMENU message handler, display the custom menu.

Definition at line 744 of file WinCvsBrowser.cpp.

References GetCustomMenu(), and CWincvsApp::IsCvsRunning().

00745 {
00746     // Prevent from changing directory if cvs is running
00747     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00748     if( app->IsCvsRunning() )
00749     {
00750         return;
00751     }
00752
00753     CTreeCtrl& treeCtrl = GetTreeCtrl();
00754     const HTREEITEM item = treeCtrl.GetSelectedItem();
00755     if( item )
00756     {
00757         // Set the track point in case it's not the mouse click
00758         if( -1 == point.x && -1 == point.y )
00759         {
00760             // Get the icon's rectangle
00761             CRect rectItem;
00762             if( treeCtrl.GetItemRect(item, &rectItem, TRUE) )
00763             {
00764                 point = rectItem.CenterPoint();
00765                 ClientToScreen(&point);
00766             }
00767         }
00768
00769         treeCtrl.SelectItem(item);
00770
00771         // Locate the submenu after item selection
00772         std::auto_ptr<CMenu> pCustomMenu(::GetCustomMenu(kCustomBrowserMenu, this));
00773         if( pCustomMenu.get() )
00774         {
00775             pCustomMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
00776         }
00777     }
00778 }

BOOL CWinCvsBrowser::OnCustomize ( UINT nID ) [protected]

WM_COMMAND message handler, display the customize dialog.

Definition at line 1445 of file WinCvsBrowser.cpp.

References CustomizeMenus(), and TRUE.

01446 {
01447     CustomizeMenus(nID == ID_CUST_FILES_MENU ? kCustomFilesMenu : kCustomBrowserMenu);
01448     return TRUE;
01449 }

void CWinCvsBrowser::OnDestroy ( ) [protected]

WM_DESTROY message handler, unregister ignore notification function.

Definition at line 1471 of file WinCvsBrowser.cpp.

References NotificationManager::CheckOut(), CWincvsApp::GetIgnoreModel(), and KiIgnoreModel::GetNotificationManager().

01472 {
01473     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
01474     {
01475         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
01476     }
01477
01478     CTreeView::OnDestroy();
01479 }

void CWinCvsBrowser::OnDraw ( CDC * pDC ) [protected, virtual]

OnDraw virtual override, no drawing code needed.

Definition at line 402 of file WinCvsBrowser.cpp.

00403 {
00404     // No draw code
00405 }

void CWinCvsBrowser::OnIgnoreChanged ( )

Ignore changed notification handler, post reset view message.

Definition at line 1482 of file WinCvsBrowser.cpp.

References m_resetViewPending.

01483 {
01484     if( !m_resetViewPending )
01485     {
01486         m_resetViewPending = true;
01487         PostMessage(WM_RESETVIEW);
01488     }
01489 }

void CWinCvsBrowser::OnInitialUpdate ( ) [virtual]

OnInitialUpdate virtual override, expand the root item and register ignore notification function.

Definition at line 1027 of file WinCvsBrowser.cpp.

References NotificationManager::CheckIn(), CWincvsApp::GetIgnoreModel(), KiIgnoreModel::GetNotificationManager(), and VERIFY.

01028 {
01029     CTreeView::OnInitialUpdate();
01030
01031     CTreeCtrl& treeCtrl = GetTreeCtrl();
01032     HTREEITEM root = treeCtrl.GetRootItem();
01033     if( root != 0L )
01034     {
01035         treeCtrl.Expand(root, TVE_EXPAND);
01036         VERIFY(treeCtrl.Select(root, TVGN_CARET));
01037     }
01038
01039     if( CWincvsApp* app = (CWincvsApp*)AfxGetApp() )
01040     {
01041         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onIgnoreChanged);
01042     }
01043 }

void CWinCvsBrowser::OnItemexpanding | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

TVN_ITEMEXPANDING notification handler, expand the selected node.

Definition at line 622 of file WinCvsBrowser.cpp.

References CStr, ENTNODE::Data(), DeleteAllItems(), ENT_SUBDIR, Entries_SetMissing(), FileTraverse(), CSortList< T >::Get(), EntnodeData::GetType(), CWincvsApp::IsCvsRunning(), EntnodeData::IsMissing(), kIconFolderLost, EntnodeData::kName, kTraversal, CSortList< T >::NumOfElements(), EntnodeData::Ref(), RetrievePath(), and TRUE.

00623 {
00624     // Prevent from changing directory if cvs is running
00625     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00626     if( app->IsCvsRunning() )
00627     {
00628         *pResult = TRUE;
00629         return;
00630     }
00631
00632     CTreeCtrl& treeCtrl = GetTreeCtrl();
00633     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00634
00635     HTREEITEM item = pNMTreeView->itemNew.hItem;
00636
00637     EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(item);
00638     if( data != 0L && data->IsMissing() )
00639     {
00640         *pResult = TRUE;
00641         return;
00642     }
00643
00644     // Erase all the childs
00645     DeleteAllItems(item);
00646
00647     CStr path;
00648     RetrievePath(item, path);
00649
00650     if( pNMTreeView->action & TVE_COLLAPSE )
00651     {
00652         TBrowserFillDummy traverse(treeCtrl, 0L, item, 0L);
00653         kTraversal res = FileTraverse(path, traverse);
00654     }
00655     else if( pNMTreeView->action & TVE_EXPAND )
00656     {
00657         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00658         TBrowserFill traverse(treeCtrl, 0L, item, entries);
00659         kTraversal res = FileTraverse(path, traverse);
00660
00661         // Add the missing folders
00662         Entries_SetMissing(entries);
00663         int numEntries = entries.NumOfElements();
00664         for(int i = 0; i < numEntries; i++)
00665         {
00666             const ENTNODE & theNode = entries.Get(i);
00667             EntnodeData* data = theNode.Data();
00668             if( !data->IsMissing() || data->GetType() != ENT_SUBDIR )
00669                 continue;
00670
00671             TV_INSERTSTRUCT tvstruct;
00672             tvstruct.hParent = item;
00673             tvstruct.hInsertAfter = TVI_SORT;
00674             tvstruct.item.iImage = kIconFolderLost;
00675             tvstruct.item.iSelectedImage = kIconFolderLost;
00676             tvstruct.item.pszText = (char*)(*data)[EntnodeData::kName];
00677             tvstruct.item.lParam = (long)data->Ref();
00678             tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM;
00679             treeCtrl.InsertItem(&tvstruct);
00680         }
00681     }
00682
00683     *pResult = 0;
00684 }

BOOL CWinCvsBrowser::OnMacro ( UINT nID ) [protected]

WM_COMMAND message handler, invoke macro.

Definition at line 1336 of file WinCvsBrowser.cpp.

References PyDoPython(), and WINCMD_to_UCMD.

01337 {
01338     PyDoPython(WINCMD_to_UCMD(nID));
01339
01340     return 1;
01341 }

void CWinCvsBrowser::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

WM_RBUTTONDOWN message handler, select the clicked item.

Note:
Prevent message from propagating to allow WM_CONTEXTMENU to work

Definition at line 723 of file WinCvsBrowser.cpp.

References CWincvsApp::IsCvsRunning().

00724 {
00725     // Prevent from changing directory if cvs is running
00726     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00727     if( app->IsCvsRunning() )
00728         return;
00729
00730     CTreeCtrl& treeCtrl = GetTreeCtrl();
00731
00732     UINT pFlags;
00733     HTREEITEM testItem = treeCtrl.HitTest(point, &pFlags);
00734
00735     if( testItem != 0L && (pFlags & (TVHT_ONITEM | TVHT_ONITEMBUTTON | TVHT_ONITEMRIGHT)) != 0 )
00736     {
00737         treeCtrl.SelectItem(testItem);
00738     }
00739
00740     //CTreeView::OnRButtonDown(nFlags, point);
00741 }

LRESULT CWinCvsBrowser::OnResetView | ( | WPARAM | ,
 |  | LPARAM |
 | ) | [protected]

WM_RESETVIEW message handler, reset view.

Definition at line 1492 of file WinCvsBrowser.cpp.

References ResetView().

01493 {
01494     ResetView(true, false);
01495     return 0;
01496 }

void CWinCvsBrowser::OnSelchanged | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

TVN_SELCHANGED notification handler, notify the views.

Definition at line 806 of file WinCvsBrowser.cpp.

References m_selectionChanged, and NotifySelectionChange().

00807 {
00808     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00809
00810     m_selectionChanged = true;
00811     NotifySelectionChange();
00812
00813     *pResult = 0;
00814 }

void CWinCvsBrowser::OnSelchanging | ( | NMHDR * | pNMHDR,
 |  | LRESULT * | pResult
 | ) | [protected]

TVN_SELCHANGING notification handler, prevent the selection of the missing item.

Definition at line 781 of file WinCvsBrowser.cpp.

References CWincvsApp::IsCvsRunning(), EntnodeData::IsMissing(), and TRUE.

00782 {
00783     // Prevent from changing directory if cvs is running
00784     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00785     if( app->IsCvsRunning() )
00786     {
00787         *pResult = TRUE;
00788         return;
00789     }
00790
00791     CTreeCtrl& treeCtrl = GetTreeCtrl();
00792     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00793     HTREEITEM item = pNMTreeView->itemNew.hItem;
00794
00795     EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(item);
00796     if( data != 0L && data->IsMissing() )
00797     {
00798         *pResult = TRUE;
00799         return;
00800     }
00801
00802     *pResult = 0;
00803 }

BOOL CWinCvsBrowser::OnSetCursor | ( | CWnd * | pWnd,
 |  | UINT | nHitTest,
 |  | UINT | message
 | ) | [protected]

WM_SETCURSOR message handler, set the hourglass cursor during CVS commands.

Definition at line 1458 of file WinCvsBrowser.cpp.

References CWincvsApp::IsCvsRunning(), and TRUE.

01459 {
01460     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01461     if( app->IsCvsRunning() )
01462     {
01463         SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
01464         return TRUE;
01465     }
01466
01467     return CTreeView::OnSetCursor(pWnd, nHitTest, message);
01468 }

void CWinCvsBrowser::OnUpdateAppCmdline ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 875 of file WinCvsBrowser.cpp.

References DisableCommon().

00876 {
00877     pCmdUI->Enable(!DisableCommon());
00878 }

void CWinCvsBrowser::OnUpdateCmd | ( | CCmdUI * | pCmdUI,
 |  | BOOL | needCvsInfos
 | ) | [private]

Update UI for CVS command

Parameters:
pCmdUI | CCmdUI UI handler
needCvsInfos | true if command needs the CVS controlled selection, false otherwise

Definition at line 691 of file WinCvsBrowser.cpp.

References CStr, DisableCommon(), RetrievePath(), and stat.

Referenced by OnUpdateViewAdd(), and OnUpdateViewUpdate().

00692 {
00693     if( DisableCommon() )
00694     {
00695         pCmdUI->Enable(FALSE);
00696         return;
00697     }
00698
00699     CTreeCtrl& treeCtrl = GetTreeCtrl();
00700     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00701     if( selItem == 0L )
00702     {
00703         pCmdUI->Enable(FALSE);
00704         return;
00705     }
00706
00707     CStr path;
00708     RetrievePath(selItem, path);
00709     if( !path.endsWith(kPathDelimiter) )
00710         path << kPathDelimiter;
00711
00712     path << "CVS";
00713
00714     struct stat sb;
00715     if( stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode) )
00716         pCmdUI->Enable(!needCvsInfos);
00717     else
00718         pCmdUI->Enable(needCvsInfos);
00719 }

void CWinCvsBrowser::OnUpdateCustomize ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1452 of file WinCvsBrowser.cpp.

01453 {
01454     pCmdUI->Enable(TRUE);
01455 }

void CWinCvsBrowser::OnUpdateMacro ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1344 of file WinCvsBrowser.cpp.

References CStr, DisableCommon(), UCmdUI::pCmdUI, PyAppendCache(), PyDoCmdUI(), PyIsUICacheValid(), RetrievePath(), SplitPath(), EntnodeData::UnRef(), EntnodePath::UnRef(), and WINCMD_to_UCMD.

01345 {
01346     if( DisableCommon() )
01347     {
01348         pCmdUI->Enable(FALSE);
01349         return;
01350     }
01351
01352     // Fill the cache with current selection
01353     if( !PyIsUICacheValid() )
01354     {
01355         CTreeCtrl& treeCtrl = GetTreeCtrl();
01356         HTREEITEM selItem = treeCtrl.GetSelectedItem();
01357         if( selItem != 0L )
01358         {
01359             CStr selPath;
01360             RetrievePath(selItem, selPath);
01361             CStr uppath, folder;
01362             SplitPath(selPath, uppath, folder);
01363
01364             bool deleteData = false;
01365             EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(selItem);
01366             if( data == 0L )
01367             {
01368                 deleteData = true;
01369                 EntnodePath *thePath = new EntnodePath(uppath);
01370                 data = new EntnodeFolder(folder, thePath);
01371                 thePath->UnRef();
01372             }
01373
01374             PyAppendCache(data);
01375
01376             if( deleteData )
01377                 data->UnRef();
01378         }
01379     }
01380
01381     UCmdUI ucmdui(WINCMD_to_UCMD(pCmdUI->m_nID));
01382     ucmdui.pCmdUI = pCmdUI;
01383     PyDoCmdUI(&ucmdui);
01384 }

void CWinCvsBrowser::OnUpdateViewAdd ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 869 of file WinCvsBrowser.cpp.

References OnUpdateCmd().

00870 {
00871     OnUpdateCmd(pCmdUI, FALSE);
00872 }

void CWinCvsBrowser::OnUpdateViewCheckout ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1412 of file WinCvsBrowser.cpp.

References DisableCommon().

01413 {
01414     if( DisableCommon() )
01415     {
01416         pCmdUI->Enable(FALSE);
01417         return;
01418     }
01419
01420     pCmdUI->Enable(TRUE);
01421     pCmdUI->SetText("Chec&kout module...");
01422 }

void CWinCvsBrowser::OnUpdateViewExplore ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1061 of file WinCvsBrowser.cpp.

References DisableCommon().

01062 {
01063     if( DisableCommon() )
01064     {
01065         pCmdUI->Enable(FALSE);
01066         return;
01067     }
01068
01069     CTreeCtrl& treeCtrl = GetTreeCtrl();
01070     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01071     if( selItem == 0L )
01072     {
01073         pCmdUI->Enable(FALSE);
01074         return;
01075     }
01076
01077     pCmdUI->Enable(TRUE);
01078 }

void CWinCvsBrowser::OnUpdateViewImport ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1432 of file WinCvsBrowser.cpp.

References DisableCommon().

01433 {
01434     if( DisableCommon() )
01435     {
01436         pCmdUI->Enable(FALSE);
01437         return;
01438     }
01439
01440     pCmdUI->Enable(TRUE);
01441     pCmdUI->SetText("&Import module...");
01442 }

void CWinCvsBrowser::OnUpdateViewReload ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 1323 of file WinCvsBrowser.cpp.

References CWincvsApp::IsCvsRunning().

01324 {
01325     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01326     pCmdUI->Enable(!app->IsCvsRunning());
01327 }

void CWinCvsBrowser::OnUpdateViewUpdate ( CCmdUI * pCmdUI ) [protected]

UPDATE_COMMAND_UI handler.

Definition at line 881 of file WinCvsBrowser.cpp.

References OnUpdateCmd().

00882 {
00883     OnUpdateCmd(pCmdUI, TRUE);
00884 }

void CWinCvsBrowser::OnViewAdd ( ) [protected]

WM_COMMAND message handler, cvs add selection.

Definition at line 887 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00888 {
00889     KoAddHandler handler;
00890     ProcessSelectionCommand(&handler);
00891 }

void CWinCvsBrowser::OnViewCheckout ( ) [protected]

WM_COMMAND message handler, cvs checkout.

Definition at line 1405 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01406 {
01407     KoCheckoutHandler handler;
01408     ProcessSelectionCommand(&handler);
01409 }

void CWinCvsBrowser::OnViewCommit ( ) [protected]

WM_COMMAND message handler, cvs commit selection.

Definition at line 894 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00895 {
00896     KoCommitHandler handler;
00897     ProcessSelectionCommand(&handler);
00898 }

void CWinCvsBrowser::OnViewDiff ( ) [protected]

WM_COMMAND message handler, [cvs] diff selection.

Definition at line 915 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00916 {
00917     KoDiffHandler handler;
00918     ProcessSelectionCommand(&handler);
00919 }

void CWinCvsBrowser::OnViewEdit ( ) [protected]

WM_COMMAND message handler, cvs edit selection.

Definition at line 957 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00958 {
00959     KoEditHandler handler;
00960     ProcessSelectionCommand(&handler);
00961 }

void CWinCvsBrowser::OnViewEditors ( ) [protected]

WM_COMMAND message handler, cvs editors selection.

Definition at line 992 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00993 {
00994     KoEditorsHandler handler;
00995     ProcessSelectionCommand(&handler);
00996 }

void CWinCvsBrowser::OnViewExplore ( ) [protected]

WM_COMMAND message handler, open the explorer.

Definition at line 1046 of file WinCvsBrowser.cpp.

References CStr, cvs_err(), and RetrievePath().

01047 {
01048     CTreeCtrl& treeCtrl = GetTreeCtrl();
01049     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01050
01051     CStr path;
01052     RetrievePath(selItem, path);
01053     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path, 0L, 0L, SW_SHOWDEFAULT);
01054     if( (long)hInst < 32 )
01055     {
01056         cvs_err("Unable to explore '%s' (error %d)\n", (char*)path, GetLastError());
01057     }
01058 }

void CWinCvsBrowser::OnViewForceedit ( ) [protected]

WM_COMMAND message handler, cvs edit -f selection.

Definition at line 971 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00972 {
00973     KoForceEditHandler handler;
00974     ProcessSelectionCommand(&handler);
00975 }

void CWinCvsBrowser::OnViewImport ( ) [protected]

WM_COMMAND message handler, cvs import.

Definition at line 1425 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01426 {
01427     KoImportHandler handler;
01428     ProcessSelectionCommand(&handler);
01429 }

void CWinCvsBrowser::OnViewLog ( ) [protected]

WM_COMMAND message handler, cvs log selection.

Definition at line 922 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00923 {
00924     KoLogHandler handler;
00925     ProcessSelectionCommand(&handler);
00926 }

void CWinCvsBrowser::OnViewQueryUpdate ( ) [protected]

WM_COMMAND message handler, cvs -n update selection.

Definition at line 908 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00909 {
00910     KoQueryUpdateHandler handler;
00911     ProcessSelectionCommand(&handler);
00912 }

void CWinCvsBrowser::OnViewRelease ( ) [protected]

WM_COMMAND message handler, cvs release selection.

Definition at line 999 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01000 {
01001     KoReleaseHandler handler;
01002     ProcessSelectionCommand(&handler);
01003 }

void CWinCvsBrowser::OnViewReload ( ) [protected]

WM_COMMAND message handler, refresh view.

Definition at line 1330 of file WinCvsBrowser.cpp.

References ResetView().

01331 {
01332     ResetView(true, true);
01333 }

void CWinCvsBrowser::OnViewReservededit ( ) [protected]

WM_COMMAND message handler, cvs edit -c selection.

Definition at line 964 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00965 {
00966     KoReservedEditHandler handler;
00967     ProcessSelectionCommand(&handler);
00968 }

void CWinCvsBrowser::OnViewStatus ( ) [protected]

WM_COMMAND message handler, cvs status selection.

Definition at line 929 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00930 {
00931     KoStatusHandler handler;
00932     ProcessSelectionCommand(&handler);
00933 }

void CWinCvsBrowser::OnViewTagBranch ( ) [protected]

WM_COMMAND message handler, cvs tag -b selection.

Definition at line 1020 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01021 {
01022     KoBranchTagHandler handler;
01023     ProcessSelectionCommand(&handler);
01024 }

void CWinCvsBrowser::OnViewTagDelete ( ) [protected]

WM_COMMAND message handler, cvs tag -d selection.

Definition at line 1013 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01014 {
01015     KoDeleteTagHandler handler;
01016     ProcessSelectionCommand(&handler);
01017 }

void CWinCvsBrowser::OnViewTagNew ( ) [protected]

WM_COMMAND message handler, cvs tag selection.

Definition at line 1006 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

01007 {
01008     KoCreateTagHandler handler;
01009     ProcessSelectionCommand(&handler);
01010 }

void CWinCvsBrowser::OnViewUnedit ( ) [protected]

WM_COMMAND message handler, cvs unedit selection.

Definition at line 978 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00979 {
00980     KoUneditHandler handler;
00981     ProcessSelectionCommand(&handler);
00982 }

void CWinCvsBrowser::OnViewUnlock ( ) [protected]

WM_COMMAND message handler, cvs admin -u selection.

Definition at line 936 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00937 {
00938     KoUnlockHandler handler;
00939     ProcessSelectionCommand(&handler);
00940 }

void CWinCvsBrowser::OnViewUpdate ( ) [protected]

WM_COMMAND message handler, cvs update selection.

Definition at line 901 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00902 {
00903     KoUpdateHandler handler;
00904     ProcessSelectionCommand(&handler);
00905 }

void CWinCvsBrowser::OnViewWatchers ( ) [protected]

WM_COMMAND message handler, cvs watchers selection.

Definition at line 985 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00986 {
00987     KoWatchersHandler handler;
00988     ProcessSelectionCommand(&handler);
00989 }

void CWinCvsBrowser::OnViewWatchOff ( ) [protected]

WM_COMMAND message handler, cvs watch remove selection.

Definition at line 950 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00951 {
00952     KoWatchOffHandler handler;
00953     ProcessSelectionCommand(&handler);
00954 }

void CWinCvsBrowser::OnViewWatchOn ( ) [protected]

WM_COMMAND message handler, cvs watch add selection.

Definition at line 943 of file WinCvsBrowser.cpp.

References ProcessSelectionCommand().

00944 {
00945     KoWatchOnHandler handler;
00946     ProcessSelectionCommand(&handler);
00947 }

BOOL CWinCvsBrowser::PreCreateWindow ( CREATESTRUCT & cs ) [protected, virtual]

PreCreateWindow virtual override, modify the window style.

Definition at line 1387 of file WinCvsBrowser.cpp.

01388 {
01389     cs.style |= WS_TABSTOP | TVS_SHOWSELALWAYS;
01390
01391     return CTreeView::PreCreateWindow(cs);
01392 }

bool CWinCvsBrowser::ProcessSelectionCommand ( KiSelectionHandler * handler ) [private]

Process the selection handler command

Parameters:
handler Command selection handler
Returns:
true if the command was processed, false otherwise

Definition at line 848 of file WinCvsBrowser.cpp.

References CStr, KiSelectionHandler::OnFolder(), and RetrievePath().

Referenced by OnAppCmdline(), OnAppRtagbranch(), OnAppRtagcreate(), OnAppRtagdelete(), OnViewAdd(), OnViewCheckout(), OnViewCommit(), OnViewDiff(), OnViewEdit(), OnViewEditors(), OnViewForceedit(), OnViewImport(), OnViewLog(), OnViewQueryUpdate(), OnViewRelease(), OnViewReservededit(), OnViewStatus(), OnViewTagBranch(), OnViewTagDelete(), OnViewTagNew(), OnViewUnedit(), OnViewUnlock(), OnViewUpdate(), OnViewWatchers(), OnViewWatchOff(), and OnViewWatchOn().

00849 {
00850     bool res = false;
00851
00852     CTreeCtrl& treeCtrl = GetTreeCtrl();
00853     HTREEITEM selItem = treeCtrl.GetSelectedItem();
00854
00855     if( selItem )
00856     {
00857         CStr path;
00858
00859         RetrievePath(selItem, path);
00860         handler->OnFolder(path);
00861
00862         res = true;
00863     }
00864
00865     return res;
00866 }

void CWinCvsBrowser::ResetBrowser | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Set the browser root path

Parameters:
path | Browser root path
notifyView | true to notify the file view, false otherwise
Returns:
true on success, false otherwise

Definition at line 507 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, and VERIFY.

Referenced by CMainFrame::ChangeLocation(), Create(), CWincvsApp::InitInstance(), CWincvsDoc::OnBrowserOpen(), CMainFrame::OnClose(), and ResetView().

00508 {
00509     CWaitCursor doWait;
00510
00511     // Must make a copy of 'path' before calling DeleteAllItems(), since
00512     // this function may have been called with 'm_root' passed as the first
00513     // parameter (in fact it is in several places in the code) whose value
00514     // gets deleted by the call to DeleteAllItems() below, making 'path'
00515     // point to an invalid memory location
00516     CStr pathCopy(path);
00517     DeleteAllItems();
00518     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00519
00520     m_root = pathCopy;
00521
00522     if( pathCopy.empty() )
00523         return;
00524
00525     if( !isReload )
00526     {
00527         if( HasPersistentSettings(m_root) )
00528             LoadPersistentSettings(m_root);
00529         else
00530         {
00531             // Check if the path has a CVS folder. If not,
00532             // we don't want the user to be prompted (like when
00533             // WinCvs is starting for the first time).
00534             UStr cvsFolder(m_root);
00535             if( !cvsFolder.endsWith(kPathDelimiter) )
00536                 cvsFolder << kPathDelimiter;
00537
00538             cvsFolder << "CVS";
00539             struct stat sb;
00540             if( stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode) )
00541                 AskCreatePersistentSettings(m_root);
00542         }
00543     }
00544
00545     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00546     CMainFrame* mainFrm = app->GetMainFrame();
00547     CHistComboBoxEx& hist = mainFrm->GetBrowseHistory();
00548     hist.NewRoot(m_root);
00549
00550     CTreeCtrl& treeCtrl = GetTreeCtrl();
00551     TBrowserFillDummy traverse(treeCtrl, 0L, 0L, 0L);
00552     kTraversal res = FileTraverse(m_root, traverse);
00553
00554     CBrowseFileView* fileView = app->GetFileView();
00555     if( fileView != 0L )
00556     {
00557         HTREEITEM root = treeCtrl.GetRootItem();
00558         if( root != 0L )
00559         {
00560             treeCtrl.Expand(root, TVE_EXPAND);
00561             if( notifyView )
00562             {
00563                 VERIFY(treeCtrl.Select(root, TVGN_CARET));
00564             }
00565         }
00566     }
00567 }

void CWinCvsBrowser::ResetView | ( | bool | forceReload = false,
 |  | bool | notifyView = false
 | ) |

Force reload or check modifications before redrawing and optionally synchronize the file view

Parameters:
forceReload | true to force the refresh, false otherwise
notifyView | true to notify the file view, false otherwise

Definition at line 1268 of file WinCvsBrowser.cpp.

References CStr, CWincvsApp::GetFileView(), GetItemByLocation(), m_resetViewPending, ResetBrowser(), CBrowseFileView::ResetView(), RetrievePath(), StepToLocation(), StoreExpanded(), and VERIFY.

Referenced by OnResetView(), OnViewReload(), and CBrowseFileView::ResetView().

01269 {
01270     // No outstanding request to reset the view any more
01271     m_resetViewPending = false;
01272
01273     CWaitCursor doWait;
01274     CWndRedrawMngr redrawMngr(this);
01275
01276     bool contentChanged = false;
01277
01278     vector<CStr> allExpanded;
01279     StoreExpanded(allExpanded);
01280
01281     CTreeCtrl& treeCtrl = GetTreeCtrl();
01282     CStr selPath;
01283
01284     HTREEITEM selItem = treeCtrl.GetSelectedItem();
01285     if( selItem != 0L )
01286         RetrievePath(selItem, selPath);
01287
01288     if( forceReload )
01289     {
01290         ResetBrowser(m_root);
01291         contentChanged = true;
01292     }
01293
01294     if( contentChanged )
01295     {
01296         // Restore the expanded paths and the selected item
01297         vector<CStr>::const_iterator i;
01298         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
01299         {
01300             StepToLocation(*i);
01301         }
01302
01303         if( !selPath.empty() )
01304         {
01305             selItem = GetItemByLocation(selPath);
01306             if( selItem != 0L )
01307             {
01308                 VERIFY(treeCtrl.Select(selItem, TVGN_CARET));
01309                 treeCtrl.EnsureVisible(selItem);
01310             }
01311         }
01312     }
01313
01314     // We don't need to notify the file view if we force the reload because that's already done
01315     if( notifyView )
01316     {
01317         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01318         app->GetFileView()->ResetView();
01319     }
01320 }

void CWinCvsBrowser::RetrievePath | ( | HTREEITEM | item,
 |  | UStr & | path
 | ) | [private]

Given an item of the tree, guess the full path.

Parameters:
item | Item to retrieve the path from
path | Return the path for the item

Definition at line 592 of file WinCvsBrowser.cpp.

References CStr, m_root, and VERIFY.

Referenced by NotifySelectionChange(), OnItemexpanding(), OnUpdateCmd(), OnUpdateMacro(), OnViewExplore(), ProcessSelectionCommand(), ResetView(), and StoreExpanded().

00593 {
00594     CTreeCtrl& treeCtrl = GetTreeCtrl();
00595
00596     CStr tmp, newPath;
00597     path = "";
00598     TV_ITEM pItem;
00599     char name[512];
00600
00601     do
00602     {
00603         pItem.hItem = item;
00604         pItem.pszText = name;
00605         pItem.cchTextMax = 512;
00606         pItem.mask = TVIF_HANDLE | TVIF_TEXT;
00607
00608         VERIFY(treeCtrl.GetItem(&pItem));
00609         item = treeCtrl.GetParentItem(item);
00610
00611         tmp = path;
00612         newPath = item == 0L ? (const char*)m_root : pItem.pszText;
00613         if( !newPath.endsWith(kPathDelimiter) )
00614             newPath << kPathDelimiter;
00615
00616         newPath << path;
00617         path = newPath;
00618     } while(item != 0L);
00619 }

void CWinCvsBrowser::SetNewStyle | ( | long | lStyleMask,
 |  | BOOL | bSetBits
 | ) | [private]

Set the style for the tree control

Parameters:
lStyleMask | Style mask
bSetBits | true to set the new style, false to remove style

Definition at line 574 of file WinCvsBrowser.cpp.

Referenced by Create().

00575 {
00576     long lStyleOld;
00577
00578     lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE);
00579     lStyleOld &= ~lStyleMask;
00580     if( bSetBits )
00581         lStyleOld |= lStyleMask;
00582
00583     SetWindowLong(m_hWnd, GWL_STYLE, lStyleOld);
00584     SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
00585 }

CWinCvsBrowser::SetSelectionChanged ( bool selectionChanged ) [inline]

Set the selection changed state.

Definition at line 248 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier::CSelectionChangeNotifier(), and CSelectionChangeNotifier::~CSelectionChangeNotifier().

00248 { m_selectionChanged = selectionChanged; };

CWinCvsBrowser::SetSelectionNotificationLocked ( bool selectionNotificationLocked ) [inline]

Set the selection notification locked state.

Definition at line 242 of file WinCvsBrowser.h.

Referenced by CSelectionChangeNotifier::CSelectionChangeNotifier(), and CSelectionChangeNotifier::~CSelectionChangeNotifier().

00242 { m_selectionNotificationLocked = selectionNotificationLocked; }

bool CWinCvsBrowser::StepToLocation | ( | const char * | path,
 |  | bool | notifyView = false
 | ) |

Expand and select the path and optionally synchronize the file view

Parameters:
path | Path to select
notifyView | true to notify the file view, false otherwise
Returns:
true on success, false otherwise

Definition at line 1086 of file WinCvsBrowser.cpp.

References CStr, and VERIFY.

Referenced by CWincvsApp::InitInstance(), CMainFrame::OnDropFiles(), ResetView(), and CBrowseFileView::ResetView().

01087 {
01088     bool bRes = false;
01089
01090     CStr root(m_root);
01091     if( !root.endsWith(kPathDelimiter) )
01092         root << kPathDelimiter;
01093
01094     CStr subpath(path);
01095     if( !subpath.endsWith(kPathDelimiter) )
01096         subpath << kPathDelimiter;
01097
01098     // Check if it is a sub-path
01099     if( strnicmp(root, subpath, root.length()) != 0 )
01100         return false;
01101
01102     CTreeCtrl& treeCtrl = GetTreeCtrl();
01103     HTREEITEM item = treeCtrl.GetRootItem();
01104     HTREEITEM lastitem = 0L;
01105     if( item == 0L )
01106         return false;
01107
01108     if( stricmp(root, subpath) == 0 )
01109     {
01110         // Must select root node
01111         lastitem = item;
01112         treeCtrl.Expand(item, TVE_EXPAND);
01113     }
01114     else
01115     {
01116         // Step inside synchronized
01117         const char* tmp = (const char*)subpath + root.length() - 1;
01118         while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
01119         {
01120             const char* name = ++tmp;
01121             if( name[0] == '\0' )
01122                 break;
01123
01124             CStr subname;
01125             const char* tmp2 = strchr(name, kPathDelimiter);
01126             if( tmp2 == 0L )
01127                 subname = name;
01128             else
01129                 subname.set(name, tmp2 - name);
01130
01131             HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01132
01133             // Find the subitem which matches this name
01134             while( childItem != 0L )
01135             {
01136                 EntnodeData* data = (EntnodeData*)treeCtrl.GetItemData(childItem);
01137                 if( data != 0L )
01138                 {
01139                     if( _stricmp((*data)[EntnodeData::kName], subname) == 0 )
01140                     {
01141                         // Found it !
01142                         lastitem = item = childItem;
01143                         treeCtrl.Expand(item, TVE_EXPAND);
01144                         break;
01145                     }
01146                 }
01147
01148                 childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01149             }
01150         }
01151     }
01152
01153     // In case this is called by the view, turn off notifying when the item gets selected
01154     if( lastitem != 0L )
01155     {
01156         CSelectionChangeNotifier notifier(this, notifyView);
01157         VERIFY( bRes = (treeCtrl.Select(lastitem, TVGN_CARET) != 0) );
01158     }
01159
01160     return bRes;
01161 }

void CWinCvsBrowser::StoreExpanded | ( | std::vector< UStr > & | allExpanded,
 |  | HTREEITEM | root = 0L
 | ) | [private]

Store expanded items

Parameters:
allExpanded | Return the collection of expanded items
root | Start item handle, NULL to start from root item
Note:
Recursive

Definition at line 1233 of file WinCvsBrowser.cpp.

References CStr, RetrievePath(), and VERIFY.

Referenced by ResetView().

01234 {
01235     HTREEITEM item = root;
01236     CTreeCtrl& treeCtrl = GetTreeCtrl();
01237     if( item == 0L )
01238         item = treeCtrl.GetRootItem();
01239
01240     if( item == 0L )
01241         return;
01242
01243     TV_ITEM pItem;
01244     pItem.hItem = item;
01245     pItem.mask = TVIF_STATE;
01246     VERIFY(treeCtrl.GetItem(&pItem));
01247
01248     if( pItem.state & TVIS_EXPANDED )
01249     {
01250         CStr path;
01251         RetrievePath(item, path);
01252         allExpanded.push_back(path);
01253     }
01254
01255     HTREEITEM childItem = treeCtrl.GetNextItem(item, TVGN_CHILD);
01256     while( childItem != 0L )
01257     {
01258         StoreExpanded(allExpanded, childItem);
01259         childItem = treeCtrl.GetNextItem(childItem, TVGN_NEXT);
01260     }
01261 }

Member Data Documentation

CImageList CWinCvsBrowser::m_imageList [static, private]

Several folders aspects image list

Definition at line 312 of file WinCvsBrowser.cpp.

Referenced by Create().

bool CWinCvsBrowser::m_resetViewPending [private]

Flag to indicate whether request to rebuild the view is pending

Definition at line 211 of file WinCvsBrowser.h.

Referenced by OnIgnoreChanged(), and ResetView().

UStr CWinCvsBrowser::m_root [private]

Current path of the browser

Definition at line 206 of file WinCvsBrowser.h.

Referenced by ResetBrowser(), and RetrievePath().

bool CWinCvsBrowser::m_selectionChanged [private]

Flag to indicate whether selection indeed changed since it was set to true, valid if m_isSelectionNotificationLocked is true

Definition at line 210 of file WinCvsBrowser.h.

Referenced by OnSelchanged().

bool CWinCvsBrowser::m_selectionNotificationLocked [private]

Flag to indicate whether the propagating selection changes is currently locked out

Definition at line 209 of file WinCvsBrowser.h.

Referenced by NotifySelectionChange().

The documentation for this class was generated from the following files:
  • WinCvs/WinCvsBrowser.h
  • WinCvs/WinCvsBrowser.cpp
Generated on Fri Jan 31 12:21:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 114 of file wincvsDoc.cpp.

00115 {
00116     // Use OLE compound files
00117     //EnableCompoundFile();
00118
00119     // TODO: add one-time construction code here
00120
00121     //EnableAutomation();
00122
00123     //AfxOleLockApp();
00124 }

CWincvsDoc::~CWincvsDoc ( ) [virtual]

Definition at line 126 of file wincvsDoc.cpp.

00127 {
00128     //AfxOleUnlockApp();
00129 }

Member Function Documentation

void CWincvsDoc::OnAppCmdline ( ) [protected]

Definition at line 242 of file wincvsDoc.cpp.

References CvsCmdCommandLine().

00243 {
00244     KoCommandLineHandler handler;
00245     CvsCmdCommandLine(handler);
00246 }

void CWincvsDoc::OnAppLogin ( ) [protected]

Definition at line 248 of file wincvsDoc.cpp.

References CvsCmdLogin().

00249 {
00250     CvsCmdLogin();
00251 }

void CWincvsDoc::OnAppLogout ( ) [protected]

Definition at line 353 of file wincvsDoc.cpp.

References CvsCmdLogout().

00354 {
00355     CvsCmdLogout();
00356 }

void CWincvsDoc::OnAppPreferences ( ) [protected]

Definition at line 237 of file wincvsDoc.cpp.

References CompatGetPrefs().

00238 {
00239     CompatGetPrefs();
00240 }

void CWincvsDoc::OnAppRtagBranch ( ) [protected]

Definition at line 310 of file wincvsDoc.cpp.

References CvsCmdRtagBranch().

00311 {
00312     KoRtagBranchHandler handler;
00313     CvsCmdRtagBranch(handler);
00314 }

void CWincvsDoc::OnAppRtagDelete ( ) [protected]

Definition at line 304 of file wincvsDoc.cpp.

References CvsCmdRtagDelete().

00305 {
00306     KoRtagDeleteHandler handler;
00307     CvsCmdRtagDelete(handler);
00308 }

void CWincvsDoc::OnAppRtagNew ( ) [protected]

Definition at line 298 of file wincvsDoc.cpp.

References CvsCmdRtagCreate().

00299 {
00300     KoRtagCreateHandler handler;
00301     CvsCmdRtagCreate(handler);
00302 }

void CWincvsDoc::OnBrowserOpen ( ) [protected]

Definition at line 279 of file wincvsDoc.cpp.

References BrowserGetDirectory(), CStr, CWincvsApp::GetBrowserView(), and CWinCvsBrowser::ResetBrowser().

00280 {
00281     CStr newPath;
00282     if( BrowserGetDirectory("Select a folder to open with the browser", newPath) )
00283     {
00284         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00285         if( app )
00286         {
00287             app->GetBrowserView()->ResetBrowser(newPath, true);
00288         }
00289     }
00290 }

BOOL CWincvsDoc::OnMacroAdmin ( UINT nID ) [protected]

Definition at line 316 of file wincvsDoc.cpp.

References CvsCmdMacrosAdmin(), ID_MACRO_ADMIN, and CMacroEntry::path.

00317 {
00318     CMacroEntry & entry = gMacrosAdmin.entries[nID - ID_MACRO_ADMIN];
00319     CvsCmdMacrosAdmin(entry.path);
00320
00321     return 1;
00322 }

BOOL CWincvsDoc::OnNewDocument ( ) [virtual]

Definition at line 136 of file wincvsDoc.cpp.

References FALSE, and TRUE.

00137 {
00138     if (!CDocument::OnNewDocument())
00139         return FALSE;
00140
00141     return TRUE;
00142 }

void CWincvsDoc::OnSavesettings ( ) [protected]

Definition at line 363 of file wincvsDoc.cpp.

References AskCreatePersistentSettings(), CWincvsApp::GetBrowserView(), and CWinCvsBrowser::GetRoot().

00364 {
00365     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00366     AskCreatePersistentSettings(app->GetBrowserView()->GetRoot());
00367 }

void CWincvsDoc::OnStopcvs ( ) [protected]

Definition at line 265 of file wincvsDoc.cpp.

References stopCVS().

00266 {
00267     stopCVS();
00268 }

void CWincvsDoc::OnUpdateCvsCmd ( CCmdUI * pCmdUI ) [protected]

Definition at line 253 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::IsCvsRunning(), and TRUE.

00254 {
00255     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00256     pCmdUI->Enable(app->IsCvsRunning() || gCvsPrefs.empty() ? FALSE : TRUE);
00257 }

void CWincvsDoc::OnUpdateMacroAdmin ( CCmdUI * pCmdUI ) [protected]

Definition at line 324 of file wincvsDoc.cpp.

References CTcl_Interp::IsAvail(), CWincvsApp::IsCvsRunning(), and TRUE.

00325 {
00326     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00327     if( app->IsCvsRunning() || gCvsPrefs.empty() || !CTcl_Interp::IsAvail() )
00328     {
00329         pCmdUI->Enable(FALSE);
00330         return;
00331     }
00332
00333     if( pCmdUI->m_pSubMenu != 0L || pCmdUI->m_pMenu == 0L )
00334         return;
00335
00336     int iMRUMax = pCmdUI->m_pMenu->GetMenuItemCount();
00337     for (int iMRU = 0; iMRU < iMRUMax; iMRU++)
00338         pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID + iMRU, MF_BYCOMMAND);
00339
00340     vector<CMacroEntry>::const_iterator i;
00341     for(i = gMacrosAdmin.entries.begin(); i != gMacrosAdmin.entries.end(); ++i)
00342     {
00343         pCmdUI->m_pMenu->InsertMenu(pCmdUI->m_nIndex++,
00344             MF_STRING | MF_BYPOSITION, pCmdUI->m_nID++,
00345             (*i).name);
00346     }
00347
00348     pCmdUI->m_nIndexMax = pCmdUI->m_pMenu->GetMenuItemCount();
00349     pCmdUI->m_nIndex--; // point to last menu added
00350     pCmdUI->m_bEnableChanged = TRUE;    // all the added items are enabled
00351 }

void CWincvsDoc::OnUpdatePrefs ( CCmdUI * pCmdUI ) [protected]

Definition at line 259 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::IsCvsRunning(), and TRUE.

00260 {
00261     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00262     pCmdUI->Enable(app->IsCvsRunning() ? FALSE : TRUE);
00263 }

void CWincvsDoc::OnUpdateSavesettings ( CCmdUI * pCmdUI ) [protected]

Definition at line 369 of file wincvsDoc.cpp.

References CWincvsApp::IsCvsRunning().

00370 {
00371     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00372     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
00373 }

void CWincvsDoc::OnUpdateStopcvs ( CCmdUI * pCmdUI ) [protected]

Definition at line 270 of file wincvsDoc.cpp.

References FALSE, CWincvsApp::IsCvsRunning(), CWincvsApp::IsCvsStopping(), and TRUE.

00271 {
00272     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00273     if( app )
00274     {
00275         pCmdUI->Enable(app->IsCvsRunning() && !app->IsCvsStopping() ? TRUE : FALSE);
00276     }
00277 }

void CWincvsDoc::OnUpdateUsePyshell ( CCmdUI * pCmdUI ) [protected]

Definition at line 386 of file wincvsDoc.cpp.

References SHELL_PYTHON.

00387 {
00388     pCmdUI->Enable(CPython_Interp::IsAvail());
00389     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_PYTHON);
00390 }

void CWincvsDoc::OnUpdateUseTclshell ( CCmdUI * pCmdUI ) [protected]

Definition at line 398 of file wincvsDoc.cpp.

References SHELL_TCL.

00399 {
00400     pCmdUI->Enable(CTcl_Interp::IsAvail());
00401     pCmdUI->SetRadio(gCvsPrefs.GetUseShell() == SHELL_TCL);
00402 }

void CWincvsDoc::OnUsePyshell ( ) [protected]

Definition at line 380 of file wincvsDoc.cpp.

References cvs_out().

00381 {
00382     gCvsPrefs.SetUseShell(SHELL_PYTHON);
00383     cvs_out("Switching the shell to Python...\n");
00384 }

void CWincvsDoc::OnUseTclshell ( ) [protected]

Definition at line 392 of file wincvsDoc.cpp.

References cvs_out().

00393 {
00394     gCvsPrefs.SetUseShell(SHELL_TCL);
00395     cvs_out("Switching the shell to TCL...\n");
00396 }

void CWincvsDoc::OnViewBrowselocationRemoveunwanted ( ) [protected]

Definition at line 375 of file wincvsDoc.cpp.

00376 {
00377     AfxMessageBox("To remove the unwanted location history items click DEL key when selecting from the combo box list.", MB_OK | MB_ICONINFORMATION);
00378 }

void CWincvsDoc::OnViewInit ( ) [protected]

Definition at line 358 of file wincvsDoc.cpp.

References CvsCmdInit().

00359 {
00360     CvsCmdInit();
00361 }

void CWincvsDoc::OnViewPathChanged ( ) [protected]

Definition at line 292 of file wincvsDoc.cpp.

00293 {
00294     // TODO: Add notification handler code
00295
00296 }

void CWincvsDoc::Serialize ( CArchive & ar ) [virtual]

Definition at line 188 of file wincvsDoc.cpp.

References EditStreamCallBack(), and NULL.

00189 {
00190     if (ar.IsStoring())
00191     {
00192         POSITION pos = GetFirstViewPosition();
00193         CView* view;
00194         while((view = GetNextView(pos)) != NULL)
00195         {
00196             if(view->IsKindOf(RUNTIME_CLASS(CRichEditView)))
00197             {
00198                 int nFormat = SF_TEXT;
00199                 EDITSTREAM es = {0, 0, (EDITSTREAMCALLBACK)EditStreamCallBack};
00200                 _afxRichEditCookie cookie(ar);
00201                 es.dwCookie = (DWORD)&cookie;
00202                 ((CRichEditView *)view)->GetRichEditCtrl().StreamOut(nFormat, es);
00203                 break;
00204             }
00205         }
00206     }
00207     else
00208     {
00209         // We don't load right now
00210     }
00211
00212     // Calling the base class CDocument enables serialization
00213     //  of the container document's COleClientItem objects.
00214     // (but we don't have COleClientItem)
00215     CDocument::Serialize(ar);
00216 }

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 Fri Jan 31 12:21:22 2003 for WinCvs Source by doxygen 1.3-rc2


CWincvsView Class Reference

Console window class. More...

#include <wincvsView.h>

Inheritance diagram for CWincvsView:

[legend]
Collaboration diagram for CWincvsView:

[legend]
List of all members.

Public Methods

CWincvsDoc * GetDocument ()
virtual void | OnDraw (CDC *pDC)
OnDraw virtual override, do nothing here.

virtual BOOL | PreCreateWindow (CREATESTRUCT &cs)
PreCreateWindow virtual override, modify the window style.

virtual | ~CWincvsView ()
CHARFORMAT | GetCurFormat (bool jumpEnd=true)
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)

Protected Methods

CWincvsView ()
virtual void | OnInitialUpdate ()
OnInitialUpdate virtual override, set the character font.

virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo)
OnPreparePrinting virtual override.

virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo)
OnBeginPrinting virtual override.

virtual void | OnEndPrinting (CDC *pDC, CPrintInfo *pInfo)
OnEndPrinting virtual override.

virtual BOOL | IsSelected (const CObject *pDocItem) const
IsSelected virtual override.

afx_msg void | OnDestroy ()
WM_DESTROY message handler.

afx_msg void | OnSetFocus (CWnd *pOldWnd)
WM_SETFOCUS message handler.

afx_msg void | OnSize (UINT nType, int cx, int cy)
WM_SIZE message handler.

afx_msg void | OnMyFormatFont ()
WM_COMMAND(ID_FORMAT_FONT) message handler.

afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
WM_KEYDOWN message handler, process the Enter key.

afx_msg void | OnDropFiles (HDROP hDropInfo)
WM_DROPFILES message handler.

afx_msg void | OnEditClearAll ()
WM_COMMAND(ID_EDIT_CLEAR_ALL) message handler, clear the selection.

afx_msg UINT | OnGetDlgCode ()
WM_GETDLGCODE message handler.

afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point)
WM_CONTEXTMENU message handler, display the custom menu.

afx_msg void | OnRButtonDown (UINT nFlags, CPoint point)
WM_RBUTTONDOWN message handler, call CWincvsView::OnContextMenu.

Private Methods

virtual HRESULT | QueryAcceptData (LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL)
QueryAcceptData virtual override.

void | OutLine (const char *buf, int numbuf, bool isStderr)
BOOL | CanPaste () const

Private Attributes

UINT | m_fRtfFormat

Static Private Attributes

char * | m_sbuf = 0L
int | m_snumbuf = 0

Detailed Description

Console window class.

Definition at line 89 of file wincvsView.h.

Constructor & Destructor Documentation

CWincvsView::CWincvsView ( ) [protected]

Definition at line 76 of file wincvsView.cpp.

References m_fRtfFormat.

00077 {
00078     m_fRtfFormat = ::RegisterClipboardFormat(_T("Rich Text Format"));
00079 }

CWincvsView::~CWincvsView ( ) [virtual]

Definition at line 81 of file wincvsView.cpp.

References CPython_Interp::ClosePythonSupport(), free, m_sbuf, m_snumbuf, and PyInvalUICache().

00082 {
00083     m_snumbuf = 0;
00084     if( m_sbuf != 0L)
00085     {
00086         free(m_sbuf);
00087         m_sbuf = 0L;
00088     }
00089
00090     PyInvalUICache();
00091     CPython_Interp::ClosePythonSupport();
00092 }

Member Function Documentation

BOOL CWincvsView::CanPaste ( ) const [private]

Check whether the clipboard contains a supported data format for paste

Returns:
If clipboard contains supported data format, false otherwise

Definition at line 643 of file wincvsView.cpp.

00644 {
00645     return (CountClipboardFormats() != 0) &&
00646         (IsClipboardFormatAvailable(CF_TEXT) ||
00647         IsClipboardFormatAvailable(m_fRtfFormat) ||
00648         //IsClipboardFormatAvailable(_oleData.cfEmbedSource) ||
00649         //IsClipboardFormatAvailable(_oleData.cfEmbeddedObject) ||
00650         //IsClipboardFormatAvailable(_oleData.cfFileName) ||
00651         //IsClipboardFormatAvailable(_oleData.cfFileNameW) ||
00652         //IsClipboardFormatAvailable(CF_METAFILEPICT) ||
00653         //IsClipboardFormatAvailable(CF_DIB) ||
00654         //IsClipboardFormatAvailable(CF_BITMAP) ||
00655         GetRichEditCtrl().CanPaste());
00656 }

CHARFORMAT CWincvsView::GetCurFormat ( bool jumpEnd = true )

Get current format of the text

Parameters:
jumpEnd true to select all
Returns:
The current format of the text
Note:
This call puts the cursor at the end of the text by default

Definition at line 335 of file wincvsView.cpp.

Referenced by CColorConsole::CColorConsole(), and OutColor().

00336 {
00337     CRichEditCtrl& edit = GetRichEditCtrl();
00338
00339     if( jumpEnd )
00340         edit.SetSel(-1, -1);
00341
00342     return GetCharFormatSelection();
00343 }

CWincvsDoc * CWincvsView::GetDocument ( ) [inline]

Definition at line 165 of file wincvsView.h.

00166    { return (CWincvsDoc*)m_pDocument; }

BOOL CWincvsView::IsSelected ( const CObject * pDocItem ) const [protected, virtual]

IsSelected virtual override.

Definition at line 188 of file wincvsView.cpp.

00189 {
00190     // The implementation below is adequate if your selection consists of
00191     //  only CWincvsCntrItem objects.  To handle different selection
00192     //  mechanisms, the implementation here should be replaced.
00193
00194     // TODO: implement this function that tests for a selected OLE client item
00195
00196     //return pDocItem == m_pSelection;
00197     return CRichEditView::IsSelected(pDocItem);
00198 }

void CWincvsView::OnBeginPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnBeginPrinting virtual override.

Definition at line 154 of file wincvsView.cpp.

00155 {
00156     // No extra initialization before printing
00157     CRichEditView::OnBeginPrinting(pDC, pInfo);
00158 }

void CWincvsView::OnContextMenu | ( | CWnd * | pWnd,
 |  | CPoint | point
 | ) | [protected]

WM_CONTEXTMENU message handler, display the custom menu.

Definition at line 695 of file wincvsView.cpp.

Referenced by OnRButtonDown().

00696 {
00697     CMenu* pSubMenu = ::GetSubCMenu(ID_EDIT_UNDO, this);
00698     if( pSubMenu )
00699     {
00700         // Set the track point in case it's not the mouse click
00701         if( -1 == point.x && -1 == point.y )
00702         {
00703             // Set the top left corner
00704             point.x = 0;
00705             point.y = 0;
00706             ClientToScreen(&point);
00707         }
00708
00709         pSubMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, this);
00710     }
00711 }

void CWincvsView::OnDestroy ( ) [protected]

WM_DESTROY message handler.

Definition at line 168 of file wincvsView.cpp.

00169 {
00170     // Deactivate the item on destruction; this is important
00171     // when a splitter view is being used.
00172
00173     CRichEditView::OnDestroy();
00174
00175     //COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00176     //if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
00177     //{
00178     //  pActiveItem->Deactivate();
00179     //  ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
00180     //}
00181 }

void CWincvsView::OnDraw ( CDC * pDC ) [virtual]

OnDraw virtual override, do nothing here.

Definition at line 107 of file wincvsView.cpp.

00108 {
00109     //CWincvsDoc* pDoc = GetDocument();
00110     //ASSERT_VALID(pDoc);
00111
00112     // TODO: add draw code for native data here
00113     // TODO: also draw all OLE items in the document
00114
00115     // Draw the selection at an arbitrary position.  This code should be
00116     //  removed once your real drawing code is implemented.  This position
00117     //  corresponds exactly to the rectangle returned by CWincvsCntrItem,
00118     //  to give the effect of in-place editing.
00119
00120     // TODO: remove this code when final draw code is complete.
00121
00122     //if (m_pSelection == NULL)
00123     //{
00124     //  POSITION pos = pDoc->GetStartPosition();
00125     //  m_pSelection = (CWincvsCntrItem*)pDoc->GetNextClientItem(pos);
00126     //}
00127     //if (m_pSelection != NULL)
00128     //  m_pSelection->Draw(pDC, CRect(10, 10, 210, 210));
00129 }

void CWincvsView::OnDropFiles ( HDROP hDropInfo ) [protected]

WM_DROPFILES message handler.

Definition at line 659 of file wincvsView.cpp.

References CMainFrame::DropFiles(), and NULL.

00660 {
00661     CWnd* pWnd = AfxGetMainWnd();   //look in InitInstance m_pMainWnd = m_mainFrame;
00662
00663     if( pWnd )
00664     {
00665         CMainFrame* pMainFrame = (CMainFrame*)pWnd;
00666
00667         if( pMainFrame->GetSafeHwnd() != NULL )
00668         {
00669             pMainFrame->DropFiles( hDropInfo );
00670         }
00671     }
00672
00673     //this cause the crash, remove
00674     //CRichEditView::OnDropFiles(hDropInfo);
00675 }

void CWincvsView::OnEditClearAll ( ) [protected]

WM_COMMAND(ID_EDIT_CLEAR_ALL) message handler, clear the selection.

Definition at line 678 of file wincvsView.cpp.

00679 {
00680     CRichEditCtrl& edit = GetRichEditCtrl();
00681     edit.SetSel(0, -1);
00682     edit.ReplaceSel("", TRUE);
00683 }

void CWincvsView::OnEndPrinting | ( | CDC * | pDC,
 |  | CPrintInfo * | pInfo
 | ) | [protected, virtual]

OnEndPrinting virtual override.

Definition at line 161 of file wincvsView.cpp.

00162 {
00163     // No cleanup after printing
00164     CRichEditView::OnEndPrinting(pDC, pInfo);
00165 }

UINT CWincvsView::OnGetDlgCode ( ) [protected]

WM_GETDLGCODE message handler.

Definition at line 714 of file wincvsView.cpp.

00715 {
00716     LRESULT DlgCode = CRichEditView::OnGetDlgCode();
00717
00718     if( 0x8000 & GetKeyState(VK_TAB) )
00719         return DlgCode & ~(DLGC_WANTTAB | DLGC_WANTALLKEYS | DLGC_WANTCHARS);
00720     else
00721         return DlgCode;
00722 }

void CWincvsView::OnInitialUpdate ( ) [protected, virtual]

OnInitialUpdate virtual override, set the character font.

Definition at line 132 of file wincvsView.cpp.

00133 {
00134     CRichEditView::OnInitialUpdate();
00135
00136     CRichEditCtrl& edit = GetRichEditCtrl();
00137     edit.SetSel(0, -1);
00138
00139     SetCharFormat((CCharFormat)gViewFont);
00140     edit.SetSel(-1, -1);
00141 }

void CWincvsView::OnKeyDown | ( | UINT | nChar,
 |  | UINT | nRepCnt,
 |  | UINT | nFlags
 | ) | [protected]

WM_KEYDOWN message handler, process the Enter key.

Definition at line 540 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.

00541 {
00542     CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
00543
00544     if( nChar != VK_RETURN )
00545     {
00546         return;
00547     }
00548
00549     long len = GetTextLength();
00550     if( len == 0 )
00551         return;
00552
00553     TCHAR* buf = (char*)malloc((len + 1) * sizeof(TCHAR));
00554     if( buf == 0L )
00555         return;
00556
00557     TEXTRANGE textRange;
00558     textRange.chrg.cpMin = 0;
00559     textRange.chrg.cpMax = len;
00560     textRange.lpstrText = buf;
00561     GetRichEditCtrl().SendMessage(EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
00562
00563     long nStartChar, nEndChar;
00564     GetRichEditCtrl().GetSel(nStartChar, nEndChar);
00565
00566     if( nStartChar == nEndChar ) // i.e. there is no selection
00567     {
00568         // Get the end and the beginning of the line
00569         if( nStartChar > 0 && buf[nStartChar] == '\r' )
00570             nStartChar--;
00571
00572         while( nStartChar > 0 && buf[nStartChar] != '\n' && buf[nStartChar] != '\r' )
00573             nStartChar--;
00574
00575         if( buf[nStartChar] == '\n' || buf[nStartChar] == '\r' )
00576             nStartChar++;
00577
00578         while( nEndChar < len && buf[nEndChar] != '\n' && buf[nEndChar] != '\r' )
00579             nEndChar++;
00580     }
00581
00582     long length = nEndChar - nStartChar;
00583     if( length > 0 && nStartChar < len )
00584     {
00585         OutConsole("\n", 1);
00586         buf[nEndChar] = '\0';
00587
00588         if( gCvsPrefs.GetUseShell() == SHELL_PYTHON && CPython_Interp::IsAvail() )
00589         {
00590             CPython_Interp interp;
00591             interp.DoScript(buf + nStartChar);
00592         }
00593         else if( gCvsPrefs.GetUseShell() == SHELL_TCL && CTcl_Interp::IsAvail() )
00594         {
00595             CTcl_Interp interp;
00596             interp.DoScript(buf + nStartChar);
00597         }
00598     }
00599
00600     free(buf);
00601 }

void CWincvsView::OnMyFormatFont ( ) [protected]

WM_COMMAND(ID_FORMAT_FONT) message handler.

Definition at line 527 of file wincvsView.cpp.

References gViewFont().

00528 {
00529     CRichEditCtrl& edit = GetRichEditCtrl();
00530     edit.SetSel(0, -1);
00531
00532     CRichEditView::OnFormatFont();
00533     edit.SetSel(-1, -1);
00534
00535     gViewFont = CCharFormat(GetCharFormatSelection());
00536     gCvsPrefs.save();
00537 }

BOOL CWincvsView::OnPreparePrinting ( CPrintInfo * pInfo ) [protected, virtual]

OnPreparePrinting virtual override.

Definition at line 147 of file wincvsView.cpp.

00148 {
00149     return DoPreparePrinting(pInfo);
00150     //return CRichEditView::OnPreparePrinting(pInfo);
00151 }

void CWincvsView::OnRButtonDown | ( | UINT | nFlags,
 |  | CPoint | point
 | ) | [protected]

WM_RBUTTONDOWN message handler, call CWincvsView::OnContextMenu.

Definition at line 686 of file wincvsView.cpp.

References OnContextMenu().

00687 {
00688     ClientToScreen(&point);
00689     OnContextMenu(this, point);
00690
00691     //CRichEditView::OnRButtonDown(nFlags, point);
00692 }

void CWincvsView::OnSetFocus ( CWnd * pOldWnd ) [protected]

WM_SETFOCUS message handler.

Note:
Special handling of OnSetFocus and OnSize are required for a container when an object is being edited in-place

Definition at line 219 of file wincvsView.cpp.

00220 {
00221 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00222 //  if (pActiveItem != NULL &&
00223 //      pActiveItem->GetItemState() == COleClientItem::activeUIState)
00224 //  {
00225         // need to set focus to this item if it is in the same view
00226 //      CWnd* pWnd = pActiveItem->GetInPlaceWindow();
00227 //      if (pWnd != NULL)
00228 //      {
00229 //          pWnd->SetFocus();   // don't call the base class
00230 //          return;
00231 //      }
00232 //  }
00233
00234     CRichEditView::OnSetFocus(pOldWnd);
00235 }

void CWincvsView::OnSize | ( | UINT | nType,
 |  | int | cx,
 |  | int | cy
 | ) | [protected]

WM_SIZE message handler.

Definition at line 238 of file wincvsView.cpp.

00239 {
00240     CRichEditView::OnSize(nType, cx, cy);
00241 //  COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
00242 //  if (pActiveItem != NULL)
00243 //      pActiveItem->SetItemRects();
00244 }

void CWincvsView::OutColor ( CHARFORMAT & format )

Set the console character format

Parameters:
format Format to be set

Definition at line 437 of file wincvsView.cpp.

00438 {
00439     CCvsThreadLock threadLock;
00440
00441     CRichEditCtrl& edit = GetRichEditCtrl();
00442     SetCharFormat(format);
00443 }

void CWincvsView::OutColor ( kConsoleColor color )

Set the console color

Parameters:
color Console color to be set

Definition at line 382 of file wincvsView.cpp.

References GetCurFormat(), kBlue, kBold, kBrown, kGreen, kItalic, kMagenta, kRed, and kUnderline.

00383 {
00384     CCvsThreadLock threadLock;
00385
00386     CRichEditCtrl& edit = GetRichEditCtrl();
00387
00388     WCHARFORMAT cf = GetCurFormat(false);
00389     cf.dwEffects = 0;
00390
00391     switch(color)
00392     {
00393     default:
00394         return;
00395         break;
00396     case kBrown :
00397         cf.dwMask = CFM_COLOR;
00398         cf.crTextColor = RGB(0x80, 0x80, 0x00);
00399         break;
00400     case kGreen :
00401         cf.dwMask = CFM_COLOR;
00402         cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00403         break;
00404     case kMagenta :
00405         cf.dwMask = CFM_COLOR;
00406         cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00407         break;
00408     case kRed :
00409         cf.dwMask = CFM_COLOR;
00410         cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00411         break;
00412     case kBlue :
00413         cf.dwMask = CFM_COLOR;
00414         cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00415         break;
00416     case kBold :
00417         cf.dwMask = CFM_BOLD;
00418         cf.dwEffects = CFE_BOLD;
00419         break;
00420     case kItalic :
00421         cf.dwMask = CFM_ITALIC;
00422         cf.dwEffects = CFE_ITALIC;
00423         break;
00424     case kUnderline :
00425         cf.dwMask = CFM_UNDERLINE;
00426         cf.dwEffects = CFE_UNDERLINE;
00427         break;
00428     }
00429
00430     SetCharFormat(cf);
00431 }

void CWincvsView::OutColor | ( | const char * | txt,
 |  | long | len
 | ) |

Print colorized console output

Parameters:
txt | Text to print
len | Length of the text to print

Definition at line 350 of file wincvsView.cpp.

Referenced by CColorConsole::operator<<().

00351 {
00352     // Synchronize it since the thread calls it
00353     CCvsThreadLock threadLock;
00354
00355     CString strText;
00356     for(int index = 0; index < len; index++)
00357     {
00358         char chr = *txt++;
00359         if( chr == 0x0d || chr == 0x0a )
00360         {
00361             strText += (char)0x0d;
00362             strText += (char)0x0a;
00363
00364             // special case if we got already \r\n
00365             if( (index + 1) < len && chr == 0x0d && txt[0] == 0x0a )
00366                 index++;
00367         }
00368         else
00369         {
00370             strText += chr;
00371         }
00372     }
00373
00374     CRichEditCtrl& edit = GetRichEditCtrl();
00375     edit.ReplaceSel(strText);
00376 }

void CWincvsView::OutConsole | ( | const char * | txt,
 |  | long | len,
 |  | bool | isStderr = false
 | ) |

Print the text to the console

Parameters:
txt | Text to print
len | Length of text to print
isStderr | true for stderr, false otherwise

Definition at line 451 of file wincvsView.cpp.

References m_sbuf, m_snumbuf, malloc, MAX_CHAR_BY_LINE, and OutLine().

Referenced by CGraphConsole::cvs_err(), cvs_err(), cvs_errstr(), CGraphConsole::cvs_out(), cvs_out(), cvs_outstr(), and OnKeyDown().

00452 {
00453     // Synchronize it since the thread calls it
00454     CCvsThreadLock threadLock;
00455
00456     if( len == 0 )
00457         return;
00458
00459     if( m_sbuf == 0L )
00460     {
00461         m_sbuf = (char*)malloc((MAX_CHAR_BY_LINE + 3) * sizeof(char));
00462         if( m_sbuf == 0L )
00463             return;
00464     }
00465
00466     int index = 0;
00467     char chr;
00468
00469     do{
00470         for(; index < len && m_snumbuf < MAX_CHAR_BY_LINE; m_snumbuf++)
00471         {
00472             chr = txt[index++];
00473
00474             if( chr == 0x0d || chr == 0x0a )
00475             {
00476                 // Newline
00477                 break;
00478             }
00479
00480             m_sbuf[m_snumbuf] = chr;
00481         }
00482
00483         // Special case if we got already \r\n
00484         if( index < len && chr == 0x0d && txt[index] == 0x0a )
00485         {
00486             index++;
00487         }
00488
00489         if( chr == 0x0d || chr == 0x0a || m_snumbuf == MAX_CHAR_BY_LINE )
00490         {
00491             m_sbuf[m_snumbuf++] = 0x0d;
00492             m_sbuf[m_snumbuf++] = 0x0a;
00493             m_sbuf[m_snumbuf++] = 0x00;
00494
00495             OutLine(m_sbuf, m_snumbuf, isStderr);
00496             m_snumbuf = 0;
00497         }
00498     }while( index < len );
00499 }

void CWincvsView::OutLine | ( | const char * | buf,
 |  | int | numbuf,
 |  | bool | isStderr
 | ) | [private]

Print a line into the console window

Parameters:
buf | Text to print
numbuf | Length of text to print
isStderr | true for stderr, false otherwise

Definition at line 252 of file wincvsView.cpp.

Referenced by OutConsole().

00253 {
00254     CRichEditCtrl& edit = GetRichEditCtrl();
00255     edit.SetSel(-1, -1);
00256
00257     if( numbuf <= 0 )
00258     {
00259         return;
00260     }
00261
00262     WCHARFORMAT cf;
00263     cf.cbSize = sizeof(WCHARFORMAT);
00264     cf = GetCharFormatSelection();
00265
00266     bool colorChanged = false;
00267     COLORREF oldColor = cf.crTextColor;
00268     DWORD oldEffect = cf.dwEffects;
00269     CString strline(buf, numbuf);
00270
00271     if( strline.GetLength() >= 5 && strline[1] == ' ' &&
00272         (strline[0] == 'M' || strline[0] == 'C' || strline[0] == 'U' ||
00273         strline[0] == 'P' || strline[0] == 'N' || strline[0] == 'A' ||
00274         strline[0] == 'R' || strline[0] == 'I' || strline[0] == '?' ||
00275         strline[0] == '<' || strline[0] == '>') )
00276     {
00277         colorChanged = true;
00278
00279         switch(strline[0])
00280         {
00281         default:
00282         case '?' :
00283         case 'I' :
00284             cf.crTextColor = RGB(0x80, 0x80, 0x00);
00285             break;
00286         case 'U' :
00287         case 'N' :
00288             cf.crTextColor = RGB(0x00, 0xA0, 0x00);
00289             break;
00290         case 'M' :
00291         case 'A' :
00292         case 'R' :
00293             cf.crTextColor = RGB(0xFF, 0x00, 0xFF);
00294             break;
00295         case 'C' :
00296         case '<' :
00297             cf.crTextColor = RGB(0xFF, 0x00, 0x00);
00298             break;
00299         case '>' :
00300         case 'P' :
00301             cf.crTextColor = RGB(0x00, 0x00, 0xFF);
00302             break;
00303         }
00304
00305         cf.dwMask = CFM_COLOR;
00306         cf.dwEffects = 0;
00307         SetCharFormat(cf);
00308     }
00309     else if( isStderr )
00310     {
00311         colorChanged = true;
00312         cf.crTextColor = RGB(0xFF, 0x80, 0x00);
00313         cf.dwMask = CFM_COLOR;
00314         cf.dwEffects = 0;
00315         SetCharFormat(cf);
00316     }
00317
00318     edit.ReplaceSel(strline);
00319
00320     if( colorChanged )
00321     {
00322         cf.dwMask = CFM_COLOR;
00323         cf.crTextColor = oldColor;
00324         cf.dwEffects = oldEffect;
00325         SetCharFormat(cf);
00326     }
00327 }

BOOL CWincvsView::PreCreateWindow ( CREATESTRUCT & cs ) [virtual]

PreCreateWindow virtual override, modify the window style.

Definition at line 95 of file wincvsView.cpp.

00096 {
00097     BOOL bRet = CRichEditView::PreCreateWindow(cs);
00098     cs.style |= WS_TABSTOP | ES_MULTILINE;
00099
00100     return bRet;
00101 }

HRESULT CWincvsView::QueryAcceptData | ( | LPDATAOBJECT | ,
 |  | CLIPFORMAT * | ,
 |  | DWORD | ,
 |  | BOOL | ,
 |  | HGLOBAL |
 | ) | [private, virtual]

QueryAcceptData virtual override.

Definition at line 604 of file wincvsView.cpp.

References ASSERT, and m_fRtfFormat.

00605 {
00606     ASSERT(lpcfFormat != NULL);
00607     if( !bReally ) // not actually pasting
00608         return S_OK;
00609
00610     // If direct pasting a particular native format allow it
00611     if( IsRichEditFormat(*lpcfFormat) )
00612         return S_OK;
00613
00614     COleDataObject dataobj;
00615     dataobj.Attach(lpdataobj, FALSE);
00616
00617     // If format is 0, then force particular formats if available
00618     if( *lpcfFormat == 0 && (m_nPasteType == 0) )
00619     {
00620         if( m_fRtfFormat != 0 && dataobj.IsDataAvailable(m_fRtfFormat)) // native avail, let rich edit do as it wants
00621         {
00622             *lpcfFormat = m_fRtfFormat;
00623             return S_OK;
00624         }
00625         else if (dataobj.IsDataAvailable(CF_TEXT))
00626         {
00627             *lpcfFormat = CF_TEXT;
00628             return S_OK;
00629         }
00630     }
00631
00632     // *DO NOT* paste OLE formats
00633     // Crash reported by Gerhard Möller
00634     //DoPaste(dataobj, *lpcfFormat, hMetaPict);
00635
00636     return S_FALSE;
00637 }

Member Data Documentation

UINT CWincvsView::m_fRtfFormat [private]

Clipboard format

Definition at line 145 of file wincvsView.h.

Referenced by CWincvsView(), and QueryAcceptData().

char * CWincvsView::m_sbuf = 0L [static, private]

Print buffer

Definition at line 73 of file wincvsView.cpp.

Referenced by OutConsole(), and ~CWincvsView().

int CWincvsView::m_snumbuf = 0 [static, private]

Print buffer size

Definition at line 74 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 Fri Jan 31 12:21:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:25 2003 for WinCvs Source by doxygen 1.3-rc2


CWinLogBranchData Class Reference

Windows log branch node data. More...

#include <UCvsGraph.h>

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 &dc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &dc, EntnodeData *entryInfo)

Detailed Description

Windows log branch node data.

Definition at line 115 of file UCvsGraph.h.

Constructor & Destructor Documentation

CWinLogBranchData::CWinLogBranchData ( CLogNode * node ) [inline]

Definition at line 118 of file UCvsGraph.h.

00118 : CWinLogData(node) {}

virtual CWinLogBranchData::~CWinLogBranchData ( ) [inline, virtual]

Definition at line 119 of file UCvsGraph.h.

00119 {}

CWinLogBranchData::CWinLogBranchData ( CLogNode * node ) [inline]

Definition at line 170 of file GraphView.h.

00170 : CWinLogData(node) {}

virtual CWinLogBranchData::~CWinLogBranchData ( ) [inline, virtual]

Definition at line 171 of file GraphView.h.

00171 {}

Member Function Documentation

CSize CWinLogBranchData::GetBoundsSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Get the bounds size

Parameters:
dc | Device context
entryInfo | Entry info
Returns:
Bounds size as CSize

Implements CWinLogData.

Definition at line 782 of file GraphView.cpp.

00783 {
00784     CLogNodeBranch& branch = *(CLogNodeBranch*)fNode;
00785     return dc.GetTextExtent(*branch, (*branch).length());
00786 }

USize CWinLogBranchData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 281 of file UCvsGraph.cpp.

References UDC::GetTextExtent().

00282 {
00283     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00284     return hdc.GetTextExtent(*branch, (*branch).length());
00285 }

void CWinLogBranchData::UpdateSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Implements CWinLogData.

Definition at line 788 of file GraphView.cpp.

References URect::CenterPoint(), gGraphBranchColor, kOctangle, NULL, CWinLogData::Selected(), and CWinLogData::SelfBounds().

00789 {
00790     // Draw the node
00791     ::DrawNode(dc, SelfBounds(), gGraphBranchColor, kOctangle, Selected());
00792
00793     // Draw the content of the node
00794     TEXTMETRIC tm;
00795     dc.GetTextMetrics(&tm);
00796     CPoint center = SelfBounds().CenterPoint();
00797     int nCenterX = center.x;
00798     int nCenterY = center.y - tm.tmHeight/2;
00799     CLogNodeBranch& branch = *(CLogNodeBranch*)fNode;
00800     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(), *branch, (*branch).length(), NULL);
00801 }

void CWinLogBranchData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 287 of file UCvsGraph.cpp.

References UDC::GetTextHeight(), CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped(), URGB, UPOINT::x, and UPOINT::y.

00288 {
00289     // draw the node
00290     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 120), true, sel);
00291
00292     // draw the content of the node
00293     UPoint center = selfB.CenterPoint();
00294     int nCenterX = center.x;
00295     int nCenterY = center.y - hdc.GetTextHeight()/2;
00296     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00297     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00298         *branch, (*branch).length());
00299 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • WinCvs/GraphView.h
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:21:26 2003 for WinCvs Source by doxygen 1.3-rc2


CWinLogData Class Reference

Windows log data abstract class. More...

#include <UCvsGraph.h>

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 | SetSelected (bool state)
void | UnselectAll (CScrollView *view)
void | UnselectAll (void)
CWinLogData * | HitTest (UPoint point)
bool | IsDiskNode (EntnodeData *entryInfo)
CWinLogData (CLogNode *node)
virtual | ~CWinLogData ()
kLogNode | GetType (void) const
const char * | GetStr (void)
CRect & | Bounds (void)
CRect & | SelfBounds (void)
void | ComputeBounds (const CPoint &topLeft, CDC &dc, EntnodeData *entryInfo=0L)
void | Offset (CPoint offset)
void | Update (CDC &dc, EntnodeData *entryInfo=0L)
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)
CWinLogData * | GetData (CLogNode *node)
virtual void | UpdateSelf (CDC &dc, EntnodeData *entryInfo)=0
virtual CSize | GetBoundsSelf (CDC &dc, EntnodeData *entryInfo)=0

Protected Attributes

URect selfB
URect totB
bool | sel

Private Attributes

CRect | selfB
CRect | totB

Detailed Description

Windows log data abstract class.

Definition at line 42 of file UCvsGraph.h.

Constructor & Destructor Documentation

CWinLogData::CWinLogData ( CLogNode * node )

Definition at line 301 of file UCvsGraph.cpp.

References sel, selfB, URect::SetRectEmpty(), and totB.

00301                                        : CLogNodeData(node)
00302 {
00303     selfB.SetRectEmpty();
00304     totB.SetRectEmpty();
00305     sel = false;
00306 }

CWinLogData::~CWinLogData ( ) [virtual]

Definition at line 308 of file UCvsGraph.cpp.

00309 {
00310 }

CWinLogData::CWinLogData ( CLogNode * node )

virtual CWinLogData::~CWinLogData ( ) [virtual]

Member Function Documentation

CRect& CWinLogData::Bounds ( void ) [inline]

CRect & CWinLogData::Bounds ( void ) [inline]

Get the bounds rectangle

Returns:
The bounds rectangle

Definition at line 56 of file UCvsGraph.h.

References totB.

Referenced by CGraphView::CalcImageSize(), UCvsGraph::CalcImageSize(), ComputeBounds(), CGraphView::OnBeginPrinting(), and TGraphRectSelect::TraverseNode().

00056 { return totB; }

void CWinLogData::ComputeBounds | ( | const CPoint & | topLeft,
 |  | CDC & | dc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Calculate the bounds

Parameters:
topLeft | Top-left point for the bounds
dc | Device context
entryInfo | Entry info

Definition at line 580 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.

00581 {
00582     CLogNode* subNode;
00583     CLogNode* nextNode = fNode->Next();
00584
00585     // First compute childrens bounds
00586     vector<CLogNode*>::iterator i;
00587     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00588     {
00589         subNode = *i;
00590         CWinLogData::CreateNewData(subNode);
00591         GetData(subNode)->ComputeBounds(topLeft, dc, entryInfo);
00592     }
00593
00594     if( nextNode != 0L )
00595         CWinLogData::CreateNewData(nextNode);
00596
00597     // Compute self place
00598     selfB.SetRectEmpty();
00599     CSize size = GetBoundsSelf(dc, entryInfo);
00600     size.cx += kInflateNodeSpace;
00601     size.cy += kInflateNodeSpace;
00602     selfB.SetRect(0, 0, size.cx, size.cy);
00603
00604     // Offset to the place assigned to this node
00605     selfB.OffsetRect(topLeft - selfB.TopLeft());
00606
00607     // Calculate the total height of the childrens
00608     int vSize = 0;
00609     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00610     {
00611         subNode = *i;
00612         CRect& b = GetData(subNode)->Bounds();
00613         vSize += b.Height();
00614     }
00615
00616     if( !fNode->Childs().empty() )
00617         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00618
00619     // Offset the children relative to self
00620     CPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00621         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00622
00623     // Place the first child at the bottom of the header node so it won't take so much space for long filenames
00624     if( fNode->GetType() == kNodeHeader )
00625     {
00626         startChilds = CPoint(topLeft.x + kHChildSpace, topLeft.y + selfB.Height() + kVChildSpace);
00627     }
00628
00629     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00630     {
00631         subNode = *i;
00632         CRect curPos = GetData(subNode)->Bounds();
00633         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00634         startChilds.y += curPos.Height() + kVChildSpace;
00635     }
00636
00637     // Calculate the total bounds of the childrens
00638     CRect bc;
00639     bc.SetRectEmpty();
00640     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00641     {
00642         subNode = *i;
00643         CRect& b = GetData(subNode)->Bounds();
00644         bc.UnionRect(bc, b);
00645     }
00646
00647     // Now we got the complete size
00648     totB.UnionRect(selfB, bc);
00649
00650     if( nextNode != 0L )
00651     {
00652         CPoint nextTopLeft;
00653         nextTopLeft.x = totB.TopLeft().x;
00654         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00655         GetData(nextNode)->ComputeBounds(nextTopLeft, dc, entryInfo);
00656
00657         totB.UnionRect(totB, GetData(nextNode)->Bounds());
00658     }
00659 }

void CWinLogData::ComputeBounds | ( | const UPoint & | topLeft,
 |  | UDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 540 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().

00542 {
00543     CLogNode *subNode;
00544     CLogNode *nextNode = fNode->Next();
00545
00546     // first compute childrens bounds
00547     std::vector<CLogNode *>::iterator i;
00548     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00549     {
00550         subNode = *i;
00551         CWinLogData::CreateNewData(subNode);
00552         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00553     }
00554     if(nextNode != 0L)
00555         CWinLogData::CreateNewData(nextNode);
00556
00557     // compute self place
00558     selfB.SetRectEmpty();
00559     USize size = GetBoundsSelf(hdc, entryInfo);
00560     size.cx += kInflateNodeSpace;
00561     size.cy += kInflateNodeSpace;
00562     selfB.SetRect(0, 0, size.cx, size.cy);
00563
00564     // offset to the place assigned to this node
00565     selfB.OffsetRect(topLeft - selfB.TopLeft());
00566
00567     // calculate the total height of the childrens
00568     int vSize = 0;
00569     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00570     {
00571         subNode = *i;
00572         URect & b = GetData(subNode)->Bounds();
00573         vSize += b.Height();
00574     }
00575     if(!fNode->Childs().empty())
00576         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00577
00578     // offset the children relative to self
00579     UPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00580         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00581     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00582     {
00583         subNode = *i;
00584         URect curPos = GetData(subNode)->Bounds();
00585         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00586         startChilds.y += curPos.Height() + kVChildSpace;
00587     }
00588
00589     // calculate the total bounds of the childrens
00590     URect bc;
00591     bc.SetRectEmpty();
00592     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00593     {
00594         subNode = *i;
00595         URect & b = GetData(subNode)->Bounds();
00596         bc.UnionRect(&bc, &b);
00597     }
00598
00599     // now we got the complete size
00600     totB.UnionRect(&selfB, &bc);
00601
00602     if(nextNode != 0L)
00603     {
00604         UPoint nextTopLeft;
00605         nextTopLeft.x = totB.TopLeft().x;
00606         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00607         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00608
00609         totB.UnionRect(&totB, &GetData(nextNode)->Bounds());
00610     }
00611 }

CWinLogData* CWinLogData::CreateNewData ( CLogNode * node ) [static]

CWinLogData * CWinLogData::CreateNewData ( CLogNode * node ) [static]

Create new log data

Parameters:
node Log node
Returns:
New log data on success, NULL otherwise

Definition at line 344 of file UCvsGraph.cpp.

Referenced by CGraphView::CalcImageSize(), UCvsGraph::CalcImageSize(), ComputeBounds(), and CGraphView::OnBeginPrinting().

00345 {
00346     if(node->GetUserData() != 0L)
00347         return (CWinLogData *)node->GetUserData();
00348
00349     CWinLogData *res = 0L;
00350     switch(node->GetType())
00351     {
00352     case kNodeHeader :
00353         res = new CWinLogHeaderData(node);
00354         break;
00355     case kNodeBranch :
00356         res = new CWinLogBranchData(node);
00357         break;
00358     case kNodeRev :
00359         res = new CWinLogRevData(node);
00360         break;
00361     case kNodeTag :
00362         res = new CWinLogTagData(node);
00363         break;
00364     }
00365     node->SetUserData(res);
00366     return res;
00367 }

virtual CSize CWinLogData::GetBoundsSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Get the bounds size

Parameters:
dc | Device context
entryInfo | Entry info
Returns:
Bounds size as CSize

Implemented in CWinLogHeaderData, CWinLogRevData, CWinLogTagData, and CWinLogBranchData.

virtual USize CWinLogData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData, CWinLogRevData, CWinLogTagData, and CWinLogBranchData.

Referenced by ComputeBounds().

CWinLogData* CWinLogData::GetData ( CLogNode * node ) [inline, protected]

CWinLogData * CWinLogData::GetData ( CLogNode * node ) [inline, protected]

Get log node data

Parameters:
node Log node to get the date from
Returns:
The log node data

Definition at line 74 of file UCvsGraph.h.

Referenced by ComputeBounds(), HitTest(), Offset(), UnselectAll(), and Update().

00075         { return (CWinLogData *)node->GetUserData(); }

const char* CWinLogData::GetStr ( void )

const char * CWinLogData::GetStr ( void )

Get the node string

Returns:
The node string

Definition at line 312 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().

00313 {
00314     switch(GetType())
00315     {
00316         case kNodeHeader :
00317         {
00318             CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00319             return (*header).WorkingFile();
00320             break;
00321         }
00322         case kNodeBranch :
00323         {
00324             CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00325             return *branch;
00326             break;
00327         }
00328         case kNodeRev :
00329         {
00330             CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00331             return (*rev).RevNum().c_str();
00332             break;
00333         }
00334         case kNodeTag :
00335         {
00336             CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00337             return *tag;
00338             break;
00339         }
00340     }
00341     return 0L;
00342 }

kLogNode CWinLogData::GetType ( void ) const [inline]

kLogNode CWinLogData::GetType ( void ) const [inline]

Get log node type

Returns:
The log node type

Definition at line 48 of file UCvsGraph.h.

Referenced by GetStr(), IsDeadNode(), IsDiskNode(), CGraphView::IsSelSingleNode(), IsUserState(), CGraphView::OnContextMenu(), CGraphView::OnUpdateViewDiff(), TGraphSelNonSig::TraverseNode(), and TGraphDelCmd::TraverseNode().

00048 { return fNode->GetType(); }

CWinLogData * CWinLogData::HitTest ( CPoint point )

Text whether the point is within the node and return the found node

Parameters:
point Point to test
Returns:
Log data if node found, NULL otherwise

Definition at line 434 of file GraphView.cpp.

References GetData(), HitTest(), URect::PtInRect(), selfB, and totB.

00435 {
00436     if( !totB.PtInRect(point) )
00437         return 0L;
00438
00439     if( selfB.PtInRect(point) )
00440         return this;
00441
00442     CWinLogData* result;
00443     vector<CLogNode*>::iterator i;
00444     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00445     {
00446         CLogNode* subNode = *i;
00447         result = GetData(subNode)->HitTest(point);
00448         if( result != 0L )
00449             return result;
00450     }
00451
00452     if( fNode->Next() != 0L )
00453     {
00454         result = GetData(fNode->Next())->HitTest(point);
00455         if( result != 0L )
00456             return result;
00457     }
00458
00459     return 0L;
00460 }

CWinLogData * CWinLogData::HitTest ( UPoint point )

Definition at line 433 of file UCvsGraph.cpp.

References GetData(), URect::PtInRect(), selfB, and totB.

Referenced by HitTest(), UCvsGraph::OnBtnClick(), CGraphView::OnContextMenu(), and CGraphView::OnLButtonDown().

00434 {
00435     if(!totB.PtInRect(point))
00436         return 0L;
00437     if(selfB.PtInRect(point))
00438         return this;
00439
00440     CWinLogData *result;
00441     std::vector<CLogNode *>::iterator i;
00442     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00443     {
00444         CLogNode *subNode = *i;
00445         result = GetData(subNode)->HitTest(point);
00446         if(result != 0L)
00447             return result;
00448     }
00449     if(fNode->Next() != 0L)
00450     {
00451         result = GetData(fNode->Next())->HitTest(point);
00452         if(result != 0L)
00453             return result;
00454     }
00455     return 0L;
00456 }

bool CWinLogData::IsDeadNode ( )

Check whether the selected node has the dead state

Returns:
true if the selected node is a revision and the state is dead, false otherwise

Definition at line 341 of file GraphView.cpp.

References GetType().

Referenced by CWinLogRevData::UpdateSelf().

00342 {
00343     if( GetType() != kNodeRev )
00344         return false;
00345
00346     return strcmp("dead", (**(CLogNodeRev*)fNode).State()) == 0;
00347 }

bool CWinLogData::IsDiskNode ( EntnodeData * entryInfo )

bool CWinLogData::IsDiskNode ( EntnodeData * entryInfo )

Check whether the selected node is the same as sandbox revision

Returns:
true if the selected node is a revision and the revision is the same as sandbox revision, false otherwise

Definition at line 369 of file UCvsGraph.cpp.

References GetType(), and EntnodeFile::kVN.

Referenced by CWinLogRevData::GetBoundsSelf(), and CWinLogRevData::UpdateSelf().

00370 {
00371     if(entryInfo == 0L || GetType() != kNodeRev)
00372         return false;
00373     const char *vn = (*entryInfo)[EntnodeFile::kVN];
00374     if(vn == 0L)
00375         return false;
00376
00377     return strcmp(vn, (**(CLogNodeRev *)fNode).RevNum().c_str()) == 0;
00378 }

bool CWinLogData::IsUserState ( )

Check whether the selected state is a user-defined state

Returns:
true if the selected node is a revision and the state is user-defined, false otherwise

Definition at line 353 of file GraphView.cpp.

References GetType().

Referenced by CWinLogRevData::UpdateSelf().

00354 {
00355     if( GetType() != kNodeRev )
00356         return false;
00357
00358     return !(strcmp("dead", (**(CLogNodeRev*)fNode).State()) == 0 ||
00359         strcmp("Exp", (**(CLogNodeRev*)fNode).State()) == 0);
00360 }

void CWinLogData::Offset ( CPoint offset )

Offset the log node

Parameters:
offset Offset

Definition at line 366 of file GraphView.cpp.

References GetData(), Offset(), URect::OffsetRect(), selfB, and totB.

00367 {
00368     selfB.OffsetRect(offset);
00369     totB.OffsetRect(offset);
00370
00371     vector<CLogNode*>::iterator i;
00372     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00373     {
00374         CLogNode* subNode = *i;
00375         GetData(subNode)->Offset(offset);
00376     }
00377
00378     if( fNode->Next() != 0L )
00379     {
00380         GetData(fNode->Next())->Offset(offset);
00381     }
00382 }

void CWinLogData::Offset ( UPoint o )

Definition at line 384 of file UCvsGraph.cpp.

References GetData(), URect::OffsetRect(), selfB, and totB.

Referenced by CGraphView::CalcImageSize(), UCvsGraph::CalcImageSize(), ComputeBounds(), and Offset().

00385 {
00386     selfB.OffsetRect(o);
00387     totB.OffsetRect(o);
00388     std::vector<CLogNode *>::iterator i;
00389     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00390     {
00391         CLogNode *subNode = *i;
00392         GetData(subNode)->Offset(o);
00393     }
00394     if(fNode->Next() != 0L)
00395         GetData(fNode->Next())->Offset(o);
00396 }

bool CWinLogData::Selected ( void ) const [inline]

bool CWinLogData::Selected ( void ) const [inline]

Get the selection state

Returns:
true if selected, false otherwise

Definition at line 59 of file UCvsGraph.h.

References sel.

Referenced by UCvsGraph::OnBtnClick(), CGraphView::OnContextMenu(), CGraphView::OnLButtonDown(), TGraphDelCmd::TraverseNode(), TGraphCmdStatus::TraverseNode(), TGraphRectSelect::TraverseNode(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogRevData::UpdateSelf(), and CWinLogHeaderData::UpdateSelf().

00059 { return sel; }

CRect& CWinLogData::SelfBounds ( void ) [inline]

CRect & CWinLogData::SelfBounds ( void ) [inline]

Get the self bounds

Returns:
The self bounds

Definition at line 57 of file UCvsGraph.h.

References selfB.

Referenced by TGraphRectSelect::TraverseNode(), Update(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogRevData::UpdateSelf(), and CWinLogHeaderData::UpdateSelf().

00057 { return selfB; }

void CWinLogData::SetSelected | ( | CScrollView * | view,
 |  | bool | state
 | ) |

void CWinLogData::SetSelected ( bool state ) [inline]

Definition at line 61 of file UCvsGraph.h.

References sel.

00061 { sel = state; }

void CWinLogData::SetSelected | ( | CScrollView * | view,
 |  | bool | state
 | ) |

Set the selection state

Parameters:
view | View to set the selection state
state | New selection state

Definition at line 399 of file UCvsGraph.cpp.

References CScrollView::GetDeviceScrollPosition(), CScrollView::InvalidateRect(), URect::OffsetRect(), sel, and selfB.

Referenced by UCvsGraph::OnBtnClick(), CGraphView::OnContextMenu(), CGraphView::OnLButtonDown(), TGraphSelNonSig::TraverseNode(), TGraphRectSelect::TraverseNode(), and UnselectAll().

00400 {
00401     sel = state;
00402
00403     URect invalR = selfB;
00404     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00405     view->InvalidateRect(&invalR);
00406 }

void CWinLogData::UnselectAll ( CScrollView * view )

void CWinLogData::UnselectAll ( void )

Definition at line 428 of file UCvsGraph.cpp.

00429 {
00430     CWinLogData::UnselectAll(NULL);
00431 }

void CWinLogData::UnselectAll ( CScrollView * view )

Remove selection from all nodes

Parameters:
view View

Definition at line 408 of file UCvsGraph.cpp.

References GetData(), NULL, and SetSelected().

Referenced by UCvsGraph::OnBtnClick(), CGraphView::OnContextMenu(), CGraphView::OnLButtonDown(), and CGraphView::OnViewSelnonsig().

00409 {
00410     if(sel)
00411     {
00412         if(view != NULL)
00413             SetSelected(view, false);
00414         else
00415             SetSelected(false);
00416     }
00417
00418     std::vector<CLogNode *>::iterator i;
00419     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00420     {
00421         CLogNode *subNode = *i;
00422         GetData(subNode)->UnselectAll(view);
00423     }
00424     if(fNode->Next() != 0L)
00425         GetData(fNode->Next())->UnselectAll(view);
00426 }

void CWinLogData::Update | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Definition at line 467 of file GraphView.cpp.

References URect::BottomRight(), URect::CenterPoint(), GetData(), kHChildSpace, selfB, SelfBounds(), URect::TopLeft(), Update(), UpdateSelf(), URect::Width(), UPOINT::x, and UPOINT::y.

00468 {
00469     CLogNode* subNode;
00470     CLogNode* nextNode = fNode->Next();
00471     CPen* pOldPen = 0L;
00472     CBrush* pOldBrush = 0L;
00473     CPen pen, pen2;
00474     CBrush brush;
00475
00476     UpdateSelf(dc, entryInfo);
00477
00478     TRY
00479     {
00480         pen.CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
00481         pen2.CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
00482         pOldPen = dc.SelectObject(&pen);
00483
00484         int topY = selfB.TopLeft().y + 2;
00485         int botY = selfB.BottomRight().y - 2;
00486         int lefX = selfB.BottomRight().x + 4;
00487
00488         int count = 1;
00489         int tot = fNode->Childs().size() + 1;
00490
00491         // Draw the children
00492         vector<CLogNode*>::iterator i;
00493         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00494         {
00495             subNode = *i;
00496
00497             // Draw the link
00498             CRect& cb = GetData(subNode)->SelfBounds();
00499
00500             if( subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch )
00501                 dc.SelectObject(&pen);
00502             else
00503                 dc.SelectObject(&pen2);
00504
00505             float y = (float)topY + (float)(botY - topY) * (float)count / (float)tot;
00506             int rigX = cb.TopLeft().x - 4;
00507             float x = (float)rigX - (float)(rigX - lefX) * (float)count / (float)tot;
00508
00509             // Special drawing for the header node
00510             if( count == 1 && fNode->GetType() == kNodeHeader )
00511             {
00512                 dc.MoveTo(selfB.TopLeft().x + kHChildSpace/2, selfB.BottomRight().y);
00513                 dc.LineTo(selfB.TopLeft().x + kHChildSpace/2, cb.CenterPoint().y);
00514                 dc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00515             }
00516             else
00517             {
00518                 //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00519                 dc.MoveTo(selfB.BottomRight().x, (int)y);
00520                 dc.LineTo((int)x, (int)y);
00521                 dc.LineTo((int)x, cb.CenterPoint().y);
00522                 dc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00523             }
00524
00525             // Draw the sub-node
00526             GetData(subNode)->Update(dc, entryInfo);
00527         }
00528
00529         // Draw the next node
00530         if( nextNode != 0L )
00531         {
00532             // Draw the link
00533             CRect& nb = GetData(nextNode)->SelfBounds();
00534             if( nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch )
00535                 dc.SelectObject(&pen);
00536             else
00537                 dc.SelectObject(&pen2);
00538             int centerX = selfB.Width() < nb.Width() ?
00539                 selfB.CenterPoint().x : nb.CenterPoint().x;
00540
00541             dc.MoveTo(centerX, selfB.BottomRight().y);
00542             dc.LineTo(centerX, nb.TopLeft().y);
00543
00544             // Draw the next node
00545             GetData(nextNode)->Update(dc, entryInfo);
00546         }
00547
00548         if( pOldPen != 0L )
00549         {
00550             dc.SelectObject(pOldPen);
00551             pOldPen = 0L;
00552         }
00553
00554         if( pOldBrush != 0L )
00555         {
00556             dc.SelectObject(pOldBrush);
00557             pOldBrush = 0L;
00558         }
00559
00560         pen.DeleteObject();
00561         pen2.DeleteObject();
00562     }
00563     CATCH_ALL(e)
00564     {
00565         if( pOldPen != 0L )
00566             dc.SelectObject(pOldPen);
00567
00568         if( pOldBrush != 0L )
00569             dc.SelectObject(pOldBrush);
00570     }
00571     END_CATCH_ALL
00572 }

void CWinLogData::Update | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo = 0L
 | ) |

Definition at line 458 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(), URGB, URect::Width(), UPOINT::x, and UPOINT::y.

Referenced by UCvsGraph::OnBtnClick(), CGraphView::OnDraw(), UCvsGraph::OnDrawing(), CGraphView::OnPrint(), and Update().

00459 {
00460     CLogNode *subNode;
00461     CLogNode *nextNode = fNode->Next();
00462     UPen *pOldPen = 0L;
00463     UPen pen, pen2;
00464
00465     UpdateSelf(hdc, entryInfo);
00466
00467     try
00468     {
00469         pen.CreatePen(UPS_SOLID, 2, URGB(0, 0, 255));
00470         pen2.CreatePen(UPS_SOLID, 1, URGB(0, 0, 0));
00471         pOldPen = hdc.SelectObject(&pen);
00472
00473         int topY = selfB.TopLeft().y + 2;
00474         int botY = selfB.BottomRight().y - 2;
00475         int lefX = selfB.BottomRight().x + 4;
00476         int count = 1;
00477         int tot = fNode->Childs().size() + 1;
00478
00479         // draw the children
00480         std::vector<CLogNode *>::iterator i;
00481         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00482         {
00483             subNode = *i;
00484
00485             // draw the link
00486             URect & cb = GetData(subNode)->SelfBounds();
00487             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00488                 hdc.SelectObject(&pen);
00489             else
00490                 hdc.SelectObject(&pen2);
00491             float y = (float)topY + (float)(botY - topY) *
00492                 (float)count / (float)tot;
00493             int rigX = cb.TopLeft().x - 4;
00494             float x = (float)rigX - (float)(rigX - lefX) *
00495                 (float)count / (float)tot;
00496             //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00497             hdc.MoveTo(selfB.BottomRight().x, (int)y);
00498             hdc.LineTo((int)x, (int)y);
00499             hdc.LineTo((int)x, cb.CenterPoint().y);
00500             hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00501
00502             // draw the sub-node
00503             GetData(subNode)->Update(hdc, entryInfo);
00504         }
00505
00506         // draw the next node
00507         if(nextNode != 0L)
00508         {
00509             // draw the link
00510             URect & nb = GetData(nextNode)->SelfBounds();
00511             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00512                 hdc.SelectObject(&pen);
00513             else
00514                 hdc.SelectObject(&pen2);
00515             int centerX = selfB.Width() < nb.Width() ?
00516                 selfB.CenterPoint().x : nb.CenterPoint().x;
00517             hdc.MoveTo(centerX, selfB.BottomRight().y);
00518             hdc.LineTo(centerX, nb.TopLeft().y);
00519
00520             // draw the next node
00521             GetData(nextNode)->Update(hdc, entryInfo);
00522         }
00523
00524         if (pOldPen != 0L)
00525         {
00526             hdc.SelectObject(pOldPen);
00527             pOldPen = 0L;
00528         }
00529
00530         pen.DeleteObject();
00531         pen2.DeleteObject();
00532     }
00533     catch(...)
00534     {
00535         if (pOldPen != 0L)
00536             hdc.SelectObject(pOldPen);
00537     }
00538 }

virtual void CWinLogData::UpdateSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Implemented in CWinLogHeaderData, CWinLogRevData, CWinLogTagData, and CWinLogBranchData.

virtual void CWinLogData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, pure virtual]

Implemented in CWinLogHeaderData, CWinLogRevData, CWinLogTagData, and CWinLogBranchData.

Referenced by Update().

Member Data Documentation

bool CWinLogData::sel [protected]

Selection flag

Definition at line 78 of file GraphView.h.

Referenced by CWinLogData(), Selected(), SetSelected(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogRevData::UpdateSelf(), and CWinLogHeaderData::UpdateSelf().

CRect CWinLogData::selfB [private]

Self bounds

Definition at line 76 of file GraphView.h.

URect CWinLogData::selfB [protected]

Definition at line 77 of file UCvsGraph.h.

Referenced by ComputeBounds(), CWinLogData(), HitTest(), Offset(), SelfBounds(), SetSelected(), Update(), CWinLogBranchData::UpdateSelf(), CWinLogTagData::UpdateSelf(), CWinLogRevData::UpdateSelf(), and CWinLogHeaderData::UpdateSelf().

CRect CWinLogData::totB [private]

Total bounds

Definition at line 77 of file GraphView.h.

URect CWinLogData::totB [protected]

Definition at line 78 of file UCvsGraph.h.

Referenced by Bounds(), ComputeBounds(), CWinLogData(), HitTest(), and Offset().

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • WinCvs/GraphView.h
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:21:28 2003 for WinCvs Source by doxygen 1.3-rc2


CWinLogHeaderData Class Reference

Windows log header node data. More...

#include <UCvsGraph.h>

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 &dc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &dc, EntnodeData *entryInfo)

Detailed Description

Windows log header node data.

Definition at line 82 of file UCvsGraph.h.

Constructor & Destructor Documentation

CWinLogHeaderData::CWinLogHeaderData ( CLogNode * node ) [inline]

Definition at line 85 of file UCvsGraph.h.

00085 : CWinLogData(node) {}

virtual CWinLogHeaderData::~CWinLogHeaderData ( ) [inline, virtual]

Definition at line 86 of file UCvsGraph.h.

00086 {}

CWinLogHeaderData::CWinLogHeaderData ( CLogNode * node ) [inline]

Definition at line 128 of file GraphView.h.

00128 : CWinLogData(node) {}

virtual CWinLogHeaderData::~CWinLogHeaderData ( ) [inline, virtual]

Definition at line 129 of file GraphView.h.

00129 {}

Member Function Documentation

CSize CWinLogHeaderData::GetBoundsSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Get the bounds size

Parameters:
dc | Device context
entryInfo | Entry info
Returns:
Bounds size as CSize

Implements CWinLogData.

Definition at line 664 of file GraphView.cpp.

00665 {
00666     CLogNodeHeader& header = *(CLogNodeHeader*)fNode;
00667     return dc.GetTextExtent((*header).WorkingFile(),
00668         (*header).WorkingFile().length());
00669 }

USize CWinLogHeaderData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 102 of file UCvsGraph.cpp.

References UDC::GetTextExtent().

00103 {
00104     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00105     return hdc.GetTextExtent((*header).WorkingFile(),
00106         (*header).WorkingFile().length());
00107 }

void CWinLogHeaderData::UpdateSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Implements CWinLogData.

Definition at line 671 of file GraphView.cpp.

References URect::CenterPoint(), gGraphHeaderColor, kRoundRect, NULL, CWinLogData::Selected(), and CWinLogData::SelfBounds().

00672 {
00673     // Draw the node
00674     ::DrawNode(dc, SelfBounds(), gGraphHeaderColor, kRoundRect, Selected());
00675
00676     // Draw the content of the node
00677     TEXTMETRIC tm;
00678     dc.GetTextMetrics(&tm);
00679
00680     CPoint center = SelfBounds().CenterPoint();
00681     int nCenterX = center.x;
00682     int nCenterY = center.y - tm.tmHeight/2;
00683
00684     CLogNodeHeader& header = *(CLogNodeHeader*)fNode;
00685     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(),
00686         (*header).WorkingFile(), (*header).WorkingFile().length(), NULL);
00687 }

void CWinLogHeaderData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 204 of file UCvsGraph.cpp.

References UDC::GetTextHeight(), CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped(), URGB, UPOINT::x, and UPOINT::y.

00205 {
00206     // draw the node
00207     ::DrawNode(hdc, selfB, URGB(255, 0, 0), URGB(120, 0, 0), true, sel);
00208
00209     // draw the content of the node
00210     UPoint center = selfB.CenterPoint();
00211     int nCenterX = center.x;
00212     int nCenterY = center.y - hdc.GetTextHeight()/2;
00213     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00214     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00215         (*header).WorkingFile(), (*header).WorkingFile().length());
00216 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • WinCvs/GraphView.h
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:21:29 2003 for WinCvs Source by doxygen 1.3-rc2


CWinLogRevData Class Reference

Windows log revision node data. More...

#include <UCvsGraph.h>

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 &dc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &dc, EntnodeData *entryInfo)

Detailed Description

Windows log revision node data.

Definition at line 93 of file UCvsGraph.h.

Constructor & Destructor Documentation

CWinLogRevData::CWinLogRevData ( CLogNode * node ) [inline]

Definition at line 96 of file UCvsGraph.h.

00096 : CWinLogData(node) {}

virtual CWinLogRevData::~CWinLogRevData ( ) [inline, virtual]

Definition at line 97 of file UCvsGraph.h.

00097 {}

CWinLogRevData::CWinLogRevData ( CLogNode * node ) [inline]

Definition at line 142 of file GraphView.h.

00142 : CWinLogData(node) {}

virtual CWinLogRevData::~CWinLogRevData ( ) [inline, virtual]

Definition at line 143 of file GraphView.h.

00143 {}

Member Function Documentation

CSize CWinLogRevData::GetBoundsSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Get the bounds size

Parameters:
dc | Device context
entryInfo | Entry info
Returns:
Bounds size as CSize

Implements CWinLogData.

Definition at line 692 of file GraphView.cpp.

References USIZE::cx, and CWinLogData::IsDiskNode().

00693 {
00694     CLogNodeRev& rev = *(CLogNodeRev*)fNode;
00695     CSize size = dc.GetTextExtent((*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00696
00697     if( IsDiskNode(entryInfo) )
00698     {
00699         size.cx += 2 + 16 + 2;
00700         size.cy = max(16, size.cy);
00701     }
00702
00703     return size;
00704 }

USize CWinLogRevData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 218 of file UCvsGraph.cpp.

References USIZE::cx, USIZE::cy, UDC::GetTextExtent(), and CWinLogData::IsDiskNode().

00219 {
00220     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00221     USize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00222         strlen((*rev).RevNum().c_str()));
00223     if(IsDiskNode(entryInfo))
00224     {
00225         size.cx += 2 + 16 + 2;
00226         size.cy = std::max(16, size.cy);
00227     }
00228     return size;
00229 }

void CWinLogRevData::UpdateSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Implements CWinLogData.

Definition at line 706 of file GraphView.cpp.

References CGraphView::GetImgList(), gGraphDeadNodeColor, gGraphNodeColor, gGraphUserStateNodeColor, URect::Height(), CWinLogData::IsDeadNode(), CWinLogData::IsDiskNode(), CWinLogData::IsUserState(), kRectangle, NULL, CWinLogData::Selected(), CWinLogData::SelfBounds(), STYLE_DEADNODE, and STYLE_USERSTATENODE.

00707 {
00708     CRect txtRect = SelfBounds();
00709
00710     if( IsDiskNode(entryInfo) )
00711     {
00712         txtRect.left += 2 + 16 + 2;
00713     }
00714
00715     // Draw the node
00716     COLORREF contour = gGraphNodeColor;
00717     int penStyle = PS_SOLID;
00718
00719     if( IsDeadNode() )
00720     {
00721         contour = (COLORREF)gGraphDeadNodeColor;
00722         penStyle = STYLE_DEADNODE;
00723     }
00724     else if( IsUserState() )
00725     {
00726         contour = (COLORREF)gGraphUserStateNodeColor;
00727         penStyle = STYLE_USERSTATENODE;
00728     }
00729
00730     ::DrawNode(dc, SelfBounds(), contour, kRectangle, Selected(), penStyle);
00731
00732     // Draw the state icon if it is the rev. of the disk
00733     if( IsDiskNode(entryInfo) )
00734     {
00735         CImageList& list = CGraphView::GetImgList();
00736         CPoint w(SelfBounds().TopLeft());
00737         w.x += 2;
00738         w.y += (SelfBounds().Height() - 16) / 2;
00739
00740         list.Draw(&dc, CBrowseFileView::GetImageForEntry(entryInfo), w, ILD_TRANSPARENT);
00741     }
00742
00743     // Draw the content of the node
00744     TEXTMETRIC tm;
00745     dc.GetTextMetrics(&tm);
00746     CPoint center = txtRect.CenterPoint();
00747     int nCenterX = center.x;
00748     int nCenterY = center.y - tm.tmHeight/2;
00749     CLogNodeRev& rev = *(CLogNodeRev*)fNode;
00750     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, txtRect,
00751         (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()), NULL);
00752 }

void CWinLogRevData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 231 of file UCvsGraph.cpp.

References URect::CenterPoint(), UDC::DrawBitmap(), UDC::GetTextHeight(), CWinLogData::IsDiskNode(), URECT::left, CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped(), URGB, UPOINT::x, and UPOINT::y.

00232 {
00233     URect txtRect = selfB;
00234
00235     if(IsDiskNode(entryInfo))
00236     {
00237         txtRect.left += 2 + 16 + 2;
00238     }
00239
00240     // draw the node
00241     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 0), false, sel);
00242
00243     // draw the state icon if it is the rev. of the disk
00244     if(IsDiskNode(entryInfo))
00245     {
00246         UPoint w(selfB.TopLeft());
00247         w.x += 2;
00248         w.y += (selfB.Height() - 16) / 2;
00249         hdc.DrawBitmap(UCvsFiles::GetImageForEntry(entryInfo), w);
00250     }
00251
00252     // draw the content of the node
00253     UPoint center = txtRect.CenterPoint();
00254     int nCenterX = center.x;
00255     int nCenterY = center.y - hdc.GetTextHeight()/2;
00256     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00257     hdc.TextOutClipped(nCenterX, nCenterY, &txtRect,
00258             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00259 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • WinCvs/GraphView.h
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:21:30 2003 for WinCvs Source by doxygen 1.3-rc2


CWinLogTagData Class Reference

Windows log tag node data. More...

#include <UCvsGraph.h>

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 &dc, EntnodeData *entryInfo)
virtual CSize | GetBoundsSelf (CDC &dc, EntnodeData *entryInfo)

Detailed Description

Windows log tag node data.

Definition at line 104 of file UCvsGraph.h.

Constructor & Destructor Documentation

CWinLogTagData::CWinLogTagData ( CLogNode * node ) [inline]

Definition at line 107 of file UCvsGraph.h.

00107 : CWinLogData(node) {}

virtual CWinLogTagData::~CWinLogTagData ( ) [inline, virtual]

Definition at line 108 of file UCvsGraph.h.

00108 {}

CWinLogTagData::CWinLogTagData ( CLogNode * node ) [inline]

Definition at line 156 of file GraphView.h.

00156 : CWinLogData(node) {}

virtual CWinLogTagData::~CWinLogTagData ( ) [inline, virtual]

Definition at line 157 of file GraphView.h.

00157 {}

Member Function Documentation

CSize CWinLogTagData::GetBoundsSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Get the bounds size

Parameters:
dc | Device context
entryInfo | Entry info
Returns:
Bounds size as CSize

Implements CWinLogData.

Definition at line 757 of file GraphView.cpp.

00758 {
00759     CLogNodeTag& tag = *(CLogNodeTag*)fNode;
00760     return dc.GetTextExtent(*tag, (*tag).length());
00761 }

USize CWinLogTagData::GetBoundsSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 261 of file UCvsGraph.cpp.

References UDC::GetTextExtent().

00262 {
00263     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00264     return hdc.GetTextExtent(*tag, (*tag).length());
00265 }

void CWinLogTagData::UpdateSelf | ( | CDC & | dc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Draw the node

Parameters:
dc | Device context
entryInfo | Entry info

Implements CWinLogData.

Definition at line 763 of file GraphView.cpp.

References URect::CenterPoint(), gGraphTagColor, kRoundRect, NULL, CWinLogData::Selected(), and CWinLogData::SelfBounds().

00764 {
00765     // Draw the node
00766     ::DrawNode(dc, SelfBounds(), gGraphTagColor, kRoundRect, Selected());
00767
00768     // Draw the content of the node
00769     TEXTMETRIC tm;
00770     dc.GetTextMetrics(&tm);
00771     CPoint center = SelfBounds().CenterPoint();
00772     int nCenterX = center.x;
00773     int nCenterY = center.y - tm.tmHeight/2;
00774
00775     CLogNodeTag& tag = *(CLogNodeTag*)fNode;
00776     dc.ExtTextOut(nCenterX, nCenterY, ETO_CLIPPED, SelfBounds(), *tag, (*tag).length(), NULL);
00777 }

void CWinLogTagData::UpdateSelf | ( | UDC & | hdc,
 |  | EntnodeData * | entryInfo
 | ) | [protected, virtual]

Implements CWinLogData.

Definition at line 267 of file UCvsGraph.cpp.

References UDC::GetTextHeight(), CWinLogData::sel, CWinLogData::selfB, UDC::TextOutClipped(), URGB, UPOINT::x, and UPOINT::y.

00268 {
00269     // draw the node
00270     ::DrawNode(hdc, selfB, URGB(0, 0, 0), URGB(120, 120, 120), true, sel);
00271
00272     // draw the content of the node
00273     UPoint center = selfB.CenterPoint();
00274     int nCenterX = center.x;
00275     int nCenterY = center.y - hdc.GetTextHeight()/2;
00276     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00277     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00278         *tag, (*tag).length());
00279 }

The documentation for this class was generated from the following files:
  • common/UCvsGraph.h
  • WinCvs/GraphView.h
  • common/UCvsGraph.cpp
  • WinCvs/GraphView.cpp
Generated on Fri Jan 31 12:21:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 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.

00078     {
00079         return hasOne ? &placement : 0L;
00080     }

CWinPlacement& CWinPlacement::operator= ( const WINDOWPLACEMENT & newplace ) [inline]

Definition at line 91 of file MainFrm.cpp.

References 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.

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.

00073     {
00074         return hasOne ? sizeof(WINDOWPLACEMENT) : 0;
00075     }

Member Data Documentation

bool CWinPlacement::hasOne

Definition at line 62 of file MainFrm.cpp.

Referenced by CMainFrame::InitialShowWindow().

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 Fri Jan 31 12:21:32 2003 for WinCvs Source by doxygen 1.3-rc2


CWinThread Class Reference

Inheritance diagram for CWinThread:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/wincvs.cpp
Generated on Fri Jan 31 12:21:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:33 2003 for WinCvs Source by doxygen 1.3-rc2


CWndRedrawMngr Class Reference

Class to support efficient drawing of CWnd based windows by managing window's redraw. 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.

virtual | ~CWndRedrawMngr ()
Destructor will make sure that Redraw is set to TRUE when object goes out of scope.

void | SetRedraw (BOOL bRedraw)

Private Attributes

CWnd * m_pWnd

Detailed Description

Class to support efficient drawing of CWnd based windows by managing window's redraw.

Definition at line 45 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 623 of file wincvs_winutil.cpp.

References ASSERT, and m_pWnd.

00624 {
00625     ASSERT(pWnd != NULL);
00626     m_pWnd = pWnd;
00627
00628     if( m_pWnd )
00629     {
00630         m_pWnd->SetRedraw(bRedraw);
00631     }
00632 }

CWndRedrawMngr::~CWndRedrawMngr ( ) [virtual]

Destructor will make sure that Redraw is set to TRUE when object goes out of scope.

Definition at line 635 of file wincvs_winutil.cpp.

References m_pWnd.

00636 {
00637     if( m_pWnd )
00638     {
00639         m_pWnd->SetRedraw(TRUE);
00640     }
00641 }

Member Function Documentation

void CWndRedrawMngr::SetRedraw ( BOOL bRedraw )

Basic manipulation of the Redraw state

Parameters:
bRedraw New value for the Redraw state

Definition at line 647 of file wincvs_winutil.cpp.

References m_pWnd.

00648 {
00649     if( m_pWnd )
00650     {
00651         m_pWnd->SetRedraw(bRedraw);
00652     }
00653 }

Member Data Documentation

CWnd* CWndRedrawMngr::m_pWnd [private]

Window to manage

Definition at line 48 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 Fri Jan 31 12:21:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 96 of file StdAfx.h.

time_t wnt_stat::st_ctime

Definition at line 98 of file StdAfx.h.

_dev_t wnt_stat::st_dev

Definition at line 88 of file StdAfx.h.

short wnt_stat::st_gid

Definition at line 93 of file StdAfx.h.

_ino_t wnt_stat::st_ino

Definition at line 89 of file StdAfx.h.

unsigned short wnt_stat::st_mode

Definition at line 90 of file StdAfx.h.

time_t wnt_stat::st_mtime

Definition at line 97 of file StdAfx.h.

Referenced by cvsgui_GetFileModTime(), and tclGetFileModTimeProc().

short wnt_stat::st_nlink

Definition at line 91 of file StdAfx.h.

_dev_t wnt_stat::st_rdev

Definition at line 94 of file StdAfx.h.

_off_t wnt_stat::st_size

Definition at line 95 of file StdAfx.h.

short wnt_stat::st_uid

Definition at line 92 of file StdAfx.h.

The documentation for this struct was generated from the following file:
  • WinCvs/StdAfx.h
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


wstring Class Reference

Inheritance diagram for wstring:

[legend]
The documentation for this class was generated from the following file:
  • WinCvs/Win32wstring.hpp
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


Hierarchical Index

WinCvs Source Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • _afxRichEditCookie
  • _CvsProcess
  • _CvsProcessStartupInfo
  • _dircontents
  • _dirdesc
  • _frameRec
  • _IID
  • _MIDL_PROC_FORMAT_STRING
  • _MIDL_TYPE_FORMAT_STRING
  • _sDiffOptionsItem
  • _WireHandler
  • _WireMessage
  • AFX_DLLVERSIONINFO
  • CAllHandlers
  • CAllTargets
  • ansiAttrCvt
    • CTCP2Parse
  • ansiAttrCvt::AnsiSeq
  • AREF
  • aref
  • Authen
  • AuthenModel
    • AuthenGserver
    • AuthenKserver
    • AuthenLocal
    • AuthenNtserver
    • AuthenPserver
    • AuthenRhosts
    • AuthenServer
    • AuthenSSH
    • AuthenSspi
  • CAuthenSetUp
  • awidget
  • UBrush
  • CBuffer
  • CButton
    • CCJBrowseButton
    • CCJColorPicker
    • CCJFlatButton
      • CCJCaptionButton
      • CCJCBarButton
      • CPseudoButton
        • CPseudoRotButton
        • CPseudoToggle
    • CCJMetaFileButton
  • CCJMenuData
  • CCJShellTree
    • CMyShellTree
  • CCJSortClass
  • CCJSortClass::CSortItem
  • CCJTreeCtrl::Color_Font
  • CCmdUI
    • CCJToolCmdUI
  • UCmdUI
  • UCOLOR
  • UColor
  • CColorConsole
  • CComboBox
    • CCJComboBoxEx
    • CCJFlatComboBox
    • CCJFontCombo
    • CSmartComboBox
      • CKeywordComboBox
  • 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
    • CItemListConsole
      • CListParserConsole
      • CModuleParserConsole
      • CTagParserConsole
    • CPyCvsConsole
    • CRevisionConsole
    • CStreamConsole
    • CTCLCvsConsole
  • CCvsThreadLock
  • UDC
  • CDestroyThreadLock
  • CDialog
    • CAboutDlg
    • CAdminOptionDlg
    • CAskYesNo
    • CCustomizeMenus
    • CCVSAlert
    • CDiff_Options
    • CEditorMonDlg
    • CGraphOptDlg
    • CImportEntry
    • CImportFilterDlg
    • CImportWarning
    • CItemListDlg
    • CNoPython
    • CProgressDlg
    • CPseudoDlg
    • CSelectionDetailsDlg
    • CTipDlg
    • GetPassword
    • GetValue
  • CDiff_Options::CompareInfo
  • direct
  • CDockBar
    • CCJDockBar
    • CCJSizeDockBar
  • CDockContext
    • CCJDockContext
  • CDocument
    • CGraphDoc
    • CWincvsDoc
  • Wincvs::Document
  • DROPDOWNBUTTON
  • CDummyClass
  • CDummyInit
  • DYN_LIST
  • CEdit
    • CCJBrowseEdit
    • CCJHexEdit
    • CCJMaskEdit
      • CCJDateEdit
        • CCJTimeEdit
    • CGfxGroupEdit
    • CTbEdit
  • ENTNODE
  • EntnodeData
    • EntnodeFile
    • EntnodeFolder
  • EntnodePath
  • CFileDialog
    • CMfFileDialog
  • 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
  • ItemDisplayInfo
  • CItemListDlg::CompareInfo
  • ItemRowInfo
  • IUnknown
    • ICvsCoworker
      • CvsCoworker
  • Wincvs::IWincvs
  • CJX_COLORMAP
  • CJX_CONTROLPOS
  • keywordMode
  • KiColumn
    • KoConflictColumn
    • KoDateColumn
    • KoNameColumn
    • KoOptionColumn
    • KoPathColumn
    • KoRevisionColumn
    • KoStatusColumn
    • KoTagColumn
  • KiColumnModel
    • KoRecursiveModel
    • KoRegularModel
  • KiFilterModel
    • KoFilterModel
  • KiIgnoreModel
    • KoIgnoreModel
  • KiRecursionModel
    • KoRecursionModel
  • KiSelectionHandler
    • KoAddBinaryHandler
    • KoAddHandler
    • KoAddUnicodeHandler
    • KoAnnotateHandler
    • KoBranchTagHandler
    • KoCancelChangesHandler
    • KoCheckoutHandler
    • KoCommandLineHandler
    • KoCommitHandler
    • KoCreateTagHandler
    • KoDeleteTagHandler
    • KoDiffHandler
    • KoEditHandler
    • KoEditorsHandler
    • KoFileRemoveHandler
    • KoForceEditHandler
    • KoGraphDiffHandler
    • KoGraphHandler
    • KoImportHandler
    • KoLockHandler
    • KoLogHandler
    • KoMoveToTrashHandler
    • KoQueryUpdateHandler
    • KoReleaseHandler
    • KoReservedEditHandler
    • KoRtagBranchHandler
    • KoRtagCreateHandler
    • KoRtagDeleteHandler
    • 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
  • match_dir
  • CMDIChildWnd
    • CCJMDIChildWnd
      • CGraphFrame
      • CLogFrame
  • CMDIFrameWnd
    • CCJMDIFrameWnd
      • CMainFrame
  • CMemFile
    • CCJMemFile
  • CMenu
    • CCJMenu
    • CColorMenu
  • UMessageMapFunctions
  • CMiniDockFrameWnd
    • CCJMiniDockFrameWnd
  • mircAttrCvt
    • CTCP2Parse
  • CMsg
  • UMSGMAP
  • UMSGMAP_ENTRY
  • MultiFiles
  • MultiFilesEntry
  • MultiFilesEntryIndex
  • 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
        • UAuthen_Sspi
        • UCvsApp
        • UCvsConsole
        • UCvsFiles
        • UCvsFolders
        • UCvsFrame
        • UCvsGraph
        • UMenu
          • UCvsMenubar
          • UMacAppMenu
          • UPPMenu
        • UPromptMessage
          • UEditMessage
        • USaveSettings
        • UToolbar
          • UCvsToolbar
  • ColorTableEntry
  • option
  • OUTBAR_INFO
  • CPathBuffer
  • UPen
  • CPersistent::CPersistentEntry
  • UPOINT
    • UPoint
  • poolRec
  • CProgress
  • CPropertyPage
    • CAnnotate_MAIN
    • CCheckout_MAIN
    • CCheckout_OPTIONS
    • CCmdLine_MAIN
    • CCommit_MAIN
    • CCommit_OPTIONS
    • CDiff_MAIN
    • CGetPrefs_CVS
    • CGetPrefs_CVSCMD_DIALOGS
    • CGetPrefs_CVSROOT
    • CGetPrefs_GLOBALS
    • CGetPrefs_WINCVS
    • CImport_MAIN
    • CImport_OPTIONS
    • CInit_MAIN
    • CLogFilters
    • CLogin_MAIN
    • CLogMain
    • CRelease_MAIN
    • CRtag_MAIN
    • CRtag_OPTIONS
    • CStatus_MAIN
    • 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
  • CSelectionChangeNotifier
  • CSelectionDetailsDlg::CompareInfo
  • SelectionDisplayInfo
  • 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
  • CVS_COWORKERLib::CvsCoworker
  • CvsFilenames
  • CvsPrefs
  • CvsProcessCallbacks
  • CvsProject
  • CvsString
  • CvsTrace
  • UWaitCursor
  • CWinApp
    • CWincvsApp
  • WINDOWPLACEMENT
    • CCJWindowPlacement
  • WININFO
  • CWinThread
    • CLogoutThread
  • CWnd
    • CCJCaptionPopupWnd
    • CCJColorPopup
    • CCJDateTimeCtrl
    • CCJFlatTabCtrl
    • CCJLogoPane
    • CCJMonthCalCtrl
    • CCJPagerCtrl
    • CCJReBarCtrl
    • CGfxOutBarCtrl
    • CSplashWnd
  • CWndRedrawMngr
  • wnt_stat
  • wstring
    • Win32wstring
Generated on Fri Jan 31 12:13:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 classes they belong to:

- _ -

  • _AddBar() : CCJReBar
  • _AddButton() : PyMenuMgr
  • _AddPulldown() : PyMenuMgr
  • _AddSeparator() : PyMenuMgr
  • _AddToggle() : PyMenuMgr
  • _afxRichEditCookie() : _afxRichEditCookie
  • _Count() : PyMenuMgr
  • _CvsProcessStartupInfo() : _CvsProcessStartupInfo
  • _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_Sspi, 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_Sspi, 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() : MultiFilesEntry, CvsArgs
  • Add() : CSubclassWndMap, CMacroSet
  • AddBar() : CCJReBar
  • AddBitmapToImageList() : CCJMenu
  • AddButton() : PyMenuMgr
  • AddButtons() : CCJToolBar
  • AddColumn() : CCJListView, CCJListCtrl
  • AddColumns() : CBrowseFileView
  • AddControl() : CCJStatusBar, CvsPrefs
  • addcvsroot() : CvsArgs
  • 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 >
  • 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() : CvsArgs
  • argc : _CvsProcess, 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
  • AuthenServer() : AuthenServer
  • AuthenSSH() : AuthenSSH
  • AuthenSspi() : AuthenSspi
  • AutoDropWidth : USmartCombo
  • AutoSaveColumns() : CCJListView, CCJListCtrl
  • AutoSize() : CCJToolBar
  • AutoSizeColumn() : CCJListView, CCJListCtrl
  • awidget() : awidget

- b -

  • b : UCOLOR, UColor
  • B : CTCP2Parse::RGBColor
  • bDownArrow : CGfxOutBarCtrl
  • bDownPressed : CGfxOutBarCtrl
  • BeforeNavigate2() : CCJHtmlView
  • BeforeUpdateUI() : UWidget
  • begin() : TMString< T >, MultiFiles
  • 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
  • CDiff_Options() : CDiff_Options
  • CDockBar : CCJMiniDockFrameWnd
  • CDummyClass() : CDummyClass
  • CDummyInit() : CDummyInit
  • CDynToolBar() : CDynToolBar
  • CEditorMonDlg() : CEditorMonDlg
  • CenterPoint() : URect
  • CExploreBar() : CExploreBar
  • CFillPyEntries() : CFillPyEntries
  • CFillTclEntries() : CFillTclEntries
  • CFindSettings() : CFindSettings
  • CGetPrefs_CVS() : CGetPrefs_CVS
  • 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
  • CheckSettings() : CItemListDlg
  • 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
  • CItemListConsole() : CItemListConsole
  • CItemListDlg() : CItemListDlg
  • CKeyString() : CKeyString
  • CKeywordComboBox() : CKeywordComboBox
  • 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
  • classUAuthen_Sspi : UAuthen_Sspi
  • 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
  • Clear() : CPathBuffer, CGraphDoc
  • ClearSelection() : CCJTreeCtrl
  • CListParserConsole() : CListParserConsole
  • CLogFilters() : CLogFilters
  • CLogFrame() : CLogFrame
  • CLogin_MAIN() : CLogin_MAIN
  • CLogMain() : CLogMain
  • CLogoutThread() : CLogoutThread
  • Close() : CCJMemFile
  • CloseProject() : CvsCoworker, ICvsCoworker
  • closeProject() : CvsProject
  • ClosePythonSupport() : CPython_Interp
  • CMacBinItem() : CMacBinItem
  • CMacBinTable() : CMacBinTable
  • CMacroEntry() : CMacroEntry
  • CMacroSet() : CMacroSet
  • CMainFrame() : CMainFrame
  • cmd : CustInvertTable, awidget, UTB_BUTTON
  • CMenuItemInfo() : CMenuItemInfo
  • CMfFileDialog() : CMfFileDialog
  • CMMenuString() : CMMenuString
  • CModuleParserConsole() : CModuleParserConsole
  • 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
  • CompareItems() : CSelectionDetailsDlg, CItemListDlg, CDiff_Options
  • ComputeBounds() : CWinLogData
  • ComputeMenuTrackPoint() : CCJMenuBar
  • Concatenate() : CKeyString
  • conflicts : ImportReport
  • consoleerr : CvsProcessCallbacks
  • consoleout : CvsProcessCallbacks
  • const_iterator : MultiFiles
  • ControlCvsArgs() : ControlCvsArgs
  • convert() : Win32wstring
  • COptionalPropertySheet() : COptionalPropertySheet
  • CopyRect() : URect
  • CopyReturn() : PyAutoObject< T >
  • CopyRow() : CCJListView, CCJListCtrl
  • Count() : PyMenuMgr
  • cp : CTCP2Parse
  • CPathBuffer() : CPathBuffer
  • cpDef : CTCP2Parse
  • CPersistent() : CPersistent
  • CPersistentBool() : CPersistentBool
  • CPersistentInt() : CPersistentInt
  • CPersistentT() : CPersistentT< T >
  • cpLast : CTCP2Parse
  • CProgress() : CProgress
  • CProgressDlg() : CProgressDlg
  • 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, CExploreBar, CGfxOutBarCtrl, CCJToolBarCtrl, CCJToolBar, CCJTabCtrl, CCJReBarCtrl, CCJReBar, CCJPagerCtrl, CCJMiniDockFrameWnd, CCJMenuBar, CCJLogoPane, CCJHtmlView, CCJHexEdit, CCJExplorerBar, CCJMonthCalCtrl, CCJDateTimeCtrl, CCJControlBar, CCJComboBoxEx, CCJColorPopup, CCJCaptionPopupWnd, CCJCaption, CCJBrowseButton, CBrowserBar, SelectionDisplayInfo, PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry, CProgressDlg, ItemDisplayInfo
  • 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
  • CRelease_MAIN() : CRelease_MAIN
  • CRevisionConsole() : CRevisionConsole
  • crHilightBorder : CGfxOutBarCtrl
  • crLightBorder : CGfxOutBarCtrl
  • crShadowBorder : CGfxOutBarCtrl
  • CRtag_MAIN() : CRtag_MAIN
  • CRtag_OPTIONS() : CRtag_OPTIONS
  • crTextColor : CGfxOutBarCtrl
  • CSelectionChangeNotifier() : CSelectionChangeNotifier
  • CSelectionDetailsDlg() : CSelectionDetailsDlg
  • CSmartComboBox() : CSmartComboBox
  • CSortHeaderCtrl() : CSortHeaderCtrl
  • CSortItem() : CCJSortClass::CSortItem
  • CSortList() : CSortList< T >
  • CSortParam() : CSortParam
  • CSplashWnd() : CSplashWnd
  • CStackThreadLock() : CStackThreadLock
  • CStaticAllocT() : CStaticAllocT< T >
  • CStatus_MAIN() : CStatus_MAIN
  • CStreamConsole() : CStreamConsole
  • CSubclassWnd() : CSubclassWnd
  • CSubclassWndMap : CSubclassWndMap, CSubclassWnd
  • CTag_MAIN() : CTag_MAIN
  • CTagParserConsole() : CTagParserConsole
  • CTbEdit() : CTbEdit
  • CTcl_Interp() : CTcl_Interp
  • CTCLBrowserEnt() : CTCLBrowserEnt
  • CTCLCvsConsole() : CTCLCvsConsole
  • CTCP2Parse() : CTCP2Parse
  • CTempToggleBool() : CTempToggleBool
  • cText : OUTBAR_INFO
  • CTipDlg() : CTipDlg
  • CtlColor() : CCJHyperLink
  • CTmpFiles() : CTmpFiles
  • CToolbarCombo() : CToolbarCombo
  • CTurnOffDispatching() : CTurnOffDispatching
  • CUpdateMain() : CUpdateMain
  • CUpdateMerge() : CUpdateMerge
  • CUpdateSticky() : CUpdateSticky
  • current : DYN_LIST, TbEntryDropDown
  • currentDirectory : _CvsProcessStartupInfo
  • currRev : FileEntry
  • Customize() : CCJToolBar
  • cvs_err() : CRevisionConsole, CGraphConsole, CTCLCvsConsole, CPyCvsConsole, CItemListConsole, CStreamConsole, CCvsConsole
  • cvs_out() : CRevisionConsole, CGraphConsole, CTCLCvsConsole, CPyCvsConsole, CItemListConsole, CStreamConsole, CCvsConsole
  • 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() : CCvsThreadLock, CLogoutThread, CSortList< T >, PyMenuMgr
  • DeleteAllItems() : CWinCvsBrowser, CCJFlatTabCtrl, UCvsFolders, CSelectionDetailsDlg, CItemListDlg
  • 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, keywordMode, EntnodeData
  • description : _sDiffOptionsItem
  • destroy : _CvsProcess
  • destroy_func : _WireHandler
  • DestroyMenu() : CCJMenu
  • Deunixfy() : CTcl_Interp
  • DiffFile() : CvsCoworker, ICvsCoworker
  • diffFile() : CvsProject
  • dir : MultiFilesEntry
  • Dir() : CCJComboBoxEx
  • dirPath : match_dir
  • dirs : MultiFiles
  • DirtySupport() : CvsPrefs
  • disable_old_style : CCJMenu
  • DisableColumnSizing() : CCJListView, CCJListCtrl
  • DisableCommon() : CWinCvsBrowser, CGraphView, CExploreBar, CMyShellTree, CBrowseFileView
  • DisableFlatLook() : CCJFlatButton
  • DisableFlatStyle() : CCJFlatSplitterWnd
  • DisableGeneric() : UCvsFolders, UCvsFiles
  • DisableSplashScreen() : CvsPrefs
  • DisableUpdate() : CGraphView
  • DisableUserSettings() : ReportConflict
  • Discard() : CCJMemFile
  • Dismiss() : UWidget
  • DisplayItems() : CItemListDlg
  • DisplaySelection() : CSelectionDetailsDlg
  • DitherBlt() : CCJMenu
  • DitherBlt2() : CCJMenu
  • do_C() : ansiAttrCvt
  • do_m() : ansiAttrCvt
  • DockControlBarLeftOf() : CMainFrame, CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • DockFlatBorders : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd
  • DockSizeBar() : CCJMDIFrameWnd, CCJMDIChildWnd, CCJFrameWnd, CCJDockContext
  • DocumentComplete() : CCJHtmlView
  • DoDataExchange() : CAboutDlg, CTipDlg, CNoPython, CCustomizeMenus, CUpdateSticky, CUpdateMerge, CUpdateMain, CTag_MAIN, CStatus_MAIN, CSelectionDetailsDlg, CRtag_OPTIONS, CRtag_MAIN, CRelease_MAIN, CProgressDlg, USaveSettings, CLogin_MAIN, CLogFilters, CLogMain, CCmdLine_MAIN, CItemListDlg, CInit_MAIN, CImportEntry, CImportWarning, CImportFilterDlg, CImport_OPTIONS, CImport_MAIN, CGraphOptDlg, GetValue, CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_CVS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT, GetPassword, CEditorMonDlg, CDiff_Options, CDiff_MAIN, CCVSAlert, CCommit_OPTIONS, CCommit_MAIN, CCheckout_OPTIONS, CCheckout_MAIN, UAuthen_Sspi, 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() : CMfFileDialog, 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, AuthenSspi, 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
  • EnableCmdLineDiffOptions() : CDiff_MAIN
  • EnableCompareType() : CDiff_MAIN
  • EnableControls() : CSelectionDetailsDlg, CItemListDlg
  • EnableDateRev() : CItemListDlg
  • 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 >, MultiFiles
  • 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 : CMacroSet, MacBinMaps, WININFO
  • Entries() : MacBinMaps
  • 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
  • fAllStrs : CMMenuString, TMString< T >
  • False() : PyContainer
  • fAnimation : CGfxOutBarCtrl
  • fBuf : CMMenuString, TMString< T >, TMPersistent< T >
  • fButtonStep : TPseudoScrollBar
  • fClass : CPersistent::CPersistentEntry
  • fController : UPseudoPlaceHolder
  • fcreator : ReportConflict
  • fCurrentIcon : UPseudoRotButton, TPseudoRotateIconButton
  • fCurrentView : UPseudoPlaceHolder
  • fCurSel : UPseudoPageHider
  • fCvsRunningCounter : CvsPrefs
  • fDef : CSortList< T >
  • fDefValue : CPersistentT< T >
  • fDragItems : CGfxOutBarCtrl
  • Feature : USmartCombo
  • fEditGroups : CGfxOutBarCtrl
  • fEditItems : CGfxOutBarCtrl
  • FeedThisLine() : UCvsConsole
  • fElems : CSortList< T >
  • fExitOnError : CTcl_Interp
  • 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 >
  • find() : UStr
  • 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
  • FlushDisplay() : CProgressDlg
  • fMap : CMacBinItem
  • fMax : CSortList< T >
  • fMaximum : TPseudoDoubleNumberText
  • fMaxStr : CMMenuString, TMString< T >
  • fMethod : CSortList< T >
  • fMinimum : TPseudoDoubleNumberText
  • fNewOne : CSortList< T >
  • fntLast : CTCP2Parse
  • fntSize : CTCP2Parse
  • fNum : CSortList< T >
  • ForceAbort() : CProgress
  • 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
  • fPageCtrl : UPseudoPageHider
  • fPageStep : TPseudoScrollBar
  • fPrecision : TPseudoDoubleNumberText
  • fRealWidth : TBuggyPopup
  • fRemoveGroups : CGfxOutBarCtrl
  • fRemoveItems : CGfxOutBarCtrl
  • FreshenFileMask() : CMainFrame, UCvsFrame
  • fromHex() : CTCP2Parse
  • 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 : CColorConsole
  • fViewSuite : UPseudoPageHider, UPseudoPlaceHolder
  • fWidid : UPseudoPageHider, UPseudoPlaceHolder
  • fWidID : TPseudoWinAdorner, TPseudoWinBehavior

- g -

  • g : UCOLOR, UColor
  • G : CTCP2Parse::RGBColor
  • gApp : UCvsApp
  • gCurMacBinMap : CMacBinTable
  • gCurRsaIdentity : AuthenSSH
  • gCvsProcess : UCvsApp
  • gCvsRunning : UCvsApp
  • gCvsStopping : UCvsApp
  • get() : MultiFilesEntry
  • Get() : CSortList< T >, CAllTargets
  • GetActiveView() : CCJTabView, CCJTabCtrlBar
  • GetAddressBar() : CCJHtmlView
  • GetAllColors() : CGraphOptDlg
  • GetAllInstances() : AuthenModel
  • GetAllRevs() : TGraphDelCmd
  • 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_Sspi, 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
  • GetBuffer() : CPathBuffer
  • 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, UCvsFiles
  • GetComboBoxCtrl() : CCJComboBoxEx
  • GetConflict() : EntnodeFile, EntnodeData
  • GetConsoleView() : CWincvsApp, CMainFrame
  • GetContainer() : CCJHtmlView
  • GetCount() : KiColumnModel, KoRecursiveModel, KoRegularModel
  • GetCountPerPage() : CGfxOutBarCtrl
  • GetCountSel() : TGraphDelCmd
  • GetCurFormat() : CWincvsView
  • GetCurModal() : UWidget
  • GetCurrent() : CPseudoRotButton
  • GetCurrentMap() : CMacBinTable
  • GetCurrentState() : UPseudoRotButton
  • GetCurrentView() : UPseudoPlaceHolder
  • GetCurSel() : CCJFlatTabCtrl, CCJMonthCalCtrl
  • GetCvsErr() : CItemListConsole
  • GetCvsExitOnError() : CTcl_Interp
  • GetCvsLastErrorCode() : CTcl_Interp
  • GetCvsProcess() : CWincvsApp, UCvsApp
  • GetData() : CWinPlacement, CWinLogData, CMMenuString, CCJHexEdit, CWinLogData, CTCLBrowserEnt, CPersistentT< T >, CPersistent, TMString< T >, TMPersistent< T >, PCStr, PCPStr
  • GetDateTime() : CCJDateEdit
  • GetDesc() : ReportWarning, ReportConflict, EntnodeData
  • GetDescription() : ItemDisplayInfo
  • GetDescriptionEx() : ItemDisplayInfo
  • GetDeviceScrollPosition() : CScrollView
  • GetDiffOptions() : CDiff_Options
  • getdir() : MultiFiles, MultiFilesEntry
  • 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() : SelectionDisplayInfo
  • getFilename() : CvsFilenames
  • getFilesToAdd() : CvsProject
  • GetFilesToAdd() : CvsCoworker, ICvsCoworker
  • GetFilesView() : UCvsApp
  • GetFileView() : CWincvsApp
  • GetFilterModel() : CWincvsApp, CMainFrame, UCvsFrame, UCvsApp
  • 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
  • GetIgnoreList() : ImportReport
  • GetIgnoreModel() : CWincvsApp, CMainFrame, UCvsFrame, UCvsApp
  • GetImageForEntry() : CBrowseFileView, UCvsFiles
  • GetImageForItem() : CItemListDlg
  • GetImageID() : CContentItems
  • GetImageIndexFromRuntimeClass() : CCJTabCtrlBar
  • GetImageList() : CGfxOutBarCtrl, CCJToolBarCtrl, CCJToolBar, CCJReBarCtrl, CCJComboBoxEx
  • GetImgList() : CGraphView
  • GetIndex() : CCJColorPopup, MultiFilesEntryIndex
  • GetInitializedMenu() : CCJMDIChildWnd
  • GetInsertMark() : CCJToolBarCtrl
  • GetInsertMarkColor() : CCJToolBarCtrl
  • GetInsideRect() : CGfxSplitterWnd, CGfxOutBarCtrl
  • GetInstance() : AuthenModel
  • GetItem() : TBrowserFillDummy, CCJComboBoxEx, ItemDisplayInfo
  • GetItemBold() : CCJTreeCtrl
  • GetItemByLocation() : CWinCvsBrowser, UCvsFolders
  • GetItemColor() : CCJTreeCtrl
  • GetItemCount() : CGfxOutBarCtrl, CGfxOutBarCtrl::CBarFolder, CCJFlatTabCtrl
  • GetItemData() : CGfxOutBarCtrl
  • GetItemFont() : CCJTreeCtrl
  • GetItemID() : CCJToolBar
  • GetItemImage() : CGfxOutBarCtrl
  • GetItemList() : CItemListConsole
  • GetItemRect() : CGfxOutBarCtrl, CCJToolBar, CCJFlatTabCtrl
  • GetItems() : USmartCombo
  • GetItemSize() : CGfxOutBarCtrl
  • GetItemText() : CToolbarCombo, CGfxOutBarCtrl, TPseudoTextListView
  • GetIterator() : MultiFilesEntryIndex
  • GetKind() : AuthenModel, AuthenServer, AuthenSspi, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH, AuthenLocal
  • GetKindDesc() : ReportConflict
  • GetLabelRect() : CGfxOutBarCtrl
  • GetLastError() : CvsCoworker, ICvsCoworker
  • getLastError() : CvsProject
  • GetLastItem() : CCJTreeCtrl
  • GetLaunchRes() : CItemListConsole
  • 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, UCvsApp, 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_Sspi, 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
  • GetNeedSelection() : KiSelectionHandler
  • GetNeedViewReset() : KiSelectionHandler
  • GetNextID() : CCJBrowseButton
  • GetNextItem() : CCJTreeCtrl
  • GetNextOrPrevButton() : CCJMenuBar
  • GetNextPathName() : CMfFileDialog
  • GetNextSelectedItem() : CCJTreeCtrl
  • GetNextTipString() : CTipDlg
  • GetNode() : CGraphDoc
  • GetNormalized() : CTCLBrowserEnt
  • GetNotificationManager() : KoIgnoreModel, KoRecursionModel, KoFilterModel, KiIgnoreModel, KiRecursionModel, KiFilterModel
  • getNumberOfFilenames() : CvsFilenames
  • GetOffline() : CCJHtmlView
  • GetOldLoc() : CHistComboBoxEx
  • GetOnlyRev() : TGraphDelCmd
  • GetOptionCheckRect() : COptionalPropertySheet
  • getOptionsAndFilename() : CvsFilenames
  • GetOverideList() : UWidget
  • GetPadding() : CCJToolBar
  • GetPageValue() : LPseudoWinAttachment
  • GetPalette() : CCJReBarCtrl
  • GetPanControl() : CCJStatusBar
  • GetParentBrowser() : CCJHtmlView
  • GetPassword() : GetPassword
  • GetPath() : CBrowseFileView, UCvsFiles, SelectionDisplayInfo
  • GetPathLength() : 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, UCvsFrame, UCvsApp
  • GetRecursiveModel() : KiColumnModel
  • GetRegisterAsBrowser() : CCJHtmlView
  • GetRegisterAsDropTarget() : CCJHtmlView
  • GetRegKey() : CCJHyperLink
  • GetRegularModel() : KiColumnModel
  • GetRemoveDirectoryOption() : CRelease_MAIN
  • GetRevision() : SelectionDisplayInfo
  • GetRoot() : CWinCvsBrowser, CWincvsApp, UCvsFolders
  • GetRow() : CCJColorPopup
  • GetRowCount() : CCJReBarCtrl
  • GetRowHeight() : CCJReBarCtrl
  • GetRowInfo() : ItemDisplayInfo
  • GetRows() : CCJToolBar
  • GetRuntimeClass() : UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, UCvsApp, CPersistentInt, CPersistentBool, CPersistent, USaveSettings, CMPString, CMString, PCStr, PCPStr, UAuthen_Sspi, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage, UWidget, UToolbar, UObject, UMenu, UCmdTarget, UMacAppMenu
  • GetSel() : CCJHexEdit
  • GetSel1() : TGraphCmdStatus
  • GetSel2() : TGraphCmdStatus
  • GetSelCount() : TGraphCmdStatus
  • GetSelection() : KiSelectionHandler
  • GetSelectionChanged() : CWinCvsBrowser
  • GetSelectionMode() : CCJColorPicker
  • GetSelectionNotificationLocked() : CWinCvsBrowser
  • GetSelFolder() : CGfxOutBarCtrl
  • GetSelFont() : CCJFontCombo
  • GetSelRange() : CCJMonthCalCtrl
  • GetSelType() : KiSelectionHandler
  • GetSettingsDesc() : AuthenModel, AuthenSspi, AuthenGserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • GetSetupData() : KiColumn, KoConflictColumn, KoDateColumn, KoTagColumn, KoStatusColumn, KoOptionColumn, KoRevisionColumn, KoPathColumn, KoNameColumn
  • GetSilent() : CCJHtmlView
  • GetStandardSignature() : TPseudoDoubleNumberText, TPseudoTextListView
  • GetStartPosition() : CMfFileDialog
  • GetState() : CCJToolBar, CPseudoToggle
  • GetStateDesc() : ReportWarning, ReportConflict
  • 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_Sspi, 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, AuthenServer, AuthenSspi, 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, KoTraversalContext, 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
  • 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
  • HasEncryption() : AuthenModel, AuthenSspi, AuthenGserver
  • hasExtension : ReportConflict
  • HasFeature() : USmartCombo
  • HasFocus() : UWidget
  • HasForceBinary() : ReportConflict
  • HasForceNoKeywords() : ReportConflict
  • HasForceText() : ReportConflict
  • HasForceUnicode() : ReportConflict
  • HasHost() : AuthenModel, AuthenServer, AuthenSspi, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • HasIgnore() : ReportConflict
  • hasIgnore : ReportConflict
  • HasLogin() : AuthenModel, AuthenSspi, AuthenPserver
  • HasLoogedIn() : CvsPrefs
  • HasModal() : UWidget
  • hasOne : CWinPlacement
  • HasProblem() : ControlCvsArgs
  • HasSettings() : AuthenModel, AuthenSspi, AuthenGserver, AuthenNtserver, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • hasTty : _CvsProcessStartupInfo
  • HasTypeCreatorConflict() : ReportConflict
  • hasTypeCreatorConflict : ReportConflict
  • HasUser() : AuthenModel, AuthenServer, AuthenSspi, AuthenKserver, AuthenRhosts, AuthenPserver, AuthenSSH
  • hDragCursor : CGfxOutBarCtrl
  • height : WININFO
  • Height() : URect
  • heightbtn : UTB_INIT
  • Helper() : CvsPrefs
  • hHandCursor : CGfxOutBarCtrl
  • HideButton() : CCJToolBar
  • HideColumn() : CCJFlatSplitterWnd
  • HideColumns() : UCvsFiles
  • HideCommandDlgAnnotate() : CvsPrefs
  • HideCommandDlgDiff() : CvsPrefs
  • HideCommandDlgGraph() : CvsPrefs
  • HideCommandDlgLog() : CvsPrefs
  • HideCommandDlgStatus() : 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

- i -

  • icon : ULIST_INSERT, UTREE_INFO, UTREE_INSERT, UTB_BUTTON
  • icons : TbEntryDropDown
  • ICTextOption() : CvsPrefs
  • idButton : DROPDOWNBUTTON
  • IDD : CAboutDlg, CNoPython, CCustomizeMenus, CUpdateSticky, CUpdateMerge, CUpdateMain, CTag_MAIN, CStatus_MAIN, CSelectionDetailsDlg, CRtag_OPTIONS, CRtag_MAIN, CRelease_MAIN, CProgressDlg, CLogin_MAIN, CLogFilters, CLogMain, CCmdLine_MAIN, CItemListDlg, CInit_MAIN, CImportEntry, CImportWarning, CImportFilterDlg, CImport_OPTIONS, CImport_MAIN, CGraphOptDlg, GetValue, CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_CVS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT, GetPassword, CEditorMonDlg, CDiff_Options, 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() : CCvsThreadLock, CCustInvertTable
  • InitializeControl() : CCJBrowseEdit
  • InitializeDockingWindows() : CMainFrame
  • InitializeFonts() : CCJFontCombo
  • InitializeHeader() : CCJFlatHeaderCtrl
  • InitializeMenu() : CCJMDIFrameWnd, CCJFrameWnd
  • InitializeMenuList() : CCJMenu
  • InitialShowWindow() : CMainFrame
  • InitInstance() : CWincvsApp, CLogoutThread
  • InitItem() : TViewFill
  • InitListCtrl() : CItemListDlg
  • InitOptionCtrls() : CItemListDlg
  • 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
  • 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() : CWincvsApp, UCvsApp, CvsPrefs
  • IsCvsStopping() : CWincvsApp, 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
  • IsError() : ReportWarning
  • 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, TViewFill, KoTraversalContext
  • IsRemoved() : EntnodeData, KoFilterModel
  • IsRightDocked() : CCJControlBar
  • IsSamePath() : CBrowseFileView, CTCLBrowserEnt
  • IsSelected() : CWincvsView, CCJHexEdit
  • IsSelSingleNode() : CGraphView
  • IsShowIgnored() : TViewFill, KoTraversalContext, 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_Sspi, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage
  • kCheckEncrypt : UAuthen_Sspi, 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 : Authen, ReportWarning, TbEntry
  • Kind() : ReportWarning
  • kindstr() : Authen
  • kindToNum() : Authen
  • kindToToken() : Authen
  • KiSelectionHandler() : KiSelectionHandler
  • kItemImgBlank : CItemListDlg
  • kItemImgBranch : CItemListDlg
  • kItemImgBranchAndRevision : CItemListDlg
  • kItemImgDir : CItemListDlg
  • kItemImgFile : CItemListDlg
  • kItemImgModule : CItemListDlg
  • kItemImgRevision : CItemListDlg
  • kItemImgUpDir : CItemListDlg
  • kMsg : UEditMessage, UPromptMessage
  • kMultiClickSelection : TPseudoTextListView
  • kName : EntnodeData
  • kNameProxy : UAuthen_Pserver
  • KoAddBinaryHandler() : KoAddBinaryHandler
  • KoAddHandler() : KoAddHandler
  • KoAddUnicodeHandler() : KoAddUnicodeHandler
  • KoAnnotateHandler() : KoAnnotateHandler
  • KoBranchTagHandler() : KoBranchTagHandler
  • KoCancelChangesHandler() : KoCancelChangesHandler
  • KoCheckoutHandler() : KoCheckoutHandler
  • KoColumnContext() : KoColumnContext
  • KoCommandLineHandler() : KoCommandLineHandler
  • KoCommitHandler() : KoCommitHandler
  • KoCreateTagHandler() : KoCreateTagHandler
  • KoDeleteTagHandler() : KoDeleteTagHandler
  • KoDiffHandler() : KoDiffHandler
  • KoEditHandler() : KoEditHandler
  • KoEditorsHandler() : KoEditorsHandler
  • KoFileRemoveHandler() : KoFileRemoveHandler
  • KoFilterModel() : KoFilterModel
  • KoForceEditHandler() : KoForceEditHandler
  • KoGraphDiffHandler() : KoGraphDiffHandler
  • KoGraphHandler() : KoGraphHandler
  • KoIgnoreModel() : KoIgnoreModel
  • KoImportHandler() : KoImportHandler
  • kOK : UAuthen_Sspi, UAuthen_Gserver, UAuthen_Kserver, UAuthen_Rhosts, UAuthen_Pserver, UAuthen_SSH, UEditMessage, UPromptMessage
  • KoLockHandler() : KoLockHandler
  • KoLogHandler() : KoLogHandler
  • KoMoveToTrashHandler() : KoMoveToTrashHandler
  • kOption : EntnodeFile
  • kOptionsCheck : UAuthen_SSH
  • kOptionsEdit : UAuthen_SSH
  • kOptionsText : UAuthen_SSH
  • KoQueryUpdateHandler() : KoQueryUpdateHandler
  • KoRecursionModel() : KoRecursionModel
  • KoReleaseHandler() : KoReleaseHandler
  • KoReservedEditHandler() : KoReservedEditHandler
  • KoRtagBranchHandler() : KoRtagBranchHandler
  • KoRtagCreateHandler() : KoRtagCreateHandler
  • KoRtagDeleteHandler() : KoRtagDeleteHandler
  • KoStatusHandler() : KoStatusHandler
  • KoTraversalContext() : KoTraversalContext
  • KoUneditHandler() : KoUneditHandler
  • KoUnlockHandler() : KoUnlockHandler
  • KoUpdateHandler() : KoUpdateHandler
  • KoUpdateMoveToTrashHandler() : KoUpdateMoveToTrashHandler
  • KoWatcher() : KoWatcher
  • KoWatchersHandler() : KoWatchersHandler
  • KoWatchOffHandler() : KoWatchOffHandler
  • KoWatchOnHandler() : KoWatchOnHandler
  • 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, UCvsFiles
  • 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 : CProgressDlg, CProgress
  • m_addbtn : CCustomizeMenus
  • m_addDefault : CCmdLine_MAIN
  • m_addSelection : CCmdLine_MAIN
  • m_addSelectionCheck : CCmdLine_MAIN
  • m_all : PyRegistry
  • m_allfiles : CTmpFiles
  • m_allowExtDiff : CDiff_MAIN
  • m_allRevs : TGraphDelCmd
  • m_AllSubMenus : CCJMenu
  • m_altCvs : CGetPrefs_CVS
  • m_altCvsEdit : CGetPrefs_CVS
  • 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_asc : CSelectionDetailsDlg::CompareInfo, CItemListDlg::CompareInfo, CDiff_Options::CompareInfo
  • m_ascendant : CBrowseFileView, UCvsFiles
  • m_Attach : UPseudoFakePane
  • m_authen : CGetPrefs_CVSROOT
  • m_authenCombo : CGetPrefs_CVSROOT
  • m_authenDescEdit : CGetPrefs_CVSROOT
  • m_autoDelete : KiSelectionHandler
  • m_autoRefreshCombo : CItemListDlg
  • 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_bRestoreFocus : CMainFrame
  • m_browseHist : CMainFrame
  • m_browser : CBrowserBar
  • m_browseReadFromButton : CItemListDlg
  • m_browseTag1Button : CDiff_MAIN
  • m_browseTag2Button : CDiff_MAIN
  • m_browseTagButton : CLogFilters, CItemListDlg, CCheckout_OPTIONS
  • 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_buffer : CPathBuffer
  • m_bufferSize : CPathBuffer
  • m_bUnderline : CCJHyperLink
  • m_bUnique : CCJControlBar
  • m_bUpdate : CCJHexEdit
  • m_bUseMask : CCJMaskEdit
  • m_bVisited : CCJHyperLink
  • m_c : PyRegistry
  • m_CacheWidgets : LPseudoWinAttachment
  • m_cancelButton : CProgressDlg, CItemListDlg
  • m_Caption : CCJExplorerBar, CCJCaptionPopupWnd
  • m_CaptionButton : CCJExplorerBar, CCJCaptionPopupWnd, CCJCaption
  • m_cbBufferMax : CvsString
  • m_checkChanges : CBrowseFileView
  • m_checkoutDir : CCheckout_MAIN
  • m_checkoutDirEdit : CCheckout_MAIN
  • m_checkoutro : CGetPrefs_GLOBALS
  • m_checkPath : CCmdLine_MAIN
  • m_checkPathCheck : CCmdLine_MAIN
  • m_checkUnmod : CTag_MAIN
  • m_checkUnmodCheck : CTag_MAIN
  • m_checkValidEdits : CCommit_OPTIONS
  • 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 : CSelectionDetailsDlg::CompareInfo, CItemListDlg::CompareInfo, CDiff_Options::CompareInfo, CSortParam
  • m_columnAlt : CSortParam
  • m_comboFilterMask : CMainFrame
  • m_compareType : CDiff_MAIN
  • m_compareTypeCombo : CDiff_MAIN
  • m_console : PyColorConsole
  • m_consolebar : CMainFrame
  • m_context : TViewFill, CSortParam
  • m_continue : UCmdUI
  • m_copyFromPath : USaveSettings
  • m_count : KoWatcher
  • m_countSel : TGraphDelCmd
  • 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_currentOptions : CDiff_Options
  • m_currentPage : UWidget
  • m_curSize : CBuffer
  • m_curVSplitBar : CCJSizeDockBar
  • m_CustomTextRect : CCJColorPopup
  • m_cvsconsole : CGetPrefs_CVSROOT
  • m_cvsErr : CItemListConsole
  • m_CvsGuiSfUrl : CAboutDlg
  • m_cvsOut : CItemListConsole
  • m_CvsProcess : CWincvsApp
  • m_cvsroot : CGetPrefs_CVSROOT
  • m_cvsrootCombo : CGetPrefs_CVSROOT
  • m_CvsRunning : CWincvsApp
  • m_cvsStopped : CItemListDlg
  • m_CvsStopping : CWincvsApp
  • 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, CItemListDlg, CCheckout_OPTIONS
  • m_date1 : CUpdateMerge
  • m_date1Combo : CUpdateMerge
  • m_date2 : CUpdateMerge
  • m_date2Combo : CUpdateMerge
  • m_dateCombo : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CItemListDlg, CCheckout_OPTIONS
  • m_deadNodeColor : CGraphOptDlg
  • m_DefaultTextRect : CCJColorPopup
  • m_defBranch : CLogMain
  • m_defhit : CCVSAlert
  • m_delAllCheck : CRelease_MAIN
  • m_delCvsInfoCheck : CRelease_MAIN
  • m_delDirCheck : CRelease_MAIN
  • m_delsticky : CUpdateMain
  • m_desc : CImportEntry, CImportWarning
  • m_description : ItemDisplayInfo, ItemRowInfo
  • m_descriptionEx : ItemDisplayInfo, ItemRowInfo
  • m_destroylock : CDummyInit
  • m_didInteract : CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_CVS, CGetPrefs_WINCVS, CGetPrefs_GLOBALS, CGetPrefs_CVSROOT
  • m_didSetIt : CTempToggleBool, CTurnOffDispatching
  • m_didSetSemaphore : USemaphore
  • m_diffOptions : CDiff_Options, CDiff_MAIN
  • m_diffOptionsCombo : CDiff_MAIN
  • m_diffProg : CGetPrefs_WINCVS
  • m_diffProgEdit : CGetPrefs_WINCVS
  • m_diffType : CDiff_MAIN
  • m_dir : UCvsGraph, CRelease_MAIN
  • m_dirname : TBrowserFillDummy
  • m_dirty : CGetPrefs_GLOBALS
  • m_disableSplashScreen : 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_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_extDiffButton : CDiff_MAIN
  • m_extDiffSelButton : CGetPrefs_WINCVS
  • m_fAccendant : CSortParam
  • m_fData : CGraphDoc
  • m_fDir : CGraphDoc
  • m_feature : USmartCombo
  • m_fGroupSubDir : CSortParam
  • m_File : CCJMemFile
  • m_fileName : SelectionDisplayInfo
  • m_fileNameCheck : CSelectionDetailsDlg
  • m_filesBuffer : CMfFileDialog
  • m_fileToDiffCombo : CCommit_MAIN
  • m_filter : CMainFrame, KoTraversalContext, UCvsFrame, KoTraversalContext
  • m_firstTimeCmdline : CCmdLine_MAIN
  • m_flag : CGetPrefs_CVSROOT, CPseudoToggle
  • m_fName : CGraphDoc
  • m_fNode : CGraphDoc
  • m_folderBuffer : CMfFileDialog
  • m_folderLoc : CCmdLine_MAIN
  • m_folderLocCombo : 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_forceCvsroot : CItemListDlg
  • m_forceCvsrootCheck : CItemListDlg
  • m_forceRecurse : CCommit_OPTIONS
  • m_forceRevision : CCommit_OPTIONS
  • m_forceRoot : CLogin_MAIN, CCmdLine_MAIN, CCheckout_OPTIONS
  • m_forceroot : CInit_MAIN
  • m_foundIt : CFindSettings
  • m_fOut : CRevisionConsole, CStreamConsole
  • m_frameHook : CCJMenuBar
  • m_fRtfFormat : CWincvsView
  • m_fSel1 : TGraphCmdStatus
  • m_fSel2 : TGraphCmdStatus
  • 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, CLogFilters, CItemListDlg, CCheckout_OPTIONS
  • m_hasdate : CUpdateSticky
  • m_hasDate1 : CUpdateMerge
  • m_hasDate2 : CUpdateMerge
  • m_hasDateCheck : CLogFilters, CItemListDlg, CCheckout_OPTIONS
  • m_hasrev : CUpdateSticky
  • m_hasRev : CRtag_OPTIONS, CLogFilters, CItemListDlg, CCheckout_OPTIONS, CAnnotate_MAIN
  • m_hasRevCheck : CLogFilters, CItemListDlg, CCheckout_OPTIONS
  • m_hasSelection : CCmdLine_MAIN
  • m_hasState : CLogFilters
  • m_hasStateCheck : CLogFilters
  • m_hasUser : CLogFilters
  • m_hasUserCheck : CLogFilters
  • m_hAuxIcon : CCJControlBar
  • m_hbmImageWell : CCJToolBar
  • m_hCursor : CCJFlatButton
  • m_hDesc : CKeywordComboBox
  • m_headerColor : CGraphOptDlg
  • m_headerCtrl : CSelectionDetailsDlg, CItemListDlg, CDiff_Options
  • m_headerDesc : CLogMain
  • m_headerDescCheck : CLogMain
  • m_headerOnly : CLogMain
  • m_headerOnlyCheck : CLogMain
  • m_height : CColorMenu
  • m_heightOfLines : CBrowseFileView
  • m_helpinit : CInit_MAIN
  • m_helpLogin : CLogin_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_hideStatus : 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_CVS
  • m_homeEdit : CGetPrefs_CVS
  • m_host : CGetPrefs_CVSROOT
  • m_hostEdit : 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_hWndParent : CProgressDlg
  • m_iActualSize : CCJSizeDockBar
  • m_iClientHeight : CCJFlatTabCtrl
  • m_iClientWidth : CCJFlatTabCtrl
  • m_iconX : CCJMenu
  • m_iconY : CCJMenu
  • m_iCurSel : CCJFlatTabCtrl
  • m_idletime : CWincvsApp
  • m_ignlist : TBrowserFill, TViewFill, TBrowserFill, TViewFill, CFillTclEntries, CFillPyEntries, ImportReport
  • m_ignore : CMainFrame, UCvsFrame
  • m_ignoreCase : CDiff_MAIN
  • m_ignoreCaseCheck : CDiff_MAIN
  • m_iLastError : CvsProject
  • m_imageList : CWinCvsBrowser, CGraphView, CImportFilterDlg
  • m_ImageList : CHistComboBoxEx, CCJControlBar
  • m_index : MultiFilesEntryIndex
  • m_indic : CCvsStatusBar
  • m_iNewPopup : CCJMenuBar
  • m_info : CDynToolBar
  • m_initialized : CCvsThreadLock
  • m_instances : AuthenModel
  • m_interruptable : CProgressDlg
  • 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_isDate1Check : CDiff_MAIN
  • m_isDate2 : CDiff_MAIN
  • m_isDate2Check : CDiff_MAIN
  • m_isFiles : KoUpdateMoveToTrashHandler
  • m_isFilesChange : CBrowseFileView
  • m_isFolders : KoUpdateMoveToTrashHandler
  • m_isHideUnknown : KoFilterModel
  • m_isIgnore : KoIgnoreModel
  • m_isMissing : KoFilterModel
  • m_isRecursive : KoWatcher, CBrowseFileView, UCvsFiles, KoTraversalContext, KoRecursionModel
  • m_isRemoved : KoFilterModel
  • m_isResetViewLocked : CBrowseFileView
  • m_isResetViewPending : CBrowseFileView
  • m_isShowIgnored : TBrowserFill, TViewFill, KoTraversalContext
  • m_isUnknown : KoFilterModel
  • m_item : TBrowserFill, TBrowserFillDummy, TBrowserFill, TBrowserFillDummy, CItemListDlg, ItemDisplayInfo
  • m_itemEdit : CItemListDlg
  • m_itemLabelStatic : CItemListDlg
  • m_itemList : CItemListDlg, CItemListConsole
  • m_itemListCtrl : CItemListDlg
  • m_itemsImageList : CItemListDlg
  • m_iTotalTabWidth : CCJFlatTabCtrl
  • m_iTrackingState : CCJMenuBar
  • m_iXOffset : CCJFlatTabCtrl
  • m_keyForce : CGetPrefs_CVSCMD_DIALOGS
  • m_keyword : CUpdateSticky, CDiff_MAIN, CCheckout_OPTIONS
  • m_keywordCombo : CUpdateSticky, CDiff_MAIN, CCheckout_OPTIONS
  • m_keywordDescStatic : CUpdateSticky, CDiff_MAIN, CCheckout_OPTIONS
  • m_lap : UTimer
  • m_LastCvsResult : CWincvsApp
  • m_lastlap : UTimer
  • m_lastRect : LPseudoWinAttachment
  • m_launchRes : CItemListConsole
  • m_length : CCJHexEdit
  • m_lineHeight : CCJHexEdit
  • m_list : CFindSettings, USaveSettings, CImportFilterDlg
  • m_listeners : UWidget
  • m_listPath : CItemListDlg
  • m_lock : CCvsThreadLock
  • m_login : CGetPrefs_CVSROOT
  • m_loginEdit : CGetPrefs_CVSROOT
  • m_logmsg : CImport_MAIN
  • m_logMsg : CCommit_MAIN
  • m_logMsgCtrl : CCommit_MAIN
  • m_logMsgCtrlWrap : CCommit_MAIN
  • m_logout : CGetPrefs_GLOBALS
  • m_logoutCheck : CGetPrefs_GLOBALS
  • m_logoutEdit : CGetPrefs_GLOBALS
  • m_logoutSpinButton : CGetPrefs_GLOBALS
  • m_logoutTime : CGetPrefs_GLOBALS
  • m_lookAttic : CRtag_MAIN
  • m_lpp : CCJHexEdit
  • m_lpszClassName : URuntimeClass
  • m_mainFrame : CWincvsApp, UCvsApp
  • 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_mf : CMfFileDialog, CUpdateSticky, CUpdateMerge, CTag_MAIN, CSelectionDetailsDlg, CRtag_OPTIONS, CRtag_MAIN, CLogFilters, CCmdLine_MAIN, CItemListDlg, CImport_MAIN, CDiff_MAIN, CCommit_OPTIONS, CCommit_MAIN, CCheckout_OPTIONS, CCheckout_MAIN, CAnnotate_MAIN
  • m_mfi : MultiFilesEntryIndex
  • m_modalRes : UWidget
  • m_modelColumns : CBrowseFileView, UCvsFiles
  • m_moduleCombo : CRtag_MAIN, CImport_MAIN, CCheckout_MAIN
  • m_moduleDescStatic : CRtag_MAIN
  • m_moduleName : CRtag_MAIN, CImport_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_needSelection : KiSelectionHandler
  • m_needViewReset : KiSelectionHandler
  • 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, CStatus_MAIN, CRtag_MAIN, CLogMain, CDiff_MAIN
  • m_norecurs : CUpdateMain
  • m_noRecursCheck : CDiff_MAIN
  • m_noRecurse : CCommit_OPTIONS, CCheckout_MAIN, CAnnotate_MAIN
  • m_noTags : CLogMain
  • m_notify : CSelectionChangeNotifier
  • m_noWhiteSpace : CDiff_MAIN
  • m_noWhiteSpaceCheck : 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_okButton : CItemListDlg
  • m_oldname : USaveSettings
  • m_onlyRCS : CLogMain
  • m_onlyRev : TGraphDelCmd
  • m_option : CItemListDlg::CompareInfo, CItemListDlg
  • m_optionCheck : COptionalPropertySheet, CItemListDlg
  • m_optionDescription : CAdminOptionDlg
  • m_options : UAuthen_SSH
  • m_optionsListCtrl : CDiff_Options
  • m_optionsMenuButton : CDiff_MAIN
  • 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_outputType : CStatus_MAIN
  • m_overide : UWidget
  • m_overrideCoDir : CCheckout_MAIN
  • m_overrideCoDirCheck : 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, SelectionDisplayInfo, USaveSettings, CImport_OPTIONS, CGetPrefs_CVSROOT, CCheckout_MAIN, KoColumnContext
  • m_pathCheck : CSelectionDetailsDlg
  • m_pathEdit : CImport_OPTIONS, CGetPrefs_CVSROOT, CCheckout_MAIN
  • 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_pmf : KiSelectionHandler
  • 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 : CCJColorPopup, CProgressDlg
  • 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 : ImportReport
  • m_progressCtrl : CProgressDlg
  • m_progressTextStatic : CProgressDlg
  • m_progressType : CProgressDlg
  • 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_readFrom : CItemListDlg
  • m_readFromCombo : CItemListDlg
  • m_rect : TGraphRectSelect
  • m_recursion : CMainFrame, UCvsFrame
  • m_refreshButton : CItemListDlg
  • m_registry : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • m_remind : CNoPython
  • m_removebtn : CCustomizeMenus
  • m_removeDirectoryOption : CRelease_MAIN
  • m_resetViewPending : CWinCvsBrowser
  • m_rev : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CItemListDlg, 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, CItemListDlg, CCommit_OPTIONS, CCheckout_OPTIONS, CAnnotate_MAIN
  • m_revision : SelectionDisplayInfo
  • m_revisionCheck : CSelectionDetailsDlg
  • m_revisionSpinCtrl : CSelectionDetailsDlg
  • 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_rowInfo : ItemDisplayInfo
  • m_rsaidentity : UAuthen_SSH
  • m_rsaidentityfile : UAuthen_SSH
  • m_rshname : UAuthen_Rhosts
  • m_rtag : CImport_MAIN
  • m_rtagCombo : CImport_MAIN
  • m_sbuf : CWincvsView
  • m_sBuffer : CvsString, CvsFilenames
  • m_section : KoWatcher
  • m_selAltCvsButton : CGetPrefs_CVS
  • m_selColor : CGraphOptDlg
  • m_selCount : TGraphCmdStatus
  • m_selDetType : CSelectionDetailsDlg
  • m_selectcheck : CCJMenu
  • m_selection : CSelectionDetailsDlg
  • m_selectionButton : CItemListDlg
  • m_selectionChanged : CWinCvsBrowser
  • m_selectionEdit : CSelectionDetailsDlg
  • m_selectionListCtrl : CSelectionDetailsDlg
  • m_selectionNotificationLocked : CWinCvsBrowser
  • m_selEnd : CCJHexEdit
  • m_selFolderButton : CCmdLine_MAIN
  • m_selStart : CCJHexEdit
  • m_selType : KiSelectionHandler
  • m_semaphore : CRecursionLock, USemaphore
  • m_server : CWincvsApp
  • m_servername : UAuthen_Rhosts
  • m_settimer : CCvsStatusBar
  • m_settingName : USaveSettings
  • m_settingsButton : CGetPrefs_CVSROOT
  • m_settingsFile : CFindSettings
  • m_settingsFolder : CGetPrefs_WINCVS
  • m_settingsFolderButton : CGetPrefs_WINCVS
  • m_settingsFolderEdit : CGetPrefs_WINCVS
  • m_shadowColor : CGraphOptDlg
  • m_shiftOn : TGraphRectSelect
  • 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
  • m_smallImageList : CBrowseFileView
  • m_snumbuf : CWincvsView
  • m_sort : CBrowseFileView, UCvsFiles
  • m_sortAsc : CSelectionDetailsDlg, CItemListDlg, CDiff_Options
  • m_sortColumn : CSelectionDetailsDlg, CItemListDlg, CDiff_Options
  • m_sOuter : CvsTrace
  • 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_strCaption : CCJExplorerBar
  • m_strCommand : KiSelectionHandler
  • m_strCustomText : CCJColorPopup, CCJColorPicker
  • m_strDefault : CCJListView, CCJListCtrl
  • m_strDefaultText : CCJColorPopup, CCJColorPicker
  • m_strDefExt : CCJBrowseButton
  • 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_supress : CLogMain
  • 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_tcpipCheck : CGetPrefs_GLOBALS
  • m_tempFile : CEditorMonDlg
  • m_term : CLogoutThread
  • m_text : CToolbarCombo
  • m_texts : CPseudoItem
  • m_timer : CEditorMonDlg
  • m_timers : UWidget
  • m_title : CProgressDlg, 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, CItemListDlg::CompareInfo, CItemListDlg, CAdminOptionDlg
  • m_uiFilechangeTimer : CBrowseFileView
  • m_uiOpenFlags : CCJMemFile
  • m_unifiedDiff : CDiff_MAIN
  • m_unifiedDiffCheck : CDiff_MAIN
  • m_unixlf : CGetPrefs_GLOBALS
  • m_unselectcheck : CCJMenu
  • m_upBorder : CGfxSplitterWnd
  • m_upbtn : CCustomizeMenus
  • m_url : CNoPython
  • m_useAltCvs : CGetPrefs_CVS
  • m_useAltCvsCheck : CGetPrefs_CVS
  • m_useDefIgnore : CImport_OPTIONS
  • m_useExtDiff : CGetPrefs_WINCVS
  • m_useExtDiffCheck : CGetPrefs_WINCVS
  • m_useFilesTime : CImport_OPTIONS
  • m_useMostRecent : CRtag_OPTIONS
  • m_user : CLogFilters
  • m_userCombo : CLogFilters
  • m_userStateNodeColor : CGraphOptDlg
  • m_useSettingsFolder : CGetPrefs_WINCVS
  • m_useSettingsFolderCheck : CGetPrefs_WINCVS
  • m_useViewerAlways : CGetPrefs_WINCVS
  • m_v : PyRegistry
  • m_value : CTempToggleBool, GetValue
  • m_vers : CAboutDlg
  • m_versCombo : CGetPrefs_CVSROOT
  • m_view : CSelectionChangeNotifier, CGraphRectTracker, TGraphSelNonSig, CGraphConsole, TGraphRectSelect, CBarConsole, KoTraversalContext
  • m_viewer : CGetPrefs_WINCVS
  • m_viewerEdit : CGetPrefs_WINCVS
  • m_viewList : CCJTabCtrlBar
  • m_viewPath : CWincvsDoc
  • m_views : CCJTabView
  • m_vtag : CImport_MAIN
  • m_vtagCombo : CImport_MAIN
  • m_warnings : CImportFilterDlg
  • m_wasLocked : 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_WinCvsUrl : CAboutDlg
  • 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_zlevelEdit : CGetPrefs_GLOBALS
  • m_zspinSpinButton : 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
  • match_dir() : match_dir
  • 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_Sspi, 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
  • mode : keywordMode
  • ModifyCaptionStyle() : CCJCaption
  • ModifyFlag() : CGfxOutBarCtrl
  • ModifyODMenuA() : CCJMenu
  • ModifyODMenuW() : CCJMenu
  • ModifyTabStyle() : CCJTabView, CCJTabCtrlBar
  • Move() : CCJHexEdit
  • MoveBand() : CCJReBarCtrl
  • MoveButton() : CCJToolBarCtrl
  • MoveDockBar() : CCJDockContext
  • MoveRow() : CCJListView, CCJListCtrl
  • MoveTo() : UDC
  • msgSend : CGfxGroupEdit
  • MulDiv() : URect
  • MultiFiles : MultiFiles, MultiFilesEntry, FileEntry
  • MultiFilesEntry : MultiFilesEntry, FileEntry
  • MultiFilesEntryIndex() : MultiFilesEntryIndex
  • my_read : _CvsProcess
  • my_write : _CvsProcess

- n -

  • name : CMacroEntry, option
  • Navigate() : CCJHtmlView
  • Navigate2() : CCJHtmlView
  • NavigateComplete2() : CCJHtmlView
  • NeedSave() : CPersistent
  • NeedsNormalize() : KoAddUnicodeHandler, KoAddBinaryHandler, KoAddHandler, KoGraphHandler, KiSelectionHandler
  • New() : PyPersistent, PyCmdUI, PyMenuMgr, PyColorConsole, PyCvsEntry
  • newdir() : MultiFiles
  • newfile() : MultiFiles
  • NewMenu() : CCJMDIFrameWnd, CCJFrameWnd
  • NewODMenu() : CCJMenu
  • NewRoot() : CHistComboBoxEx
  • next : 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, MultiFiles
  • NormalizeRect() : URect
  • NormalizeSel() : CCJHexEdit
  • NotificationManager() : NotificationManager
  • NotifyAll() : NotificationManager
  • NotifySelectionChange() : CWinCvsBrowser
  • nSig : UMSGMAP_ENTRY
  • nul_void_ignore : CTCP2Parse::RGBColor
  • numbuf : CStaticAllocT< T >
  • NumDirs() : MultiFiles
  • numentries : DYN_LIST
  • NumFiles() : MultiFilesEntry
  • numMaps : MACBINMAPENTRIES
  • NumNodes() : CGraphDoc
  • NumOfElements() : CSortList< T >
  • numToKind() : Authen

- o -

  • observer : NotificationManager::Node
  • Offset() : CWinLogData, UPoint
  • OffsetRect() : URect
  • oldFormat : CColorConsole
  • oldHome : AuthenModel
  • oldPserverPort : AuthenPserver
  • oldRhostPort : AuthenRhosts
  • oldRsa : AuthenRhosts
  • oldRsaIdentity : AuthenSSH
  • oldRsaOptions : AuthenSSH
  • oldRsh : AuthenSSH
  • oldServerName : AuthenRhosts
  • OnAbout() : UCvsFrame
  • OnActivate() : CMainFrame
  • OnActivateApp() : CCJColorPopup
  • OnAdd() : CCustomizeMenus
  • OnAddSelection() : CCmdLine_MAIN
  • OnAlias() : TViewFill, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • OnAltcvschk() : CGetPrefs_CVS
  • OnAltcvssel() : CGetPrefs_CVS
  • OnAltsettingschk() : CGetPrefs_WINCVS
  • OnAnnotate() : CBrowseFileView
  • OnAnyDevice() : LSReport, TraversalReport
  • OnAppAbout() : CWincvsApp
  • OnAppCmdline() : CWincvsDoc, CWinCvsBrowser, CBrowseFileView
  • OnAppCopyrights() : CWincvsApp
  • OnAppCredits() : CWincvsApp
  • OnAppLogin() : CWincvsDoc
  • OnAppLogout() : CWincvsDoc
  • OnApply() : CGraphOptDlg
  • OnAppPreferences() : CWincvsDoc
  • OnAppRtagBranch() : CWincvsDoc
  • OnAppRtagbranch() : CWinCvsBrowser, CBrowseFileView
  • OnAppRtagcreate() : CWinCvsBrowser, CBrowseFileView
  • OnAppRtagDelete() : CWincvsDoc
  • OnAppRtagdelete() : CWinCvsBrowser, CBrowseFileView
  • OnAppRtagNew() : CWincvsDoc
  • OnBarStyleChange() : CCJToolBar, CCJMenuBar
  • OnBeforeNavigate2() : CCJHtmlView
  • OnBegindrag() : CBrowseFileView
  • OnBegindragMenulist() : CCustomizeMenus
  • OnBeginPrinting() : CWincvsView, CGraphView, CBrowseFileView
  • OnBeginrdrag() : CBrowseFileView
  • OnBlockHandler() : UWidget
  • OnBranch() : CGraphOptDlg
  • OnBroadcastCmdMsg() : CMainFrame
  • OnBrowseModules() : CRtag_MAIN, CImport_MAIN, CCheckout_MAIN
  • OnBrowseReadfrom() : CItemListDlg
  • OnBrowserOpen() : CWincvsDoc
  • OnBrowserPopup() : UCvsFrame
  • OnBrowseTag() : CUpdateSticky, CTag_MAIN, CRtag_OPTIONS, CRtag_MAIN, CLogFilters, CItemListDlg, CCommit_OPTIONS, CCheckout_OPTIONS, CAnnotate_MAIN
  • OnBrowseTag1() : CUpdateMerge, CImport_MAIN, CDiff_MAIN
  • OnBrowseTag2() : CUpdateMerge, CImport_MAIN, CDiff_MAIN
  • OnBtnClick() : UCvsGraph
  • OnBtnhome() : CGetPrefs_CVS
  • OnBtnName() : UAuthen_SSH
  • OnBtnpath() : CImport_OPTIONS
  • OnBtnPath() : CCheckout_MAIN
  • OnBtnRSA() : UAuthen_SSH
  • OnBtnsettings() : CGetPrefs_WINCVS
  • OnBtnviewer() : CGetPrefs_WINCVS
  • OnButtonClose() : CCJExplorerBar, CCJControlBar
  • OnButtonMinimize() : CCJControlBar
  • OnCancel() : CItemListDlg, 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
  • OnCheckdate() : CItemListDlg
  • 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
  • OnCheckrev() : CItemListDlg
  • 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
  • OnCmdUIFilterMask() : UCvsFrame
  • OnCmdUIGraph() : UCvsFiles
  • OnCmdUIHideUnknown() : UCvsFrame
  • 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
  • OnCmdUIViewAdded() : UCvsFrame
  • OnCmdUIViewChanged() : UCvsFrame
  • OnCmdUIViewConflict() : UCvsFrame
  • OnCmdUIViewIgnored() : UCvsFrame
  • OnCmdUIViewMissing() : UCvsFrame
  • OnCmdUIViewModified() : UCvsFrame
  • OnCmdUIViewRecursive() : UCvsFrame, UCvsFolders, UCvsFiles
  • OnCmdUIViewRemoved() : UCvsFrame
  • OnCmdUIViewUnknown() : UCvsFrame
  • OnCmdUnedit() : UCvsFolders, UCvsFiles
  • OnCmdUnlock() : UCvsFolders, UCvsFiles
  • OnCmdUpdate() : UCvsFolders, UCvsFiles
  • OnCmdUpone() : UCvsFiles
  • OnCmdWatchers() : UCvsFolders, UCvsFiles
  • OnCmdWatchOff() : UCvsFolders, UCvsFiles
  • OnCmdWatchOn() : UCvsFolders, UCvsFiles
  • OnColumnclick() : CBrowseFileView
  • OnColumnclickItemlist() : CItemListDlg
  • OnColumnclickOptionslist() : CDiff_Options
  • OnColumnclickSelectionlist() : CSelectionDetailsDlg
  • 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() : CWincvsView, CWinCvsBrowser, CGraphView, CCJHexEdit, CBrowseFileView
  • 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
  • OnDblclkItemlist() : CItemListDlg
  • OnDblclkListentries() : CImportFilterDlg
  • OnDblclkMenulist() : CCustomizeMenus
  • OnDblclkSelectionlist() : CSelectionDetailsDlg
  • OnDead() : CGraphOptDlg
  • OnDelall() : CRelease_MAIN
  • OnDelcvsinfo() : CRelease_MAIN
  • OnDeldir() : CRelease_MAIN
  • OnDeleteitem() : CMyShellTree, CBrowseFileView
  • OnDeltaposRevisionSpin() : CSelectionDetailsDlg
  • OnDestroy() : CWincvsView, CWinCvsBrowser, CCJToolBar, CCJListView, CCJListCtrl, CCJHtmlView, CCJFontCombo, CCJCaptionPopupWnd, CBrowserBar, CBrowseFileView, UCvsToolbar, UCvsMenubar, UCvsGraph, UCvsFrame, UCvsFolders, UCvsFiles, UCvsConsole, CSelectionDetailsDlg, CItemListDlg, CEditorMonDlg, CCommit_MAIN, UToolbar, CDynToolBar
  • OnDiff() : CCommit_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
  • OnFilename() : CSelectionDetailsDlg
  • OnFileNameChange() : CMfFileDialog
  • OnFileNew() : CWincvsApp
  • OnFilePrint() : CCJHtmlView
  • OnFiles() : KoRtagBranchHandler, KoRtagDeleteHandler, KoRtagCreateHandler, KoCheckoutHandler, KoImportHandler, KoCommandLineHandler, KoCancelChangesHandler, KoAnnotateHandler, KoQueryUpdateHandler, KoUpdateHandler, KoCommitHandler, KoAddUnicodeHandler, KoAddBinaryHandler, KoAddHandler, KoUnlockHandler, KoLockHandler, KoFileRemoveHandler, KoStatusHandler, KoGraphHandler, KoLogHandler, KoGraphDiffHandler, KoDiffHandler, KoWatchOffHandler, KoWatchOnHandler, KoEditorsHandler, KoWatchersHandler, KoReleaseHandler, KoUneditHandler, KoForceEditHandler, KoReservedEditHandler, KoEditHandler, KoBranchTagHandler, KoDeleteTagHandler, KoCreateTagHandler, KoUpdateMoveToTrashHandler, KoMoveToTrashHandler, KiSelectionHandler
  • OnFilteringChanged() : CBrowseFileView, UCvsFiles
  • OnFilterMaskEntered() : CMainFrame, UCvsFrame
  • OnFolder() : KoRtagBranchHandler, KoRtagDeleteHandler, KoRtagCreateHandler, KoCheckoutHandler, KoImportHandler, KoCommandLineHandler, KoCancelChangesHandler, KoAnnotateHandler, KoQueryUpdateHandler, KoUpdateHandler, KoCommitHandler, KoAddUnicodeHandler, KoAddBinaryHandler, KoAddHandler, KoUnlockHandler, KoLockHandler, KoFileRemoveHandler, KoStatusHandler, KoGraphHandler, KoLogHandler, KoGraphDiffHandler, KoDiffHandler, KoWatchOffHandler, KoWatchOnHandler, KoEditorsHandler, KoWatchersHandler, KoReleaseHandler, KoUneditHandler, KoForceEditHandler, KoReservedEditHandler, KoEditHandler, KoBranchTagHandler, KoDeleteTagHandler, KoCreateTagHandler, KoUpdateMoveToTrashHandler, KoMoveToTrashHandler, KiSelectionHandler
  • OnForcerevision() : CCommit_OPTIONS
  • OnForceroot() : CItemListDlg
  • OnFullScreen() : CCJHtmlView
  • OnGetDlgCode() : CWincvsView, CCJHexEdit
  • OnGetEnv() : AuthenModel, AuthenServer, AuthenSspi, 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
  • OnHeaders() : CLogMain
  • OnHeadersdesc() : CLogMain
  • OnHeightChange() : CCJReBar
  • OnHelpCvs() : CWincvsApp
  • OnHelpCvsclient() : CWincvsApp
  • OnHideUnknown() : UCvsFrame
  • OnHistorySelect() : CMainFrame
  • OnHomeArrow() : CCJFlatTabCtrl
  • OnHScroll() : CCJHexEdit
  • OnIdle() : TBrowserFill, TBrowserFillDummy, TViewFill, TBrowserFill, TBrowserFillDummy, TViewFill, LSReport, CFillTclEntries, CFillPyEntries, ImportReport, TraversalReport
  • OnIgnoreChanged() : CWinCvsBrowser
  • OnInitDialog() : CAboutDlg, CTipDlg, CNoPython, CCustomizeMenus, CUpdateSticky, CTag_MAIN, CSelectionDetailsDlg, CRtag_OPTIONS, CRtag_MAIN, CProgressDlg, COptionalPropertySheet, CCmdLine_MAIN, CItemListDlg, CImportFilterDlg, CGetPrefs_GLOBALS, GetPassword, CEditorMonDlg, CDiff_Options, CDiff_MAIN, CCommit_MAIN, CCheckout_OPTIONS, 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
  • OnItemchangedItemlist() : CItemListDlg
  • OnItemchangedMenulist() : CCustomizeMenus
  • OnItemchangedOptionslist() : CDiff_Options
  • OnItemchangedSelectionlist() : CSelectionDetailsDlg
  • 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
  • OnLButtonUp() : CCJSizeDockBar, CCJOutlookBar, CCJHexEdit, CCJFlatComboBox, CCJFlatButton, CCJExplorerBar, CCJControlBar, CCJColorPopup, CPseudoToggle
  • OnLeftArrow() : CCJFlatTabCtrl
  • OnListAddColumns() : UWidget
  • OnListAddSel() : UWidget
  • OnListDelRow() : UWidget
  • OnListGetInfo() : UWidget
  • OnListGetNext() : UWidget
  • OnListGetNextSel() : UWidget
  • OnListHideColumns() : UWidget
  • OnListInsert() : UWidget
  • OnListNewRow() : UWidget
  • OnListPopup() : UWidget
  • OnListResetAll() : UWidget
  • OnListResort() : UWidget
  • OnListRowGetData() : UWidget
  • OnListRowSetData() : UWidget
  • OnListSetColTitle() : UWidget
  • OnListSetColWidth() : UWidget
  • OnListSetFeedback() : UWidget
  • OnListSetSortDir() : UWidget
  • OnListShowColumns() : 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
  • OnModule() : CCmdLine_MAIN
  • 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, CCustomizeMenus, CProgressDlg, CItemListDlg, CGraphOptDlg, CDiff_Options, UPromptMessage
  • OnOption() : CItemListDlg
  • OnOptionsmenu() : CDiff_MAIN
  • 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
  • OnPath() : CSelectionDetailsDlg
  • OnPopup() : UCvsFiles
  • OnPreparePrinting() : CWincvsView, CGraphView, CBrowseFileView
  • OnPreserveZeroBorderHelper() : CCJToolBar
  • OnPrint() : CGraphView, CBrowseFileView
  • OnProgressChange() : CCJHtmlView
  • OnPropertyChange() : CCJHtmlView
  • OnPushPinButton() : CCJCaption
  • OnPushPinCancel() : CCJCaption
  • OnQueryAnnotate() : CGraphView
  • OnQueryNewPalette() : CCJColorPopup
  • OnQuit() : CCJHtmlView, UCvsFrame
  • OnRButtonDown() : CWincvsView, CWinCvsBrowser, CGfxOutBarCtrl, CCJToolBar, CCJTabCtrl, CCJFlatHeaderCtrl, CCJControlBar
  • OnRclick() : CMyShellTree
  • OnRecalcParent() : CCJReBar
  • OnRedraw() : UWidget
  • OnRefresh() : CItemListDlg
  • OnRemove() : CCustomizeMenus
  • OnReset() : CGraphOptDlg
  • OnResetView() : CWinCvsBrowser, CBrowseFileView
  • OnRestoreEnv() : AuthenModel, AuthenRhosts, AuthenPserver, AuthenSSH
  • OnRev() : CUpdateSticky, CRtag_OPTIONS, CLogFilters, CCheckout_OPTIONS
  • OnRevision() : CSelectionDetailsDlg
  • OnRightArrow() : CCJFlatTabCtrl
  • OnSavesettings() : CWincvsDoc
  • OnSelchange() : CCJTabView, CKeywordComboBox
  • OnSelChange() : CCJColorPicker
  • OnSelchangeAuthen() : CGetPrefs_CVSROOT
  • OnSelchangeAutoRefresh() : CItemListDlg
  • OnSelchangeCombo() : CCommit_MAIN
  • OnSelchangeComboroot() : CGetPrefs_CVSROOT
  • OnSelchangeCompareType() : CDiff_MAIN
  • OnSelchanged() : CWinCvsBrowser, CMyShellTree
  • OnSelchangeFiletodiff() : CCommit_MAIN
  • OnSelchangePrevcmd() : CCmdLine_MAIN
  • OnSelchanging() : CWinCvsBrowser
  • OnSelColumn() : UCvsFiles
  • OnSelection() : CItemListDlg, CGraphOptDlg
  • OnSelendcancel() : CToolbarCombo
  • OnSelEndCancel() : CCJColorPicker
  • 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() : CCmdLine_MAIN, 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
  • OnUnblockHandler() : UWidget
  • OnUp() : CCustomizeMenus
  • OnUpdateAppCmdline() : CWinCvsBrowser
  • OnUpdateButtonClose() : CCJExplorerBar, CCJControlBar
  • OnUpdateButtonMinimize() : CCJControlBar
  • OnUpdateCmd() : CWinCvsBrowser, CExploreBar
  • OnUpdateCmdUI() : CCJToolBar, CCJReBar, CCJControlBar
  • OnUpdateCustomize() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateCvsCmd() : CWincvsDoc, CBrowseFileView
  • 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
  • OnUpdateSavesettings() : CWincvsDoc
  • OnUpdateStopcvs() : CWincvsDoc
  • OnUpdateUI() : UWidget, UToolbar, UMenu, UMacAppMenu
  • OnUpdateUsePyshell() : CWincvsDoc
  • OnUpdateUseTclshell() : CWincvsDoc
  • OnUpdateViewAdd() : CWinCvsBrowser, CBrowseFileView
  • OnUpdateViewAddB() : CBrowseFileView
  • OnUpdateViewAdded() : CMainFrame
  • OnUpdateViewAnnotate() : CBrowseFileView
  • 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, UCvsFrame
  • OnViewAddu() : CBrowseFileView
  • OnViewBrowselocationRemoveunwanted() : CWincvsDoc
  • OnViewChanged() : CMainFrame, UCvsFrame
  • OnViewCheckout() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnViewCommit() : CWinCvsBrowser, CBrowseFileView
  • OnViewConflict() : CMainFrame, UCvsFrame
  • 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
  • OnViewIgnored() : UCvsFrame
  • OnViewImport() : CWinCvsBrowser, CExploreBar, CBrowseFileView
  • OnViewInit() : CWincvsDoc
  • OnViewList() : CBrowseFileView
  • OnViewLog() : CWinCvsBrowser, CBrowseFileView
  • OnViewMissing() : CMainFrame, UCvsFrame
  • OnViewModified() : CMainFrame, UCvsFrame
  • OnViewPathChanged() : CWincvsDoc
  • OnViewQueryUpdate() : CWinCvsBrowser, CBrowseFileView
  • OnViewRecursive() : CMainFrame, UCvsFrame, UCvsFolders, UCvsFiles
  • OnViewRelease() : CWinCvsBrowser, CBrowseFileView
  • OnViewReload() : CWinCvsBrowser, CGraphView, CBrowseFileView
  • OnViewRemoved() : CMainFrame, UCvsFrame
  • 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, UCvsFrame
  • 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 : _CvsProcess
  • Open() : CCJMemFile
  • openProject() : CvsProject
  • OpenProject() : CvsCoworker, ICvsCoworker
  • 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()() : match_dir
  • operator+() : CvsString, URect, UPoint, USize
  • operator+=() : CvsString, CCJMemFile, UStr, URect, UPoint, USize
  • operator-() : URect, UPoint, USize
  • operator-=() : URect, UPoint, USize
  • operator->() : PyAutoObject< 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 : _sDiffOptionsItem, EntnodeFile
  • out : UCvsConsole
  • OutColor() : CWincvsView, UCvsConsole
  • OutConsole() : CWincvsView, UCvsConsole
  • outEnabled : UPseudoCmdStatusWrapper
  • OutLine() : CWincvsView
  • 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() : CListParserConsole, CModuleParserConsole, CTagParserConsole, CItemListConsole
  • parse_cvsroot() : Authen
  • ParseIt() : CTCP2Parse
  • path : CMacroEntry
  • pattern : ReportConflict
  • pBaseMap : UMSGMAP
  • pBlackPen : CGfxOutBarCtrl
  • pChild : CGfxOutBarCtrl::CBarFolder
  • pCmdUI : UCmdUI
  • PCPStr() : PCPStr
  • PCStr() : PCStr
  • PeekPumpAndIdle() : CWincvsApp, UCvsApp
  • 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 : ansiAttrCvt, USLIDER
  • PositionControls() : CCJStatusBar
  • PositionWindow() : CCJHyperLink
  • PostClickRefresh() : CItemListDlg
  • PostNcDestroy() : CSplashWnd, CGfxGroupEdit, CProgressDlg
  • PreCreateWindow() : CWincvsView, CWinCvsBrowser, CMainFrame, CCJTreeCtrl, CCJToolBar, CCJMDIFrameWnd, CCJHexEdit, CCJFrameWnd, CCJFlatTabCtrl, CBrowseFileView
  • PressButton() : CCJToolBar
  • PRESSED : CCJFlatComboBox
  • PreSubclassWindow() : CCJHyperLink, CCJFontCombo, CCJFlatHeaderCtrl, CCJColorPicker, CCJBrowseEdit, CSmartComboBox, CKeywordComboBox
  • PreTranslateAppMessage() : CSplashWnd
  • PreTranslateMessage() : CWincvsApp, CTbEdit, CLogFrame, CHistComboBoxEx, CGfxGroupEdit, CCJTabCtrlBar, CCJHyperLink, CCJFrameWnd, CCJFlatTabCtrl, CCJFlatComboBox, CCJControlBar, CCJColorPopup, CSmartComboBox, CCmdLine_MAIN, CItemListDlg, CCommit_MAIN
  • print() : CvsArgs
  • Print() : PyColorConsole
  • PrintOut() : ReportWarning, ReportConflict
  • ProcessMask() : CCJTimeEdit, CCJDateEdit, CCJMaskEdit
  • ProcessSelectionCommand() : CWinCvsBrowser, CBrowseFileView, UCvsFolders, UCvsFiles
  • 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() : CvsProject
  • RemoveFiles() : CvsCoworker, ICvsCoworker
  • 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() : MultiFiles, CvsArgs
  • Reset() : CSortList< T >, MacBinMaps
  • 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 : UTREE_INSERT
  • Result() : CSortList< T >
  • RetrievePath() : CWinCvsBrowser, UCvsFolders
  • revcmp() : KoRevisionColumn
  • revCnt : CTCP2Parse
  • reverse : ansiAttrCvt
  • revLast : CTCP2Parse
  • rfind() : UStr
  • 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
  • rtUAuthen_Sspi() : UAuthen_Sspi
  • 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, UCvsFiles
  • SaveColumnWidths() : CCJListView, CCJListCtrl
  • SaveDefaults() : MacBinMaps
  • SaveState() : CCJToolBar
  • SaveWindowPos() : CCJWindowPlacement
  • SayWelcome() : UCvsApp
  • sbuffer : EntnodeData
  • ScrollIntoView() : CCJHexEdit
  • Search() : UCvsFiles, WININFO
  • searchAllPath() : CFindSettings
  • searchPath() : CFindSettings
  • SearchWidID() : LPseudoWinAttachment
  • segment : CTCP2Parse
  • sel : CWinLogData
  • SelDelete() : CCJHexEdit
  • Selected() : CWinLogData
  • SelectItem() : CItemListDlg
  • 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
  • SetCvsProcess() : CWincvsApp, UCvsApp
  • SetCvsRunning() : CWincvsApp, UCvsApp, CvsPrefs
  • SetCvsStopping() : CWincvsApp, 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
  • SetDescription() : CKeywordComboBox
  • SetDescriptionWnd() : CKeywordComboBox
  • setdir() : MultiFilesEntry
  • SetDirtySupport() : CvsPrefs
  • SetDisabledImageList() : CCJToolBarCtrl
  • SetDisableOldStyle() : CCJMenu
  • SetDisableSplashScreen() : CvsPrefs
  • 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
  • SetHideCommandDlgStatus() : 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() : CProgressDlg, 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, UCvsFiles
  • 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
  • SetSelectionChanged() : CWinCvsBrowser
  • SetSelectionMode() : CCJColorPicker
  • SetSelectionNotificationLocked() : CWinCvsBrowser
  • SetSelFolder() : CGfxOutBarCtrl
  • SetSelRange() : CCJMonthCalCtrl
  • SetServerName() : CvsPrefs
  • SetSettingsFolder() : CvsPrefs
  • SetSilent() : CCJHtmlView
  • SetSizes() : CCJToolBar
  • SetSmallIconView() : CGfxOutBarCtrl
  • SetSortImage() : CSortHeaderCtrl, CCJFlatHeaderCtrl
  • SetState() : CCJToolBar, CPseudoToggle
  • SetStatusBar() : CCJHtmlView
  • SetStatusOutputType() : CvsPrefs
  • SetStyle() : CCJToolBarCtrl
  • SetTabImageList() : CCJTabView, CCJTabCtrlBar
  • SetTabMenuID() : CCJTabCtrlBar
  • SetTclFileRunning() : CvsPrefs
  • SetText() : CToolbarCombo, CCJToolCmdUI, PyCmdUI, UCmdUI
  • SetTextColor() : CCJReBarCtrl, CCJColorPicker
  • SetTextStyle() : CCJCaption
  • SetTheaterMode() : CCJHtmlView
  • SetTime() : CCJDateTimeCtrl
  • SettingsFolder() : CvsPrefs
  • 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
  • ShowColumns() : UCvsFiles
  • ShowFileHistory() : CvsCoworker, ICvsCoworker
  • showFileHistory() : CvsProject
  • showFileProperties() : CvsProject
  • ShowFileProperties() : CvsCoworker, ICvsCoworker
  • ShowFrameControls() : CCJControlBar
  • ShowRow() : CCJFlatSplitterWnd
  • ShowSplashScreen() : CSplashWnd
  • ShowTipAtStartup() : CWincvsApp
  • ShowTipOfTheDay() : CWincvsApp
  • showUserInterface() : CvsProject
  • ShowUserInterface() : CvsCoworker, ICvsCoworker
  • sig : MACBINMAP
  • SignalStartWatch() : KoWatcher
  • SignalTerminate() : KoWatcher
  • SingleClick() : CPseudoItem
  • Size() : URect
  • size() : CBuffer, CStaticAllocT< T >
  • 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
  • Sort() : CCJSortClass
  • SortItems() : CSelectionDetailsDlg, CItemListDlg, CDiff_Options
  • 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
  • StatusOutputType() : CvsPrefs
  • StepToLocation() : CWinCvsBrowser, UCvsFolders
  • Stop() : CCJHtmlView
  • stopProcessEvent : _CvsProcess
  • StopWatch() : KoWatcher
  • StoreExpanded() : CWinCvsBrowser, UCvsFolders
  • StoreValues() : CGetPrefs_CVSCMD_DIALOGS, CGetPrefs_CVS, 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
  • substr() : UStr
  • 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
  • threadID : _CvsProcess
  • 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
  • tooManyWarnings : ReportWarning
  • top : URECT
  • TopLeft() : URect
  • TotalNumFiles() : MultiFiles
  • 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
  • UAuthen_Sspi() : UAuthen_Sspi
  • 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() : CvsProject
  • UncheckoutFiles() : CvsCoworker, ICvsCoworker
  • 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() : CvsCoworker, ICvsCoworker
  • updateFiles() : CvsProject
  • UpdateFont() : CCJTabCtrl, CCJOutlookBar, CCJMenuBar, CCJMaskEdit, CCJFlatButton, CCJColorPopup, CCJCaption, CCJBrowseButton
  • UpdateInfo() : CCommit_MAIN
  • UpdateMenu() : CCJMenu
  • UpdatePreviewInfo() : CCommit_MAIN
  • UpdateScrollbars() : CCJHexEdit
  • UpdateSelect() : CSelectionDetailsDlg
  • 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 : 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 : WININFO
  • Width() : URect
  • 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
  • ~AuthenServer() : AuthenServer
  • ~AuthenSSH() : AuthenSSH
  • ~AuthenSspi() : AuthenSspi
  • ~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_CVS() : CGetPrefs_CVS
  • ~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
  • ~CItemListConsole() : CItemListConsole
  • ~CKeyString() : CKeyString
  • ~CKeywordComboBox() : CKeywordComboBox
  • ~CListParserConsole() : CListParserConsole
  • ~CLogFilters() : CLogFilters
  • ~CLogFrame() : CLogFrame
  • ~CLogin_MAIN() : CLogin_MAIN
  • ~CLogMain() : CLogMain
  • ~CLogoutThread() : CLogoutThread
  • ~CMacBinItem() : CMacBinItem
  • ~CMacBinTable() : CMacBinTable
  • ~CMainFrame() : CMainFrame
  • ~CMMenuString() : CMMenuString
  • ~CModuleParserConsole() : CModuleParserConsole
  • ~CMPString() : CMPString
  • ~CMString() : CMString
  • ~COptionalPropertySheet() : COptionalPropertySheet
  • ~CPathBuffer() : CPathBuffer
  • ~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
  • ~CRelease_MAIN() : CRelease_MAIN
  • ~CRevisionConsole() : CRevisionConsole
  • ~CRtag_MAIN() : CRtag_MAIN
  • ~CRtag_OPTIONS() : CRtag_OPTIONS
  • ~CSelectionChangeNotifier() : CSelectionChangeNotifier
  • ~CSmartComboBox() : CSmartComboBox
  • ~CSortHeaderCtrl() : CSortHeaderCtrl
  • ~CSortList() : CSortList< T >
  • ~CSplashWnd() : CSplashWnd
  • ~CStackThreadLock() : CStackThreadLock
  • ~CStaticAllocT() : CStaticAllocT< T >
  • ~CStatus_MAIN() : CStatus_MAIN
  • ~CSubclassWnd() : CSubclassWnd
  • ~CSubclassWndMap() : CSubclassWndMap
  • ~CTag_MAIN() : CTag_MAIN
  • ~CTagParserConsole() : CTagParserConsole
  • ~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
  • ~KiSelectionHandler() : KiSelectionHandler
  • ~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
  • ~UAuthen_Sspi() : UAuthen_Sspi
  • ~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 Fri Jan 31 12:13:19 2003 for WinCvs Source by doxygen 1.3-rc2


Namespace Index

WinCvs Source Namespace List

Here is a list of all namespaces with brief descriptions:
CVS_COWORKERLib
std
Wincvs
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


CVS_COWORKERLib Namespace Reference

Compounds

class CvsCoworker

Functions

importlib ("stdole32.tlb")
importlib ("stdole2.tlb")

Function Documentation

importlib ( "stdole2.tlb" )

importlib ( "stdole32.tlb" )

Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


std Namespace Reference

Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


Wincvs Namespace Reference

Compounds

class | Document
interface | IWincvs

Functions

importlib ("stdole32.tlb")

Function Documentation

importlib ( "stdole32.tlb" )

Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


common/AboutDlg.cpp Source File

common/AboutDlg.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 : Karl-Heinz Brünen <gcvs@bruenen-net.de> --- March 2002
00019  */
00020
00021 // AboutDlg.cpp : About Dialog!
00022
00023 #include "stdafx.h"
00024
00025 #if qUnix
00026 #   include "UCvsDialogs.h"
00027 #endif
00028
00029 #include "uwidget.h"
00030 #include "AboutDlg.h"
00031 #include "UCvsApp.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00039 UIMPLEMENT_DYNAMIC(UAboutDlg, UWidget)
00040 UBEGIN_MESSAGE_MAP(UAboutDlg, UWidget)
00041     ON_UCOMMAND(kOK, UAboutDlg::OnOk)
00042 //  ON_UCOMMAND(kAppURL, UAboutDlg::OnURL)
00043 UEND_MESSAGE_MAP()
00044
00045 int UAboutDlg::OnOk(void)
00046 {
00047     EndModal(true);
00048     return 0;
00049 }
00050
00051 int UAboutDlg::OnURL(void)
00052 {
00053     return 0;
00054 }
00055
00056 void UAboutDlg::DoDataExchange(bool fill)
00057 {
00058     UStr  appURL = "http://cvsgui.sourceforge.net";
00059     UStr  appText;
00060
00061     appText  = UCvsApp::gApp->GetAppName();
00062     appText += " ";
00063     appText += UCvsApp::gApp->GetAppVersion();
00064
00065     if(fill)
00066     {
00067         UEventSendMessage(GetWidID(), EV_SETTEXT, kAppName, (void *)(const char *)appText);
00068         UEventSendMessage(GetWidID(), EV_SETTEXT, kAppURL, (void *)(const char *)appURL);
00069     }
00070     else
00071     {
00072     }
00073 }
00074
00075
00076 void AboutDialog(void)
00077 {
00078     void *wid = UCreate_AboutDlg();
00079     UStr  appText = UCvsApp::gApp->GetAppName();
00080
00081     UAboutDlg *dlg = new UAboutDlg ();
00082     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00083     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, appText);
00084
00085     bool res = false;
00086
00087     res = dlg->DoModal();
00088
00089     return;
00090 }
Generated on Fri Jan 31 12:08:31 2003 for WinCvs Source by doxygen 1.3-rc2


common/AboutDlg.h Source File

common/AboutDlg.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 : Karl-Heinz Brünen <k.bruenen@yahoo.com> --- March 2002
00019  */
00020
00021 // AboutDlg.h
00022 #ifndef ABOUT_DLG_H
00023 #define ABOUT_DLG_H
00024
00025 extern void AboutDialog(void);
00026
00027 #ifdef qUnix
00028 class UAboutDlg : public UWidget
00029 {
00030     UDECLARE_DYNAMIC(UAboutDlg)
00031 public:
00032     UAboutDlg() : UWidget(::UEventGetWidID()) {}
00033
00034     virtual ~UAboutDlg() {}
00035
00036     enum
00037     {
00038         kOK = EV_COMMAND_START, // 0
00039         kAppPix,                // 1
00040         kAppName,               // 2
00041         kAppURL                 // 3
00042     };
00043
00044     virtual void DoDataExchange(bool fill);
00045
00046 protected:
00047     ev_msg int OnOk(void);
00048     ev_msg int OnURL(void);
00049
00050     UDECLARE_MESSAGE_MAP()
00051 };
00052 #endif // qUnix
00053
00054 #endif // ABOUT_DLG_H
Generated on Fri Jan 31 12:08:31 2003 for WinCvs Source by doxygen 1.3-rc2


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
00080
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 Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "MultiString.h"
00051 #include "MultiFiles.h"
00052 #include "ItemListDlg.h"
00053
00054 #ifdef WIN32
00055 #include "GetPrefs.h"
00056
00057 #ifdef _DEBUG
00058 #define new DEBUG_NEW
00059 #undef THIS_FILE
00060 static char THIS_FILE[] = __FILE__;
00061 #endif
00062
00064 // CAnnotate_MAIN property page
00065
00066 IMPLEMENT_DYNAMIC(CAnnotate_MAIN, CPropertyPage)
00067
00068 CAnnotate_MAIN::CAnnotate_MAIN(const MultiFiles* mf,
00069                                const char* rev, bool isDate)
00070                                : m_mf(mf), CPropertyPage(CAnnotate_MAIN::IDD)
00071 {
00072     m_hasRev = FALSE;
00073     m_isDate = isDate;
00074     m_strRev = rev;
00075     m_force = FALSE;
00076     m_noRecurse = FALSE;
00077
00078     m_revCombo.SetItems(m_isDate ? &gDateNames : &gRevNames);
00079 }
00080
00081 CAnnotate_MAIN::~CAnnotate_MAIN()
00082 {
00083 }
00084
00085 void CAnnotate_MAIN::DoDataExchange(CDataExchange* pDX)
00086 {
00087     CPropertyPage::DoDataExchange(pDX);
00088     //{{AFX_DATA_MAP(CAnnotate_MAIN)
00089     DDX_Control(pDX, IDC_COMBO_REV, m_revCombo);
00090     DDX_Check(pDX, IDC_SPECIFY_REV, m_hasRev);
00091     DDX_Check(pDX, IDC_ISDATE, m_isDate);
00092     DDX_Check(pDX, IDC_FORCE, m_force);
00093     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00094     DDX_CBString(pDX, IDC_COMBO_REV, m_strRev);
00095     //}}AFX_DATA_MAP
00096
00097     if( m_hasRev )
00098     {
00099         DDV_MinChars(pDX, m_strRev, 1);
00100     }
00101
00102     DDX_ComboMString(pDX, IDC_COMBO_REV, m_revCombo);
00103
00104     if( !pDX->m_bSaveAndValidate )
00105     {
00106         OnSpecifyRev();
00107     }
00108 }
00109
00110
00111 BEGIN_MESSAGE_MAP(CAnnotate_MAIN, CPropertyPage)
00112     //{{AFX_MSG_MAP(CAnnotate_MAIN)
00113     ON_BN_CLICKED(IDC_SPECIFY_REV, OnSpecifyRev)
00114     ON_BN_CLICKED(IDC_ISDATE, OnIsdate)
00115     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00116     //}}AFX_MSG_MAP
00117 END_MESSAGE_MAP()
00118
00119
00120 // CAnnotate_MAIN message handlers
00121
00122
00123 void CAnnotate_MAIN::OnSpecifyRev()
00124 {
00125     CButton* btnHasRev = (CButton*)GetDlgItem(IDC_SPECIFY_REV);
00126     CWnd* wndIsDate = GetDlgItem(IDC_ISDATE);
00127     CWnd* wndRev = GetDlgItem(IDC_COMBO_REV);
00128     CWnd* wndForce = GetDlgItem(IDC_FORCE);
00129     CWnd* wndBrowseTag = GetDlgItem(IDC_BROWSE_TAG);
00130
00131     BOOL bEnable = btnHasRev->GetCheck();
00132
00133     wndIsDate->EnableWindow(bEnable);
00134     wndRev->EnableWindow(bEnable);
00135     wndForce->EnableWindow(bEnable);
00136     wndBrowseTag->EnableWindow(bEnable && !((CButton*)wndIsDate)->GetCheck());
00137 }
00138
00140 void CAnnotate_MAIN::OnIsdate()
00141 {
00142     CButton* btnIsDate = (CButton*)GetDlgItem(IDC_ISDATE);
00143     BOOL isDate = btnIsDate->GetCheck();
00144
00145     m_revCombo.SetItems(isDate ? &gDateNames : &gRevNames);
00146     DDX_ComboMString(NULL, IDC_COMBO_REV, m_revCombo);
00147
00148     GetDlgItem(IDC_BROWSE_TAG)->EnableWindow(!isDate);
00149 }
00150
00152 void CAnnotate_MAIN::OnBrowseTag()
00153 {
00154     CStr tagName;
00155     if( CompatGetTagListItem(m_mf, tagName) )
00156     {
00157         m_strRev = (const char*)tagName;
00158         m_revCombo.SetWindowText(m_strRev);
00159     }
00160 }
00161
00162 #endif /* WIN32 */
00163
00165 bool CompatGetAnnotate(const MultiFiles* mf, bool& noRecurs, bool& isDate, CPStr& rev, bool& force)
00166 {
00167     bool userHitOK = false;
00168
00169     static CPStr sLastRev;
00170     static bool bIsDate = false;
00171
00172     rev = "";
00173     noRecurs = false;
00174     force = false;
00175     bool hasRev = false;
00176     isDate = bIsDate;
00177
00178 #ifdef WIN32
00179     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgAnnotate(), "Annotate settings");
00180     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00181     CAnnotate_MAIN page1(mf, sLastRev, isDate);
00182     CGetPrefs_GLOBALS page2;
00183     pages.AddPage(&page1);
00184     pages.AddPage(&page2);
00185     if(pages.DoModal() == IDOK)
00186     {
00187         noRecurs = page1.m_noRecurse == TRUE;
00188
00189         sLastRev = page1.m_strRev;
00190         isDate = page1.m_isDate == TRUE;
00191         hasRev = page1.m_hasRev == TRUE;
00192         force = page1.m_force == TRUE;
00193
00194         page2.StoreValues();
00195         gCvsPrefs.SetHideCommandDlgAnnotate(pages.GetHideCommandDlg());
00196         userHitOK = true;
00197     }
00198 #endif /* WIN32 */
00199
00200 #ifdef qMacCvsPP
00201 #endif /* qMacCvsPP */
00202
00203 #if qUnix
00204 #endif // qUnix
00205
00206     if(userHitOK)
00207     {
00208         if(hasRev)
00209             rev = sLastRev;
00210         bIsDate = isDate;
00211
00212         gCvsPrefs.save();
00213     }
00214
00215     return userHitOK;
00216 }
00217
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 "SmartComboBox.h"
00034
00035 class MultiFiles;
00036
00037 bool CompatGetAnnotate(const MultiFiles* mf, bool& noRecurs, bool& isDate, CPStr& rev, bool& force);
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_DYNAMIC(CAnnotate_MAIN)
00051
00052 // Construction
00053 public:
00054     CAnnotate_MAIN(const MultiFiles* mf, const char* rev, bool isDate);
00055     ~CAnnotate_MAIN();
00056
00057 // Dialog Data
00058     //{{AFX_DATA(CAnnotate_MAIN)
00059     enum { IDD = IDD_ANNOTATE_MAIN };
00060     CSmartComboBox  m_revCombo;
00061     BOOL    m_hasRev;
00062     BOOL    m_isDate;
00063     BOOL    m_force;
00064     BOOL    m_noRecurse;
00065     CString m_strRev;
00066     //}}AFX_DATA
00067
00068
00069 // Overrides
00070     // ClassWizard generate virtual function overrides
00071     //{{AFX_VIRTUAL(CAnnotate_MAIN)
00072     protected:
00073     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00074     //}}AFX_VIRTUAL
00075
00076 // Implementation
00077 protected:
00078     // Generated message map functions
00079     //{{AFX_MSG(CAnnotate_MAIN)
00080     afx_msg void OnSpecifyRev();
00081     afx_msg void OnIsdate();
00082     afx_msg void OnBrowseTag();
00083     //}}AFX_MSG
00084     DECLARE_MESSAGE_MAP()
00085 private:
00086     const MultiFiles* m_mf;
00087 };
00088
00089 //{{AFX_INSERT_LOCATION}}
00090 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00091 #endif /* WIN32 */
00092
00093 #endif // !defined(AFX_ANNOTATEDLG_H__864729EE_838B_473D_8723_E1269829F781__INCLUDED_)
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if _RICHEDIT_VER >= 0x0210
00052 #   define WCHARFORMAT CHARFORMAT2
00053 #else
00054 #   define WCHARFORMAT CHARFORMAT
00055 #endif
00056 #endif /* WIN32 */
00057
00058 class CColorConsole
00059 {
00060 public:
00061     CColorConsole();
00062     virtual ~CColorConsole();
00063
00064     CColorConsole & operator<<(char c);
00065     CColorConsole & operator<<(kConsoleColor color);
00066     CColorConsole & operator<<(const char *str);
00067     CColorConsole & operator<<(int value);
00068 protected:
00069 #ifdef WIN32
00070     CWincvsView * fView;
00071     CWincvsView * GetView();
00072     WCHARFORMAT oldFormat;
00073 public:
00074     CColorConsole(CWincvsView * aview);
00075 #endif /* WIN32 */
00076 };
00077
00078 #if defined(TARGET_OS_MAC) && !defined(qMacCvsPP)
00079     // for the mpw tools
00080 #   define cvs_out printf
00081 #   define cvs_err printf
00082 #endif /* TARGET_OS_MAC && !qMacCvsPP */
00083
00084 #endif /* APPCONSOLE_H */
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028
00029 #include "stdafx.h"
00030
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <string.h>
00034 #include <stdarg.h>
00035
00036
00037 #ifdef TARGET_OS_MAC
00038 #   include <TextUtils.h>
00039 #   include <Strings.h>
00040 #   include <Dialogs.h>
00041 #   include <unistd.h>
00042 #   include <errno.h>
00043 #   include <console.h>
00044 #   include <ctype.h>
00045 #   include "mktemp.h"
00046 #   include "dll_process.h"
00047 #   include "AppGlue.mac.h"
00048 #   include "MacMisc.h"
00049 #endif /* TARGET_OS_MAC */
00050
00051 #ifdef qMacCvsPP
00052 #   include "MacCvsApp.h"
00053 #   include "LogWindow.h"
00054 #   include "MacBinEncoding.h"
00055 #   include "MacCvsAE.h"
00056 #endif /* qMacCvsPP */
00057
00058 #ifdef WIN32
00059 #   include "wincvs.h"
00060 #   include "PromptFiles.h"
00061 #   include "BrowseFileView.h"
00062 #   include "wincvs_winutil.h"
00063
00064 #   include <process.h>
00065 #   include <direct.h>
00066
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 #if !TARGET_RT_MAC_CFM
00075 #   include "cvsgui_process.h"
00076 #endif
00077
00078 #if qUnix
00079 #   include "UCvsApp.h"
00080 #   include "UCvsFiles.h"
00081 #   include <ctype.h>
00082 #endif /* qUnix */
00083
00084 #ifdef HAVE_ERRNO_H
00085 #   include <errno.h>
00086 #endif
00087
00088 #ifdef HAVE_UNISTD_H
00089 #   include <unistd.h>
00090 #endif
00091
00092 #include "Authen.h"
00093 #include "CvsPrefs.h"
00094 #include "AppGlue.h"
00095 #include "AppConsole.h"
00096 #include "GetPassword.h"
00097 #include "AskYesNo.h"
00098 #include "CvsArgs.h"
00099 #include "FileTraversal.h"
00100 #include "CvsCommands.h"
00101 #include "cvsgui_i18n.h"
00102
00104 CCvsConsole* gConsole = 0L;
00105
00107 static int sLastExitCode;
00108
00110 CTmpFiles sTmpList;
00111
00112 #ifdef _MSC_VER
00113 #   define CVS_EXTERN_C extern "C"
00114 #else
00115 #   define CVS_EXTERN_C
00116 #endif
00117
00118 #if !TARGET_RT_MAC_CFM
00119 static CvsProcessCallbacks sCallTable = {
00120     glue_consoleout,
00121     glue_consoleerr,
00122     glue_getenv,
00123     glue_exit
00124 };
00125 #endif
00126
00131 CVS_EXTERN_C void glue_exit(int code)
00132 {
00133     if( !gCvsPrefs.IsTclFileRunning() )
00134         cvs_out(_i18n("\n***** CVS exited normally with code %d *****\n\n"), code);
00135
00136     sLastExitCode = code;
00137 }
00138
00145 CVS_EXTERN_C long glue_consoleout(char* txt, long len)
00146 {
00147     if( gConsole != 0L )
00148         return gConsole->cvs_out(txt, len);
00149
00150     cvs_outstr(txt, len);
00151
00152     return len;
00153 }
00154
00161 CVS_EXTERN_C long glue_consoleerr(char* txt, long len)
00162 {
00163     if( gConsole != 0L )
00164         return gConsole->cvs_err(txt, len);
00165
00166     cvs_errstr(txt, len);
00167
00168     return len;
00169 }
00170
00177 CVS_EXTERN_C long glue_consolein(char* txt, long len)
00178 {
00179     return 0;
00180 }
00181
00182 #ifdef TARGET_OS_MAC
00183 #   define isGlobalEnvVariable(name) ( \
00184         strcmp(name, "CVS_PSERVER_PORT") == 0 || \
00185         strcmp(name, "CVS_RCMD_PORT") == 0 || \
00186         strcmp(name, "CVS_SERVER") == 0 || \
00187         strcmp(name, "CVS_RSH") == 0 || \
00188         strcmp(name, "CVS_RSA_IDENTITY") == 0 || \
00189         strcmp(name, "HOME") == 0 || \
00190         strcmp(name, "ISO8859") == 0 || \
00191         strcmp(name, "IC_ON_TXT") == 0 || \
00192         strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0 || \
00193         strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0 || \
00194         strcmp(name, "MAC_BINARY_TYPES_HQX") == 0 || \
00195         strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0 || \
00196         strcmp(name, "CVSUSEUNIXLF") == 0 || \
00197         strcmp(name, "DIRTY_MCP") == 0 \
00198         )
00199 #endif /* TARGET_OS_MAC */
00200
00207 CVS_EXTERN_C const char* glue_getenv(char* name)
00208 {
00209     if( name == NULL )
00210         return NULL;
00211
00212 #ifdef WIN32
00213     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00214     if( !app )
00215     {
00216         ASSERT(FALSE);  // need an application object
00217         return NULL;
00218     }
00219
00220     if( ::GetCurrentThreadId() != app->m_nThreadID &&
00221         (strcmp(name, "CVS_GETPASS") == 0 || strcmp(name, "CVSLIB_YESNO") == 0 ||
00222         strcmp(name, "HOME") == 0) )
00223     {
00224         // synchonize it since the thread calls and
00225         // we call some MFC objects in it (prompt
00226         // password, get path...)
00227         CCvsThreadLock threadLock;
00228
00229         return app->GetEnvMainThread(name);
00230     }
00231 #endif /* WIN32 */
00232
00233 #ifdef TARGET_OS_MAC
00234     char* result;
00235     if( (result = ae_getenv(name)) != (char*)-1 )
00236     {
00237         if( result == 0L && isGlobalEnvVariable(name) )
00238         {
00239             // in this case only we let continue
00240             // to get the MacCVS settings. So the CWCVS
00241             // users (or any AppleEvent user) can set
00242             // these variables in MacCVS but still can overide
00243             // them using Apple Events.
00244         }
00245         else
00246             return result;
00247     }
00248 #endif /* TARGET_OS_MAC */
00249
00250     // Give a chance for the new AuthenModel to react to the getenv callback
00251     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00252     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00253     std::vector<AuthenModel*>::const_iterator i;
00254
00255     if( curModel != 0L )
00256     {
00257         const char* res = curModel->OnGetEnv(name);
00258         if( res != 0L )
00259             return res;
00260     }
00261
00262     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00263     {
00264         AuthenModel* model = *i;
00265
00266         if( model == curModel )
00267             continue;
00268
00269         const char* res = model->OnGetEnv(name);
00270         if( res != 0L )
00271             return res;
00272     }
00273
00274     if( strcmp(name, "USER") == 0
00275 #ifdef WIN32
00276         // I do that (and see the "STRATA_HACK" in
00277         // subr.c) because people get tired on Windows
00278         // to have to check their Windows login :
00279         // this is only for .rhosts authentication.
00280         || strcmp(name, "LOGNAME") == 0
00281 #endif /* WIN32 */
00282         )
00283     {
00284         static char user[64];
00285
00286         // extract from the cvsroot
00287         const char* ccvsroot = gCvsPrefs;
00288         ccvsroot = Authen::skiptoken(ccvsroot);
00289         char* login = strchr(ccvsroot, '@');
00290         if( login == NULL )
00291         {
00292             // for WIN32/gcvs this means the CVSROOT is local
00293 #ifdef TARGET_OS_MAC
00294             cvs_err(_i18n("MacCvs: Cannot extract login from cvsroot %s !\n"), ccvsroot);
00295 #endif /* TARGET_OS_MAC */
00296             return NULL;
00297         }
00298
00299         int length = login - ccvsroot;
00300         memcpy(user, ccvsroot, length * sizeof(char));
00301         user[length] = '\0';
00302
00303         return user;
00304     }
00305     else if( strcmp(name, "CVSROOT") == 0 )
00306     {
00307         static CStr root;
00308
00309         // extract from the cvsroot
00310         const char* ccvsroot = gCvsPrefs;
00311         ccvsroot = Authen::skiptoken(ccvsroot);
00312         root = gAuthen.token();
00313         root << ccvsroot;
00314
00315         return root;
00316     }
00317     else if( strcmp(name, "CVSREAD") == 0 )
00318     {
00319         return gCvsPrefs.CheckoutRO() ? (char*)"1" : 0L;
00320     }
00321     else if( strncmp(name, "CVS_GETPASS", strlen("CVS_GETPASS")) == 0 )
00322     {
00323         UStr str(_i18n("Enter the password:"));
00324         char *tmp;
00325         if( (tmp = strchr(name, '=')) != 0L )
00326         {
00327             str = ++tmp;
00328         }
00329
00330         return CompatGetPassword(str);
00331     }
00332     else if( strcmp(name, "CVSLIB_YESNO") == 0 )
00333     {
00334         return (char*)AskYesNo();
00335     }
00336     else if( strcmp(name, "DIRTY_MCP") == 0 )
00337     {
00338         return gCvsPrefs.DirtySupport() ? (char*)"yes" : (char*)"no";
00339     }
00340 #ifdef WIN32
00341     else if( strcmp(name, "HOME") == 0 )
00342     {
00343         // prompt for home the first time
00344         if( gCvsPrefs.Home() == 0L )
00345         {
00346             char oldpath[_MAX_PATH];
00347             getcwd(oldpath, _MAX_PATH-1);
00348
00349             CStr home;
00350             if( !BrowserGetDirectory(_i18n("Select your home directory"), home) )
00351             {
00352                 chdir(oldpath);
00353                 return 0L;
00354             }
00355
00356             gCvsPrefs.SetHome(home);
00357             gCvsPrefs.save();
00358             chdir(oldpath);
00359         }
00360
00361         // Windows 98 doesn't like C:\/.cvspass
00362         static CStr home;
00363         home = gCvsPrefs.Home();
00364         if( home.endsWith(kPathDelimiter) )
00365         {
00366             home[home.length() - 1] = '\0';
00367         }
00368
00369         return home;
00370     }
00371     else if( strcmp(name, "CVSUSEUNIXLF") == 0 )
00372     {
00373         return gCvsPrefs.UnixLF() ? (char*)"1" : 0L;
00374     }
00375 #endif /*WIN32 */
00376 #if TARGET_RT_MAC_MACHO
00377     else if( strcmp(name, "CVS_MACLF") == 0 )
00378     {
00379         return gCvsPrefs.MacLF() ? (char*)"1" : 0L;
00380     }
00381 #endif
00382 #if TARGET_RT_MAC_CFM
00383     else if( strcmp(name, "HOME") == 0 )
00384     {
00385         UFSSpec theFolder;
00386         static UStr thePath;
00387
00388         if( MacGetPrefsFolder(theFolder, thePath) != noErr )
00389         {
00390             cvs_err(_i18n("Unable to locate the preferences folder !\n"));
00391             return 0L;
00392         }
00393
00394         // We do not use any more the "@@@" trick. Instead
00395         // we let cvs convert it to a Unix path.
00396         //strcpy(thePath, "@@@");
00397         return thePath;
00398     }
00399     else if( strcmp(name, "CVSUSEUNIXLF") == 0 )
00400     {
00401         return gCvsPrefs.UnixLF() ? (char*)"1" : 0L;
00402     }
00403 #endif
00404 #ifdef TARGET_OS_MAC
00405     else if( strcmp(name, "ISO8859") == 0 )
00406     {
00407         static char iso[6];
00408
00409         if( gCvsPrefs.IsoConvert() == ISO8559_none )
00410             return 0L;
00411
00412         sprintf(iso, "%d", (int)gCvsPrefs.IsoConvert());
00413         return iso;
00414     }
00415     else if( strcmp(name, "IC_ON_TXT") == 0 )
00416     {
00417         return gCvsPrefs.ICTextOption() ? (char *)"1" : 0L;
00418     }
00419     else if( strcmp(name, "MAC_DEFAULT_RESOURCE_ENCODING") == 0 )
00420     {
00421         switch(gCvsPrefs.MacBinEncoding())
00422         {
00423             case MAC_HQX:
00424                 return (char*)"HQX";
00425                 break;
00426             case MAC_APPSINGLE:
00427                 return (char*)"AppleSingle";
00428                 break;
00429         }
00430         return 0L;
00431     }
00432     else if( strcmp(name, "MAC_BINARY_TYPES_SINGLE") == 0 )
00433     {
00434         return (char*)MacBinMaps::GetEnvTypes(MAC_APPSINGLE);
00435     }
00436     else if( strcmp(name, "MAC_BINARY_TYPES_HQX") == 0 )
00437     {
00438         return (char*)MacBinMaps::GetEnvTypes(MAC_HQX);
00439     }
00440     else if( strcmp(name, "MAC_BINARY_TYPES_PLAIN") == 0 )
00441     {
00442         return (char*)MacBinMaps::GetEnvPlainTypes();
00443     }
00444 #endif /* TARGET_OS_MAC */
00445     else
00446     {
00447         char* res;
00448         res = getenv(name);
00449         return res;
00450     }
00451
00452     return NULL;
00453 }
00454
00465 int launchCVS(int test, const char* path, int argc, char* const* argv, CCvsConsole* console /*= 0L*/, const char *cvsfile /*= 0L*/ )
00466 {
00467     CAuthenSetUp setupEnv;
00468     CvsProcessStartupInfo startupInfo;
00469
00470     startupInfo.hasTty = ( !test ? gCvsPrefs.CvsConsole() : true ); // test cvs has always tty (prevent printing cvs version info on console
00471     startupInfo.currentDirectory = path;
00472
00473     gConsole = console;
00474
00475 #if TARGET_RT_MAC_CFM
00476     CompatConnectID connID;
00477
00478     if( !loadCVS(connID) ) || test
00479         return errInternal;
00480
00481     int exitc = 0;
00482
00483     // call the main
00484     if( !CompatCallLibrary3(connID, exitc, uppMainProcInfo, "dllglue_main",
00485         dllglue_main_func, path, argc, (char**)argv) )
00486     {
00487         cvs_err(_i18n("Error : Cannot find symbol ""dllglue_main""\n"));
00488         exitc = errInternal;
00489     }
00490
00491     unloadCVS(connID, exitc);
00492
00493     return exitc;
00494
00495 #elif defined(WIN32) || defined(qUnix) || TARGET_RT_MAC_MACHO
00496     CStr cvscmd;
00497
00498 #ifdef WIN32
00499     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00500 #elif qUnix
00501     UCvsApp* app = UCvsApp::gApp;
00502 #elif TARGET_RT_MAC_MACHO
00503     CMacCvsApp* app = CMacCvsApp::gApp;
00504 #endif
00505
00506     if( app->IsCvsRunning() && cvs_process_is_active(app->GetCvsProcess()) ) {
00507         cvs_err(_i18n("Error : cvs is already running !\n"));
00508         return -1;
00509     }
00510
00511 #if qUnix || TARGET_RT_MAC_MACHO
00512     if(path != 0L && chdir(path) != 0) {
00513         cvs_err(("Error : cannot chdir to %s (error %d)!\n"), path, errno);
00514     }
00515 #endif // qUnix
00516
00517     app->SetCvsStopping(false);
00518
00519     if( !test ) {
00520         gCvsPrefs.WhichCvs(cvscmd, gCvsPrefs.UseAltCvs());
00521         sLastExitCode = 0;
00522     } else {
00523         cvscmd = cvsfile;
00524         sLastExitCode = errNoCvsguiProtocol;
00525     }
00526
00527     struct stat sb;
00528
00529     if( stat(cvscmd, &sb) == -1 ||
00530 #if qUnix || TARGET_RT_MAC_MACHO
00531          S_ISLNK(sb.st_mode) ||
00532 #endif
00533          !(S_ISREG(sb.st_mode)) )
00534     {
00535         cvs_err(_i18n("Unable to find the cvs process in : (error %d)\n"), errno);
00536         cvs_err("1) %s\n", (const char*)cvscmd);
00537     }
00538
00539     CvsProcess* proc = cvs_process_run(cvscmd, argc - 1, (char**)argv + 1, &sCallTable, &startupInfo);
00540     if( proc == 0L )
00541     {
00542         cvs_err(_i18n("Unable to initialize the cvs process (error %d)\n"), errno);
00543         cvs_err(_i18n("The cvs used is : %s\n"), (const char*)cvscmd);
00544     }
00545     else
00546     {
00547 #ifdef TARGET_RT_MAC_MACHO
00548         UInt32 ticker = ::TickCount();
00549 #endif
00550
00551         app->SetCvsRunning(true);
00552         app->SetCvsProcess(proc);
00553 #if defined(WIN32) || defined(qUnix)
00554         app->PeekPumpAndIdle(true);
00555 #endif
00556 #ifndef qUnix
00557         if( console != 0L )
00558 #endif
00559         {
00560             time_t start = time(NULL);
00561
00562             while( TRUE )
00563             {
00564 #if TARGET_RT_MAC_MACHO
00565                 UInt32 ticker = ::TickCount();
00566 #elif defined(WIN32) || defined(qUnix)
00567                 app->PeekPumpAndIdle(false);
00568 #endif
00569
00570 #if TARGET_RT_MAC_MACHO
00571                 if( (::TickCount () - ticker) > 40 )
00572                 {
00573                     glue_eventdispatcher(0L);
00574                     ticker = ::TickCount ();
00575                 }
00576 #endif
00577                 cvs_process_give_time();
00578
00579                 if( !cvs_process_is_active(proc) )
00580                     break;
00581
00582                 if ( test && ( (time(NULL) - start) > 10 ) )
00583                 {
00584                     cvs_err(_i18n("testing cvs timed out\n"));
00585                     cvs_process_stop(proc);
00586                 }
00587             } // end while
00588         }
00589     }
00590
00591     return sLastExitCode;
00592
00593 #endif
00594 }
00595
00599 void stopCVS()
00600 {
00601 #ifdef WIN32
00602     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00603     app->SetCvsStopping(true);
00604
00605     cvs_process_stop(app->GetCvsProcess());
00606     cvs_out(_i18n("***** CVS stopped on user request !!! *****\n\n"));
00607 #endif
00608 }
00609
00617 int testCVS(const char* cvsfile, int argc, char* const* argv)
00618 {
00619     return launchCVS(TRUE, NULL, argc, argv, NULL, cvsfile);
00620 }
00629 int launchCVS(const char* path, int argc, char* const* argv, CCvsConsole* console /*= 0L*/)
00630 {
00631     return launchCVS(FALSE, path, argc, argv, console, NULL);
00632 }
00633
00643 FILE* launchCVS(const char* dir, const CvsArgs& args, CStr& tmpFile,
00644                 const char* prefix /*= 0L*/, const char* extension /*= 0L*/)
00645 {
00646     if( !MakeTmpFile(tmpFile, prefix, extension) )
00647         return 0L;
00648
00649     FILE* res = fopen(tmpFile, gCvsPrefs.UnixLF() ? "wb+" : "w+");
00650     if( res == 0L )
00651     {
00652         cvs_err(_i18n("Impossible to open the temp file '%s' for write (error %d)"),
00653             (const char*)tmpFile, errno);
00654
00655         return 0L;
00656     }
00657
00658     CStreamConsole myconsole(res);
00659
00660     launchCVS(dir, args.Argc(), args.Argv(), &myconsole);
00661     fseek(res, 0L, SEEK_SET);
00662
00663     return res;
00664 }
00665
00675 const char* launchCVS(const char* dir, const CvsArgs& args,
00676                       const char* prefix /*= 0L*/, const char* extension /*= 0L*/)
00677 {
00678     CStr filename;
00679     FILE* file = launchCVS(dir, args, filename, prefix, extension);
00680     if( file == 0L )
00681         return 0L;
00682
00683     fclose(file);
00684
00685     return sTmpList.push_back(filename);
00686 }
00687
00688 #ifdef WIN32
00689 void WaitForCvs(void)
00690 {
00691     // pump messages manually
00692     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00693
00694     while( TRUE )
00695     {
00696         if( app->GetCvsProcess() == 0L )
00697             return;
00698
00699         if( !cvs_process_is_active(app->GetCvsProcess()) )
00700             return;
00701
00702         Sleep(100);
00703     }
00704 }
00705 #endif
00706
00707 #if TARGET_RT_MAC_MACHO
00708 void WaitForCvs(void)
00709 {
00710     while( cvs_process_is_active(CMacCvsApp::gApp->GetCvsProcess()) )
00711     {
00712         UInt32 ticker = ::TickCount();
00713
00714         while( cvs_process_give_time() )
00715         {
00716             if( (::TickCount() - ticker) >= 60 )
00717                 break;
00718         }
00719
00720         glue_eventdispatcher(0L);
00721     }
00722
00723     CMacCvsApp::gApp->SetCvsRunning(false);
00724 }
00725 #endif
00726
00728 // CStreamConsole
00729
00730 CStreamConsole::CStreamConsole(FILE* out)
00731     : m_fOut(out)
00732 {
00733 }
00734
00735 long CStreamConsole::cvs_out(char* txt, long len)
00736 {
00737     fwrite(txt, sizeof(char), len, m_fOut);
00738     return len;
00739 }
00740
00741 long CStreamConsole::cvs_err(char* txt, long len)
00742 {
00743     cvs_errstr(txt, len);
00744     return len;
00745 }
00746
00748 // CAuthenSetUp
00749
00750 CAuthenSetUp::CAuthenSetUp()
00751 {
00752     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00753     if( curModel != 0L )
00754         curModel->OnSetupEnv();
00755 }
00756
00757 CAuthenSetUp::~CAuthenSetUp()
00758 {
00759     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00760     if( curModel != 0L )
00761         curModel->OnRestoreEnv();
00762 }
00763
00765 // CTmpFiles
00766
00767 CTmpFiles::CTmpFiles()
00768 {
00769 }
00770
00771 CTmpFiles::~CTmpFiles()
00772 {
00773     std::vector<CStr>::const_iterator i;
00774     for(i = m_allfiles.begin(); i != m_allfiles.end(); ++i)
00775     {
00776         const char* file = *i;
00777         unlink((char*)file);
00778     }
00779 }
00780
00781 inline const char* CTmpFiles::push_back(const char* file)
00782 {
00783     m_allfiles.push_back(file);
00784
00785     return m_allfiles[m_allfiles.size() - 1];
00786 }
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include <vector>
00030
00031 #define errInternal -99
00032 #define errThreadRunning -98
00033 #define errNoCvsguiProtocol -97
00034
00035 // hooks for cvs
00036 extern "C" {
00037     extern long glue_consoleout(char* txt, long len);
00038     extern long glue_consoleerr(char* txt, long len);
00039     extern long glue_consolein(char* txt, long len);
00040     extern const char* glue_getenv(char* name);
00041     extern void glue_exit(int code);
00042 }
00043
00044 class CCvsConsole;
00045 extern CCvsConsole* gConsole;
00046
00047 class CvsArgs;
00048 class UStr;
00049 class CStr;
00050
00051 int testCVS(const char* path, int argc, char* const* argv);
00052 int launchCVS(const char* path, int argc, char* const* argv, CCvsConsole* console = 0L);
00053 int launchCVS(int test, const char* path, int argc, char* const* argv, CCvsConsole* console = 0L, const char* cvsfile = 0L);
00054 void stopCVS();
00055
00056 FILE* launchCVS(const char* dir, const CvsArgs& args, UStr& tmpFile,
00057                 const char* prefix = 0L, const char* extension = 0L);
00058
00059 const char* launchCVS(const char* dir, const CvsArgs& args,
00060                       const char* prefix = 0L, const char* extension = 0L);
00061
00062 #if defined(WIN32) || TARGET_RT_MAC_MACHO
00063
00064     void WaitForCvs(void);
00065 #else
00066 #   define WaitForCvs()
00067 #endif
00068
00070 class CCvsConsole
00071 {
00072 public:
00074     virtual long cvs_out(char* txt, long len) = 0L;
00075
00077     virtual long cvs_err(char* txt, long len) = 0L;
00078 };
00079
00081 class CStreamConsole : public CCvsConsole
00082 {
00083 public:
00084     CStreamConsole(FILE* out);
00085
00086     virtual long cvs_out(char* txt, long len);
00087     virtual long cvs_err(char* txt, long len);
00088
00089 protected:
00090     FILE* m_fOut;
00091 };
00092
00094 class CAuthenSetUp
00095 {
00096 public:
00097     CAuthenSetUp();
00098     virtual ~CAuthenSetUp();
00099 };
00100
00102 class CTmpFiles
00103 {
00104 public:
00105     CTmpFiles();
00106     virtual ~CTmpFiles();
00107     const char* push_back(const char* file);
00108 protected:
00109     std::vector<CStr> m_allfiles;
00110 };
00111
00112 #endif /* APPGLUE_H */
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 TARGET_RT_MAC_CFM
00043     if(CMacCvsApp::gApp == 0L || !(CMacCvsApp::gApp->IsCvsRunning() || TraversalReport::gRunning))
00044         return 0;
00045 #else
00046     if(CMacCvsApp::gApp == 0L)
00047         return 0;
00048 #endif
00049
00050     EventRecord localEvent;
00051     if (!ev) {
00052         //  Spin callback
00053         UInt32  kSpinSleep = TraversalReport::gRunning ? CMacCvsApp::gApp->GetSleepTime() : 6;
00054             // for CWCVS, we want to go fast on background. But for a traversal operation,
00055             // we want to be smooth
00056         static  UInt32  spinTicks = 0;
00057         if ((::TickCount () - spinTicks) < kSpinSleep)
00058             return 0;
00059
00060         ev = &localEvent;
00061         ::WaitNextEvent (everyEvent, ev, kSpinSleep, nil);
00062         spinTicks = ::TickCount ();
00063     } // if
00064
00065     if(ev->what == mouseDown)
00066     {
00067         WindowPtr macWindowP;
00068         SInt16 thePart = ::FindWindow(ev->where, &macWindowP);
00069         switch (thePart)
00070         {
00071             case inDrag:
00072             case inGrow:
00073             case inZoomIn:
00074             case inZoomOut:
00075                 LEventDispatcher::GetCurrentEventDispatcher()->DispatchEvent(*ev);
00076                 break;
00077             case inContent:
00078                 if (macWindowP != ::FrontWindow())
00079                 {
00080                     // Clicked Window is not the front one
00081                     LWindow *frontW = LWindow::FetchWindowObject(macWindowP);
00082                     if (frontW != nil && !UDesktop::WindowIsSelected(frontW))
00083                         LEventDispatcher::GetCurrentEventDispatcher()->DispatchEvent(*ev);
00084                 }
00085                 break;
00086         }
00087         return 0;
00088     }
00089     else if(ev->what == nullEvent)
00090     {
00091         CMacCvsApp::gApp->DoSpinCursor();
00092     }
00093     else if(ev->what != keyDown && ev->what != keyUp && ev->what != mouseUp)
00094     {
00095         LEventDispatcher::GetCurrentEventDispatcher()->DispatchEvent(*ev);
00096     }
00097     return 0;
00098 }
00099
00100 bool loadCVS(CompatConnectID & connID)
00101 {
00102     int result = 0;
00103     const char *name_dll2;
00104
00105 #if TARGET_RT_MAC_CFM
00106     // restore it in case it was not restored correctly by lsh
00107     GusiMSLSetWriteConsole(GUSIMSL_WriteConsoleHook);
00108     GusiMSLSetErrConsole(GUSIMSL_WriteErrHook);
00109     GusiMSLSetHandleEvent(GUSIMSL_HandleEventHook);
00110 #endif
00111
00112     // get cvs shared library
00113 #if qCarbon
00114 #   if qCvsDebug
00115         name_dll2 = "cvsXDbgLib";
00116 #   else
00117         name_dll2 = "cvsXLib";
00118 #   endif
00119 #else
00120 #   if qCvsDebug
00121         name_dll2 = "cvs2DbgLib";
00122 #   else
00123         name_dll2 = "cvs2Lib";
00124 #   endif
00125 #endif
00126
00127     // open the library
00128     if(!CompatLoadLibrary(&connID, name_dll2))
00129     {
00130         cvs_err("Error: Unable to load the library %s\n", name_dll2);
00131         return false;
00132     }
00133
00134     // set the console out
00135     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsoleout",
00136         dllglue_setglue_func, CompatFuncArg(uppConsoleOutProcInfo, glue_consoleout)))
00137     {
00138         cvs_err("Error : Cannot find symbol ""dllglue_setconsoleout""\n");
00139         goto closeandfail;
00140     }
00141
00142     // set the console err
00143     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsoleerr",
00144         dllglue_setglue_func, CompatFuncArg(uppConsoleOutProcInfo, glue_consoleerr)))
00145     {
00146         cvs_err("Error : Cannot find symbol ""dllglue_setconsoleerr""\n");
00147         goto closeandfail;
00148     }
00149
00150     // set the console in
00151     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setconsolein",
00152         dllglue_setglue_func, CompatFuncArg(uppConsoleInProcInfo, glue_consolein)))
00153     {
00154         cvs_err("Error : Cannot find symbol ""dllglue_setconsolein""\n");
00155         goto closeandfail;
00156     }
00157
00158     // set the getenv
00159     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_setgetenv",
00160         dllglue_setglue_func, CompatFuncArg(uppGetEnvProcInfo, glue_getenv)))
00161     {
00162         cvs_err("Error : Cannot find symbol ""dllglue_setgetenv""\n");
00163         goto closeandfail;
00164     }
00165
00166     // set the event dispatcher
00167     if(!CompatCallLibrary1(connID, result, uppSetGlueProcInfo, "dllglue_seteventdispatch",
00168         dllglue_setglue_func, CompatFuncArg(uppEventDispatchProcInfo, glue_eventdispatcher)))
00169     {
00170         cvs_err("Error : Cannot find symbol ""dllglue_seteventdispatch""\n");
00171         goto closeandfail;
00172     }
00173
00174     CMacCvsApp::gApp->SetCvsRunning(true);
00175
00176     return true;
00177
00178 closeandfail:
00179     CompatCloseLibrary(&connID);
00180     return false;
00181 }
00182
00183 void unloadCVS(CompatConnectID connID, int exitc)
00184 {
00185 #if TARGET_RT_MAC_CFM
00186     // restore it in case it was not restored correctly by lsh
00187     GusiMSLSetWriteConsole(GUSIMSL_WriteConsoleHook);
00188     GusiMSLSetErrConsole(GUSIMSL_WriteErrHook);
00189     GusiMSLSetHandleEvent(GUSIMSL_HandleEventHook);
00190 #endif
00191
00192     CompatCloseLibrary(&connID);
00193
00194     glue_exit(exitc);
00195
00196     CMacCvsApp::gApp->SetCvsRunning(false);
00197 }
00198
00199 int decodeCVS(char* path)
00200 {
00201     gConsole = 0;
00202
00203     CompatConnectID connID;
00204
00205     if(!loadCVS(connID))
00206         return errInternal;
00207
00208     int exitc = 0;
00209
00210     // call the main
00211     if(!CompatCallLibrary1(connID, exitc, uppDecodeFileProcInfo, "dllglue_decode_file",
00212         dllglue_decode_file_func, path))
00213     {
00214         cvs_err("Error : Cannot find symbol ""dllglue_decode_file""\n");
00215         exitc = errInternal;
00216     }
00217
00218     unloadCVS(connID, exitc);
00219
00220     return exitc;
00221 }
00222
00223 long GUSIMSL_WriteConsoleHook(char *buffer, long n)
00224 {
00225     return glue_consoleout(buffer, n);
00226 }
00227 long GUSIMSL_WriteErrHook(char *buffer, long n)
00228 {
00229     return glue_consoleerr(buffer, n);
00230 }
00231 int GUSIMSL_HandleEventHook(EventRecord *ev)
00232 {
00233     return glue_eventdispatcher(ev);
00234 }
00235
00236 #endif /* TARGET_OS_MAC */
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "cvsgui_i18n.h"
00044
00045 #ifdef _DEBUG
00046 #define new DEBUG_NEW
00047 #undef THIS_FILE
00048 static char THIS_FILE[] = __FILE__;
00049 #endif
00050
00051 #ifdef WIN32
00052
00053 // CAskYesNo dialog
00054
00055
00056 CAskYesNo::CAskYesNo(CWnd* pParent /*=NULL*/)
00057     : CDialog(CAskYesNo::IDD, pParent)
00058 {
00059     //{{AFX_DATA_INIT(CAskYesNo)
00060     //}}AFX_DATA_INIT
00061 }
00062
00063
00064 void CAskYesNo::DoDataExchange(CDataExchange* pDX)
00065 {
00066     CDialog::DoDataExchange(pDX);
00067     //{{AFX_DATA_MAP(CAskYesNo)
00068     //}}AFX_DATA_MAP
00069 }
00070
00071
00072 BEGIN_MESSAGE_MAP(CAskYesNo, CDialog)
00073     //{{AFX_MSG_MAP(CAskYesNo)
00074         // NOTE: the ClassWizard will add message map macros here
00075     //}}AFX_MSG_MAP
00076 END_MESSAGE_MAP()
00077
00078
00079 // CAskYesNo message handlers
00080 #endif /* WIN32 */
00081
00082 const char *AskYesNo(void)
00083 {
00084 #ifdef WIN32
00085     CAskYesNo gp;
00086     return gp.DoModal() == IDOK ? _i18n("yes") : _i18n("no");
00087 #endif /* WIN32 */
00088 #ifdef qMacCvsPP
00089     if(!CMacCvsApp::gApp->IsFrontProcess() && CMacCvsApp::gApp->NotifyUser(0L))
00090     {
00091         while(!CMacCvsApp::gApp->IsFrontProcess())
00092         {
00093             CMacCvsApp::gApp->SpendSomeTime();
00094         }
00095     }
00096
00097     StDialogHandler theHandler(dlg_YesNo, LCommander::GetTopCommander());
00098     LWindow *theDialog = theHandler.GetDialog();
00099     ThrowIfNil_(theDialog);
00100
00101     theDialog->Show();
00102     MessageT hitMessage;
00103     while (true)
00104     {       // Let DialogHandler process events
00105         hitMessage = theHandler.DoDialog();
00106
00107         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00108             break;
00109     }
00110     theDialog->Hide();
00111
00112     return hitMessage == msg_OK ? _i18n("yes") : _i18n("no");
00113 #endif /* qMacCvsPP */
00114 #ifdef qUnix
00115     return CvsAlert(_i18n("cvs is requiring you to answer yes or no (see the console for details)"), _i18n("No"), _i18n("Yes")) ?
00116         _i18n("no") : _i18n("yes");
00117 #endif /* qUnix */
00118 }
00119
00120 class UPromptMessage : public UWidget
00121 {
00122     UDECLARE_DYNAMIC(UPromptMessage)
00123 public:
00124     UPromptMessage(const char *msg, const char *title, const char *def,
00125         const char *cncl) : UWidget(UEventGetWidID()), m_msg(msg), m_title(title),
00126         m_ok(def), m_cncl(cncl)
00127     {
00128     }
00129
00130     virtual ~UPromptMessage() {}
00131
00132     enum
00133     {
00134         kOK = EV_COMMAND_START, // 0
00135         kCancel,                // 1
00136         kMsg                    // 2
00137     };
00138
00139     virtual void DoDataExchange(bool fill)
00140     {
00141         if(fill)
00142         {
00143             UEventSendMessage(GetWidID(), EV_SETTEXT, kOK, (void *)m_ok.c_str());
00144             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)m_title.c_str());
00145             UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void *)m_cncl.c_str());
00146             UEventSendMessage(GetWidID(), EV_SETTEXT, kMsg, (void *)m_msg.c_str());
00147         }
00148         else
00149         {
00150         }
00151     }
00152
00153 protected:
00154     UStr m_msg, m_title, m_ok, m_cncl;
00155
00156     ev_msg int OnOK(void);
00157     ev_msg int OnCancel(void);
00158
00159     UDECLARE_MESSAGE_MAP()
00160 };
00161
00162 UIMPLEMENT_DYNAMIC(UPromptMessage, UWidget)
00163
00164 UBEGIN_MESSAGE_MAP(UPromptMessage, UWidget)
00165     ON_UCOMMAND(kOK, UPromptMessage::OnOK)
00166     ON_UCOMMAND(kCancel, UPromptMessage::OnCancel)
00167 UEND_MESSAGE_MAP()
00168
00169 int UPromptMessage::OnOK(void)
00170 {
00171     EndModal(true);
00172     return 0;
00173 }
00174
00175 int UPromptMessage::OnCancel(void)
00176 {
00177     EndModal(false);
00178     return 0;
00179 }
00180
00181 bool PromptMessage(const char *msg, const char *title, const char *def, const char *cncl)
00182 {
00183     std::auto_ptr<UPromptMessage> dlg(new UPromptMessage(msg, title, def, cncl));
00184     bool res = false;
00185
00186 #ifdef WIN32
00187     res = dlg->DoModal(IDD_PROMPTMESSAGE);
00188 #endif
00189 #ifdef qMacCvsPP
00190     res = dlg->DoModal(dlg_PromptCommand);
00191 #endif
00192
00193     return res;
00194 }
00195
00196 class UEditMessage : public UPromptMessage
00197 {
00198     UDECLARE_DYNAMIC(UEditMessage)
00199 public:
00200     UEditMessage(const char *msg, const char *edit, const char *title, const char *def,
00201         const char *cncl) : UPromptMessage(msg, title, def, cncl), m_edit(edit)
00202     {
00203     }
00204
00205     virtual ~UEditMessage() {}
00206
00207     enum
00208     {
00209         kOK = EV_COMMAND_START, // 0
00210         kCancel,                // 1
00211         kMsg,                   // 2
00212         kEdit                   // 3
00213     };
00214
00215     virtual void DoDataExchange(bool fill)
00216     {
00217         UPromptMessage::DoDataExchange(fill);
00218
00219         if(fill)
00220         {
00221             UEventSendMessage(GetWidID(), EV_SETTEXT, kEdit, (void *)m_edit.c_str());
00222         }
00223         else
00224         {
00225             UEventSendMessage(GetWidID(), EV_GETTEXT, kEdit, &m_edit);
00226         }
00227     }
00228
00229     UStr m_edit;
00230
00231 protected:
00232
00233     UDECLARE_MESSAGE_MAP()
00234 };
00235
00236 UIMPLEMENT_DYNAMIC(UEditMessage, UPromptMessage)
00237
00238 UBEGIN_MESSAGE_MAP(UEditMessage, UPromptMessage)
00239 UEND_MESSAGE_MAP()
00240
00241 bool PromptEditMessage(const char *msg, UStr & edit, const char *title, const char *def, const char *cncl)
00242 {
00243     std::auto_ptr<UEditMessage> dlg(new UEditMessage(msg, edit, title, def, cncl));
00244     bool res = false;
00245
00246 #ifdef WIN32
00247     res = dlg->DoModal(IDD_EDITMESSAGE);
00248 #endif
00249 #ifdef qMacCvsPP
00250     res = dlg->DoModal(dlg_PromptEditCommand);
00251 #endif
00252
00253     if(res)
00254         edit = dlg->m_edit;
00255
00256     return res;
00257 }
Generated on Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 "uwidget.h"
00037 #include "SmartComboBox.h"
00038 #include "CvsCommands.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 TARGET_OS_MAC
00048     rhosts,
00049 #else /* !TARGET_OS_MAC */
00050     local,
00051 #endif /* !TARGET_OS_MAC */
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 TARGET_OS_MAC
00063     #if !TARGET_API_MAC_OSX
00064     #define putenv(a)
00065     #endif
00066 #endif
00067
00068 // Under windows we need an equal sign, which would make a "real" unsetenv fail
00069 #ifdef WIN32
00070     #define STR_UNSETENV_EQUAL "="
00071 #else
00072     #define STR_UNSETENV_EQUAL
00073 #endif
00074
00075 #ifdef WIN32
00076 #define unsetenv(a) putenv(a STR_UNSETENV_EQUAL)
00077 #endif
00078
00079 #ifndef qUnix
00080 UStr AuthenModel::oldHome;
00081 #endif
00082
00083
00084 Authen gAuthen;
00085
00087 // Authentication class
00088
00090 AuthenKind Authen::kind(void)
00091 {
00092     return gAuthenKind;
00093 }
00094
00096 void Authen::setkind(AuthenKind newkind)
00097 {
00098     gAuthenKind = newkind;
00099 }
00100
00102 const char* Authen::kindstr(void)
00103 {
00104     static CStr res;
00105
00106     switch( kind() )
00107     {
00108     default:
00109     case rhosts:
00110         res = ".rhosts authentication";
00111         break;
00112     case pserver:
00113         res = "password authentication";
00114         break;
00115     case kserver:
00116         res = "kerberos authentication";
00117         break;
00118     case local:
00119         res = "local mounted directory";
00120         break;
00121     case ssh:
00122         res = "ssh authentication";
00123         break;
00124     case ntserver:
00125         res = "NT server services";
00126         break;
00127     case gserver:
00128         res = "GSSAPI authentication";
00129         break;
00130     case sspi:
00131         res = "sspi authentication";
00132         break;
00133     case server:
00134         res = "server authentication";
00135         break;
00136     }
00137
00138     if( kind() == pserver && gCvsPrefs.UseProxy() )
00139     {
00140         res << " using a proxy";
00141     }
00142
00143     return res;
00144 }
00145
00147 const char* Authen::token(void)
00148 {
00149     return Authen::token(kind());
00150 }
00151
00153 const char* Authen::token(AuthenKind kind)
00154 {
00155     static CStr res;
00156
00157     switch( kind )
00158     {
00159     default :
00160     case rhosts:
00161         res = "";
00162         break;
00163     case pserver :
00164         res = ":pserver";
00165         if(gCvsPrefs.UseProxy())
00166         {
00167             res << ";proxy=";
00168             res << gCvsPrefs.ProxyHost();
00169             res << ";proxyport=";
00170             res << gCvsPrefs.ProxyPort();
00171         }
00172         res << ':';
00173         break;
00174     case kserver:
00175         res = ":kserver:";
00176         break;
00177     case local:
00178         res = ":local:";
00179         break;
00180     case ssh:
00181         res = ":ext:";
00182         break;
00183     case ntserver:
00184         res = ":ntserver:";
00185         break;
00186     case gserver:
00187         res = ":gserver:";
00188         break;
00189     case sspi:
00190         res = ":sspi:";
00191         break;
00192     case server:
00193         res = ":server:";
00194         break;
00195     }
00196
00197     return res;
00198 }
00199
00201 const char* Authen::skiptoken(const char* cvsroot)
00202 {
00203     const char* secondColon;
00204
00205     if( cvsroot[0] != ':' || (secondColon = strchr(cvsroot + 1, ':')) == NULL )
00206         return cvsroot;
00207
00208     return secondColon + 1;
00209 }
00210
00212 const char* Authen::kindToToken(AuthenKind kind)
00213 {
00214     AuthenModel* model = AuthenModel::GetInstance(kind);
00215     return model->GetToken();
00216 }
00217
00219 AuthenKind Authen::tokenToKind(const char* token)
00220 {
00221     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00222     std::vector<AuthenModel*>::const_iterator i;
00223     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00224     {
00225         AuthenModel* model = *i;
00226         if( strcmp(model->GetToken(), token) == 0 )
00227             return model->GetKind();
00228     }
00229
00230     cvs_err("Unknown authentication kind '%s'\n", token);
00231
00232     return local;
00233 }
00234
00236 short Authen::kindToNum(AuthenKind kind)
00237 {
00238     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00239     std::vector<AuthenModel*>::const_iterator i;
00240     int cnt = 0;
00241     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00242     {
00243         AuthenModel* model = *i;
00244         if( model->GetKind() == kind )
00245             return cnt;
00246     }
00247
00248     return 0;
00249 }
00250
00252 AuthenKind Authen::numToKind(short num)
00253 {
00254     std::vector<AuthenModel*>& allInstances = AuthenModel::GetAllInstances();
00255     std::vector<AuthenModel*>::const_iterator i;
00256     int cnt = 0;
00257     for(i = allInstances.begin(); i != allInstances.end(); ++i, cnt++)
00258     {
00259         AuthenModel* model = *i;
00260         if( cnt == num )
00261             return model->GetKind();
00262     }
00263
00264     return local;
00265 }
00266
00268 bool Authen::parse_cvsroot(const char* CVSroot, UStr& theMethod, UStr& theUser, UStr& theHost, UStr& thePath)
00269 {
00270     char* p;
00271     UStr copyroot(CVSroot);
00272     char* cvsroot_copy = copyroot;
00273
00274     theMethod = "";
00275     theUser = "";
00276     theHost = "";
00277     thePath = "";
00278
00279     if( *cvsroot_copy == ':' )
00280     {
00281         char* method = ++cvsroot_copy;
00282         bool have_semicolon;
00283
00284         /* Access method specified, as in
00285         * "cvs -d :pserver:user@host:/path",
00286         * "cvs -d :local:e:\path",
00287         * "cvs -d :kserver:user@host:/path", or
00288         * "cvs -d :fork:/path".
00289         * We need to get past that part of CVSroot before parsing the
00290         * rest of it.
00291         */
00292
00293         if( !(p = strchr(method, ':')) )
00294             return false;
00295
00296         p = strpbrk(method, ":;#");
00297         if( p == 0L )
00298             return false;
00299
00300         have_semicolon = (*p == ';' || *p == '#');
00301         *p = '\0';
00302         cvsroot_copy = ++p;
00303
00304         theMethod = method;
00305
00306         while(have_semicolon)
00307         {
00308             /* More elaborate implementation would allow multiple
00309             semicolons, for example:
00310
00311             :server;rsh=34;command=cvs-1.6:
00312
00313             we will allow
00314             :server;port=22;proxy=www-proxy;proxyport=8080:
00315
00316             we will also allow # as well as ; as a separator to
00317             avoid having to quote the root in a shell.
00318             */
00319             /* FIXME: lots of error conditions should be better handled,
00320             e.g. garbage after the number or no valid number.
00321
00322             Would be nice to have testcases for some of these cases
00323             including the error cases.  */
00324             p = strpbrk(cvsroot_copy, ":;#");
00325             if( p == NULL )
00326                 return false;
00327
00328             /* pick up more options if we have them */
00329             have_semicolon = (*p == ';' || *p == '#');
00330             *p = '\0';
00331
00332             cvsroot_copy = ++p;
00333         }
00334     }
00335
00336     if( theMethod != "local" )
00337     {
00338         /* Check to see if there is a username in the string. */
00339
00340         if( (p = strchr(cvsroot_copy, '@')) != NULL )
00341         {
00342             *p = '\0';
00343             theUser = cvsroot_copy;
00344             cvsroot_copy = ++p;
00345         }
00346
00347         if( (p = strchr(cvsroot_copy, ':')) != NULL )
00348         {
00349             *p = '\0';
00350             theHost = cvsroot_copy;
00351             cvsroot_copy = ++p;
00352         }
00353     }
00354
00355     thePath = cvsroot_copy;
00356
00357     return true;
00358 }
00359
00361 // Authentications collection
00362
00364 std::vector<AuthenModel*>* AuthenModel::m_instances = 0L;
00365
00367 AuthenModel::AuthenModel()
00368 {
00369     if( m_instances == 0L )
00370     {
00371         m_instances = new std::vector<AuthenModel*>;
00372         if( m_instances == 0L )
00373             throw std::bad_alloc();
00374     }
00375
00376     m_instances->push_back(this);
00377 }
00378
00380 AuthenModel::~AuthenModel()
00381 {
00382     std::vector<AuthenModel*>::iterator i;
00383     i = std::find(m_instances->begin(), m_instances->end(), this);
00384     if( i != m_instances->end() )
00385         m_instances->erase(i);
00386
00387     if( m_instances->empty() )
00388         delete m_instances;
00389 }
00390
00392 std::vector<AuthenModel*>& AuthenModel::GetAllInstances(void)
00393 {
00394     return *AuthenModel::m_instances;
00395 }
00396
00398 AuthenModel* AuthenModel::GetInstance(AuthenKind k)
00399 {
00400     std::vector<AuthenModel*>& allInstances = GetAllInstances();
00401     std::vector<AuthenModel*>::const_iterator i;
00402     for(i = allInstances.begin(); i != allInstances.end(); ++i)
00403     {
00404         AuthenModel* model = *i;
00405         if( model->GetKind() == k )
00406             return model;
00407     }
00408
00409     // default to local
00410     cvs_err("Unknown authentication kind %d\n", k);
00411
00412     return GetInstance(local);
00413 }
00414
00416 void AuthenModel::OnSetupEnv(void)
00417 {
00418     /* under unix there should always be the correct home path
00419      * in the emviroment. So we have not to overwrite it.*/
00420 #ifndef qUnix
00421     static UStr home;
00422
00423     oldHome = getenv("HOME");
00424
00425     home = "HOME=";
00426     home << gCvsPrefs.Home();
00427
00428     putenv(home);
00429 #endif
00430 }
00431
00433 void AuthenModel::OnRestoreEnv(void)
00434 {
00435     /* we have not to clear the HOME enviroment on unix */
00436 #ifndef qUnix
00437     if( oldHome.empty() )
00438         unsetenv("HOME");
00439     else
00440         putenv(oldHome);
00441 #endif
00442 }
00443
00445 // Authentication: local
00446
00447 class AuthenLocal : public AuthenModel
00448 {
00449 public :
00450     AuthenLocal() {}
00451     virtual ~AuthenLocal() {}
00452
00453     virtual AuthenKind GetKind(void) const { return local; }
00454     virtual const char* GetToken(void) const { return "local"; }
00455 };
00456
00457 #if TARGET_RT_MAC_CFM
00458
00461
00462 class AuthenLSH : public AuthenModel
00463 {
00464 public :
00465     AuthenLSH() {}
00466     virtual ~AuthenLSH() {}
00467
00468     virtual AuthenKind GetKind(void) const { return ssh; }
00469     virtual const char* GetToken(void) const { return "ssh"; }
00470
00471     virtual bool HasSettings(void) const { return true; }
00472     virtual bool HasHost(void) const { return true; }
00473     virtual bool HasUser(void) const { return true; }
00474
00475     virtual void DoSettings(void);
00476     virtual void GetSettingsDesc(UStr& desc);
00477
00478     virtual char* OnGetEnv(char* env);
00479
00480     static CPersistentInt gLSHEncrypt;
00481     static CPersistentInt gLSHAuthen;
00482     static CPersistentInt gLSHCompress;
00483     static CPersistentInt gLSHPort;
00484     static CPersistentBool gLSHVerbose;
00485     static CPersistentBool gLSHTrace;
00486     static CPersistentBool gLSHDebug;
00487     static CPersistentBool gLSHKeychain;
00488     static CPersistentBool gLSHIdentity;
00489
00490 };
00491
00492 class UAuthen_LSH : public UWidget
00493 {
00494     UDECLARE_DYNAMIC(UAuthen_LSH)
00495 public:
00496     UAuthen_LSH();
00497     virtual ~UAuthen_LSH() {}
00498
00499     enum
00500     {
00501         kOK = EV_COMMAND_START, // 0
00502         kCancel,            // 1
00503         kEncryptPopup,      // 2
00504         kAuthenPopup,       // 3
00505         kCompressPopup,     // 4
00506         kCheckPort,         // 5
00507         kEditPort,          // 6
00508         kCheckVerbose,      // 7
00509         kCheckTrace,        // 8
00510         kCheckDebug,        // 9
00511         kKeychain,          // 10
00512         kSendIdentity       // 11
00513     };
00514
00515     virtual void DoDataExchange(bool fill);
00516
00517 protected:
00518
00519     ev_msg int OnCheckPort(void);
00520
00521     UDECLARE_MESSAGE_MAP()
00522 };
00523
00524 UIMPLEMENT_DYNAMIC(UAuthen_LSH, UWidget)
00525
00526 UBEGIN_MESSAGE_MAP(UAuthen_LSH, UWidget)
00527     ON_UCOMMAND(kCheckPort, UAuthen_LSH::OnCheckPort)
00528 UEND_MESSAGE_MAP()
00529
00530 UAuthen_LSH::UAuthen_LSH() : UWidget(::UEventGetWidID())
00531 {
00532 }
00533
00534 void UAuthen_LSH::DoDataExchange(bool fill)
00535 {
00536     if( fill )
00537     {
00538         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kEncryptPopup, (int)AuthenLSH::gLSHEncrypt), 0L);
00539         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kAuthenPopup, (int)AuthenLSH::gLSHAuthen), 0L);
00540         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kCompressPopup, (int)AuthenLSH::gLSHCompress), 0L);
00541
00542         int port = (int)AuthenLSH::gLSHPort > 0 ? (int)AuthenLSH::gLSHPort : -1;
00543         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, port != -1), 0L);
00544         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, port == -1 ? 0 : port), 0L);
00545         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, port != -1), 0L);
00546
00547         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckVerbose, (bool)AuthenLSH::gLSHVerbose), 0L);
00548         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTrace, (bool)AuthenLSH::gLSHTrace), 0L);
00549         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDebug, (bool)AuthenLSH::gLSHDebug), 0L);
00550         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kKeychain, (bool)AuthenLSH::gLSHKeychain), 0L);
00551         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSendIdentity, (bool)AuthenLSH::gLSHIdentity), 0L);
00552     }
00553     else
00554     {
00555         AuthenLSH::gLSHEncrypt = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kEncryptPopup, 0L);
00556         AuthenLSH::gLSHAuthen = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kAuthenPopup, 0L);
00557         AuthenLSH::gLSHCompress = UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCompressPopup, 0L);
00558
00559         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
00560         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
00561         AuthenLSH::gLSHPort = state ? value : -1;
00562
00563         AuthenLSH::gLSHVerbose = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckVerbose, 0L) != 0;
00564         AuthenLSH::gLSHTrace = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTrace, 0L) != 0;
00565         AuthenLSH::gLSHDebug = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDebug, 0L) != 0;
00566         AuthenLSH::gLSHKeychain = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kKeychain, 0L) != 0;
00567         AuthenLSH::gLSHIdentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSendIdentity, 0L) != 0;
00568     }
00569 }
00570
00571 int UAuthen_LSH::OnCheckPort(void)
00572 {
00573     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
00574     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
00575
00576     return 0;
00577 }
00578
00579 void AuthenLSH::DoSettings(void)
00580 {
00581     UAuthen_LSH* dlg = new UAuthen_LSH();
00582
00583     try
00584     {
00585         dlg->DoModal(3004);
00586     }
00587     catch(...)
00588     {
00589     }
00590
00591     delete dlg;
00592 }
00593
00594 void AuthenLSH::GetSettingsDesc(UStr& desc)
00595 {
00596     if( (int)gLSHPort <= 0 )
00597         desc << "Using default port";
00598     else
00599         desc << "Using port " << (int)gLSHPort;
00600
00601     if( (bool)gLSHKeychain )
00602         desc << " and key chain";
00603
00604     if( (bool)gLSHIdentity )
00605         desc << " and identity file";
00606 }
00607
00608 char* AuthenLSH::OnGetEnv(char* env)
00609 {
00610     if( strcmp(env, "LSH_SEND_IDENTITY") == 0 )
00611     {
00612         return (bool)gLSHIdentity ? (char*)"yes" : (char*)"no";
00613     }
00614     else if( strcmp(env, "LSH_ENCRYPTION") == 0 )
00615     {
00616         static char* encryptions[] =
00617         {
00618             "-call",
00619             "-c3des",
00620             "-ctwofish",
00621             "-ccast128",
00622             "-cserpent",
00623             "-crijndael",
00624             "-cblowfish",
00625             "-carcfour",
00626             "-cnone"
00627         };
00628
00629         return encryptions[(int)gLSHEncrypt];
00630     }
00631     else if( strcmp(env, "LSH_AUTHENTICATION") == 0 )
00632     {
00633         static char* authentications[] =
00634         {
00635             "",
00636             "-msha1",
00637             "-mmd5",
00638             "-mnone"
00639         };
00640
00641         return authentications[(int)gLSHAuthen];
00642     }
00643     else if( strcmp(env, "LSH_ZLIB") == 0 )
00644     {
00645         static char* zlib[] =
00646         {
00647             "",
00648             "-znone",
00649             "-zzlib"
00650         };
00651
00652         return zlib[(int)gLSHCompress];
00653     }
00654     else if(strcmp(env, "LSH_MORE_ARGS") == 0)
00655     {
00656         static UStr res;
00657
00658         res = "";
00659
00660         if( (bool)gLSHVerbose )
00661             res << " --verbose";
00662
00663         if( (bool)gLSHTrace )
00664             res << " --trace";
00665
00666         if( (bool)gLSHDebug )
00667             res << " --debug";
00668
00669         return res;
00670     }
00671     else if( strcmp(env, "LSH_PORT") == 0 )
00672     {
00673         int port = (int)gLSHPort;
00674         if( port > 0 )
00675         {
00676             static char portstr[10];
00677             sprintf(portstr, "%d", port);
00678
00679             return portstr;
00680         }
00681     }
00682
00683     return 0L;
00684 }
00685
00686 CPersistentInt AuthenLSH::gLSHEncrypt("P_LSHEncrypt", 0, kAddSettings);
00687 CPersistentInt AuthenLSH::gLSHAuthen("P_LSHAuthen", 0, kAddSettings);
00688 CPersistentInt AuthenLSH::gLSHCompress("P_LSHCompress", 2, kAddSettings);
00689 CPersistentInt AuthenLSH::gLSHPort("P_LSHPort", -1, kAddSettings);
00690 CPersistentBool AuthenLSH::gLSHVerbose("P_LSHVerbose", false, kAddSettings);
00691 CPersistentBool AuthenLSH::gLSHTrace("P_LSHTrace", false, kAddSettings);
00692 CPersistentBool AuthenLSH::gLSHDebug("P_LSHDebug", false, kAddSettings);
00693 CPersistentBool AuthenLSH::gLSHKeychain("P_LSHKeychain", false, kAddSettings);
00694 CPersistentBool AuthenLSH::gLSHIdentity("P_LSHIdentity", true, kAddSettings);
00695
00696 #else // !TARGET_RT_MAC_CFM
00697
00699 // Authentication: ssh
00700
00701 class AuthenSSH : public AuthenModel
00702 {
00703 public :
00704     AuthenSSH() {}
00705     virtual ~AuthenSSH() {}
00706
00707     virtual AuthenKind GetKind(void) const { return ssh; }
00708     virtual const char* GetToken(void) const { return "ssh"; }
00709
00710     virtual bool HasSettings(void) const { return true; }
00711     virtual bool HasHost(void) const { return true; }
00712     virtual bool HasUser(void) const { return true; }
00713
00714     virtual void DoSettings(void);
00715     virtual void GetSettingsDesc(UStr& desc);
00716
00717     virtual const char* OnGetEnv(char* env);
00718
00719     virtual void OnSetupEnv(void);
00720     virtual void OnRestoreEnv(void);
00721
00722     static PCStr gSSHName;
00723     static PCStr gSSHOptions;
00724     static CPersistentBool gRsaIdentity;
00725     static CMString gRsaIdentityFile;
00726     static PCStr gCurRsaIdentity;
00727
00728   static const char* RsaIdentityFile(void);
00729
00730 private:
00731   UStr oldRsh;
00732   UStr oldRsaOptions;
00733   UStr oldRsaIdentity;
00734 };
00735
00736 PCStr AuthenSSH::gSSHName("P_SSHName", "ssh", kAddSettings);
00737 PCStr AuthenSSH::gSSHOptions("P_SSHOptions", "", kAddSettings);
00738 CPersistentBool AuthenSSH::gRsaIdentity("P_RsaIdentity", false, kAddSettings);
00739 CMString AuthenSSH::gRsaIdentityFile(10, "P_RsaIdentityFiles");
00740 PCStr AuthenSSH::gCurRsaIdentity("P_CurrentRsaIdentity", 0L, kAddSettings);
00741
00742 const char* AuthenSSH::RsaIdentityFile(void)
00743 {
00744     if( gRsaIdentityFile.GetList().size() != 0 )
00745         gCurRsaIdentity = gRsaIdentityFile.GetList()[0];
00746
00747 #ifdef WIN32
00748     // Fill in a default value, if one empty slot
00749     if( gCurRsaIdentity.empty())
00750     {
00751         char* env = getenv( "HOME" );
00752         if( env != 0L )
00753         {
00754             char default_identity_folder[] = ".ssh/identity";
00755             char default_identity[ MAX_PATH ];
00756
00757             _makepath(default_identity, NULL, env, default_identity_folder, NULL);
00758             gCurRsaIdentity = default_identity;
00759         }
00760     }
00761 #endif
00762
00763     return gCurRsaIdentity.empty() ? 0L : (const char*)gCurRsaIdentity;
00764 }
00765
00766 class UAuthen_SSH : public UWidget
00767 {
00768     UDECLARE_DYNAMIC(UAuthen_SSH)
00769 public:
00770     UAuthen_SSH();
00771     virtual ~UAuthen_SSH() {}
00772
00773     enum
00774     {
00775         kOK = EV_COMMAND_START, // 0
00776         kCancel,            // 1
00777         kRSACheck,          // 2
00778         kRSAEdit,           // 3
00779         kRSABtn,            // 4
00780         kSSHCheck,          // 5
00781         kSSHName,           // 6
00782         kOptionsText,       // 7
00783         kOptionsCheck,      // 8
00784         kOptionsEdit,       // 9
00785         kSSHBtn         // 10
00786     };
00787
00788     virtual void DoDataExchange(bool fill);
00789
00790 protected:
00791     bool m_rsaidentity;
00792     UStr m_rsaidentityfile;
00793     UStr m_options;
00794
00795     ev_msg int OnCheckRSA(void);
00796     ev_msg int OnBtnRSA(void);
00797     ev_msg int OnCheckName(void);
00798     ev_msg int OnBtnName(void);
00799     ev_msg int OnCheckOptions(void);
00800
00801     UDECLARE_MESSAGE_MAP()
00802 };
00803
00804 UIMPLEMENT_DYNAMIC(UAuthen_SSH, UWidget)
00805
00806 UBEGIN_MESSAGE_MAP(UAuthen_SSH, UWidget)
00807     ON_UCOMMAND(kRSACheck, UAuthen_SSH::OnCheckRSA)
00808     ON_UCOMMAND(kRSABtn, UAuthen_SSH::OnBtnRSA)
00809     ON_UCOMMAND(kSSHCheck, UAuthen_SSH::OnCheckName)
00810     ON_UCOMMAND(kSSHBtn, UAuthen_SSH::OnBtnName)
00811     ON_UCOMMAND(kOptionsCheck, UAuthen_SSH::OnCheckOptions)
00812 UEND_MESSAGE_MAP()
00813
00814 UAuthen_SSH::UAuthen_SSH() : UWidget(::UEventGetWidID())
00815 {
00816 }
00817
00818 int UAuthen_SSH::OnCheckRSA(void)
00819 {
00820     m_rsaidentity = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRSACheck, 0L) != 0;
00821
00822     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSAEdit, m_rsaidentity), 0L);
00823     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRSABtn, m_rsaidentity), 0L);
00824
00825     return 0;
00826 }
00827
00828 int UAuthen_SSH::OnCheckName(void)
00829 {
00830     bool state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) != 0;
00831
00832     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHName, state), 0L);
00833     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSSHBtn, state), 0L);
00834
00835     return 0;
00836 }
00837
00838 int UAuthen_SSH::OnCheckOptions(void)
00839 {
00840     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L);
00841
00842     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsEdit, state), 0L);
00843     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOptionsText, state), 0L);
00844
00845     return 0;
00846 }
00847
00848 int UAuthen_SSH::OnBtnRSA(void)
00849 {
00850     UStr rsaidentityfile;
00851     UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &rsaidentityfile);
00852
00853     MultiFiles mf;
00854     if( !rsaidentityfile.empty() )
00855     {
00856         CStr uppath;
00857         CStr file;
00858
00859         if( SplitPath(rsaidentityfile, uppath, file) )
00860         {
00861             mf.newdir(uppath);
00862             mf.newfile(file);
00863         }
00864     }
00865
00866     if( !BrowserGetMultiFiles("Select the RSA identity file", mf, true) )
00867         return 0;
00868
00869     CvsArgs args(false);
00870     const char* dir = (*mf.begin()).add(args);
00871     char* const* argv = args.Argv();
00872
00873     UStr fullpath;
00874     fullpath = dir;
00875     if( !fullpath.endsWith(kPathDelimiter) )
00876         fullpath << kPathDelimiter;
00877
00878     fullpath << argv[0];
00879
00880     UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void*)fullpath.c_str());
00881
00882     return 0;
00883 }
00884
00885 int UAuthen_SSH::OnBtnName(void)
00886 {
00887     UStr SSHName;
00888     UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &SSHName);
00889
00890     MultiFiles mf;
00891     if( !SSHName.empty() )
00892     {
00893         CStr uppath;
00894         CStr file;
00895
00896         if( SplitPath(SSHName, uppath, file) )
00897         {
00898             mf.newdir(uppath);
00899             mf.newfile(file);
00900         }
00901     }
00902
00903     if( !BrowserGetMultiFiles("Select SSH", mf, true, kSelectExecutable) )
00904         return 0;
00905
00906     CvsArgs args(false);
00907     const char* dir = (*mf.begin()).add(args);
00908     char* const* argv = args.Argv();
00909
00910     UStr fullpath;
00911     fullpath = dir;
00912     if( !fullpath.endsWith(kPathDelimiter) )
00913         fullpath << kPathDelimiter;
00914
00915     fullpath << argv[0];
00916
00917     UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void*)fullpath.c_str());
00918
00919     return 0;
00920 }
00921
00922 void UAuthen_SSH::DoDataExchange(bool fill)
00923 {
00924     if( fill )
00925     {
00926         m_rsaidentity = AuthenSSH::gRsaIdentity;
00927         m_rsaidentityfile = AuthenSSH::RsaIdentityFile();
00928
00929         UStr helpMsg = "* Some Cygwin/OpenSSH options :\n"
00930             "-v : Verbose mode\n"
00931             "-C : Request compression\n"
00932             "-1 : Forces ssh to try protocol version 1 only\n"
00933             "-2 : Forces ssh to try protocol version 2 only\n"
00934             "-4 : Forces ssh to use IPv4 addresses only\n"
00935             "-6 : Forces ssh to use IPv6 addresses only";
00936
00937         UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsText, (void*)helpMsg.c_str());
00938
00939         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETFEATURE, kRSAEdit, (void*)USmartCombo::DefaultFeature);
00940         UEventSendMessage(GetWidID(), EV_SMARTCOMBO_SETITEMS, kRSAEdit, (void*)&AuthenSSH::gRsaIdentityFile);
00941
00942         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRSAEdit, 0L);
00943         const CMString::list_t& rsastrings = AuthenSSH::gRsaIdentityFile.GetList();
00944         CMString::list_t::const_iterator i;
00945         for(i = rsastrings.begin(); i != rsastrings.end(); ++i)
00946         {
00947             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRSAEdit, (void*)(const char*)*i);
00948         }
00949
00950         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRSACheck, m_rsaidentity), 0L);
00951         UEventSendMessage(GetWidID(), EV_SETTEXT, kRSAEdit, (void*)m_rsaidentityfile.c_str());
00952
00953         if( !AuthenSSH::gSSHName.empty() )
00954         {
00955             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kSSHCheck, 1), 0L);
00956             UEventSendMessage(GetWidID(), EV_SETTEXT, kSSHName, (void*)AuthenSSH::gSSHName.c_str());
00957         }
00958
00959         if( !AuthenSSH::gSSHOptions.empty() )
00960         {
00961             UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kOptionsCheck, 1), 0L);
00962             UEventSendMessage(GetWidID(), EV_SETTEXT, kOptionsEdit, (void*)AuthenSSH::gSSHOptions.c_str());
00963         }
00964
00965         OnCheckRSA();
00966         OnCheckName();
00967         OnCheckOptions();
00968     }
00969     else
00970     {
00971         AuthenSSH::gRsaIdentity = m_rsaidentity;
00972         if( m_rsaidentity )
00973         {
00974             UEventSendMessage(GetWidID(), EV_GETTEXT, kRSAEdit, &m_rsaidentityfile);
00975             AuthenSSH::gRsaIdentityFile.Insert(m_rsaidentityfile);
00976             AuthenSSH::gCurRsaIdentity = m_rsaidentityfile;
00977         }
00978
00979         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSSHCheck, 0L) )
00980             UEventSendMessage(GetWidID(), EV_GETTEXT, kSSHName, &AuthenSSH::gSSHName);
00981         else
00982             AuthenSSH::gSSHName = "";
00983
00984         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kOptionsCheck, 0L) )
00985             UEventSendMessage(GetWidID(), EV_GETTEXT, kOptionsEdit, &AuthenSSH::gSSHOptions);
00986         else
00987             AuthenSSH::gSSHOptions = "";
00988     }
00989 }
00990
00991 void AuthenSSH::DoSettings(void)
00992 {
00993     UAuthen_SSH* dlg = new UAuthen_SSH();
00994
00995     try
00996     {
00997 #ifdef WIN32
00998         dlg->DoModal(IDD_SSH);
00999 #endif
01000 #if TARGET_RT_MAC_MACHO
01001         dlg->DoModal(3005);
01002 #endif
01003     }
01004     catch(...)
01005     {
01006     }
01007
01008     delete dlg;
01009 }
01010
01011 void AuthenSSH::GetSettingsDesc(UStr& desc)
01012 {
01013     if( !gSSHOptions.empty() )
01014     {
01015         desc << "Using ";
01016         desc << gSSHOptions.c_str();
01017         desc << " ";
01018     }
01019
01020     if( (bool)gRsaIdentity )
01021     {
01022         if( gSSHOptions.empty() )
01023             desc << "Using ";
01024
01025         desc << "-i ";
01026         desc << RsaIdentityFile();
01027     }
01028 }
01029
01030 void AuthenSSH::OnSetupEnv(void)
01031 {
01032     AuthenModel::OnSetupEnv();
01033
01034     static UStr rsh;
01035     static UStr options;
01036     static UStr identity;
01037
01038     rsh = "CVS_RSH=";
01039
01040     oldRsh         = getenv("CVS_RSH");
01041     oldRsaOptions  = getenv("CVS_RSA_OPTIONS");
01042     oldRsaIdentity = getenv("CVS_RSA_IDENTITY");
01043
01044     if( gSSHName.empty() )
01045         rsh << "ssh";
01046     else
01047         rsh << gSSHName.c_str();
01048
01049     putenv(rsh);
01050
01051     if( !gSSHOptions.empty() )
01052     {
01053         options = "CVS_RSA_OPTIONS=";
01054         options << gSSHOptions.c_str();
01055
01056         putenv(options);
01057     }
01058
01059     if( (bool)gRsaIdentity )
01060     {
01061         identity = "CVS_RSA_IDENTITY=";
01062         identity << RsaIdentityFile();
01063
01064         putenv(identity);
01065     }
01066 }
01067
01068 void AuthenSSH::OnRestoreEnv(void)
01069 {
01070     AuthenModel::OnRestoreEnv();
01071
01072     if( oldRsh.empty() )
01073         unsetenv("CVS_RSH");
01074     else
01075         putenv(oldRsh);
01076
01077     if( oldRsaOptions.empty() )
01078         unsetenv("CVS_RSA_OPTIONS");
01079     else
01080         putenv(oldRsaOptions);
01081
01082     if( oldRsaIdentity.empty() )
01083         unsetenv("CVS_RSA_IDENTITY");
01084     else
01085         putenv(oldRsaIdentity);
01086 }
01087
01088 const char* AuthenSSH::OnGetEnv(char* env)
01089 {
01090     if( strcmp(env, "CVS_RSH") == 0 )
01091     {
01092         return gSSHName.empty() ? "ssh" : (char*)gSSHName.c_str();
01093     }
01094     else if( strcmp(env, "CVS_RSA_OPTIONS") == 0)
01095     {
01096         return gSSHOptions.empty() ? 0L : (char*)gSSHOptions.c_str();
01097     }
01098     else if( strcmp(env, "CVS_RSA_IDENTITY") == 0 && (bool)gRsaIdentity)
01099     {
01100         const char* tmp = RsaIdentityFile();
01101         if( tmp && *tmp )
01102         {
01103 #ifdef WIN32
01104             while( *tmp && iswspace(*tmp) )
01105 #else
01106             while( *tmp && isspace(*tmp) )
01107 #endif
01108                 tmp++;
01109
01110             return *tmp ? (char*)tmp : 0L;
01111         }
01112
01113         return 0L;
01114     }
01115
01116     return 0L;
01117 }
01118 #endif // qMacCvsPP
01119
01120 bool CvsPrefs::UseKeyChain(void) const
01121 {
01122 #if TARGET_RT_MAC_CFM
01123     return (bool)AuthenLSH::gLSHKeychain;
01124 #else
01125     return false;
01126 #endif
01127 }
01128
01130 // Authentication: pserver
01131
01132 class AuthenPserver : public AuthenModel
01133 {
01134 public :
01135     AuthenPserver() {}
01136     virtual ~AuthenPserver() {}
01137
01138     virtual AuthenKind GetKind(void) const { return pserver; }
01139     virtual const char* GetToken(void) const { return "pserver"; }
01140
01141     virtual bool HasSettings(void) const { return true; }
01142     virtual bool HasHost(void) const { return true; }
01143     virtual bool HasUser(void) const { return true; }
01144
01145     virtual bool HasLogin(void) const { return true; }
01146
01147     virtual void DoSettings(void);
01148     virtual void GetSettingsDesc(UStr& desc);
01149
01150     virtual const char* OnGetEnv(char* env);
01151
01152     virtual void OnSetupEnv(void);
01153     virtual void OnRestoreEnv(void);
01154
01155 private:
01156     UStr oldPserverPort;
01157 };
01158
01159 class UAuthen_Pserver : public UWidget
01160 {
01161     UDECLARE_DYNAMIC(UAuthen_Pserver)
01162 public:
01163     UAuthen_Pserver();
01164     virtual ~UAuthen_Pserver() {}
01165
01166     enum
01167     {
01168         kOK = EV_COMMAND_START, // 0
01169         kCancel,            // 1
01170         kCheckPort,         // 2
01171         kEditPort,          // 3
01172         kCheckProxy,        // 4
01173         kNameProxy,         // 5
01174         kEditProxy          // 6
01175     };
01176
01177     virtual void DoDataExchange(bool fill);
01178
01179 protected:
01180     int m_port;
01181     int m_pport;
01182     UStr m_pname;
01183
01184     ev_msg int OnCheckPort(void);
01185     ev_msg int OnCheckProxy(void);
01186
01187     UDECLARE_MESSAGE_MAP()
01188 };
01189
01190 UIMPLEMENT_DYNAMIC(UAuthen_Pserver, UWidget)
01191
01192 UBEGIN_MESSAGE_MAP(UAuthen_Pserver, UWidget)
01193     ON_UCOMMAND(kCheckPort, UAuthen_Pserver::OnCheckPort)
01194     ON_UCOMMAND(kCheckProxy,  UAuthen_Pserver::OnCheckProxy)
01195 UEND_MESSAGE_MAP()
01196
01197 UAuthen_Pserver::UAuthen_Pserver() : UWidget(::UEventGetWidID())
01198 {
01199 }
01200
01201 int UAuthen_Pserver::OnCheckPort(void)
01202 {
01203     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01204
01205     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01206
01207     return 0;
01208 }
01209
01210 int UAuthen_Pserver::OnCheckProxy(void)
01211 {
01212     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01213
01214     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, state), 0L);
01215     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, state), 0L);
01216
01217     return 0;
01218 }
01219
01220 void UAuthen_Pserver::DoDataExchange(bool fill)
01221 {
01222     if( fill )
01223     {
01224         m_port = gCvsPrefs.PserverPort();
01225
01226         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01227         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 2401 : m_port), 0L);
01228         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01229
01230         m_pport = gCvsPrefs.ProxyPort();
01231         m_pname = gCvsPrefs.ProxyHost();
01232         bool useProxy = gCvsPrefs.UseProxy();
01233
01234         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditProxy, useProxy), 0L);
01235         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kNameProxy, useProxy), 0L);
01236         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditProxy, m_pport), 0L);
01237         UEventSendMessage(GetWidID(), EV_SETTEXT, kNameProxy, (void*)(const char*)m_pname);
01238         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckProxy, useProxy), 0L);
01239     }
01240     else
01241     {
01242         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01243
01244         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01245         gCvsPrefs.SetPserverPort(state ? value : -1);
01246
01247         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckProxy, 0L);
01248         value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditProxy, 0L);
01249         UEventSendMessage(GetWidID(), EV_GETTEXT, kNameProxy, &m_pname);
01250         gCvsPrefs.SetUseProxy(state != 0);
01251
01252         if( state != 0 )
01253         {
01254             gCvsPrefs.SetProxyHost(m_pname);
01255             gCvsPrefs.SetProxyPort(value);
01256         }
01257     }
01258 }
01259
01260 void AuthenPserver::DoSettings(void)
01261 {
01262     UAuthen_Pserver* dlg = new UAuthen_Pserver();
01263
01264     try
01265     {
01266 #if qMacCvsPP
01267         dlg->DoModal(3002);
01268 #endif
01269 #ifdef WIN32
01270         dlg->DoModal(IDD_PSERVER);
01271 #endif
01272     }
01273     catch(...)
01274     {
01275     }
01276
01277     delete dlg;
01278 }
01279
01280 void AuthenPserver::GetSettingsDesc(UStr& desc)
01281 {
01282     if( gCvsPrefs.PserverPort() == -1 )
01283         desc << "Using default port and ";
01284     else
01285         desc << "Using port " << gCvsPrefs.PserverPort() << " and ";
01286
01287     if( !gCvsPrefs.UseProxy() )
01288         desc << "no proxy";
01289     else
01290         desc << "using proxy host " << gCvsPrefs.ProxyHost() << " with port " << gCvsPrefs.ProxyPort();
01291 }
01292
01293 void AuthenPserver::OnSetupEnv(void)
01294 {
01295     AuthenModel::OnSetupEnv();
01296
01297     static UStr options;
01298
01299     if( gCvsPrefs.PserverPort() != -1 )
01300     {
01301         oldPserverPort = getenv("CVS_PSERVER_PORT");
01302
01303         options = "CVS_PSERVER_PORT=";
01304         options << gCvsPrefs.PserverPort();
01305
01306         putenv(options);
01307     }
01308 }
01309
01310 void AuthenPserver::OnRestoreEnv(void)
01311 {
01312     AuthenModel::OnRestoreEnv();
01313
01314     if( gCvsPrefs.PserverPort() != -1 )
01315     {
01316         if( oldPserverPort.empty() )
01317                 unsetenv("CVS_PSERVER_PORT");
01318         else
01319                 putenv(oldPserverPort);
01320     }
01321 }
01322
01323 const char* AuthenPserver::OnGetEnv(char* env)
01324 {
01325     if( strcmp(env, "CVS_PSERVER_PORT") == 0 )
01326     {
01327         if( gCvsPrefs.PserverPort() != -1 )
01328         {
01329             static char port[10];
01330             sprintf(port, "%d", gCvsPrefs.PserverPort());
01331
01332             return port;
01333         }
01334
01335         return 0L;
01336     }
01337
01338     return 0L;
01339 }
01340
01342 // Authentication: rhosts
01343
01344 class AuthenRhosts : public AuthenModel
01345 {
01346 public :
01347     AuthenRhosts() {}
01348     virtual ~AuthenRhosts() {}
01349
01350     virtual AuthenKind GetKind(void) const { return rhosts; }
01351     virtual const char* GetToken(void) const { return "rhosts"; }
01352
01353     virtual bool HasSettings(void) const { return true; }
01354     virtual bool HasHost(void) const { return true; }
01355     virtual bool HasUser(void) const { return true; }
01356
01357     virtual void DoSettings(void);
01358     virtual void GetSettingsDesc(UStr& desc);
01359
01360     virtual const char* OnGetEnv(char* env);
01361
01362     virtual void OnSetupEnv(void);
01363     virtual void OnRestoreEnv(void);
01364 private:
01365     UStr oldRsa;
01366     UStr oldRhostPort;
01367     UStr oldServerName;
01368 };
01369
01370 class UAuthen_Rhosts : public UWidget
01371 {
01372     UDECLARE_DYNAMIC(UAuthen_Rhosts)
01373 public:
01374     UAuthen_Rhosts();
01375     virtual ~UAuthen_Rhosts() {}
01376
01377     enum
01378     {
01379         kOK = EV_COMMAND_START, // 0
01380         kCancel,            // 1
01381         kCheckPort,         // 2
01382         kEditPort,          // 3
01383         kCheckRSHName,      // 4
01384         kEditRSHName,       // 5
01385         kCheckServerName,   // 6
01386         kEditServerName     // 7
01387     };
01388
01389     virtual void DoDataExchange(bool fill);
01390
01391 protected:
01392     int m_port;
01393     UStr m_rshname;
01394     UStr m_servername;
01395
01396     ev_msg int OnCheckPort(void);
01397     ev_msg int OnCheckRshName(void);
01398     ev_msg int OnCheckServerName(void);
01399
01400     UDECLARE_MESSAGE_MAP()
01401 };
01402
01403 UIMPLEMENT_DYNAMIC(UAuthen_Rhosts, UWidget)
01404
01405 UBEGIN_MESSAGE_MAP(UAuthen_Rhosts, UWidget)
01406     ON_UCOMMAND(kCheckPort, UAuthen_Rhosts::OnCheckPort)
01407     ON_UCOMMAND(kCheckRSHName, UAuthen_Rhosts::OnCheckRshName)
01408     ON_UCOMMAND(kCheckServerName, UAuthen_Rhosts::OnCheckServerName)
01409 UEND_MESSAGE_MAP()
01410
01411 UAuthen_Rhosts::UAuthen_Rhosts() : UWidget(::UEventGetWidID())
01412 {
01413 }
01414
01415 int UAuthen_Rhosts::OnCheckPort(void)
01416 {
01417     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01418
01419     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01420
01421     return 0;
01422 }
01423
01424 int UAuthen_Rhosts::OnCheckRshName(void)
01425 {
01426     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01427
01428     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, state), 0L);
01429
01430     return 0;
01431 }
01432
01433 int UAuthen_Rhosts::OnCheckServerName(void)
01434 {
01435     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01436
01437     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, state), 0L);
01438
01439     return 0;
01440 }
01441
01442 void UAuthen_Rhosts::DoDataExchange(bool fill)
01443 {
01444     if( fill )
01445     {
01446         m_port = gCvsPrefs.RhostPort();
01447         m_rshname = gCvsPrefs.RshName();
01448         m_servername = gCvsPrefs.ServerName();
01449
01450         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01451         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01452         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01453
01454         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditRSHName, !m_rshname.empty()), 0L);
01455         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRSHName, (void*)m_rshname.c_str());
01456         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRSHName, !m_rshname.empty()), 0L);
01457
01458         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditServerName, !m_servername.empty()), 0L);
01459         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditServerName, (void*)m_servername.c_str());
01460         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckServerName, !m_servername.empty()), 0L);
01461     }
01462     else
01463     {
01464         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01465         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01466         gCvsPrefs.SetRhostPort(state ? value : -1);
01467
01468         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRSHName, 0L);
01469         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRSHName, &m_rshname);
01470         gCvsPrefs.SetRshName(state ? m_rshname.c_str() : "");
01471
01472         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckServerName, 0L);
01473         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditServerName, &m_servername);
01474         gCvsPrefs.SetServerName(state ? m_servername.c_str() : "");
01475     }
01476 }
01477
01478 void AuthenRhosts::DoSettings(void)
01479 {
01480     UAuthen_Rhosts* dlg = new UAuthen_Rhosts();
01481
01482     try
01483     {
01484 #if qMacCvsPP
01485         dlg->DoModal(3001);
01486 #endif
01487 #if WIN32
01488         dlg->DoModal(IDD_RSH);
01489 #endif
01490     }
01491     catch(...)
01492     {
01493     }
01494
01495     delete dlg;
01496 }
01497
01498 void AuthenRhosts::GetSettingsDesc(UStr& desc)
01499 {
01500     if( gCvsPrefs.RhostPort() == -1 )
01501         desc << "Using default port and ";
01502     else
01503         desc << "Using port " << gCvsPrefs.RhostPort() << " and ";
01504
01505     if( gCvsPrefs.RshName() == 0L )
01506         desc << "default shell name";
01507     else
01508         desc << "shell named " << gCvsPrefs.RshName();
01509 }
01510
01511 void AuthenRhosts::OnSetupEnv(void)
01512 {
01513     AuthenModel::OnSetupEnv();
01514
01515     static UStr rsh;
01516     static UStr port;
01517     static UStr server;
01518
01519     oldRsa        = getenv("CVS_RSH");
01520     oldRhostPort  = getenv("CVS_RCMD_PORT");
01521     oldServerName = getenv("CVS_SERVER");
01522
01523     if( gCvsPrefs.RshName() != 0L )
01524     {
01525         rsh = "CVS_RSH=";
01526         rsh << gCvsPrefs.RshName();
01527
01528         putenv(rsh);
01529     }
01530
01531     if( gCvsPrefs.RhostPort() != -1 )
01532     {
01533         port = "CVS_RCMD_PORT=";
01534         port << gCvsPrefs.RhostPort();
01535
01536         putenv(port);
01537     }
01538
01539     if( gCvsPrefs.ServerName() != 0L )
01540     {
01541         server = "CVS_SERVER=";
01542         server << gCvsPrefs.ServerName();
01543
01544         putenv(server);
01545     }
01546 }
01547
01548 void AuthenRhosts::OnRestoreEnv(void)
01549 {
01550     AuthenModel::OnRestoreEnv();
01551
01552     if( oldRsa.empty() )
01553         unsetenv("CVS_RSH");
01554     else
01555         putenv(oldRsa);
01556
01557     if( oldRhostPort.empty() )
01558         unsetenv("CVS_RCMD_PORT");
01559     else
01560         putenv(oldRhostPort);
01561
01562     if( oldServerName.empty() )
01563         unsetenv("CVS_SERVER");
01564     else
01565         putenv(oldServerName);
01566 }
01567
01568 const char* AuthenRhosts::OnGetEnv(char* env)
01569 {
01570     if( strcmp(env, "CVS_RSH") == 0 )
01571     {
01572         return (char*)gCvsPrefs.RshName();
01573     }
01574     else if( strcmp(env, "CVS_RCMD_PORT") == 0 )
01575     {
01576         if( gCvsPrefs.RhostPort() != -1 )
01577         {
01578             static char port[10];
01579             sprintf(port, "%d", gCvsPrefs.RhostPort());
01580
01581             return port;
01582         }
01583
01584         return 0L;
01585     }
01586     else if( strcmp(env, "CVS_SERVER") == 0 )
01587     {
01588         return (char*)gCvsPrefs.ServerName();
01589     }
01590
01591     return 0L;
01592 }
01593
01595 // Authentication: kserver
01596
01597 class AuthenKserver : public AuthenModel
01598 {
01599 public :
01600     AuthenKserver() {}
01601     virtual ~AuthenKserver() {}
01602
01603     virtual AuthenKind GetKind(void) const { return kserver; }
01604     virtual const char* GetToken(void) const { return "kserver"; }
01605
01606     virtual bool HasSettings(void) const { return true; }
01607     virtual bool HasHost(void) const { return true; }
01608     virtual bool HasUser(void) const { return true; }
01609
01610     virtual void DoSettings(void);
01611     virtual void GetSettingsDesc(UStr& desc);
01612
01613     virtual const char* OnGetEnv(char* env);
01614 };
01615
01616 class UAuthen_Kserver : public UWidget
01617 {
01618     UDECLARE_DYNAMIC(UAuthen_Kserver)
01619 public:
01620     UAuthen_Kserver();
01621     virtual ~UAuthen_Kserver() {}
01622
01623     enum
01624     {
01625         kOK = EV_COMMAND_START, // 0
01626         kCancel,            // 1
01627         kCheckPort,         // 2
01628         kEditPort           // 3
01629     };
01630
01631     virtual void DoDataExchange(bool fill);
01632
01633 protected:
01634     int m_port;
01635
01636     ev_msg int OnCheckPort(void);
01637
01638     UDECLARE_MESSAGE_MAP()
01639 };
01640
01641 UIMPLEMENT_DYNAMIC(UAuthen_Kserver, UWidget)
01642
01643 UBEGIN_MESSAGE_MAP(UAuthen_Kserver, UWidget)
01644     ON_UCOMMAND(kCheckPort, UAuthen_Kserver::OnCheckPort)
01645 UEND_MESSAGE_MAP()
01646
01647 UAuthen_Kserver::UAuthen_Kserver() : UWidget(::UEventGetWidID())
01648 {
01649 }
01650
01651 int UAuthen_Kserver::OnCheckPort(void)
01652 {
01653     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01654
01655     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, state), 0L);
01656
01657     return 0;
01658 }
01659
01660 void UAuthen_Kserver::DoDataExchange(bool fill)
01661 {
01662     if( fill )
01663     {
01664         m_port = gCvsPrefs.KserverPort();
01665
01666         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kEditPort, m_port != -1), 0L);
01667         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kEditPort, m_port == -1 ? 0 : m_port), 0L);
01668         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPort, m_port != -1), 0L);
01669     }
01670     else
01671     {
01672         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPort, 0L);
01673         int value = UEventSendMessage(GetWidID(), EV_GETINTEGER, kEditPort, 0L);
01674         gCvsPrefs.SetKserverPort(state ? value : -1);
01675     }
01676 }
01677
01678 void AuthenKserver::DoSettings(void)
01679 {
01680     UAuthen_Kserver* dlg = new UAuthen_Kserver();
01681
01682     try
01683     {
01684 #if qMacCvsPP
01685         dlg->DoModal(3003);
01686 #endif
01687     }
01688     catch(...)
01689     {
01690     }
01691
01692     delete dlg;
01693 }
01694
01695 void AuthenKserver::GetSettingsDesc(UStr& desc)
01696 {
01697     if( gCvsPrefs.KserverPort() == -1 )
01698         desc << "Using default port";
01699     else
01700         desc << "Using port " << gCvsPrefs.KserverPort();
01701 }
01702
01703 const char* AuthenKserver::OnGetEnv(char* env)
01704 {
01705     return 0L;
01706 }
01707
01709 // Authentication: ntserver
01710
01711 class AuthenNtserver : public AuthenModel
01712 {
01713 public :
01714     AuthenNtserver() {}
01715     virtual ~AuthenNtserver() {}
01716
01717     virtual AuthenKind GetKind(void) const { return ntserver; }
01718     virtual const char* GetToken(void) const { return "ntserver"; }
01719
01720     virtual bool HasSettings(void) const { return false; }
01721     virtual bool HasHost(void) const { return true; }
01722
01723     virtual const char* OnGetEnv(char* env);
01724 };
01725
01726 const char* AuthenNtserver::OnGetEnv(char* env)
01727 {
01728     return 0L;
01729 }
01730
01732 // Authentication: gserver
01733
01734 class AuthenGserver : public AuthenModel
01735 {
01736 public :
01737     AuthenGserver() {}
01738     virtual ~AuthenGserver() {}
01739
01740     virtual AuthenKind GetKind(void) const { return gserver; }
01741     virtual const char* GetToken(void) const { return "gserver"; }
01742
01743     virtual bool HasSettings(void) const { return true; }
01744     virtual bool HasHost(void) const { return true; }
01745
01746     virtual bool HasEncryption(void) const { return true; }
01747
01748     virtual void DoSettings(void);
01749     virtual void GetSettingsDesc(UStr& desc);
01750
01751     virtual const char* OnGetEnv(char* env);
01752 };
01753
01754 void AuthenGserver::GetSettingsDesc(UStr& desc)
01755 {
01756     if( gCvsPrefs.EncryptCommunication() )
01757         desc << "Encryption turned on";
01758     else
01759         desc << "Encryption turned off";
01760 }
01761
01762 const char* AuthenGserver::OnGetEnv(char* env)
01763 {
01764     return 0L;
01765 }
01766
01767 class UAuthen_Gserver : public UWidget
01768 {
01769     UDECLARE_DYNAMIC(UAuthen_Gserver)
01770 public:
01771     UAuthen_Gserver();
01772     virtual ~UAuthen_Gserver() {}
01773
01774     enum
01775     {
01776         kOK = EV_COMMAND_START, // 0
01777         kCancel,                // 1
01778         kCheckEncrypt           // 2
01779     };
01780
01781     virtual void DoDataExchange(bool fill);
01782
01783 protected:
01784     UDECLARE_MESSAGE_MAP()
01785 };
01786
01787 UIMPLEMENT_DYNAMIC(UAuthen_Gserver, UWidget)
01788
01789 UBEGIN_MESSAGE_MAP(UAuthen_Gserver, UWidget)
01790 UEND_MESSAGE_MAP()
01791
01792 UAuthen_Gserver::UAuthen_Gserver() : UWidget(::UEventGetWidID())
01793 {
01794 }
01795
01796 void UAuthen_Gserver::DoDataExchange(bool fill)
01797 {
01798     if( fill )
01799     {
01800         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01801     }
01802     else
01803     {
01804         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01805         gCvsPrefs.SetEncryptCommunication(state != 0);
01806     }
01807 }
01808
01809 void AuthenGserver::DoSettings(void)
01810 {
01811     UAuthen_Gserver* dlg = new UAuthen_Gserver();
01812
01813     try
01814     {
01815 #if WIN32
01816         dlg->DoModal(IDD_GSERVER);
01817 #endif
01818     }
01819     catch(...)
01820     {
01821     }
01822
01823     delete dlg;
01824 }
01825
01827 // Authentication: sspi
01828
01829 class AuthenSspi : public AuthenModel
01830 {
01831 public :
01832     AuthenSspi() {}
01833     virtual ~AuthenSspi() {}
01834
01835     virtual AuthenKind GetKind(void) const { return sspi; }
01836     virtual const char* GetToken(void) const { return "sspi"; }
01837
01838     virtual bool HasSettings(void) const { return true; }
01839     virtual bool HasHost(void) const { return true; }
01840     virtual bool HasUser(void) const { return true; }
01841
01842     virtual bool HasEncryption(void) const { return true; }
01843     virtual bool HasLogin(void) const { return true; }
01844
01845     virtual void DoSettings(void);
01846     virtual void GetSettingsDesc(UStr& desc);
01847
01848     virtual const char* OnGetEnv(char* env);
01849 };
01850
01851 void AuthenSspi::GetSettingsDesc(UStr& desc)
01852 {
01853     if( gCvsPrefs.EncryptCommunication() )
01854         desc << "Encryption turned on";
01855     else
01856         desc << "Encryption turned off";
01857 }
01858
01859 const char* AuthenSspi::OnGetEnv(char* env)
01860 {
01861     return 0L;
01862 }
01863
01864 class UAuthen_Sspi : public UWidget
01865 {
01866     UDECLARE_DYNAMIC(UAuthen_Sspi)
01867 public:
01868     UAuthen_Sspi();
01869     virtual ~UAuthen_Sspi() {}
01870
01871     enum
01872     {
01873         kOK = EV_COMMAND_START, // 0
01874         kCancel,                // 1
01875         kCheckEncrypt           // 2
01876     };
01877
01878     virtual void DoDataExchange(bool fill);
01879
01880 protected:
01881     UDECLARE_MESSAGE_MAP()
01882 };
01883
01884 UIMPLEMENT_DYNAMIC(UAuthen_Sspi, UWidget)
01885
01886 UBEGIN_MESSAGE_MAP(UAuthen_Sspi, UWidget)
01887 UEND_MESSAGE_MAP()
01888
01889 UAuthen_Sspi::UAuthen_Sspi() : UWidget(::UEventGetWidID())
01890 {
01891 }
01892
01893 void UAuthen_Sspi::DoDataExchange(bool fill)
01894 {
01895     if( fill )
01896     {
01897         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckEncrypt, gCvsPrefs.EncryptCommunication()), 0L);
01898     }
01899     else
01900     {
01901         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckEncrypt, 0L);
01902         gCvsPrefs.SetEncryptCommunication(state != 0);
01903     }
01904 }
01905
01906 void AuthenSspi::DoSettings(void)
01907 {
01908     UAuthen_Sspi* dlg = new UAuthen_Sspi();
01909
01910     try
01911     {
01912 #if WIN32
01913         dlg->DoModal(IDD_SSPI);
01914 #endif
01915     }
01916     catch(...)
01917     {
01918     }
01919
01920     delete dlg;
01921 }
01922
01924 // Authentication: server
01925
01926 class AuthenServer : public AuthenModel
01927 {
01928 public :
01929     AuthenServer() {}
01930     virtual ~AuthenServer() {}
01931
01932     virtual AuthenKind GetKind(void) const { return server; }
01933     virtual const char* GetToken(void) const { return "server"; }
01934
01935     virtual bool HasHost(void) const { return true; }
01936     virtual bool HasUser(void) const { return true; }
01937
01938     virtual const char* OnGetEnv(char* env);
01939 };
01940
01941 const char* AuthenServer::OnGetEnv(char* env)
01942 {
01943     return 0L;
01944 }
01945
01947 // Authentication instances
01948
01949 static AuthenLocal localInstance;
01950 static AuthenPserver pserverInstance;
01951 static AuthenRhosts rhostsInstance;
01952
01953 #ifndef WIN32
01954     static AuthenKserver kserverInstance;
01955 #else
01956     static AuthenNtserver ntserverInstance;
01957     static AuthenGserver gserverInstance;
01958     static AuthenSspi sspiInstance;
01959     static AuthenServer serverInstance;
01960 #endif
01961
01962 #if TARGET_RT_MAC_CFM
01963 static AuthenLSH sshInstance;
01964 #else
01965 static AuthenSSH sshInstance;
01966 #endif
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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     sspi,
00042     server
00043 } AuthenKind;
00044
00048 class Authen
00049 {
00050 public :
00051     Authen() {}
00052
00053     AuthenKind kind(void);
00054     const char* kindstr(void);
00055     void setkind(AuthenKind newkind);
00056
00057     static const char* kindToToken(AuthenKind k);
00058     static AuthenKind tokenToKind(const char* t);
00059     static short kindToNum(AuthenKind k);
00060     static AuthenKind numToKind(short num);
00061
00062     static bool parse_cvsroot(const char* CVSroot,
00063         UStr& theMethod, UStr& theUser, UStr& theHost, UStr& thePath);
00064
00065     // ":pserver:", ":kserver:"
00066     const char* token(void);
00067     static const char* token(AuthenKind k);
00068     static const char* skiptoken(const char* cvsroot);
00069 };
00070
00074 class AuthenModel
00075 {
00076 public :
00077     AuthenModel();
00078     virtual ~AuthenModel();
00079
00080     static std::vector<AuthenModel*>& GetAllInstances(void);
00081     static AuthenModel* GetInstance(AuthenKind k);
00082
00083     virtual AuthenKind GetKind(void) const = 0;
00084     virtual const char* GetToken(void) const = 0;
00085
00086     virtual bool HasSettings(void) const { return false; }
00087     virtual bool HasHost(void) const { return false; }
00088     virtual bool HasUser(void) const { return false; }
00089
00090     virtual bool HasEncryption(void) const { return false; }
00091     virtual bool HasLogin(void) const { return false; }
00092
00093     virtual void DoSettings(void) {}
00094     virtual void GetSettingsDesc(UStr& desc) { desc = ""; }
00095
00096     virtual const char* OnGetEnv(char* env) { return 0L; }
00097
00098     /* This is intended for "cvs release". This command spawns
00099     another cvs and use the output for doing the release. The
00100     problem is that it beats the cvsgui protocol and thus we need
00101     to set up the env. variable correctly */
00102     virtual void OnSetupEnv(void);
00103     virtual void OnRestoreEnv(void);
00104
00105 protected:
00106     static std::vector<AuthenModel*>* m_instances;
00107   /* we have not to change the HOME enviroment on unix */
00108 #ifndef qUnix
00109   static UStr oldHome;
00110 #endif
00111 };
00112
00113 extern Authen gAuthen;
00114
00115 #endif /* AUTHEN_H */
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 #ifdef WIN32
00023 #include "wincvs_winutil.h"
00024 #endif /* !WIN32 */
00025
00026
00027 #if TIME_WITH_SYS_TIME
00028 #   include <sys/time.h>
00029 #   include <time.h>
00030 #elif HAVE_SYS_TIME_H
00031 #   include <sys/time.h>
00032 #else
00033 #   include <time.h>
00034 #endif
00035
00036 #if qMacPP
00037 #   include "MacMisc.h"
00038 #endif
00039
00040 #ifndef _countof
00041 #   define _countof(array) (sizeof(array)/sizeof(array[0]))
00042 #endif
00043
00050 static void SafeCopy(char* buffer, const char* value, int bufferSize)
00051 {
00052     if( value && *value )
00053     {
00054         strncpy(buffer, value, bufferSize);
00055     }
00056     else
00057     {
00058         *buffer = 0;
00059     }
00060 }
00061
00063 const class KoNameColumn : public KiColumn
00064 {
00065 // Interfaces
00066 public:
00067 #ifdef WIN32
00068
00069     virtual void GetSetupData(LV_COLUMN* lvc) const
00070     {
00071         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00072         lvc->pszText = _T("Name");
00073         lvc->cx = 150;
00074         lvc->fmt = LVCFMT_LEFT;
00075     }
00076 #else
00077
00078     virtual void GetSetupData(LV_COLUMN* lvc) const
00079     {
00080         lvc->name = "Name";
00081         lvc->width = 210;
00082     }
00083 #endif
00084
00086     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00087     {
00088         SafeCopy(buffer, data->GetName(), bufferSize);
00089     }
00090
00092     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00093     {
00094         int res = stricmp(d1->GetName(), d2->GetName());
00095         return res;
00096     }
00097
00099     virtual bool IsDefaultAscending() const
00100     {
00101         return false;
00102     }
00103 } nameColumn;
00104
00106 const class KoPathColumn : public KiColumn
00107 {
00108 // Interfaces
00109 public:
00111 #ifdef WIN32
00112     virtual void GetSetupData(LV_COLUMN* lvc) const
00113     {
00114         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00115         lvc->pszText = _T("Path");
00116         lvc->cx = 150;
00117         lvc->fmt = LVCFMT_LEFT;
00118     }
00119 #else
00120
00121     virtual void GetSetupData(LV_COLUMN* lvc) const
00122     {
00123         lvc->name = "Path";
00124         lvc->width = 300;
00125     }
00126 #endif
00127
00129     virtual void GetText(KoColumnContext* context, EntnodeData* data, char* buffer, int bufferSize) const
00130     {
00131         UStr buf;
00132         const char* fullpath = data->GetFullPathName(buf);
00133         int len = context->m_path.length();
00134         fullpath += len;
00135
00136         if( *fullpath == '\\' )
00137         {
00138             fullpath++;
00139         }
00140
00141         SafeCopy(buffer, fullpath, bufferSize);
00142
00143         const char* name = data->GetName();
00144         if( name )
00145         {
00146             int lenName = strlen(name) + 1;
00147             int lenPath = strlen(buffer);
00148             if( lenPath <= lenName )
00149             {
00150                 strncpy(buffer, ".", bufferSize);
00151             }
00152             else
00153             {
00154                 buffer[lenPath - lenName] = 0;
00155             }
00156         }
00157     }
00158
00160     virtual int Compare(KoColumnContext* context, EntnodeData* d1, EntnodeData* d2) const
00161     {
00162         char text1[256];
00163         GetText(context, d1, text1, 256);
00164
00165         char text2[256];
00166         GetText(context, d2, text2, 256);
00167
00168         return stricmp(text1, text2);
00169     }
00170
00172     virtual bool IsDefaultAscending() const
00173     {
00174         return false;
00175     }
00176 } pathColumn;
00177
00179 const class KoRevisionColumn : public KiColumn
00180 {
00181 // Interfaces
00182 public:
00184 #ifdef WIN32
00185     virtual void GetSetupData(LV_COLUMN* lvc) const
00186     {
00187         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00188         lvc->pszText = _T("Rev.");
00189         lvc->cx = 50;
00190         lvc->fmt = LVCFMT_LEFT;
00191     }
00192 #else
00193
00194     virtual void GetSetupData(LV_COLUMN* lvc) const
00195     {
00196         lvc->name = "Rev.";
00197         lvc->width = 70;
00198     }
00199 #endif
00200
00202     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00203     {
00204         SafeCopy(buffer, (*data)[EntnodeFile::kVN], bufferSize);
00205     }
00206
00208     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00209     {
00210         const char* s1 = (*d1)[EntnodeFile::kVN];
00211         const char* s2 = (*d2)[EntnodeFile::kVN];
00212
00213         int res;
00214         if( s1 != 0L && s2 != 0L )
00215             res = revcmp(s1, s2);
00216         else
00217             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00218
00219         return res;
00220     }
00221
00223     static int revcmp(const char* rev1, const char* rev2)
00224     {
00225         if( rev1 == 0L && rev2 == 0L )
00226             return 0;
00227         else if( rev1 == 0L || rev2 == 0L )
00228             return rev1 == 0L ? -1 : 1;
00229
00230         CStr r1(rev1), r2(rev2);
00231         CStr q1, q2;
00232         char* tmp;
00233         int v1, v2;
00234
00235         if( (tmp = strchr(r1, '.')) != 0L )
00236         {
00237             tmp[0] = '\0';
00238             q1 = tmp + 1;
00239         }
00240
00241         v1 = atoi(r1);
00242
00243         if( (tmp = strchr(r2, '.')) != 0L )
00244         {
00245             tmp[0] = '\0';
00246             q2 = tmp + 1;
00247         }
00248
00249         v2 = atoi(r2);
00250
00251         if( v1 == v2 )
00252             return revcmp(q1.empty() ? (const char*)0L : q1.c_str(), q2.empty() ? (const char*)0L : q2.c_str());
00253
00254         return v1 < v2 ? -1 : 1;
00255     }
00256
00258     virtual bool IsDefaultAscending() const
00259     {
00260         return true;
00261     }
00262 } revisionColumn;
00263
00265 const class KoOptionColumn : public KiColumn
00266 {
00267 // Interfaces
00268 public:
00270 #ifdef WIN32
00271     virtual void GetSetupData(LV_COLUMN* lvc) const
00272     {
00273         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00274         lvc->pszText = _T("Option");
00275         lvc->cx = 50;
00276         lvc->fmt = LVCFMT_LEFT;
00277     }
00278 #else
00279
00280     virtual void GetSetupData(LV_COLUMN* lvc) const
00281     {
00282         lvc->name = "Option";
00283         lvc->width = 55;
00284     }
00285 #endif
00286
00288     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00289     {
00290         SafeCopy(buffer, (*data)[EntnodeFile::kOption], bufferSize);
00291     }
00292
00294     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00295     {
00296         const char* s1 = (*d1)[EntnodeFile::kOption];
00297         const char* s2 = (*d2)[EntnodeFile::kOption];
00298         int res;
00299         if( s1 != 0L && s2 != 0L )
00300             res = strcmp(s1, s2);
00301         else
00302             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00303
00304         return res;
00305     }
00306
00308     virtual bool IsDefaultAscending() const
00309     {
00310         return true;
00311     }
00312 } optionColumn;
00313
00315 const class KoStatusColumn : public KiColumn
00316 {
00317 // Interfaces
00318 public:
00320 #ifdef WIN32
00321     virtual void GetSetupData(LV_COLUMN* lvc) const
00322     {
00323         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00324         lvc->pszText = _T("Status");
00325         lvc->cx = 100;
00326         lvc->fmt = LVCFMT_LEFT;
00327     }
00328 #else
00329
00330     virtual void GetSetupData(LV_COLUMN* lvc) const
00331     {
00332         lvc->name = "Status";
00333         lvc->width = 70;
00334     }
00335 #endif
00336
00338     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00339     {
00340         SafeCopy(buffer, (*data)[EntnodeData::kStatus], bufferSize);
00341     }
00342
00344     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00345     {
00346         int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
00347         return res;
00348     }
00349
00351     virtual bool IsDefaultAscending() const
00352     {
00353         return true;
00354     }
00355 } statusColumn;
00356
00358 const class KoTagColumn : public KiColumn
00359 {
00360 // Interfaces
00361 public:
00363 #ifdef WIN32
00364     virtual void GetSetupData(LV_COLUMN* lvc) const
00365     {
00366         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00367         lvc->pszText = _T("Tag");
00368         lvc->cx = 150;
00369         lvc->fmt = LVCFMT_LEFT;
00370     }
00371 #else
00372
00373     virtual void GetSetupData(LV_COLUMN* lvc) const
00374     {
00375         lvc->name = "Tag";
00376         lvc->width = 90;
00377     }
00378 #endif
00379
00381     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00382     {
00383         SafeCopy(buffer, (*data)[EntnodeFile::kTag], bufferSize);
00384     }
00385
00387     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00388     {
00389         const char* s1 = (*d1)[EntnodeFile::kTag];
00390         const char* s2 = (*d2)[EntnodeFile::kTag];
00391         int res;
00392         if( s1 != 0L && s2 != 0L )
00393             res = strcmp(s1, s2);
00394         else
00395             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00396
00397         return res;
00398
00399     }
00400
00402     virtual bool IsDefaultAscending() const
00403     {
00404         return true;
00405     }
00406 } tagColumn;
00407
00409 const class KoDateColumn : public KiColumn
00410 {
00411 // Interfaces
00412 public:
00414 #ifdef WIN32
00415     virtual void GetSetupData(LV_COLUMN* lvc) const
00416     {
00417         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00418         lvc->pszText = _T("Timestamp");
00419         lvc->cx = (IsLargeFonts()) ? 170 : 150;
00420         lvc->fmt = LVCFMT_LEFT;
00421     }
00422 #else
00423
00424     virtual void GetSetupData(LV_COLUMN* lvc) const
00425     {
00426         lvc->name = "Timestamp";
00427         lvc->width = 135;
00428     }
00429 #endif
00430
00432     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00433     {
00434         SafeCopy(buffer, (*data)[EntnodeFile::kTS], bufferSize);
00435     }
00436
00438     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00439     {
00440         const char* s1 = (*d1)[EntnodeFile::kTS];
00441         const char* s2 = (*d2)[EntnodeFile::kTS];
00442         int res = 0;
00443
00444         if( s1 != 0L && s2 != 0L )
00445         {
00446             time_t t1 = GetDateTime(s1);
00447             time_t t2 = GetDateTime(s2);
00448             res = t1 < t2 ? -1 : (t1 > t2 ? 1 : 0);
00449         }
00450         else
00451             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00452
00453         return res;
00454     }
00455
00457     virtual bool IsDefaultAscending() const
00458     {
00459         return true;
00460     }
00461 } dateColumn;
00462
00464 const class KoConflictColumn : public KiColumn
00465 {
00466 // Interfaces
00467 public:
00469 #ifdef WIN32
00470     virtual void GetSetupData(LV_COLUMN* lvc) const
00471     {
00472         lvc->mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
00473         lvc->pszText = _T("Conflict");
00474         lvc->cx = 150;
00475         lvc->fmt = LVCFMT_LEFT;
00476     }
00477 #else
00478
00479     virtual void GetSetupData(LV_COLUMN* lvc) const
00480     {
00481         lvc->name = "Conflict";
00482         lvc->width = 100;
00483     }
00484 #endif
00485
00487     virtual void GetText(KoColumnContext* /*context*/, EntnodeData* data, char* buffer, int bufferSize) const
00488     {
00489         SafeCopy(buffer, data->GetConflict(), bufferSize);
00490     }
00491
00493     virtual int Compare(KoColumnContext* /*context*/, EntnodeData* d1, EntnodeData* d2) const
00494     {
00495         const char* s1 = d1->GetConflict();
00496         const char* s2 = d2->GetConflict();
00497         int res;
00498         if( s1 != 0L && s2 != 0L )
00499             res = strcmp(s1, s2);
00500         else
00501             res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
00502
00503         return res;
00504     }
00505
00507     virtual bool IsDefaultAscending() const
00508     {
00509         return true;
00510     }
00511 } conflictColumn;
00512
00514 static const KiColumn* columnsRegular[] = {
00515     &nameColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
00516 };
00517
00518 static const int typesRegular[] = {
00519     EntnodeData::kName, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
00520     EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
00521 };
00522
00523 static const KiColumn* columnsRecursive[] = {
00524     &nameColumn, &pathColumn, &revisionColumn, &optionColumn, &statusColumn, &tagColumn, &dateColumn, &conflictColumn
00525 };
00526
00527 static const int typesRecursive[] = {
00528     EntnodeData::kName, EntnodeFile::kPath, EntnodeFile::kVN, EntnodeFile::kOption, EntnodeData::kStatus,
00529     EntnodeFile::kTag, EntnodeFile::kTS, EntnodeFile::kConflict
00530 };
00531
00533 class KoRegularModel : public KiColumnModel
00534 {
00535 // Interfaces
00536 public:
00537     virtual const KiColumn* GetAt(int pos) const
00538     {
00539         return columnsRegular[pos];
00540     }
00541
00542     virtual int GetType(int pos) const
00543     {
00544         return typesRegular[pos];
00545     }
00546
00547     virtual int GetCount() const
00548     {
00549         return _countof(columnsRegular);
00550     }
00551 } modelRegular;
00552
00554 class KoRecursiveModel : public KiColumnModel
00555 {
00556 // Interfaces
00557 public:
00558     virtual const KiColumn* GetAt(int pos) const
00559     {
00560         return columnsRecursive[pos];
00561     }
00562
00563     virtual int GetType(int pos) const
00564     {
00565         return typesRecursive[pos];
00566     }
00567
00568     virtual int GetCount() const
00569     {
00570         return _countof(columnsRecursive);
00571     }
00572 } modelRecursive;
00573
00575 // Instantiation
00576
00577 KiColumnModel* KiColumnModel::GetRecursiveModel()
00578 {
00579     return &modelRecursive;
00580 }
00581
00582 KiColumnModel* KiColumnModel::GetRegularModel()
00583 {
00584     return &modelRegular;
00585 }
00586
00587 int KiColumnModel::GetColumn(int type) const
00588 {
00589     int numColumns = GetCount();
00590     for(int i = 0; i < numColumns; i++)
00591     {
00592         if(type == GetType(i))
00593             return i;
00594     }
00595
00596     return 0;
00597 }
00598
00599 #ifdef WIN32
00600 int CALLBACK _Compare(LPARAM data1, LPARAM data2, LPARAM data)
00601 #else
00602 int _Compare(void* data1, void* data2, void* data)
00603 #endif
00604 {
00605     int res = 0;
00606     bool fOneDirOnly = false;
00607
00608     EntnodeData* d1 = (EntnodeData*)data1;
00609     EntnodeData* d2 = (EntnodeData*)data2;
00610
00611     const CSortParam* pSortParam = (CSortParam*)data;
00612
00613     //  Group sub dirs ?
00614     if( pSortParam->m_fGroupSubDir )
00615     {
00616         int d1IsDir = d1->GetType()==ENT_SUBDIR;
00617         int d2IsDir = d2->GetType()==ENT_SUBDIR;
00618
00619         if( (d1IsDir + d2IsDir) == 1)
00620         {
00621             //  One (and only one of them) is a directory
00622             fOneDirOnly = true;
00623             res = d1IsDir ? -1 : 1;
00624         }
00625     }
00626
00627     if( !res )
00628     {
00629         res = pSortParam->m_column->Compare(pSortParam->m_context, d1, d2);
00630     }
00631
00632     if( res==0 && pSortParam->m_column != pSortParam->m_columnAlt )
00633         res = pSortParam->m_columnAlt->Compare(pSortParam->m_context, d1, d2);
00634     else if( !fOneDirOnly )
00635         res = pSortParam->m_fAccendant ? -res : res;
00636
00637     return res;
00638 }
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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
00025 class KoColumnContext
00026 {
00027 // Attributes
00028 public:
00029     UStr m_path;
00031 public:
00032     KoColumnContext(const char* path)
00033     : m_path(path)
00034     {}
00035 };
00036
00037 #ifndef WIN32
00038     struct LV_COLUMN
00039     {
00040         int width;
00041         const char* name;
00042     };
00043 #endif
00044
00046 class KiColumn
00047 {
00048 // Interfaces
00049 public:
00051     virtual void GetSetupData(LV_COLUMN* lvc) const = 0;
00052
00054     virtual bool IsDefaultAscending() const = 0;
00055
00057     virtual void GetText(KoColumnContext* context, EntnodeData* data, char* buffer, int buffersize) const = 0;
00058
00060     virtual int Compare(KoColumnContext* context, EntnodeData* d1, EntnodeData* d2) const = 0;
00061 };
00062
00064 class KiColumnModel
00065 {
00066 // Interfaces
00067 public:
00069     virtual const KiColumn* GetAt(int pos) const = 0;
00070
00072     virtual int GetType(int pos) const = 0;
00073
00075     virtual int GetCount() const = 0;
00076
00078     virtual int GetColumn(int type) const;
00079
00080 // Factory methods
00081 public:
00082     static KiColumnModel* GetRecursiveModel();
00083     static KiColumnModel* GetRegularModel();
00084 };
00085
00087 struct CSortParam
00088 {
00089     CSortParam (bool fAccendant, bool fGroupSubDir, const KiColumn* column, const KiColumn* columnAlt, KoColumnContext* context)
00090     : m_column(column)
00091     , m_columnAlt(columnAlt)
00092     , m_context(context)
00093     , m_fAccendant(fAccendant)
00094     , m_fGroupSubDir(fGroupSubDir)
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
00105 #ifdef WIN32
00106 int CALLBACK _Compare(LPARAM data1, LPARAM data2, LPARAM data);
00107 #else
00108 int _Compare(void* data1, void* data2, void* data);
00109 #endif
00110
00111 #endif
00112 // __BROWSEVIEW_COLUMN_H__
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


common/BrowseViewHandlers.cpp Source File

common/BrowseViewHandlers.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 2002
00019 */
00020
00021 // BrowseViewHandlers.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef WIN32
00027 #include "wincvs.h"
00028 #endif /* !WIN32 */
00029
00030 #include "BrowseViewHandlers.h"
00031 #include "PromptFiles.h"
00032 #include "MultiFiles.h"
00033
00034
00035
00041 KiSelectionHandler::KiSelectionHandler(const char* strCommand, bool needSelection /*= true*/, bool needViewReset /*= false*/)
00042     : m_strCommand(strCommand), m_pmf(NULL), m_selType(kSelNone),
00043       m_autoDelete(false), m_needSelection(needSelection), m_needViewReset(needViewReset)
00044 {
00045 }
00046
00047 KiSelectionHandler::~KiSelectionHandler()
00048 {
00049     if( m_autoDelete && m_pmf )
00050     {
00051         delete m_pmf;
00052     }
00053 }
00054
00059 kSelType KiSelectionHandler::GetSelType() const
00060 {
00061     return m_selType;
00062 }
00063
00068 bool KiSelectionHandler::GetNeedSelection() const
00069 {
00070     return m_needSelection;
00071 }
00072
00077 bool KiSelectionHandler::GetNeedViewReset() const
00078 {
00079     return m_needViewReset;
00080 }
00081
00087 void KiSelectionHandler::OnFolder(const char* fullpath)
00088 {
00089     m_selType = kSelDir;
00090     if( fullpath )
00091     {
00092         m_pmf = new MultiFiles;
00093         if( m_pmf )
00094         {
00095             m_autoDelete = true;
00096             m_pmf->newdir(fullpath);
00097         }
00098     }
00099 }
00100
00106 void KiSelectionHandler::OnFiles(MultiFiles* pmf)
00107 {
00108     m_selType = kSelFiles;
00109     m_pmf = pmf;
00110 }
00111
00117 MultiFiles* KiSelectionHandler::GetSelection()
00118 {
00119     if( !m_pmf && m_needSelection )
00120     {
00121         switch( m_selType )
00122         {
00123         case kSelFiles:
00124             m_pmf = new MultiFiles;
00125             if( m_pmf )
00126             {
00127                 m_autoDelete = true;
00128
00129                 CStr strPrompt;
00130                 strPrompt << _i18n("Select files for ");
00131                 strPrompt << m_strCommand;
00132
00133                 if( !BrowserGetMultiFiles(strPrompt, *m_pmf, false) )
00134                 {
00135                     delete m_pmf;
00136                     m_pmf = NULL;
00137                 }
00138             }
00139             break;
00140         case kSelDir:
00141             m_pmf = new MultiFiles;
00142             if( m_pmf )
00143             {
00144                 CStr strPrompt;
00145                 strPrompt << _i18n("Select directory to ");
00146                 strPrompt << m_strCommand;
00147
00148                 CStr dir;
00149                 if( BrowserGetDirectory(strPrompt, dir) )
00150                 {
00151                     m_pmf->newdir(dir);
00152                 }
00153                 else
00154                 {
00155                     delete m_pmf;
00156                     m_pmf = NULL;
00157                 }
00158             }
00159             break;
00160         default:
00161 #ifdef WIN32
00162             ASSERT(FALSE);  // type must be set to something if m_needSelection is true
00163 #endif
00164             break;
00165         }
00166     }
00167
00168     return m_pmf;
00169 }
00170
00171 bool KiSelectionHandler::NeedsNormalize()
00172 {
00173     return false;
00174 }
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.h"
00021 #include "CPStr.h"
00022 #include "cvsgui_i18n.h"
00023
00025 typedef enum
00026 {
00027     kSelNone,
00028     kSelFiles,
00029     kSelDir
00030 } kSelType;
00031
00032 // Forward declaration
00033 class MultiFiles;
00034
00052 class KiSelectionHandler
00053 {
00054 private:
00055     CStr m_strCommand;
00057     MultiFiles* m_pmf;
00058     kSelType m_selType;
00060     bool m_autoDelete;
00062 protected:
00063     bool m_needSelection;
00064     bool m_needViewReset;
00066 public:
00067     KiSelectionHandler(const char* strCommand, bool needSelection = true, bool needResetView = false);
00068     virtual ~KiSelectionHandler();
00069
00070     kSelType GetSelType() const;
00071     bool GetNeedSelection() const;
00072     bool GetNeedViewReset() const;
00073
00074     virtual void OnFolder(const char* fullpath) = 0;
00075     virtual void OnFiles(MultiFiles* pmf) = 0;
00076     virtual MultiFiles* GetSelection();
00077     virtual bool NeedsNormalize();
00078 };
00079
00081 class KoMoveToTrashHandler : public KiSelectionHandler
00082 {
00083 public:
00084     KoMoveToTrashHandler()
00085         : KiSelectionHandler(_i18n("Move To Trash"), true, true)
00086     {}
00087
00088     virtual void OnFolder(const char* fullpath)
00089     { /* ignore */ }
00090
00091     virtual void OnFiles(MultiFiles* pmf)
00092     {
00093         KiSelectionHandler::OnFiles(pmf);
00094         CvsCmdMoveToTrash(*this);
00095     }
00096 };
00097
00099 class KoUpdateMoveToTrashHandler : public KiSelectionHandler
00100 {
00101 // Attributes
00102     bool m_isFolders;
00103     bool m_isFiles;
00104
00105 public:
00106     KoUpdateMoveToTrashHandler()
00107         : KiSelectionHandler(_i18n("Update Move To Trash")), m_isFolders(false), m_isFiles(false)
00108     {}
00109
00110     virtual void OnFolder(const char* fullpath)
00111     {
00112         m_isFolders = true;
00113     }
00114
00115     virtual void OnFiles(MultiFiles* /*pmf*/)
00116     {
00117         m_isFiles = true;
00118     }
00119
00120     bool IsEnabled() const
00121     {
00122         return !m_isFolders && m_isFiles;
00123     }
00124 };
00125
00127 class KoCreateTagHandler : public KiSelectionHandler
00128 {
00129 public:
00130     KoCreateTagHandler()
00131         : KiSelectionHandler(_i18n("Create Tag"))
00132     {}
00133
00134     virtual void OnFolder(const char* fullpath)
00135     {
00136         KiSelectionHandler::OnFolder(fullpath);
00137         CvsCmdTagCreate(*this);
00138     }
00139
00140     virtual void OnFiles(MultiFiles* pmf)
00141     {
00142         KiSelectionHandler::OnFiles(pmf);
00143         CvsCmdTagCreate(*this);
00144     }
00145 };
00146
00148 class KoDeleteTagHandler : public KiSelectionHandler
00149 {
00150 public:
00151     KoDeleteTagHandler()
00152         : KiSelectionHandler(_i18n("Delete Tag"))
00153     {}
00154
00155     virtual void OnFolder(const char* fullpath)
00156     {
00157         KiSelectionHandler::OnFolder(fullpath);
00158         CvsCmdTagDelete(*this);
00159     }
00160
00161     virtual void OnFiles(MultiFiles* pmf)
00162     {
00163         KiSelectionHandler::OnFiles(pmf);
00164         CvsCmdTagDelete(*this);
00165     }
00166 };
00167
00169 class KoBranchTagHandler : public KiSelectionHandler
00170 {
00171 public:
00172     KoBranchTagHandler()
00173         : KiSelectionHandler(_i18n("Branch"))
00174     {}
00175
00176     virtual void OnFolder(const char* fullpath)
00177     {
00178         KiSelectionHandler::OnFolder(fullpath);
00179         CvsCmdTagBranch(*this);
00180     }
00181
00182     virtual void OnFiles(MultiFiles* pmf)
00183     {
00184         KiSelectionHandler::OnFiles(pmf);
00185         CvsCmdTagBranch(*this);
00186     }
00187 };
00188
00190 class KoEditHandler : public KiSelectionHandler
00191 {
00192 public:
00193     KoEditHandler()
00194         : KiSelectionHandler(_i18n("Edit"))
00195     {}
00196
00197     virtual void OnFolder(const char* fullpath)
00198     {
00199         KiSelectionHandler::OnFolder(fullpath);
00200         CvsCmdEdit(*this);
00201     }
00202
00203     virtual void OnFiles(MultiFiles* pmf)
00204     {
00205         KiSelectionHandler::OnFiles(pmf);
00206         CvsCmdEdit(*this);
00207     }
00208 };
00209
00211 class KoReservedEditHandler : public KiSelectionHandler
00212 {
00213 public:
00214     KoReservedEditHandler()
00215         : KiSelectionHandler(_i18n("Reserved Edit"))
00216     {}
00217
00218     virtual void OnFolder(const char* fullpath)
00219     {
00220         KiSelectionHandler::OnFolder(fullpath);
00221         CvsCmdEdit(*this, kEditReserved);
00222     }
00223
00224     virtual void OnFiles(MultiFiles* pmf)
00225     {
00226         KiSelectionHandler::OnFiles(pmf);
00227         CvsCmdEdit(*this, kEditReserved);
00228     }
00229 };
00230
00232 class KoForceEditHandler : public KiSelectionHandler
00233 {
00234 public:
00235     KoForceEditHandler()
00236         : KiSelectionHandler(_i18n("Force Edit"))
00237     {}
00238
00239     virtual void OnFolder(const char* fullpath)
00240     {
00241         KiSelectionHandler::OnFolder(fullpath);
00242         CvsCmdEdit(*this, kEditForce);
00243     }
00244
00245     virtual void OnFiles(MultiFiles* pmf)
00246     {
00247         KiSelectionHandler::OnFiles(pmf);
00248         CvsCmdEdit(*this, kEditForce);
00249     }
00250 };
00251
00253 class KoUneditHandler : public KiSelectionHandler
00254 {
00255 public:
00256     KoUneditHandler()
00257         : KiSelectionHandler(_i18n("Unedit"))
00258     {}
00259
00260     virtual void OnFolder(const char* fullpath)
00261     {
00262         KiSelectionHandler::OnFolder(fullpath);
00263         CvsCmdUnedit(*this);
00264     }
00265
00266     virtual void OnFiles(MultiFiles* pmf)
00267     {
00268         KiSelectionHandler::OnFiles(pmf);
00269         CvsCmdUnedit(*this);
00270     }
00271 };
00272
00274 class KoReleaseHandler : public KiSelectionHandler
00275 {
00276 public:
00277     KoReleaseHandler()
00278         : KiSelectionHandler(_i18n("Release"))
00279     {}
00280
00281     virtual void OnFolder(const char* fullpath)
00282     {
00283         KiSelectionHandler::OnFolder(fullpath);
00284         CvsCmdRelease(*this);
00285     }
00286
00287     virtual void OnFiles(MultiFiles* /*pmf*/)
00288     {   }
00289 };
00290
00292 class KoWatchersHandler : public KiSelectionHandler
00293 {
00294 public:
00295     KoWatchersHandler()
00296         : KiSelectionHandler(_i18n("Watchers"))
00297     {}
00298
00299     virtual void OnFolder(const char* fullpath)
00300     {
00301         KiSelectionHandler::OnFolder(fullpath);
00302         CvsCmdWatchers(*this);
00303     }
00304
00305     virtual void OnFiles(MultiFiles* pmf)
00306     {
00307         KiSelectionHandler::OnFiles(pmf);
00308         CvsCmdWatchers(*this);
00309     }
00310 };
00311
00313 class KoEditorsHandler : public KiSelectionHandler
00314 {
00315 public:
00316     KoEditorsHandler()
00317         : KiSelectionHandler(_i18n("Editors"))
00318     {}
00319
00320     virtual void OnFolder(const char* fullpath)
00321     {
00322         KiSelectionHandler::OnFolder(fullpath);
00323         CvsCmdEditors(*this);
00324     }
00325
00326     virtual void OnFiles(MultiFiles* pmf)
00327     {
00328         KiSelectionHandler::OnFiles(pmf);
00329         CvsCmdEditors(*this);
00330     }
00331 };
00332
00334 class KoWatchOnHandler : public KiSelectionHandler
00335 {
00336 public:
00337     KoWatchOnHandler()
00338         : KiSelectionHandler(_i18n("Watch On"))
00339     {}
00340
00341     virtual void OnFolder(const char* fullpath)
00342     {
00343         KiSelectionHandler::OnFolder(fullpath);
00344         CvsCmdWatchOn(*this);
00345     }
00346
00347     virtual void OnFiles(MultiFiles* pmf)
00348     {
00349         KiSelectionHandler::OnFiles(pmf);
00350         CvsCmdWatchOn(*this);
00351     }
00352 };
00353
00355 class KoWatchOffHandler : public KiSelectionHandler
00356 {
00357 public:
00358     KoWatchOffHandler()
00359         : KiSelectionHandler(_i18n("Watch Off"))
00360     {}
00361
00362     virtual void OnFolder(const char* fullpath)
00363     {
00364         KiSelectionHandler::OnFolder(fullpath);
00365         CvsCmdWatchOff(*this);
00366     }
00367
00368     virtual void OnFiles(MultiFiles* pmf)
00369     {
00370         KiSelectionHandler::OnFiles(pmf);
00371         CvsCmdWatchOff(*this);
00372     }
00373 };
00374
00376 class KoDiffHandler : public KiSelectionHandler
00377 {
00378 public:
00379     KoDiffHandler()
00380         : KiSelectionHandler(_i18n("Diff"))
00381     {}
00382
00383     virtual void OnFolder(const char* fullpath)
00384     {
00385         KiSelectionHandler::OnFolder(fullpath);
00386         CvsCmdDiff(*this, kDiffFolder);
00387     }
00388
00389     virtual void OnFiles(MultiFiles* pmf)
00390     {
00391         KiSelectionHandler::OnFiles(pmf);
00392         CvsCmdDiff(*this, kDiffFile);
00393     }
00394 };
00395
00397 class KoGraphDiffHandler : public KiSelectionHandler
00398 {
00399 public:
00400     KoGraphDiffHandler()
00401         : KiSelectionHandler(_i18n("Diff"))
00402     {}
00403
00404     virtual void OnFolder(const char* /*fullpath*/)
00405     {   }
00406
00407     virtual void OnFiles(MultiFiles* pmf)
00408     {
00409         KiSelectionHandler::OnFiles(pmf);
00410         CvsCmdDiff(*this, kDiffGraph);
00411     }
00412 };
00413
00415 class KoLogHandler : public KiSelectionHandler
00416 {
00417 public:
00418     KoLogHandler()
00419         : KiSelectionHandler(_i18n("Log"))
00420     {}
00421
00422     virtual void OnFolder(const char* fullpath)
00423     {
00424         KiSelectionHandler::OnFolder(fullpath);
00425         CvsCmdLog(*this);
00426     }
00427
00428     virtual void OnFiles(MultiFiles* pmf)
00429     {
00430         KiSelectionHandler::OnFiles(pmf);
00431         CvsCmdLog(*this);
00432     }
00433 };
00434
00436 class KoGraphHandler : public KiSelectionHandler
00437 {
00438 public:
00439     KoGraphHandler()
00440         : KiSelectionHandler(_i18n("Graph"))
00441     {}
00442
00443     virtual void OnFolder(const char* /*fullpath*/)
00444     {
00445         /*we avoid processing directory*/
00446     }
00447
00448     virtual void OnFiles(MultiFiles* pmf)
00449     {
00450         KiSelectionHandler::OnFiles(pmf);
00451         CvsCmdLog(*this, true);
00452     }
00453
00454     virtual bool NeedsNormalize()
00455     {
00456         return true;
00457     }
00458 };
00459
00461 class KoStatusHandler : public KiSelectionHandler
00462 {
00463 public:
00464     KoStatusHandler()
00465         : KiSelectionHandler(_i18n("Status"))
00466     {}
00467
00468     virtual void OnFolder(const char* fullpath)
00469     {
00470         KiSelectionHandler::OnFolder(fullpath);
00471         CvsCmdStatus(*this);
00472     }
00473
00474     virtual void OnFiles(MultiFiles* pmf)
00475     {
00476         KiSelectionHandler::OnFiles(pmf);
00477         CvsCmdStatus(*this);
00478     }
00479 };
00480
00482 class KoFileRemoveHandler : public KiSelectionHandler
00483 {
00484 public:
00485     KoFileRemoveHandler()
00486         : KiSelectionHandler(_i18n("Remove"))
00487     {}
00488
00489     virtual void OnFolder(const char* fullpath)
00490     { /* folder cannot be removed */ }
00491
00492     virtual void OnFiles(MultiFiles* pmf)
00493     {
00494         KiSelectionHandler::OnFiles(pmf);
00495         CvsCmdRemove(*this);
00496     }
00497 };
00498
00500 class KoLockHandler : public KiSelectionHandler
00501 {
00502 public:
00503     KoLockHandler()
00504         : KiSelectionHandler(_i18n("Lock"))
00505     {}
00506
00507     virtual void OnFolder(const char* fullpath)
00508     {
00509         KiSelectionHandler::OnFolder(fullpath);
00510         CvsCmdLock(*this);
00511     }
00512
00513     virtual void OnFiles(MultiFiles* pmf)
00514     {
00515         KiSelectionHandler::OnFiles(pmf);
00516         CvsCmdLock(*this);
00517     }
00518 };
00519
00521 class KoUnlockHandler : public KiSelectionHandler
00522 {
00523 public:
00524     KoUnlockHandler()
00525         : KiSelectionHandler(_i18n("Unlock"))
00526     {}
00527     virtual void OnFolder(const char* fullpath)
00528     {
00529         KiSelectionHandler::OnFolder(fullpath);
00530         CvsCmdUnlock(*this);
00531     }
00532
00533     virtual void OnFiles(MultiFiles* pmf)
00534     {
00535         KiSelectionHandler::OnFiles(pmf);
00536         CvsCmdUnlock(*this);
00537     }
00538 };
00539
00541 class KoAddHandler : public KiSelectionHandler
00542 {
00543 public:
00544     KoAddHandler()
00545         : KiSelectionHandler(_i18n("Add"))
00546     {}
00547
00548     virtual void OnFolder(const char* fullpath)
00549     {
00550         KiSelectionHandler::OnFolder(fullpath);
00551         CvsCmdAdd(*this);
00552     }
00553
00554     virtual void OnFiles(MultiFiles* pmf)
00555     {
00556         KiSelectionHandler::OnFiles(pmf);
00557         CvsCmdAdd(*this);
00558     }
00559
00560     virtual bool NeedsNormalize()
00561     {
00562         return true;
00563     }
00564 };
00565
00567 class KoAddBinaryHandler : public KiSelectionHandler
00568 {
00569 public:
00570     KoAddBinaryHandler()
00571         : KiSelectionHandler(_i18n("Add Binary"))
00572     {}
00573
00574     virtual void OnFolder(const char* fullpath)
00575     {
00576         KiSelectionHandler::OnFolder(fullpath);
00577         CvsCmdAdd(*this);
00578     }
00579
00580     virtual void OnFiles(MultiFiles* pmf)
00581     {
00582         KiSelectionHandler::OnFiles(pmf);
00583         CvsCmdAdd(*this, kAddBinary);
00584     }
00585
00586     virtual bool NeedsNormalize()
00587     {
00588         return true;
00589     }
00590 };
00591
00593 class KoAddUnicodeHandler : public KiSelectionHandler
00594 {
00595 public:
00596     KoAddUnicodeHandler()
00597         : KiSelectionHandler(_i18n("Add Unicode"))
00598     {}
00599
00600     virtual void OnFolder(const char* fullpath)
00601     {
00602         KiSelectionHandler::OnFolder(fullpath);
00603         CvsCmdAdd(*this);
00604     }
00605
00606     virtual void OnFiles(MultiFiles* pmf)
00607     {
00608         KiSelectionHandler::OnFiles(pmf);
00609         CvsCmdAdd(*this, kAddUnicode);
00610     }
00611
00612     virtual bool NeedsNormalize()
00613     {
00614         return true;
00615     }
00616 };
00617
00619 class KoCommitHandler : public KiSelectionHandler
00620 {
00621 public:
00622     KoCommitHandler()
00623         : KiSelectionHandler(_i18n("Commit"))
00624     {}
00625
00626     virtual void OnFolder(const char* fullpath)
00627     {
00628         KiSelectionHandler::OnFolder(fullpath);
00629         CvsCmdCommit(*this);
00630     }
00631
00632     virtual void OnFiles(MultiFiles* pmf)
00633     {
00634         KiSelectionHandler::OnFiles(pmf);
00635         CvsCmdCommit(*this);
00636     }
00637 };
00638
00640 class KoUpdateHandler : public KiSelectionHandler
00641 {
00642 public:
00643     KoUpdateHandler()
00644         : KiSelectionHandler(_i18n("Update"))
00645     {}
00646
00647     virtual void OnFolder(const char* fullpath)
00648     {
00649         KiSelectionHandler::OnFolder(fullpath);
00650         CvsCmdUpdate(*this);
00651     }
00652
00653     virtual void OnFiles(MultiFiles* pmf)
00654     {
00655         KiSelectionHandler::OnFiles(pmf);
00656         CvsCmdUpdate(*this);
00657     }
00658 };
00659
00661 class KoQueryUpdateHandler : public KiSelectionHandler
00662 {
00663 public:
00664     KoQueryUpdateHandler()
00665         : KiSelectionHandler(_i18n("Query Update"))
00666     {}
00667
00668     virtual void OnFolder(const char* fullpath)
00669     {
00670         KiSelectionHandler::OnFolder(fullpath);
00671         CvsCmdUpdate(*this, true);
00672     }
00673
00674     virtual void OnFiles(MultiFiles* pmf)
00675     {
00676         KiSelectionHandler::OnFiles(pmf);
00677         CvsCmdUpdate(*this, true);
00678     }
00679 };
00680
00682 class KoAnnotateHandler : public KiSelectionHandler
00683 {
00684 public:
00685     KoAnnotateHandler()
00686         : KiSelectionHandler(_i18n("Annotate"))
00687     {}
00688
00689     virtual void OnFolder(const char* /*fullpath*/)
00690     {
00691         /*we avoid processing directory*/
00692     }
00693
00694     virtual void OnFiles(MultiFiles* pmf)
00695     {
00696         KiSelectionHandler::OnFiles(pmf);
00697         CvsCmdAnnotate(*this);
00698     }
00699 };
00700
00702 class KoCancelChangesHandler : public KiSelectionHandler
00703 {
00704 public:
00705     KoCancelChangesHandler()
00706         : KiSelectionHandler(_i18n("Cancel Changes"))
00707     {}
00708
00709     virtual void OnFolder(const char* /*fullpath*/)
00710     {
00711         /*we avoid processing directory*/
00712     }
00713
00714     virtual void OnFiles(MultiFiles* pmf)
00715     {
00716         KiSelectionHandler::OnFiles(pmf);
00717         CvsCmdCancelChanges(*this);
00718     }
00719 };
00720
00722 class KoCommandLineHandler : public KiSelectionHandler
00723 {
00724 public:
00725     KoCommandLineHandler()
00726         : KiSelectionHandler(_i18n("Command Line"), false)
00727     {}
00728
00729     virtual void OnFolder(const char* fullpath)
00730     {
00731         KiSelectionHandler::OnFolder(fullpath);
00732         CvsCmdCommandLine(*this);
00733     }
00734
00735     virtual void OnFiles(MultiFiles* pmf)
00736     {
00737         KiSelectionHandler::OnFiles(pmf);
00738         CvsCmdCommandLine(*this);
00739     }
00740 };
00741
00743 class KoImportHandler : public KiSelectionHandler
00744 {
00745 public:
00746     KoImportHandler()
00747         : KiSelectionHandler(_i18n("Import"))
00748     {}
00749
00750     virtual void OnFolder(const char* fullpath)
00751     {
00752         KiSelectionHandler::OnFolder(fullpath);
00753         CvsCmdImportModule(*this);
00754     }
00755
00756     virtual void OnFiles(MultiFiles* pmf)
00757     {
00758         KiSelectionHandler::OnFiles(pmf);
00759         CvsCmdImportModule(*this);
00760     }
00761 };
00762
00764 class KoCheckoutHandler : public KiSelectionHandler
00765 {
00766 public:
00767     KoCheckoutHandler()
00768         : KiSelectionHandler(_i18n("Checkout"))
00769     {}
00770
00771     virtual void OnFolder(const char* fullpath)
00772     {
00773         KiSelectionHandler::OnFolder(fullpath);
00774         CvsCmdCheckoutModule(*this);
00775     }
00776
00777     virtual void OnFiles(MultiFiles* pmf)
00778     {
00779         KiSelectionHandler::OnFiles(pmf);
00780         CvsCmdCheckoutModule(*this);
00781     }
00782 };
00783
00785 class KoRtagCreateHandler : public KiSelectionHandler
00786 {
00787 public:
00788     KoRtagCreateHandler()
00789         : KiSelectionHandler(_i18n("Rtag Create"), false)
00790     {}
00791
00792     virtual void OnFolder(const char* fullpath)
00793     {
00794         KiSelectionHandler::OnFolder(fullpath);
00795         CvsCmdRtagCreate(*this);
00796     }
00797
00798     virtual void OnFiles(MultiFiles* pmf)
00799     {
00800         KiSelectionHandler::OnFiles(pmf);
00801         CvsCmdRtagCreate(*this);
00802     }
00803 };
00804
00806 class KoRtagDeleteHandler : public KiSelectionHandler
00807 {
00808 public:
00809     KoRtagDeleteHandler()
00810         : KiSelectionHandler(_i18n("Rtag Delete"), false)
00811     {}
00812
00813     virtual void OnFolder(const char* fullpath)
00814     {
00815         KiSelectionHandler::OnFolder(fullpath);
00816         CvsCmdRtagDelete(*this);
00817     }
00818
00819     virtual void OnFiles(MultiFiles* pmf)
00820     {
00821         KiSelectionHandler::OnFiles(pmf);
00822         CvsCmdRtagDelete(*this);
00823     }
00824 };
00825
00827 class KoRtagBranchHandler : public KiSelectionHandler
00828 {
00829 public:
00830     KoRtagBranchHandler()
00831         : KiSelectionHandler(_i18n("Rtag Branch"), false)
00832     {}
00833
00834     virtual void OnFolder(const char* fullpath)
00835     {
00836         KiSelectionHandler::OnFolder(fullpath);
00837         CvsCmdRtagBranch(*this);
00838     }
00839
00840     virtual void OnFiles(MultiFiles* pmf)
00841     {
00842         KiSelectionHandler::OnFiles(pmf);
00843         CvsCmdRtagBranch(*this);
00844     }
00845 };
00846
00847 #endif
00848 // OWSEVIEWHANDLERS_H_
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 #ifdef qUnix
00031 #define CObject void
00032 #endif
00033
00034 // use this to cast to proper notification handler
00035 typedef void (*FNOBSERVER)(CObject*);
00036
00037
00038 // notification handler
00039 //template <class TObserver>
00040 class NotificationManager
00041 {
00042 // used types
00043 public:
00044
00045 private:
00046     // node describing observer registration
00047     struct Node
00048     {
00049         CObject* observer;
00050         // observer
00051
00052         FNOBSERVER handler;
00053         // its notification handler
00054
00055         // default constructor just zeroes everything
00056         Node()
00057         : observer(NULL), handler(NULL)
00058         {}
00059
00060         // full-blown construction
00061         Node(CObject* o, FNOBSERVER h)
00062         : observer(o), handler(h)
00063         {}
00064
00065         Node(const Node & n)
00066         {
00067             observer = n.observer;
00068             handler = n.handler;
00069         }
00070
00071         Node & operator=(const Node & n)
00072         {
00073             observer = n.observer;
00074             handler = n.handler;
00075             return *this;
00076         }
00077
00078     };
00079
00080 // Attributes
00081 private:
00082     std::vector<Node> m_nodes;
00083
00084 // Construction
00085 public:
00086     NotificationManager()   {}
00087
00088 // Operations
00089 public:
00090     // register an observer
00091     void CheckIn(CObject* observer, FNOBSERVER handler)
00092     {
00093         m_nodes.push_back(Node(observer, handler));
00094     }
00095
00096     // unregister an observer
00097     void CheckOut(CObject* observer)
00098     {
00099         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00100         {
00101             if ((*i).observer == observer)
00102             {
00103                 m_nodes.erase(i);
00104                 break;
00105             }
00106         }
00107     }
00108
00109     // fire up a notification once done with changes in observable
00110     void NotifyAll()
00111     {
00112         for (std::vector<Node>::iterator i = m_nodes.begin(); i != m_nodes.end(); i++)
00113         {
00114             // make a local copy so that observers can freely unregister during the process
00115             Node & node = *i;
00116             node.handler(node.observer);
00117         }
00118     }
00119
00120 };
00121
00122 // interface to filtering entries
00123 class KiFilterModel
00124 {
00125 // Interfaces
00126 public:
00127     // checks to see if an item satisfies current filtering criteria
00128     virtual bool IsMatch(EntnodeData* data) = 0;
00129
00130     // retrieves notification manager for observing changes in the
00131     virtual NotificationManager* GetNotificationManager() = 0;
00132 };
00133
00134 // interface to recursive display of entries
00135 class KiRecursionModel
00136 {
00137 // Interfaces
00138 public:
00139     // returns true if displaying files recursively
00140     virtual bool IsShowRecursive() = 0;
00141
00142     // retrieves notification manager for observing changes in the
00143     virtual NotificationManager* GetNotificationManager() = 0;
00144 };
00145
00146 // interface to recursive display of entries
00147 class KiIgnoreModel
00148 {
00149 // Interfaces
00150 public:
00151     // returns true if displaying ignored files
00152     virtual bool IsShowIgnored() = 0;
00153
00154     // retrieves notification manager for observing changes in the
00155     virtual NotificationManager* GetNotificationManager() = 0;
00156 };
00157
00158 // interface to filtering entries
00159 class KoFilterModel : public KiFilterModel
00160 {
00161 // Attributes
00162 protected:
00163     NotificationManager m_manager; // manager for filter change notifications
00164     UStr m_mask;             // current file mask
00165     std::vector<UStr> m_match;  // itemized array of file masks to display as found
00166     bool m_isChanged;       // flag to tell if only changed files are to be displayed
00167     bool m_isAdded;         // flag to tell if only added files are to be displayed
00168     bool m_isRemoved;       // flag to tell if only removed files are to be displayed
00169     bool m_isConflicts;     // flag to tell if conflicting files shall be displayed
00170
00171     bool m_isUnknown;       // flag to tell if unknown files have to be shown
00172     bool m_isMissing;       // flag to tell if missing files have to be shown
00173     bool m_isHideUnknown;   // flag to tell if unknown files have to be hidden, mutually
00174                             // exclusive with above
00175
00176 // Construction
00177 public:
00178     KoFilterModel();
00179     virtual ~KoFilterModel();
00180
00181
00182 // Interfaces
00183 public:
00184     // checks to see if an item satisfies current filtering criteria
00185     virtual bool IsMatch(EntnodeData* data);
00186
00187     // retrieves notification manager for observing changes in the
00188     virtual NotificationManager* GetNotificationManager();
00189
00190 // Operations
00191 public:
00192     // tells if the filter is in default mode - fo show flags are set
00193     bool IsDefaultMode() const;
00194
00195     // toggles modified flag
00196     void ToggleModified();
00197
00198     //accessor for modified flag
00199     bool IsModified() const;
00200
00201     // sets new file mask, returns true if changed
00202     bool SetMask(const char *mask);
00203
00204     // toggles show conflict flag
00205     void ToggleConflict()
00206     {
00207         m_isConflicts = !m_isConflicts;
00208     }
00209
00210     //accessor for show conflict flag
00211     bool IsConflict() const
00212     {
00213         return m_isConflicts;
00214     }
00215
00216     // toggles show conflict flag
00217     void ToggleUnknown();
00218
00219     //accessor for show unknown flag
00220     bool IsUnknown() const
00221     {
00222         return m_isUnknown;
00223     }
00224
00225     // toggles hide unknown flag
00226     void ToggleHideUnknown();
00227
00228     //accessor for hide unknown flag
00229     bool IsHideUnknown() const
00230     {
00231         return m_isHideUnknown;
00232     }
00233
00234
00235     // toggles show missing flag
00236     void ToggleMissing()
00237     {
00238         m_isMissing = !m_isMissing;
00239     }
00240
00241     //accessor for show missing flag
00242     bool IsMissing() const
00243     {
00244         return m_isMissing;
00245     }
00246
00247     void ToggleChanged()
00248     {
00249         m_isChanged = !m_isChanged;
00250     }
00251
00252     bool IsChanged() const
00253     {
00254         return m_isChanged;
00255     }
00256
00257     void ToggleAdded()
00258     {
00259         m_isAdded = !m_isAdded;
00260     }
00261
00262     bool IsAdded() const
00263     {
00264         return m_isAdded;
00265     }
00266
00267     void ToggleRemoved()
00268     {
00269         m_isRemoved = !m_isRemoved;
00270     }
00271
00272     bool IsRemoved() const
00273     {
00274         return m_isRemoved;
00275     }
00276 };
00277
00278 // interface to recursive display of entries
00279 class KoRecursionModel : public KiRecursionModel
00280 {
00281     NotificationManager m_manager;
00282     // manager for change notifications
00283
00284     bool m_isRecursive;
00285     // flag to tell if files in subfolders shall be iterated
00286 // Construction
00287 public:
00288     KoRecursionModel();
00289     virtual ~KoRecursionModel();
00290
00291 // Interfaces
00292 public:
00293     // returns true if displaying files recursively
00294     virtual bool IsShowRecursive();
00295
00296     // retrieves notification manager for observing changes in the
00297     virtual NotificationManager* GetNotificationManager();
00298
00299     // toggle recursion switch
00300     void ToggleRecursion();
00301
00302 };
00303
00304 // interface to recursive display of entries
00305 class KoIgnoreModel : public KiIgnoreModel
00306 {
00307     NotificationManager m_manager;
00308     // manager for change notifications
00309
00310     bool m_isIgnore;
00311     // flag to tell if ignored files are displayed
00312
00313 // Construction
00314 public:
00315     KoIgnoreModel();
00316     virtual ~KoIgnoreModel();
00317
00318 // Interfaces
00319 public:
00320     // returns true if displaying ignored files
00321     virtual bool IsShowIgnored();
00322
00323     // retrieves notification manager for observing changes in the
00324     virtual NotificationManager* GetNotificationManager();
00325
00326     // toggle recursion switch
00327     void ToggleIgnore();
00328 };
00329 #endif
00330 // __MODEL__H__
Generated on Fri Jan 31 12:08:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiString.h"
00054 #include "MultiFiles.h"
00055 #include "UpdateDlg.h"
00056 #include "PromptFiles.h"
00057 #include "ItemListDlg.h"
00058
00059 CMString gOldModules(10, "P_OldModules");
00060
00061 #ifdef WIN32
00062 #   include "GetPrefs.h"
00063 #   ifdef _DEBUG
00064 #   define new DEBUG_NEW
00065 #   undef THIS_FILE
00066     static char THIS_FILE[] = __FILE__;
00067 #   endif
00068
00069 IMPLEMENT_DYNAMIC(CCheckout_MAIN, CPropertyPage)
00070
00071 CCheckout_MAIN::CCheckout_MAIN(const MultiFiles* mf, const char* modname, const char* path)
00072     : m_mf(mf), CPropertyPage(CCheckout_MAIN::IDD)
00073 {
00074     //{{AFX_DATA_INIT(CCheckout_MAIN)
00075     m_noRecurse = FALSE;
00076     m_stdout = FALSE;
00077     m_overrideCoDir = FALSE;
00078     m_checkoutDir = _T("");
00079     //}}AFX_DATA_INIT
00080
00081     m_moduleName = modname;
00082     m_path = path;
00083     if( m_path.IsEmpty() )
00084     {
00085         CWincvsApp* app = (CWincvsApp*)AfxGetApp();
00086         if( 0L != app )
00087             m_path = app->GetRoot();
00088     }
00089
00090     m_moduleCombo.SetItems(&gOldModules);
00091 }
00092
00093 CCheckout_MAIN::~CCheckout_MAIN()
00094 {
00095 }
00096
00097 void CCheckout_MAIN::DoDataExchange(CDataExchange* pDX)
00098 {
00099     CPropertyPage::DoDataExchange(pDX);
00100
00101     //{{AFX_DATA_MAP(CCheckout_MAIN)
00102     DDX_Control(pDX, IDC_EDIT_CHECKOUTDIR, m_checkoutDirEdit);
00103     DDX_Control(pDX, IDC_CHECK_OVERRIDECHECKOUTDIR, m_overrideCoDirCheck);
00104     DDX_Control(pDX, IDC_PATH, m_pathEdit);
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_overrideCoDir);
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     ON_BN_CLICKED(IDC_BROWSE_MODULES, OnBrowseModules)
00131     //}}AFX_MSG_MAP
00132 END_MESSAGE_MAP()
00133
00134
00135 // CCheckout_MAIN message handlers
00136
00137
00138 void CCheckout_MAIN::OnBtnPath()
00139 {
00140     CString strPath;
00141     m_pathEdit.GetWindowText(strPath);
00142
00143     CStr path(strPath);
00144     if( BrowserGetDirectory("Select a directory to checkout to", path, IsWindow(m_hWnd) ? this : NULL) )
00145     {
00146         m_pathEdit.SetWindowText(path);
00147     }
00148 }
00149
00151 void CCheckout_MAIN::OnCheckOverridecheckoutdir()
00152 {
00153     BOOL enableCheckoutDir = m_overrideCoDirCheck.GetCheck() != 0;
00154
00155     m_checkoutDirEdit.EnableWindow(enableCheckoutDir);
00156
00157     if( enableCheckoutDir )
00158     {
00159         CString strCheckoutDir;
00160         m_checkoutDirEdit.GetWindowText(strCheckoutDir);
00161         if( strCheckoutDir.IsEmpty() )
00162         {
00163             CString strModuleName;
00164             m_moduleCombo.GetWindowText(strModuleName);
00165
00166             if( !strModuleName.IsEmpty() )
00167             {
00168                 m_checkoutDirEdit.SetWindowText(strModuleName);
00169                 GotoDlgCtrl(&m_checkoutDirEdit);
00170             }
00171         }
00172     }
00173 }
00174
00176 void CCheckout_MAIN::OnBrowseModules()
00177 {
00178     CStr moduleName;
00179     if( CompatGetModuleListItem(m_mf, moduleName) )
00180     {
00181         m_moduleName = (const char*)moduleName;
00182         m_moduleCombo.SetWindowText(m_moduleName);
00183     }
00184 }
00185
00186 IMPLEMENT_DYNAMIC(CCheckout_OPTIONS, CPropertyPage)
00187
00188 CCheckout_OPTIONS::CCheckout_OPTIONS(const MultiFiles* mf,
00189                                      const char* rev, const char* date, const char* keyword)
00190                                      : m_mf(mf), CPropertyPage(CCheckout_OPTIONS::IDD)
00191 {
00192     //{{AFX_DATA_INIT(CCheckout_OPTIONS)
00193     m_date = date;
00194     m_rev = rev;
00195     m_hasDate = FALSE;
00196     m_match = FALSE;
00197     m_hasRev = FALSE;
00198     m_export = FALSE;
00199     m_forceRoot = FALSE;
00200     m_keyword = keyword;
00201     //}}AFX_DATA_INIT
00202
00203     m_revCombo.SetItems(&gRevNames);
00204     m_dateCombo.SetItems(&gDateNames);
00205 }
00206
00207 CCheckout_OPTIONS::~CCheckout_OPTIONS()
00208 {
00209 }
00210
00211 void CCheckout_OPTIONS::DoDataExchange(CDataExchange* pDX)
00212 {
00213     CPropertyPage::DoDataExchange(pDX);
00214     //{{AFX_DATA_MAP(CCheckout_OPTIONS)
00215     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00216     DDX_Control(pDX, IDC_REV, m_hasRevCheck);
00217     DDX_Control(pDX, IDC_DATE, m_hasDateCheck);
00218     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00219     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00220     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00221     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00222     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00223     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00224     DDX_Check(pDX, IDC_DATE, m_hasDate);
00225     DDX_Check(pDX, IDC_MATCH, m_match);
00226     DDX_Check(pDX, IDC_REV, m_hasRev);
00227     DDX_Check(pDX, IDC_EXPORT, m_export);
00228     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00229     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00230     //}}AFX_DATA_MAP
00231
00232     if( m_hasRev )
00233     {
00234         DDV_MinChars(pDX, m_rev, 1);
00235     }
00236
00237     if( m_hasDate )
00238     {
00239         DDV_MinChars(pDX, m_date, 1);
00240     }
00241
00242     if( !pDX->m_bSaveAndValidate )
00243     {
00244         OnDate();
00245         OnRev();
00246     }
00247
00248     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00249     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00250 }
00251
00252
00253 BEGIN_MESSAGE_MAP(CCheckout_OPTIONS, CPropertyPage)
00254     //{{AFX_MSG_MAP(CCheckout_OPTIONS)
00255     ON_BN_CLICKED(IDC_DATE, OnDate)
00256     ON_BN_CLICKED(IDC_REV, OnRev)
00257     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00258     //}}AFX_MSG_MAP
00259 END_MESSAGE_MAP()
00260
00261
00262 // CCheckout_OPTIONS message handlers
00263
00264
00265 BOOL CCheckout_OPTIONS::OnInitDialog()
00266 {
00267     CPropertyPage::OnInitDialog();
00268
00269     // Extra initialization
00270     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00271
00272     return TRUE;  // return TRUE unless you set the focus to a control
00273                   // EXCEPTION: OCX Property Pages should return FALSE
00274 }
00275
00277 void CCheckout_OPTIONS::OnDate()
00278 {
00279     m_dateCombo.EnableWindow(m_hasDateCheck.GetCheck() != 0);
00280 }
00281
00283 void CCheckout_OPTIONS::OnRev()
00284 {
00285     m_revCombo.EnableWindow(m_hasRevCheck.GetCheck());
00286     m_browseTagButton.EnableWindow(m_hasRevCheck.GetCheck());
00287 }
00288
00290 void CCheckout_OPTIONS::OnBrowseTag()
00291 {
00292     CStr tagName;
00293     if( CompatGetTagListItem(m_mf, tagName) )
00294     {
00295         m_rev = (const char*)tagName;
00296         m_revCombo.SetWindowText(m_rev);
00297     }
00298 }
00299
00300 #endif /* WIN32 */
00301
00302 #ifdef qMacCvsPP
00303 static void DoDataExchange_CheckoutMain(LWindow *theDialog, const MultiFiles* mf, CPStr & modname,
00304     bool & norecurs, bool & toStdout, bool & overrideCheckoutDir, CPStr & checkoutDir, bool putValue)
00305 {
00306     LEditText *mname = dynamic_cast<LEditText*>
00307         (theDialog->FindPaneByID(item_ModuleName));
00308     LPopupFiller *filler = dynamic_cast<LPopupFiller*>
00309         (theDialog->FindPaneByID(item_PopModName));
00310
00311     LModuleWrapper *wrapper = putValue ? NEW LModuleWrapper(filler, mf) : 0L;
00312     filler->DoDataExchange(gOldModules, putValue, wrapper);
00313
00314     DoDataExchange (theDialog, item_NoRecurs, norecurs, putValue);
00315     DoDataExchange (theDialog, item_ToStout, toStdout, putValue);
00316     DoDataExchange (theDialog, item_CheckGroupPath, overrideCheckoutDir, putValue);
00317     DoDataExchange (theDialog, item_EditPath, checkoutDir, putValue);
00318
00319     if(putValue)
00320     {
00321         mname->SetText((Ptr)(const char *)modname, modname.length());
00322         theDialog->SetLatentSub(mname);
00323
00324         // this will take care about an empty module name
00325         mname->AddListener(GetDlgHandler());
00326         if(modname.length() == 0)
00327         {
00328             LPushButton *theOK = dynamic_cast<LPushButton*>
00329                                         (theDialog->FindPaneByID(item_OK));
00330             Assert_(theOK != 0L);
00331             theOK->Disable();
00332         }
00333     }
00334     else
00335     {
00336         char buf[512];
00337         Size len;
00338         mname->GetText(buf, 511, &len);
00339         modname.set(buf, len);
00340     }
00341 }
00342
00343 static void
00344 DoDataExchange_CheckoutOptions(
00345     LView *theDialog,
00346     const MultiFiles* mf,
00347     bool & hasDate,
00348     bool & hasRev,
00349     CPStr & sLastDate,
00350     CPStr & sLastRev,
00351     bool & useMostRecent,
00352     bool & doexport,
00353     bool & forceCvsroot,
00354     bool putValue)
00355
00356 {
00357     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00358         (theDialog->FindPaneByID(item_FillerTag));
00359     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00360         (theDialog->FindPaneByID(item_FillerDate));
00361
00362     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00363     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00364     fillDate->DoDataExchange(gDateNames, putValue);
00365
00366     DoDataExchange (theDialog, item_CheckDate, hasDate, putValue);
00367     DoDataExchange (theDialog, item_CheckRevTag, hasRev, putValue);
00368     DoDataExchange (theDialog, item_EditDate, sLastDate, putValue);
00369     DoDataExchange (theDialog, item_EditRevTag, sLastRev, putValue);
00370     DoDataExchange (theDialog, item_MostRecentRev, useMostRecent, putValue);
00371     DoDataExchange (theDialog, item_CheckForceRoot, forceCvsroot, putValue);
00372     DoDataExchange (theDialog, item_CheckExport, doexport, putValue);
00373
00374 }
00375 #endif /* qMacCvsPP */
00376
00377 #if qUnix
00378 class UCvsCheckout : public UWidget
00379 {
00380     UDECLARE_DYNAMIC(UCvsCheckout)
00381 public:
00382     UCvsCheckout() : UWidget(::UEventGetWidID()) {}
00383     virtual ~UCvsCheckout() {}
00384
00385     enum
00386     {
00387         kOK = EV_COMMAND_START, // 0
00388         kCancel,                // 1
00389         kTabGeneral             // 2
00390     };
00391
00392     virtual void DoDataExchange(bool fill);
00393
00394 protected:
00395     ev_msg int OnOK(void);
00396     ev_msg int OnCancel(void);
00397
00398     UDECLARE_MESSAGE_MAP()
00399 };
00400
00401 UIMPLEMENT_DYNAMIC(UCvsCheckout, UWidget)
00402
00403 UBEGIN_MESSAGE_MAP(UCvsCheckout, UWidget)
00404     ON_UCOMMAND(UCvsCheckout::kOK, UCvsCheckout::OnOK)
00405     ON_UCOMMAND(UCvsCheckout::kCancel, UCvsCheckout::OnCancel)
00406 UEND_MESSAGE_MAP()
00407
00408 int UCvsCheckout::OnOK(void)
00409 {
00410     EndModal(true);
00411     return 0;
00412 }
00413
00414 int UCvsCheckout::OnCancel(void)
00415 {
00416     EndModal(false);
00417     return 0;
00418 }
00419
00420 void UCvsCheckout::DoDataExchange(bool fill)
00421 {
00422     if(fill)
00423     {
00424     }
00425     else
00426     {
00427     }
00428 }
00429
00430 class UCvsCheckout_MAIN : public UWidget
00431 {
00432     UDECLARE_DYNAMIC(UCvsCheckout_MAIN)
00433 public:
00434     UCvsCheckout_MAIN(const char * modname, const char * path);
00435     virtual ~UCvsCheckout_MAIN() {}
00436
00437     enum
00438     {
00439         kComboPath = EV_COMMAND_START,  // 0
00440         kStaticPath,            // 1
00441         kBtnPath,               // 2
00442         kCheckStdout,           // 3
00443         kCheckRecurse           // 4
00444     };
00445
00446     virtual void DoDataExchange(bool fill);
00447
00448     UStr m_path;
00449     UStr m_modname;
00450     bool m_norecurs;
00451     bool m_stdout;
00452
00453 protected:
00454     ev_msg int OnPath(void);
00455
00456     UDECLARE_MESSAGE_MAP()
00457 };
00458
00459 UIMPLEMENT_DYNAMIC(UCvsCheckout_MAIN, UWidget)
00460
00461 UBEGIN_MESSAGE_MAP(UCvsCheckout_MAIN, UWidget)
00462     ON_UCOMMAND(UCvsCheckout_MAIN::kBtnPath, UCvsCheckout_MAIN::OnPath)
00463 UEND_MESSAGE_MAP()
00464
00465 UCvsCheckout_MAIN::UCvsCheckout_MAIN(const char * modname, const char * path) : UWidget(::UEventGetWidID())
00466 {
00467     m_path = path;
00468     m_modname = modname;
00469     m_norecurs = false;
00470     m_stdout = false;
00471 }
00472
00473 int UCvsCheckout_MAIN::OnPath(void)
00474 {
00475     CStr dir;
00476     if( BrowserGetDirectory("Select a directory to checkout to", dir) )
00477     {
00478         UEventSendMessage(GetWidID(), EV_SETTEXT, kStaticPath, (void*)dir.c_str());
00479     }
00480
00481     return 0;
00482 }
00483
00484 void UCvsCheckout_MAIN::DoDataExchange(bool fill)
00485 {
00486     ::DoDataExchange(fill, GetWidID(), kComboPath, gOldModules);
00487
00488     if(fill)
00489     {
00490         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckStdout, m_stdout), 0L);
00491         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurse, m_norecurs), 0L);
00492
00493         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboPath, (void *)(const char *)m_modname);
00494         UEventSendMessage(GetWidID(), EV_SETTEXT, kStaticPath, (void *)(const char *)m_path);
00495     }
00496     else
00497     {
00498         m_stdout = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckStdout, 0L) != 0;
00499         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurse, 0L) != 0;
00500
00501         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboPath, &m_modname);
00502         UEventSendMessage(GetWidID(), EV_GETTEXT, kStaticPath, &m_path);
00503     }
00504 }
00505
00506 class UCvsCheckout_STICKY : public UWidget
00507 {
00508     UDECLARE_DYNAMIC(UCvsCheckout_STICKY)
00509 public:
00510     UCvsCheckout_STICKY(const char *rev, const char *date);
00511     virtual ~UCvsCheckout_STICKY() {}
00512
00513     enum
00514     {
00515         kCheckDate = EV_COMMAND_START,  // 0
00516         kComboDate,         // 1
00517         kCheckRev,          // 2
00518         kComboRev,          // 3
00519         kCheckMatch         // 4
00520     };
00521
00522     virtual void DoDataExchange(bool fill);
00523
00524     UStr m_date;
00525     UStr m_rev;
00526     bool m_hasdate;
00527     bool m_hasrev;
00528     bool m_match;
00529 protected:
00530
00531     ev_msg int OnDate(void);
00532     ev_msg int OnRev(void);
00533
00534     UDECLARE_MESSAGE_MAP()
00535 };
00536
00537 UIMPLEMENT_DYNAMIC(UCvsCheckout_STICKY, UWidget)
00538
00539 UBEGIN_MESSAGE_MAP(UCvsCheckout_STICKY, UWidget)
00540     ON_UCOMMAND(UCvsCheckout_STICKY::kCheckDate, UCvsCheckout_STICKY::OnDate)
00541     ON_UCOMMAND(UCvsCheckout_STICKY::kCheckRev, UCvsCheckout_STICKY::OnRev)
00542 UEND_MESSAGE_MAP()
00543
00544 UCvsCheckout_STICKY::UCvsCheckout_STICKY(const char *rev, const char *date) : UWidget(::UEventGetWidID())
00545 {
00546     m_date = date;
00547     m_rev = rev;
00548     m_hasdate = false;
00549     m_hasrev = false;
00550     m_match = false;
00551 }
00552
00553 int UCvsCheckout_STICKY::OnDate()
00554 {
00555     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00556     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboDate, state), 0L);
00557     return 0;
00558 }
00559
00560 int UCvsCheckout_STICKY::OnRev()
00561 {
00562     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00563     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev, state), 0L);
00564     return 0;
00565 }
00566
00567 void UCvsCheckout_STICKY::DoDataExchange(bool fill)
00568 {
00569     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00570     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00571
00572     if(fill)
00573     {
00574         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00575         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00576         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00577
00578         OnDate();
00579         OnRev();
00580     }
00581     else
00582     {
00583         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00584         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00585         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00586
00587         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00588         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00589     }
00590 }
00591
00592 class UCvsCheckout_OPTIONS : public UWidget
00593 {
00594     UDECLARE_DYNAMIC(UCvsCheckout_OPTIONS)
00595 public:
00596     UCvsCheckout_OPTIONS();
00597     virtual ~UCvsCheckout_OPTIONS() {}
00598
00599     enum
00600     {
00601         kCheckForce = EV_COMMAND_START, // 0
00602         kCheckExport        // 1
00603     };
00604
00605     virtual void DoDataExchange(bool fill);
00606
00607     bool m_export;
00608     bool m_forceroot;
00609 protected:
00610
00611     UDECLARE_MESSAGE_MAP()
00612 };
00613
00614 UIMPLEMENT_DYNAMIC(UCvsCheckout_OPTIONS, UWidget)
00615
00616 UBEGIN_MESSAGE_MAP(UCvsCheckout_OPTIONS, UWidget)
00617 UEND_MESSAGE_MAP()
00618
00619 UCvsCheckout_OPTIONS::UCvsCheckout_OPTIONS() : UWidget(::UEventGetWidID())
00620 {
00621     m_export = false;
00622     m_forceroot = false;
00623 }
00624
00625 void UCvsCheckout_OPTIONS::DoDataExchange(bool fill)
00626 {
00627     if(fill)
00628     {
00629         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckForce, m_forceroot), 0L);
00630         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckExport, m_export), 0L);
00631     }
00632     else
00633     {
00634         m_forceroot = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckForce, 0L);
00635         m_export = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckExport, 0L);
00636     }
00637 }
00638 #endif // qUnix
00639
00641 bool CompatGetCheckout(const MultiFiles* mf,
00642                        CPStr& modname, CPStr& path, bool& norecurs,
00643                        bool& toStdout, CPStr& date, CPStr& rev,
00644                        bool& useMostRecent,
00645                        CPStr& rev1, CPStr& rev2,
00646                        bool& doexport, bool& forceCvsroot,
00647                        bool& overrideCheckoutDir, CPStr& checkoutDir,
00648                        CPStr& keyword)
00649 {
00650     bool userHitOK = false;
00651
00652     date = "";
00653     rev = "";
00654     modname = "";
00655     norecurs = false;
00656     toStdout = false;
00657     useMostRecent = false;
00658     doexport = false;
00659     forceCvsroot = false;
00660     overrideCheckoutDir = false;
00661
00662     static CPStr sLastModName;
00663     static CPStr sLastRev;
00664     static CPStr sLastDate;
00665     static CPStr sLastRev1;
00666     static CPStr sLastRev2;
00667     static CPStr sLastDate1;
00668     static CPStr sLastDate2;
00669
00670     bool hasDate = false;
00671     bool hasRev = false;
00672     bool merge1 = false;
00673     bool merge2 = false;
00674     bool hasDate1 = false;
00675     bool hasDate2 = false;
00676     keyword = "";
00677
00678 #ifdef WIN32
00679     CPropertySheet pages("Checkout settings");
00680     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00681     CCheckout_MAIN page1(mf, sLastModName, path);
00682     CCheckout_OPTIONS page2(mf, sLastRev, sLastDate, keyword);
00683     CUpdateMerge page3(mf, true, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00684     CGetPrefs_CVSROOT page4;
00685     CGetPrefs_GLOBALS page5;
00686     pages.AddPage(&page1);
00687     pages.AddPage(&page2);
00688     pages.AddPage(&page3);
00689     pages.AddPage(&page4);
00690     pages.AddPage(&page5);
00691     if(pages.DoModal() == IDOK)
00692     {
00693         sLastModName = (const char *)page1.m_moduleName;
00694         path = (const char *)page1.m_path;
00695         norecurs = page1.m_noRecurse == TRUE;
00696         toStdout = page1.m_stdout == TRUE;
00697         overrideCheckoutDir = page1.m_overrideCoDir == TRUE;
00698         checkoutDir = (const char *)page1.m_checkoutDir;
00699
00700         sLastDate = page2.m_date;
00701         sLastRev = page2.m_rev;
00702         hasDate = page2.m_hasDate == TRUE;
00703         hasRev = page2.m_hasRev == TRUE;
00704         useMostRecent = page2.m_match == TRUE;
00705         doexport = page2.m_export == TRUE;
00706         forceCvsroot = page2.m_forceRoot == TRUE;
00707         keyword = page2.m_keyword;
00708
00709         merge1 = page3.m_merge >= 1;
00710         merge2 = page3.m_merge == 2;
00711         sLastRev1 = page3.m_rev1;
00712         sLastRev2 = page3.m_rev2;
00713         hasDate1 = page3.m_hasDate1 == TRUE;
00714         hasDate2 = page3.m_hasDate2 == TRUE;
00715         sLastDate1 = page3.m_date1;
00716         sLastDate2 = page3.m_date2;
00717
00718         page4.StoreValues();
00719         page5.StoreValues();
00720         userHitOK = true;
00721     }
00722 #endif /* WIN32 */
00723 #ifdef qMacCvsPP
00724     StDialogHandler theHandler(dlg_Checkout, LCommander::GetTopCommander());
00725     LWindow *theDialog = theHandler.GetDialog();
00726     ThrowIfNil_(theDialog);
00727     static UInt16 sRuntimePanel = 1;
00728
00729     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00730         (theDialog->FindPaneByID(item_MultiViewPrefs));
00731     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00732
00733     multiView->SwitchToPanel(3);
00734     DoDataExchange_Globals(theDialog, true);
00735     multiView->SwitchToPanel(2);
00736     DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00737         sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, true);
00738     multiView->SwitchToPanel(1);
00739     DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, true);
00740     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00741     dynamic_cast<LBroadcaster*> (theDialog->FindPaneByID (item_CheckGroupPath))->AddListener (&theHandler);
00742
00743
00744     groupView->SetValue(sRuntimePanel);
00745     theDialog->Show();
00746     MessageT hitMessage;
00747     while (true)
00748     {       // Let DialogHandler process events
00749         hitMessage = theHandler.DoDialog();
00750
00751         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00752             break;
00753
00754         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00755         {
00756             if(theDialog->GetValueForPaneID(item_CheckGroupPath) == Button_Off)
00757             {
00758                 continue;
00759             }
00760
00761             CStr dir;
00762             if( BrowserGetDirectory("Select a directory to checkout to", dir) )
00763             {
00764                 CPStr tmp(dir.c_str());
00765                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00766             }
00767             else if(hitMessage == item_CheckGroupPath)
00768             {
00769                 theDialog->SetValueForPaneID(item_CheckGroupPath, Button_Off);
00770             }
00771         }
00772     }
00773     theDialog->Hide();
00774     sRuntimePanel = groupView->GetValue();
00775
00776     if(hitMessage == msg_OK)
00777     {
00778         multiView->SwitchToPanel(1);
00779         DoDataExchange_CheckoutMain(theDialog, mf, sLastModName, norecurs, toStdout, overrideCheckoutDir, checkoutDir, false);
00780         multiView->SwitchToPanel(2);
00781         DoDataExchange_CheckoutOptions(theDialog, mf, hasDate, hasRev,
00782             sLastDate, sLastRev, useMostRecent, doexport, forceCvsroot, false);
00783         multiView->SwitchToPanel(3);
00784         DoDataExchange_Globals(theDialog, false);
00785
00786         Assert_(sLastModName.length() != 0);
00787
00788         userHitOK = true;
00789     }
00790 #endif /* qMacCvsPP */
00791 #if qUnix
00792     void *wid = UCreate_CheckoutDlg();
00793
00794     UCvsCheckout *dlg = new UCvsCheckout();
00795     UCvsCheckout_MAIN *tab1 = new UCvsCheckout_MAIN(sLastModName, path);
00796     UCvsCheckout_STICKY *tab2 = new UCvsCheckout_STICKY(sLastRev, sLastDate);
00797     UCvsCheckout_OPTIONS *tab3 = new UCvsCheckout_OPTIONS();
00798     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00799     dlg->AddPage(tab1, UCvsCheckout::kTabGeneral, 0);
00800     dlg->AddPage(tab2, UCvsCheckout::kTabGeneral, 1);
00801     dlg->AddPage(tab3, UCvsCheckout::kTabGeneral, 2);
00802
00803     if(dlg->DoModal())
00804     {
00805         sLastModName = tab1->m_modname;
00806         path = tab1->m_path;
00807         norecurs = tab1->m_norecurs;
00808         toStdout = tab1->m_stdout;
00809
00810         sLastDate = tab2->m_date;
00811         sLastRev = tab2->m_rev;
00812         hasDate = tab2->m_hasdate;
00813         hasRev = tab2->m_hasrev;
00814         useMostRecent = tab2->m_match;
00815
00816         doexport = tab3->m_export;
00817         forceCvsroot = tab3->m_forceroot;
00818
00819         userHitOK = true;
00820     }
00821
00822     delete dlg;
00823 #endif // qUnix
00824
00825     if( userHitOK )
00826     {
00827         if( hasDate && !sLastDate.empty() )
00828             date = sLastDate;
00829
00830         if( hasRev && !sLastRev.empty() )
00831             rev = sLastRev;
00832
00833         modname = sLastModName;
00834
00835         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
00836         {
00837             rev1 = sLastRev1;
00838             rev2 = sLastRev2;
00839
00840             if( hasDate1 )
00841                 rev1 << ":" << sLastDate1;
00842
00843             if( hasDate2 )
00844                 rev2 << ":" << sLastDate2;
00845
00846         }
00847
00848         if( merge1 && !merge2 && !sLastRev1.empty() )
00849         {
00850             rev1 = sLastRev1;
00851
00852             if( hasDate1 )
00853                 rev1 << ":" << sLastDate1;
00854         }
00855
00856         gCvsPrefs.save();
00857     }
00858
00859     return userHitOK;
00860 }
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 "SmartComboBox.h"
00034 #include "KeywordComboBox.h"
00035
00036 class MultiFiles;
00037
00038 bool CompatGetCheckout(const MultiFiles* mf,
00039                        CPStr& modname, CPStr& path, bool& norecurs,
00040                        bool& toStdout, CPStr& date, CPStr& rev,
00041                        bool& useMostRecent,
00042                        CPStr& rev1, CPStr& rev2,
00043                        bool& doexport, bool& forceCvsroot,
00044                        bool& overrideCheckoutDir, CPStr& checkoutDir,
00045                        CPStr& keyword);
00046
00047 extern CMString gOldModules;
00048
00049 #ifdef WIN32
00050
00051 class CCheckout_MAIN : public CPropertyPage
00052 {
00053     DECLARE_DYNAMIC(CCheckout_MAIN)
00054
00055 // Construction
00056 public:
00057     CCheckout_MAIN(const MultiFiles* mf, const char* modname, const char* path);
00058     ~CCheckout_MAIN();
00059
00060 // Dialog Data
00061     //{{AFX_DATA(CCheckout_MAIN)
00062     enum { IDD = IDD_CHECKOUT_MAIN };
00063     CEdit   m_checkoutDirEdit;
00064     CButton m_overrideCoDirCheck;
00065     CEdit   m_pathEdit;
00066     CSmartComboBox  m_moduleCombo;
00067     CString m_moduleName;
00068     CString m_path;
00069     BOOL    m_noRecurse;
00070     BOOL    m_stdout;
00071     BOOL    m_overrideCoDir;
00072     CString m_checkoutDir;
00073     //}}AFX_DATA
00074
00075
00076 // Overrides
00077     // ClassWizard generate virtual function overrides
00078     //{{AFX_VIRTUAL(CCheckout_MAIN)
00079     protected:
00080     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00081     //}}AFX_VIRTUAL
00082
00083 // Implementation
00084 protected:
00085     // Generated message map functions
00086     //{{AFX_MSG(CCheckout_MAIN)
00087     afx_msg void OnBtnPath();
00088     afx_msg void OnCheckOverridecheckoutdir();
00089     afx_msg void OnBrowseModules();
00090     //}}AFX_MSG
00091     DECLARE_MESSAGE_MAP()
00092 private:
00093     const MultiFiles* m_mf;
00094 };
00095
00096 class CCheckout_OPTIONS : public CPropertyPage
00097 {
00098     DECLARE_DYNAMIC(CCheckout_OPTIONS)
00099
00100 // Construction
00101 public:
00102     CCheckout_OPTIONS(const MultiFiles* mf, const char* rev, const char* date, const char* keyword);
00103     ~CCheckout_OPTIONS();
00104
00105 // Dialog Data
00106     //{{AFX_DATA(CCheckout_OPTIONS)
00107     enum { IDD = IDD_CHECKOUT_OPTIONS };
00108     CButton m_browseTagButton;
00109     CButton m_hasRevCheck;
00110     CButton m_hasDateCheck;
00111     CKeywordComboBox    m_keywordCombo;
00112     CStatic m_keywordDescStatic;
00113     CSmartComboBox  m_revCombo;
00114     CSmartComboBox  m_dateCombo;
00115     CString m_date;
00116     CString m_rev;
00117     BOOL    m_hasDate;
00118     BOOL    m_match;
00119     BOOL    m_hasRev;
00120     BOOL    m_export;
00121     BOOL    m_forceRoot;
00122     CString m_keyword;
00123     //}}AFX_DATA
00124
00125
00126 // Overrides
00127     // ClassWizard generate virtual function overrides
00128     //{{AFX_VIRTUAL(CCheckout_OPTIONS)
00129     protected:
00130     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00131     //}}AFX_VIRTUAL
00132
00133 // Implementation
00134 protected:
00135     // Generated message map functions
00136     //{{AFX_MSG(CCheckout_OPTIONS)
00137     afx_msg void OnDate();
00138     afx_msg void OnRev();
00139     afx_msg void OnBrowseTag();
00140     virtual BOOL OnInitDialog();
00141     //}}AFX_MSG
00142     DECLARE_MESSAGE_MAP()
00143 private:
00144     const MultiFiles* m_mf;
00145 };
00146
00147 //{{AFX_INSERT_LOCATION}}
00148 #endif /* WIN32 */
00149
00150 #endif // !defined(AFX_CHECKOUTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 <LPushButton.h>
00045 #   include "LPopupFiller.h"
00046
00047 #   include "MacCvsConstant.h"
00048 #endif /* qMacCvsPP */
00049
00050 #include "CommitDlg.h"
00051 #include "CvsPrefs.h"
00052 #include "MultiFiles.h"
00053 #include "getline.h"
00054 #include "MultiString.h"
00055 #include "CvsCommands.h"
00056 #include "EditorMonDlg.h"
00057 #include "ItemListDlg.h"
00058 #include "BrowseViewHandlers.h"
00059
00060 static CMString gCommitLogs(10, "P_CommitLogs");
00061 static CPersistentBool gCheckValidEdits("P_CheckValidEdits", false);
00062
00067 void combozify(CStr& str)
00068 {
00069     // extract the first xxx words
00070     const char* tmp = str;
00071     CStr result;
00072     int numWords = 0;
00073 #   define HOWMUCH_WORDS 5
00074     while(*tmp != '\0' && numWords < HOWMUCH_WORDS)
00075     {
00076         while(*tmp != '\0' && isspace(*tmp))
00077             tmp++;
00078
00079         while(*tmp != '\0' && !isspace(*tmp))
00080             result << *tmp ++;
00081
00082         if( *tmp != '\0' )
00083             result << ' ';
00084
00085         numWords++;
00086     }
00087
00088     if( *tmp != '\0' )
00089     {
00090         result << "...";
00091     }
00092
00093     str = result;
00094 }
00095
00096 #ifdef WIN32
00097 #   include "GetPrefs.h"
00098 #   ifdef _DEBUG
00099 #       define new DEBUG_NEW
00100 #       undef THIS_FILE
00101         static char THIS_FILE[] = __FILE__;
00102 #   endif
00103
00104 IMPLEMENT_DYNAMIC(CCommit_MAIN, CPropertyPage)
00105
00106 CCommit_MAIN::CCommit_MAIN(const MultiFiles *mf, const char *logMsg, const char *pathTmpl)
00107     : m_mf(mf), m_fileToDiffCombo(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly),
00108     CPropertyPage(CCommit_MAIN::IDD)
00109 {
00110     //{{AFX_DATA_INIT(CCommit_MAIN)
00111     m_logMsg = logMsg;
00112     m_wordWrap = FALSE;
00113     //}}AFX_DATA_INIT
00114
00115     m_tmplPath = pathTmpl;
00116     if( !m_tmplPath.empty() )
00117     {
00118         if( !m_tmplPath.endsWith(kPathDelimiter) )
00119             m_tmplPath << kPathDelimiter;
00120
00121         m_tmplPath << "CVS";
00122         m_tmplPath << kPathDelimiter;
00123         m_tmplPath << "Template";
00124     }
00125
00126     m_bSwitchingWrap = FALSE;
00127     m_wordWrap = gCvsPrefs.WordWrapLogMsg();
00128
00129     m_prevLogsCombo.SetItems(&gCommitLogs);
00130 }
00131
00132 CCommit_MAIN::~CCommit_MAIN()
00133 {
00134 }
00135
00136 void CCommit_MAIN::DoDataExchange(CDataExchange* pDX)
00137 {
00138     CPropertyPage::DoDataExchange(pDX);
00139     //{{AFX_DATA_MAP(CCommit_MAIN)
00140     DDX_Control(pDX, IDC_PREVIEWINFO, m_previewInfo);
00141     DDX_Control(pDX, IDC_FILETODIFF, m_fileToDiffCombo);
00142     DDX_Control(pDX, IDC_WORDWRAP, m_wordWrapCtrl);
00143     DDX_Control(pDX, IDC_LOGMSG_WRAP, m_logMsgCtrlWrap);
00144     DDX_Control(pDX, IDC_LOGMSG, m_logMsgCtrl);
00145     DDX_Control(pDX, IDC_COMBO, m_prevLogsCombo);
00146     DDX_Check(pDX, IDC_WORDWRAP, m_wordWrap);
00147     //}}AFX_DATA_MAP
00148
00149     if( !pDX->m_bSaveAndValidate )
00150     {
00151         DDX_Text(pDX, IDC_LOGMSG_WRAP, m_logMsg);
00152         DDX_Text(pDX, IDC_LOGMSG, m_logMsg);
00153     }
00154     else
00155     {
00156         DDX_Text(pDX, GetLogMsgID(), m_logMsg);
00157     }
00158
00159     if( pDX->m_bSaveAndValidate )
00160     {
00161         if( !m_logMsg.IsEmpty() )
00162         {
00163             gCommitLogs.Insert(m_logMsg);
00164         }
00165     }
00166     else
00167     {
00168         DDX_ComboMString(pDX, IDC_COMBO, m_prevLogsCombo);
00169     }
00170 }
00171
00173 void CCommit_MAIN::OnSelchangeCombo()
00174 {
00175     int sel = m_prevLogsCombo.GetCurSel();
00176     if( sel == CB_ERR )
00177         return;
00178
00179     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00180     pEdit->SetSel(0, -1);
00181
00182     const NAMESPACE(std) vector<CStr>& list = gCommitLogs.GetList();
00183     pEdit->ReplaceSel(list[sel]);
00184 }
00185
00186 BEGIN_MESSAGE_MAP(CCommit_MAIN, CPropertyPage)
00187     //{{AFX_MSG_MAP(CCommit_MAIN)
00188     ON_CBN_SELCHANGE(IDC_COMBO, OnSelchangeCombo)
00189     ON_BN_CLICKED(IDC_LAUNCHEDITOR, OnLauncheditor)
00190     ON_WM_ERASEBKGND()
00191     ON_BN_CLICKED(IDC_WORDWRAP, OnWordwrap)
00192     ON_BN_CLICKED(IDC_DIFF, OnDiff)
00193     ON_CBN_SELCHANGE(IDC_FILETODIFF, OnSelchangeFiletodiff)
00194     ON_BN_CLICKED(IDC_TEMPLATE, OnTemplate)
00195     ON_WM_DESTROY()
00196     //}}AFX_MSG_MAP
00197 END_MESSAGE_MAP()
00198
00199
00200 BOOL CCommit_MAIN::PreTranslateMessage(MSG* pMsg)
00201 {
00202     if( pMsg->message >= WM_KEYFIRST ||
00203         pMsg->message <= WM_KEYLAST ||
00204         pMsg->message == WM_COPY || pMsg->message == WM_CUT || pMsg->message == WM_PASTE )
00205     {
00206         UpdateInfo();
00207     }
00208
00209     //dialog can be dismissed by Esc key
00210     if( pMsg->message == WM_KEYDOWN &&
00211         (int)pMsg->wParam == VK_ESCAPE )
00212     {
00213         EndDialog(IDCANCEL);
00214     }
00215
00216     return CPropertyPage::PreTranslateMessage(pMsg);
00217 }
00218
00220 void CCommit_MAIN::UpdateInfo()
00221 {
00222     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00223
00224     CString strOldInfo;
00225     CString strInfo;
00226     int nLineNumber = pEdit->LineFromChar();
00227     int nLineLenght = pEdit->LineLength(pEdit->LineIndex());
00228
00229     strInfo.Format("Line %d (%d chars)", nLineNumber + 1, nLineLenght);
00230
00231     GetDlgItemText(IDC_EDIT_POSITION, strOldInfo);
00232     if( strOldInfo != strInfo )
00233     {
00234         SetDlgItemText(IDC_EDIT_POSITION, strInfo);
00235     }
00236 }
00237
00239 void CCommit_MAIN::UpdatePreviewInfo()
00240 {
00241     CString strPreviewInfo;
00242     int nSelInfo = m_fileToDiffCombo.GetCurSel();
00243     if( nSelInfo < 0 || !m_fileToDiffCombo.GetCount() )
00244     {
00245         nSelInfo = 0;
00246     }
00247     else
00248     {
00249         nSelInfo++;
00250     }
00251
00252     strPreviewInfo.Format("Preview file changes (%d/%d):", nSelInfo, m_fileToDiffCombo.GetCount());
00253     m_previewInfo.SetWindowText(strPreviewInfo);
00254 }
00255
00257 void CCommit_MAIN::OnSelchangeFiletodiff()
00258 {
00259     UpdatePreviewInfo();
00260 }
00261
00263 void CCommit_MAIN::OnLauncheditor()
00264 {
00265     UStr message;
00266
00267     if( CompatGetEditorMsg(message) )
00268     {
00269         CString strMessage(message);
00270         strMessage.Replace("\n", "\r\n");
00271
00272         if( !strMessage.IsEmpty() )
00273         {
00274             CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00275             pEdit->SetSel(0, -1);
00276             pEdit->ReplaceSel(strMessage);
00277         }
00278     }
00279
00280     GotoDlgCtrl(GetLogMsgWnd());
00281 }
00282
00284 void CCommit_MAIN::SwitchWrapEdit(BOOL bWordWrap)
00285 {
00286     CString strMessage;
00287
00288     if( bWordWrap )
00289     {
00290         m_logMsgCtrl.GetWindowText(strMessage);
00291         m_logMsgCtrlWrap.SetWindowText(strMessage);
00292
00293         m_bSwitchingWrap = TRUE;
00294         m_logMsgCtrl.ShowWindow(SW_HIDE);
00295         m_logMsgCtrlWrap.ShowWindow(SW_SHOW);
00296         m_bSwitchingWrap = FALSE;
00297     }
00298     else
00299     {
00300         m_logMsgCtrlWrap.GetWindowText(strMessage);
00301         m_logMsgCtrl.SetWindowText(strMessage);
00302
00303         m_bSwitchingWrap = TRUE;
00304         m_logMsgCtrlWrap.ShowWindow(SW_HIDE);
00305         m_logMsgCtrl.ShowWindow(SW_SHOW);
00306         m_bSwitchingWrap = FALSE;
00307     }
00308 }
00309
00311 int CCommit_MAIN::GetLogMsgID()
00312 {
00313     return m_wordWrapCtrl.GetCheck() ? IDC_LOGMSG_WRAP : IDC_LOGMSG;
00314 }
00315
00317 CWnd* CCommit_MAIN::GetLogMsgWnd()
00318 {
00319     return GetDlgItem(GetLogMsgID());
00320 }
00321
00323 BOOL CCommit_MAIN::OnEraseBkgnd(CDC* pDC)
00324 {
00325     if( m_bSwitchingWrap )
00326     {
00327         return TRUE;
00328     }
00329
00330     return CPropertyPage::OnEraseBkgnd(pDC);
00331 }
00332
00334 void CCommit_MAIN::OnWordwrap()
00335 {
00336     gCvsPrefs.SetWordWrapLogMsg(m_wordWrapCtrl.GetCheck());
00337     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00338 }
00339
00341 void CCommit_MAIN::OnDiff()
00342 {
00343     const int nComboIndex = m_fileToDiffCombo.GetCurSel();
00344     if( nComboIndex > CB_ERR )
00345     {
00346         MultiFilesEntryIndex* entryIndex = (MultiFilesEntryIndex*)m_fileToDiffCombo.GetItemData(nComboIndex);
00347         CStr path;
00348         CStr fileName;
00349         CStr currRev;
00350
00351         if( entryIndex && entryIndex->GetIterator()->get(entryIndex->GetIndex(), path, fileName, currRev) )
00352         {
00353             MultiFiles mf;
00354             mf.newdir(path);
00355             mf.newfile(fileName, 0, currRev);
00356
00357             KoDiffHandler handler;
00358             handler.OnFiles(&mf);
00359         }
00360     }
00361 }
00362
00364 BOOL CCommit_MAIN::OnInitDialog()
00365 {
00366     CPropertyPage::OnInitDialog();
00367
00368     // Extra initialization here
00369     SwitchWrapEdit(gCvsPrefs.WordWrapLogMsg());
00370
00371     if( m_mf && m_mf->TotalNumFiles() )
00372     {
00373         MultiFiles::const_iterator mfi;
00374         for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00375         {
00376             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00377             {
00378                 UStr path;
00379                 UStr fileName;
00380                 UStr currRev;
00381
00382                 mfi->get(nIndex, path, fileName, currRev);
00383                 if( !path.empty() && !path.endsWith(kPathDelimiter) )
00384                     path << kPathDelimiter;
00385
00386                 path << fileName;
00387
00388                 const int nComboIndex = m_fileToDiffCombo.AddString(path);
00389
00390                 MultiFilesEntryIndex* entryIndex = new MultiFilesEntryIndex(nComboIndex, mfi);
00391                 m_fileToDiffCombo.SetItemData(nComboIndex, (DWORD)entryIndex);
00392             }
00393         }
00394     }
00395
00396     if( m_fileToDiffCombo.GetCount() )
00397     {
00398         m_fileToDiffCombo.SetCurSel(0);
00399     }
00400     else
00401     {
00402         m_fileToDiffCombo.EnableWindow(FALSE);
00403         CWnd* pButton = GetDlgItem(IDC_DIFF);
00404         if( pButton )
00405         {
00406             pButton->EnableWindow(FALSE);
00407         }
00408     }
00409
00410     //enable template button
00411     {
00412         CWnd* pTemplateButton = GetDlgItem(IDC_TEMPLATE);
00413         if( pTemplateButton )
00414         {
00415             FILE* templateFile = fopen(m_tmplPath, "r");
00416             pTemplateButton->EnableWindow(NULL != templateFile);
00417             if( templateFile )
00418             {
00419                 fclose(templateFile);
00420             }
00421         }
00422     }
00423
00424     UpdatePreviewInfo();
00425
00426     return TRUE;  // return TRUE unless you set the focus to a control
00427                   // EXCEPTION: OCX Property Pages should return FALSE
00428 }
00429
00431 void CCommit_MAIN::OnDestroy()
00432 {
00433     const int count = m_fileToDiffCombo.GetCount();
00434     for(int nIndex = 0; nIndex < count; nIndex++)
00435     {
00436         MultiFilesEntryIndex* entryIndex = (MultiFilesEntryIndex*)m_fileToDiffCombo.GetItemData(nIndex);
00437         delete entryIndex;
00438     }
00439
00440     CPropertyPage::OnDestroy();
00441 }
00442
00444 void CCommit_MAIN::OnTemplate()
00445 {
00446     CEdit* pEdit = (CEdit*)GetLogMsgWnd();
00447     pEdit->SetSel(0, -1);
00448
00449     bool gotIt = false;
00450     FILE* output;
00451
00452     if( !m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L )
00453     {
00454         char* line = 0L;
00455         size_t line_chars_allocated = 0;
00456         int line_length;
00457         while( (line_length = getline(&line, &line_chars_allocated, output)) > 0 )
00458         {
00459             //correct the new line characters for edit box and insert the line
00460             CString strLine(line);
00461             strLine.Replace( "\n", "\r\n" );
00462             pEdit->ReplaceSel(strLine);
00463         }
00464
00465         gotIt = true;
00466         if( line_length < 0 && !feof(output) )
00467             gotIt = false;
00468
00469         if( line != 0L )
00470             free(line);
00471
00472         fclose(output);
00473     }
00474
00475     if( !gotIt )
00476     {
00477         pEdit->ReplaceSel("*CVS/Template file not found*");
00478     }
00479 }
00480
00482 // CCommit_OPTIONS property page
00483
00484 IMPLEMENT_DYNAMIC(CCommit_OPTIONS, CPropertyPage)
00485
00486 CCommit_OPTIONS::CCommit_OPTIONS(const MultiFiles* mf)
00487     : m_mf(mf), CPropertyPage(CCommit_OPTIONS::IDD)
00488 {
00489     //{{AFX_DATA_INIT(CCommit_OPTIONS)
00490     m_forceCommit = FALSE;
00491     m_rev = _T("");
00492     m_forceRecurse = FALSE;
00493     m_forceRevision = FALSE;
00494     m_noModuleProgram = FALSE;
00495     m_noRecurse = FALSE;
00496     m_checkValidEdits = FALSE;
00497     //}}AFX_DATA_INIT
00498
00499     m_checkValidEdits = (bool)gCheckValidEdits;
00500     m_revCombo.SetItems(&gRevNames);
00501 }
00502
00503 CCommit_OPTIONS::~CCommit_OPTIONS()
00504 {
00505 }
00506
00507 void CCommit_OPTIONS::DoDataExchange(CDataExchange* pDX)
00508 {
00509     CPropertyPage::DoDataExchange(pDX);
00510     //{{AFX_DATA_MAP(CCommit_OPTIONS)
00511     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00512     DDX_Check(pDX, IDC_FORCECOMMIT, m_forceCommit);
00513     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00514     DDX_Check(pDX, IDC_FORCERECURSE, m_forceRecurse);
00515     DDX_Check(pDX, IDC_FORCEREVISION, m_forceRevision);
00516     DDX_Check(pDX, IDC_NOMODULEPROGRAM, m_noModuleProgram);
00517     DDX_Check(pDX, IDC_NORECURS, m_noRecurse);
00518     DDX_Check(pDX, IDC_CHECKVALIDEDITS, m_checkValidEdits);
00519     //}}AFX_DATA_MAP
00520
00521     if( m_forceRevision )
00522     {
00523         DDV_MinChars(pDX, m_rev, 1);
00524     }
00525
00526     if( !pDX->m_bSaveAndValidate )
00527     {
00528         OnForcerevision();
00529     }
00530
00531     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00532 }
00533
00534
00535 BEGIN_MESSAGE_MAP(CCommit_OPTIONS, CPropertyPage)
00536 //{{AFX_MSG_MAP(CCommit_OPTIONS)
00537     ON_BN_CLICKED(IDC_FORCEREVISION, OnForcerevision)
00538     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00539     //}}AFX_MSG_MAP
00540 END_MESSAGE_MAP()
00541
00542
00543 // CCommit_OPTIONS message handlers
00544
00545
00546 void CCommit_OPTIONS::OnForcerevision()
00547 {
00548     CButton* but = (CButton*)GetDlgItem(IDC_FORCEREVISION);
00549
00550     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00551     if( wnd )
00552     {
00553         wnd->EnableWindow(but->GetCheck());
00554     }
00555
00556     wnd = GetDlgItem(IDC_BROWSE_TAG);
00557     if( wnd )
00558     {
00559         wnd->EnableWindow(but->GetCheck());
00560     }
00561 }
00562
00564 void CCommit_OPTIONS::OnBrowseTag()
00565 {
00566     CStr tagName;
00567     if( CompatGetTagListItem(m_mf, tagName) )
00568     {
00569         m_rev = (const char*)tagName;
00570         m_revCombo.SetWindowText(m_rev);
00571     }
00572 }
00573
00574 #endif /* WIN32 */
00575
00576 #ifdef qMacCvsPP
00577 class LLogFillerWrapper : public LFillerWrapper
00578 {
00579 public:
00580     LLogFillerWrapper(LMenuController *menu, CMString & mstr, const char *pathTmpl) :
00581         LFillerWrapper(menu), fMStr(mstr), fFirstTime(true)
00582     {
00583         fTmplPath = pathTmpl;
00584         if(!fTmplPath.empty())
00585         {
00586             if(!fTmplPath.endsWith(kPathDelimiter))
00587                 fTmplPath << kPathDelimiter;
00588             fTmplPath << "CVS";
00589             fTmplPath << kPathDelimiter;
00590             fTmplPath << "Template";
00591         }
00592
00593     }
00594
00595     virtual void OnAddingItem(CStr & str)
00596     {
00597         if(fFirstTime)
00598         {
00599             fMenu->InsertMenuItem("\pInsert CVS/Template", max_Int16);
00600             mTmplItem = ::CountMenuItems(fMenu->GetMacMenuH());
00601             fMenu->InsertMenuItem("\p(-", max_Int16, false);
00602             fFirstTime = false;
00603         }
00604
00605         combozify(str);
00606         CPStr pstr(str);
00607         fMenu->InsertMenuItem(pstr, max_Int16);
00608     }
00609
00610     virtual bool OnSelectingItem(SInt32 inItem, CStr & str)
00611     {
00612         str = "";
00613         if(inItem == mTmplItem)
00614         {
00615             bool gotIt = false;
00616             FILE *output;
00617             if(!fTmplPath.empty() && (output = fopen(fTmplPath, "r")) != 0L)
00618             {
00619                 char *line = 0L;
00620                 size_t line_chars_allocated = 0;
00621                 int line_length;
00622                 while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00623                 {
00624                     str << line;
00625                 }
00626
00627                 gotIt = true;
00628                 if (line_length < 0 && !feof (output))
00629                     gotIt = false;
00630
00631                 if(line != 0L)
00632                     free (line);
00633
00634                 fclose(output);
00635             }
00636             if(!gotIt)
00637                 str << "*found no CVS/Template file*";
00638             return true;
00639         }
00640         else if(inItem >= mTmplItem + 2)
00641         {
00642             str = fMStr.GetList()[inItem - 4];
00643             return true;
00644         }
00645
00646         return false;
00647     }
00648 protected:
00649     CMString & fMStr;
00650     CStr fTmplPath;
00651     SInt32 mTmplItem;
00652     bool fFirstTime;
00653 };
00654
00655 static void DoDataExchange_Commit(LWindow *theDialog, CStr & commit,
00656     const char *pathTmpl, bool putValue)
00657 {
00658     LTextEditView *editLog = dynamic_cast<LTextEditView*>
00659         (theDialog->FindPaneByID(item_LogMsg));
00660     LPopupFiller *fillLog = dynamic_cast<LPopupFiller*>
00661         (theDialog->FindPaneByID(item_FillerRev1));
00662     LLogFillerWrapper *wrapper = putValue ? NEW LLogFillerWrapper(fillLog, gCommitLogs, pathTmpl) : 0L;
00663
00664     fillLog->DoDataExchange(gCommitLogs, putValue, wrapper);
00665
00666     if(putValue)
00667     {
00668         editLog->SetTextPtr((Ptr)(const char *)commit, commit.length());
00669         theDialog->SetLatentSub(editLog);
00670     }
00671     else
00672     {
00673         Handle hdl = editLog->GetTextHandle();
00674         Assert_(hdl != 0L);
00675         commit.set(*hdl, GetHandleSize(hdl));
00676
00677     }
00678 }
00679
00680 static void
00681 DoDataExchange_CommitOptions(
00682     LView *theDialog,
00683     const MultiFiles* mf,
00684     bool & norecurs,
00685     bool & forceCommit,
00686     bool & forceRecurse,
00687     bool & hasRev,
00688     CPStr & lastRev,
00689     bool & noModuleProgram,
00690     bool putValue)
00691 {
00692     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*> (theDialog->FindPaneByID(item_FillerTag));
00693     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00694     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00695
00696     DoDataExchange (theDialog, item_NoRecurs, norecurs, putValue);
00697     DoDataExchange (theDialog, item_ForceCommit, forceCommit, putValue);
00698     DoDataExchange (theDialog, item_ForceRecurse, forceRecurse, putValue);
00699     DoDataExchange (theDialog, item_NoModuleProgram, noModuleProgram, putValue);
00700     DoDataExchange (theDialog, item_CheckRevTag, hasRev, putValue);
00701     DoDataExchange (theDialog, item_EditRevTag, lastRev, putValue);
00702 }
00703 #endif /* qMacCvsPP */
00704
00705 #if qUnix
00706 class UCvsCommit : public UWidget
00707 {
00708     UDECLARE_DYNAMIC(UCvsCommit)
00709 public:
00710     UCvsCommit() : UWidget(::UEventGetWidID()) {}
00711     virtual ~UCvsCommit() {}
00712
00713     enum
00714     {
00715         kOK = EV_COMMAND_START, // 0
00716         kCancel,                // 1
00717         kTabGeneral             // 2
00718     };
00719
00720     virtual void DoDataExchange(bool fill);
00721
00722 protected:
00723     ev_msg int OnOK(void);
00724     ev_msg int OnCancel(void);
00725
00726     UDECLARE_MESSAGE_MAP()
00727 };
00728
00729 UIMPLEMENT_DYNAMIC(UCvsCommit, UWidget)
00730
00731 UBEGIN_MESSAGE_MAP(UCvsCommit, UWidget)
00732     ON_UCOMMAND(UCvsCommit::kOK, UCvsCommit::OnOK)
00733     ON_UCOMMAND(UCvsCommit::kCancel, UCvsCommit::OnCancel)
00734 UEND_MESSAGE_MAP()
00735
00736 int UCvsCommit::OnOK(void)
00737 {
00738     EndModal(true);
00739     return 0;
00740 }
00741
00742 int UCvsCommit::OnCancel(void)
00743 {
00744     EndModal(false);
00745     return 0;
00746 }
00747
00748 void UCvsCommit::DoDataExchange(bool fill)
00749 {
00750     if(fill)
00751     {
00752     }
00753     else
00754     {
00755     }
00756 }
00757
00758 class UCvsCommit_MAIN : public UWidget
00759 {
00760     UDECLARE_DYNAMIC(UCvsCommit_MAIN)
00761 public:
00762     UCvsCommit_MAIN( const MultiFiles *mf, const char *logmsg, const char *pathTmpl);
00763     virtual ~UCvsCommit_MAIN() {}
00764
00765     enum
00766     {
00767         kEditLog = EV_COMMAND_START,    // 0
00768         kComboLog,              // 1
00769         kComboDiffSelection,     // 2
00770         kExecDiff                // 3
00771     };
00772
00773     virtual void DoDataExchange(bool fill);
00774
00775     UStr m_logmsg;
00776     UStr m_tmplPath;
00777
00778 protected:
00779
00780     ev_msg void OnComboSel(int pos, const char *txt);
00781     ev_msg void OnComboDiffSel(int pos, const char *txt);
00782     ev_msg int OnExecDiff(void);
00783
00784     UDECLARE_MESSAGE_MAP()
00785 private:
00786     const MultiFiles* m_mf;
00787     int m_selected_diff_file;
00788 };
00789
00790 UIMPLEMENT_DYNAMIC(UCvsCommit_MAIN, UWidget)
00791
00792 UBEGIN_MESSAGE_MAP(UCvsCommit_MAIN, UWidget)
00793     ON_COMBO_SEL(UCvsCommit_MAIN::kComboLog, UCvsCommit_MAIN::OnComboSel)
00794     ON_COMBO_SEL(UCvsCommit_MAIN::kComboDiffSelection, UCvsCommit_MAIN::OnComboDiffSel)
00795     ON_UCOMMAND(UCvsCommit_MAIN::kExecDiff, UCvsCommit_MAIN::OnExecDiff)
00796 UEND_MESSAGE_MAP()
00797
00798 UCvsCommit_MAIN::UCvsCommit_MAIN( const MultiFiles *mf, const char *logmsg, const char *pathTmpl)
00799     : m_mf(mf), m_selected_diff_file(0), UWidget(::UEventGetWidID())
00800 {
00801     m_logmsg = logmsg;
00802     m_tmplPath = pathTmpl;
00803     if(!m_tmplPath.empty())
00804     {
00805         if(!m_tmplPath.endsWith(kPathDelimiter))
00806             m_tmplPath << kPathDelimiter;
00807         m_tmplPath << "CVS";
00808         m_tmplPath << kPathDelimiter;
00809         m_tmplPath << "Template";
00810     }
00811 }
00812
00813 void UCvsCommit_MAIN::OnComboSel(int pos, const char *txt)
00814 {
00815     if(pos == 0)
00816     {
00817         bool gotIt = false;
00818         FILE *output;
00819
00820         if(!m_tmplPath.empty() && (output = fopen(m_tmplPath, "r")) != 0L)
00821         {
00822             char *line = 0L;
00823             size_t line_chars_allocated = 0;
00824             int line_length;
00825             while ((line_length = getline (&line, &line_chars_allocated, output)) > 0)
00826             {
00827                 UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, line);
00828             }
00829
00830             gotIt = true;
00831             if (line_length < 0 && !feof (output))
00832                 gotIt = false;
00833
00834             if(line != 0L)
00835                 free (line);
00836
00837             fclose(output);
00838         }
00839         if(!gotIt)
00840             UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)"*found no CVS/Template file*");
00841     }
00842     else
00843     {
00844         const std::vector<CStr> & list = gCommitLogs.GetList();
00845         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)list[pos - 1]);
00846     }
00847 }
00848
00849 void UCvsCommit_MAIN::OnComboDiffSel(int pos, const char *txt)
00850 {
00851     m_selected_diff_file = pos;
00852     printf( "selected file %d, '%s'\n", pos, txt);
00853 }
00854
00855 void UCvsCommit_MAIN::DoDataExchange(bool fill)
00856 {
00857     if(fill)
00858     {
00859         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)m_logmsg);
00860
00861         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kComboLog, 0L);
00862         UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kComboLog,
00863                           (void *)"Insert CVS/Template");
00864         const std::vector<CStr> & list = gCommitLogs.GetList();
00865         std::vector<CStr>::const_iterator i;
00866         for(i = list.begin(); i != list.end(); ++i)
00867         {
00868             CStr str = *i;
00869             combozify(str);
00870             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kComboLog, (void *)(const char *)str);
00871         }
00872
00873         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kComboDiffSelection, 0L);
00874         if( m_mf && m_mf->TotalNumFiles() )
00875         {
00876             MultiFiles::const_iterator mfi;
00877             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00878             {
00879                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00880                 {
00881                     UStr path;
00882                     UStr fileName;
00883                     UStr currRev;
00884
00885                     mfi->get(nIndex, path, fileName, currRev);
00886                     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00887                         path << kPathDelimiter;
00888
00889                     path << fileName;
00890
00891                     UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kComboDiffSelection,
00892                           (void *)(const char*)path);
00893                 }
00894             }
00895         }
00896
00897     }
00898     else
00899     {
00900         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditLog, &m_logmsg);
00901         if(!m_logmsg.empty())
00902             gCommitLogs.Insert(m_logmsg);
00903     }
00904 }
00905
00906 int UCvsCommit_MAIN::OnExecDiff(void)
00907 {
00908     if( m_mf && m_mf->TotalNumFiles() )
00909     {
00910         MultiFiles::const_iterator mfi;
00911         int diff_idx;
00912         for( diff_idx = 0, mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00913         {
00914             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++, diff_idx++ )
00915             {
00916                 if( diff_idx == m_selected_diff_file)
00917                 {
00918                     UStr path;
00919                     UStr fileName;
00920                     UStr currRev;
00921
00922                     mfi->get(nIndex, path, fileName, currRev);
00923
00924                     MultiFiles mf;
00925                     mf.newdir(path);
00926                     mf.newfile(fileName, 0, currRev);
00927
00928                     KoDiffHandler handler;
00929                     handler.OnFiles(&mf);
00930                     return 0;
00931                 }
00932             }
00933         }
00934         // oops! file not found!
00935     }
00936     return 0;
00937 }
00938
00939 // - - - - - - - - - - - - - - - - - - - - -
00940
00941 class UCvsCommit_OPTIONS : public UWidget
00942 {
00943     UDECLARE_DYNAMIC(UCvsCommit_OPTIONS)
00944 public:
00945     UCvsCommit_OPTIONS( const MultiFiles *mf);
00946     virtual ~UCvsCommit_OPTIONS() {}
00947
00948     enum
00949     {
00950         kNoRecurse = EV_COMMAND_START,  // 0
00951         kForceCommit,               // 1
00952         kForceRevision,     // 2
00953         kRevList,                // 3
00954         kBrowseRev, // 4
00955         kForceRecurse, // 5
00956         kNoRunModuleProgram, // 6
00957         kCheckValidEdits, // 7
00958     };
00959
00960     virtual void DoDataExchange(bool fill);
00961
00962     bool    m_forceCommit;
00963     bool    m_forceRecurse;
00964     bool    m_forceRevision;
00965     bool    m_noModuleProgram;
00966     bool    m_noRecurse;
00967     bool    m_checkValidEdits;
00968     UStr    m_rev;
00969
00970 protected:
00971
00972     ev_msg int OnBrowseRevision(void);
00973     ev_msg int OnForceHit(void);
00974     ev_msg void OnRevisionSel(int pos, const char *txt);
00975
00976     UDECLARE_MESSAGE_MAP()
00977 private:
00978     const MultiFiles* m_mf;
00979     bool m_localforcerev;
00980 };
00981
00982 UIMPLEMENT_DYNAMIC(UCvsCommit_OPTIONS, UWidget)
00983
00984 UBEGIN_MESSAGE_MAP(UCvsCommit_OPTIONS, UWidget)
00985     ON_UCOMMAND(UCvsCommit_OPTIONS::kBrowseRev, UCvsCommit_OPTIONS::OnBrowseRevision)
00986     ON_UCOMMAND(UCvsCommit_OPTIONS::kForceRevision, UCvsCommit_OPTIONS::OnForceHit)
00987     ON_COMBO_SEL(UCvsCommit_OPTIONS::kRevList, UCvsCommit_OPTIONS::OnRevisionSel)
00988 UEND_MESSAGE_MAP()
00989
00990 UCvsCommit_OPTIONS::UCvsCommit_OPTIONS( const MultiFiles *mf)
00991     : m_mf(mf), m_localforcerev(false), UWidget(::UEventGetWidID())
00992 {
00993     m_forceCommit = false;
00994     m_forceRecurse = false;
00995     m_forceRevision = false;
00996     m_noModuleProgram = false;
00997     m_noRecurse = false;
00998     m_checkValidEdits = (bool)gCheckValidEdits;
00999 }
01000
01001 void UCvsCommit_OPTIONS::DoDataExchange(bool fill)
01002 {
01003     if(fill)
01004     {
01005         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kForceCommit, m_forceCommit), 0L);
01006         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kForceRecurse, m_forceRecurse), 0L);
01007         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kForceRevision, m_forceRevision), 0L);
01008         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kNoRunModuleProgram, m_noModuleProgram), 0L);
01009         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kNoRecurse, m_noRecurse), 0L);
01010         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckValidEdits, m_checkValidEdits), 0L);
01011
01012         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRevList, 0L);
01013         const std::vector<UStr> & list = gRevNames.GetList();
01014         std::vector<UStr>::const_iterator i;
01015         for(i = list.begin(); i != list.end(); ++i)
01016         {
01017             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRevList, (void *)(const char *)(*i));
01018         }
01019         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevList, m_forceRevision), 0L);
01020         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kBrowseRev, m_forceRevision), 0L);
01021     }
01022     else
01023     {
01024         m_forceCommit = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceCommit, 0L);
01025         m_forceRecurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRecurse, 0L);
01026         m_forceRevision = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRevision, 0L);
01027         m_noModuleProgram = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kNoRunModuleProgram, 0L);
01028         m_noRecurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kNoRecurse, 0L);
01029         m_checkValidEdits = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckValidEdits, 0L);
01030         UEventSendMessage(GetWidID(), EV_GETTEXT, kRevList, &m_rev);
01031     }
01032 }
01033
01034 ev_msg int UCvsCommit_OPTIONS::OnBrowseRevision(void)
01035 {
01036     CStr tagName;
01037     if( CompatGetTagListItem(m_mf, tagName) )
01038     {
01039         m_rev = (const char*)tagName;
01040         if( !m_rev.empty())
01041         {
01042             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRevList, (void *)(const char *)tagName);
01043             int sel = UEventSendMessage(GetWidID(), EV_COMBO_GETCOUNT, kRevList, 0L);
01044             UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kRevList, sel-1), 0L);
01045         }
01046     }
01047     return 0;
01048 }
01049
01050 ev_msg int UCvsCommit_OPTIONS::OnForceHit(void)
01051 {
01052     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRevision, 0L);
01053     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevList, state), 0L);
01054     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kBrowseRev, state), 0L);
01055     return 0;
01056 }
01057
01058 void UCvsCommit_OPTIONS::OnRevisionSel(int pos, const char *txt)
01059 {
01060     m_rev = txt;
01061 }
01062
01063
01064 #endif // qUnix
01065
01070 bool CompatGetCommit(const MultiFiles* mf,
01071                      CStr& commit, bool& norecurs,
01072                      bool& forceCommit, bool& forceRecurse, CPStr& rev, bool& noModuleProgram,
01073                      bool& checkValidEdits,
01074                      const char* pathTmpl /*= 0L*/)
01075 {
01076     bool userHitOK = false;
01077
01078     static CStr sLastMsg;
01079     static CPStr sLastRev;
01080
01081     bool hasRev = false;
01082
01083     norecurs = false;
01084     commit = "";
01085     forceCommit = false;
01086     forceRecurse = false;
01087     rev = "";
01088     noModuleProgram = false;
01089     checkValidEdits = (bool)gCheckValidEdits;
01090
01091 #ifdef WIN32
01092     CPropertySheet pages("Commit settings");
01093     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01094     CCommit_MAIN page1(mf, sLastMsg, pathTmpl);
01095     CCommit_OPTIONS page2(mf);
01096     CGetPrefs_GLOBALS page3;
01097     pages.AddPage(&page1);
01098     pages.AddPage(&page2);
01099     pages.AddPage(&page3);
01100     if(pages.DoModal() == IDOK)
01101     {
01102         commit = (const char *)page1.m_logMsg;
01103         sLastMsg = (const char *)page1.m_logMsg;
01104         norecurs = page2.m_noRecurse ? true : false;
01105         forceCommit = page2.m_forceCommit ? true : false;
01106         forceRecurse = page2.m_forceRecurse ? true : false;
01107         hasRev = page2.m_forceRevision ? true : false;
01108         sLastRev = page2.m_rev;
01109         noModuleProgram = page2.m_noModuleProgram ? true : false;
01110         gCheckValidEdits = page2.m_checkValidEdits ? true : false;
01111         page3.StoreValues();
01112
01113         userHitOK = true;
01114     }
01115 #endif /* WIN32 */
01116 #ifdef qMacCvsPP
01117     StDialogHandler theHandler(dlg_Commit, LCommander::GetTopCommander());
01118     LWindow *theDialog = theHandler.GetDialog();
01119     ThrowIfNil_(theDialog);
01120     static UInt16 sRuntimePanel = 1;
01121
01122     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01123         (theDialog->FindPaneByID(item_MultiViewPrefs));
01124     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01125
01126     multiView->SwitchToPanel(3);
01127     DoDataExchange_Globals(theDialog, true);
01128     multiView->SwitchToPanel(2);
01129     DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, true);
01130     multiView->SwitchToPanel(1);
01131     DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, true);
01132
01133     LPopupButton *previewDiff = dynamic_cast<LPopupButton*>
01134                                 (theDialog->FindPaneByID(item_PreviewDiffPopup));
01135     LPushButton *previewBtn = dynamic_cast<LPushButton*>
01136                                 (theDialog->FindPaneByID(item_PreviewDiffBtn));
01137     previewBtn->AddListener(&theHandler);
01138     previewDiff->DeleteAllMenuItems();
01139     if( mf && mf->TotalNumFiles() )
01140     {
01141         MultiFiles::const_iterator mfi;
01142         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01143         {
01144             for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
01145             {
01146                 UStr path;
01147                 UStr fileName, currRev;
01148
01149                 mfi->get(nIndex, path, fileName, currRev);
01150                 if(!path.empty() && !path.endsWith(kPathDelimiter))
01151                     path << kPathDelimiter;
01152                 path << fileName;
01153                 previewDiff->InsertMenuItem(LStr255(path), ::CountMenuItems(previewDiff->GetMacMenuH()));
01154             }
01155         }
01156     }
01157     else
01158     {
01159         previewDiff->Disable();
01160         previewBtn->Disable();
01161     }
01162
01163     groupView->SetValue(sRuntimePanel);
01164     theDialog->Show();
01165     MessageT hitMessage;
01166     while (true)
01167     {       // Let DialogHandler process events
01168         hitMessage = theHandler.DoDialog();
01169
01170         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01171             break;
01172
01173         if(hitMessage == item_PreviewDiffBtn)
01174         {
01175             int file = previewDiff->GetCurrentMenuItem(), count = 1;
01176             MultiFiles::const_iterator mfi;
01177             for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01178             {
01179                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++, count++)
01180                 {
01181                     if(count == file)
01182                     {
01183                         UStr path;
01184                         UStr fileName, currRev;
01185                         mfi->get(nIndex, path, fileName, currRev);
01186
01187                         MultiFiles mf;
01188                         mf.newdir(path);
01189                         mf.newfile(fileName, 0, currRev);
01190
01191                         KoDiffHandler handler;
01192                         handler.OnFiles(&mf);
01193                         break;
01194                     }
01195                 }
01196             }
01197         }
01198     }
01199     theDialog->Hide();
01200     sRuntimePanel = groupView->GetValue();
01201
01202     if(hitMessage == msg_OK)
01203     {
01204         multiView->SwitchToPanel(1);
01205         DoDataExchange_Commit(theDialog, sLastMsg, pathTmpl, false);
01206         multiView->SwitchToPanel(2);
01207         DoDataExchange_CommitOptions(theDialog, mf, norecurs, forceCommit, forceRecurse, hasRev, sLastRev, noModuleProgram, false);
01208         multiView->SwitchToPanel(3);
01209         DoDataExchange_Globals(theDialog, false);
01210         commit = sLastMsg;
01211         commit.replace('\015', '\012');
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215 #if qUnix
01216     void *wid = UCreate_CommitDlg();
01217
01218     UCvsCommit *dlg = new UCvsCommit();
01219     UCvsCommit_MAIN *tab1 = new UCvsCommit_MAIN( mf, sLastMsg, pathTmpl);
01220     UCvsCommit_OPTIONS *tab2 = new UCvsCommit_OPTIONS( mf);
01221
01222     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01223     dlg->AddPage(tab1, UCvsCommit::kTabGeneral, 0);
01224     dlg->AddPage(tab2, UCvsCommit::kTabGeneral, 1);
01225
01226     if(dlg->DoModal())
01227     {
01228         commit = tab1->m_logmsg;
01229         sLastMsg = tab1->m_logmsg;
01230         norecurs = tab2->m_noRecurse;
01231         forceCommit = tab2->m_forceCommit;
01232         forceRecurse = tab2->m_forceRecurse;
01233         hasRev = tab2->m_forceRevision;
01234         sLastRev = tab2->m_rev;
01235         noModuleProgram = tab2->m_noModuleProgram;
01236         gCheckValidEdits = tab2->m_checkValidEdits;
01237
01238         userHitOK = true;
01239     }
01240
01241     delete dlg;
01242 #endif // qUnix
01243
01244     if(userHitOK)
01245     {
01246         if(commit.length() == 0)
01247             commit = "no message";
01248
01249         if(hasRev && !sLastRev.empty())
01250             rev = sLastRev;
01251
01252         checkValidEdits = (bool)gCheckValidEdits;
01253
01254         gCvsPrefs.save();
01255     }
01256
01257     return userHitOK;
01258 }
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 "SmartComboBox.h"
00034
00035 class MultiFiles;
00036
00037 bool CompatGetCommit(const MultiFiles* mf,
00038                      CStr& commit, bool& norecurs,
00039                      bool& forceCommit, bool& forceRecurse, CPStr& rev, bool& noModuleProgram,
00040                      bool& checkValidEdits,
00041                      const char* pathTmpl = 0L);
00042
00043 void combozify(CStr & str);
00044     // strip the string with the few first words.
00045
00046 extern CMString gRevNames;
00047
00048 #ifdef WIN32
00049 class CCommit_MAIN : public CPropertyPage
00050 {
00051     DECLARE_DYNAMIC(CCommit_MAIN)
00052
00053 // Construction
00054 public:
00055     CCommit_MAIN(const MultiFiles* mf, const char *logMsg, const char *pathTmpl = 0L);
00056     ~CCommit_MAIN();
00057
00058 // Dialog Data
00059     //{{AFX_DATA(CCommit_MAIN)
00060     enum { IDD = IDD_COMMIT_MAIN };
00061     CButton m_previewInfo;
00062     CSmartComboBox  m_fileToDiffCombo;
00063     CButton m_wordWrapCtrl;
00064     CEdit   m_logMsgCtrlWrap;
00065     CEdit   m_logMsgCtrl;
00066     CSmartComboBox  m_prevLogsCombo;
00067     CString m_logMsg;
00068     BOOL    m_wordWrap;
00069     //}}AFX_DATA
00070
00071 // Overrides
00072     // ClassWizard generate virtual function overrides
00073     //{{AFX_VIRTUAL(CCommit_MAIN)
00074     public:
00075     virtual BOOL PreTranslateMessage(MSG* pMsg);
00076     protected:
00077     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00078     //}}AFX_VIRTUAL
00079
00080 // Implementation
00081 protected:
00082     // Generated message map functions
00083     //{{AFX_MSG(CCommit_MAIN)
00084     afx_msg void OnSelchangeCombo();
00085     afx_msg void OnLauncheditor();
00086     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00087     afx_msg void OnWordwrap();
00088     virtual BOOL OnInitDialog();
00089     afx_msg void OnDiff();
00090     afx_msg void OnSelchangeFiletodiff();
00091     afx_msg void OnTemplate();
00092     afx_msg void OnDestroy();
00093     //}}AFX_MSG
00094     DECLARE_MESSAGE_MAP()
00095 private:
00096     CStr m_tmplPath;
00097     const MultiFiles* m_mf;
00098
00099     BOOL m_bSwitchingWrap;
00100
00101     void UpdateInfo();
00102     void UpdatePreviewInfo();
00103     void SwitchWrapEdit(BOOL bWordWrap);
00104     int GetLogMsgID();
00105     CWnd* GetLogMsgWnd();
00106 };
00107
00109 // CCommit_OPTIONS dialog
00110
00111 class CCommit_OPTIONS : public CPropertyPage
00112 {
00113     DECLARE_DYNAMIC(CCommit_OPTIONS)
00114
00115 // Construction
00116 public:
00117     CCommit_OPTIONS(const MultiFiles* mf);
00118     ~CCommit_OPTIONS();
00119
00120 // Dialog Data
00121     //{{AFX_DATA(CCommit_OPTIONS)
00122     enum { IDD = IDD_COMMIT_OPTIONS };
00123     CSmartComboBox  m_revCombo;
00124     BOOL    m_forceCommit;
00125     CString m_rev;
00126     BOOL    m_forceRecurse;
00127     BOOL    m_forceRevision;
00128     BOOL    m_noModuleProgram;
00129     BOOL    m_noRecurse;
00130     BOOL    m_checkValidEdits;
00131     //}}AFX_DATA
00132
00133
00134 // Overrides
00135     // ClassWizard generate virtual function overrides
00136     //{{AFX_VIRTUAL(CCommit_OPTIONS)
00137     protected:
00138     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00139     //}}AFX_VIRTUAL
00140
00141 // Implementation
00142 protected:
00143     // Generated message map functions
00144     //{{AFX_MSG(CCommit_OPTIONS)
00145     afx_msg void OnForcerevision();
00146     afx_msg void OnBrowseTag();
00147     //}}AFX_MSG
00148     DECLARE_MESSAGE_MAP()
00149 private:
00150     const MultiFiles* m_mf;
00151 };
00152
00153 //{{AFX_INSERT_LOCATION}}
00154 #endif /* WIN32 */
00155
00156 #endif // !defined(AFX_COMMITDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if TARGET_RT_MAC_CFM
00039     extern "C" int stricmp(const char *str1, const char *str2);
00040     extern "C" int strnicmp(const char *str1, const char *str2, unsigned long size);
00041 #elif TARGET_RT_MAC_MACHO || qUnix
00042 #   ifndef HAVE_STRICMP
00043 #       define stricmp strcasecmp
00044 #   endif
00045 #   ifndef HAVE_STRNICMP
00046 #       define strnicmp strncasecmp
00047 #   endif
00048 #endif
00049
00050 // the persistent version
00051 class PCPStr : public CPStr, public CPersistent
00052 {
00053     UDECLARE_DYNAMIC(PCPStr)
00054 public:
00055     PCPStr(const char *uniqueName, const char *defValue = 0L, kClassPersistent pclass = kNoClass) : CPStr(),
00056         CPersistent(uniqueName, pclass)
00057     {
00058         if(defValue != 0L)
00059             *(CPStr *)this = defValue;
00060     }
00061     virtual ~PCPStr()
00062     {
00063     }
00064
00065     virtual unsigned int SizeOf(void) const
00066     {
00067         return str != 0L ? length() + 1 : 1;
00068     }
00069
00070     virtual const void *GetData(void) const
00071     {
00072         const void *res = (const char *)(*(CPStr *)this);
00073         return res == 0L ? "" : res;
00074     }
00075
00076     virtual void SetData(const void *ptr, unsigned int size)
00077     {
00078         if(strlen((const char *)ptr) == (size - 1))
00079             *(CPStr *)this = (const char *)ptr;
00080     }
00081
00082     inline operator const unsigned char *() const
00083         { return *(CPStr *)this; }
00084     inline operator unsigned char *() EGCS_CONST
00085         { return *(CPStr *)this; }
00086         // as a P string
00087
00088     inline operator const char *() const { return *(CPStr *)this; }
00089     inline operator char *() EGCS_CONST { return *(CPStr *)this; }
00090         // as a C string
00091
00092     inline const char *operator=(const char *newstr)
00093         { return ((CPStr *)this)->operator=(newstr); }
00094         // set from a C String (0L is OK)
00095     inline const unsigned char *operator=(const unsigned char *newstr)
00096         { return ((CPStr *)this)->operator=(newstr); }
00097         // set from a P String (0L is OK)
00098 };
00099
00100 class PCStr : public CStr, public CPersistent
00101 {
00102     UDECLARE_DYNAMIC(PCStr)
00103 public:
00104     PCStr(const char *uniqueName, const char *defValue = 0L, kClassPersistent pclass = kNoClass) : CStr(),
00105         CPersistent(uniqueName, pclass)
00106     {
00107         if(defValue != 0L)
00108             *(CStr *)this = defValue;
00109     }
00110     virtual ~PCStr()
00111     {
00112     }
00113
00114     virtual unsigned int SizeOf(void) const
00115     {
00116         return str != 0L ? length() + 1 : 0;
00117     }
00118
00119     virtual const void *GetData(void) const
00120     {
00121         const void *res = (const char *)(*(CStr *)this);
00122         return res == 0L ? "" : res;
00123     }
00124
00125     virtual void SetData(const void *ptr, unsigned int size)
00126     {
00127         if(strlen((const char *)ptr) == (size - 1))
00128             *(CStr *)this = (const char *)ptr;
00129     }
00130
00131     inline operator const char *() const { return *(CStr *)this; }
00132     inline operator char *() EGCS_CONST { return *(CStr *)this; }
00133         // as a C string
00134
00135     inline const char *operator=(const char *newstr)
00136     {
00137         TouchTimeStamp();
00138         return ((CStr *)this)->operator=(newstr);
00139     }
00140         // set from a C String (0L is OK)
00141     inline const char *operator=(const unsigned char *newstr)
00142     {
00143         TouchTimeStamp();
00144         return ((CStr *)this)->operator=(newstr);
00145     }
00146         // set from a P String (0L is OK)
00147 };
00148
00149 // class to use when fed-up with realloc, malloc...
00150 template <class T>
00151 class CStaticAllocT
00152 {
00153 public:
00154     CStaticAllocT()
00155     {
00156         buf = 0L;
00157         numbuf = 0;
00158     }
00159
00160     ~CStaticAllocT()
00161     {
00162         if(buf != 0L)
00163             free(buf);
00164     }
00165
00166     void AdjustSize(size_t size)
00167     {
00168         if(numbuf < size)
00169         {
00170             if(buf == 0L)
00171                 buf = (T *)malloc(size * sizeof(T));
00172             else
00173                 buf = (T *)realloc(buf, size * sizeof(T));
00174             if(buf == 0L)
00175                 throw std::bad_alloc();
00176             numbuf = size;
00177         }
00178     }
00179
00180     inline operator T *(void) const /* egcs const */ { return buf; }
00181     inline operator const T *(void) const { return buf; }
00182 #ifdef __GNUC__
00183     inline const T & operator[](int i) const { return buf[i]; }
00184     inline T & operator[](int i) { return buf[i]; }
00185 #endif
00186
00187     inline size_t size() const { return numbuf; }
00188 protected:
00189     T *buf;
00190     size_t numbuf;
00191 };
00192
00193 #endif /* CPSTR_H */
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00027 #   define kDlgIdAlert 129
00028 #   include <Dialogs.h>
00029 #   include <TextUtils.h>
00030 #   include <string.h>
00031 #   include "MacMisc.h"
00032 #endif /* TARGET_OS_MAC */
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
00084
00085 // CCVSAlert message handlers
00086 #endif /* WIN32 */
00087
00088 #ifdef TARGET_OS_MAC
00089     static const char *sPrompt = 0L, *sDefhit = 0L, *sCnclhit = 0L;
00090
00091     static pascal Boolean AlertModalFilter(DialogPtr dlog, EventRecord *event, short *itemHit)
00092     {
00093         if (event->what == activateEvt && (event->modifiers & activeFlag) != 0)
00094         {
00095             Str255 pp, pd, pc;
00096             c2pstrcpy(pp, sPrompt);
00097             c2pstrcpy(pd, sDefhit);
00098             c2pstrcpy(pc, sCnclhit);
00099
00100             SetControlTitle(GetDItemCtrlHdl(dlog, 1), pd);
00101             SetControlTitle(GetDItemCtrlHdl(dlog, 2), pc);
00102             SetDialogItemText(GetDItemHdl(dlog, 3), pp);
00103         }
00104
00105         return false;          // For all non-keyDown events
00106     }
00107 #endif /* TARGET_OS_MAC */
00108
00109 #if qUnix
00110 class UAskYesNo : public UWidget
00111 {
00112     UDECLARE_DYNAMIC(UAskYesNo)
00113 public:
00114     UAskYesNo() : UWidget(::UEventGetWidID()) {}
00115     virtual ~UAskYesNo() {}
00116
00117     enum
00118     {
00119         kOK = EV_COMMAND_START, // 0
00120         kCancel,                // 1
00121         kText                   // 2
00122     };
00123
00124 protected:
00125     ev_msg int OnOK(void);
00126     ev_msg int OnCancel(void);
00127
00128     UDECLARE_MESSAGE_MAP()
00129 };
00130
00131 UIMPLEMENT_DYNAMIC(UAskYesNo, UWidget)
00132
00133 UBEGIN_MESSAGE_MAP(UAskYesNo, UWidget)
00134     ON_UCOMMAND(UAskYesNo::kOK, UAskYesNo::OnOK)
00135     ON_UCOMMAND(UAskYesNo::kCancel, UAskYesNo::OnCancel)
00136 UEND_MESSAGE_MAP()
00137
00138 int UAskYesNo::OnOK(void)
00139 {
00140     EndModal(true);
00141     return 0;
00142 }
00143
00144 int UAskYesNo::OnCancel(void)
00145 {
00146     EndModal(false);
00147     return 0;
00148 }
00149 #endif
00150
00151 bool CvsAlert(const char *prompt, const char *defhit, const char *cnclhit)
00152 {
00153 #ifdef WIN32
00154     CCVSAlert gv(prompt, defhit, cnclhit);
00155     return gv.DoModal() == IDOK;
00156 #endif /* WIN32 */
00157 #ifdef TARGET_OS_MAC
00158     static ModalFilterUPP filter = NULL;
00159
00160     if(filter == NULL)
00161         filter = NewModalFilterUPP(AlertModalFilter);
00162
00163     sPrompt = prompt;
00164     sDefhit = defhit;
00165     sCnclhit = cnclhit;
00166
00167     return CautionAlert(kDlgIdAlert, filter) == 1;
00168 #endif /* TARGET_OS_MAC */
00169 #if qUnix
00170     void *wid = UCreate_AskYesNo();
00171
00172     UAskYesNo *dlg = new UAskYesNo();
00173     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00174     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, kUMainWidget, (void *)_i18n("Alert"));
00175     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kOK, (void *)defhit);
00176     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kCancel, (void *)cnclhit);
00177     UEventSendMessage(dlg->GetWidID(), EV_SETTEXT, UAskYesNo::kText, (void *)prompt);
00178
00179     bool res = dlg->DoModal();
00180     delete dlg;
00181     return res;
00182 #endif
00183 }
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include <errno.h>
00030
00031 #include "CvsPrefs.h"
00032 #include "CvsArgs.h"
00033 #include "AppConsole.h"
00034 #include "Authen.h"
00035 #include "FileTraversal.h"
00036 #include "MoveToTrash.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 #define MAX_PRINT_ARG 80
00047
00048 static CStaticAllocT<char> buf;
00049
00050 static char *mystrdup(const char *string)
00051 {
00052     int size = strlen(string);
00053     char *result = (char *)malloc((size + 1) * sizeof(char));
00054     if(result == NULL)
00055     {
00056         cvs_err("Impossible to allocate %d bytes !\n", size + 1);
00057         exit(1);
00058     }
00059     strcpy(result, string);
00060     return result;
00061 }
00062
00064 static char *reduceString(const char *str, CStaticAllocT<char> & buf)
00065 {
00066     buf.AdjustSize(MAX_PRINT_ARG + 4); // "..." + '\0'
00067     size_t len = strlen(str);
00068     if(len < MAX_PRINT_ARG)
00069     {
00070         strcpy(buf, str);
00071     }
00072     else
00073     {
00074         memcpy((char *)buf, str, MAX_PRINT_ARG * sizeof(char));
00075         char *tmp = (char *)buf + MAX_PRINT_ARG;
00076         *tmp++ = '.';
00077         *tmp++ = '.';
00078         *tmp++ = '.';
00079         *tmp = '\0';
00080     }
00081
00082     return buf;
00083 }
00084
00086 static char *expandLF(const char *str, CStaticAllocT<char> & buf)
00087 {
00088     int numLFs = 0;
00089     const char *runner = str;
00090     while((runner = strchr(runner, '\n')) != 0L)
00091     {
00092         numLFs++;
00093         runner++;
00094     }
00095
00096     size_t len = strlen(str);
00097     buf.AdjustSize(len + numLFs + 1); // numLFs * "\n" + '\0'
00098
00099     char *tmp = buf;
00100     char c;
00101     runner = str;
00102     while((c = *runner++) != '\0')
00103     {
00104         if(c == '\n')
00105         {
00106             *tmp++ = '\\';
00107             *tmp++ = 'n';
00108         }
00109         else
00110             *tmp++ = c;
00111     }
00112     *tmp++ = '\0';
00113
00114     return buf;
00115 }
00116
00118 // CvsArgs
00119
00120 CvsArgs::CvsArgs(bool defargs)
00121 {
00122     argv = NULL;
00123     argc = 0;
00124
00125     reset(defargs);
00126 }
00127
00128 CvsArgs::CvsArgs(char* const* fromargv, int fromargc)
00129 {
00130     argv = NULL;
00131     argc = 0;
00132
00133     reset(false);
00134
00135     for(int i = 0; i < fromargc; i++)
00136     {
00137         add(fromargv[i]);
00138     }
00139 }
00140
00141 CvsArgs::~CvsArgs()
00142 {
00143     reset(false);
00144 }
00145
00150 void CvsArgs::reset(bool defargs)
00151 {
00152     if( argv != 0L )
00153     {
00154         for(int i = 0; i < argc; i++)
00155         {
00156             if( argv[i] != 0L )
00157                 free(argv[i]);
00158         }
00159
00160         free(argv);
00161     }
00162
00163     argc = 0;
00164     argv = NULL;
00165
00166     if( defargs )
00167     {
00168         int numargs = 1;
00169
00170         if( gCvsPrefs.Z9Option() )
00171             numargs++;
00172
00173         if( gCvsPrefs.QuietOption() )
00174             numargs++;
00175
00176         AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00177         bool encrypt = gCvsPrefs.EncryptCommunication() && curModel->HasEncryption();
00178         if( encrypt )
00179             numargs++;
00180
00181         if( gCvsPrefs.AlwaysUseCvsroot() )
00182             numargs += 2;
00183
00184         argv = (char**)malloc(numargs * sizeof(char*));
00185         argv[argc++] = mystrdup(CVS_CMD);
00186
00187         if( gCvsPrefs.AlwaysUseCvsroot() )
00188         {
00189             argv[argc++] = mystrdup("-d");
00190             CStr root;
00191             const char* ccvsroot = gCvsPrefs;
00192             ccvsroot = Authen::skiptoken(ccvsroot);
00193             root = gAuthen.token();
00194             root << ccvsroot;
00195             argv[argc++] = mystrdup(root);
00196         }
00197
00198         if( gCvsPrefs.Z9Option() )
00199         {
00200             CStr zlev("-z");
00201             zlev << gCvsPrefs.ZLevel();
00202             argv[argc++] = mystrdup(zlev);
00203         }
00204
00205         if( gCvsPrefs.QuietOption() )
00206             argv[argc++] = mystrdup("-q");
00207
00208         if( encrypt )
00209             argv[argc++] = mystrdup("-x");
00210     }
00211 }
00212
00217 void CvsArgs::print(const char* indirectory /*= 0L*/)
00218 {
00219     static CStaticAllocT<char> buf;
00220
00221     for(int i = 0; i < argc; i++)
00222     {
00223         CStr newarg;
00224         newarg = argv[i];
00225         bool hasLF = strchr(newarg, '\n') != 0L;
00226         size_t len = newarg.length();
00227
00228         if( len > MAX_PRINT_ARG )
00229             newarg = reduceString(newarg, buf);
00230
00231         if( hasLF )
00232             newarg = expandLF(newarg, buf);
00233
00234         bool hasSpace = strchr(newarg, ' ') != 0L;
00235         if( hasSpace )
00236             cvs_out("\"");
00237
00238         cvs_outstr(newarg, newarg.length());
00239
00240         if( hasSpace )
00241             cvs_out("\"");
00242
00243         cvs_out(" ");
00244     }
00245
00246     if( indirectory != NULL && strlen(indirectory) )
00247     {
00248         cvs_out("(in directory %s)", indirectory);
00249     }
00250
00251     cvs_out("\n");
00252 }
00253
00255 void CvsArgs::add(const char *arg)
00256 {
00257     if(argv == 0L)
00258         argv = (char**)malloc(2 * sizeof(char*));
00259     else
00260         argv = (char**)realloc(argv, (argc + 2) * sizeof(char*));
00261
00262     argv[argc++] = arg != 0L ? mystrdup(arg) : 0L;
00263     argv[argc] = 0L;
00264 }
00265
00267 void CvsArgs::addfile(const char* arg, const char* /*dir*/, const UFSSpec* /*spec*/, const char* /*currRevision*/)
00268 {
00269     add(arg);
00270 }
00271
00273 void CvsArgs::addcvsroot()
00274 {
00275     // Extract from the cvsroot
00276     const char* ccvsroot = gCvsPrefs;
00277     ccvsroot = Authen::skiptoken(ccvsroot);
00278
00279     CStr root;
00280
00281     root = gAuthen.token();
00282     root << ccvsroot;
00283
00284     add("-d");
00285     add(root);
00286 }
00287
00289 char* const* CvsArgs::Argv(void) const
00290 {
00291     return argv;
00292 }
00293
00295 int CvsArgs::Argc(void) const
00296 {
00297     return argc;
00298 }
00299
00300
00302 // ControlCvsArgs
00303
00304 void ControlCvsArgs::addfile(const char* arg, const char* dir, const UFSSpec* spec,
00305     const char* currRevision)
00306 {
00307     CvsArgs::addfile(arg, dir, spec);
00308
00309     if( !gCvsPrefs.AddControl() )
00310         return;
00311
00312 #if TARGET_RT_MAC_CFM
00313     // here a bug of MSL : it refuses to open a file beginning by
00314     // ".". So we skip this file out of the test and warn the user.
00315     if(arg[0] == '.')
00316     {
00317         cvs_out("Warning : \'%s\' cannot be verified due to a bug in MW MSL, please\n", arg);
00318         cvs_out("          verify manually \'%s\' *is* a %s file\n", arg, TypeDesc());
00319         return;
00320     }
00321 #endif
00322
00323     kTextBinTYPE state = FileIsType(arg, dir, spec);
00324     switch(state)
00325     {
00326     case kFileIsOK:
00327         break;
00328
00329     case kFileMissing:
00330         // we can resurect a file which is missing by re-adding it
00331         break;
00332
00333     case kFileIsAlias:
00334         cvs_err("Warning : \'%s\' is an alias\n", arg);
00335         SetProblem(true);
00336         break;
00337
00338     case kFileInvalidName:
00339         cvs_err("Warning : \'%s\' has an invalid name\n", arg);
00340         SetProblem(true);
00341         break;
00342
00343     case kTextWrongLF:
00344         cvs_err("Warning : \'%s\' seems to have the wrong line feed for this machine, you should correct it first\n", arg);
00345         SetProblem(true);
00346         break;
00347
00348     case kUnicodeIsBinary: // fall thru intentional
00349     case kTextIsBinary:
00350         cvs_err("Warning : \'%s\' seems to be \'binary\', you should use the \'Add binary\' command instead...\n", arg);
00351         SetProblem(true);
00352         break;
00353
00354     case kTextEscapeChar:
00355 #ifdef TARGET_OS_MAC
00356         if(gCvsPrefs.IsoConvert() == ISO8559_none)
00357         {
00358             cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF),\n", arg);
00359             cvs_err("Warning   so you may need to have the ISO8559 translation option set in the preferences\n");
00360             cvs_err("Warning   before commiting\n");
00361         }
00362 #else /* !TARGET_OS_MAC */
00363         cvs_err("Warning : \'%s\' has some escape characters in it (0x00-0x20, 0x80-0xFF), you should correct it first\n", arg);
00364 #endif /* !TARGET_OS_MAC */
00365         break;
00366
00367     case kTextWrongSig:
00368 #if TARGET_RT_MAC_MACHO
00369         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\' or 0, you should correct it first\n", arg);
00370 #else
00371         cvs_err("Warning : \'%s\' has a file type different from \'TEXT\', you should correct it first\n", arg);
00372 #endif
00373         SetProblem(true);
00374         break;
00375
00376     case kUnicodeIsText: // fall thru intentional
00377     case kBinIsText:
00378         cvs_err("Warning : \'%s\' seems to be a text file, you should consider to use the \'Add selection\' command instead\n", arg);
00379         SetProblem(true);
00380         break;
00381
00382     case kBinWrongSig:
00383         cvs_err("Warning : \'%s\' has a file type of \'TEXT\', you should correct it first\n", arg);
00384         SetProblem(true);
00385         break;
00386
00387     case kTextIsUnicode: // fall thru intentional
00388     case kBinIsUnicode:
00389         cvs_err("Warning : \'%s\' seems to be an Unicode file, you should consider to use the \'Add unicode\' command instead\n", arg);
00390         SetProblem(true);
00391         break;
00392
00393     default:
00394         cvs_err("Warning : \'%s\' has some unknown problems\n", arg);
00395         SetProblem(true);
00396         break;
00397     }
00398 }
00399
00404 bool ControlCvsArgs::HasProblem(void) const
00405 {
00406     return m_gotProblem;
00407 }
00408
00413 void ControlCvsArgs::SetProblem(bool newState)
00414 {
00415     m_gotProblem = newState;
00416 }
00417
00418
00420 // RemoveCvsArgs
00421
00422 void RemoveCvsArgs::addfile(const char* arg, const char* dir, const UFSSpec* spec,
00423     const char* currRevision)
00424 {
00425     CvsArgs::addfile(arg, dir, spec);
00426
00427     CStr fullpath(dir);
00428     if( !fullpath.endsWith(kPathDelimiter) )
00429         fullpath << kPathDelimiter;
00430
00431     fullpath << arg;
00432
00433     // check the file is not already deleted
00434     struct stat sb;
00435     if( stat(dir, &sb) != -1 && S_ISDIR(sb.st_mode) &&
00436         stat(fullpath, &sb) == -1 && errno == ENOENT )
00437     {
00438         return;
00439     }
00440
00441     if( !CompatMoveToTrash(arg, dir, spec) )
00442 #ifdef WIN32
00443         cvs_err("Unable to send '%s' to the recycle bin\n", arg);
00444     else
00445         cvs_out("'%s' has been moved successfully to the recycle bin...\n", arg);
00446 #else
00447         cvs_err("Unable to send '%s' to the trash\n", arg);
00448     else
00449         cvs_out("'%s' has been moved successfully to the trash...\n", arg);
00450 #endif
00451 }
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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
00031 // CvsArgs
00032
00034 #define CVS_CMD "cvs"
00035
00037 class CvsArgs
00038 {
00039 public :
00040     CvsArgs(bool defargs = true);
00041     CvsArgs(char* const* fromargv, int fromargc);
00042     virtual ~CvsArgs();
00043
00044     virtual void add(const char* arg);
00045     virtual void addfile(const char* arg, const char* dir = 0L,
00046         const UFSSpec* spec = 0L, const char* currRevision = 0L);
00047
00048     void addcvsroot();
00049
00050     void reset(bool defargs = true);
00051
00052     void print(const char* indirectory = 0L);
00053
00054     char* const* Argv(void) const;
00055     int Argc(void) const;
00056
00057 protected:
00058     char** argv;
00059     int argc;
00060 };
00061
00063 // ControlCvsArgs
00064
00066 class ControlCvsArgs : public CvsArgs
00067 {
00068 public:
00069     ControlCvsArgs() : m_gotProblem(false) { }
00070
00071     virtual void addfile(const char* arg, const char* dir = 0L, const UFSSpec* spec = 0L,
00072         const char* currRevision = 0L);
00073
00074     bool HasProblem(void) const;
00075     void SetProblem(bool newState);
00076
00077 protected:
00079     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L) = 0;
00080
00082     virtual const char* TypeDesc() = 0;
00083
00084 private:
00085     bool m_gotProblem;
00086 };
00087
00089 // AddCvsArgs
00090
00092 class AddCvsArgs : public ControlCvsArgs
00093 {
00094 protected:
00095     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
00096     {
00097         return FileIsText(arg, dir, spec);
00098     }
00099
00100     virtual const char* TypeDesc()
00101     {
00102         return "TEXT";
00103     }
00104 };
00105
00107 // AddBinCvsArgs
00108
00110 class AddBinCvsArgs : public ControlCvsArgs
00111 {
00112 protected:
00113     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
00114     {
00115         return FileIsBinary(arg, dir, spec);
00116     }
00117
00118     virtual const char* TypeDesc()
00119     {
00120         return "binary";
00121     }
00122 };
00123
00125 // AddUnicodeCvsArgs
00126
00128 class AddUnicodeCvsArgs : public ControlCvsArgs
00129 {
00130 protected:
00131     virtual kTextBinTYPE FileIsType(const char* arg, const char* dir, const UFSSpec* spec = 0L)
00132     {
00133         return FileIsUnicode(arg, dir, spec);
00134     }
00135
00136     virtual const char* TypeDesc()
00137     {
00138         return "Unicode";
00139     }
00140 };
00141
00143 // RemoveCvsArgs
00144
00146 class RemoveCvsArgs : public CvsArgs
00147 {
00148 public:
00149     virtual void addfile(const char* arg, const char* dir = 0L,
00150         const UFSSpec* spec = 0L, const char* currRevision = 0L);
00151 };
00152
00153 #endif /* CVSPREFS_H */
Generated on Fri Jan 31 12:08:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 <process.h>
00031 #   include <io.h>
00032 #   include "wincvs.h"
00033
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 #include "CvsCommands.h"
00042 #include "Authen.h"
00043 #include "CvsArgs.h"
00044 #include "MultiFiles.h"
00045 #include "PromptFiles.h"
00046 #include "AppConsole.h"
00047 #include "AppGlue.h"
00048 #include "MoveToTrash.h"
00049 #include "LineCmd.h"
00050 #include "CvsAlert.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 #include "StatusDlg.h"
00066 #include "LoginDlg.h"
00067
00068 #include "BrowseViewHandlers.h"
00069
00070 #ifdef qMacCvsPP
00071 #   include "AppGlue.mac.h"
00072 #   include "MacMisc.h"
00073 #   include "MacCvsApp.h"
00074 #endif
00075
00076 #ifdef qUnix
00077 #include "UCvsApp.h"
00078 #endif
00079
00086 char* CleanupLogMsg(const char* msg)
00087 {
00088     static CStaticAllocT<char> buf;
00089
00090     size_t len = strlen(msg);
00091     buf.AdjustSize(len + 1);
00092
00093     char* tmp = buf;
00094     char c;
00095
00096
00097     while( (c = *msg++) != '\0' )
00098     {
00099 #ifdef WIN32
00100         if(c == '\r')
00101             continue;
00102 #endif /* WIN32 */
00103 #ifdef TARGET_OS_MAC
00104         if(c == '\r')
00105             c = '\n';
00106 #endif /* TARGET_OS_MAC */
00107         *tmp++ = c;
00108     }
00109
00110     *tmp++ = '\0';
00111
00112     return buf;
00113 }
00114
00124 bool SplitPath(const char* dir, CStr& uppath, CStr& folder, bool dontSkipDelimiter /*= false*/)
00125 {
00126     char newDir[MAX_PATH * 2] = "";
00127     char oldDir[MAX_PATH * 2] = "";
00128     char newFile[MAX_PATH] = "";
00129
00130     if( !dir )
00131     {
00132         // Null pointer
00133         return false;
00134     }
00135
00136     int dirLen = strlen(dir);
00137     if( dirLen > 0 )
00138     {
00139         strcpy(oldDir, dir);
00140
00141         if( !dontSkipDelimiter && (dir[dirLen - 1] == kPathDelimiter) )
00142         {
00143             oldDir[dirLen - 1] = '\0';
00144             --dirLen;
00145         }
00146
00147         const char* tmp = oldDir;
00148         const char* prev = oldDir;
00149
00150         while( (tmp = strchr(tmp, kPathDelimiter)) != 0L )
00151         {
00152             prev = ++tmp;
00153         }
00154
00155         strcpy(newDir, oldDir);
00156         newDir[prev - oldDir] = '\0';
00157         strcpy(newFile, prev);
00158     }
00159
00160     uppath = newDir;
00161     folder = newFile;
00162
00163     return true;
00164 }
00165
00174 bool MakeTmpFile(CStr& file, const char* prefix, const char* extension /*= 0L*/, bool create /*= false*/)
00175 {
00176     static int count = 0;
00177     char filename[MAX_PATH];
00178
00179     CStr tmpPath;
00180     CStr ext;
00181     CStr prf;
00182
00183     if( extension != 0L && extension[0] != '\0' )
00184     {
00185         if( extension[0] != '.' )
00186             ext = ".";
00187
00188         ext << extension;
00189     }
00190
00191     if( prefix != 0L && prefix[0] != '\0' )
00192     {
00193         prf = prefix;
00194     }
00195     else
00196     {
00197         prf = "cvsgui";
00198     }
00199
00200 #ifdef WIN32
00201     char* ptr;
00202     ptr = getenv(_T("TMP"));
00203     if( ptr != 0L && _access(ptr, 0) != -1 )
00204     {
00205         tmpPath = ptr;
00206     }
00207     else
00208     {
00209         tmpPath = ".";
00210     }
00211 #endif /* !WIN32 */
00212 #ifdef TARGET_OS_MAC
00213     UFSSpec theFolder;
00214     OSErr err;
00215
00216     if( (err = MacGetTempFolder(theFolder, tmpPath)) != noErr )
00217     {
00218         cvs_err(_i18n("Unable to locate the preferences folder (error %d) !\n"), err);
00219         return 0L;
00220     }
00221
00222 #if !TARGET_RT_MAC_MACHO  // no problems with long file names on Mac OS X...
00223     for( ; ; )
00224     {
00225         sprintf(filename, "%s%d%s", (const char*)prf, count, (const char*)ext);
00226         if( ::strlen(filename) <= 31 )
00227             break;
00228
00229         if( prf.length() == 0 )
00230         {
00231             cvs_err(_i18n("Unable to truncate temp file !\n"));
00232             return 0L;
00233         }
00234
00235         prf.set (prf, prf.length () - 1);
00236     }
00237 #endif // !TARGET_RT_MAC_MACHO
00238 #endif /* !TARGET_OS_MAC */
00239 #if qUnix
00240     tmpPath = "/tmp";
00241 #endif
00242
00243     struct stat sb;
00244     if( stat(tmpPath, &sb) == -1 || !S_ISDIR(sb.st_mode) )
00245     {
00246         cvs_err(_i18n("Unable to access '%s' (error %d) !\n"), (const char*)tmpPath, errno);
00247         return false;
00248     }
00249
00250     if( !tmpPath.endsWith(kPathDelimiter) )
00251         tmpPath << kPathDelimiter;
00252
00253     int maxtry = 10000;
00254     while( true )
00255     {
00256         sprintf(filename, "%s%d%s", (const char*)prf, count++, (const char*)ext);
00257         file = tmpPath;
00258         file << filename;
00259
00260         if( stat(file, &sb) == -1 && errno == ENOENT )
00261         {
00262             if( create )
00263             {
00264                 FILE* stream = fopen(file, "w");
00265                 if( stream )
00266                 {
00267                     fclose(stream);
00268                 }
00269             }
00270
00271             return true;
00272         }
00273
00274         if( maxtry-- == 0 )
00275         {
00276             cvs_err(_i18n("Time out to access '%s' !\n"), (const char*)tmpPath);
00277             break;
00278         }
00279     }
00280
00281     return false;
00282 }
00283
00290 void GetExtension(const char* file, CStr& base, CStr& ext)
00291 {
00292     char* tmp = strrchr(file, '.');
00293
00294     if( tmp == 0L )
00295     {
00296         ext = "";
00297         base = file;
00298     }
00299     else
00300     {
00301         ext = tmp + 1;
00302         base = file;
00303         base[tmp - file] = '\0';
00304     }
00305 }
00306
00314 bool GetEnvValue(const char* cmd, const char* key, UStr& value)
00315 {
00316     const char* tmp = strstr(cmd, key);
00317     if( tmp == 0L )
00318         return false;
00319
00320     tmp = strchr(tmp, '=');
00321     if( tmp == 0L )
00322         return false;
00323
00324     tmp++;
00325
00326     const char* tmp2 = strchr(tmp, '&');
00327     if( tmp2 == 0L )
00328         value = tmp;
00329     else
00330         value.set(tmp, tmp2 - tmp);
00331
00332     return true;
00333 }
00334
00341 int StringToArgv(const char* cmdLine, char** argv)
00342 {
00343     int argc = 0;
00344
00345     char Quote = '\0';              /*  Contains the quote character if we are inside "" or '', or \0 otherwise */
00346     const char* walker1 = cmdLine;  /*  walker1 traverses the original command line */
00347     char* walker2;                  /*  walker2 traverses the parsed copy of the commandline */
00348     char theChar;                   /*  theChar is the character we are currently parsing */
00349     char arguments[MAX_CMD_LEN];    /*  Will contain a parsed copy of the command line */
00350
00351     /* Copy into arguments */
00352     walker2 = arguments;
00353
00354     /* Parse command line to \0 */
00355     while( (theChar = *walker1++) != '\0' )
00356     {
00357         /* Skip leading space before an argument */
00358         if( theChar == ' ' )
00359             continue;
00360
00361         /* Set argv to point to the space where we copy the next argument */
00362         argv [argc++] = walker2;
00363
00364         /* If we filled argv, skip the rest */
00365         if( argc > MAX_ARGS)
00366         {
00367             argc--;
00368             break;
00369         }
00370
00371         do
00372         {
00373             /* Parse an argument skip \s */
00374             if( theChar == '\\' && *walker1++ )
00375             {
00376                 theChar = *walker1++;
00377             }
00378             else
00379             {
00380                 /* When we find a quote... */
00381                 if( theChar == '"' || theChar == '\'' )
00382                 {
00383                     /* If we are not inside quotes already, */
00384                     if( Quote == '\0' )
00385                     {
00386                         /* Remember we are inside quotes now */
00387                         Quote = theChar;
00388
00389                         /* Go to the next character */
00390                         continue;
00391                     }
00392
00393                     /* If we are already inside that kind of quotes */
00394                     if( theChar == Quote )
00395                     {
00396                         /* Close quotes */
00397                         Quote = '\0';
00398
00399                         /* Go to the next character */
00400                         continue;
00401                     }
00402                 }
00403             }
00404
00405             /* Copy the character into args */
00406             *walker2++ = theChar;
00407
00408             /* Repeat until we reach the end of arguments or we reach a space that is not inside quotes */
00409         }while( (*walker1 != '\0') && (((theChar = *walker1++) != ' ') || (Quote != '\0')) );
00410
00411         /* Null-terminate the last argument */
00412         *walker2++ = 0;
00413     }
00414
00415     return argc;
00416 }
00417
00424 bool LaunchDiff(const char* f1, const char* f2)
00425 {
00426 #if TARGET_RT_MAC_CFM
00427     const   OSType      kBBEditDiffCreatorCode  = FOUR_CHAR_CODE('BBds');
00428     const   OSType      kResourcererCreatorCode = FOUR_CHAR_CODE('Doug');
00429
00430     //  Resourcerer's Compare suite
00431     const   DescType    kAECompareClass = 'Comp';
00432     const   DescType    kAECompareEvent = 'Comp';
00433         const   DescType    keyNewer        = 'kNew';
00434         const   DescType    keyOlder        = 'kOld';
00435         const   DescType    keyShowDiff     = 'kShD';
00436         const   DescType    keyReturnDiff   = 'kRtD';
00437
00438     OSErr               e = noErr;
00439
00440     try {
00441         //  Convert to file specs
00442         Boolean             inShowDiffs = true;
00443         FSSpec              spec1 = GUSIFileSpec (f1);
00444         FSSpec              spec2 = GUSIFileSpec (f2);
00445
00446         //  Find the file type
00447         FInfo   info;
00448         e = ::FSpGetFInfo (&spec2, &info);
00449         ThrowIfOSErr_(e);
00450
00451         //  Decide on the application
00452         OSType              applCreator = FOUR_CHAR_CODE('????');
00453         switch (info.fdType) {
00454             case 'TEXT':
00455                 applCreator = kBBEditDiffCreatorCode;
00456                 break;
00457
00458             default:
00459                 applCreator = kResourcererCreatorCode;
00460                 break;
00461             } // switch
00462
00463         //  Try to launch it
00464         LaunchFlags         launchFlags = launchContinue + launchNoFileFlags;
00465         OSType              applType = FOUR_CHAR_CODE('APPL');
00466         FSSpec              applSpec;
00467         ProcessSerialNumber applPSN;
00468         if (!UProcess::Launch (applCreator, applType, launchFlags, &applSpec, &applPSN)) Throw_(fnfErr);
00469
00470         //  Now, diff the files.  We use the Resourcerer suite and a BBEdit glue applet.
00471             //  Create the parameters
00472         StAEDescriptor  newerDesc (spec1);
00473         StAEDescriptor  olderDesc (spec2);
00474         StAEDescriptor  showDesc (inShowDiffs);
00475
00476             //  Create the event
00477         StAEDescriptor  addressDesc (typeProcessSerialNumber, &applPSN, sizeof (applPSN));
00478
00479         StAEDescriptor  diffEvent;
00480         e = ::AECreateAppleEvent (kAECompareClass, kAECompareEvent, addressDesc, kAutoGenerateReturnID, kAnyTransactionID, diffEvent);
00481         ThrowIfOSErr_(e);
00482
00483             //  Add the parameters
00484         e = ::AEPutParamDesc (diffEvent, keyNewer, newerDesc);
00485         ThrowIfOSErr_(e);
00486         e = ::AEPutParamDesc (diffEvent, keyOlder, olderDesc);
00487         ThrowIfOSErr_(e);
00488         e = ::AEPutParamDesc (diffEvent, keyShowDiff, showDesc);
00489         ThrowIfOSErr_(e);
00490
00491             //  Send the event
00492         UAppleEventsMgr::SendAppleEvent (diffEvent);
00493
00494         return true;
00495         } // try
00496
00497     catch (LException ex) {
00498         } // catch
00499 #endif
00500
00501     if( gCvsPrefs.ExtDiff() == 0L )
00502     {
00503         cvs_err(_i18n("The external diff program is not defined.\n"));
00504         cvs_err(_i18n("You need to set it in the preferences dialog.\n"));
00505         return false;
00506     }
00507
00508 #ifdef WIN32
00509     CString args;
00510     CStr program, file1, file2;
00511
00512     if( strchr(gCvsPrefs.ExtDiff(), ' ') != 0L )
00513     {
00514         program << '\"';
00515         program << gCvsPrefs.ExtDiff();
00516         program << '\"';
00517     }
00518     else
00519         program = gCvsPrefs.ExtDiff();
00520
00521     if( strchr(f1, ' ') != 0L )
00522     {
00523         file1 << '\"';
00524         file1 << f1;
00525         file1 << '\"';
00526     }
00527     else
00528         file1 = f1;
00529
00530     if( strchr(f2, ' ') != 0L )
00531     {
00532         file2 << '\"';
00533         file2 << f2;
00534         file2 << '\"';
00535     }
00536     else
00537         file2 = f2;
00538
00539     args += file1;
00540     args += " ";
00541     args += file2;
00542
00543     CWnd* pMainWnd = AfxGetMainWnd();
00544     HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00545
00546     HINSTANCE hInst = ShellExecute(hParentWnd, NULL, gCvsPrefs.ExtDiff(), args, NULL, SW_SHOWDEFAULT);
00547
00548     if( (UINT)hInst < 32 )
00549     {
00550         // ExtDiff app was not found. Let's try to execute it from
00551         // the application path. However, this is done only when ExtDiff
00552         // value doesn't contain absolute path ("c:\subdir\" or "\subdir\").
00553         if( strchr(gCvsPrefs.ExtDiff(), ':') == 0L && (gCvsPrefs.ExtDiff()[0]) != '\\' )
00554         {
00555             CStr appPath;
00556
00557             ((CWincvsApp*)AfxGetApp())->GetAppPath(appPath);
00558             if( !appPath.endsWith(kPathDelimiter) )
00559                 appPath << kPathDelimiter;
00560
00561             appPath << gCvsPrefs.ExtDiff();
00562
00563             hInst = ShellExecute(hParentWnd, NULL, appPath, args, NULL, SW_SHOWDEFAULT);
00564         }
00565     }
00566
00567     if( (UINT)hInst < 32 )
00568     {
00569         LPVOID lpMsgBuf;
00570         FormatMessage(
00571             FORMAT_MESSAGE_ALLOCATE_BUFFER |
00572             FORMAT_MESSAGE_FROM_SYSTEM |
00573             FORMAT_MESSAGE_IGNORE_INSERTS,
00574             NULL,
00575             GetLastError(),
00576             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
00577             (LPTSTR)&lpMsgBuf,
00578             0,
00579             NULL
00580             );
00581
00582         cvs_err(_i18n("Unable to open '%s' (%s), using console instead\n"), (char*)gCvsPrefs.ExtDiff(), (LPCSTR)lpMsgBuf);
00583         // Free the buffer.
00584         LocalFree( lpMsgBuf );
00585         return false;
00586     }
00587
00588     return true;
00589 #elif qUnix
00590     CvsArgs args(false);
00591     args.add(gCvsPrefs.ExtDiff());
00592     args.add(f1);
00593     args.add(f2);
00594     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
00595     return true;
00596 #elif TARGET_RT_MAC_MACHO
00597     CvsArgs args(false);
00598     args.add(gCvsPrefs.ExtDiff());
00599     args.add(f1);
00600     args.add(f2);
00601     CMacCvsApp::gApp->Execute(args.Argc(), args.Argv());
00602     return true;
00603 #endif
00604 }
00605
00612 bool LaunchViewer(const char* filePath, bool useDefault /*= false*/)
00613 {
00614     bool res = false;
00615
00616 #ifdef WIN32
00617     if( !gCvsPrefs.UseViewerAlways() )
00618     {
00619         CStr folder, file;
00620         SplitPath(filePath, folder, file);
00621
00622         // MSS fix bug with files not being found by FindExecutable
00623         // (see Article ID: Q140724 for the problem desc of FindExecutable)
00624         if( !useDefault )
00625         {
00626             CWnd* pMainWnd = AfxGetMainWnd();
00627             HWND hParentWnd = pMainWnd ? pMainWnd->m_hWnd : NULL;
00628
00629             HINSTANCE hInst = ShellExecute(hParentWnd, "open", filePath, 0L, folder, SW_SHOWDEFAULT);
00630             if( (long)hInst < 32 )
00631             {
00632                 // If it failed because of no valid association and file has an extension then try the "Open with..." dialog instead
00633                 if( file.rfind('.') &&
00634                     (SE_ERR_NOASSOC == (long)hInst || SE_ERR_ASSOCINCOMPLETE == (long)hInst) )
00635                 {
00636                     SHELLEXECUTEINFO seInfo = { 0 };
00637                     seInfo.cbSize = sizeof(SHELLEXECUTEINFO);
00638                     seInfo.hwnd = hParentWnd;
00639                     seInfo.lpVerb = "openas";
00640                     seInfo.lpFile = filePath;
00641                     seInfo.lpDirectory = folder;
00642
00643                     if( ShellExecuteEx(&seInfo) )
00644                     {
00645                         res = true;
00646                     }
00647                 }
00648             }
00649             else
00650             {
00651                 res = true;
00652             }
00653
00654             if( !res )
00655             {
00656                 cvs_err(_i18n("Unable to open '%s' (error %d), using default viewer instead\n"), (char*)filePath, GetLastError());
00657             }
00658         }
00659     }
00660
00661     if( !res )
00662     {
00663         res = LaunchEditor(filePath);
00664     }
00665
00666 #endif /* WIN32 */
00667
00668 #ifdef qMacCvsPP
00669     res = true;
00670 #endif /* qMacCvsPP */
00671
00672 #if qUnix
00673     res = true;
00674 #endif // qUnix
00675
00676     return res;
00677 }
00678
00685 bool LaunchEditor(const char* filePath, void* par /*= 0L*/)
00686 {
00687     bool res = false;
00688
00689     if( gCvsPrefs.Viewer() == 0L )
00690     {
00691         cvs_err(_i18n("You need to define a default viewer in the preferences\n"));
00692         return false;
00693     }
00694
00695     CStr program, file;
00696
00697     if( strchr(gCvsPrefs.Viewer(), ' ') != 0L )
00698     {
00699         program << '\"';
00700         program << gCvsPrefs.Viewer();
00701         program << '\"';
00702     }
00703     else
00704         program = gCvsPrefs.Viewer();
00705
00706     if( strchr(filePath, ' ') != 0L )
00707     {
00708         file << '\"';
00709         file << filePath;
00710         file << '\"';
00711     }
00712     else
00713         file = filePath;
00714
00715     CStr command;
00716     command << program;
00717     command << " ";
00718     command << file;
00719
00720 #ifdef WIN32
00721     STARTUPINFO sStartupInfo = { 0 };
00722     PROCESS_INFORMATION sProcessInformation = { 0 };
00723
00724     // Execute the command with a call to the CreateProcess API call.
00725     sStartupInfo.cb = sizeof(sStartupInfo);
00726     sStartupInfo.dwFlags = STARTF_USESHOWWINDOW;
00727     sStartupInfo.wShowWindow = SW_SHOWNORMAL;
00728
00729     if( !CreateProcess( NULL,
00730         (char*)command,
00731         NULL,
00732         NULL,
00733         FALSE,
00734         0,
00735         NULL,
00736         NULL,
00737         &sStartupInfo,
00738         &sProcessInformation) )
00739     {
00740         sProcessInformation.hProcess = INVALID_HANDLE_VALUE;
00741         sProcessInformation.hThread = INVALID_HANDLE_VALUE;
00742     }
00743
00744     if( sProcessInformation.hProcess != INVALID_HANDLE_VALUE )
00745     {
00746         res = true;
00747     }
00748
00749     if( par )
00750     {
00751         *((PROCESS_INFORMATION*)par) = sProcessInformation;
00752     }
00753     else if( res )
00754     {
00755         CloseHandle(sProcessInformation.hProcess);
00756         CloseHandle(sProcessInformation.hThread);
00757     }
00758
00759 #endif /* WIN32 */
00760
00761 #ifdef qMacCvsPP
00762     res = true;
00763 #endif /* qMacCvsPP */
00764
00765 #if qUnix
00766     res = true;
00767 #endif // qUnix
00768
00769     return res;
00770 }
00771
00772 #ifdef WIN32
00773
00780 static void FlatenSubFolders(CStr& tmpf)
00781 {
00782     char* cp = (char*)tmpf;
00783
00784     if( cp )
00785     {
00786         while( *cp )
00787         {
00788             if( *cp == kPathDelimiter )
00789             {
00790                 *cp = '.';
00791             }
00792
00793             cp++;
00794         }
00795     }
00796 }
00797 #elif TARGET_OS_MAC
00798 static void FlatenSubFolders(CStr& tmpf)
00799 {
00800     char *tmp;
00801     if((tmp = strrchr(tmpf, kPathDelimiter)) != NULL)
00802     {
00803         UStr newStr(++tmp);
00804         tmpf = newStr;
00805     }
00806 }
00807 #else
00808 #define FlatenSubFolders(tmpf) // no-op on other platforms
00809 #endif
00810
00815 void CvsCmdMacrosAdmin(const char* macroName)
00816 {
00817     if( gCvsPrefs.empty() || !CTcl_Interp::IsAvail() )
00818         return;
00819
00820     CTcl_Interp interp;
00821     CStr path = macroName;
00822     CTcl_Interp::Unixfy(path);
00823     interp.DoScriptVar("source \"%s\"", (const char*)path);
00824 }
00825
00833 static bool CheckSelectionHandler(KiSelectionHandler& handler, MultiFiles*& mf, bool forceNormalize=false)
00834 {
00835     if( gCvsPrefs.empty() )
00836     {
00837         return false;
00838     }
00839
00840     mf = handler.GetSelection();
00841     if( !mf && handler.GetNeedSelection() )
00842     {
00843         return false;
00844     }
00845
00846     return ( forceNormalize || handler.NeedsNormalize() ) ? mf->Normalize() : true;
00847 }
00848
00852 void CvsCmdInit()
00853 {
00854     if( gCvsPrefs.empty() )
00855         return;
00856
00857     bool forceCvsroot;
00858
00859     if( !CompatGetInit(forceCvsroot) )
00860         return;
00861
00862     CvsArgs args;
00863
00864     if( forceCvsroot )
00865     {
00866         args.addcvsroot();
00867     }
00868
00869     args.add("init");
00870
00871     args.print();
00872     launchCVS(0L, args.Argc(), args.Argv());
00873 }
00874
00878 void CvsCmdLogin(void)
00879 {
00880     if( gCvsPrefs.empty() )
00881         return;
00882
00883     bool forceCvsroot;
00884
00885     if( !CompatGetLogin(forceCvsroot) )
00886         return;
00887
00888     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00889     if( !curModel->HasLogin() )
00890     {
00891         cvs_err(_i18n("Logging in is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00892             "Please consult the CVS manual for more details.\n"));
00893     }
00894
00895     if( gCvsPrefs.HasLoogedIn() && gCvsPrefs.LogoutTimeOut() > 0 )
00896     {
00897         cvs_err(_i18n("Making automatic logout:\n"));
00898         CvsCmdLogout();
00899         WaitForCvs();
00900     }
00901
00902     gCvsPrefs.SetHasLoogedIn(true);
00903
00904     CvsArgs args;
00905
00906     if( forceCvsroot )
00907     {
00908         args.addcvsroot();
00909     }
00910
00911     args.add("login");
00912
00913     args.print();
00914     launchCVS(0L, args.Argc(), args.Argv());
00915 }
00916
00920 void CvsCmdLogout(void)
00921 {
00922     if( gCvsPrefs.empty() )
00923         return;
00924
00925     AuthenModel* curModel = AuthenModel::GetInstance(gAuthen.kind());
00926     if( curModel->HasLogin() )
00927     {
00928         cvs_err(_i18n("Logging out is required for 'pserver' or 'sspi' authentication only (see Preferences dialog).\n"
00929             "Please consult the CVS manual for more details.\n"));
00930     }
00931
00932     gCvsPrefs.SetHasLoogedIn(false);
00933
00934     CvsArgs args;
00935
00936     args.add("logout");
00937
00938     args.print();
00939     launchCVS(0L, args.Argc(), args.Argv());
00940 }
00941
00946 void CvsCmdRtagCreate(KiSelectionHandler& handler)
00947 {
00948     MultiFiles* mf = NULL;
00949     if( !CheckSelectionHandler(handler, mf) )
00950         return;
00951
00952     bool norecurs;
00953     bool useMostRecent;
00954     bool overwriteExisting;
00955     bool lookAttic;
00956     CPStr modname;
00957     CPStr tagname;
00958     CPStr date;
00959     CPStr rev;
00960
00961     if( !CompatRtagCreate(mf, norecurs, overwriteExisting, tagname, modname, date, rev, useMostRecent, lookAttic) )
00962         return;
00963
00964     CvsArgs args;
00965     args.add("rtag");
00966
00967     if( norecurs )
00968         args.add("-l");
00969
00970     if( useMostRecent )
00971         args.add("-f");
00972
00973     if( overwriteExisting )
00974         args.add("-F");
00975
00976     if( lookAttic )
00977         args.add("-a");
00978
00979     if( !date.empty() )
00980     {
00981         args.add("-D");
00982         args.add(date);
00983     }
00984
00985     if( !rev.empty() )
00986     {
00987         args.add("-r");
00988         args.add(rev);
00989     }
00990
00991     args.add(tagname);
00992     args.add(modname);
00993
00994     args.print();
00995     launchCVS(0L, args.Argc(), args.Argv());
00996 }
00997
01002 void CvsCmdRtagDelete(KiSelectionHandler& handler)
01003 {
01004     MultiFiles* mf = NULL;
01005     if( !CheckSelectionHandler(handler, mf) )
01006         return;
01007
01008     bool norecurs;
01009     bool lookAttic;
01010     CPStr modname;
01011     CPStr tagname;
01012
01013     if( !CompatRtagDelete(mf, norecurs, lookAttic, tagname, modname) )
01014             return;
01015
01016     CvsArgs args;
01017     args.add("rtag");
01018     args.add("-d");
01019
01020     if( norecurs )
01021         args.add("-l");
01022
01023     if( lookAttic )
01024         args.add("-a");
01025
01026     args.add(tagname);
01027     args.add(modname);
01028
01029     args.print();
01030     launchCVS(0L, args.Argc(), args.Argv());
01031 }
01032
01037 void CvsCmdRtagBranch(KiSelectionHandler& handler)
01038 {
01039     MultiFiles* mf = NULL;
01040     if( !CheckSelectionHandler(handler, mf) )
01041         return;
01042
01043     bool norecurs;
01044     bool useMostRecent;
01045     bool lookAttic;
01046     CPStr modname;
01047     CPStr branchname;
01048     CPStr date;
01049     CPStr rev;
01050
01051     if( !CompatRtagBranch(mf, norecurs, branchname, modname, date, rev, useMostRecent, lookAttic) )
01052             return;
01053
01054     CvsArgs args;
01055     args.add("rtag");
01056     args.add("-b");
01057
01058     if( norecurs )
01059         args.add("-l");
01060
01061     if( useMostRecent )
01062         args.add("-f");
01063
01064     if( lookAttic )
01065         args.add("-a");
01066
01067     if( !date.empty() )
01068     {
01069         args.add("-D");
01070         args.add(date);
01071     }
01072
01073     if( !rev.empty() )
01074     {
01075         args.add("-r");
01076         args.add(rev);
01077     }
01078
01079     args.add(branchname);
01080     args.add(modname);
01081
01082     args.print();
01083     launchCVS(0L, args.Argc(), args.Argv());
01084 }
01085
01090 void CvsCmdCheckoutModule(KiSelectionHandler& handler)
01091 {
01092     MultiFiles* mf = NULL;
01093     if( !CheckSelectionHandler(handler, mf) )
01094         return;
01095
01096     MultiFiles::const_iterator mfi = mf->begin();
01097     const char* dir = mfi->getdir();
01098     bool norecurs;
01099     CPStr modname;
01100     CPStr path(dir);
01101     bool toStdout;
01102     CPStr date;
01103     CPStr rev;
01104     bool useMostRecent;
01105     CPStr rev1;
01106     CPStr rev2;
01107     bool doexport;
01108     bool forceCvsroot;
01109     bool overrideCheckoutDir;
01110     CPStr checkoutDir;
01111     CPStr keyword;
01112
01113     if( !CompatGetCheckout(mf, modname, path, norecurs,
01114         toStdout, date, rev, useMostRecent, rev1, rev2, doexport, forceCvsroot,
01115         overrideCheckoutDir, checkoutDir, keyword) )
01116     {
01117         return;
01118     }
01119
01120     CvsArgs args;
01121
01122     if( forceCvsroot )
01123     {
01124         args.addcvsroot();
01125     }
01126
01127     args.add(doexport ? "export" : "checkout");
01128
01129     if( !keyword.empty() )
01130     {
01131         args.add(keyword);
01132     }
01133
01134     if( gCvsPrefs.PruneOption() && !doexport )
01135         args.add("-P");
01136
01137     if( norecurs )
01138         args.add("-l");
01139
01140     if( toStdout )
01141         args.add("-p");
01142
01143     if( useMostRecent )
01144         args.add("-f");
01145
01146     if( !rev1.empty() )
01147     {
01148         CPStr tmp;
01149         tmp = "-j";
01150         tmp << rev1;
01151         args.add(tmp);
01152     }
01153
01154     if( !rev2.empty() )
01155     {
01156         CPStr tmp;
01157         tmp = "-j";
01158         tmp << rev2;
01159         args.add(tmp);
01160     }
01161
01162     if( !date.empty() )
01163     {
01164         args.add("-D");
01165         args.add(date);
01166     }
01167
01168     if( !rev.empty() )
01169     {
01170         args.add("-r");
01171         args.add(rev);
01172     }
01173
01174     if( doexport && rev.empty() && date.empty() )
01175     {
01176         args.add("-r");
01177         args.add("HEAD");
01178     }
01179
01180     if( overrideCheckoutDir )
01181     {
01182         args.add("-d");
01183         args.add(checkoutDir);
01184     }
01185
01186     args.add(modname);
01187
01188     args.print(path);
01189     launchCVS(path, args.Argc(), args.Argv());
01190 }
01191
01196 void CvsCmdImportModule(KiSelectionHandler& handler)
01197 {
01198     MultiFiles* mf = NULL;
01199     if( !CheckSelectionHandler(handler, mf) )
01200         return;
01201
01202     MultiFiles::const_iterator mfi;
01203     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01204     {
01205         ReportConflict* entries;
01206         ReportWarning* warnings;
01207         const char* dir = mfi->getdir();
01208
01209         if( !CompatImportFilter(dir, entries, warnings) )
01210             return;
01211
01212         CPStr modname, vendortag, reltag, path(dir);
01213         CStr logmsg;
01214         bool useDefIgnore;
01215         bool useFilesTime;
01216
01217         if( !CompatGetImport(mf, modname, logmsg, vendortag, reltag, path, useDefIgnore, useFilesTime) )
01218             return;
01219
01220         CvsArgs args;
01221         args.add("import");
01222
01223         if( useFilesTime )
01224         {
01225             args.add("-d");
01226         }
01227
01228         // fill the wrappers
01229         ReportConflict* tmpentry = entries;
01230
01231         if( !useDefIgnore )
01232         {
01233             args.add("-I"); // no default (core, *.o...)
01234             args.add("!");
01235             args.add("-I"); // but ignore the CVS folders
01236             args.add("CVS");
01237         }
01238
01239         while( tmpentry != 0L )
01240         {
01241             if( tmpentry->HasIgnore() )
01242             {
01243                 CPStr ign;
01244                 args.add("-I");
01245
01246                 if( tmpentry->IsExtension() )
01247                     ign << '*';
01248
01249                 ign << tmpentry->GetPattern();
01250                 args.add(ign);
01251             }
01252             else if( !tmpentry->HasForceText() &&
01253                 (tmpentry->IsBinary() || tmpentry->HasForceBinary() || tmpentry->HasForceNoKeywords() ||
01254                 tmpentry->IsUnicode() || tmpentry->HasForceUnicode()) )
01255             {
01256                 CPStr wrap;
01257                 const char* pattern = tmpentry->GetPattern();
01258                 bool hasSpace = strchr(pattern, ' ') != 0L;
01259                 args.add("-W");
01260
01261                 if( hasSpace )
01262                     wrap << '"';
01263
01264                 if( tmpentry->IsExtension() )
01265                     wrap << '*';
01266
01267                 wrap << pattern;
01268
01269                 if( hasSpace )
01270                     wrap << '"';
01271
01272                 if( tmpentry->HasForceNoKeywords() )
01273                 {
01274                     wrap << " -k 'o'";
01275                 }
01276                 else if( tmpentry->HasForceBinary() )
01277                 {
01278                     wrap << " -k 'b'";
01279                 }
01280                 else if( tmpentry->HasForceUnicode() )
01281                 {
01282                     wrap << " -k 'u'";
01283                 }
01284                 else if( tmpentry->IsBinary() )
01285                 {
01286                     wrap << " -k 'b'";
01287                 }
01288                 else if( tmpentry->IsUnicode() )
01289                 {
01290                     wrap << " -k 'u'";
01291                 }
01292
01293                 args.add(wrap);
01294             }
01295
01296             tmpentry = tmpentry->next;
01297         }
01298
01299         free_list_types(warnings, entries);
01300
01301         args.add("-m");
01302         args.add(CleanupLogMsg(logmsg));
01303         args.add(modname);
01304         args.add(vendortag);
01305         args.add(reltag);
01306
01307         args.print(path);
01308         launchCVS(path, args.Argc(), args.Argv());
01309     }
01310 }
01311
01316 void CvsCmdCommandLine(KiSelectionHandler& handler)
01317 {
01318     MultiFiles* mf = NULL;
01319     if( !CheckSelectionHandler(handler, mf) )
01320         return;
01321
01322     CStr dir;
01323     CStr cmd;
01324     bool addDefault;
01325     bool addSelection;
01326     bool forceCvsroot;
01327
01328     if( !CompatGetCommand(mf, cmd, dir, addDefault, addSelection, forceCvsroot) )
01329         return;
01330
01331     char* argv[MAX_ARGS];
01332     int argc = StringToArgv(cmd.c_str(), argv);
01333
01334     if( addSelection )
01335     {
01336         MultiFiles::const_iterator mfi;
01337         for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01338         {
01339             CvsArgs args(addDefault);
01340
01341             if( addDefault && forceCvsroot )
01342             {
01343                 args.addcvsroot();
01344             }
01345
01346             for(int i = 0; i < argc; i++)
01347             {
01348                 if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01349                 {
01350                     // Skip the "cvs" arguments as it's already added by args constructor
01351                     continue;
01352                 }
01353
01354                 args.add(argv[i]);
01355
01356                 if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01357                 {
01358                     args.addcvsroot();
01359                 }
01360             }
01361
01362             const char* dir = mfi->add(args);
01363             args.print(dir);
01364             launchCVS(dir, args.Argc(), args.Argv());
01365         }
01366     }
01367     else
01368     {
01369         CvsArgs args(addDefault);
01370
01371         if( addDefault && forceCvsroot )
01372         {
01373             args.addcvsroot();
01374         }
01375
01376         for(int i = 0; i < argc; i++)
01377         {
01378             if( addDefault && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01379             {
01380                 // Skip the "cvs" arguments as it's already added by args constructor
01381                 continue;
01382             }
01383
01384             args.add(argv[i]);
01385
01386             if( !addDefault && forceCvsroot && i == 0 && strcmp(argv[i], CVS_CMD) == 0 )
01387             {
01388                 args.addcvsroot();
01389             }
01390         }
01391
01392         args.print(dir);
01393         launchCVS(dir, args.Argc(), args.Argv());
01394     }
01395 }
01396
01401 void CvsCmdCancelChanges(KiSelectionHandler& handler)
01402 {
01403     MultiFiles* mf = NULL;
01404     if( !CheckSelectionHandler(handler, mf) )
01405         return;
01406
01407     MultiFiles::const_iterator mfi;
01408     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01409     {
01410         RemoveCvsArgs args;
01411         args.add("update");
01412
01413         const char* dir = mfi->add(args);
01414         args.print(dir);
01415         launchCVS(dir, args.Argc(), args.Argv());
01416     }
01417 }
01418
01424 void CvsCmdUpdate(KiSelectionHandler& handler, bool queryOnly)
01425 {
01426     MultiFiles* mf = NULL;
01427     if( !CheckSelectionHandler(handler, mf) )
01428         return;
01429
01430     bool toStdout;
01431     bool noRecurs;
01432     bool resetSticky;
01433     CPStr date;
01434     CPStr rev;
01435     bool useMostRecent;
01436     CPStr rev1;
01437     CPStr rev2;
01438     bool createMissDir;
01439     bool getCleanCopy;
01440     CPStr keyword;
01441
01442     if( !queryOnly && !CompatGetUpdate(mf, toStdout, noRecurs, resetSticky,
01443         date, rev, useMostRecent, rev1, rev2, createMissDir, getCleanCopy, keyword) )
01444         return;
01445
01446     MultiFiles::const_iterator mfi;
01447     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01448     {
01449         CvsArgs args;
01450
01451         if( queryOnly )
01452             args.add("-n");
01453
01454         args.add("update");
01455
01456         if( !keyword.empty() )
01457         {
01458             args.add(keyword);
01459         }
01460
01461         if( gCvsPrefs.PruneOption() )
01462             args.add("-P");
01463
01464         if( !queryOnly )
01465         {
01466             if( resetSticky )
01467                 args.add("-A");
01468
01469             if( createMissDir )
01470                 args.add("-d");
01471
01472             if( getCleanCopy )
01473                 args.add("-C");
01474
01475             if( !date.empty() )
01476             {
01477                 args.add("-D");
01478                 args.add(date);
01479             }
01480
01481             if( useMostRecent )
01482                 args.add("-f");
01483
01484             if( !rev1.empty() )
01485             {
01486                 CPStr tmp;
01487                 tmp = "-j";
01488                 tmp << rev1;
01489                 args.add(tmp);
01490             }
01491
01492             if( !rev2.empty() )
01493             {
01494                 CPStr tmp;
01495                 tmp = "-j";
01496                 tmp << rev2;
01497                 args.add(tmp);
01498             }
01499
01500             if( noRecurs )
01501                 args.add("-l");
01502
01503             if( toStdout )
01504                 args.add("-p");
01505
01506             if( !rev.empty() )
01507             {
01508                 args.add("-r");
01509                 args.add(rev);
01510             }
01511         }
01512
01513         const char* dir = mfi->add(args);
01514         args.print(dir);
01515         launchCVS(dir, args.Argc(), args.Argv());
01516     }
01517 }
01518
01523 void CvsCmdCommit(KiSelectionHandler& handler)
01524 {
01525     MultiFiles* mf = NULL;
01526     if( !CheckSelectionHandler(handler, mf) )
01527         return;
01528
01529     bool firstTime = true;
01530     bool norecurs;
01531     CStr logmsg;
01532     bool forceCommit;
01533     bool forceRecurse;
01534     CPStr rev;
01535     bool noModuleProgram;
01536     bool checkValidEdits;
01537
01538     MultiFiles::const_iterator mfi;
01539     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01540     {
01541         if( firstTime )
01542         {
01543             // we have to give the path where the commit is done is
01544             // the user expects to fill the CVS/Template file. we just
01545             // grab the first one for this purpose.
01546             CStr pathTmpl;
01547             pathTmpl = mfi->getdir();
01548
01549             if( !CompatGetCommit(mf, logmsg, norecurs, forceCommit, forceRecurse, rev, noModuleProgram, checkValidEdits, pathTmpl) )
01550                 return;
01551
01552             firstTime = false;
01553         }
01554
01555         CvsArgs args;
01556         args.add("commit");
01557
01558         if( checkValidEdits )
01559             args.add("-c");
01560
01561         if( norecurs )
01562             args.add("-l");
01563
01564         if( noModuleProgram )
01565             args.add("-n");
01566
01567         if( forceCommit )
01568             args.add("-f");
01569
01570         if( forceRecurse )
01571             args.add("-R");
01572
01573         args.add("-m");
01574         args.add(CleanupLogMsg(logmsg));
01575
01576         if( !rev.empty() )
01577         {
01578             args.add("-r");
01579             args.add(rev);
01580         }
01581
01582         const char* dir = mfi->add(args);
01583         args.print(dir);
01584         launchCVS(dir, args.Argc(), args.Argv());
01585     }
01586 }
01587
01593 void CvsCmdDiff(KiSelectionHandler& handler, kDiffCmdType diffType)
01594 {
01595     MultiFiles* mf = NULL;
01596     if( !CheckSelectionHandler(handler, mf) )
01597         return;
01598
01599     bool noRecurs;
01600     bool isDate1;
01601     bool isDate2;
01602     bool useExtDiff;
01603     CPStr rev1;
01604     CPStr rev2;
01605     bool unifiedDiff;
01606     bool noWhiteSpace;
01607     bool noBlankLines;
01608     bool ignoreCase;
01609     bool extDiffResult;
01610     CPStr diffOptions;
01611     CPStr keyword;
01612
01613     if ( diffType == kDiffGraph )
01614     {
01615       // determine initial revision settings
01616       //
01617       if ( mf->TotalNumFiles() > 0 )
01618       {
01619         const MultiFilesEntry&  mfe = *mf->begin();
01620         CStr              ignorePath, ignoreName, rev;
01621         switch ( mfe.NumFiles() )
01622       {
01623         case 2:
01624           if ( mfe.get(1, ignorePath, ignoreName, rev) ) rev2 = rev;
01625           // fall thru
01626         case 1:
01627           if ( mfe.get(0, ignorePath, ignoreName, rev) ) rev1 = rev;
01628           break;
01629       }
01630       }
01631     }
01632
01633     if( !CompatGetDiff(mf, diffType, noRecurs, isDate1, isDate2, rev1, rev2, useExtDiff,
01634         unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase, keyword, diffOptions,
01635         mf->TotalNumFiles() > 0) )
01636     {
01637         return;
01638     }
01639
01640     MultiFiles::const_iterator mfi;
01641     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01642     {
01643         extDiffResult = false;
01644
01645         if( mfi->NumFiles() && useExtDiff )
01646         {
01647             CStr path, filename, ext, base, currRev;
01648             CStr file1, file2;
01649
01650             for(int i = 0; ; i++)
01651             {
01652                 if( !mfi->get(i, path, filename, currRev) )
01653                     break;
01654
01655                 if( 0 < i && kDiffGraph == diffType )
01656                 {
01657                     // Graph diff contains two files, but it's actually the same one
01658                     break;
01659                 }
01660
01661                 // note that filename can contain subfolders
01662
01663                 GetExtension(filename, base, ext);
01664
01665                 CvsArgs args;
01666                 CStr tmpf(base);
01667                 tmpf << '_';
01668
01669                 if( !rev1.empty() )
01670                     tmpf << rev1;
01671                 else
01672                     tmpf << currRev;
01673
01674                 tmpf << '_';
01675
01676                 // convert subfolder names to regular name
01677                 FlatenSubFolders(tmpf);
01678
01679                 args.add("update");
01680                 args.add("-p");
01681
01682                 if( !rev1.empty() )
01683                 {
01684                     args.add(isDate1 ? "-D" : "-r");
01685                     args.add(rev1);
01686                 }
01687                 else if( !currRev.empty() )
01688                 {
01689                     args.add("-r");
01690                     args.add(currRev);
01691                 }
01692
01693                 args.add(filename);
01694                 args.print(path);
01695                 file1 = launchCVS(path, args, (const char *)tmpf, ext);
01696
01697 #if TARGET_RT_MAC_CFM
01698                 decodeCVS (file1);
01699 #endif
01700
01701                 if( rev2.empty() )
01702                 {
01703                     file2 = path;
01704
01705                     if( !file2.endsWith(kPathDelimiter) )
01706                         file2 << kPathDelimiter;
01707
01708                     file2 << filename;
01709                 }
01710                 else
01711                 {
01712                     CvsArgs args2;
01713
01714                     tmpf = base;
01715                     tmpf << '_';
01716                     tmpf << rev2;
01717                     tmpf << '_';
01718
01719                     // convert subfolder names to regular name
01720                     FlatenSubFolders(tmpf);
01721
01722                     args2.add("update");
01723                     args2.add("-p");
01724                     args2.add(isDate2 ? "-D" : "-r");
01725                     args2.add(rev2);
01726                     args2.add(filename);
01727                     args2.print(path);
01728                     file2 = launchCVS(path, args2, (const char *)tmpf, ext);
01729 #if TARGET_RT_MAC_CFM
01730                     decodeCVS (file2);
01731 #endif
01732                 }
01733
01734                 if( file1.empty() || file2.empty() )
01735                     continue;
01736
01737                 extDiffResult = LaunchDiff(file1, file2);
01738             }
01739         }
01740
01741         if( !mfi->NumFiles() || !useExtDiff || !extDiffResult )
01742         {
01743             CvsArgs args;
01744             args.add("diff");
01745
01746             if( noRecurs )
01747                 args.add("-l");
01748
01749             if( !rev1.empty() )
01750             {
01751                 args.add(isDate1 ? "-D" : "-r");
01752                 args.add(rev1);
01753             }
01754
01755             if( !rev2.empty() )
01756             {
01757                 args.add(isDate2 ? "-D" : "-r");
01758                 args.add(rev2);
01759             }
01760
01761             if( unifiedDiff )
01762                 args.add("-u");     // --unified, -u
01763
01764             if( noWhiteSpace )
01765                 args.add("-wb");    //--ignore-all-space --ignore-space-change
01766
01767             if( noBlankLines )
01768                 args.add("-B");     //--ignore-blank-lines
01769
01770             if( ignoreCase )
01771                 args.add("-i");     //--ignore-case
01772
01773             if( !keyword.empty() )
01774             {
01775                 args.add(keyword);
01776             }
01777
01778             if( !diffOptions.empty() )
01779             {
01780                 args.add(diffOptions);
01781             }
01782
01783             const char* dir = mfi->add(args);
01784             args.print(dir);
01785             launchCVS(dir, args.Argc(), args.Argv());
01786         }
01787     }
01788 }
01789
01795 void CvsCmdAdd(KiSelectionHandler& handler, kAddCmdType addType /*= kAddNormal*/)
01796 {
01797     MultiFiles* mf = NULL;
01798     if( !CheckSelectionHandler(handler, mf) )
01799         return;
01800
01801     MultiFiles::const_iterator mfi;
01802     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01803     {
01804         if( mfi->NumFiles() > 0 )
01805         {
01806             // Files
01807             ControlCvsArgs* args = NULL;
01808             switch( addType )
01809             {
01810             default:
01811             case kAddNormal:
01812                 args = new AddCvsArgs;
01813                 break;
01814             case kAddBinary:
01815                 args = new AddBinCvsArgs;
01816                 break;
01817             case kAddUnicode:
01818                 args = new AddUnicodeCvsArgs;
01819                 break;
01820             }
01821
01822             if( !args )
01823             {
01824                 cvs_err("Unable to allocate memory for arguments list\n");
01825                 return;
01826             }
01827
01828             args->add("add");
01829
01830             if( addType == kAddBinary )
01831             {
01832                 args->add("-kb");
01833             }
01834             else if( addType == kAddUnicode )
01835             {
01836                 args->add("-ku");
01837             }
01838
01839             const char* dir = mfi->add(*args);
01840
01841             if( !args->HasProblem() ||
01842                 !CvsAlert(_i18n("Some problems have been found while adding files and should be corrected"), _i18n("Cancel"), _i18n("Ignore")) )
01843             {
01844                 args->print(dir);
01845                 launchCVS(dir, args->Argc(), args->Argv());
01846             }
01847
01848             delete args;
01849         }
01850         else
01851         {
01852             // Directory
01853             const char* dir = mfi->getdir();
01854             CStr uppath, folder;
01855
01856             if( !SplitPath(dir, uppath, folder) )
01857             {
01858                 cvs_err(_i18n("Unable to convert path name '%s'\n"), dir);
01859                 return;
01860             }
01861
01862             CvsArgs args;
01863             args.add("add");
01864             args.add(folder);
01865
01866             args.print(uppath);
01867             launchCVS(uppath, args.Argc(), args.Argv());
01868         }
01869     }
01870 }
01871
01876 void CvsCmdRemove(KiSelectionHandler& handler)
01877 {
01878     MultiFiles* mf = NULL;
01879     if( !CheckSelectionHandler(handler, mf) )
01880         return;
01881
01882     MultiFiles::const_iterator mfi;
01883     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01884     {
01885         RemoveCvsArgs args;
01886
01887         CompatBeginMoveToTrash();
01888
01889         args.add("remove");
01890         const char* dir = mfi->add(args);
01891         args.print(dir);
01892
01893         CompatEndMoveToTrash();
01894
01895         launchCVS(dir, args.Argc(), args.Argv());
01896     }
01897 }
01898
01905 void CvsCmdLog(KiSelectionHandler& handler, bool outGraph, void* defWnd)
01906 {
01907     MultiFiles* mf = NULL;
01908     if( !CheckSelectionHandler(handler, mf) )
01909         return;
01910
01911     bool noRecurs;
01912     bool defBranch;
01913     CPStr date;
01914     bool headerOnly;
01915     bool headerDesc;
01916     bool supress;
01917     bool noTags;
01918     bool onlyRCSfile;
01919     bool hasRev;
01920     CPStr rev;
01921     CPStr states;
01922     bool hasUser;
01923     CPStr users;
01924
01925     if( !CompatGetLog(mf, noRecurs, defBranch, date,
01926         headerOnly, headerDesc, supress,
01927         noTags, onlyRCSfile, hasRev,
01928         rev, states, hasUser, users,
01929         outGraph) )
01930     {
01931         return;
01932     }
01933
01934     MultiFiles::const_iterator mfi;
01935     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
01936     {
01937         CvsArgs args;
01938         args.add("log");
01939
01940         if( noRecurs )
01941             args.add("-l");
01942
01943         if( defBranch )
01944             args.add("-b");
01945
01946         if( headerDesc )
01947         {
01948             args.add("-t");
01949         }
01950         else
01951         {
01952             if( headerOnly )
01953                 args.add("-h");
01954         }
01955
01956         if( supress )
01957             args.add("-S");
01958
01959         if( noTags )
01960             args.add("-N");
01961
01962         if( onlyRCSfile )
01963             args.add("-R");
01964
01965         if( !date.empty() )
01966         {
01967             args.add("-d");
01968             args.add(date);
01969         }
01970
01971         if( !states.empty() )
01972         {
01973             args.add("-s");
01974             args.add(states);
01975         }
01976
01977         if( hasRev )
01978         {
01979             CPStr tmp;
01980             tmp = "-r";
01981             tmp << rev;
01982             args.add(tmp);
01983         }
01984
01985         if( hasUser )
01986         {
01987             CPStr tmp;
01988             tmp = "-w";
01989             tmp << users;
01990             args.add(tmp);
01991         }
01992
01993         const char* dir = mfi->add(args);
01994         args.print(dir);
01995         CvsLogParse(dir, args, outGraph, defWnd);
01996     }
01997 }
01998
02003 void CvsCmdStatus(KiSelectionHandler& handler)
02004 {
02005     MultiFiles* mf = NULL;
02006     if( !CheckSelectionHandler(handler, mf) )
02007         return;
02008
02009     bool noRecurs = false;
02010     STATUSOUTPUT_TYPE outputType = STATUSOUTPUT_VERBOSE;
02011
02012     if( !CompatGetStatus(mf, noRecurs, outputType) )
02013         return;
02014
02015     MultiFiles::const_iterator mfi;
02016     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02017     {
02018         CvsArgs args;
02019         args.add("status");
02020
02021         if( noRecurs )
02022             args.add("-l");
02023
02024         if( STATUSOUTPUT_VERBOSE == outputType )
02025         {
02026             args.add("-v");
02027         }
02028         else if( STATUSOUTPUT_QUICK == outputType )
02029         {
02030             args.add("-q");
02031         }
02032
02033         const char* dir = mfi->add(args);
02034         args.print(dir);
02035         launchCVS(dir, args.Argc(), args.Argv());
02036     }
02037 }
02038
02043 void CvsCmdLock(KiSelectionHandler& handler)
02044 {
02045     MultiFiles* mf = NULL;
02046     if( !CheckSelectionHandler(handler, mf) )
02047         return;
02048
02049     MultiFiles::const_iterator mfi;
02050     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02051     {
02052         CvsArgs args;
02053         args.add("admin");
02054         args.add("-l");
02055
02056         const char* dir = mfi->add(args);
02057         args.print(dir);
02058         launchCVS(dir, args.Argc(), args.Argv());
02059     }
02060 }
02061
02066 void CvsCmdUnlock(KiSelectionHandler& handler)
02067 {
02068     MultiFiles* mf = NULL;
02069     if( !CheckSelectionHandler(handler, mf) )
02070         return;
02071
02072     MultiFiles::const_iterator mfi;
02073     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02074     {
02075         CvsArgs args;
02076         args.add("admin");
02077         args.add("-u");
02078
02079         const char* dir = mfi->add(args);
02080         args.print(dir);
02081         launchCVS(dir, args.Argc(), args.Argv());
02082     }
02083 }
02084
02089 void CvsCmdTagCreate(KiSelectionHandler& handler)
02090 {
02091     MultiFiles* mf = NULL;
02092     if( !CheckSelectionHandler(handler, mf) )
02093         return;
02094
02095     bool noRecurs, overwriteExisting, checkUnmod;
02096     CPStr tagName;
02097
02098     if( !CompatTagCreate(mf, noRecurs, overwriteExisting, tagName, checkUnmod) )
02099         return;
02100
02101     MultiFiles::const_iterator mfi;
02102     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02103     {
02104         CvsArgs args;
02105         args.add("tag");
02106
02107         if( noRecurs )
02108             args.add("-l");
02109
02110         if( overwriteExisting )
02111             args.add("-F");
02112
02113         if( checkUnmod )
02114             args.add("-c");
02115
02116         args.add(tagName);
02117
02118         const char* dir = mfi->add(args);
02119         args.print(dir);
02120         launchCVS(dir, args.Argc(), args.Argv());
02121     }
02122 }
02123
02128 void CvsCmdTagDelete(KiSelectionHandler& handler)
02129 {
02130     MultiFiles* mf = NULL;
02131     if( !CheckSelectionHandler(handler, mf) )
02132         return;
02133
02134     bool noRecurs;
02135     CPStr tagName;
02136
02137     if( !CompatTagDelete(mf, noRecurs, tagName) )
02138         return;
02139
02140     MultiFiles::const_iterator mfi;
02141     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02142     {
02143         CvsArgs args;
02144         args.add("tag");
02145         args.add("-d");
02146
02147         if( noRecurs )
02148             args.add("-l");
02149
02150         args.add(tagName);
02151
02152         const char* dir = mfi->add(args);
02153         args.print(dir);
02154         launchCVS(dir, args.Argc(), args.Argv());
02155     }
02156 }
02157
02162 void CvsCmdTagBranch(KiSelectionHandler& handler)
02163 {
02164     MultiFiles* mf = NULL;
02165     if( !CheckSelectionHandler(handler, mf) )
02166         return;
02167
02168     bool noRecurs, checkUnmod;
02169     CPStr branchName;
02170
02171     if( !CompatTagBranch(mf, noRecurs, branchName, checkUnmod) )
02172         return;
02173
02174     MultiFiles::const_iterator mfi;
02175     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02176     {
02177         CvsArgs args;
02178         args.add("tag");
02179         args.add("-b");
02180
02181         if( noRecurs )
02182             args.add("-l");
02183
02184         if( checkUnmod )
02185             args.add("-c");
02186
02187         args.add(branchName);
02188
02189         const char* dir = mfi->add(args);
02190         args.print(dir);
02191         launchCVS(dir, args.Argc(), args.Argv());
02192     }
02193 }
02194
02200 void CvsCmdEdit(KiSelectionHandler& handler, kEditCmdType editType /*= kNormal*/)
02201 {
02202     MultiFiles* mf = NULL;
02203     if( !CheckSelectionHandler(handler, mf) )
02204         return;
02205
02206     MultiFiles::const_iterator mfi;
02207     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02208     {
02209         CvsArgs args;
02210         args.add("edit");
02211
02212         switch( editType )
02213         {
02214         default:
02215         case kEditNormal:
02216             // intentionally blank
02217             break;
02218         case kEditReserved:
02219             args.add("-c");
02220             break;
02221         case kEditForce:
02222             args.add("-f");
02223             break;
02224         }
02225
02226         const char* dir = mfi->add(args);
02227         args.print(dir);
02228         launchCVS(dir, args.Argc(), args.Argv());
02229     }
02230 }
02231
02236 void CvsCmdUnedit(KiSelectionHandler& handler)
02237 {
02238     MultiFiles* mf = NULL;
02239     if( !CheckSelectionHandler(handler, mf) )
02240         return;
02241
02242     MultiFiles::const_iterator mfi;
02243     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02244     {
02245         CvsArgs args;
02246         args.add("unedit");
02247
02248         const char* dir = mfi->add(args);
02249         args.print(dir);
02250         launchCVS(dir, args.Argc(), args.Argv());
02251     }
02252 }
02253
02258 void CvsCmdWatchOn(KiSelectionHandler& handler)
02259 {
02260     MultiFiles* mf = NULL;
02261     if( !CheckSelectionHandler(handler, mf) )
02262         return;
02263
02264     MultiFiles::const_iterator mfi;
02265     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02266     {
02267         CvsArgs args;
02268         args.add("watch");
02269         args.add("add");
02270
02271         const char* dir = mfi->add(args);
02272         args.print(dir);
02273         launchCVS(dir, args.Argc(), args.Argv());
02274     }
02275 }
02276
02281 void CvsCmdWatchOff(KiSelectionHandler& handler)
02282 {
02283     MultiFiles* mf = NULL;
02284     if( !CheckSelectionHandler(handler, mf) )
02285         return;
02286
02287     MultiFiles::const_iterator mfi;
02288     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02289     {
02290         CvsArgs args;
02291         args.add("watch");
02292         args.add("remove");
02293
02294         const char* dir = mfi->add(args);
02295         args.print(dir);
02296         launchCVS(dir, args.Argc(), args.Argv());
02297     }
02298 }
02299
02304 void CvsCmdRelease(KiSelectionHandler& handler)
02305 {
02306     MultiFiles* mf = NULL;
02307     if( !CheckSelectionHandler(handler, mf) )
02308         return;
02309
02310     CStr dir;
02311     if( !mf->getdir(0, dir) )
02312     {
02313         return;
02314     }
02315
02316     CStr uppath, folder;
02317     if( !SplitPath(dir, uppath, folder) )
02318     {
02319         cvs_err(_i18n("Unable to convert path name '%s'\n"), dir.c_str());
02320
02321         // Even thought something didn't work we will try to continue and put all the responsibility onto the user
02322         uppath = dir;
02323         folder = ".";
02324     }
02325
02326     kReleaseDelType removeDirectoryOption = kReleaseNoDel;
02327
02328     if( !CompatGetRelease(mf, dir, removeDirectoryOption) )
02329     {
02330         return;
02331     }
02332
02333     CvsArgs args;
02334     args.add("release");
02335
02336     switch( removeDirectoryOption )
02337     {
02338     default:
02339     case kReleaseNoDel:
02340         break;
02341     case kReleaseDelDir:
02342         args.add("-d");
02343         break;
02344     case kReleaseDelAll:
02345         args.add("-f");
02346         break;
02347     case kReleaseDelCvsInfo:
02348         args.add("-e");
02349         break;
02350     }
02351
02352     args.add(folder);
02353
02354     args.print(uppath);
02355     launchCVS(uppath, args.Argc(), args.Argv());
02356 }
02357
02362 void CvsCmdWatchers(KiSelectionHandler& handler)
02363 {
02364     MultiFiles* mf = NULL;
02365     if( !CheckSelectionHandler(handler, mf) )
02366         return;
02367
02368     MultiFiles::const_iterator mfi;
02369     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02370     {
02371         CvsArgs args;
02372         args.add("watchers");
02373
02374         const char* dir = mfi->add(args);
02375         args.print(dir);
02376         launchCVS(dir, args.Argc(), args.Argv());
02377     }
02378 }
02379
02384 void CvsCmdEditors(KiSelectionHandler& handler)
02385 {
02386     MultiFiles* mf = NULL;
02387     if( !CheckSelectionHandler(handler, mf) )
02388         return;
02389
02390     MultiFiles::const_iterator mfi;
02391     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02392     {
02393         CvsArgs args;
02394         args.add("editors");
02395
02396         const char* dir = mfi->add(args);
02397         args.print(dir);
02398         launchCVS(dir, args.Argc(), args.Argv());
02399     }
02400 }
02401
02406 void CvsCmdAnnotate(KiSelectionHandler& handler)
02407 {
02408     MultiFiles* mf = NULL;
02409     if( !CheckSelectionHandler(handler, mf) )
02410         return;
02411
02412     bool noRecurs;
02413     bool isDate;
02414     CPStr rev;
02415     bool force;
02416
02417     if( !CompatGetAnnotate(mf, noRecurs, isDate, rev, force) )
02418         return;
02419
02420     MultiFiles::const_iterator mfi;
02421     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02422     {
02423         CStr path, filename, ext, base, currRev;
02424         CStr file;
02425
02426         for(int i = 0; ; i++)
02427         {
02428             if( !mfi->get(i, path, filename, currRev) )
02429                 break;
02430
02431             // note that filename can contain subfolders
02432
02433             GetExtension(filename, base, ext);
02434
02435             CvsArgs args;
02436             CStr tmpf(base);
02437
02438             if( !rev.empty() )
02439             {
02440                 tmpf << "_ann_";
02441                 tmpf << rev;
02442                 tmpf << '_';
02443             }
02444             else
02445                 tmpf << "_ann_";
02446
02447             // convert subfolder names to regular name
02448             FlatenSubFolders(tmpf);
02449
02450             args.add("annotate");
02451
02452             if( noRecurs )
02453             {
02454                 args.add("-l");
02455             }
02456
02457             if( force )
02458             {
02459                 args.add("-f");
02460             }
02461
02462             if( !rev.empty() )
02463             {
02464                 args.add(isDate ? "-D" : "-r");
02465                 args.add(rev);
02466             }
02467
02468             args.add(filename);
02469             args.print(path);
02470             file = launchCVS(path, args, (const char *)tmpf, ext);
02471 #ifdef qMacCvsPP
02472             decodeCVS (file);
02473 #endif
02474
02475             if( file.empty() )
02476                 continue;
02477
02478             LaunchViewer(file, true);
02479         }
02480     }
02481 }
02482
02487 void CvsCmdMoveToTrash(KiSelectionHandler& handler)
02488 {
02489     MultiFiles* mf = NULL;
02490     if( !CheckSelectionHandler(handler, mf) )
02491         return;
02492
02493     if( !CvsAlert(_i18n("Are you sure you want to erase selected files?"), _i18n("Yes"), _i18n("No")) )
02494     {
02495         return;
02496     }
02497
02498     CompatBeginMoveToTrash();
02499
02500     MultiFiles::const_iterator mfi;
02501     for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02502     {
02503         int count = mfi->NumFiles();
02504         for(int i = 0; i < count; i++)
02505         {
02506             CStr path, fileName, currRev;
02507             if( mfi->get(i, path, fileName, currRev) )
02508             {
02509                 UStr fn(path);
02510                 if( !fn.endsWith(kPathDelimiter) )
02511                     fn << kPathDelimiter;
02512
02513                 fn << fileName;
02514
02515                 if( !CompatMoveToTrash(fn) )
02516                 {
02517                     UStr errText;
02518                     errText << _i18n("Unable to remove '") << fn << _i18n("' (error ") << errno << ")\n";
02519
02520                     cvs_err( errText.c_str() );
02521                 }
02522                 else
02523                 {
02524                     UStr errText;
02525 #if TARGET_OS_MAC
02526                     errText << "'" << fn << _i18n("' has been moved successfully to the trash...\n");
02527 #elif WIN32
02528                     errText << "'" << fn << _i18n("' has been moved successfully to the recycle bin ...\n");
02529 #else
02530                     errText << "'" << fn << _i18n("' has been removed successfully ...\n");
02531 #endif
02532                     cvs_out( errText.c_str() );
02533                 }
02534             }
02535         }
02536     }
02537
02538     CompatEndMoveToTrash();
02539 }
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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
00028 #include "CPStr.h"
00029
00030 #define MAX_ARGS    40
00031 #define MAX_CMD_LEN 2048
00032
00034 typedef enum
00035 {
00036     kEditNormal,
00037     kEditReserved,
00038     kEditForce
00039 } kEditCmdType;
00040
00042 typedef enum
00043 {
00044     kAddNormal,
00045     kAddBinary,
00046     kAddUnicode
00047 } kAddCmdType;
00048
00050 typedef enum
00051 {
00052     kDiffFile,
00053     kDiffFolder,
00054     kDiffGraph
00055 } kDiffCmdType;
00056
00057 class KiSelectionHandler;
00058
00059 // Helper functions
00060 char* CleanupLogMsg(const char* msg);
00061 bool SplitPath(const char* dir, CStr& uppath, CStr& folder, bool dontSkipDelimiter = false);
00062 bool MakeTmpFile(CStr& file, const char* prefix, const char* extension = 0L, bool create = false);
00063 void GetExtension(const char* file, CStr& base, CStr& ext);
00064 bool GetEnvValue(const char* cmd, const char* key, UStr& value);
00065 int StringToArgv(const char* cmdLine, char** argv);
00066
00067 // Helper commands
00068 bool LaunchDiff(const char* file1, const char* file2);
00069 bool LaunchViewer(const char* filePath, bool useDefault = false);
00070 bool LaunchEditor(const char* filePath, void* par = 0L);
00071
00072 // Command functions that don't carry the selection and don't need the selection handler
00073 void CvsCmdInit();
00074 void CvsCmdLogin(void);
00075 void CvsCmdLogout(void);
00076
00077 // Command functions that may need the selection and need a selection handler
00078 void CvsCmdRtagCreate(KiSelectionHandler& handler);
00079 void CvsCmdRtagDelete(KiSelectionHandler& handler);
00080 void CvsCmdRtagBranch(KiSelectionHandler& handler);
00081 void CvsCmdCommandLine(KiSelectionHandler& handler);
00082
00083 // Command functions that need both the selection and the selection handler
00084 void CvsCmdCheckoutModule(KiSelectionHandler& handler);
00085 void CvsCmdImportModule(KiSelectionHandler& handler);
00086 void CvsCmdCancelChanges(KiSelectionHandler& handler);
00087 void CvsCmdUpdate(KiSelectionHandler& handler, bool queryOnly = false);
00088 void CvsCmdCommit(KiSelectionHandler& handler);
00089 void CvsCmdDiff(KiSelectionHandler& handler, kDiffCmdType diffType);
00090 void CvsCmdAdd(KiSelectionHandler& handler, kAddCmdType addType = kAddNormal);
00091 void CvsCmdRemove(KiSelectionHandler& handler);
00092 void CvsCmdLog(KiSelectionHandler& handler, bool outGraph = false, void* defWnd = 0L);
00093 void CvsCmdStatus(KiSelectionHandler& handler);
00094 void CvsCmdLock(KiSelectionHandler& handler);
00095 void CvsCmdUnlock(KiSelectionHandler& handler);
00096 void CvsCmdTagCreate(KiSelectionHandler& handler);
00097 void CvsCmdTagDelete(KiSelectionHandler& handler);
00098 void CvsCmdTagBranch(KiSelectionHandler& handler);
00099 void CvsCmdEdit(KiSelectionHandler& handler, kEditCmdType editType = kEditNormal);
00100 void CvsCmdUnedit(KiSelectionHandler& handler);
00101 void CvsCmdWatchOn(KiSelectionHandler& handler);
00102 void CvsCmdWatchOff(KiSelectionHandler& handler);
00103 void CvsCmdRelease(KiSelectionHandler& handler);
00104 void CvsCmdWatchers(KiSelectionHandler& handler);
00105 void CvsCmdEditors(KiSelectionHandler& handler);
00106 void CvsCmdAnnotate(KiSelectionHandler& handler);
00107 void CvsCmdMoveToTrash(KiSelectionHandler& handler);
00108
00109 void CvsCmdMacrosAdmin(const char* macroName);
00110     // TO_OBSOLETE
00111
00112 #endif /* CVSCOMMANDS_H */
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00028 #   include "GUSIInternal.h"
00029 #   include "GUSIFileSpec.h"
00030 #   define S_IWRITE S_IWUSR
00031 #endif
00032
00033 #include <stdlib.h>
00034 #include <cstring>
00035 #include <sys/types.h>
00036 #include <sys/stat.h>
00037
00038 #include <sstream>
00039 #include <algorithm>
00040
00041 #include "CvsEntries.h"
00042 #include "AppConsole.h"
00043 #include "getline.h"
00044 #include "FileTraversal.h"
00045
00046 #ifdef WIN32
00047 #   ifdef _DEBUG
00048 #       define new DEBUG_NEW
00049 #       undef THIS_FILE
00050         static char THIS_FILE[] = __FILE__;
00051 #   endif
00052 #   include "WinCvsDebug.h"
00053 #endif /* WIN32 */
00054
00055 #if TIME_WITH_SYS_TIME
00056 #   include <sys/time.h>
00057 #   include <time.h>
00058 #elif HAVE_SYS_TIME_H
00059 #   include <sys/time.h>
00060 #else
00061 #   include <time.h>
00062 #endif
00063
00064 #ifndef NEW
00065 #define NEW new
00066 #endif
00067
00068 #ifndef NAMESPACE
00069 #       if defined(_MSC_VER) || defined(__MWERKS__) || (__GNUC__ > 2)
00070 #               define NAMESPACE(w) w::
00071 #       else
00072 #               define NAMESPACE(w) ::
00073 #       endif
00074 #endif
00075
00077 // Helper functions
00078
00080 NAMESPACE(std) string gStrMonths[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
00081
00087 time_t GetDateTime(const char* strTime)
00088 {
00089     struct tm tmTime = { 0 };
00090
00091     NAMESPACE(std) string stringTime = strTime;
00092
00093     if( stringTime.empty() )
00094     {
00095         return -1;
00096     }
00097
00098     // Replace the time separator with spaces to help with parsing
00099     replace(stringTime.begin(), stringTime.end(), ':', ' ');
00100
00101     // Parse
00102     NAMESPACE(std) stringstream parser;
00103     parser << stringTime;
00104
00105     NAMESPACE(std) string strDay;
00106     NAMESPACE(std) string strMonth;
00107
00108     parser >> strDay;
00109     parser >> strMonth;
00110     {
00111         // Find out the month
00112         tmTime.tm_mon = -1;
00113         NAMESPACE(std) string* month = find(gStrMonths, gStrMonths + 12, strMonth);
00114
00115         if( month != gStrMonths + 12 )
00116         {
00117             tmTime.tm_mon = month - gStrMonths;
00118         }
00119         else
00120         {
00121 #ifdef WIN32
00122             ASSERT(FALSE);  // unknown month
00123 #endif
00124             return -1;
00125         }
00126     }
00127
00128     parser >> tmTime.tm_mday;
00129     parser >> tmTime.tm_hour;
00130     parser >> tmTime.tm_min;
00131     parser >> tmTime.tm_sec;
00132
00133     parser >> tmTime.tm_year;
00134     tmTime.tm_year -= 1900;
00135
00136     tmTime.tm_isdst = -1;
00137
00138     return mktime(&tmTime);
00139 }
00140
00147 static const char* CloneStr(const char* cp)
00148 {
00149     if( cp && *cp )
00150     {
00151         cp = strdup(cp);
00152         if( !cp )
00153         {
00154             throw std::bad_alloc();
00155         }
00156     }
00157     else
00158     {
00159         cp = 0L;
00160     }
00161
00162     return cp;
00163 }
00164
00169 static void DisposeStr(const char* cp)
00170 {
00171     if( cp )
00172     {
00173         free((void*)cp);
00174     }
00175 }
00176
00178 // EntnodePath
00179
00180 EntnodePath::EntnodePath(const char* path) : fullpathname(0L), ref(1)
00181 {
00182     fullpathname = CloneStr(path);
00183 }
00184
00185 EntnodePath::~EntnodePath()
00186 {
00187     DisposeStr(fullpathname);
00188 }
00189
00196 const char* EntnodePath::GetFullPathName(UStr& resPath, const char* name) const
00197 {
00198     resPath = fullpathname;
00199     if( !resPath.endsWith(kPathDelimiter) )
00200         resPath << kPathDelimiter;
00201
00202     resPath << name;
00203
00204     return resPath;
00205 }
00206
00208 // EntnodeData
00209
00210 UStr EntnodeData::sbuffer;
00211
00212 EntnodeData::EntnodeData(const char* name, EntnodePath* path)
00213     : ref(1), missing(false), visited(false), unknown(false),
00214       unmodified(true), ignored(false), locked(false), removed(false),
00215       user(0L), desc(0L), fullpathname(0L)
00216 {
00217 #if TARGET_RT_MAC_CFM
00218     macspec.vRefNum = 0;
00219     macspec.parID = 0;
00220     macspec.name[0] = '\0';
00221 #endif
00222
00223 #if TARGET_RT_MAC_MACHO
00224     memset(&macspec, 0, sizeof(macspec));
00225 #endif
00226
00227     user = CloneStr(name);
00228     fullpathname = path->Ref();
00229 }
00230
00231 EntnodeData::~EntnodeData()
00232 {
00233     DisposeStr(user);
00234
00235     if( fullpathname )
00236         fullpathname->UnRef();
00237 }
00238
00240 const char* EntnodeData::operator[](int index) const
00241 {
00242     switch( index )
00243     {
00244     case kName:
00245         return user;
00246     case kStatus:
00247         return desc;
00248     case kPath:
00249         return GetFullPathName(sbuffer);
00250     default:
00251         break;
00252     }
00253
00254     return 0L;
00255 }
00256
00258 // EntnodeFile
00259
00260 EntnodeFile::EntnodeFile(const char* name, EntnodePath* path, const char* newvn /*= 0L*/,
00261     const char* newts /*= 0L*/, const char* newoptions /*= 0L*/, const char* newtag /*= 0L*/,
00262     const char* newdate /*= 0L*/, const char* newts_conflict /*= 0L*/) : EntnodeData(name, path)
00263 {
00264     vn = 0L;
00265     ts = 0L;
00266     option = 0L;
00267     tag = 0L;
00268     date = 0L;
00269     ts_conflict = 0L;
00270
00271     vn = CloneStr(newvn);
00272     ts = CloneStr(newts);
00273     option = CloneStr(newoptions);
00274     tag = CloneStr(newtag);
00275     date = CloneStr(newdate);
00276     ts_conflict = CloneStr(newts_conflict);
00277
00278     if( newvn != 0L && newvn[0] == '-' )
00279         SetRemoved(true);
00280 }
00281
00282 EntnodeFile::~EntnodeFile()
00283 {
00284     DisposeStr(vn);
00285     DisposeStr(ts);
00286     DisposeStr(option);
00287     DisposeStr(tag);
00288     DisposeStr(date);
00289     DisposeStr(ts_conflict);
00290 }
00291
00293 const char* EntnodeFile::operator[](int index) const
00294 {
00295     switch( index )
00296     {
00297     case kVN:
00298         return vn;
00299     case kTS:
00300         return ts;
00301     case kOption:
00302         return option;
00303     case kTag:
00304         return tag != 0L ? tag : date;
00305     case kConflict:
00306         return ts_conflict;
00307     default:
00308         break;
00309     }
00310
00311     return EntnodeData::operator[](index);
00312 }
00313
00315 ent_type EntnodeFile::GetType() const
00316 {
00317     return ENT_FILE;
00318 }
00319
00321 const char* EntnodeFile::GetConflict() const
00322 {
00323     return ts_conflict;
00324 }
00325
00327 // EntnodeFolder
00328
00329 EntnodeFolder::EntnodeFolder(const char* name, EntnodePath* path, const char* newvn /*= 0L*/,
00330     const char* newts /*= 0L*/, const char* newoptions /*= 0L*/, const char* newtag /*= 0L*/,
00331     const char* newdate /*= 0L*/, const char* newts_conflict /*= 0L*/) : EntnodeData(name, path)
00332 {
00333 }
00334
00335 EntnodeFolder::~EntnodeFolder()
00336 {
00337 }
00338
00340 const char* EntnodeFolder::operator[](int index) const
00341 {
00342     return EntnodeData::operator[](index);
00343 }
00344
00346 ent_type EntnodeFolder::GetType() const
00347 {
00348     return ENT_SUBDIR;
00349 }
00350
00352 // ENTNODE
00353
00355 ENTNODE& ENTNODE::operator=(const ENTNODE& anode)
00356 {
00357     EntnodeData* oldData = shareData;
00358     shareData = anode.shareData;
00359
00360     if( shareData != 0L )
00361     {
00362         shareData->Ref();
00363     }
00364
00365     if( oldData != 0L )
00366     {
00367         oldData->UnRef();
00368     }
00369
00370     return *this;
00371 }
00372
00374 // Static functions
00375
00384 static EntnodeData* GetNextEntriesLine(FILE* fpin, const char* path, char* cmd = 0L)
00385 {
00386     EntnodeData* ent;
00387     char* line = 0L;
00388     size_t line_chars_allocated = 0;
00389     register char* cp;
00390     ent_type type;
00391     char* l, *user, *vn, *ts, *options;
00392     char* tag_or_date, *tag, *date, *ts_conflict;
00393     int line_length;
00394
00395     EntnodePath* thePath = new EntnodePath(path);
00396
00397     ent = 0L;
00398     while( (line_length = getline(&line, &line_chars_allocated, fpin)) > 0 )
00399     {
00400         l = line;
00401
00402         /* If CMD is not NULL, we are reading an Entries.Log file.
00403         Each line in the Entries.Log file starts with a single
00404         character command followed by a space.  For backward
00405         compatibility, the absence of a space indicates an add
00406         command.  */
00407         if( cmd != 0L )
00408         {
00409             if( l[1] != ' ' )
00410                 *cmd = 'A';
00411             else
00412             {
00413                 *cmd = l[0];
00414                 l += 2;
00415             }
00416         }
00417
00418         type = ENT_FILE;
00419
00420         if( l[0] == 'D' )
00421         {
00422             type = ENT_SUBDIR;
00423             ++l;
00424             /* An empty D line is permitted; it is a signal that this
00425             Entries file lists all known subdirectories.  */
00426         }
00427
00428         if( l[0] != '/' )
00429             continue;
00430
00431         user = l + 1;
00432         if( (cp = strchr (user, '/')) == 0L )
00433             continue;
00434
00435         *cp++ = '\0';
00436         vn = cp;
00437         if( (cp = strchr (vn, '/')) == 0L )
00438             continue;
00439
00440         *cp++ = '\0';
00441         ts = cp;
00442         if( (cp = strchr (ts, '/')) == 0L )
00443             continue;
00444
00445         *cp++ = '\0';
00446         options = cp;
00447         if( (cp = strchr (options, '/')) == 0L )
00448             continue;
00449
00450         *cp++ = '\0';
00451         tag_or_date = cp;
00452
00453         if( (cp = strchr (tag_or_date, '\n')) == 0L
00454 #ifdef TARGET_OS_MAC
00455             && (cp = strchr (tag_or_date, '\r')) == 0L
00456 #endif
00457         )
00458             continue;
00459
00460         *cp = '\0';
00461         tag = (char*) 0L;
00462         date = (char*) 0L;
00463         if( *tag_or_date == 'T' )
00464             tag = tag_or_date + 1;
00465         else if( *tag_or_date == 'D' )
00466             date = tag_or_date + 1;
00467
00468         if( (ts_conflict = strchr (ts, '+')) )
00469             *ts_conflict++ = '\0';
00470
00471         if( type == ENT_SUBDIR )
00472             ent = NEW EntnodeFolder(user, thePath);
00473         else
00474             ent = NEW EntnodeFile(user, thePath, vn, ts, options, tag, date, ts_conflict);
00475
00476         break;
00477     }
00478
00479     if( line_length < 0 && !feof(fpin) )
00480         cvs_err("Cannot read entries file (error %d)\n", errno);
00481
00482     free(line);
00483
00484     thePath->UnRef();
00485
00486     return ent;
00487 }
00488
00498 bool Entries_Open(CSortList<ENTNODE>& entries, const char* fullpath)
00499 {
00500     EntnodeData* ent;
00501
00502     UStr adminPath(fullpath);
00503     if( !adminPath.endsWith(kPathDelimiter) )
00504         adminPath << kPathDelimiter;
00505
00506     adminPath << "CVS";
00507     adminPath << kPathDelimiter;
00508
00509     entries.Reset();
00510
00511     UStr filename = adminPath;
00512     filename << "Entries";
00513
00514     FILE* fpin = fopen(filename, "r");
00515     if( fpin == 0L )
00516         return false;
00517
00518     while( (ent = GetNextEntriesLine(fpin, fullpath)) != 0L )
00519     {
00520         ENTNODE newnode(ent);
00521         ent->UnRef();
00522
00523         if( entries.InsideAndInsert(newnode) )
00524         {
00525             cvs_err("Warning : duplicated entry in the 'CVS/Entries' file in directory '%s'\n", fullpath);
00526         }
00527     }
00528
00529     fclose(fpin);
00530
00531     filename = adminPath;
00532     filename << "Entries.log";
00533
00534     fpin = fopen(filename, "r");
00535     if( fpin != 0L )
00536     {
00537         char cmd;
00538
00539         while( (ent = GetNextEntriesLine(fpin, &cmd)) != 0L )
00540         {
00541             ENTNODE newnode(ent);
00542             ent->UnRef();
00543
00544             switch (cmd)
00545             {
00546             case 'A':
00547                 if(entries.InsideAndInsert(newnode))
00548                 {
00549                     // don't care
00550                 }
00551                 break;
00552             case 'R':
00553                 entries.Delete(newnode);
00554                 break;
00555             default:
00556                 /* Ignore unrecognized commands.  */
00557                 break;
00558             }
00559         }
00560
00561         fclose(fpin);
00562     }
00563
00564     return true;
00565 }
00566
00574 static bool unmodified(const struct stat& sb, const char* ts)
00575 {
00576     char* cp;
00577     struct tm* tm_p;
00578     struct tm local_tm;
00579
00580     /* We want to use the same timestamp format as is stored in the
00581     st_mtime.  For unix (and NT I think) this *must* be universal
00582     time (UT), so that files don't appear to be modified merely
00583     because the timezone has changed.  For VMS, or hopefully other
00584     systems where gmtime returns NULL, the modification time is
00585     stored in local time, and therefore it is not possible to cause
00586     st_mtime to be out of sync by changing the timezone.  */
00587
00588     tm_p = gmtime(&sb.st_mtime);
00589     if( tm_p )
00590     {
00591         memcpy(&local_tm, tm_p, sizeof (local_tm));
00592         cp = asctime(&local_tm);    /* copy in the modify time */
00593     }
00594     else
00595         cp = ctime(&sb.st_mtime);
00596
00597     cp[24] = 0;
00598
00599     /* Deal with the differences in timestamps - POSIX uses space filled, NT uses zero filled */
00600     if( cp[8]=='0' && ts[8]==' ' )
00601         cp[8]=' ';
00602     if( cp[8]==' ' && ts[8]=='0' )
00603         cp[8]='0';
00604
00605     return strcmp(cp, ts) == 0;
00606 }
00607
00619 EntnodeData* Entries_SetVisited(const char* path, CSortList<ENTNODE>& entries, const char* name,
00620     const struct stat& finfo, bool isFolder, const std::vector<CStr>* ignlist /*= 0L*/)
00621 {
00622     int index;
00623     bool isCvs = false;
00624
00625     EntnodePath* thePath = new EntnodePath(path);
00626
00627     if( isFolder )
00628     {
00629         EntnodeFolder* adata = NEW EntnodeFolder(name, thePath);
00630         ENTNODE anode(adata);
00631         adata->UnRef();
00632         isCvs = entries.InsideAndInsert(anode, &index);
00633     }
00634     else
00635     {
00636         EntnodeFile* adata = NEW EntnodeFile(name, thePath);
00637         ENTNODE anode(adata);
00638         adata->UnRef();
00639         isCvs = entries.InsideAndInsert(anode, &index);
00640     }
00641
00642     thePath->UnRef();
00643
00644     const ENTNODE& theNode = entries.Get(index);
00645     EntnodeData* data = theNode.Data();
00646     data->SetVisited(true);
00647
00648     if( !isCvs )
00649     {
00650         data->SetUnknown(true);
00651         if( ignlist != 0L && MatchIgnoredList(name, *ignlist) )
00652             data->SetIgnored(true);
00653
00654         // the folder may have some cvs informations in it, despite the fact
00655         // that it is not referenced by the parent directory, so try
00656         // to figure it.
00657
00658         if( !data->IsIgnored() )
00659         {
00660             CStr cvsFile(path);
00661             if( !cvsFile.endsWith(kPathDelimiter) )
00662                 cvsFile << kPathDelimiter;
00663
00664             cvsFile << name;
00665             if( !cvsFile.endsWith(kPathDelimiter) )
00666                 cvsFile << kPathDelimiter;
00667
00668             cvsFile << "CVS";
00669             struct stat sb;
00670             if( stat(cvsFile, &sb) != -1 && S_ISDIR(sb.st_mode) )
00671             {
00672                 data->SetUnknown(false);
00673             }
00674         }
00675     }
00676
00677     if( isFolder )
00678     {
00679         if( data->IsIgnored() )
00680         {
00681             data->SetDesc("Ignored Folder");
00682         }
00683         else if( data->IsUnknown() )
00684         {
00685             data->SetDesc("NonCvs Folder");
00686         }
00687         else
00688         {
00689             data->SetDesc("Folder");
00690         }
00691     }
00692     else
00693     {
00694         const char* ts = (*data)[EntnodeFile::kTS];
00695         if( ts == 0L )
00696             data->SetUnmodified(true);
00697         else
00698             data->SetUnmodified(unmodified(finfo, ts));
00699
00700 #if defined(WIN32)
00701         if( GetWinCvsDebugMaskBit(wcvsdbg_trace_modified_checks_bit) )
00702         {
00703             char scratch[128];
00704
00705             /* copied from unmodified... */
00706             char* cp;
00707             struct tm* tm_p;
00708             struct tm local_tm;
00709             tm_p = gmtime(&finfo.st_mtime);
00710             if( tm_p )
00711             {
00712                 memcpy(&local_tm, tm_p, sizeof(local_tm));
00713                 cp = asctime(&local_tm);    /* copy in the modify time */
00714             }
00715             else
00716             {
00717                 cp = "NULL";
00718             }
00719
00720             _snprintf(scratch, 128,
00721                 "Checking timestamps for %s: Entries: %s, file: %s --> %s\n",
00722                 name, ts, cp,
00723                 data->IsUnmodified() ? "unmodified" : "modified");
00724
00725             cvs_err(scratch);
00726             OutputDebugString(scratch);
00727         }
00728 #endif
00729
00730         data->SetLocked((finfo.st_mode & S_IWRITE) == 0);
00731
00732         const char* info = 0L;
00733         if( data->IsIgnored() )
00734         {
00735             data->SetDesc("Ignored");
00736         }
00737         else if( data->IsUnknown() )
00738         {
00739             data->SetDesc("NonCvs file");
00740         }
00741         else if( data->GetConflict() != 0L )
00742         {
00743             data->SetDesc("Conflict");
00744         }
00745         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0 )
00746         {
00747             data->SetDesc(data->IsUnmodified() ? "Binary" : "Mod. Binary");
00748         }
00749         else if( (info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-ku") == 0 )
00750         {
00751             data->SetDesc(data->IsUnmodified() ? "Unicode" : "Mod. Unicode");
00752         }
00753         else
00754         {
00755             data->SetDesc(data->IsUnmodified() ? "File" : "Mod. File");
00756         }
00757     }
00758
00759     return data;
00760 }
00761
00768 void Entries_SetMissing(CSortList<ENTNODE>& entries)
00769 {
00770     int numEntries = entries.NumOfElements();
00771     for(int i = 0; i < numEntries; i++)
00772     {
00773         const ENTNODE& theNode = entries.Get(i);
00774         EntnodeData* data = theNode.Data();
00775
00776         if( data->IsVisited() )
00777             continue;
00778
00779         data->SetMissing(true);
00780         data->SetDesc(data->IsRemoved() ? "Removed" : "Missing");
00781     }
00782 }
00783
00790 bool Tag_Open(CStr& tag, const char* fullpath)
00791 {
00792     tag = "";
00793     CStr tagFile(fullpath);
00794     if( !tagFile.endsWith(kPathDelimiter) )
00795         tagFile << kPathDelimiter;
00796
00797     tagFile << "Tag";
00798
00799     FILE* fpin = fopen(tagFile, "r");
00800     if( fpin == 0L )
00801         return false;
00802
00803     char* line = 0L;
00804     size_t line_chars_allocated = 0;
00805     int line_length;
00806     if( (line_length = getline(&line, &line_chars_allocated, fpin)) > 0 )
00807     {
00808         char* tmp = strchr(line, '\n');
00809         if( tmp != 0L )
00810             *tmp = '\0';
00811
00812         if( line[0] == 'T' )
00813             tag = line + 1;
00814     }
00815
00816     if( line != 0L )
00817         free(line);
00818
00819     if( line_length < 0 && !feof(fpin) )
00820     {
00821         cvs_err("Cannot open Tag file in '%s' (error %d)\n", fullpath, errno);
00822         return false;
00823     }
00824
00825     fclose(fpin);
00826
00827     return !tag.empty();
00828 }
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 time_t GetDateTime(const char* strTime);
00034
00036 typedef enum
00037 {
00038     ENT_FILE,
00039     ENT_SUBDIR
00040 } ent_type;
00041
00046 class EntnodePath
00047 {
00048 public:
00049     // Construction
00050     EntnodePath(const char* path);
00051 protected:
00052     virtual ~EntnodePath();
00053
00054 public:
00055     // Interface
00056     EntnodePath* Ref();
00057     EntnodePath* UnRef();
00058     const char* GetFullPathName(UStr& resPath, const char* name) const;
00059     const char* GetFolderPath() const;
00060
00061 protected:
00062     // Data members
00063     const char* fullpathname;
00064     int ref;
00065 };
00066
00071 class EntnodeData
00072 {
00073 protected:
00074     // Construction
00075     EntnodeData(const char* name, EntnodePath* path);
00076     virtual ~EntnodeData();
00077
00078 public:
00080     enum
00081     {
00082         kName = 0,
00083         kStatus = 3,
00084         kPath = 7
00085     };
00086
00087     // Interface
00088
00090     virtual ent_type GetType() const = 0;
00091
00092     EntnodeData* Ref();
00093     EntnodeData* UnRef();
00094     static int Compare(const EntnodeData& node1, const EntnodeData& node2);
00095     virtual const char* operator[](int index) const;
00096
00097     void SetMissing(bool state);
00098     bool IsMissing() const;
00099     void SetVisited(bool state);
00100     bool IsVisited() const;
00101     void SetUnknown(bool state);
00102     bool IsUnknown() const;
00103     void SetIgnored(bool state);
00104     bool IsIgnored() const;
00105     void SetLocked(bool state);
00106     bool IsLocked() const;
00107     void SetRemoved(bool state);
00108     bool IsRemoved() const;
00109     void SetDesc(const char* newdesc);
00110     const char* GetDesc() const;
00111
00112     const char* GetName() const;
00113     const char* GetFullPathName(UStr& resPath) const;
00114
00115     const char* GetFolderPath() const;
00116     virtual const char* GetConflict() const;
00117
00118     void SetUnmodified(bool state);
00119     bool IsUnmodified() const;
00120
00121 #ifdef TARGET_OS_MAC
00122     UFSSpec& MacSpec();
00123     const UFSSpec& GetMacSpec() const;
00124 #endif /* TARGET_OS_MAC */
00125
00126 protected:
00127     // Data members
00128     int ref;
00130     int missing : 1;
00131     int visited : 1;
00132     int unknown : 1;
00133     int unmodified : 1;
00134     int ignored : 1;
00135     int locked : 1;
00136     int removed : 1;
00138 #ifdef TARGET_OS_MAC
00139     UFSSpec macspec;
00140 #endif /* TARGET_OS_MAC */
00141
00142 private:
00143     const char* user;
00144     const char* desc;
00145     EntnodePath* fullpathname;
00147     static UStr sbuffer;
00148 };
00149
00154 class EntnodeFile : public EntnodeData
00155 {
00156 public:
00157     // Construction
00158     EntnodeFile(const char* name, EntnodePath* path, const char* newvn = 0L,
00159         const char* newts = 0L, const char* newoptions = 0L,
00160         const char* newtag = 0L, const char* newdate = 0L,
00161         const char* newts_conflict = 0L);
00162 protected:
00163     virtual ~EntnodeFile();
00164
00165 public:
00167     enum
00168     {
00169         kVN = 1,
00170         kTS = 5,
00171         kOption = 2,
00172         kTag = 4,
00173         kConflict = 6
00174     };
00175
00176     // Interface
00177     virtual const char* operator[](int index) const;
00178     virtual ent_type GetType() const;
00179     virtual const char* GetConflict() const;
00180
00181 protected:
00182     // Data members
00183     const char* vn;
00184     const char* ts;
00185     const char* option;
00186     const char* tag;
00187     const char* date;
00188     const char* ts_conflict;
00189 };
00190
00195 class EntnodeFolder : public EntnodeData
00196 {
00197 public:
00198 // Construction
00199     EntnodeFolder(const char* name, EntnodePath* path, const char* newvn = 0L,
00200         const char* newts = 0L, const char* newoptions = 0L, const char* newtag = 0L,
00201         const char* newdate = 0L, const char* newts_conflict = 0L);
00202 protected:
00203     virtual ~EntnodeFolder();
00204
00205 public:
00206     // Interface
00207     virtual const char* operator[](int index) const;
00208     virtual ent_type GetType() const;
00209 };
00210
00212 class ENTNODE
00213 {
00214 public:
00215     // Construction
00216     ENTNODE();
00217     ENTNODE(EntnodeData* data);
00218     ENTNODE(EntnodeData& data);
00219     ENTNODE(const ENTNODE& anode);
00220     virtual ~ENTNODE();
00221
00222     // Interface
00223     static int Compare(const ENTNODE& node1, const ENTNODE& node2);
00224     ENTNODE& operator=(const ENTNODE& anode);
00225     EntnodeData* Data() const;
00226     operator EntnodeData*() const;
00227
00228 protected:
00229     // Data members
00230     EntnodeData* shareData;
00231 };
00232
00233 bool Entries_Open(CSortList<ENTNODE>& entries, const char* fullpath);
00234
00235 EntnodeData* Entries_SetVisited(const char* path, CSortList<ENTNODE>& entries, const char* name,
00236     const struct stat& finfo, bool isFolder, const std::vector<CStr>* ignlist = 0L);
00237
00238 void Entries_SetMissing(CSortList<ENTNODE>& entries);
00239 bool Tag_Open(CStr& tag, const char* fullpath);
00240
00242 // EntnodePath
00243
00245 inline EntnodePath* EntnodePath::Ref()
00246 {
00247     ++ref;
00248     return this;
00249 }
00250
00252 inline EntnodePath* EntnodePath::UnRef()
00253 {
00254     if( --ref == 0 )
00255     {
00256         delete this;
00257         return 0L;
00258     }
00259
00260     return this;
00261 }
00262
00267 inline const char* EntnodePath::GetFolderPath() const
00268 {
00269     return fullpathname;
00270 }
00271
00273 // EntnodeData
00274
00276 inline EntnodeData* EntnodeData::Ref()
00277 {
00278     ++ref;
00279     return this;
00280 }
00281
00283 inline EntnodeData* EntnodeData::UnRef()
00284 {
00285     if( --ref == 0 )
00286     {
00287         delete this;
00288         return 0L;
00289     }
00290
00291     return this;
00292 }
00293
00301 inline int EntnodeData::Compare(const EntnodeData& node1, const EntnodeData& node2)
00302 {
00303 #ifdef WIN32
00304     return stricmp(node1.user, node2.user);
00305 #else /* !WIN32 */
00306     return strcmp(node1.user, node2.user);
00307 #endif /* !WIN32 */
00308 }
00309
00311 inline void EntnodeData::SetMissing(bool state)
00312 {
00313     missing = state;
00314 }
00315
00317 inline bool EntnodeData::IsMissing() const
00318 {
00319     return 0 != missing;
00320 }
00321
00323 inline void EntnodeData::SetVisited(bool state)
00324 {
00325     visited = state;
00326 }
00327
00329 inline bool EntnodeData::IsVisited() const
00330 {
00331     return 0 != visited;
00332 }
00333
00335 inline void EntnodeData::SetUnknown(bool state)
00336 {
00337     unknown = state;
00338 }
00339
00341 inline bool EntnodeData::IsUnknown() const
00342 {
00343     return 0 != unknown;
00344 }
00345
00347 inline void EntnodeData::SetIgnored(bool state)
00348 {
00349     ignored = state;
00350 }
00351
00353 inline bool EntnodeData::IsIgnored() const
00354 {
00355     return 0 != ignored;
00356 }
00357
00359 inline void EntnodeData::SetLocked(bool state)
00360 {
00361     locked = state;
00362 }
00363
00365 inline bool EntnodeData::IsLocked() const
00366 {
00367     return 0 != locked;
00368 }
00369
00371 inline void EntnodeData::SetRemoved(bool state)
00372 {
00373     removed = state;
00374 }
00375
00377 inline bool EntnodeData::IsRemoved() const
00378 {
00379     return 0 != removed;
00380 }
00381
00383 inline void EntnodeData::SetDesc(const char* newdesc)
00384 {
00385     desc = newdesc;
00386 }
00387
00389 inline const char* EntnodeData::GetDesc() const
00390 {
00391     return desc;
00392 }
00393
00395 inline const char* EntnodeData::GetName() const
00396 {
00397     return user;
00398 }
00399
00401 inline const char* EntnodeData::GetFullPathName(UStr& resPath) const
00402 {
00403     return fullpathname->GetFullPathName(resPath, user);
00404 }
00405
00407 inline const char* EntnodeData::GetFolderPath() const
00408 {
00409     return fullpathname->GetFolderPath();
00410 }
00411
00413 inline const char* EntnodeData::GetConflict() const
00414 {
00415     return 0L;
00416 }
00417
00419 inline void EntnodeData::SetUnmodified(bool state)
00420 {
00421     unmodified = state;
00422 }
00423
00425 inline bool EntnodeData::IsUnmodified() const
00426 {
00427     return 0 != unmodified;
00428 }
00429
00430 #ifdef TARGET_OS_MAC
00431
00432 inline UFSSpec& EntnodeData::MacSpec()
00433 {
00434     return macspec;
00435 }
00436
00438 inline const UFSSpec& EntnodeData::GetMacSpec() const
00439 {
00440     return macspec;
00441 }
00442 #endif /* TARGET_OS_MAC */
00443
00445 // ENTNODE
00446
00447 inline ENTNODE::ENTNODE() : shareData(0L)
00448 {
00449 }
00450
00451 inline ENTNODE::ENTNODE(EntnodeData* data) : shareData(data->Ref())
00452 {
00453 }
00454
00455 inline ENTNODE::ENTNODE(EntnodeData& data) : shareData(data.Ref())
00456 {
00457 }
00458
00459 inline ENTNODE::ENTNODE(const ENTNODE& anode) : shareData(0L)
00460 {
00461     *this = anode;
00462 }
00463
00464 inline ENTNODE::~ENTNODE()
00465 {
00466     if( shareData != 0L )
00467         shareData->UnRef();
00468 }
00469
00476 inline int ENTNODE::Compare(const ENTNODE& node1, const ENTNODE& node2)
00477 {
00478     return EntnodeData::Compare(*node1.shareData, *node2.shareData);
00479 }
00480
00482 inline EntnodeData* ENTNODE::Data() const
00483 {
00484     return shareData;
00485 }
00486
00488 inline ENTNODE::operator EntnodeData*() const
00489 {
00490     return shareData;
00491 }
00492
00493 #endif /* CVSENTRIES_H */
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if qCvsDebug
00080     fprintf(stderr, "%s=%s\n", env, res);
00081 #endif
00082
00083     return res;
00084 }
00085
00086 char * cvsguiglue_getpass(const char *prompt)
00087 {
00088     cvsguiglue_flushconsole(0);
00089
00090     if(_cvsgui_readfd == 0)
00091         return getpass(prompt);
00092
00093     return cvsguiglue_getenv("CVS_GETPASS");
00094 }
00095
00096 void cvsguiglue_exit(int code)
00097 {
00098     cvsguiglue_flushconsole(1);
00099
00100     if(_cvsgui_writefd != 0)
00101         gp_quit_write (_cvsgui_writefd, code);
00102     exit(code);
00103 }
00104
00105 static void reopen_consoles(void)
00106 {
00107 #if !defined(WIN32) && !defined(__GNUC__)
00108     strcpy(outname, tempnam(0L, 0L));
00109     strcpy(errname, tempnam(0L, 0L));
00110     strcat(outname, ".out");
00111     strcat(errname, ".err");
00112
00113     outlog = freopen(outname, "w+", stdout);
00114     if(outlog == 0L)
00115     {
00116         fprintf(stderr, "Unable to reopen stdout !\n");
00117         exit(1);
00118     }
00119     errlog = freopen(errname, "w+", stderr);
00120     if(errlog == 0L)
00121     {
00122         fprintf(stderr, "Unable to reopen stderr !\n");
00123         exit(1);
00124     }
00125
00126     outseek = 0;
00127     errseek = 0;
00128 #endif
00129 }
00130
00131 static void
00132 close_consoles(void)
00133 {
00134 #if !defined(WIN32) && !defined(__GNUC__)
00135     if(outlog != 0L)
00136         fclose(outlog);
00137     if(errlog != 0L)
00138         fclose(errlog);
00139     if(outname[0])
00140         unlink(outname);
00141     if(errname[0])
00142         unlink(errname);
00143     outlog = 0L;
00144     errlog = 0L;
00145     outname[0] = '\0';
00146     errname[0] = '\0';
00147 #endif
00148 }
00149
00150 static void
00151 myflush(FILE *log, long *oldpos)
00152 {
00153     long newpos, pos;
00154 #   define BUF_SIZE 8000
00155     char buf[BUF_SIZE];
00156     size_t len;
00157
00158     pos = fseek(log, *oldpos, SEEK_SET);
00159     if(pos != 0)
00160         goto fail;
00161
00162     while(!feof(log) && !ferror(log))
00163     {
00164         len = fread(buf, sizeof(char), BUF_SIZE, log);
00165         if(len > 0)
00166         {
00167             if(log == outlog)
00168                 gp_console_write (_cvsgui_writefd, buf, len, 0);
00169             if(log == errlog)
00170                 gp_console_write (_cvsgui_writefd, buf, len, 1);
00171         }
00172     }
00173
00174     if(ferror(log))
00175         goto fail;
00176
00177     newpos = ftell(log);
00178     if(newpos < 0)
00179         goto fail;
00180
00181     *oldpos = newpos;
00182     return;
00183 fail:
00184     fprintf(stderr, "Unable to redirect stdout/stderr !\n");
00185 }
00186
00187 void
00188 cvsguiglue_flushconsole(int closeit)
00189 {
00190     fflush(stdout);
00191     fflush(stderr);
00192
00193 #if !defined(WIN32) && !defined(__GNUC__)
00194     if(outlog != 0L)
00195         myflush(outlog, &outseek);
00196     if(errlog != 0L)
00197         myflush(errlog, &errseek);
00198     if(closeit)
00199         close_consoles();
00200 #endif
00201 }
00202
00203 int main(int argc, char *argv[])
00204 {
00205     int res;
00206     char **tmparg = 0L;
00207
00208     if(argc >= 4 && strcmp(argv[1], "-cvsgui") == 0)
00209     {
00210         int i;
00211
00212         _cvsgui_readfd = (pipe_t)atoi (argv[2]);
00213         _cvsgui_writefd = (pipe_t)atoi (argv[3]);
00214
00215         tmparg = (char **)malloc((argc - 2) * sizeof(char *));
00216         if(tmparg == 0L)
00217             goto ignore;
00218
00219         tmparg[0] = argv[0];
00220         for(i = 4; i < argc; i++)
00221         {
00222             tmparg[i - 3] = argv[i];
00223         }
00224         tmparg[argc - 3] = 0L;
00225         argc -= 3;
00226
00227         cvs_process_init();
00228         reopen_consoles();
00229     }
00230
00231 ignore:
00232     res = cvsguiglue_main(argc, tmparg != 0L ? tmparg :  argv);
00233
00234     if(tmparg != 0L)
00235     {
00236         cvsguiglue_flushconsole(1);
00237         if(_cvsgui_writefd != 0)
00238             gp_quit_write (_cvsgui_writefd, res);
00239         free(tmparg);
00240     }
00241
00242     return res;
00243 }
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 WIN32
00037 #   include <process.h> // exit
00038 #endif
00039
00040 #ifdef __MACH__
00041 #   include <CoreServices/CoreServices.h>
00042 #endif /* __MACH__ */
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048 /*
00049  * glue code to intercept some low level calls and tunnel them
00050  * inside the communication pipes.
00051  */
00052 #define getenv cvsguiglue_getenv
00053 #define getpass cvsguiglue_getpass
00054
00055 // RCH - extra #define for Solaris
00056 #define getpassphrase cvsguiglue_getpass
00057
00058 #define main cvsguiglue_main
00059 #define exit cvsguiglue_exit
00060
00061 extern char * cvsguiglue_getenv(const char *env);
00062 extern char * cvsguiglue_getpass(const char *prompt);
00063 extern int cvsguiglue_main(int argc, char *argv[]);
00064 extern void cvsguiglue_exit(int code);
00065 extern void cvsguiglue_flushconsole(int closeit);
00066
00067 // Mach-o OSX
00068 #if TARGET_RT_MAC_MACHO
00069 #   ifndef CVSGUI_PIPE
00070 #       define CVSGUI_PIPE                  // cvs protocol, also defined by autoconf, but not MW
00071 #   endif
00072 #   define str_list str_list_cvs            // conflict in OSServices/OpenTransportProtocol.h
00073 #   define BINHEX_STUFF                     // resource fork encoding/deconding
00074 #   define O_BINARY 0x8000                  // not defined on OSX
00075 #   define BROKEN_READWRITE_CONVERSION      // required for BINHEX_STUFF
00076 #   define MACOS                            // Necessary for Z Library
00077 #   define RSA_IDENTITY_SUPPORT             // extension for passing args to ssh
00078 #endif
00079
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083
00084 #endif /* CVSGUI_H */
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


common/cvsgui_i18n.h Source File

common/cvsgui_i18n.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 cvsgui_i18n_H
00022 #define cvsgui_i18n_H
00023
00024 /*
00025  * Standard gettext macros.
00026  */
00027 #ifdef ENABLE_NLS
00028 #  include <libintl.h>
00029 #  undef _i18n
00030 #  define _i18n(String) dgettext (PACKAGE, String)
00031 #  ifdef gettext_noop
00032 #    define N_(String) gettext_noop (String)
00033 #  else
00034 #    define N_(String) (String)
00035 #  endif
00036 #else
00037 #  define textdomain(String) (String)
00038 #  define gettext(String) (String)
00039 #  define dgettext(Domain,Message) (Message)
00040 #  define dcgettext(Domain,Message,Type) (Message)
00041 #  define bindtextdomain(Domain,Directory) (Domain)
00042 #  define _i18n(String) (String)
00043 #  define N_(String) (String)
00044 #endif
00045
00046 #endif
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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, guint8* buf, gulong count);
00063 static int cvs_process_flush(pipe_t fd);
00064 static void cvs_process_push(CvsProcess* cvs_process);
00065 static void cvs_process_pop(void);
00066 static void cvs_process_recv_message(CvsProcess* p);
00067 static void cvs_process_handle_message(WireMessage* msg);
00068
00069 void cvs_process_kill(CvsProcess* cvs_process);
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
00085 class CDummyInit
00086 {
00087 public:
00088     CDummyInit()
00089     {
00090         ::InitializeCriticalSection(&m_destroylock);
00091         ::InitializeCriticalSection(&m_stacklock);
00092     }
00093
00094     ~CDummyInit()
00095     {
00096         ::DeleteCriticalSection(&m_destroylock);
00097         ::DeleteCriticalSection(&m_stacklock);
00098     }
00099
00100     static CRITICAL_SECTION m_destroylock;
00101     static CRITICAL_SECTION m_stacklock;
00102 } sDummyObject;
00103
00104 CRITICAL_SECTION CDummyInit::m_destroylock;
00105 CRITICAL_SECTION CDummyInit::m_stacklock;
00106
00115 static int write(pipe_t fd, const void* buf, int count)
00116 {
00117     DWORD write;
00118     if( !WriteFile(fd, buf, count, &write, NULL) )
00119     {
00120         errno = EINVAL;
00121         return -1;
00122     }
00123
00124     return write;
00125 }
00126
00133 BOOL CALLBACK PostCloseEnum(HWND hWnd, LPARAM lParam)
00134 {
00135     DWORD pid = 0;
00136
00137     GetWindowThreadProcessId(hWnd, &pid);
00138
00139     if( pid == (DWORD)lParam )
00140     {
00141         PostMessage(hWnd, WM_CLOSE, 0, 0);
00142     }
00143
00144     return TRUE;
00145 }
00146
00153 bool cvs_process_terminate(CvsProcess* cvs_process)
00154 {
00155     bool res = FALSE;
00156
00157     EnumWindows((WNDENUMPROC)PostCloseEnum, (LPARAM)cvs_process->threadID);
00158
00159     if( WaitForSingleObject(cvs_process->pid, 300) == WAIT_OBJECT_0 )
00160     {
00161         res = TRUE;
00162     }
00163     else
00164     {
00165         res = TerminateProcess(cvs_process->pid, 0) != 0;
00166     }
00167
00168     return res;
00169 }
00170
00172 struct CDestroyThreadLock
00173 {
00174 public:
00175     inline CDestroyThreadLock()
00176     {
00177         EnterCriticalSection(&CDummyInit::m_destroylock);
00178     }
00179
00180     inline ~CDestroyThreadLock()
00181     {
00182         LeaveCriticalSection(&CDummyInit::m_destroylock);
00183     }
00184 };
00185
00187 struct CStackThreadLock
00188 {
00189 public:
00190     inline CStackThreadLock()
00191     {
00192         EnterCriticalSection(&CDummyInit::m_stacklock);
00193     }
00194
00195     inline ~CStackThreadLock()
00196     {
00197         LeaveCriticalSection(&CDummyInit::m_stacklock);
00198     }
00199 };
00200
00201 #else
00202
00204 struct CDestroyThreadLock
00205 {
00206 public:
00207     inline CDestroyThreadLock()
00208     {
00209     }
00210
00211     inline ~CDestroyThreadLock()
00212     {
00213     }
00214 };
00215
00217 struct CStackThreadLock
00218 {
00219 public:
00220     inline CStackThreadLock()
00221     {
00222     }
00223
00224     inline ~CStackThreadLock()
00225     {
00226     }
00227 };
00228
00229 #endif
00230
00231 static void _gp_quit_read(pipe_t fd, WireMessage* msg)
00232 {
00233     GPT_QUIT* t = (GPT_QUIT*)malloc(sizeof(GPT_QUIT));
00234     if( t == 0L )
00235         return;
00236
00237     if( !wire_read_int32(fd, (guint32*)&t->code, 1) )
00238         return;
00239
00240     msg->data = t;
00241 }
00242
00243 static void _gp_quit_write(pipe_t fd, WireMessage* msg)
00244 {
00245     GPT_QUIT* t = (GPT_QUIT*)msg->data;
00246     if( !wire_write_int32(fd, (guint32*)&t->code, 1) )
00247         return;
00248 }
00249
00250 static void _gp_quit_destroy(WireMessage* msg)
00251 {
00252     free(msg->data);
00253 }
00254
00255 static void _gp_getenv_read(pipe_t fd, WireMessage* msg)
00256 {
00257     GPT_GETENV* t = (GPT_GETENV*)malloc(sizeof(GPT_GETENV));
00258     if( t == 0L )
00259         return;
00260
00261     if( !wire_read_int8(fd, &t->empty, 1) )
00262         return;
00263
00264     if( !wire_read_string(fd, &t->str, 1) )
00265         return;
00266
00267     msg->data = t;
00268 }
00269
00270 static void _gp_getenv_write(pipe_t fd, WireMessage* msg)
00271 {
00272     GPT_GETENV* t = (GPT_GETENV*)msg->data;
00273     if( !wire_write_int8(fd, &t->empty, 1) )
00274         return;
00275
00276     if( !wire_write_string(fd, &t->str, 1) )
00277         return;
00278 }
00279
00280 static void _gp_getenv_destroy(WireMessage* msg)
00281 {
00282     GPT_GETENV* t = (GPT_GETENV*)msg->data;
00283     free(t->str);
00284     free(t);
00285 }
00286
00287 static void _gp_console_read(pipe_t fd, WireMessage* msg)
00288 {
00289     GPT_CONSOLE* t = (GPT_CONSOLE*)malloc(sizeof(GPT_CONSOLE));
00290     if( t == 0L )
00291         return;
00292
00293     if( !wire_read_int8(fd, &t->isStderr, 1) )
00294         return;
00295
00296     if( !wire_read_int32(fd, &t->len, 1) )
00297         return;
00298
00299     if( !wire_read_string(fd, &t->str, 1) )
00300         return;
00301
00302     msg->data = t;
00303 }
00304
00305 static void _gp_console_write(pipe_t fd, WireMessage* msg)
00306 {
00307     GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
00308
00309     if( !wire_write_int8(fd, &t->isStderr, 1) )
00310         return;
00311
00312     if( !wire_write_int32(fd, &t->len, 1) )
00313         return;
00314
00315     if( !wire_write_string(fd, &t->str, 1) )
00316         return;
00317 }
00318
00319 static void _gp_console_destroy(WireMessage* msg)
00320 {
00321     GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
00322     free(t->str);
00323     free(t);
00324 }
00325
00326 static void gp_init()
00327 {
00328     wire_register(GP_QUIT,
00329         _gp_quit_read,
00330         _gp_quit_write,
00331         _gp_quit_destroy);
00332
00333     wire_register(GP_GETENV,
00334         _gp_getenv_read,
00335         _gp_getenv_write,
00336         _gp_getenv_destroy);
00337
00338     wire_register(GP_CONSOLE,
00339         _gp_console_read,
00340         _gp_console_write,
00341         _gp_console_destroy);
00342 }
00343
00344 int gp_quit_write(pipe_t fd, int code)
00345 {
00346     WireMessage msg;
00347     GPT_QUIT* t = (GPT_QUIT*)malloc(sizeof(GPT_QUIT));
00348
00349     msg.type = GP_QUIT;
00350     msg.data = t;
00351
00352     t->code = code;
00353
00354     if( !wire_write_msg(fd, &msg) )
00355         return FALSE;
00356
00357     if( !wire_flush(fd) )
00358         return FALSE;
00359
00360     return TRUE;
00361 }
00362
00363 int gp_getenv_write(pipe_t fd, const char* env)
00364 {
00365     WireMessage msg;
00366     GPT_GETENV* t = (GPT_GETENV*)malloc(sizeof(GPT_GETENV));
00367
00368     msg.type = GP_GETENV;
00369     msg.data = t;
00370
00371     t->empty = env == 0L;
00372     t->str = strdup(env == 0L ? "" : env);
00373
00374     if( !wire_write_msg(fd, &msg) )
00375         return FALSE;
00376
00377     wire_destroy(&msg);
00378     if( !wire_flush (fd) )
00379         return FALSE;
00380
00381     return TRUE;
00382 }
00383
00384 char* gp_getenv_read(pipe_t fd)
00385 {
00386     WireMessage msg;
00387     char* res;
00388
00389     memset(&msg, 0, sizeof(WireMessage));
00390     if( !wire_read_msg(fd, &msg) || msg.type != GP_GETENV )
00391     {
00392         fprintf(stderr, "cvsgui protocol error !\n");
00393         exit(-1);
00394     }
00395
00396     GPT_GETENV* t = (GPT_GETENV*)msg.data;
00397     res = t->empty ? 0L : strdup(t->str);
00398     wire_destroy(&msg);
00399
00400     return res;
00401 }
00402
00403 #ifdef WIN32
00404 extern "C"
00405 #endif
00406
00407 int gp_console_write(pipe_t fd, const char* str, int len, int isStderr)
00408 {
00409     WireMessage msg;
00410     GPT_CONSOLE* t = (GPT_CONSOLE*)malloc(sizeof(GPT_CONSOLE));
00411
00412     msg.type = GP_CONSOLE;
00413     msg.data = t;
00414
00415     t->isStderr = isStderr;
00416     t->len = len;
00417     t->str = (char*)malloc((len + 1) * sizeof(char));
00418     memcpy(t->str, str, len * sizeof(char));
00419     t->str[len] = '\0';
00420
00421     if( !wire_write_msg(fd, &msg) )
00422         return FALSE;
00423
00424     if( !wire_flush(fd) )
00425         return FALSE;
00426
00427     return TRUE;
00428 }
00429
00433 void cvs_process_init()
00434 {
00435     /* initialize the gimp protocol library and set the read and
00436      *  write handlers.
00437      */
00438     gp_init();
00439     wire_set_writer(cvs_process_write);
00440     wire_set_flusher(cvs_process_flush);
00441 }
00442
00451 static CvsProcess* cvs_process_new(char* name, int argc, char** argv)
00452 {
00453     CvsProcess* cvs_process;
00454
00455     cvs_process_init();
00456
00457     cvs_process = (CvsProcess*)malloc(sizeof(CvsProcess));
00458     if( cvs_process == 0L )
00459         return 0L;
00460
00461     cvs_process->open = FALSE;
00462     cvs_process->destroy = FALSE;
00463
00464 #ifdef WIN32
00465     cvs_process->starting = TRUE;
00466     cvs_process->threadID = 0;
00467 #endif
00468
00469     cvs_process->pid = 0;
00470
00471     cvs_process->callbacks = 0L;
00472     cvs_process->argc = argc + 4;
00473     cvs_process->args = (char**)malloc((cvs_process->argc + 1) * sizeof(char*));
00474     cvs_process->args[0] = strdup(name);
00475     cvs_process->args[1] = strdup("-cvsgui");
00476     cvs_process->args[2] = (char*)malloc(16 * sizeof(char));
00477     cvs_process->args[3] = (char*)malloc(16 * sizeof(char));
00478
00479     for(int i = 0; i < argc; i++)
00480     {
00481         cvs_process->args[4 + i] = strdup(argv[i]);
00482     }
00483
00484     cvs_process->args[cvs_process->argc] = 0L;
00485     cvs_process->my_read = 0;
00486     cvs_process->my_write = 0;
00487     cvs_process->his_read = 0;
00488     cvs_process->his_write = 0;
00489     cvs_process->write_buffer_index = 0;
00490     cvs_process->pstdin = 0;
00491     cvs_process->pstdout = 0;
00492     cvs_process->pstderr = 0;
00493
00494 #ifdef WIN32
00495     memset(cvs_process->threads, 0, sizeof(cvs_process->threads));
00496     memset(cvs_process->threadsID, 0, sizeof(cvs_process->threadsID));
00497
00498     cvs_process->stopProcessEvent = NULL;
00499 #endif
00500
00501     return cvs_process;
00502 }
00503
00508 static void cvs_process_destroy(CvsProcess* cvs_process)
00509 {
00510     if( cvs_process )
00511     {
00512         cvs_process_close(cvs_process, TRUE);
00513
00514         if( cvs_process->args != 0L )
00515         {
00516             for(int i = 0; i < cvs_process->argc; i++)
00517             {
00518                 if( cvs_process->args[i] )
00519                 {
00520                     free(cvs_process->args[i]);
00521                     cvs_process->args[i] = 0L;
00522                 }
00523             }
00524
00525             free(cvs_process->args);
00526             cvs_process->args = 0L;
00527         }
00528
00529         if( cvs_process == current_cvs_process )
00530             cvs_process_pop ();
00531
00532         if( !cvs_process->destroy )
00533         {
00534             cvs_process->destroy = TRUE;
00535 #ifdef WIN32
00536             // wait so the threads do not continue to use the pointer
00537             HANDLE WaitH[4];
00538             int cnt = 0;
00539             DWORD curT = GetCurrentThreadId();
00540
00541             for(int i = 0; i < 4; i++)
00542             {
00543                 if( cvs_process->threads[i] && curT != cvs_process->threadsID[i] )
00544                     WaitH[cnt++] = cvs_process->threads[i];
00545             }
00546
00547             WaitForMultipleObjects(cnt, WaitH, TRUE, INFINITE);
00548
00549             // Close the handles
00550             for(i = 0; i < 4; i++)
00551             {
00552                 if( cvs_process->threads[i] && CloseHandle(cvs_process->threads[i]) )
00553                 {
00554                     cvs_process->threads[i] = NULL;
00555                 }
00556             }
00557
00558             if( cvs_process->stopProcessEvent )
00559             {
00560                 CloseHandle(cvs_process->stopProcessEvent);
00561             }
00562 #endif
00563             free(cvs_process);
00564         }
00565     }
00566 }
00567
00568 #ifdef WIN32
00569
00578 static char* build_command(int argc, char* const* argv)
00579 {
00580     int len;
00581
00582     /* Compute the total length the command will have.  */
00583     {
00584         int i;
00585
00586         len = 0;
00587         for (i = 0; i < argc; i++)
00588         {
00589             char* p;
00590
00591             len += 2;  /* for the double quotes */
00592
00593             for (p = argv[i]; *p; p++)
00594             {
00595                 if( *p == '"' )
00596                     len += 2;
00597                 else
00598                     len++;
00599             }
00600
00601             len++;  /* for the space or the '\0'  */
00602         }
00603     }
00604
00605     {
00606         /* The + 10 is in case len is 0.  */
00607         char* command = (char*)malloc(len + 10);
00608         int i;
00609         char* p;
00610
00611         if( !command )
00612         {
00613             errno = ENOMEM;
00614             return command;
00615         }
00616
00617         p = command;
00618         *p = '\0';
00619         /* copy each element of argv to command, putting each command
00620         in double quotes, and backslashing any quotes that appear
00621         within an argument.  */
00622         for (i = 0; i < argc; i++)
00623         {
00624             char* a;
00625             *p++ = '"';
00626             for (a = argv[i]; *a; a++)
00627             {
00628                 if( *a == '"' )
00629                     *p++ = '\\', *p++ = '"';
00630                 else
00631                     *p++ = *a;
00632             }
00633
00634             *p++ = '"';
00635             *p++ = ' ';
00636         }
00637
00638         if( p > command )
00639             p[-1] = '\0';
00640
00641         return command;
00642     }
00643 }
00644
00646 #define BUFFSIZE 1024
00647
00649 #define THREAD_EXIT_SUCCESS (1)
00650
00656 static DWORD GetChldOutput(CvsProcess* process)
00657 {
00658     char buff[BUFFSIZE];
00659     DWORD dread;
00660
00661     while( ReadFile(process->pstdout, buff, BUFFSIZE-1, &dread, NULL) )
00662     {
00663         buff[dread] = '\0';
00664         process->callbacks->consoleout(buff, dread);
00665     }
00666
00667     return THREAD_EXIT_SUCCESS;
00668 }
00669
00675 static DWORD GetChldError(CvsProcess* process)
00676 {
00677     char buff[BUFFSIZE];
00678     DWORD dread;
00679
00680     while( ReadFile(process->pstderr, buff, BUFFSIZE-1, &dread, NULL) )
00681     {
00682         buff[dread] = '\0';
00683         process->callbacks->consoleerr(buff, dread);
00684     }
00685
00686     return THREAD_EXIT_SUCCESS;
00687 }
00688
00694 static DWORD MonitorChld(CvsProcess* process)
00695 {
00696     HANDLE waitHandles[2] = { process->pid, process->stopProcessEvent };
00697
00698     const DWORD waitResult = WaitForMultipleObjects(2, waitHandles, FALSE, INFINITE);
00699     if( waitResult == (WAIT_OBJECT_0 + 1) )
00700     {
00701         cvs_process_kill(process);
00702     }
00703     else
00704     {
00705         cvs_process_destroy(process);
00706     }
00707
00708     return THREAD_EXIT_SUCCESS;
00709 }
00710
00716 static DWORD ServeProtocol(CvsProcess* process)
00717 {
00718     while( process->starting )
00719     {
00720         Sleep(20);
00721         continue;
00722     }
00723
00724     DWORD avail;
00725     while( cvs_process_is_active(process) && process->open )
00726     {
00727         if( !PeekNamedPipe(process->my_read, 0L, 0 , 0L, &avail, 0L) )
00728             break;
00729
00730         if( avail == 0 )
00731         {
00732             Sleep(20);
00733             continue;
00734         }
00735
00736         cvs_process_recv_message(process);
00737     }
00738
00739     return THREAD_EXIT_SUCCESS;
00740 }
00741 #endif
00742
00743 #ifndef WIN32
00744 // pointer to the process if sigtt_handler is forced to kill
00745 CvsProcess *sigtt_cvs_process = NULL;
00746
00747 #define SIGTT_ERR "This CVS command required an interactive TTY, I had to kill it.\n"
00748
00749 static void sigtt_handler(int sig)
00750 {
00751   if (sigtt_cvs_process)
00752   {
00753     // keep that for later
00754     CvsProcessCallbacks *callbacks = sigtt_cvs_process->callbacks;
00755     // killing the cvs process avoids getting stuck in a SIGSTOP
00756     cvs_process_destroy (sigtt_cvs_process);
00757     callbacks->consoleerr(SIGTT_ERR, strlen(SIGTT_ERR));
00758   }
00759   sigtt_cvs_process = NULL;
00760 }
00761 #endif
00762
00772 CvsProcess* cvs_process_run(char* name, int argc, char** argv,
00773                             CvsProcessCallbacks* callbacks, CvsProcessStartupInfo* startupInfo)
00774 {
00775     if( !callbacks || !startupInfo )
00776         return 0L;
00777
00778     CvsProcess* cvs_process = cvs_process_new(name, argc, argv);
00779
00780     if( !cvs_process || !callbacks || !startupInfo )
00781         return 0L;
00782
00783     cvs_process->callbacks = callbacks;
00784
00785 #ifndef WIN32
00786
00787     int my_read[2] = { 0, 0 };
00788     int my_write[2] = { 0, 0 };
00789
00790     /* Open two pipes. (Bidirectional communication). */
00791     if( (pipe(my_read) == -1) || (pipe(my_write) == -1) )
00792     {
00793         fprintf(stderr, "unable to open pipe\n");
00794         cvs_process_destroy(cvs_process);
00795         return 0L;
00796     }
00797
00798     cvs_process->my_read = my_read[0];
00799     cvs_process->my_write = my_write[1];
00800     cvs_process->his_read = my_write[0];
00801     cvs_process->his_write = my_read[1];
00802
00803     /* Remember the file descriptors for the pipes. */
00804     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00805     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00806
00807     /* TTimo
00808     * add the relevant commands to spawn in a terminal if necessary
00809     */
00810     if( startupInfo->hasTty )
00811     {
00812         cvs_process->argc += 2;
00813         char **old_args = cvs_process->args;
00814         cvs_process->args = (char **)malloc((cvs_process->argc + 1) * sizeof(char *));
00815         cvs_process->args[0] = strdup ("xterm");
00816         cvs_process->args[1] = strdup ("-e");
00817         int i = 0;
00818         while (old_args[i])
00819         {
00820             cvs_process->args[i+2] = old_args[i];
00821             i++;
00822         }
00823
00824         cvs_process->args[cvs_process->argc] = 0L;
00825         free(old_args);
00826     }
00827
00828     /* If we are running non interactively (i.e. gcvs&), it is
00829     *  possible that the cvs process would require entering a password
00830     *  or something similar (happens in some cases for CVS_RSH=ssh)
00831     *  this would raise a SIGTTOU, which turns into a SIGSTOP if not handled
00832     */
00833     sigtt_cvs_process = cvs_process;
00834     signal(SIGTTIN, sigtt_handler); // TODO: check if necessary on Mac
00835     signal(SIGTTOU, sigtt_handler); // TODO: check if necessary on Mac
00836
00837     /* Fork another process. We'll remember the process id
00838     *  so that we can later use it to kill the filter if
00839     *  necessary.
00840     */
00841
00842     cvs_process->pid = fork ();
00843
00844     if( cvs_process->pid == 0 )
00845     {
00846         close(cvs_process->my_read);
00847         close(cvs_process->my_write);
00848         /* Execute the filter. The "_exit" call should never
00849         *  be reached, unless some strange error condition
00850         *  exists.
00851         */
00852         execvp(cvs_process->args[0], cvs_process->args);
00853         _exit(1);
00854     }
00855     else if( cvs_process->pid == -1 )
00856     {
00857         cvs_process_destroy(cvs_process);
00858         // fork failed
00859         sigtt_cvs_process = NULL;
00860         return 0L;
00861     }
00862
00863     close(cvs_process->his_read);
00864     cvs_process->his_read  = -1;
00865
00866     close(cvs_process->his_write);
00867     cvs_process->his_write = -1;
00868
00869 #else
00870
00871     SECURITY_ATTRIBUTES lsa = { 0 };
00872     STARTUPINFO si = { 0 };
00873     PROCESS_INFORMATION pi = { 0 };
00874
00875     HANDLE dupIn = 0L, dupOut = 0L;
00876     HANDLE stdChildIn = 0L, stdChildOut = 0L, stdChildErr = 0L;
00877     HANDLE stdoldIn = 0L, stdoldOut = 0L, stdoldErr = 0L;
00878     HANDLE stddupIn = 0L, stddupOut = 0L, stddupErr = 0L;
00879     char* command = 0L;
00880     BOOL resCreate;
00881     int cnt, i;
00882     LPTHREAD_START_ROUTINE threadsFunc[4];
00883
00884     lsa.nLength = sizeof(SECURITY_ATTRIBUTES);
00885     lsa.lpSecurityDescriptor = NULL;
00886     lsa.bInheritHandle = TRUE;
00887
00888     // create the pipes used for the cvsgui protocol
00889     if( !CreatePipe(&cvs_process->his_read, &dupIn, &lsa, 0) )
00890         goto error;
00891     if( !CreatePipe(&dupOut, &cvs_process->his_write, &lsa, 0) )
00892         goto error;
00893
00894     // duplicate the App side handles so they lose the inheritance
00895     if( !DuplicateHandle(GetCurrentProcess(), dupIn,
00896         GetCurrentProcess(), &cvs_process->my_write, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00897         goto error;
00898
00899     CloseHandle(dupIn);
00900     dupIn = 0;
00901
00902     if( !DuplicateHandle(GetCurrentProcess(), dupOut,
00903         GetCurrentProcess(), &cvs_process->my_read, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00904         goto error;
00905
00906     CloseHandle(dupOut);
00907     dupOut = 0;
00908
00909     if( !startupInfo->hasTty )
00910     {
00911         // redirect stdout, stderr, stdin
00912         if( !CreatePipe(&stdChildIn, &stddupIn, &lsa, 0) )
00913             goto error;
00914
00915         if( !CreatePipe(&stddupOut, &stdChildOut, &lsa, 0) )
00916             goto error;
00917
00918         if( !CreatePipe(&stddupErr, &stdChildErr, &lsa, 0) )
00919             goto error;
00920
00921         // same thing as above
00922         if( !DuplicateHandle(GetCurrentProcess(), stddupIn,
00923             GetCurrentProcess(), &cvs_process->pstdin, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00924             goto error;
00925
00926         CloseHandle(stddupIn);
00927         stddupIn = 0;
00928
00929         if( !DuplicateHandle(GetCurrentProcess(), stddupOut,
00930             GetCurrentProcess(), &cvs_process->pstdout, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00931             goto error;
00932
00933         CloseHandle(stddupOut);
00934         stddupOut = 0;
00935
00936         if( !DuplicateHandle(GetCurrentProcess(), stddupErr,
00937             GetCurrentProcess(), &cvs_process->pstderr, 0, FALSE, DUPLICATE_SAME_ACCESS) )
00938             goto error;
00939
00940         CloseHandle(stddupErr);
00941         stddupErr = 0;
00942     }
00943
00944     // Build the arguments for cvs
00945     sprintf(cvs_process->args[2], "%d", cvs_process->his_read);
00946     sprintf(cvs_process->args[3], "%d", cvs_process->his_write);
00947
00948     command = build_command(cvs_process->argc, cvs_process->args);
00949     if( command == 0L )
00950         goto error;
00951
00952     // Redirect Console StdHandles and set the start options
00953     memset(&si, 0, sizeof(STARTUPINFO));
00954     si.cb = sizeof(STARTUPINFO);
00955     si.dwFlags = startupInfo->hasTty ? 0 : STARTF_USESTDHANDLES;
00956     si.hStdInput = stdChildIn;
00957     si.hStdOutput = stdChildOut;
00958     si.hStdError = stdChildErr;
00959
00960     if( !startupInfo->hasTty )
00961     {
00962         si.dwFlags |= STARTF_USESHOWWINDOW;
00963         si.wShowWindow = SW_SHOWMINNOACTIVE;
00964
00965         stdoldIn  = GetStdHandle(STD_INPUT_HANDLE);
00966         stdoldOut = GetStdHandle(STD_OUTPUT_HANDLE);
00967         stdoldErr = GetStdHandle(STD_ERROR_HANDLE);
00968         SetStdHandle(STD_INPUT_HANDLE,  stdChildIn);
00969         SetStdHandle(STD_OUTPUT_HANDLE, stdChildOut);
00970         SetStdHandle(STD_ERROR_HANDLE,  stdChildErr);
00971     }
00972
00973     // Create Child Process
00974     resCreate = CreateProcess(
00975         NULL,
00976         command,
00977         NULL,
00978         NULL,
00979         TRUE,
00980         NORMAL_PRIORITY_CLASS | CREATE_SUSPENDED,
00981         NULL,
00982         startupInfo->currentDirectory && strlen(startupInfo->currentDirectory) ? startupInfo->currentDirectory : NULL,
00983         &si,
00984         &pi);
00985
00986     if( !startupInfo->hasTty )
00987     {
00988         SetStdHandle(STD_INPUT_HANDLE,  stdoldIn);
00989         SetStdHandle(STD_OUTPUT_HANDLE, stdoldOut);
00990         SetStdHandle(STD_ERROR_HANDLE,  stdoldErr);
00991     }
00992
00993     if( !resCreate )
00994         goto error;
00995
00996     cvs_process->threadID = pi.dwProcessId;
00997     cvs_process->pid = pi.hProcess;
00998
00999     cnt = 0;
01000
01001     // Create a stop process event
01002     cvs_process->stopProcessEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
01003     if( !cvs_process->stopProcessEvent )
01004     {
01005         goto error;
01006     }
01007
01008     // Now open-up threads which will serve the pipes
01009     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)ServeProtocol;
01010     threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)MonitorChld;
01011
01012     if( !startupInfo->hasTty )
01013     {
01014         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldOutput;
01015         threadsFunc[cnt++] = (LPTHREAD_START_ROUTINE)GetChldError;
01016     }
01017
01018     for(i = 0; i < cnt; i++)
01019     {
01020         if( (cvs_process->threads[i] = ::CreateThread(
01021             (LPSECURITY_ATTRIBUTES)NULL,                    // No security attributes.
01022             (DWORD)0,                                       // Use same stack size.
01023             (LPTHREAD_START_ROUTINE)threadsFunc[i],         // Thread procedure.
01024             (LPVOID)cvs_process,                            // Parameter to pass.
01025             (DWORD)0,                                       // Run immediately.
01026             (LPDWORD)&cvs_process->threadsID[i])) == NULL )
01027         {
01028             TerminateProcess(cvs_process->pid, 0);
01029             goto error;
01030         }
01031     }
01032
01033     //Close unneccesary Handles
01034     CloseHandle(cvs_process->his_read);
01035     cvs_process->his_read = 0;
01036     CloseHandle(cvs_process->his_write);
01037     cvs_process->his_write = 0;
01038
01039     if( !startupInfo->hasTty )
01040     {
01041         CloseHandle(stdChildIn);
01042         CloseHandle(stdChildOut);
01043         CloseHandle(stdChildErr);
01044     }
01045
01046     // Resume process execution
01047     ResumeThread(pi.hThread);
01048     CloseHandle(pi.hThread);
01049
01050     // Small tactical delay to reduce problems with process termination
01051     Sleep(100);
01052
01053     free(command);
01054
01055     goto goodboy;
01056
01057 error:
01058     if(cvs_process->his_read != 0L)
01059         CloseHandle(cvs_process->his_read);
01060     if(cvs_process->his_write != 0L)
01061         CloseHandle(cvs_process->his_write);
01062     if(dupIn != 0L)
01063         CloseHandle(dupIn);
01064     if(dupOut != 0L)
01065         CloseHandle(dupOut);
01066     if(cvs_process->my_read != 0L)
01067         CloseHandle(cvs_process->my_read);
01068     if(cvs_process->my_write != 0L)
01069         CloseHandle(cvs_process->my_write);
01070     if(command != 0L)
01071         free(command);
01072     if(stdChildIn != 0L)
01073         CloseHandle(stdChildIn);
01074     if(stdChildOut != 0L)
01075         CloseHandle(stdChildOut);
01076     if(stdChildErr != 0L)
01077         CloseHandle(stdChildErr);
01078     if(stddupIn != 0L)
01079         CloseHandle(stddupIn);
01080     if(stddupOut != 0L)
01081         CloseHandle(stddupOut);
01082     if(stddupErr != 0L)
01083         CloseHandle(stddupErr);
01084     if(cvs_process->pstdin != 0L)
01085         CloseHandle(cvs_process->pstdin);
01086     if(cvs_process->pstdout != 0L)
01087         CloseHandle(cvs_process->pstdout);
01088     if(cvs_process->pstderr != 0L)
01089         CloseHandle(cvs_process->pstderr);
01090
01091     cvs_process_destroy (cvs_process);
01092     return 0L;
01093
01094 goodboy:
01095 #endif
01096
01097     {
01098         CStackThreadLock locker;
01099
01100         open_cvs_process.push_back(cvs_process);
01101     }
01102
01103     cvs_process->open = TRUE;
01104 #ifdef WIN32
01105     cvs_process->starting = FALSE;
01106 #endif
01107
01108     return cvs_process;
01109 }
01110
01116 static void cvs_process_close(CvsProcess* cvs_process, int kill_it)
01117 {
01118     CDestroyThreadLock locker;
01119
01120     if( cvs_process && cvs_process->open )
01121     {
01122 #ifdef WIN32
01123
01124         if( GetCurrentThreadId() != cvs_process->threadsID[0] )
01125         {
01126             // we wait for all the protocol to be over before we close
01127             // the process and the pipe.
01128             WaitForSingleObject(cvs_process->threads[0], 500);
01129             cvs_process->open = FALSE;
01130             WaitForSingleObject(cvs_process->threads[0], 500);
01131         }
01132 #endif
01133
01134         cvs_process->open = FALSE;
01135
01136 #ifndef WIN32
01137         int status;
01138
01139         /* If necessary, kill the filter. */
01140         if( kill_it && cvs_process->pid )
01141             status = kill(cvs_process->pid, SIGKILL);
01142
01143         /* Wait for the process to exit. This will happen
01144          *  immediately if it was just killed.
01145          */
01146         if( cvs_process->pid )
01147             waitpid(cvs_process->pid, &status, 0);
01148
01149         /* Close the pipes. */
01150         if( cvs_process->my_read )
01151             close(cvs_process->my_read);
01152
01153         if( cvs_process->my_write )
01154             close(cvs_process->my_write);
01155
01156         if( cvs_process->his_read )
01157             close(cvs_process->his_read);
01158
01159         if( cvs_process->his_write )
01160             close(cvs_process->his_write);
01161 #else
01162         cvs_process->starting = TRUE;
01163
01164         if( kill_it && cvs_process->pid )
01165         {
01166             cvs_process_terminate(cvs_process);
01167         }
01168
01169         if( cvs_process->pid )
01170             CloseHandle(cvs_process->pid);
01171
01172         if( cvs_process->my_read )
01173             CloseHandle(cvs_process->my_read);
01174
01175         if( cvs_process->my_write )
01176             CloseHandle(cvs_process->my_write);
01177
01178         if( cvs_process->his_read )
01179             CloseHandle(cvs_process->his_read);
01180
01181         if( cvs_process->his_write )
01182             CloseHandle(cvs_process->his_write);
01183
01184         if( cvs_process->pstdin )
01185             CloseHandle(cvs_process->pstdin);
01186
01187         if( cvs_process->pstdout )
01188             CloseHandle(cvs_process->pstdout);
01189
01190         if( cvs_process->pstderr )
01191             CloseHandle(cvs_process->pstderr);
01192 #endif
01193
01194         wire_clear_error();
01195
01196         /* Set the fields to null values.
01197          */
01198         cvs_process->pid = 0;
01199         cvs_process->my_read = 0;
01200         cvs_process->my_write = 0;
01201         cvs_process->his_read = 0;
01202         cvs_process->his_write = 0;
01203         cvs_process->pstdin = 0;
01204         cvs_process->pstdout = 0;
01205         cvs_process->pstderr = 0;
01206
01207         {
01208             CStackThreadLock locker;
01209
01210             STD_STL vector<CvsProcess*>::iterator i = STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01211             if( i != open_cvs_process.end() )
01212                 open_cvs_process.erase(i);
01213         }
01214     }
01215 }
01216
01222 int cvs_process_is_active(const CvsProcess* cvs_process)
01223 {
01224     int res;
01225
01226     {
01227         CStackThreadLock locker;
01228
01229         STD_STL vector<CvsProcess*>::iterator i =
01230             STD_STL find(open_cvs_process.begin(), open_cvs_process.end(), cvs_process);
01231         res = i != open_cvs_process.end() ? 1 : 0;
01232     }
01233
01234     return res;
01235 }
01236
01241 void cvs_process_kill(CvsProcess* cvs_process)
01242 {
01243     if( cvs_process_is_active(cvs_process) )
01244     {
01245         cvs_process_destroy(cvs_process);
01246     }
01247 }
01248
01253 void cvs_process_stop(CvsProcess* cvs_process)
01254 {
01255 #ifdef WIN32
01256     // On windows we need to kill process "from within" to avoid race condition with MonitorChld thread
01257     SetEvent(cvs_process->stopProcessEvent);
01258 #else
01259     cvs_process_kill(cvs_process);
01260 #endif
01261 }
01262
01267 int cvs_process_give_time(void)
01268 {
01269 #ifndef WIN32
01270
01271     fd_set rset;
01272     int ready;
01273     int maxfd = 0;
01274     int fd;
01275     struct timeval tv;
01276     int didone = 0;
01277
01278     FD_ZERO (&rset);
01279
01280     STD_STL vector<CvsProcess*>::iterator i;
01281
01282     for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01283     {
01284         fd = (*i)->my_read;
01285
01286         FD_SET (fd, &rset);
01287         if( fd > maxfd )
01288             maxfd = fd;
01289     }
01290
01291     tv.tv_sec = 0;
01292     tv.tv_usec = 10000; // was 100000, but this blocks the interactive dialogs e.g. password dialog
01293     ready = select (maxfd + 1, &rset, 0L, 0L, &tv);
01294
01295     STD_STL vector<CvsProcess*> toFire;
01296     if( ready > 0 )
01297     {
01298         for (i = open_cvs_process.begin(); i != open_cvs_process.end(); ++i)
01299         {
01300             fd = (*i)->my_read;
01301
01302             if( FD_ISSET(fd, &rset) )
01303                 toFire.push_back(*i);
01304         }
01305     }
01306
01307     for (i = toFire.begin(); i != toFire.end(); ++i)
01308     {
01309         fd = (*i)->my_read;
01310
01311         if( FD_ISSET(fd, &rset) )
01312         {
01313             cvs_process_recv_message(*i);
01314             didone = 1;
01315         }
01316     }
01317
01318     return didone;
01319 #else
01320
01321     // we don't have to do yield since we use preemptive threads
01322     return 0;
01323 #endif
01324 }
01325
01330 static void cvs_process_recv_message(CvsProcess* cvs_process)
01331 {
01332     WireMessage msg;
01333
01334     cvs_process_push(cvs_process);
01335
01336     memset(&msg, 0, sizeof(WireMessage));
01337
01338     if( !wire_read_msg(cvs_process->my_read, &msg) )
01339     {
01340         cvs_process_close(cvs_process, TRUE);
01341     }
01342     else
01343     {
01344         cvs_process_handle_message(&msg);
01345         wire_destroy(&msg);
01346     }
01347
01348     if( cvs_process_is_active(current_cvs_process) )
01349     {
01350         if( !current_cvs_process->open )
01351         {
01352 #ifndef WIN32
01353             cvs_process_destroy(current_cvs_process);
01354 #endif
01355         }
01356         else
01357             cvs_process_pop();
01358     }
01359 }
01360
01365 static void cvs_process_handle_message(WireMessage* msg)
01366 {
01367     switch(msg->type)
01368     {
01369     case GP_QUIT:
01370         {
01371             GPT_QUIT* t = (GPT_QUIT*)msg->data;
01372 #ifdef WIN32
01373             // Small delay to work around problems on Win9x (we will have to find the "real" solution in the future though...)
01374             Sleep(100);
01375 #endif
01376             current_cvs_process->callbacks->exit(t->code);
01377             cvs_process_close(current_cvs_process, FALSE);
01378             break;
01379         }
01380     case GP_GETENV:
01381         {
01382             GPT_GETENV* t = (GPT_GETENV*)msg->data;
01383             cvs_process_push(current_cvs_process);
01384             gp_getenv_write(current_cvs_process->my_write, current_cvs_process->callbacks->getenv(t->str));
01385             cvs_process_pop();
01386             break;
01387         }
01388     case GP_CONSOLE:
01389         {
01390             GPT_CONSOLE* t = (GPT_CONSOLE*)msg->data;
01391             if( t->isStderr )
01392                 current_cvs_process->callbacks->consoleerr(t->str, t->len);
01393             else
01394                 current_cvs_process->callbacks->consoleout(t->str, t->len);
01395
01396             break;
01397         }
01398     }
01399 }
01400
01408 static int cvs_process_write(pipe_t fd, guint8* buf, gulong  count)
01409 {
01410     gulong bytes;
01411
01412     if( current_write_buffer == 0L )
01413         current_write_buffer = process_write_buffer;
01414
01415     while( count > 0 )
01416     {
01417         if( (current_write_buffer_index + count) >= WRITE_BUFFER_SIZE )
01418         {
01419             bytes = WRITE_BUFFER_SIZE - current_write_buffer_index;
01420             memcpy(&current_write_buffer[current_write_buffer_index], buf, bytes);
01421             current_write_buffer_index += bytes;
01422
01423             if( !wire_flush(fd) )
01424                 return FALSE;
01425         }
01426         else
01427         {
01428             bytes = count;
01429             memcpy(&current_write_buffer[current_write_buffer_index], buf, bytes);
01430             current_write_buffer_index += bytes;
01431         }
01432
01433         buf += bytes;
01434         count -= bytes;
01435     }
01436
01437     return TRUE;
01438 }
01439
01445 static int cvs_process_flush(pipe_t fd)
01446 {
01447     int count;
01448     int bytes;
01449
01450     if( current_write_buffer_index > 0 )
01451     {
01452         count = 0;
01453         while( count != current_write_buffer_index )
01454         {
01455             do {
01456                 bytes = write(fd, &current_write_buffer[count], (current_write_buffer_index - count));
01457             } while( (bytes == -1) && (errno == EAGAIN) );
01458
01459             if( bytes == -1 )
01460                 return FALSE;
01461
01462             count += bytes;
01463         }
01464
01465         current_write_buffer_index = 0;
01466     }
01467
01468     return TRUE;
01469 }
01470
01475 static void cvs_process_push(CvsProcess* cvs_process)
01476 {
01477     CStackThreadLock locker;
01478
01479     if( cvs_process )
01480     {
01481         current_cvs_process = cvs_process;
01482
01483         cvs_process_stack.push_back(current_cvs_process);
01484
01485         current_write_buffer_index = current_cvs_process->write_buffer_index;
01486         current_write_buffer = current_cvs_process->write_buffer;
01487     }
01488     else
01489     {
01490         current_write_buffer_index = 0;
01491         current_write_buffer = NULL;
01492     }
01493 }
01494
01498 static void cvs_process_pop()
01499 {
01500     CStackThreadLock locker;
01501
01502     if( current_cvs_process )
01503     {
01504         current_cvs_process->write_buffer_index = current_write_buffer_index;
01505
01506         cvs_process_stack.pop_back();
01507     }
01508
01509     if( !cvs_process_stack.empty() )
01510     {
01511         current_cvs_process = cvs_process_stack.back();
01512         current_write_buffer_index = current_cvs_process->write_buffer_index;
01513         current_write_buffer = current_cvs_process->write_buffer;
01514     }
01515     else
01516     {
01517         current_cvs_process = NULL;
01518         current_write_buffer_index = 0;
01519         current_write_buffer = NULL;
01520     }
01521 }
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 <stdio.h>
00028 #include <sys/types.h>
00029 #include "cvsgui_wire.h"
00030
00031 #define WRITE_BUFFER_SIZE   512
00032
00033 /* C++ has a "bool" type built in. */
00034 #ifndef __cplusplus
00035 typedef unsigned char bool;
00036 #endif
00037
00038 typedef struct _CvsProcess CvsProcess;
00039
00041 typedef struct
00042 {
00043     long (*consoleout)(char* txt, long len);
00044     long (*consoleerr)(char* txt, long len);
00045     const char* (*getenv)(char* name);
00046     void (*exit)(int code);
00047 } CvsProcessCallbacks;
00048
00050 struct _CvsProcess
00051 {
00052     unsigned int open : 1;
00053     unsigned int destroy : 1;
00054 #ifdef WIN32
00055     unsigned int starting : 1;
00056     DWORD threadID;
00057 #endif
00058     pid_t pid;
00060     char** args;
00061     int argc;
00062
00063     pipe_t my_read;
00064     pipe_t my_write;
00066     pipe_t his_read;
00067     pipe_t his_write;
00069     pipe_t pstdin;
00070     pipe_t pstdout;
00071     pipe_t pstderr;
00073     char write_buffer[WRITE_BUFFER_SIZE];
00074     int write_buffer_index;
00075     CvsProcessCallbacks* callbacks;
00077 #ifdef WIN32
00078     HANDLE threads[4];
00079     DWORD threadsID[4];
00081     HANDLE stopProcessEvent;
00082 #endif
00083 };
00084
00086 typedef struct _CvsProcessStartupInfo
00087 {
00088     int hasTty;
00089     const char* currentDirectory;
00091 #ifdef __cplusplus
00092     _CvsProcessStartupInfo()
00093     {
00094         hasTty = false;
00095         currentDirectory = NULL;
00096     }
00097 #endif
00098
00099 } CvsProcessStartupInfo;
00100
00101
00102 #ifdef __cplusplus
00103 extern "C" {
00104 #endif
00105
00106 CvsProcess* cvs_process_run(char* name, int argc, char** argv,
00107                             CvsProcessCallbacks* callbacks, CvsProcessStartupInfo* startupInfo);
00108 void cvs_process_stop(CvsProcess* cvs_process);
00109
00110 int cvs_process_is_active(const CvsProcess* cvs_process);
00111 int cvs_process_give_time(void);
00112
00113 void cvs_process_init(void);
00114
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118
00119 #endif /* CVSGUI_PROCESS_H */
Generated on Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00158         UFSSpec theFolder;
00159         CStr home;
00160
00161         if(MacGetPrefsFolder(theFolder, home) == noErr)
00162         {
00163 #else /* !TARGET_OS_MAC */
00164         if(gCvsPrefs.Home() != 0L)
00165         {
00166             CStr home(gCvsPrefs.Home());
00167 #endif /* !TARGET_OS_MAC */
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 || TARGET_RT_MAC_MACHO
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 .DS_Store _$* *$");
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 Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 /* TARGET_OS_MAC */
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 "WinCvsBrowser.h"
00057 #   include "wincvs.h"
00058 #   include "wincvs_winutil.h"
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 #ifdef qMacCvsPP
00067 #   include "GUSIInternal.h"
00068 #   include "GUSIFileSpec.h"
00069 #   include "MacCvsApp.h"
00070 #   include <UProcess.h>
00071 #endif
00072
00073 #if qUnix
00074 #   include "UCvsApp.h"
00075 #   include "UCvsFolders.h"
00076 #endif
00077
00078 CvsPrefs gCvsPrefs;
00079
00080 static CPersistentInt gPersistentShema("P_PersistentShema", SCHEMA_0);
00081
00082 static CPersistentBool gCheckoutRO("P_CheckoutRO", true, kAddSettings);
00083 static CPersistentBool gZ9Option("P_Z9Option", false, kAddSettings);
00084 static CPersistentBool gPruneOption("P_PruneOption", true, kAddSettings);
00085 static CPersistentBool gQuietOption("P_QuietOption", false);
00086 static CPersistentInt gIsoConvert("P_NIsoConvert", ISO8559_none, kAddSettings);
00087 static CPersistentBool gICTextOption("P_ICTextOption", false, kAddSettings);
00088 static CPersistentBool gAddBinControl("P_AddBinControl", true);
00089 static CPersistentBool gUseViewerAlways("P_UseViewerAlways", false, kAddSettings);
00090 static CPersistentInt gMacBinEncoding("P_NMacBinEncoding", MAC_HQX, kAddSettings);
00091 static CPersistentInt gUseShell("P_UseShell", SHELL_TCL);
00092
00093 static PCPStr gCvsroot("P_Cvsroot");
00094 CMString gOldCvsroots(20, "P_OldCvsroots");
00095
00096 // migration
00097 #ifndef MIGRATECVSROOTLIST
00098 static PCPStr gCvsroot1("P_Cvsroot1");
00099 static PCPStr gCvsroot2("P_Cvsroot2");
00100 static PCPStr gCvsroot3("P_Cvsroot3");
00101 static PCPStr gCvsroot4("P_Cvsroot4");
00102 static PCPStr gCvsroot5("P_Cvsroot5");
00103 static PCPStr gCvsroot6("P_Cvsroot6");
00104 static PCPStr gCvsroot7("P_Cvsroot7");
00105 static PCPStr gCvsroot8("P_Cvsroot8");
00106 static PCPStr gCvsroot9("P_Cvsroot9");
00107 static PCPStr gCvsroot10("P_Cvsroot10");
00108 static PCPStr gCvsroot11("P_Cvsroot11");
00109 static PCPStr gCvsroot12("P_Cvsroot12");
00110 static PCPStr gCvsroot13("P_Cvsroot13");
00111 static PCPStr gCvsroot14("P_Cvsroot14");
00112 static PCPStr gCvsroot15("P_Cvsroot15");
00113 static PCPStr gCvsroot16("P_Cvsroot16");
00114 static PCPStr gCvsroot17("P_Cvsroot17");
00115 static PCPStr gCvsroot18("P_Cvsroot18");
00116 static PCPStr gCvsroot19("P_Cvsroot19");
00117 static PCPStr gCvsroot20("P_Cvsroot20");
00118 #endif
00119
00120 static CPersistentInt gKserverPort("P_KserverPort", -1, kAddSettings);
00121 static CPersistentInt gPserverPort("P_PserverPort", -1, kAddSettings);
00122 static CPersistentInt gRhostPort("P_RhostPort", -1, kAddSettings);
00123 static PCPStr gServerName("P_ServerName", 0L, kAddSettings);
00124 static PCStr gRshName("P_RshName", 0L, kAddSettings);
00125 static CPersistentBool gEncryptCommunication("P_EncryptCommunication", false, kAddSettings);
00126
00127 #ifndef qUnix
00128 static PCStr gHome("P_Home", 0L, kAddSettings);
00129 #endif /* !qUnix */
00130 #ifdef qUnix
00131 static PCStr gViewer("P_Viewer", "emacs"); // not vi ;-)
00132 #else
00133 static PCStr gViewer("P_Viewer", "Notepad");
00134 #endif
00135 static PCStr gHelper("P_Helper", "netscape");
00136 static PCStr gBrowser("P_Browser", "gmc");
00137 #ifdef qUnix
00138 static PCStr gExtdiff("P_Extdiff", "emacs");
00139 #elif TARGET_RT_MAC_MACHO
00140 static PCStr gExtdiff("P_Extdiff", "opendiff");
00141 #else
00142 static PCStr gExtdiff("P_Extdiff", "");
00143 #endif
00144 static CPersistentBool gDirtySupport("P_DirtySupport", true, kAddSettings);
00145 static CPersistentBool gAlwaysUseCvsroot("P_AlwaysUseCvsroot", false, kAddSettings);
00146 static CPersistentInt gLogoutTimeOut("P_LogoutTimeOut", 0);
00147 static PCStr gProxyHost("P_ProxyHost", "www.mydomain", kAddSettings);
00148 static CPersistentInt gProxyPort("P_ProxyPort", 8888, kAddSettings);
00149 static CPersistentBool gUseProxy("P_UseProxy", false, kAddSettings);
00150 static CPersistentBool gUnixLF("P_UnixLF", false, kAddSettings);
00151 static CPersistentBool gMacLF("P_MacLF", false, kAddSettings);
00152 static CPersistentInt gZLevel("P_ZLevel", 9, kAddSettings);
00153 static CPersistentInt gCvsVersion("P_CvsVersion", 0, kAddSettings);
00154 static CPersistentBool gCvsConsole("P_CvsConsole", false, kAddSettings);
00155 static CPersistentInt gWordWrapLogMsg("P_WordWrapLogMsg", 0, kAddSettings);
00156 static PCStr gLastWorkingDir("P_LastWorkingDir", 0L, kAddSettings);
00157
00158 static CPersistentBool gDisableSplashScreen("P_DisableSplashScreen", false);
00159 static CPersistentInt gStatusOutputType("P_StatusOutputType", STATUSOUTPUT_VERBOSE);
00160
00161 static CPersistentBool gHideCommandDlgUpdate("P_HideCommandDlgUpdate", false);
00162 static CPersistentBool gHideCommandDlgDiff("P_HideCommandDlgDiff", false);
00163 static CPersistentBool gHideCommandDlgLog("P_HideCommandDlgLog", false);
00164 static CPersistentBool gHideCommandDlgGraph("P_HideCommandDlgGraph", false);
00165 static CPersistentBool gHideCommandDlgAnnotate("P_HideCommandDlgAnnotate", false);
00166 static CPersistentBool gHideCommandDlgStatus("P_HideCommandDlgStatus", false);
00167 static CPersistentBool gHideCommandDlgUseShift("P_HideCommandDlgUseShift", true);
00168
00169 static CKeyString gWhichCvs(10, "P_WhichCvs" );
00170 static CPersistentBool gUseAltCvs("P_UseAltCvs", false, kAddSettings);
00171 static PCStr gSettingsFolder("P_SettingsFolder", 0L);
00172
00173 bool CvsPrefs::CheckoutRO(void) const {return gCheckoutRO;}
00174 bool CvsPrefs::Z9Option(void) const
00175 {
00176 #if TARGET_RT_MAC_CFM
00177     // because of the problem with LSH...
00178     return true;
00179 #endif
00180     return gZ9Option;
00181 }
00182 bool CvsPrefs::PruneOption(void) const {return gPruneOption;}
00183 bool CvsPrefs::QuietOption(void) const {return gQuietOption;}
00184 ISO8559 CvsPrefs::IsoConvert(void) const {return (ISO8559)(int)gIsoConvert;}
00185 bool CvsPrefs::ICTextOption(void) const {return gICTextOption;}
00186 bool CvsPrefs::AddControl(void) const {return gAddBinControl;}
00187 bool CvsPrefs::UseViewerAlways(void) const {return gUseViewerAlways;}
00188 MACENCODING CvsPrefs::MacBinEncoding(void) const {return (MACENCODING)(int)gMacBinEncoding;}
00189 int CvsPrefs::KserverPort(void) const {return gKserverPort;}
00190 int CvsPrefs::PserverPort(void) const {return gPserverPort;}
00191 int CvsPrefs::RhostPort(void) const {return gRhostPort;}
00192
00193 const char* CvsPrefs::ServerName(void) const
00194 {
00195     return gServerName.empty() ? 0L : (const char*)gServerName;
00196 }
00197 const char* CvsPrefs::RshName(void) const
00198 {
00199     return gRshName.empty() ? 0L : (const char*)gRshName;
00200 }
00201 bool CvsPrefs::EncryptCommunication(void) const {return gEncryptCommunication;}
00202
00203 const char* CvsPrefs::Home(void) const
00204 {
00205 #if !qUnix && !TARGET_RT_MAC_MACHO
00206 #   ifdef WIN32
00207     // Windows 98 doesn't like C:\/.cvspass
00208     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00209     {
00210         gHome[gHome.length() - 1] = '\0';
00211     }
00212 #   endif
00213     return gHome.empty() ? 0L : (const char*)gHome;
00214 #else /* qUnix */
00215     static CStr home;
00216     if (!home.empty())
00217         return home;
00218
00219     char *env = getenv ("HOME");
00220     struct passwd *pw;
00221     if (env)
00222         home = env;
00223     else if ((pw = (struct passwd *) getpwuid (getuid ()))
00224              && pw->pw_dir)
00225         home = pw->pw_dir;
00226     else
00227         return 0L;
00228
00229     return home;
00230 #endif /* qUnix */
00231 }
00232 const char* CvsPrefs::Viewer(void) const
00233 {
00234     return gViewer.empty() ? 0L : (const char*)gViewer;
00235 }
00236 const char* CvsPrefs::Helper(void) const
00237 {
00238     return gHelper.empty() ? 0L : (const char*)gHelper;
00239 }
00240 const char* CvsPrefs::Browser(void) const
00241 {
00242     return gBrowser.empty() ? 0L : (const char*)gBrowser;
00243 }
00244 const char* CvsPrefs::ExtDiff(void) const
00245 {
00246     return gExtdiff.empty() ? 0L : (const char*)gExtdiff;
00247 }
00248 bool CvsPrefs::DirtySupport(void) const {return gDirtySupport;}
00249 int CvsPrefs::LogoutTimeOut(void) const {return gLogoutTimeOut;}
00250 bool CvsPrefs::AlwaysUseCvsroot(void) const {return gAlwaysUseCvsroot;}
00251 const char* CvsPrefs::ProxyHost(void) const {return gProxyHost;}
00252 int CvsPrefs::ProxyPort(void) const {return gProxyPort;}
00253 bool CvsPrefs::UseProxy(void) const {return gUseProxy;}
00254 bool CvsPrefs::UnixLF(void) const {return gUnixLF;}
00255 bool CvsPrefs::MacLF(void) const {return gMacLF;}
00256 int CvsPrefs::ZLevel(void) const {return gZLevel;}
00257 int CvsPrefs::CvsVersion(void) const {return gCvsVersion;}
00258 bool CvsPrefs::CvsConsole(void) const {return gCvsConsole;}
00259 int CvsPrefs::WordWrapLogMsg(void) const {return gWordWrapLogMsg;}
00260 SHELL_KIND CvsPrefs::GetUseShell(void) const {return (SHELL_KIND)(int)gUseShell;}
00261 bool CvsPrefs::DisableSplashScreen(void) const {return gDisableSplashScreen;}
00262 STATUSOUTPUT_TYPE CvsPrefs::StatusOutputType(void) const {return (STATUSOUTPUT_TYPE)(int)gStatusOutputType;}
00263 const char* CvsPrefs::SettingsFolder(void) const {return gSettingsFolder.empty() ? 0L : (const char*)gSettingsFolder;};
00264
00265 /* Return the current working dir (last working dir).   */
00266 /* This directory is automatically selected when WinCVS */
00267 /* is opened the next time. */
00268 const char* CvsPrefs::LastWorkingDir(void) const
00269 {
00270     return gLastWorkingDir.empty() ? 0L : (const char*)gLastWorkingDir;
00271 }
00272
00273 bool CvsPrefs::HideCommandDlgUpdate(void) const {return gHideCommandDlgUpdate;}
00274 bool CvsPrefs::HideCommandDlgDiff(void) const {return gHideCommandDlgDiff;}
00275 bool CvsPrefs::HideCommandDlgLog(void) const {return gHideCommandDlgLog;}
00276 bool CvsPrefs::HideCommandDlgGraph(void) const {return gHideCommandDlgGraph;}
00277 bool CvsPrefs::HideCommandDlgAnnotate(void) const {return gHideCommandDlgAnnotate;}
00278 bool CvsPrefs::HideCommandDlgStatus(void) const {return gHideCommandDlgStatus;}
00279 bool CvsPrefs::HideCommandDlgUseShift(void) const {return gHideCommandDlgUseShift;}
00280
00281 void CvsPrefs::SetCheckoutRO(bool newState) {gCheckoutRO = newState;}
00282 void CvsPrefs::SetZ9Option(bool newState) {gZ9Option = newState;}
00283 void CvsPrefs::SetPruneOption(bool newState) {gPruneOption = newState;}
00284 void CvsPrefs::SetQuietOption(bool newState) {gQuietOption = newState;}
00285 void CvsPrefs::SetIsoConvert(ISO8559 newState) {gIsoConvert = (int)newState;}
00286 void CvsPrefs::SetICTextOption(bool newState) {gICTextOption = newState;}
00287 void CvsPrefs::SetAddControl(bool newState) {gAddBinControl = newState;}
00288 void CvsPrefs::SetUseViewerAlways(bool newState) {gUseViewerAlways = newState;}
00289 void CvsPrefs::SetMacBinEncoding(MACENCODING newState) {gMacBinEncoding = (int)newState;}
00290 void CvsPrefs::SetKserverPort(int newState) {gKserverPort = newState;}
00291 void CvsPrefs::SetPserverPort(int newState) {gPserverPort = newState;}
00292 void CvsPrefs::SetRhostPort(int newState) {gRhostPort = newState;}
00293 void CvsPrefs::SetServerName(const char* newservername) {gServerName = newservername;}
00294 void CvsPrefs::SetRshName(const char* newrshname) {gRshName = newrshname;}
00295 void CvsPrefs::SetEncryptCommunication(bool newState) {gEncryptCommunication = newState;}
00296
00297 void CvsPrefs::SetHome(const char* newhome)
00298 {
00299 #ifndef qUnix
00300     gHome = newhome;
00301 #   ifdef WIN32
00302     // Windows 98 doesn't like C:\/.cvspass
00303     if(!gHome.empty() && gHome.endsWith(kPathDelimiter))
00304     {
00305         gHome[gHome.length() - 1] = '\0';
00306     }
00307 #   endif
00308 #endif /* !qUnix */
00309 }
00310
00311 void CvsPrefs::SetViewer(const char* newviewer) {gViewer = newviewer;}
00312 void CvsPrefs::SetBrowser(const char* newviewer) {gBrowser = newviewer;}
00313 void CvsPrefs::SetHelper(const char* newviewer) {gHelper = newviewer;}
00314 void CvsPrefs::SetExtDiff(const char* newdiff) {gExtdiff = newdiff;}
00315 void CvsPrefs::SetDirtySupport(bool newState) {gDirtySupport = newState;}
00316 void CvsPrefs::SetLogoutTimeOut(int newTimeout) {gLogoutTimeOut = newTimeout;}
00317 void CvsPrefs::SetAlwaysUseCvsroot(bool newState) {gAlwaysUseCvsroot = newState;}
00318 void CvsPrefs::SetUseProxy(bool useit) {gUseProxy = useit;}
00319 void CvsPrefs::SetUnixLF(bool useit) {gUnixLF = useit;}
00320 void CvsPrefs::SetMacLF(bool useit) {gMacLF = useit;}
00321 void CvsPrefs::SetZLevel(int level) {gZLevel = level;}
00322 void CvsPrefs::SetProxyHost(const char* newhost) {gProxyHost = newhost;}
00323 void CvsPrefs::SetProxyPort(int newport) {gProxyPort = newport;}
00324 void CvsPrefs::SetCvsVersion(int vers) {gCvsVersion = vers;}
00325 void CvsPrefs::SetCvsConsole(bool console) {gCvsConsole = console;}
00326 void CvsPrefs::SetWordWrapLogMsg(int wordwrap) {gWordWrapLogMsg = wordwrap;}
00327 void CvsPrefs::SetLastWorkingDir(const char* workdir) {gLastWorkingDir = workdir;}
00328 void CvsPrefs::SetUseShell(SHELL_KIND shell) {gUseShell = shell;}
00329 void CvsPrefs::SetDisableSplashScreen(bool newState) {gDisableSplashScreen = newState;}
00330 void CvsPrefs::SetStatusOutputType(STATUSOUTPUT_TYPE outputType) {gStatusOutputType = outputType;}
00331 void CvsPrefs::SetSettingsFolder(const char* settingsFolder) {gSettingsFolder = settingsFolder;};
00332
00333 void CvsPrefs::SetHideCommandDlgUpdate(bool newState) {gHideCommandDlgUpdate = newState;}
00334 void CvsPrefs::SetHideCommandDlgDiff(bool newState) {gHideCommandDlgDiff = newState;}
00335 void CvsPrefs::SetHideCommandDlgLog(bool newState) {gHideCommandDlgLog = newState;}
00336 void CvsPrefs::SetHideCommandDlgGraph(bool newState) {gHideCommandDlgGraph = newState;}
00337 void CvsPrefs::SetHideCommandDlgAnnotate(bool newState) {gHideCommandDlgAnnotate = newState;}
00338 void CvsPrefs::SetHideCommandDlgStatus(bool newState) {gHideCommandDlgStatus = newState;}
00339 void CvsPrefs::SetHideCommandDlgUseShift(bool newState) {gHideCommandDlgUseShift = newState;}
00340
00341 bool CvsPrefs::empty(void) const  { return gCvsroot.empty();  }
00342 int  CvsPrefs::length(void) const { return gCvsroot.length(); }
00343 CvsPrefs::operator const char*() const {    return (const char*)gCvsroot; }
00344 CvsPrefs::operator const unsigned char *() const {return (const unsigned char *)gCvsroot;}
00345 const char* CvsPrefs::operator=(const char*newstr) {    return gCvsroot = newstr; }
00346 const unsigned char *CvsPrefs::operator=(const unsigned char *newstr) { return gCvsroot = newstr; }
00347
00348 // migration
00349 #ifndef MIGRATECVSROOTLIST
00350 CPStr & CvsPrefs::get_cvsroot_list(int entry)
00351 {
00352     switch(entry)   {
00353     case  0: return gCvsroot1;  break;
00354     case  1: return gCvsroot2;  break;
00355     case  2: return gCvsroot3;  break;
00356     case  3: return gCvsroot4;  break;
00357     case  4: return gCvsroot5;  break;
00358     case  5: return gCvsroot6;  break;
00359     case  6: return gCvsroot7;  break;
00360     case  7: return gCvsroot8;  break;
00361     case  8: return gCvsroot9;  break;
00362     case  9: return gCvsroot10; break;
00363     case 10: return gCvsroot11; break;
00364     case 11: return gCvsroot12; break;
00365     case 12: return gCvsroot13; break;
00366     case 13: return gCvsroot14; break;
00367     case 14: return gCvsroot15; break;
00368     case 15: return gCvsroot16; break;
00369     case 16: return gCvsroot17; break;
00370     case 17: return gCvsroot18; break;
00371     case 18: return gCvsroot19; break;
00372     case 19: return gCvsroot20; break;
00373     }
00374     return gCvsroot1;
00375 }
00376
00377 bool CvsPrefs::has_cvsroot_in_list(const char* cvsroot, int & entry)
00378 {
00379     for(int i = 0; i < NUM_CVSROOT; i++)
00380     {
00381         CPStr & str = get_cvsroot_list(i);
00382         if(str.empty())
00383             continue;
00384         if(strcmp(str, cvsroot) == 0)
00385         {
00386             entry = i;
00387             return true;
00388         }
00389     }
00390     return false;
00391 }
00392
00393 void CvsPrefs::insert_cvsroot_in_list(const char* cvsroot)
00394 {
00395     int entry;
00396
00397     if(has_cvsroot_in_list(cvsroot, entry))
00398     {
00399         // move to the first entry
00400         CPStr tmp;
00401         tmp = get_cvsroot_list(0);
00402         get_cvsroot_list(0) = get_cvsroot_list(entry);
00403         get_cvsroot_list(entry) = tmp;
00404     }
00405     else
00406     {
00407         // push back the entry
00408         for(int i = (NUM_CVSROOT - 1); i >= 1; i--)
00409         {
00410             get_cvsroot_list(i) = get_cvsroot_list(i - 1);
00411         }
00412         get_cvsroot_list(0) = cvsroot;
00413     }
00414 }
00415
00416 void CvsPrefs::flush_list(void)
00417 {
00418     for(int i = 0; i < NUM_CVSROOT; i++)
00419     {
00420         get_cvsroot_list(i) = "";
00421     }
00422 }
00423
00424 #endif /* MIGRATECVSROOTLIST */
00425
00426
00427 void CvsPrefs::save(void)
00428 {
00429     if(empty())
00430         return;
00431
00432     if( SCHEMA_1 != gPersistentShema )
00433     {
00434         gPersistentShema = SCHEMA_1;
00435     }
00436
00437     bool needSave = CPersistent::NeedSave();
00438     bool needSaveSettings = CPersistent::NeedSave(true);
00439     if(!needSave)
00440         return;
00441
00442 // migration
00443 #ifndef MIGRATECVSROOTLIST
00444     // update the CVSROOT list
00445     insert_cvsroot_in_list((const char*)*this);
00446 #endif
00447
00448     CPersistent::SaveAll();
00449
00450     if(!needSaveSettings)
00451         return;
00452
00453 #ifdef WIN32
00454     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00455     SavePersistentSettings(app->GetBrowserView()->GetRoot());
00456 #endif
00457 #ifdef qMacCvsPP
00458     CMacCvsApp::SavePersistentSettings();
00459 #endif /* qMacCvsPP */
00460 #if qUnix
00461     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00462     if(browser != 0L && browser->GetRoot() != 0L)
00463         SavePersistentSettings(browser->GetRoot());
00464 #endif
00465 }
00466
00467 void CvsPrefs::load(void)
00468 {
00469 // migration
00470 #ifndef MIGRATECVSROOTLIST
00471     // flush the CVSROOT list, it will be filled later
00472     flush_list();
00473 #endif
00474
00475     bool loaded = CPersistent::LoadAll();
00476
00477     if( loaded )
00478     {
00479         if( SCHEMA_0 == gPersistentShema )
00480         {
00481             MigrateCvsrootList();
00482         }
00483
00484         return;
00485     }
00486
00487     // backward compatibility
00488 #ifdef WIN32
00489     UINT value;
00490
00491     CString cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, "CVSROOT");
00492     if(!cstr.IsEmpty())
00493         *this = (const char*)cstr;
00494
00495     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "CheckoutRO", -1)) != -1)
00496         SetCheckoutRO(value ? 1 : 0);
00497     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Z9Option", -1)) != -1)
00498         SetZ9Option(value ? 1 : 0);
00499     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "QuietOption", -1)) != -1)
00500         SetQuietOption(value ? 1 : 0);
00501     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "PruneOption", -1)) != -1)
00502         SetPruneOption(value ? 1 : 0);
00503     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "Authentication", -1)) != -1)
00504         gAuthen.setkind((AuthenKind)value);
00505     if((value = AfxGetApp()->GetProfileInt(PROFILE_NAME, "AddControl", -1)) != -1)
00506         SetAddControl(value ? 1 : 0);
00507
00508     char tmp[20];
00509     for(int i = 0; i < NUM_CVSROOT; i++)
00510     {
00511         sprintf(tmp, "CVSROOTLIST%d", i);
00512         cstr = AfxGetApp()->GetProfileString(PROFILE_NAME, tmp);
00513         if(!cstr.IsEmpty())
00514             gOldCvsroots.Insert((const char*)cstr);
00515     }
00516
00517 #endif /* WIN32 */
00518
00519 #if defined(TARGET_OS_MAC) && !TARGET_API_MAC_CARBON
00520     FSSpec theFolder;
00521     short FRef;
00522     Handle hdl;
00523     OSErr err;
00524     Str255 thePath;
00525
00526     err = MacGetPrefsFolder(theFolder, thePath);
00527     if(err != noErr)
00528         return;
00529
00530     err = HSetVol(NULL, theFolder.vRefNum, theFolder.parID);
00531     FRef = OpenResFile(PCVS);
00532     if(FRef < 0)
00533         return;
00534
00535     hdl = GetResource('CVS ', 128);
00536     if(hdl != NULL)
00537     {
00538         Str255 str;
00539         HLock(hdl);
00540         BlockMove(*hdl, str, (*hdl)[0] + 1);
00541         str[str[0] + 1] = '\0';
00542         *this = (const char*)str + 1;
00543         HUnlock(hdl);
00544     }
00545     hdl = GetResource('CHRO', 128);
00546     if(hdl != NULL)
00547     {
00548         SetCheckoutRO(**hdl);
00549     }
00550     hdl = GetResource('Z9OP', 128);
00551     if(hdl != NULL)
00552     {
00553         SetZ9Option(**hdl);
00554     }
00555     hdl = GetResource('QUIE', 128);
00556     if(hdl != NULL)
00557     {
00558         SetQuietOption(**hdl);
00559     }
00560     hdl = GetResource('POPT', 128);
00561     if(hdl != NULL)
00562     {
00563         SetPruneOption(**hdl);
00564     }
00565     hdl = GetResource('AUTH', 128);
00566     if(hdl != NULL)
00567     {
00568         gAuthen.setkind((AuthenKind)**hdl);
00569     }
00570     hdl = GetResource('ISOC', 128);
00571     if(hdl != NULL)
00572     {
00573         SetIsoConvert((ISO8559)**hdl);
00574     }
00575     hdl = GetResource('ICTO', 128);
00576     if(hdl != NULL)
00577     {
00578         SetICTextOption(**hdl);
00579     }
00580     hdl = GetResource('ACTL', 128);
00581     if(hdl != NULL)
00582     {
00583         SetAddControl(**hdl);
00584     }
00585
00586     for(int i = 0; i < NUM_CVSROOT; i++)
00587     {
00588         hdl = GetResource('CROL', 128 + i);
00589         if(hdl != NULL)
00590         {
00591             HLock(hdl);
00592             get_cvsroot_list(i) = (const char*)*hdl;
00593             HUnlock(hdl);
00594         }
00595     }
00596     CloseResFile (FRef);
00597 #endif /* TARGET_OS_MAC && !TARGET_API_MAC_CARBON */
00598 }
00599
00601 void MigrateCvsrootList()
00602 {
00603     for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00604     {
00605         CStr cvsroot;
00606 #ifdef WIN32
00607         char tmp[20];
00608         sprintf(tmp, "P_Cvsroot%d", nIndex);
00609         BYTE* ppData;
00610         UINT pBytes = 0;
00611
00612         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, tmp, &ppData, &pBytes) )
00613         {
00614             continue;
00615         }
00616
00617         cvsroot = (char*)ppData;
00618         delete ppData;
00619 #endif /* WIN32 */
00620
00621 #if qUnix
00622 #endif // qUnix
00623
00624 #if qMacCvsPP
00625 #endif // qMacCvsPP
00626
00627         if( !cvsroot.empty() )
00628         {
00629             gOldCvsroots.Insert(cvsroot);
00630         }
00631     }
00632 }
00633
00634 #ifdef WIN32
00635 kWinVersion CvsPrefs::WhichVersion()
00636 {
00637     DWORD dwVersion = GetVersion(); // Get major and minor version numbers of Windows
00638     DWORD dwWindowsMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
00639     DWORD dwWindowsMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
00640     DWORD dwBuild;
00641
00642     // Get build numbers for Windows NT or Win32s
00643     if (dwVersion < 0x80000000)                // Windows NT
00644     {
00645         dwBuild = (DWORD)(HIWORD(dwVersion));
00646         return dwWindowsMajorVersion == 3 ? kWinNT35 : kWinNT4;
00647     }
00648     else if (dwWindowsMajorVersion < 4)        // Win16s
00649     {
00650         dwBuild = (DWORD)(HIWORD(dwVersion));
00651         return kWin16;
00652     }
00653
00654     // Windows 95 -- No build numbers provided    dwBuild =  0;
00655     return kWin32;
00656 }
00657 #endif /* WIN32 */
00658
00659
00660 //
00661 // TODO: If we sometimes implement multi-threaded CVS/TCL macro
00662 // execution then we have to implement thread synchronization in
00663 // IsXXXRunning and SetXXXRunning methods.
00664 //
00665 // NOTE! IsCvsRunning and SetCvsRunning methods are not yet
00666 // used in Mac/Unix/WinCVS. Each of these version have had
00667 // their own app.gCvsRunning variable. I haven't cleaned up
00668 // the code and changed them to use this "one and only"
00669 // CvsRunning methods.
00670 //
00671 bool CvsPrefs::IsCvsRunning(void) const
00672 {
00673     return(fCvsRunningCounter > 0);
00674 }
00675
00676 int CvsPrefs::SetCvsRunning(bool launched)
00677 {
00678     if(launched)
00679         fCvsRunningCounter++;
00680     else if(fCvsRunningCounter > 0)
00681         fCvsRunningCounter--;
00682
00683     return fCvsRunningCounter;
00684 }
00685
00686 bool CvsPrefs::IsTclFileRunning(void) const
00687 {
00688     return(fTclFileRunningCounter > 0);
00689 }
00690
00691 int CvsPrefs::SetTclFileRunning(bool launched)
00692 {
00693     if(launched)
00694         fTclFileRunningCounter++;
00695     else if(fTclFileRunningCounter > 0)
00696         fTclFileRunningCounter--;
00697
00698     return fTclFileRunningCounter;
00699 }
00700
00701 bool CvsPrefs::UseAltCvs(void) const {return gUseAltCvs;}
00702 void CvsPrefs::SetUseAltCvs(bool useit) {gUseAltCvs = useit;}
00703
00704 void CvsPrefs::SetWhichCvs(const char* cvsPath)
00705 {
00706     UStr appPath;
00707
00708 #ifdef WIN32
00709     HINSTANCE hInst = ::AfxGetInstanceHandle();
00710     char apath[512];
00711     DWORD len;
00712     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
00713     {
00714         CString tmp(apath);
00715         tmp.MakeLower();
00716         appPath = tmp;
00717     }
00718 #elif qUnix
00719     appPath << EXECLIB << "/" << "cvs";
00720 #elif TARGET_RT_MAC_MACHO
00721     appPath = CMacCvsApp::gApp->GetAppPath();
00722 #endif
00723
00724     if(!appPath.empty()) {
00725         UStr value;
00726         gWhichCvs.Concatenate(value, appPath, cvsPath);
00727         gWhichCvs.Insert(value);
00728     } else {
00729         gWhichCvs.Insert( cvsPath );
00730     }
00731 }
00732
00733 const char* CvsPrefs::WhichCvs(UStr & path, bool userOnly) const
00734 {
00735     path = "";
00736
00737     UStr appPath = "";
00738
00739 #ifdef WIN32
00740     HINSTANCE hInst = ::AfxGetInstanceHandle();
00741     char apath[512];
00742     DWORD len;
00743     if(hInst != 0L && (len = ::GetModuleFileName(hInst, apath, 512)) > 0)
00744     {
00745         CString tmp(apath);
00746         tmp.MakeLower();
00747         appPath = tmp;
00748     }
00749 #elif qUnix
00750     appPath << EXECLIB << "/" << "cvs";
00751 #elif TARGET_RT_MAC_MACHO
00752     appPath = CMacCvsApp::gApp->GetAppPath();
00753 #endif
00754
00755     // search if beside the default cvs, the user defined one to use
00756     // with this application only.
00757     UStr candidate;
00758     if(!appPath.empty())
00759     {
00760         UStr value;
00761         gWhichCvs.Concatenate(value, appPath, "");
00762         TMString<UStr>::list_t::const_iterator i = gWhichCvs.Find(value);
00763         if(i != gWhichCvs.end())
00764         {
00765             UStr key;
00766             gWhichCvs.Split(*i, key, candidate);
00767         }
00768     }
00769
00770     // verify this cvs exe is still there
00771     struct stat sb;
00772     if(!candidate.empty() && stat(candidate, &sb) != -1 && S_ISREG(sb.st_mode))
00773     {
00774         path = candidate;
00775         return path.c_str();
00776     }
00777
00778     // fallback to the default one.
00779     if(userOnly)
00780         return 0L;
00781
00782 #ifdef WIN32
00783     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00784
00785     app->GetAppPath(path);
00786     if(!path.endsWith(kPathDelimiter))
00787         path << kPathDelimiter;
00788     path << (gCvsPrefs.WhichVersion() == kWin32 ? "cvs95.exe" : "cvs.exe");
00789 #elif qUnix
00790     if( path.empty() )
00791         path = EXECLIB;
00792
00793     if(!path.endsWith(kPathDelimiter))
00794         path << kPathDelimiter;
00795
00796     path << "cvs";
00797 #elif TARGET_RT_MAC_MACHO
00798     path = CMacCvsApp::gApp->GetAppResourcesPath();
00799     if(!path.endsWith(kPathDelimiter))
00800         path << kPathDelimiter;
00801     path << "cvsgui";
00802 #endif
00803
00804     return path.c_str();
00805 }
00806
00807
00808
00809
Generated on Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00034 #   include <Files.h>
00035 #endif /* TARGET_OS_MAC */
00036
00037 #if defined(WIN32) || TARGET_OS_MAC
00038 // \todo 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 typedef enum
00079 {
00080     STATUSOUTPUT_STANDARD,
00081     STATUSOUTPUT_QUICK,
00082     STATUSOUTPUT_VERBOSE
00083 } STATUSOUTPUT_TYPE;
00084
00085 #define NUM_CVSROOT 20
00086
00087 #ifdef WIN32
00088     typedef enum
00089     {
00090         kWin16,
00091         kWinNT35,
00092         kWinNT4,
00093         kWin32
00094     } kWinVersion;
00095 #endif /* WIN32 */
00096
00097 class CMString;
00098 extern CMString gOldCvsroots;
00099
00100 void MigrateCvsrootList();
00101     // copy the previous cvsroot list data to the new schema
00102
00103 class CKeyString;
00104
00105 class CvsPrefs
00106 {
00107
00108 public :
00109     inline CvsPrefs() : fHasLoggedIn(false),
00110         fCvsRunningCounter(0), fTclFileRunningCounter(0) {}
00111     inline ~CvsPrefs() {}
00112
00113     // CVSROOT
00114     bool empty(void) const;
00115     int length(void) const;
00116
00117     const char* operator=(const char* newstr);
00118         // set to a new C String (0L is OK)
00119     const unsigned char *operator=(const unsigned char* newstr);
00120         // set to a new P String (0L is OK)
00121
00122     operator const char*() const;
00123         // as a C string
00124     operator const unsigned char*() const;
00125         // as a P string
00126
00127     // misc. options
00128     bool CheckoutRO(void) const;
00129     bool Z9Option(void) const;
00130     bool PruneOption(void) const;
00131     bool QuietOption(void) const;
00132     ISO8559 IsoConvert(void) const;
00133     bool ICTextOption(void) const;
00134     bool AddControl(void) const;
00135     bool UseViewerAlways(void) const;
00136     MACENCODING MacBinEncoding(void) const;
00137     int KserverPort(void) const;
00138     int PserverPort(void) const;
00139     int RhostPort(void) const;
00140     const char* ServerName(void) const;
00141     const char* RshName(void) const;
00142     bool EncryptCommunication(void) const;
00143     const char* Home(void) const;
00144     const char* Viewer(void) const;
00145     const char* ExtDiff(void) const;
00146     const char* Helper(void) const;
00147     const char* Browser(void) const;
00148     bool DirtySupport(void) const;
00149     int LogoutTimeOut(void) const;
00150     bool AlwaysUseCvsroot(void) const;
00151     bool UseProxy(void) const;
00152     const char* ProxyHost(void) const;
00153     int ProxyPort(void) const;
00154     bool UnixLF(void) const;
00155     bool MacLF(void) const;
00156     int ZLevel(void) const;
00157     int CvsVersion(void) const;
00158     bool CvsConsole(void) const;
00159     int WordWrapLogMsg(void) const;
00160     const char* LastWorkingDir(void) const;
00161     bool UseKeyChain(void) const; // on mac
00162     bool HideCommandDlgUpdate(void) const;
00163     bool HideCommandDlgDiff(void) const;
00164     bool HideCommandDlgLog(void) const;
00165     bool HideCommandDlgGraph(void) const;
00166     bool HideCommandDlgAnnotate(void) const;
00167     bool HideCommandDlgStatus(void) const;
00168     bool HideCommandDlgUseShift(void) const;
00169     SHELL_KIND GetUseShell(void) const;
00170     bool DisableSplashScreen(void) const;
00171     STATUSOUTPUT_TYPE StatusOutputType(void) const;
00172     const char* SettingsFolder(void) const;
00173
00174     void SetCheckoutRO(bool newState);
00175     void SetZ9Option(bool newState);
00176     void SetPruneOption(bool newState);
00177     void SetQuietOption(bool newState);
00178     void SetIsoConvert(ISO8559 newState);
00179     void SetICTextOption(bool newState);
00180     void SetAddControl(bool newState);
00181     void SetUseViewerAlways(bool newState);
00182     void SetMacBinEncoding(MACENCODING newState);
00183     void SetKserverPort(int newState);
00184     void SetPserverPort(int newState);
00185     void SetRhostPort(int newState);
00186     void SetServerName(const char* newservername);
00187     void SetRshName(const char* newrshname);
00188     void SetEncryptCommunication(bool newState);
00189     void SetHome(const char* newhome);
00190     void SetViewer(const char* newviewer);
00191     void SetExtDiff(const char* newdiff);
00192     void SetHelper(const char* newhelper);
00193     void SetBrowser(const char* newbrowser);
00194     void SetDirtySupport(bool newState);
00195     void SetLogoutTimeOut(int newTimeout);
00196     void SetAlwaysUseCvsroot(bool newState);
00197     void SetUseProxy(bool useit);
00198     void SetProxyHost(const char* newhost);
00199     void SetProxyPort(int newport);
00200     void SetUnixLF(bool useit);
00201     void SetMacLF(bool useit);
00202     void SetZLevel(int level);
00203     void SetCvsVersion(int version);
00204     void SetCvsConsole(bool console);
00205     void SetWordWrapLogMsg(int wordwrap);
00206     void SetLastWorkingDir(const char* workdir);
00207     void SetHideCommandDlgUpdate(bool newState);
00208     void SetHideCommandDlgDiff(bool newState);
00209     void SetHideCommandDlgLog(bool newState);
00210     void SetHideCommandDlgGraph(bool newState);
00211     void SetHideCommandDlgAnnotate(bool newState);
00212     void SetHideCommandDlgStatus(bool newState);
00213     void SetHideCommandDlgUseShift(bool newState);
00214     void SetUseShell(SHELL_KIND shell);
00215     void SetDisableSplashScreen(bool newState);
00216     void SetStatusOutputType(STATUSOUTPUT_TYPE outputType);
00217     void SetSettingsFolder(const char* settingsFolder);
00218
00219 #ifdef WIN32
00220     kWinVersion WhichVersion();
00221 #endif /* WIN32 */
00222
00223     bool UseAltCvs(void) const;
00224     void SetUseAltCvs(bool useIt);
00225     const char* WhichCvs(UStr & path, bool userOnly = false) const;
00226     void SetWhichCvs(const char* cvsPath);
00227         // full path of the cvs used
00228
00229     // login/logout flag in order to manage auto-logout
00230     inline bool HasLoogedIn(void) const { return fHasLoggedIn; }
00231     inline void SetHasLoogedIn(bool newstate) { fHasLoggedIn = newstate; }
00232
00233     // Usage counter flags for CVS commands and TCL macro files.
00234     // Each SetCvsRunning(TRUE) must have equivalent
00235     // SetCvsRunning(FALSE) call.
00236     bool IsCvsRunning(void) const;
00237     int  SetCvsRunning(bool launched);
00238     bool IsTclFileRunning(void) const;
00239     int  SetTclFileRunning(bool launched);
00240
00241     // save/load preferences
00242     void save(void);
00243     void load(void);
00244
00245 #ifndef MIGRATECVSROOTLIST
00246     // access the CVSROOT list
00247     inline const CPStr & get_cvsroot_list(int entry) const
00248         {return ((CvsPrefs *)this)->get_cvsroot_list(entry);}
00249 #endif
00250
00251 protected :
00252     bool fHasLoggedIn;
00253
00254     int  fCvsRunningCounter;      // Usage counters to CVS commands
00255     int  fTclFileRunningCounter;  // and Tcl macro file executions
00256
00257 #ifndef MIGRATECVSROOTLIST
00258     CPStr & get_cvsroot_list(int entry);
00259
00260     bool has_cvsroot_in_list(const char* cvsroot, int & entry);
00261     void insert_cvsroot_in_list(const char* cvsroot);
00262     void flush_list(void);
00263 #endif
00264
00265 };
00266
00267 extern CvsPrefs gCvsPrefs;
00268
00269 #endif /* CVSPREFS_H */
Generated on Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 # include "UCommandDialogs.h"
00047 #endif /* qMacCvsPP */
00048
00049 #define _DIFF_CPP_
00050
00051 #include "DiffDlg.h"
00052 #include "CvsPrefs.h"
00053 #include "MultiFiles.h"
00054 #include "UpdateDlg.h"
00055 #include "ItemListDlg.h"
00056 #include "CPStr.h"
00057
00058 static CPersistentBool gUseExtDiff("P_DiffUseExtDiff", false);
00059 static CPersistentBool gIgnoreCase("P_IgnoreCase", false);
00060 static CPersistentBool gNoWhiteSpace("P_NoWhiteSpace", false);
00061 static CPersistentBool gNoBlankLines("P_NoBlankLines", false);
00062 static CPersistentBool gUnifiedDiff("P_UnifiedDiff", false);
00063
00064 CMString gDiffOptions(20, "P_DiffOptions");
00065
00066 // Option description format
00067 #define STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT    "[%s]: %s"
00068
00069 // Diff options and descriptions strings
00070 #define STR_DIFFOPT_OPT_A       "-a"
00071 #define STR_DIFFOPT_DESC_A          "Treat all files as text and compare them line-by-line, even if they do not seem to be text"
00072 #define STR_DIFFOPT_OPT_B       "-b"
00073 #define STR_DIFFOPT_DESC_B          "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"
00074 #define STR_DIFFOPT_OPT_BB      "-B"
00075 #define STR_DIFFOPT_DESC_BB         "Ignore changes that just insert or delete blank lines"
00076 #define STR_DIFFOPT_OPT_BINARY  "--binary"
00077 #define STR_DIFFOPT_DESC_BINARY     "Read and write data in binary mode"
00078 #define STR_DIFFOPT_OPT_BRIEF   "--brief"
00079 #define STR_DIFFOPT_DESC_BRIEF      "Report only whether the files differ, not the details of the differences"
00080 #define STR_DIFFOPT_OPT_C       "-c"
00081 #define STR_DIFFOPT_DESC_C          "Use the context output format"
00082 #define STR_DIFFOPT_OPT_CC      "-C lines"
00083 #define STR_DIFFOPT_DESC_CC         "Use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"
00084 #define STR_DIFFOPT_OPT_C_G_F   "--changed-group-format=format"
00085 #define STR_DIFFOPT_DESC_C_G_F      "Use format to output a line group containing differing lines from both files in if-then-else format. See CVS manual for line group formats"
00086 #define STR_DIFFOPT_OPT_D       "-d"
00087 #define STR_DIFFOPT_DESC_D          "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"
00088 #define STR_DIFFOPT_OPT_E       "-e"
00089 #define STR_DIFFOPT_DESC_E          "Make output that is a valid ed script"
00090 #define STR_DIFFOPT_OPT_E_T     "--expand-tabs"
00091 #define STR_DIFFOPT_DESC_E_T        "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"
00092 #define STR_DIFFOPT_OPT_F       "-f"
00093 #define STR_DIFFOPT_DESC_F          "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"
00094 #define STR_DIFFOPT_OPT_FF      "-F regexp"
00095 #define STR_DIFFOPT_DESC_FF         "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"
00096 #define STR_DIFFOPT_OPT_F_E     "--forward-ed"
00097 #define STR_DIFFOPT_DESC_F_E        "Make output that looks vaguely like an ed script but has changes in the order they appear in the file"
00098 #define STR_DIFFOPT_OPT_HH      "-H"
00099 #define STR_DIFFOPT_DESC_HH         "Use heuristics to speed handling of large files that have numerous scattered small changes"
00100 #define STR_DIFFOPT_OPT_H_L     "--horizon-lines=lines"
00101 #define STR_DIFFOPT_DESC_H_L        "Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix"
00102 #define STR_DIFFOPT_OPT_I       "-i"
00103 #define STR_DIFFOPT_DESC_I          "Ignore changes in case; consider upper- and lower-case letters equivalent"
00104 #define STR_DIFFOPT_OPT_II      "-I regexp"
00105 #define STR_DIFFOPT_DESC_II         "Ignore changes that just insert or delete lines that match regexp"
00106 #define STR_DIFFOPT_OPT_IFDEF   "--ifdef=name"
00107 #define STR_DIFFOPT_DESC_IFDEF      "Make merged if-then-else output using name"
00108 #define STR_DIFFOPT_OPT_I_A_S   "--ignore-all-space"
00109 #define STR_DIFFOPT_DESC_I_A_S      "Ignore white space when comparing lines"
00110 #define STR_DIFFOPT_OPT_I_B_L   "--ignore-blank-lines"
00111 #define STR_DIFFOPT_DESC_I_B_L      "Ignore changes that just insert or delete blank lines"
00112 #define STR_DIFFOPT_OPT_I_C     "--ignore-case"
00113 #define STR_DIFFOPT_DESC_I_C        "Ignore changes in case; consider upper- and lower-case to be the same"
00114 #define STR_DIFFOPT_OPT_I_M_L   "--ignore-matching-lines=regexp"
00115 #define STR_DIFFOPT_DESC_I_M_L      "Ignore changes that just insert or delete lines that match regexp"
00116 #define STR_DIFFOPT_OPT_I_S_C   "--ignore-space-change"
00117 #define STR_DIFFOPT_DESC_I_S_C      "Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent"
00118 #define STR_DIFFOPT_OPT_I_T     "--initial-tab"
00119 #define STR_DIFFOPT_DESC_I_T        "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"
00120 #define STR_DIFFOPT_OPT_LL      "-L label"
00121 #define STR_DIFFOPT_DESC_LL         "Use label instead of the file name in the context format and unified format headers"
00122 #define STR_DIFFOPT_OPT_LABEL   "--label=label"
00123 #define STR_DIFFOPT_DESC_LABEL      "Use label instead of the file name in the context format and unified format headers"
00124 #define STR_DIFFOPT_OPT_L_C     "--left-column"
00125 #define STR_DIFFOPT_DESC_L_C        "Print only the left column of two common lines in side by side format"
00126 #define STR_DIFFOPT_OPT_L_F     "--line-format=format"
00127 #define STR_DIFFOPT_DESC_L_F        "Use format to output all input lines in if-then-else format. See CVS manual for line formats"
00128 #define STR_DIFFOPT_OPT_MINIMAL "--minimal"
00129 #define STR_DIFFOPT_DESC_MINIMAL    "Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower)"
00130 #define STR_DIFFOPT_OPT_N       "-n"
00131 #define STR_DIFFOPT_DESC_N          "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"
00132 #define STR_DIFFOPT_OPT_NN      "-N"
00133 #define STR_DIFFOPT_DESC_NN         "In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory"
00134 #define STR_DIFFOPT_OPT_N_G_F   "--new-group-format=format"
00135 #define STR_DIFFOPT_DESC_N_G_F      "Use format to output a group of lines taken from just the second file in if-then-else format. See section A.9.1.1 Line group formats"
00136 #define STR_DIFFOPT_OPT_N_L_F   "--new-line-format=format"
00137 #define STR_DIFFOPT_DESC_N_L_F      "Use format to output a line taken from just the second file in if-then-else format. See CVS manual for line formats"
00138 #define STR_DIFFOPT_OPT_O_G_F   "--old-group-format=format"
00139 #define STR_DIFFOPT_DESC_O_G_F      "Use format to output a group of lines taken from just the first file in if-then-else format. See section A.9.1.1 Line group formats"
00140 #define STR_DIFFOPT_OPT_O_L_F   "--old-line-format=format"
00141 #define STR_DIFFOPT_DESC_O_L_F      "Use format to output a line taken from just the first file in if-then-else format. See CVS manual for line formats"
00142 #define STR_DIFFOPT_OPT_P       "-p"
00143 #define STR_DIFFOPT_DESC_PP         "Show which C function each change is in"
00144 #define STR_DIFFOPT_OPT_RCS     "--rcs"
00145 #define STR_DIFFOPT_DESC_RCS        "Output RCS-format diffs; like `-f' except that each command specifies the number of lines affected"
00146 #define STR_DIFFOPT_OPT_S       "-s"
00147 #define STR_DIFFOPT_DESC_S          "Report when two files are the same"
00148 #define STR_DIFFOPT_OPT_S_C_F   "--show-c-function"
00149 #define STR_DIFFOPT_DESC_S_C_F      "Show which C function each change is in"
00150 #define STR_DIFFOPT_OPT_S_F_L   "--show-function-line=regexp"
00151 #define STR_DIFFOPT_DESC_S_F_L      "In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp"
00152 #define STR_DIFFOPT_OPT_S_B_S   "--side-by-side"
00153 #define STR_DIFFOPT_DESC_S_B_S      "Use the side by side output format"
00154 #define STR_DIFFOPT_OPT_S_L_F   "--speed-large-files"
00155 #define STR_DIFFOPT_DESC_S_L_F      "Use heuristics to speed handling of large files that have numerous scattered small changes"
00156 #define STR_DIFFOPT_OPT_S_C_L   "--suppress-common-lines"
00157 #define STR_DIFFOPT_DESC_S_C_L      "Do not print common lines in side by side format"
00158 #define STR_DIFFOPT_OPT_T       "-t"
00159 #define STR_DIFFOPT_DESC_T          "Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files"
00160 #define STR_DIFFOPT_OPT_TT      "-T"
00161 #define STR_DIFFOPT_DESC_TT         "Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal"
00162 #define STR_DIFFOPT_OPT_TEXT    "--text"
00163 #define STR_DIFFOPT_DESC_TEXT       "Treat all files as text and compare them line-by-line, even if they do not appear to be text"
00164 #define STR_DIFFOPT_OPT_U       "-u"
00165 #define STR_DIFFOPT_DESC_U          "Use the unified output format"
00166 #define STR_DIFFOPT_OPT_U_G_F   "--unchanged-group-format=format"
00167 #define STR_DIFFOPT_DESC_U_G_F      "Use format to output a group of common lines taken from both files in if-then-else format. See section A.9.1.1 Line group formats"
00168 #define STR_DIFFOPT_OPT_U_L_F   "--unchanged-line-format=format"
00169 #define STR_DIFFOPT_DESC_U_L_F      "Use format to output a line common to both files in if-then-else format. See CVS manual for line formats"
00170 #define STR_DIFFOPT_OPT_UU      "-U lines"
00171 #define STR_DIFFOPT_DESC_UU         "Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper operation, patch typically needs at least two lines of context"
00172 #define STR_DIFFOPT_OPT_W       "-w"
00173 #define STR_DIFFOPT_DESC_W          "Ignore white space when comparing lines"
00174 #define STR_DIFFOPT_OPT_WW      "-W columns"
00175 #define STR_DIFFOPT_DESC_WW         "Use an output width of columns in side by side format"
00176 #define STR_DIFFOPT_OPT_Y       "-y"
00177 #define STR_DIFFOPT_DESC_Y          "Use the side by side output format"
00178
00180 typedef struct _sDiffOptionsItem{
00181     const char* option;
00182     const char* description;
00183 }DiffOptionsItem;
00184
00186 static DiffOptionsItem sDiffOptions[] =
00187 {
00188     { STR_DIFFOPT_OPT_A,        STR_DIFFOPT_DESC_A          },
00189     { STR_DIFFOPT_OPT_B,        STR_DIFFOPT_DESC_B          },
00190     { STR_DIFFOPT_OPT_BB,       STR_DIFFOPT_DESC_BB         },
00191     { STR_DIFFOPT_OPT_BINARY,   STR_DIFFOPT_DESC_BINARY     },
00192     { STR_DIFFOPT_OPT_BRIEF,    STR_DIFFOPT_DESC_BRIEF      },
00193     { STR_DIFFOPT_OPT_C,        STR_DIFFOPT_DESC_C          },
00194     { STR_DIFFOPT_OPT_CC,       STR_DIFFOPT_DESC_CC         },
00195     { STR_DIFFOPT_OPT_C_G_F,    STR_DIFFOPT_DESC_C_G_F      },
00196     { STR_DIFFOPT_OPT_D,        STR_DIFFOPT_DESC_D          },
00197     { STR_DIFFOPT_OPT_E,        STR_DIFFOPT_DESC_E          },
00198     { STR_DIFFOPT_OPT_E_T,      STR_DIFFOPT_DESC_E_T        },
00199     { STR_DIFFOPT_OPT_F,        STR_DIFFOPT_DESC_F          },
00200     { STR_DIFFOPT_OPT_FF,       STR_DIFFOPT_DESC_FF         },
00201     { STR_DIFFOPT_OPT_F_E,      STR_DIFFOPT_DESC_F_E        },
00202     { STR_DIFFOPT_OPT_HH,       STR_DIFFOPT_DESC_HH         },
00203     { STR_DIFFOPT_OPT_H_L,      STR_DIFFOPT_DESC_H_L        },
00204     { STR_DIFFOPT_OPT_I,        STR_DIFFOPT_DESC_I          },
00205     { STR_DIFFOPT_OPT_II,       STR_DIFFOPT_DESC_II         },
00206     { STR_DIFFOPT_OPT_IFDEF,    STR_DIFFOPT_DESC_IFDEF      },
00207     { STR_DIFFOPT_OPT_I_A_S,    STR_DIFFOPT_DESC_I_A_S      },
00208     { STR_DIFFOPT_OPT_I_B_L,    STR_DIFFOPT_DESC_I_B_L      },
00209     { STR_DIFFOPT_OPT_I_C,      STR_DIFFOPT_DESC_I_C        },
00210     { STR_DIFFOPT_OPT_I_M_L,    STR_DIFFOPT_DESC_I_M_L      },
00211     { STR_DIFFOPT_OPT_I_S_C,    STR_DIFFOPT_DESC_I_S_C      },
00212     { STR_DIFFOPT_OPT_I_T,      STR_DIFFOPT_DESC_I_T        },
00213     { STR_DIFFOPT_OPT_LL,       STR_DIFFOPT_DESC_LL         },
00214     { STR_DIFFOPT_OPT_LABEL,    STR_DIFFOPT_DESC_LABEL      },
00215     { STR_DIFFOPT_OPT_L_C,      STR_DIFFOPT_DESC_L_C        },
00216     { STR_DIFFOPT_OPT_L_F,      STR_DIFFOPT_DESC_L_F        },
00217     { STR_DIFFOPT_OPT_MINIMAL,  STR_DIFFOPT_DESC_MINIMAL    },
00218     { STR_DIFFOPT_OPT_N,        STR_DIFFOPT_DESC_N          },
00219     { STR_DIFFOPT_OPT_NN,       STR_DIFFOPT_DESC_NN         },
00220     { STR_DIFFOPT_OPT_N_G_F,    STR_DIFFOPT_DESC_N_G_F      },
00221     { STR_DIFFOPT_OPT_N_L_F,    STR_DIFFOPT_DESC_N_L_F      },
00222     { STR_DIFFOPT_OPT_O_G_F,    STR_DIFFOPT_DESC_O_G_F      },
00223     { STR_DIFFOPT_OPT_O_L_F,    STR_DIFFOPT_DESC_O_L_F      },
00224     { STR_DIFFOPT_OPT_P,        STR_DIFFOPT_DESC_PP         },
00225     { STR_DIFFOPT_OPT_RCS,      STR_DIFFOPT_DESC_RCS        },
00226     { STR_DIFFOPT_OPT_S,        STR_DIFFOPT_DESC_S          },
00227     { STR_DIFFOPT_OPT_S_C_F,    STR_DIFFOPT_DESC_S_C_F      },
00228     { STR_DIFFOPT_OPT_S_F_L,    STR_DIFFOPT_DESC_S_F_L      },
00229     { STR_DIFFOPT_OPT_S_B_S,    STR_DIFFOPT_DESC_S_B_S      },
00230     { STR_DIFFOPT_OPT_S_L_F,    STR_DIFFOPT_DESC_S_L_F      },
00231     { STR_DIFFOPT_OPT_S_C_L,    STR_DIFFOPT_DESC_S_C_L      },
00232     { STR_DIFFOPT_OPT_T,        STR_DIFFOPT_DESC_T          },
00233     { STR_DIFFOPT_OPT_TT,       STR_DIFFOPT_DESC_TT         },
00234     { STR_DIFFOPT_OPT_TEXT,     STR_DIFFOPT_DESC_TEXT       },
00235     { STR_DIFFOPT_OPT_U,        STR_DIFFOPT_DESC_U          },
00236     { STR_DIFFOPT_OPT_U_G_F,    STR_DIFFOPT_DESC_U_G_F      },
00237     { STR_DIFFOPT_OPT_U_L_F,    STR_DIFFOPT_DESC_U_L_F      },
00238     { STR_DIFFOPT_OPT_UU,       STR_DIFFOPT_DESC_UU         },
00239     { STR_DIFFOPT_OPT_W,        STR_DIFFOPT_DESC_W          },
00240     { STR_DIFFOPT_OPT_WW,       STR_DIFFOPT_DESC_WW         },
00241     { STR_DIFFOPT_OPT_Y,        STR_DIFFOPT_DESC_Y          },
00242 };
00243
00244 //{ Win32 - Part
00245 #ifdef WIN32
00246 #include "GetPrefs.h"
00247
00248 #ifdef _DEBUG
00249 #define new DEBUG_NEW
00250 #undef THIS_FILE
00251 static char THIS_FILE[] = __FILE__;
00252 #endif
00253
00254 IMPLEMENT_DYNAMIC(CDiff_MAIN, CPropertyPage)
00255
00256 CDiff_MAIN::CDiff_MAIN(const MultiFiles* mf, kDiffCmdType diffType,
00257                        const char* rev1, const char* rev2,
00258                        bool allowExtDiff, bool useExtDiff,
00259                        bool unifiedDiff, bool noWhiteSpace, bool ignoreCase,
00260                        const char* keyword, const char* diffOptions)
00261                        : m_mf(mf), m_diffType(diffType), m_compareTypeCombo(USmartCombo::AutoDropWidth), m_allowExtDiff(allowExtDiff),
00262                        CPropertyPage(CDiff_MAIN::IDD)
00263 {
00264     //{{AFX_DATA_INIT(CDiff_MAIN)
00265     m_isDate1 = FALSE;
00266     m_isDate2 = FALSE;
00267     m_rev1 = rev1;
00268     m_rev2 = rev2;
00269     m_noWhiteSpace = noWhiteSpace;
00270     m_ignoreCase = ignoreCase;
00271     m_compareType = kCompareSameRev;
00272     m_unifiedDiff = unifiedDiff;
00273     m_keyword = keyword;
00274     m_noRecurs = FALSE;
00275     m_extDiff = useExtDiff;
00276     m_diffOptions = diffOptions;
00277     //}}AFX_DATA_INIT
00278
00279     if( kDiffGraph != m_diffType )
00280     {
00281         m_rev1Combo.SetItems(m_isDate1 ? &gDateNames : &gRevNames);
00282         m_rev2Combo.SetItems(m_isDate2 ? &gDateNames : &gRevNames);
00283     }
00284     else
00285     {
00286         m_compareType = m_mf->TotalNumFiles() == 1 ? kCompareAnotherRev : kCompareTwoRev;
00287
00288         m_rev1Combo.SetFeature(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly);
00289         m_rev2Combo.SetFeature(USmartCombo::AutoDropWidth | USmartCombo::ReadOnly);
00290
00291         if( m_mf && m_mf->TotalNumFiles() )
00292         {
00293             MultiFiles::const_iterator mfi;
00294             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00295             {
00296                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00297                 {
00298                     UStr path;
00299                     UStr fileName;
00300                     UStr currRev;
00301
00302                     mfi->get(nIndex, path, fileName, currRev);
00303
00304                     switch( nIndex )
00305                     {
00306                     case 0:
00307                         m_rev1 = currRev.c_str();
00308                         break;
00309                     case 1:
00310                         m_rev2 = currRev.c_str();
00311                         break;
00312                     default:
00313                         ASSERT(FALSE);  // there should be no more than 2 files in the selection
00314                         break;
00315                     }
00316                 }
00317             }
00318         }
00319     }
00320
00321     m_diffOptionsCombo.SetItems(&gDiffOptions);
00322 }
00323
00324 CDiff_MAIN::~CDiff_MAIN()
00325 {
00326 }
00327
00328 void CDiff_MAIN::DoDataExchange(CDataExchange* pDX)
00329 {
00330     CPropertyPage::DoDataExchange(pDX);
00331     //{{AFX_DATA_MAP(CDiff_MAIN)
00332     DDX_Control(pDX, IDC_DIFFOPTIONS, m_diffOptionsCombo);
00333     DDX_Control(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpaceCheck);
00334     DDX_Control(pDX, IDC_IGNORECASE, m_ignoreCaseCheck);
00335     DDX_Control(pDX, IDC_EXTDIFF, m_extDiffButton);
00336     DDX_Control(pDX, IDC_OPTIONSMENU, m_optionsMenuButton);
00337     DDX_Control(pDX, IDC_NORECURS, m_noRecursCheck);
00338     DDX_Control(pDX, IDC_UNIFIEDDIFF, m_unifiedDiffCheck);
00339     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00340     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00341     DDX_Control(pDX, IDC_BROWSE_TAG2, m_browseTag2Button);
00342     DDX_Control(pDX, IDC_BROWSE_TAG1, m_browseTag1Button);
00343     DDX_Control(pDX, IDC_ISDATE2, m_isDate2Check);
00344     DDX_Control(pDX, IDC_ISDATE1, m_isDate1Check);
00345     DDX_Control(pDX, IDC_COMPARE_TYPE, m_compareTypeCombo);
00346     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00347     DDX_Control(pDX, IDC_COMBOREV1, m_rev1Combo);
00348     DDX_Check(pDX, IDC_ISDATE1, m_isDate1);
00349     DDX_Check(pDX, IDC_ISDATE2, m_isDate2);
00350     DDX_CBString(pDX, IDC_COMBOREV1, m_rev1);
00351     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00352     DDX_Check(pDX, IDC_IGNOREWHITESPACE, m_noWhiteSpace);
00353     DDX_Check(pDX, IDC_IGNORECASE, m_ignoreCase);
00354     DDX_CBIndex(pDX, IDC_COMPARE_TYPE, m_compareType);
00355     DDX_Check(pDX, IDC_UNIFIEDDIFF, m_unifiedDiff);
00356     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00357     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00358     DDX_Check(pDX, IDC_EXTDIFF, m_extDiff);
00359     DDX_CBString(pDX, IDC_DIFFOPTIONS, m_diffOptions);
00360     //}}AFX_DATA_MAP
00361
00362     if( kDiffGraph != m_diffType )
00363     {
00364         if( kCompareAnotherRev == m_compareType || kCompareTwoRev == m_compareType )
00365         {
00366             DDV_MinChars(pDX, m_rev1, 1);
00367         }
00368
00369         if( kCompareTwoRev == m_compareType )
00370         {
00371             DDV_MinChars(pDX, m_rev2, 1);
00372         }
00373
00374         if( !pDX->m_bSaveAndValidate )
00375         {
00376             EnableCompareType(m_compareType);
00377         }
00378
00379         DDX_ComboMString(pDX, IDC_COMBOREV1, m_rev1Combo);
00380         DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00381
00382         DDX_ComboMString(pDX, IDC_DIFFOPTIONS, m_diffOptionsCombo);
00383     }
00384
00385     m_extDiffButton.EnableWindow(m_allowExtDiff ? true : false);
00386
00387     OnExtdiff();
00388 }
00389
00390 BEGIN_MESSAGE_MAP(CDiff_MAIN, CPropertyPage)
00391     //{{AFX_MSG_MAP(CDiff_MAIN)
00392     ON_BN_CLICKED(IDC_EXTDIFF, OnExtdiff)
00393     ON_BN_CLICKED(IDC_ISDATE1, OnCheck1)
00394     ON_BN_CLICKED(IDC_ISDATE2, OnCheck2)
00395     ON_BN_CLICKED(IDC_BROWSE_TAG1, OnBrowseTag1)
00396     ON_BN_CLICKED(IDC_BROWSE_TAG2, OnBrowseTag2)
00397     ON_CBN_SELCHANGE(IDC_COMPARE_TYPE, OnSelchangeCompareType)
00398     ON_BN_CLICKED(IDC_OPTIONSMENU, OnOptionsmenu)
00399     //}}AFX_MSG_MAP
00400 END_MESSAGE_MAP()
00401
00402
00403 // CDiff_MAIN message handlers
00404
00405
00406 void CDiff_MAIN::OnExtdiff()
00407 {
00408     EnableCmdLineDiffOptions(!m_extDiffButton.GetCheck() || !m_extDiffButton.IsWindowEnabled());
00409 }
00410
00415 void CDiff_MAIN::EnableCmdLineDiffOptions(bool enable)
00416 {
00417     m_unifiedDiffCheck.EnableWindow(enable);
00418     m_ignoreCaseCheck.EnableWindow(enable);
00419     m_noWhiteSpaceCheck.EnableWindow(enable);
00420     m_noRecursCheck.EnableWindow(enable);
00421     m_keywordCombo.EnableWindow(enable);
00422     m_keywordDescStatic.EnableWindow(enable);
00423     m_diffOptionsCombo.EnableWindow(enable);
00424     m_optionsMenuButton.EnableWindow(enable);
00425 }
00426
00428 void CDiff_MAIN::OnCheck1()
00429 {
00430     BOOL isDate = m_isDate1Check.GetCheck();
00431
00432     m_rev1Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00433     DDX_ComboMString(NULL, IDC_COMBOREV1, m_rev1Combo);
00434
00435     m_browseTag1Button.EnableWindow(!isDate);
00436 }
00437
00439 void CDiff_MAIN::OnCheck2()
00440 {
00441     BOOL isDate = m_isDate2Check.GetCheck();
00442
00443     m_rev2Combo.SetItems(isDate ? &gDateNames : &gRevNames);
00444     DDX_ComboMString(NULL, IDC_COMBOREV2, m_rev2Combo);
00445
00446     m_browseTag2Button.EnableWindow(!isDate);
00447 }
00448
00450 void CDiff_MAIN::OnBrowseTag1()
00451 {
00452     CStr tagName;
00453     if( CompatGetTagListItem(m_mf, tagName) )
00454     {
00455         m_rev1 = (const char*)tagName;
00456         m_rev1Combo.SetWindowText(m_rev1);
00457     }
00458 }
00459
00461 void CDiff_MAIN::OnBrowseTag2()
00462 {
00463     CStr tagName;
00464     if( CompatGetTagListItem(m_mf, tagName) )
00465     {
00466         m_rev2 = (const char*)tagName;
00467         m_rev2Combo.SetWindowText(m_rev2);
00468     }
00469 }
00470
00472 void CDiff_MAIN::OnSelchangeCompareType()
00473 {
00474     EnableCompareType(m_compareTypeCombo.GetCurSel());
00475 }
00476
00481 void CDiff_MAIN::EnableCompareType(int compareType)
00482 {
00483     bool hasRev1 = false;
00484     bool hasRev2 = false;
00485
00486     switch( compareType )
00487     {
00488     default:
00489         ASSERT(FALSE);  //unknown compare type
00490     case kCompareSameRev:
00491         hasRev1 = hasRev2 = false;
00492         break;
00493     case kCompareAnotherRev:
00494         hasRev1 = true;
00495         hasRev2 = false;
00496         break;
00497     case kCompareTwoRev:
00498         hasRev1 = true;
00499         hasRev2 = true;
00500         break;
00501     }
00502
00503     m_rev1Combo.EnableWindow(hasRev1);
00504     m_isDate1Check.EnableWindow(hasRev1);
00505     m_browseTag1Button.EnableWindow(hasRev1);
00506
00507     m_rev2Combo.EnableWindow(hasRev2);
00508     m_isDate2Check.EnableWindow(hasRev2);
00509     m_browseTag2Button.EnableWindow(hasRev2);
00510 }
00511
00513 BOOL CDiff_MAIN::OnInitDialog()
00514 {
00515     CPropertyPage::OnInitDialog();
00516
00517     // Extra initialization
00518     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00519
00520     // Special setup for the diff invoked using the graph view
00521     if( kDiffGraph == m_diffType )
00522     {
00523         m_compareTypeCombo.SetCurSel(m_mf->TotalNumFiles() == 1 ? kCompareAnotherRev : kCompareTwoRev);
00524         m_compareTypeCombo.EnableWindow(FALSE);
00525
00526         m_browseTag1Button.EnableWindow(FALSE);
00527         m_browseTag2Button.EnableWindow(FALSE);
00528
00529         m_isDate1Check.EnableWindow(FALSE);
00530         m_isDate2Check.EnableWindow(FALSE);
00531
00532         m_rev1Combo.SetReadOnly(TRUE);
00533         m_rev1Combo.ResetContent();
00534
00535         if( !m_rev1.IsEmpty() )
00536         {
00537             m_rev1Combo.AddString(m_rev1);
00538             m_rev1Combo.SetWindowText(m_rev1);
00539         }
00540
00541         if( m_mf && m_mf->TotalNumFiles() == 2 )
00542         {
00543             m_rev2Combo.SetReadOnly(TRUE);
00544             m_rev2Combo.ResetContent();
00545
00546             if( !m_rev2.IsEmpty() )
00547             {
00548                 m_rev2Combo.AddString(m_rev2);
00549                 m_rev2Combo.SetWindowText(m_rev2);
00550             }
00551         }
00552         else
00553         {
00554             m_rev2Combo.EnableWindow(FALSE);
00555         }
00556     }
00557
00558     return TRUE;  // return TRUE unless you set the focus to a control
00559                   // EXCEPTION: OCX Property Pages should return FALSE
00560 }
00561
00563 void CDiff_MAIN::OnOptionsmenu()
00564 {
00565     CDiff_Options diffOptionsDlg;
00566
00567     CString currentOptions;
00568     m_diffOptionsCombo.GetWindowText(currentOptions);
00569     diffOptionsDlg.m_currentOptions = currentOptions;
00570
00571     if( diffOptionsDlg.DoModal() == IDOK )
00572     {
00573         CString diffOptions = diffOptionsDlg.GetDiffOptions();
00574         if( !diffOptions.IsEmpty() )
00575         {
00576             currentOptions.TrimRight();
00577             currentOptions += currentOptions.IsEmpty() ? "" : " ";
00578             m_diffOptionsCombo.SetWindowText(currentOptions + diffOptions);
00579             GotoDlgCtrl(&m_diffOptionsCombo);
00580         }
00581     }
00582 }
00583
00584
00586 // CDiff_Options dialog
00587
00588 CDiff_Options::CDiff_Options(CWnd* pParent /*=NULL*/)
00589     : CDialog(CDiff_Options::IDD, pParent)
00590 {
00591     //{{AFX_DATA_INIT(CDiff_Options)
00592     m_currentOptions = _T("");
00593     //}}AFX_DATA_INIT
00594
00595     m_sortAsc = false;
00596     m_sortColumn = 0;
00597 }
00598
00599
00600 void CDiff_Options::DoDataExchange(CDataExchange* pDX)
00601 {
00602     CDialog::DoDataExchange(pDX);
00603     //{{AFX_DATA_MAP(CDiff_Options)
00604     DDX_Control(pDX, IDC_OPTIONSLIST, m_optionsListCtrl);
00605     DDX_Text(pDX, IDC_CURRENT_OPTIONS, m_currentOptions);
00606     //}}AFX_DATA_MAP
00607 }
00608
00609
00610 BEGIN_MESSAGE_MAP(CDiff_Options, CDialog)
00611     //{{AFX_MSG_MAP(CDiff_Options)
00612     ON_NOTIFY(LVN_ITEMCHANGED, IDC_OPTIONSLIST, OnItemchangedOptionslist)
00613     ON_NOTIFY(LVN_COLUMNCLICK, IDC_OPTIONSLIST, OnColumnclickOptionslist)
00614     //}}AFX_MSG_MAP
00615 END_MESSAGE_MAP()
00616
00617
00618 // CDiff_Options message handlers
00619
00620
00624 CString CDiff_Options::GetDiffOptions()
00625 {
00626     return m_diffOptions;
00627 }
00628
00630 void CDiff_Options::OnOK()
00631 {
00632     for(int nIndex = 0; nIndex < m_optionsListCtrl.GetItemCount(); nIndex++)
00633     {
00634         if( m_optionsListCtrl.GetCheck(nIndex) )
00635         {
00636             m_diffOptions += m_optionsListCtrl.GetItemText(nIndex, 0);
00637             m_diffOptions += " ";
00638         }
00639     }
00640
00641     m_diffOptions.TrimRight();
00642
00643     CDialog::OnOK();
00644 }
00645
00647 void CDiff_Options::OnItemchangedOptionslist(NMHDR* pNMHDR, LRESULT* pResult)
00648 {
00649     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00650     if( pNMListView->iItem > -1 &&
00651         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
00652     {
00653         CString item;
00654         item.Format(STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT,
00655             m_optionsListCtrl.GetItemText(pNMListView->iItem, 0),
00656             m_optionsListCtrl.GetItemText(pNMListView->iItem, 1));
00657
00658         SetDlgItemText(IDC_OPTIONDETAILS, item);
00659     }
00660
00661     *pResult = 0;
00662 }
00663
00665 void CDiff_Options::OnColumnclickOptionslist(NMHDR* pNMHDR, LRESULT* pResult)
00666 {
00667     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00668
00669     if( m_sortColumn != pNMListView->iSubItem )
00670     {
00671         m_sortAsc = false;
00672     }
00673     else
00674     {
00675         m_sortAsc = !m_sortAsc;
00676     }
00677
00678     m_sortColumn = pNMListView->iSubItem;
00679
00680     SortItems(m_sortColumn, m_sortAsc);
00681
00682     *pResult = 0;
00683 }
00684
00686 BOOL CDiff_Options::OnInitDialog()
00687 {
00688     CDialog::OnInitDialog();
00689
00690     // Set the control's style
00691     {
00692         DWORD dwExtendedStyle = m_optionsListCtrl.GetExtendedStyle();
00693         dwExtendedStyle |= LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
00694         m_optionsListCtrl.SetExtendedStyle(dwExtendedStyle);
00695     }
00696
00697     // Setup controls
00698     CHeaderCtrl* headerCtrl = m_optionsListCtrl.GetHeaderCtrl();
00699     if( headerCtrl )
00700     {
00701         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00702     }
00703
00704     // Get the client area width to properly size columns
00705     CRect rect;
00706     m_optionsListCtrl.GetClientRect(rect);
00707
00708     const int listCtrlWidth = rect.Width();
00709     const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
00710
00711     // Insert columns
00712     m_optionsListCtrl.InsertColumn(0, "Option", LVCFMT_LEFT, 65);
00713     m_optionsListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, listCtrlWidthNoScroll - 65);
00714
00715     // Insert options
00716     const int itemsCount = (sizeof(sDiffOptions) / sizeof(DiffOptionsItem));
00717     for(int nIndex = 0; nIndex < itemsCount; nIndex++)
00718     {
00719         const int item = m_optionsListCtrl.InsertItem(m_optionsListCtrl.GetItemCount(), sDiffOptions[nIndex].option);
00720         if( item > -1 )
00721         {
00722             m_optionsListCtrl.SetItemText(item, 1, sDiffOptions[nIndex].description);
00723             m_optionsListCtrl.SetItemData(item, (DWORD)&sDiffOptions[nIndex]);
00724         }
00725     }
00726
00727     return TRUE;  // return TRUE unless you set the focus to a control
00728                   // EXCEPTION: OCX Property Pages should return FALSE
00729 }
00730
00737 void CDiff_Options::SortItems(int column, bool asc)
00738 {
00739     m_headerCtrl.SetSortImage(column, asc);
00740
00741     CompareInfo info = { 0 };
00742
00743     info.m_column = column;
00744     info.m_asc = asc;
00745
00746     m_optionsListCtrl.SortItems(CompareItems, (DWORD)&info);
00747 }
00748
00756 int CALLBACK CDiff_Options::CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam)
00757 {
00758     int res = 0;
00759
00760     const CompareInfo* info = (CompareInfo*)lParam;
00761     if( info )
00762     {
00763         DiffOptionsItem* diffOptionsItem1 = (DiffOptionsItem*)itemData1;
00764         DiffOptionsItem* diffOptionsItem2 = (DiffOptionsItem*)itemData2;
00765
00766         switch( info->m_column )
00767         {
00768         case 0:
00769             res = stricmp(diffOptionsItem1->option, diffOptionsItem2->option);
00770             break;
00771         case 1:
00772             res = stricmp(diffOptionsItem1->description, diffOptionsItem2->description);
00773             break;
00774         default:
00775             ASSERT(FALSE); // should not come here
00776             break;
00777         }
00778     }
00779
00780     if( res )
00781     {
00782         if( info->m_asc )
00783         {
00784             res *= -1;
00785         }
00786     }
00787
00788     return res;
00789 }
00790
00791 #endif /* WIN32 */
00792 //} Win32 - Part
00793
00794 //{ Mac - Part
00795 #ifdef qMacCvsPP
00796 static void DoDataExchange_DiffMain(LWindow *theDialog, const MultiFiles* mf, bool & noRecurs, bool & isDate1, bool & isDate2,
00797     CPStr & sLastRev1, CPStr & sLastRev2, bool & hasRev1, bool & hasRev2, bool putValue)
00798 {
00799     LRadioButton *chkHasRev = dynamic_cast<LRadioButton*>
00800         (theDialog->FindPaneByID(item_CheckRevTag1));
00801     LEditText *editRev = dynamic_cast<LEditText*>
00802         (theDialog->FindPaneByID(item_EditRevTag1));
00803     LRadioButton *chkHasRev2 = dynamic_cast<LRadioButton*>
00804         (theDialog->FindPaneByID(item_CheckRevTag2));
00805     LEditText *editRev2 = dynamic_cast<LEditText*>
00806         (theDialog->FindPaneByID(item_EditRevTag2));
00807     LCheckBox *chkHasDate1 = dynamic_cast<LCheckBox*>
00808         (theDialog->FindPaneByID(item_CheckDate1));
00809     LCheckBox *chkHasDate2 = dynamic_cast<LCheckBox*>
00810         (theDialog->FindPaneByID(item_CheckDate2));
00811     LPopupFiller *fill1 = dynamic_cast<LPopupFiller*>
00812         (theDialog->FindPaneByID(item_FillerRev1));
00813     LPopupFiller *fill2 = dynamic_cast<LPopupFiller*>
00814         (theDialog->FindPaneByID(item_FillerRev2));
00815     LPane *extDiff = theDialog->FindPaneByID(item_DiffExternal);
00816
00817     if(putValue)
00818     {
00819         chkHasDate1->SetValue(isDate1 ? Button_On : Button_Off);
00820         chkHasDate2->SetValue(isDate2 ? Button_On : Button_Off);
00821         if(hasRev1 && hasRev2)
00822             theDialog->SetValueForPaneID (item_CheckRevTag2, Button_On);
00823         else if(hasRev1)
00824             theDialog->SetValueForPaneID (item_CheckRevTag1, Button_On);
00825         else
00826             theDialog->SetValueForPaneID (item_MergeNone, Button_On);
00827
00828         editRev->SetText((Ptr)(const char *)sLastRev1, sLastRev1.length());
00829         editRev2->SetText((Ptr)(const char *)sLastRev2, sLastRev2.length());
00830
00831         LTagWrapper *wrapper1 = putValue ? NEW LTagWrapper(fill1, mf) : 0L;
00832         fill1->DoDataExchange(gRevNames, putValue, wrapper1);
00833         LTagWrapper *wrapper2 = putValue ? NEW LTagWrapper(fill2, mf) : 0L;
00834         fill2->DoDataExchange(gRevNames, putValue, wrapper2);
00835
00836         extDiff->SetValue ((bool)gUseExtDiff ? Button_On : Button_Off);
00837     }
00838     else
00839     {
00840         isDate1 = chkHasDate1->GetValue() == Button_On;
00841         isDate2 = chkHasDate2->GetValue() == Button_On;
00842
00843         if(theDialog->GetValueForPaneID (item_CheckRevTag2) == Button_On)
00844         {
00845             hasRev1 = hasRev2 = true;
00846         }
00847         else if (theDialog->GetValueForPaneID (item_CheckRevTag1) == Button_On)
00848         {
00849             hasRev1 = true;
00850             hasRev2 = false;
00851         }
00852         else
00853         {
00854             hasRev1 = hasRev2 = false;
00855         }
00856
00857         fill1->DoDataExchange(isDate1 ? gDateNames : gRevNames, putValue);
00858         fill2->DoDataExchange(isDate2 ? gDateNames : gRevNames, putValue);
00859
00860         char str[255];
00861         Size len;
00862
00863         editRev->GetText(str, 254, &len);
00864         sLastRev1.set(str, len);
00865         editRev2->GetText(str, 254, &len);
00866         sLastRev2.set(str, len);
00867
00868         gUseExtDiff = extDiff->GetValue () == Button_On;
00869     }
00870 }
00871 #endif /* qMacCvsPP */
00872 //}
00873 //{ Unix - Part
00874 #ifdef qUnix
00875 int UCvsDiff::OnOK(void)
00876 {
00877     EndModal(true);
00878     return 0;
00879 }
00880
00881 int UCvsDiff::OnCancel(void)
00882 {
00883     EndModal(false);
00884     return 0;
00885 }
00886
00887 void UCvsDiff::DoDataExchange(bool fill)
00888 {
00889     if(fill)
00890     {
00891     }
00892     else
00893     {
00894     }
00895 }
00896
00897 UCvsDiff_MAIN::UCvsDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff, bool unifiedDiff,
00898                              bool noWhiteSpace, bool noBlankLines, bool ignoreCase) : UWidget(::UEventGetWidID())
00899 {
00900     m_check1 = false;
00901     m_check2 = false;
00902     m_rev1 = rev1;
00903     m_rev2 = rev2;
00904     m_diff = 0;
00905     m_noWhiteSpace = gNoWhiteSpace;
00906     m_noBlankLines = noBlankLines;
00907     m_ignoreCase = gIgnoreCase;
00908     m_norecurs = false;
00909     m_extdiff = gUseExtDiff;
00910     m_unifiedDiff = unifiedDiff;
00911     m_allowExtDiff = allowExtDiff;
00912
00913 }
00914
00915 int UCvsDiff_MAIN::OnDiff(int cmd)
00916 {
00917     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff1, 0L);
00918     if(state)
00919     {
00920         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate1, 0), 0L);
00921         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 0), 0L);
00922         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate2, 0), 0L);
00923         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, 0), 0L);
00924     }
00925     else
00926     {
00927         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate1, 1), 0L);
00928         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 1), 0L);
00929         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff2, 0L);
00930         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckDate2, state == 0), 0L);
00931         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, state == 0), 0L);
00932     }
00933     return 0;
00934 }
00935
00936 void UCvsDiff_MAIN::DoDataExchange(bool fill)
00937 {
00938     ::DoDataExchange(fill, GetWidID(), kComboRev1, gDateOrRevNames);
00939     ::DoDataExchange(fill, GetWidID(), kComboRev2, gDateOrRevNames);
00940
00941     if(fill)
00942     {
00943         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCheckExtDiff, m_allowExtDiff), 0L);
00944
00945         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate1, m_check1), 0L);
00946         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate2, m_check2), 0L);
00947         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00948         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckExtDiff, m_extdiff), 0L);
00949         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUnifiedDiff, m_unifiedDiff), 0L);
00950         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDiff1 + m_diff, 1), 0L);
00951         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckNoWhiteSpace, m_noWhiteSpace), 0L);
00952         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckNoBlankLines, m_noBlankLines), 0L);
00953         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckIgnoreCase,   m_ignoreCase), 0L);
00954
00955         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev1, (void *)(const char *)m_rev1);
00956         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev2, (void *)(const char *)m_rev2);
00957
00958         OnDiff(kCheckDiff1 + m_diff);
00959     }
00960     else
00961     {
00962         m_check1       = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate1, 0L);
00963         m_check2       = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate2, 0L);
00964         m_norecurs     = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00965         m_extdiff      = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckExtDiff, 0L);
00966         m_unifiedDiff  = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUnifiedDiff, 0L);
00967         m_noWhiteSpace = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckNoWhiteSpace, 0L);
00968         m_noBlankLines = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckNoBlankLines, 0L);
00969         m_ignoreCase   = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckIgnoreCase, 0L);
00970
00971         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff1, 0L))
00972             m_diff = 0;
00973         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDiff2, 0L))
00974             m_diff = 1;
00975         else
00976             m_diff = 2;
00977
00978         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev1, &m_rev1);
00979         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev2, &m_rev2);
00980     }
00981 }
00982 #endif // qUnix
00983 //} Unix - Part
00984
00986 bool CompatGetDiff(const MultiFiles* mf, kDiffCmdType diffType,
00987                    bool& noRecurs, bool& isDate1, bool& isDate2,
00988                    CPStr& rev1, CPStr& rev2, bool& useExtDiff,
00989                    bool& unifiedDiff, bool& noWhiteSpace, bool& noBlankLines, bool& ignoreCase,
00990                    CPStr& keyword, CPStr& diffOptions,
00991                    bool allowExtDiff /*= false*/)
00992 {
00993     bool userHitOK = false;
00994
00995     static CPStr sLastRev1;
00996     static CPStr sLastRev2;
00997     static CPStr sLastKeyword;
00998     static CPStr sLastDiffOptions;
00999
01000     bool hasRev1;
01001     bool hasRev2;
01002   CPStr initialRev1, initialRev2;
01003
01004   // Graph view diff supplies initial revisions, so don't override them
01005     if ( diffType == kDiffGraph )
01006     {
01007       initialRev1 = rev1;
01008       initialRev2 = rev2;
01009       hasRev1 = !rev1.empty();
01010       hasRev2 = !rev2.empty();
01011     }
01012     else
01013     {
01014     rev1 = "";
01015     rev2 = "";
01016       hasRev1 = false;
01017       hasRev2 = false;
01018       initialRev1 = sLastRev1;
01019       initialRev2 = sLastRev2;
01020   }
01021     noRecurs = false;
01022     isDate1 = false;
01023     isDate2 = false;
01024     useExtDiff = (bool)gUseExtDiff;
01025     noWhiteSpace = (bool)gNoWhiteSpace;
01026     noBlankLines = (bool)gNoBlankLines;
01027     ignoreCase = (bool)gIgnoreCase;
01028     unifiedDiff = (bool)gUnifiedDiff;
01029
01030
01031 //{ Win32 - Part
01032 #ifdef WIN32
01033     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgDiff(), "Diff settings");
01034     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01035
01036     CDiff_MAIN page1(mf, diffType, initialRev1, initialRev2, allowExtDiff, useExtDiff, unifiedDiff, noWhiteSpace, ignoreCase, sLastKeyword, sLastDiffOptions);
01037     CGetPrefs_GLOBALS page2;
01038
01039     pages.AddPage(&page1);
01040     pages.AddPage(&page2);
01041
01042     if( pages.DoModal() == IDOK )
01043     {
01044         noRecurs = page1.m_noRecurs ? true : false;
01045
01046         sLastRev1 = page1.m_rev1;
01047         sLastRev2 = page1.m_rev2;
01048         isDate1 = page1.m_isDate1 ? true : false;
01049         isDate2 = page1.m_isDate2 ? true : false;
01050
01051         gUseExtDiff = page1.m_extDiff ? true : false;
01052
01053         switch( page1.m_compareType )
01054         {
01055         default:
01056             ASSERT(FALSE);  //unknown compare type
01057         case kCompareSameRev:
01058             hasRev1 = hasRev2 = false;
01059             break;
01060         case kCompareAnotherRev:
01061             hasRev1 = true;
01062             hasRev2 = false;
01063             break;
01064         case kCompareTwoRev:
01065             hasRev1 = true;
01066             hasRev2 = true;
01067             break;
01068         }
01069
01070         gUnifiedDiff = page1.m_unifiedDiff ? true : false;
01071         gNoWhiteSpace = page1.m_noWhiteSpace ? true : false;
01072         gIgnoreCase = page1.m_ignoreCase ? true : false;
01073
01074         sLastKeyword = page1.m_keyword;
01075         sLastDiffOptions = page1.m_diffOptions;
01076
01077         page2.StoreValues();
01078         gCvsPrefs.SetHideCommandDlgDiff(pages.GetHideCommandDlg());
01079         userHitOK = true;
01080     }
01081 #endif /* WIN32 */
01082 //} Win32 - Part
01083 //{ Mac - Part
01084 #ifdef qMacCvsPP
01085     StOptionalDialogHandler theHandler(dlg_Diff, gCvsPrefs.HideCommandDlgDiff(), LCommander::GetTopCommander());
01086     LWindow *theDialog = theHandler.GetDialog();
01087     ThrowIfNil_(theDialog);
01088     static UInt16 sRuntimePanel = 1;
01089
01090     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01091         (theDialog->FindPaneByID(item_MultiViewPrefs));
01092     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01093
01094     multiView->SwitchToPanel(2);
01095     DoDataExchange_Globals(theDialog, true);
01096     multiView->SwitchToPanel(1);
01097     DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, initialRev1, initialRev2,
01098         hasRev1, hasRev2, true);
01099     if ( diffType == kDiffGraph )
01100     {
01101       // disable label chooser view
01102       LPane   *labelOptionsGroup = theDialog->FindPaneByID(item_DiffLabelOptions);
01103       if ( labelOptionsGroup ) labelOptionsGroup->Disable();
01104     }
01105     groupView->SetValue(sRuntimePanel);
01106     // skip dialog when option key is pressed
01107   MessageT hitMessage;
01108     theHandler.ShowDialog();
01109     while (true)
01110     {       // Let DialogHandler process events
01111         hitMessage = theHandler.DoDialog();
01112
01113         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01114             break;
01115     }
01116     theDialog->Hide();
01117     sRuntimePanel = groupView->GetValue();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         multiView->SwitchToPanel(1);
01122         DoDataExchange_DiffMain(theDialog, mf, noRecurs, isDate1, isDate2, sLastRev1, sLastRev2,
01123             hasRev1, hasRev2, false);
01124         multiView->SwitchToPanel(2);
01125         DoDataExchange_Globals(theDialog, false);
01126         gCvsPrefs.SetHideCommandDlgDiff(theHandler.GetHideCommandDlg());
01127         userHitOK = true;
01128     }
01129 #endif /* qMacCvsPP */
01130 //} Mac - Part
01131 //{ Unix - Part
01132 #if qUnix
01133     void *wid = UCreate_DiffDlg();
01134
01135     UCvsDiff *dlg = new UCvsDiff();
01136     UCvsDiff_MAIN *tab1 = new UCvsDiff_MAIN(sLastRev1, sLastRev2, allowExtDiff, unifiedDiff, noWhiteSpace, noBlankLines, ignoreCase);
01137     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01138     dlg->AddPage(tab1, UCvsDiff::kTabGeneral, 0);
01139
01140     if(dlg->DoModal())
01141     {
01142         noRecurs = tab1->m_norecurs;
01143
01144         gNoWhiteSpace   = tab1->m_noWhiteSpace != 0;
01145         gNoBlankLines   = tab1->m_noBlankLines != 0;
01146         gIgnoreCase     = tab1->m_ignoreCase != 0;
01147         gUnifiedDiff    = tab1->m_unifiedDiff != 0;
01148         gUseExtDiff     = tab1->m_extdiff;
01149
01150         sLastRev1 = tab1->m_rev1;
01151         sLastRev2 = tab1->m_rev2;
01152         isDate1 = tab1->m_check1;
01153         isDate2 = tab1->m_check2;
01154
01155         if(tab1->m_diff == 0)
01156         {
01157             hasRev1 = hasRev2 = false;
01158         }
01159         else if(tab1->m_diff == 1)
01160         {
01161             hasRev1 = true;
01162             hasRev2 = false;
01163         }
01164         else
01165         {
01166             hasRev1 = true;
01167             hasRev2 = true;
01168         }
01169
01170         userHitOK = true;
01171     }
01172
01173     delete dlg;
01174 #endif // qUnix
01175 //} Unix - Part
01176
01177     if( userHitOK )
01178     {
01179         if( hasRev1 )
01180             rev1 = sLastRev1;
01181
01182         if( hasRev2 )
01183             rev2 = sLastRev2;
01184
01185         useExtDiff     = (bool)gUseExtDiff;
01186         noWhiteSpace   = (bool)gNoWhiteSpace;
01187         noBlankLines   = (bool)gNoBlankLines;
01188         unifiedDiff    = (bool)gUnifiedDiff;
01189         ignoreCase     = (bool)gIgnoreCase;
01190
01191         if( !sLastDiffOptions.empty() )
01192         {
01193             diffOptions = sLastDiffOptions;
01194         }
01195
01196         if( !sLastKeyword.empty() )
01197         {
01198             keyword = sLastKeyword;
01199         }
01200
01201         gCvsPrefs.save();
01202     }
01203
01204     return userHitOK;
01205 }
Generated on Fri Jan 31 12:08:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 "SmartComboBox.h"
00033 #include "KeywordComboBox.h"
00034 #include "uwidget.h"
00035 #include "CvsCommands.h"
00036
00037 #ifdef WIN32
00038 #include "SortHeaderCtrl.h"
00039 #endif
00040
00041 class MultiFiles;
00042 class CPStr;
00043
00045 enum
00046 {
00047     kCompareSameRev = 0,
00048     kCompareAnotherRev,
00049     kCompareTwoRev
00050 };
00051
00052 bool CompatGetDiff(const MultiFiles* mf, kDiffCmdType diffType,
00053                    bool& noRecurs, bool& isDate1, bool& isDate2,
00054                    CPStr& rev1, CPStr& rev2, bool& useExtDiff,
00055                    bool& useUnifiedDiff, bool& noWhiteSpace, bool& noBlankLines, bool& ignoreCase,
00056                    CPStr& keyword, CPStr& diffOptions,
00057                    bool allowExtDiff = false);
00058
00059 #ifdef WIN32
00060
00061 class CDiff_MAIN : public CPropertyPage
00062 {
00063     DECLARE_DYNAMIC(CDiff_MAIN)
00064
00065 // Construction
00066 public:
00067     CDiff_MAIN(const MultiFiles* mf, kDiffCmdType diffType,
00068         const char* rev1, const char* rev2,
00069         bool allowExtDiff, bool useExtDiff,
00070         bool unifiedDiff, bool noWhiteSpace, bool ignoreCase,
00071         const char* keyword, const char* diffOptions);
00072     ~CDiff_MAIN();
00073
00074 // Dialog Data
00075     //{{AFX_DATA(CDiff_MAIN)
00076     enum { IDD = IDD_DIFF_MAIN };
00077     CSmartComboBox  m_diffOptionsCombo;
00078     CButton m_noWhiteSpaceCheck;
00079     CButton m_ignoreCaseCheck;
00080     CButton m_extDiffButton;
00081     CButton m_optionsMenuButton;
00082     CButton m_noRecursCheck;
00083     CButton m_unifiedDiffCheck;
00084     CStatic m_keywordDescStatic;
00085     CKeywordComboBox    m_keywordCombo;
00086     CButton m_browseTag2Button;
00087     CButton m_browseTag1Button;
00088     CButton m_isDate2Check;
00089     CButton m_isDate1Check;
00090     CSmartComboBox  m_compareTypeCombo;
00091     CSmartComboBox  m_rev2Combo;
00092     CSmartComboBox  m_rev1Combo;
00093     BOOL    m_isDate1;
00094     BOOL    m_isDate2;
00095     CString m_rev1;
00096     CString m_rev2;
00097     BOOL    m_noWhiteSpace;
00098     BOOL    m_ignoreCase;
00099     int     m_compareType;
00100     BOOL    m_unifiedDiff;
00101     CString m_keyword;
00102     BOOL    m_noRecurs;
00103     BOOL    m_extDiff;
00104     CString m_diffOptions;
00105     //}}AFX_DATA
00106
00107 // Overrides
00108     // ClassWizard generate virtual function overrides
00109     //{{AFX_VIRTUAL(CDiff_MAIN)
00110     protected:
00111     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00112     //}}AFX_VIRTUAL
00113
00114 // Implementation
00115 protected:
00116     // Generated message map functions
00117     //{{AFX_MSG(CDiff_MAIN)
00118     afx_msg void OnExtdiff();
00119     afx_msg void OnCheck1();
00120     afx_msg void OnCheck2();
00121     afx_msg void OnBrowseTag1();
00122     afx_msg void OnBrowseTag2();
00123     afx_msg void OnSelchangeCompareType();
00124     virtual BOOL OnInitDialog();
00125     afx_msg void OnOptionsmenu();
00126     //}}AFX_MSG
00127     DECLARE_MESSAGE_MAP()
00128 private:
00129     // Data members
00130     const MultiFiles* m_mf;
00131     bool m_allowExtDiff;
00132     kDiffCmdType m_diffType;
00133
00134     // Methods
00135     void EnableCompareType(int compareType);
00136     void EnableCmdLineDiffOptions(bool enable);
00137 };
00138
00140 // CDiff_Options dialog
00141
00142 class CDiff_Options : public CDialog
00143 {
00144 // Construction
00145 public:
00146     CDiff_Options(CWnd* pParent = NULL);   // standard constructor
00147
00148 // Dialog Data
00149     //{{AFX_DATA(CDiff_Options)
00150     enum { IDD = IDD_DIFF_OPTIONS };
00151     CListCtrl   m_optionsListCtrl;
00152     CString m_currentOptions;
00153     //}}AFX_DATA
00154
00155
00156 // Overrides
00157     // ClassWizard generated virtual function overrides
00158     //{{AFX_VIRTUAL(CDiff_Options)
00159     protected:
00160     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00161     //}}AFX_VIRTUAL
00162
00163 // Implementation
00164 protected:
00165
00166     // Generated message map functions
00167     //{{AFX_MSG(CDiff_Options)
00168     virtual void OnOK();
00169     afx_msg void OnItemchangedOptionslist(NMHDR* pNMHDR, LRESULT* pResult);
00170     afx_msg void OnColumnclickOptionslist(NMHDR* pNMHDR, LRESULT* pResult);
00171     virtual BOOL OnInitDialog();
00172     //}}AFX_MSG
00173     DECLARE_MESSAGE_MAP()
00174 private:
00175     // Data members
00176     CString m_diffOptions;
00178     // Sorting
00180     typedef struct
00181     {
00182         int m_column;
00183         bool m_asc;
00184     } CompareInfo;
00185
00186     bool m_sortAsc;
00187     int m_sortColumn;
00188     CSortHeaderCtrl m_headerCtrl;
00189
00190     // Methods
00191     void SortItems(int column, bool asc);
00192     static int CALLBACK CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam);
00193 public:
00194     // Interface
00195     CString GetDiffOptions();
00196 };
00197
00198 //{{AFX_INSERT_LOCATION}}
00199 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00200 #endif /* WIN32 */
00201
00202 #ifdef qUnix
00203 #ifdef _DIFF_CPP_
00204 class UCvsDiff : public UWidget
00205 {
00206     UDECLARE_DYNAMIC(UCvsDiff)
00207 public:
00208     UCvsDiff() : UWidget(::UEventGetWidID()) {}
00209     virtual ~UCvsDiff() {}
00210
00211     enum
00212     {
00213         kOK = EV_COMMAND_START, // 0
00214         kCancel,                // 1
00215         kTabGeneral             // 2
00216     };
00217
00218     virtual void DoDataExchange(bool fill);
00219
00220 protected:
00221     ev_msg int OnOK(void);
00222     ev_msg int OnCancel(void);
00223
00224     UDECLARE_MESSAGE_MAP()
00225 };
00226
00227 UIMPLEMENT_DYNAMIC(UCvsDiff, UWidget)
00228
00229 UBEGIN_MESSAGE_MAP(UCvsDiff, UWidget)
00230     ON_UCOMMAND(UCvsDiff::kOK, UCvsDiff::OnOK)
00231     ON_UCOMMAND(UCvsDiff::kCancel, UCvsDiff::OnCancel)
00232 UEND_MESSAGE_MAP()
00233
00234 class UCvsDiff_MAIN : public UWidget
00235 {
00236     UDECLARE_DYNAMIC(UCvsDiff_MAIN)
00237 public:
00238     UCvsDiff_MAIN(const char *rev1, const char *rev2, bool allowExtDiff, bool useUnifiedDiff,
00239                   bool noWhiteSpace, bool noBlankLines, bool ignoreCase);
00240     virtual ~UCvsDiff_MAIN() {}
00241
00242     enum
00243     {
00244         kCheckDiff1 = EV_COMMAND_START, // 0
00245         kCheckDiff2,            // 1
00246         kCheckDiff3,            // 2
00247         kCheckDate1,            // 3
00248         kCheckDate2,            // 4
00249         kComboRev1,             // 5
00250         kComboRev2,             // 6
00251         kCheckRecurs,           // 7
00252         kCheckExtDiff,          // 8
00253         kCheckNoWhiteSpace,     // 9
00254         kCheckIgnoreCase,       // 10
00255         kCheckNoBlankLines,     // 11
00256         kCheckUnifiedDiff       // 12
00257     };
00258
00259     virtual void DoDataExchange(bool fill);
00260
00261     bool m_check1;
00262     bool m_check2;
00263     UStr m_rev1;
00264     UStr m_rev2;
00265     int m_diff;
00266     bool m_norecurs;
00267     bool m_extdiff;
00268     bool m_unifiedDiff;
00269     bool m_allowExtDiff;
00270     bool m_noWhiteSpace;
00271     bool m_noBlankLines;
00272     bool m_ignoreCase;
00273
00274 protected:
00275     ev_msg int OnDiff(int cmd);
00276
00277     UDECLARE_MESSAGE_MAP()
00278 };
00279
00280 UIMPLEMENT_DYNAMIC(UCvsDiff_MAIN, UWidget)
00281
00282 UBEGIN_MESSAGE_MAP(UCvsDiff_MAIN, UWidget)
00283     ON_UCOMMAND_RANGE(UCvsDiff_MAIN::kCheckDiff1, UCvsDiff_MAIN::kCheckDiff2, UCvsDiff_MAIN::OnDiff)
00284 UEND_MESSAGE_MAP()
00285 #endif // _DIFF_CPP_
00286
00287 #endif // qUnix
00288
00289 #endif // !defined(AFX_DIFFDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC)
00030 #   include "dynl.h"
00031 #endif /* !WIN32 && !TARGET_OS_MAC */
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(TARGET_OS_MAC) && !TARGET_API_MAC_CARBON
00042     RoutineDescriptor sCompatProcRD;
00043     UniversalProcPtr sCompatProc;
00044 #else /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00045     void *sCompatProc;
00046 #endif /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00047
00048 #ifdef TARGET_OS_MAC
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 /* TARGET_OS_MAC */
00074
00075 int
00076 CompatLoadLibrary(CompatConnectID * connID, const char *name_dll)
00077 {
00078     if(connID == 0L)
00079         return 0;
00080
00081 #ifdef TARGET_OS_MAC
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 && !TARGET_OS_MAC */
00097     *connID = dynl_link(name_dll);
00098     return (*connID) != 0L;
00099 #endif /* !WIN32 && !TARGET_OS_MAC */
00100 }
00101
00102 int
00103 CompatCloseLibrary(CompatConnectID * connID)
00104 {
00105     if(connID == 0L)
00106         return 0;
00107
00108 #ifdef TARGET_OS_MAC
00109     CloseConnection(connID);
00110     return 1;
00111 #elif defined(WIN32)
00112     FreeLibrary(*connID);
00113     connID = 0L;
00114     return 1;
00115 #else /* !WIN32 && !TARGET_OS_MAC */
00116     dynl_unlink(*connID);
00117     connID = 0L;
00118     return 1;
00119 #endif /* !WIN32 && !TARGET_OS_MAC */
00120 }
00121
00122 #if defined(TARGET_OS_MAC) && !TARGET_API_MAC_CARBON
00123 UniversalProcPtr
00124 _CompatCallLibrary(CompatConnectID connID, long id_func, const char *name_func)
00125 #else /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00126 void *
00127 _CompatCallLibrary(CompatConnectID connID, const char *name_func)
00128 #endif /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00129 {
00130 #ifdef TARGET_OS_MAC
00131     ProcPtr symAddr;
00132     Str255 pname;
00133 #   if TARGET_API_MAC_OS8
00134     UniversalProcPtr proc;
00135 #   endif
00136
00137     c2pstrcpy(pname, name_func);
00138
00139     symAddr = getSymFunction(connID, pname);
00140 #   if TARGET_API_MAC_CARBON
00141     return symAddr;
00142 #   else
00143     if(symAddr == 0L)
00144         return 0L;
00145
00146     proc = NewRoutineDescriptor(symAddr, id_func, kPowerPCISA);
00147     return proc;
00148 #   endif
00149 #elif defined(WIN32)
00150     return GetProcAddress(connID, name_func);
00151 #else /* !WIN32 && !TARGET_OS_MAC */
00152     return dynl_func(name_func, connID);
00153 #endif /* !WIN32 && !TARGET_OS_MAC */
00154 }
Generated on Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00029 #   include <CodeFragments.h>
00030     typedef CFragConnectionID CompatConnectID;
00031 #elif defined(WIN32)
00032     typedef HINSTANCE CompatConnectID;
00033 #else /* !TARGET_OS_MAC && !WIN32 */
00034 #   include <dlfcn.h>
00035     typedef void *CompatConnectID;
00036 #endif /* !TARGET_OS_MAC && !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(TARGET_OS_MAC) && !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 /* !TARGET_OS_MAC || 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 /* !TARGET_OS_MAC || 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(TARGET_OS_MAC) && !TARGET_API_MAC_CARBON
00112 #   define CompatFuncArg(funcInfo, func) \
00113         NewRoutineDescriptor((ProcPtr)func, funcInfo, kPowerPCISA)
00114 #else /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00115 #   define CompatFuncArg(funcInfo, func) func
00116 #endif /* TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122 #endif /* DLLLOADER_H */
Generated on Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00029 #   include <CodeFragments.h>
00030 #   include <Events.h>
00031 #endif
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #if defined(TARGET_OS_MAC) && !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 /* !TARGET_OS_MAC || 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 /* !TARGET_OS_MAC || TARGET_API_MAC_CARBON */
00094
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098
00099 #endif /* DLL_PROCESS_H */
Generated on Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CvsCommands.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
00070
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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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         GUSIFileSpec inspec(foldermacspec);
00196         inspec += dp->d_name;
00197         UFSSpec infspec = inspec;
00198         macspec = &infspec;
00199
00200         statres = stat(fullname, &sb);
00201 #else
00202 #   if defined(WIN32)
00203         if ( (dbg_mask & wcvsdbg_trace_modified_checks) && (dbg_mask & wcvsdbg_verbose) )
00204         {
00205             AppendWinCvsDebugMask(wcvsdbg_trace_dst_checks
00206                                     | wcvsdbg_trace_stat);
00207             tracestr = "Stat(";
00208             tracestr << static_cast<const char *>(fullname);
00209             tracestr << ") ...\n";
00210             cvs_err(tracestr);
00211             OutputDebugString(tracestr);
00212         }
00213 #   endif   // defined(WIN32)
00214
00215         statres = stat(fullname, &sb);
00216 #endif
00217
00218
00219     if (statres != -1)
00220         {
00221             if(S_ISDIR(sb.st_mode))
00222             {
00223                 res = report.OnDirectory(path, fullname, dp->d_name, sb, macspec);
00224
00225         if(res == kSkipFile)
00226                     continue;
00227                 if(res != kContinueTraversal)
00228                     goto abort;
00229
00230         res = FileTraverse(fullname, report, macspec);
00231                 if(res != kContinueTraversal)
00232                     goto abort;
00233
00234             }
00235             else if(S_ISREG(sb.st_mode))
00236             {
00237                 res = report.OnFile(path, fullname, dp->d_name, sb, macspec);
00238                 if(res == kSkipFile)
00239                     continue;
00240                 if(res != kContinueTraversal)
00241                     goto abort;
00242             }
00243 #ifdef S_ISLNK
00244             else if(S_ISLNK(sb.st_mode))
00245             {
00246                 res = report.OnAlias(path, fullname, dp->d_name, sb, macspec);
00247                 if(res == kSkipFile)
00248                     continue;
00249                 if(res != kContinueTraversal)
00250                     goto abort;
00251             }
00252 #endif /* S_ISLNK */
00253             else
00254             {
00255                 /* TODO : Unix devices */
00256                 errstr = "Error while accessing ";
00257                 errstr << fullname;
00258                 errstr << " (error " << errno << ')';
00259                 res = report.OnError(errstr, errno);
00260                 goto abort;
00261             }
00262         }
00263         else
00264         {
00265             errstr = "Error while accessing ";
00266             errstr << fullname;
00267             errstr << " (error " << errno << ')';
00268             res = report.OnError(errstr, errno);
00269
00270       // no abort, because all
00271       // * files not read yet will be signed as missing and all
00272       // * folder will not be displayed
00273       //goto abort;
00274         }
00275     }
00276
00277     res = report.ExitDirectory(path);
00278
00279 abort:
00280     closedir (dirp);
00281 exit:
00282     if(0L != szOriginalPath)
00283     {
00284 #if !TARGET_RT_MAC_CFM
00285         chdir(szOriginalPath);
00286 #endif
00287         free(szOriginalPath);
00288         szOriginalPath = NULL;
00289     }
00290
00291 #if defined(WIN32)
00292     SetWinCvsDebugMask(dbg_mask);
00293 #endif  // defined(WIN32)
00294
00295     return res;
00296 }
Generated on Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00031 #   define not notnot
00032 #endif /* TARGET_OS_MAC */
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(TARGET_OS_MAC)
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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC))
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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC)
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 TARGET_OS_MAC
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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC) || defined(WIN32)
00054 #include <stdlib.h>
00055 #endif /* TARGET_OS_MAC || 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 TARGET_OS_MAC
00185 char *getenv ();
00186 #endif /* !TARGET_OS_MAC */
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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC) || 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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 #endif /* qMacCvsPP */
00041
00042 #if qUnix
00043 #   include "UCvsDialogs.h"
00044 #endif
00045
00046 #include "GetPassword.h"
00047 #include "CvsCommands.h"
00048
00049 #ifdef WIN32
00050 #   ifdef _DEBUG
00051 #   define new DEBUG_NEW
00052 #   undef THIS_FILE
00053     static char THIS_FILE[] = __FILE__;
00054 #   endif
00055 #endif /* WIN32 */
00056
00057 #ifdef WIN32
00058
00059 // GetPassword dialog
00060
00061
00062 GetPassword::GetPassword(CWnd* pParent /*=NULL*/)
00063     : CDialog(GetPassword::IDD, pParent)
00064 {
00065     //{{AFX_DATA_INIT(GetPassword)
00066     m_passwd = _T("");
00067     //}}AFX_DATA_INIT
00068 }
00069
00070
00071 void GetPassword::DoDataExchange(CDataExchange* pDX)
00072 {
00073     CDialog::DoDataExchange(pDX);
00074     //{{AFX_DATA_MAP(GetPassword)
00075     DDX_Text(pDX, IDC_PASSWD, m_passwd);
00076     //}}AFX_DATA_MAP
00077 }
00078
00079
00080 BEGIN_MESSAGE_MAP(GetPassword, CDialog)
00081     //{{AFX_MSG_MAP(GetPassword)
00082     //}}AFX_MSG_MAP
00083 END_MESSAGE_MAP()
00084
00085
00086 // GetPassword message handlers
00087
00088 BOOL GetPassword::OnInitDialog()
00089 {
00090     CDialog::OnInitDialog();
00091
00092     // Extra initialization here
00093
00094     //force the window to the foreground in case it was covered by terminal or DOS box
00095     if( !IsWindowVisible() )
00096     {
00097         SetForegroundWindow();
00098     }
00099
00100     return TRUE;  // return TRUE unless you set the focus to a control
00101     // EXCEPTION: OCX Property Pages should return FALSE
00102 }
00103
00104 #endif /* WIN32 */
00105
00106 #if qUnix
00107 class UCvsGetPasswd : public UWidget
00108 {
00109     UDECLARE_DYNAMIC(UCvsGetPasswd)
00110 public:
00111     UCvsGetPasswd() : UWidget(::UEventGetWidID()) {}
00112     virtual ~UCvsGetPasswd() {}
00113
00114     enum
00115     {
00116         kOK = EV_COMMAND_START, // 0
00117         kCancel,                // 1
00118         kPasswd                 // 2
00119     };
00120
00121     virtual void DoDataExchange(bool fill);
00122
00123     UStr m_passwd;
00124
00125 protected:
00126     ev_msg int OnOK(void);
00127     ev_msg int OnCancel(void);
00128
00129     UDECLARE_MESSAGE_MAP()
00130 };
00131
00132 UIMPLEMENT_DYNAMIC(UCvsGetPasswd, UWidget)
00133
00134 UBEGIN_MESSAGE_MAP(UCvsGetPasswd, UWidget)
00135     ON_UCOMMAND(UCvsGetPasswd::kOK, UCvsGetPasswd::OnOK)
00136     ON_UCOMMAND(UCvsGetPasswd::kCancel, UCvsGetPasswd::OnCancel)
00137 UEND_MESSAGE_MAP()
00138
00139 int UCvsGetPasswd::OnOK(void)
00140 {
00141     EndModal(true);
00142     return 0;
00143 }
00144
00145 int UCvsGetPasswd::OnCancel(void)
00146 {
00147     EndModal(false);
00148     return 0;
00149 }
00150
00151 void UCvsGetPasswd::DoDataExchange(bool fill)
00152 {
00153     if(fill)
00154     {
00155     }
00156     else
00157     {
00158         UEventSendMessage(GetWidID(), EV_GETTEXT, kPasswd, &m_passwd);
00159     }
00160 }
00161 #endif // qUnix
00162
00163 char *CompatGetPassword(const char *prompt)
00164 {
00165 #ifdef WIN32
00166     static char passwd[255];
00167     GetPassword gp;
00168     if(gp.DoModal() == IDOK)
00169     {
00170         strcpy(passwd, gp.m_passwd);
00171         return passwd;
00172     }
00173     return "";
00174 #endif /* WIN32 */
00175 //{ Mac-Part
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 //}
00359 #if qUnix
00360     static char passwd[255];
00361     void *wid = UCreate_PasswdDlg();
00362
00363     UCvsGetPasswd *dlg = new UCvsGetPasswd();
00364     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00365
00366     if(dlg->DoModal())
00367     {
00368         strcpy(passwd, dlg->m_passwd);
00369     }
00370     else
00371         strcpy(passwd, "");
00372
00373     delete dlg;
00374     return passwd;
00375 #endif // qUnix
00376 }
Generated on Fri Jan 31 12:08:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 <LEditText.h>
00030 #   include <LPushButton.h>
00031 #   include <LPopupGroupBox.h>
00032
00033 #   include "MacCvsConstant.h"
00034 #   include "MacBinEncoding.h"
00035 #   include "uwidget.h"
00036 #endif /* qMacCvsPP */
00037
00038 #if qUnix
00039 #   include "UCvsDialogs.h"
00040 #   include "gtk/gtkmain.h"
00041 #endif
00042
00043 #ifdef WIN32
00044 #   include "wincvs.h"
00045 #   include "umain.h"
00046 #   include <afxdao.h>
00047 #endif /* WIN32 */
00048
00049 #include "GetPrefs.h"
00050 #include "CvsPrefs.h"
00051 #include "Authen.h"
00052 #include "AppConsole.h"
00053 #include "AppGlue.h"
00054 #include "PromptFiles.h"
00055 #include "MultiFiles.h"
00056 #include "CvsArgs.h"
00057 #include "FileTraversal.h"
00058 #include "CvsCommands.h"
00059
00060 #ifdef WIN32   //{ Windows-Part
00061
00062 #ifdef _DEBUG
00063 #define new DEBUG_NEW
00064 #undef THIS_FILE
00065 static char THIS_FILE[] = __FILE__;
00066 #endif
00067
00068 // CVSROOT page
00069 IMPLEMENT_DYNCREATE(CGetPrefs_CVSROOT, CPropertyPage)
00070
00071 CGetPrefs_CVSROOT::CGetPrefs_CVSROOT()
00072     : m_versCombo(USmartCombo::AutoDropWidth), m_authenCombo(USmartCombo::AutoDropWidth),
00073     CPropertyPage(CGetPrefs_CVSROOT::IDD), m_didInteract(false)
00074 {
00075     //{{AFX_DATA_INIT(CGetPrefs_CVSROOT)
00076     m_cvsroot = (const char*)gCvsPrefs;
00077     m_cvsvers = gCvsPrefs.CvsVersion();
00078     m_cvsconsole = gCvsPrefs.CvsConsole();
00079     m_authen = gAuthen.kind();
00080     m_host = _T("");
00081     m_login = _T("");
00082     m_path = _T("");
00083     //}}AFX_DATA_INIT
00084
00085     m_flag = false;
00086     m_cvsrootCombo.SetItems(&gOldCvsroots);
00087 }
00088
00089 CGetPrefs_CVSROOT::~CGetPrefs_CVSROOT()
00090 {
00091 }
00092
00093
00094 void CGetPrefs_CVSROOT::DoDataExchange(CDataExchange* pDX)
00095 {
00096     m_didInteract = true;
00097
00098     CPropertyPage::DoDataExchange(pDX);
00099
00100     //{{AFX_DATA_MAP(CGetPrefs_CVSROOT)
00101     DDX_Control(pDX, IDC_AUTHENDESC, m_authenDescEdit);
00102     DDX_Control(pDX, IDC_SETTINGS, m_settingsButton);
00103     DDX_Control(pDX, IDC_PATH, m_pathEdit);
00104     DDX_Control(pDX, IDC_LOGIN, m_loginEdit);
00105     DDX_Control(pDX, IDC_HOST, m_hostEdit);
00106     DDX_Control(pDX, IDC_CVSVERS, m_versCombo);
00107     DDX_Control(pDX, IDC_AUTHEN, m_authenCombo);
00108     DDX_Control(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00109     DDX_CBString(pDX, IDC_COMBOROOT, m_cvsroot);
00110     DDV_MinChars(pDX, m_cvsroot, 1);
00111     DDX_Text(pDX, IDC_HOST, m_host);
00112     DDX_Text(pDX, IDC_LOGIN, m_login);
00113     DDX_Text(pDX, IDC_PATH, m_path);
00114     DDX_Check(pDX, IDC_CONSOLE, m_cvsconsole);
00115     //}}AFX_DATA_MAP
00116
00117     DDV_CheckCVSROOT(pDX, m_cvsroot);
00118
00119     if( pDX->m_bSaveAndValidate )
00120     {
00121         //in case the CVSROOT was modified by DDV rutine we need to refill the fields
00122         FillFields();
00123
00124         m_cvsvers = m_versCombo.GetCurSel();
00125
00126         if( !m_cvsroot.IsEmpty() )
00127         {
00128             gOldCvsroots.Insert(m_cvsroot);
00129         }
00130     }
00131     else
00132     {
00133         DDX_ComboMString(pDX, IDC_COMBOROOT, m_cvsrootCombo);
00134
00135         m_versCombo.SetCurSel(m_cvsvers);
00136
00137         m_authenCombo.ResetContent();
00138         std::vector<AuthenModel*>& allAuthen = AuthenModel::GetAllInstances();
00139         std::vector<AuthenModel*>::iterator j;
00140         for(j = allAuthen.begin(); j != allAuthen.end(); ++j)
00141         {
00142             m_authenCombo.InsertString(-1, (*j)->GetToken());
00143         }
00144
00145         AuthenModel* model = AuthenModel::GetInstance(m_authen);
00146         m_authenCombo.SetCurSel(Authen::kindToNum(m_authen));
00147
00148         FillFields();
00149         OnSelchangeAuthen();
00150     }
00151 }
00152
00154 void CGetPrefs_CVSROOT::StoreValues()
00155 {
00156     if( !m_didInteract )
00157         return;
00158
00159     gCvsPrefs = (const char*)m_cvsroot;
00160     gAuthen.setkind(m_authen);
00161     gCvsPrefs.SetCvsVersion(m_cvsvers);
00162     gCvsPrefs.SetCvsConsole(m_cvsconsole != 0);
00163 }
00164
00166 void CGetPrefs_CVSROOT::OnSelchangeAuthen()
00167 {
00168     m_authen = Authen::numToKind(m_authenCombo.GetCurSel());
00169
00170     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00171
00172     m_hostEdit.EnableWindow(model->HasHost());
00173     m_loginEdit.EnableWindow(model->HasUser());
00174     m_settingsButton.EnableWindow(model->HasSettings());
00175
00176     if( !model->HasHost() )
00177         m_hostEdit.SetWindowText("");
00178
00179     if( !model->HasUser() )
00180         m_loginEdit.SetWindowText("");
00181
00182     UStr desc;
00183     model->GetSettingsDesc(desc);
00184     m_authenDescEdit.SetWindowText(desc);
00185 }
00186
00188 void CGetPrefs_CVSROOT::OnChangePath()
00189 {
00190     OnChangeFields();
00191 }
00192
00194 void CGetPrefs_CVSROOT::OnChangeHost()
00195 {
00196     OnChangeFields();
00197 }
00198
00200 void CGetPrefs_CVSROOT::OnChangeLogin()
00201 {
00202     OnChangeFields();
00203 }
00204
00206 void CGetPrefs_CVSROOT::OnSettings()
00207 {
00208     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00209     model->DoSettings();
00210
00211     UStr desc;
00212     model->GetSettingsDesc(desc);
00213     m_authenDescEdit.SetWindowText(desc);
00214 }
00215
00217 void CGetPrefs_CVSROOT::FillFields(void)
00218 {
00219     UStr theMethod, theUser, theHost, thePath;
00220     USemaphore policeman(m_flag);
00221     if( policeman.IsEnteredTwice() )
00222         return;
00223
00224     UStr root;
00225     root = Authen::token(m_authen);
00226     root << Authen::skiptoken(m_cvsroot);
00227
00228     if( Authen::parse_cvsroot(root, theMethod, theUser, theHost, thePath) )
00229     {
00230         m_pathEdit.SetWindowText(thePath);
00231         m_hostEdit.SetWindowText(theHost);
00232         m_loginEdit.SetWindowText(theUser);
00233     }
00234 }
00235
00237 void CGetPrefs_CVSROOT::OnEditchangeComboroot()
00238 {
00239     m_cvsrootCombo.GetWindowText(m_cvsroot);
00240     FillFields();
00241 }
00242
00244 void CGetPrefs_CVSROOT::OnChangeFields(void)
00245 {
00246     USemaphore policeman(m_flag);
00247     if( policeman.IsEnteredTwice() )
00248         return;
00249
00250     CString theUser, theHost, thePath;
00251
00252     m_pathEdit.GetWindowText(thePath);
00253     m_hostEdit.GetWindowText(theHost);
00254     m_loginEdit.GetWindowText(theUser);
00255
00256     m_cvsroot = "";
00257     AuthenModel* model = AuthenModel::GetInstance(m_authen);
00258     if( model->HasUser() )
00259     {
00260         m_cvsroot += theUser;
00261
00262         if( model->HasHost() && !(theUser.IsEmpty() || theHost.IsEmpty()) )
00263         {
00264             m_cvsroot += '@';
00265         }
00266     }
00267
00268     if( model->HasHost() )
00269     {
00270         m_cvsroot += theHost;
00271     }
00272
00273     if( model->HasUser() || model->HasHost() )
00274         m_cvsroot += ':';
00275
00276     m_cvsroot += thePath;
00277
00278     m_cvsrootCombo.SetWindowText(m_cvsroot);
00279 }
00280
00282 void CGetPrefs_CVSROOT::OnSelchangeComboroot()
00283 {
00284     int nCurSel = m_cvsrootCombo.GetCurSel();
00285     m_cvsrootCombo.GetLBText(nCurSel, m_cvsroot);
00286     FillFields();
00287 }
00288
00289 BEGIN_MESSAGE_MAP(CGetPrefs_CVSROOT, CPropertyPage)
00290     //{{AFX_MSG_MAP(CGetPrefs_CVSROOT)
00291     ON_CBN_SELCHANGE(IDC_AUTHEN, OnSelchangeAuthen)
00292     ON_EN_CHANGE(IDC_PATH, OnChangePath)
00293     ON_EN_CHANGE(IDC_HOST, OnChangeHost)
00294     ON_EN_CHANGE(IDC_LOGIN, OnChangeLogin)
00295     ON_BN_CLICKED(IDC_SETTINGS, OnSettings)
00296     ON_CBN_SELCHANGE(IDC_COMBOROOT, OnSelchangeComboroot)
00297     ON_CBN_EDITCHANGE(IDC_COMBOROOT, OnEditchangeComboroot)
00298     //}}AFX_MSG_MAP
00299 END_MESSAGE_MAP()
00300
00301 // Globals options page
00302 IMPLEMENT_DYNCREATE(CGetPrefs_GLOBALS, CPropertyPage)
00303
00304 CGetPrefs_GLOBALS::CGetPrefs_GLOBALS() : CPropertyPage(CGetPrefs_GLOBALS::IDD), m_didInteract(false)
00305 {
00306     //{{AFX_DATA_INIT(CGetPrefs_GLOBALS)
00307     m_checkoutro = gCvsPrefs.CheckoutRO();
00308     m_prune = gCvsPrefs.PruneOption();
00309     m_tcpip = gCvsPrefs.Z9Option();
00310     m_quiet = gCvsPrefs.QuietOption();
00311     m_cntladd = gCvsPrefs.AddControl();
00312     m_dirty = gCvsPrefs.DirtySupport();
00313     m_alwaysroot = gCvsPrefs.AlwaysUseCvsroot();
00314     m_logout = gCvsPrefs.LogoutTimeOut() > 0;
00315     m_unixlf = gCvsPrefs.UnixLF();
00316     m_zlevel = gCvsPrefs.ZLevel();
00317     m_disableSplashScreen = gCvsPrefs.DisableSplashScreen();
00318     m_logoutTime = gCvsPrefs.LogoutTimeOut();
00319     //}}AFX_DATA_INIT
00320 }
00321
00322 CGetPrefs_GLOBALS::~CGetPrefs_GLOBALS()
00323 {
00324 }
00325
00326 void CGetPrefs_GLOBALS::DoDataExchange(CDataExchange* pDX)
00327 {
00328     m_didInteract = true;
00329
00330     CPropertyPage::DoDataExchange(pDX);
00331
00332     //{{AFX_DATA_MAP(CGetPrefs_GLOBALS)
00333     DDX_Control(pDX, IDC_SPINLOGOUT, m_logoutSpinButton);
00334     DDX_Control(pDX, IDC_EDITLOGOUT, m_logoutEdit);
00335     DDX_Control(pDX, IDC_LOGOUT, m_logoutCheck);
00336     DDX_Control(pDX, IDC_ZSPIN, m_zspinSpinButton);
00337     DDX_Control(pDX, IDC_ZLEVEL, m_zlevelEdit);
00338     DDX_Control(pDX, IDC_TCPIP, m_tcpipCheck);
00339     DDX_Check(pDX, IDC_CHECKOUTRO, m_checkoutro);
00340     DDX_Check(pDX, IDC_PRUNE, m_prune);
00341     DDX_Check(pDX, IDC_TCPIP, m_tcpip);
00342     DDX_Check(pDX, IDC_QUIET, m_quiet);
00343     DDX_Check(pDX, IDC_CTNLADD, m_cntladd);
00344     DDX_Check(pDX, IDC_DIRTYSUPPORT, m_dirty);
00345     DDX_Check(pDX, IDC_ALWAYSROOT, m_alwaysroot);
00346     DDX_Check(pDX, IDC_LOGOUT, m_logout);
00347     DDX_Check(pDX, IDC_CHECKUNIXLF, m_unixlf);
00348     DDX_Text(pDX, IDC_ZLEVEL, m_zlevel);
00349     DDV_MinMaxUInt(pDX, m_zlevel, 1, 9);
00350     DDX_Check(pDX, IDC_DISABLESPLASHSCREEN, m_disableSplashScreen);
00351     DDX_Text(pDX, IDC_EDITLOGOUT, m_logoutTime);
00352     DDV_MinMaxUInt(pDX, m_logoutTime, 0, 999999);
00353     //}}AFX_DATA_MAP
00354
00355     if( !pDX->m_bSaveAndValidate )
00356     {
00357         OnTcpip();
00358         OnLogout();
00359     }
00360 }
00361
00363 void CGetPrefs_GLOBALS::StoreValues()
00364 {
00365     if( !m_didInteract )
00366         return;
00367
00368     gCvsPrefs.SetCheckoutRO(m_checkoutro ? true : false);
00369     gCvsPrefs.SetPruneOption(m_prune ? true : false);
00370     gCvsPrefs.SetZ9Option(m_tcpip ? true : false);
00371     gCvsPrefs.SetQuietOption(m_quiet ? true : false);
00372     gCvsPrefs.SetAddControl(m_cntladd ? true : false);
00373     gCvsPrefs.SetDirtySupport(m_dirty ? true : false);
00374     gCvsPrefs.SetAlwaysUseCvsroot(m_alwaysroot ? true : false);
00375     gCvsPrefs.SetLogoutTimeOut(m_logout ? (int)m_logoutTime : 0);
00376     gCvsPrefs.SetUnixLF(m_unixlf != 0);
00377     gCvsPrefs.SetZLevel(m_zlevel);
00378     gCvsPrefs.SetDisableSplashScreen(m_disableSplashScreen ? true : false);
00379 }
00380
00381 BEGIN_MESSAGE_MAP(CGetPrefs_GLOBALS, CPropertyPage)
00382     //{{AFX_MSG_MAP(CGetPrefs_GLOBALS)
00383     ON_BN_CLICKED(IDC_LOGOUT, OnLogout)
00384     ON_BN_CLICKED(IDC_CHECKUNIXLF, OnCheckunixlf)
00385     ON_BN_CLICKED(IDC_TCPIP, OnTcpip)
00386     //}}AFX_MSG_MAP
00387 END_MESSAGE_MAP()
00388
00389
00390 BOOL CGetPrefs_GLOBALS::OnInitDialog()
00391 {
00392     CPropertyPage::OnInitDialog();
00393
00394     // Extra initialization
00395     m_logoutSpinButton.SetBase(10);
00396     m_logoutSpinButton.SetRange(0, 30000);
00397
00398     m_zspinSpinButton.SetBase(1);
00399     m_zspinSpinButton.SetRange(1, 9);
00400
00401     return TRUE;  // return TRUE unless you set the focus to a control
00402                   // EXCEPTION: OCX Property Pages should return FALSE
00403 }
00404
00406 void CGetPrefs_GLOBALS::OnTcpip()
00407 {
00408     m_zlevelEdit.EnableWindow(m_tcpipCheck.GetCheck() != 0);
00409     m_zspinSpinButton.EnableWindow(m_tcpipCheck.GetCheck() != 0);
00410 }
00411
00413 void CGetPrefs_GLOBALS::OnLogout()
00414 {
00415     m_logoutEdit.EnableWindow(m_logoutCheck.GetCheck() != 0);
00416     m_logoutSpinButton.EnableWindow(m_logoutCheck.GetCheck() != 0);
00417 }
00418
00420 void CGetPrefs_GLOBALS::OnCheckunixlf()
00421 {
00422     AfxMessageBox("Be careful when toggling this option : you *CANNOT* use WinCvs in"
00423         " both mode. You got to use either one or the other. If you experience some"
00424         " problems, try to remove the global cvs files (such as .cvspass) because they probably"
00425         " don't match the new line feeds.", MB_ICONEXCLAMATION | MB_OK);
00426 }
00427
00428 // WinCvs options page
00429 IMPLEMENT_DYNCREATE(CGetPrefs_WINCVS, CPropertyPage)
00430
00431 CGetPrefs_WINCVS::CGetPrefs_WINCVS() : CPropertyPage(CGetPrefs_WINCVS::IDD), m_didInteract(false)
00432 {
00433     //{{AFX_DATA_INIT(CGetPrefs_WINCVS)
00434     m_viewer = gCvsPrefs.Viewer() != 0L ? gCvsPrefs.Viewer() : "";
00435     m_useViewerAlways = gCvsPrefs.UseViewerAlways();
00436     m_useExtDiff = gCvsPrefs.ExtDiff() != 0L;
00437     m_diffProg = gCvsPrefs.ExtDiff();
00438     m_useSettingsFolder = gCvsPrefs.SettingsFolder() != 0L;
00439     m_settingsFolder = gCvsPrefs.SettingsFolder() != 0L ? gCvsPrefs.SettingsFolder() : "";
00440     //}}AFX_DATA_INIT
00441 }
00442
00443 CGetPrefs_WINCVS::~CGetPrefs_WINCVS()
00444 {
00445 }
00446
00447 void CGetPrefs_WINCVS::DoDataExchange(CDataExchange* pDX)
00448 {
00449     m_didInteract = true;
00450
00451     CPropertyPage::DoDataExchange(pDX);
00452
00453     //{{AFX_DATA_MAP(CGetPrefs_WINCVS)
00454     DDX_Control(pDX, IDC_PROGRAM, m_viewerEdit);
00455     DDX_Control(pDX, IDC_EXTDIFFSEL, m_extDiffSelButton);
00456     DDX_Control(pDX, IDC_DIFFPROG, m_diffProgEdit);
00457     DDX_Control(pDX, IDC_EXTDIFF, m_useExtDiffCheck);
00458     DDX_Control(pDX, IDC_SETTINGS, m_settingsFolderEdit);
00459     DDX_Control(pDX, IDC_BTNSETTINGS, m_settingsFolderButton);
00460     DDX_Control(pDX, IDC_ALTSETTINGSCHK, m_useSettingsFolderCheck);
00461     DDX_Text(pDX, IDC_PROGRAM, m_viewer);
00462     DDX_Check(pDX, IDC_USE_VIEWER_ALWAYS, m_useViewerAlways);
00463     DDX_Check(pDX, IDC_EXTDIFF, m_useExtDiff);
00464     DDX_Text(pDX, IDC_DIFFPROG, m_diffProg);
00465     DDX_Check(pDX, IDC_ALTSETTINGSCHK, m_useSettingsFolder);
00466     DDX_Text(pDX, IDC_SETTINGS, m_settingsFolder);
00467     //}}AFX_DATA_MAP
00468
00469     if( m_useSettingsFolder )
00470     {
00471         DDV_MinChars(pDX, m_settingsFolder, 1);
00472         DDV_CheckPathExists(pDX, IDC_SETTINGS, m_settingsFolder);
00473     }
00474
00475     if( !pDX->m_bSaveAndValidate )
00476     {
00477         OnExtdiff();
00478         OnAltsettingschk();
00479     }
00480 }
00481
00483 void CGetPrefs_WINCVS::StoreValues()
00484 {
00485     if( !m_didInteract )
00486         return;
00487
00488     gCvsPrefs.SetViewer(!m_viewer.IsEmpty() ? (LPCTSTR)m_viewer : 0L);
00489     gCvsPrefs.SetExtDiff(m_useExtDiff && !m_diffProg.IsEmpty() ? (LPCTSTR)m_diffProg : 0L);
00490     gCvsPrefs.SetUseViewerAlways(m_useViewerAlways ? true : false);
00491     gCvsPrefs.SetSettingsFolder(m_useSettingsFolder && !m_settingsFolder.IsEmpty() ? (LPCTSTR)m_settingsFolder : 0L);
00492 }
00493
00494 BEGIN_MESSAGE_MAP(CGetPrefs_WINCVS, CPropertyPage)
00495     //{{AFX_MSG_MAP(CGetPrefs_WINCVS)
00496     ON_BN_CLICKED(IDC_BTNPROGRAM, OnBtnviewer)
00497     ON_BN_CLICKED(IDC_EXTDIFFSEL, OnExtdiffsel)
00498     ON_BN_CLICKED(IDC_EXTDIFF, OnExtdiff)
00499     ON_BN_CLICKED(IDC_ALTSETTINGSCHK, OnAltsettingschk)
00500     ON_BN_CLICKED(IDC_BTNSETTINGS, OnBtnsettings)
00501     //}}AFX_MSG_MAP
00502 END_MESSAGE_MAP()
00503
00504
00505 void CGetPrefs_WINCVS::OnBtnviewer()
00506 {
00507     MultiFiles mf;
00508
00509     CString viewerPath;
00510     m_viewerEdit.GetWindowText(viewerPath);
00511
00512     if( !viewerPath.IsEmpty() )
00513     {
00514         CStr uppath;
00515         CStr file;
00516
00517         if( SplitPath(viewerPath, uppath, file) )
00518         {
00519             mf.newdir(uppath);
00520             mf.newfile(file);
00521         }
00522     }
00523
00524     if( !BrowserGetMultiFiles("Select the viewer application", mf, true, kSelectExecutable) )
00525         return;
00526
00527     CvsArgs args(false);
00528
00529     const char* dir = (*mf.begin()).add(args);
00530     char* const* argv = args.Argv();
00531
00532     CStr fullpath;
00533     fullpath = dir;
00534
00535     if( !fullpath.endsWith(kPathDelimiter) )
00536         fullpath << kPathDelimiter;
00537
00538     fullpath << argv[0];
00539
00540     m_viewerEdit.SetWindowText(fullpath);
00541 }
00542
00544 void CGetPrefs_WINCVS::OnExtdiffsel()
00545 {
00546     MultiFiles mf;
00547
00548     CString diffProg;
00549     m_diffProgEdit.GetWindowText(diffProg);
00550
00551     if( !diffProg.IsEmpty() )
00552     {
00553         CStr uppath;
00554         CStr file;
00555
00556         if( SplitPath(diffProg, uppath, file) )
00557         {
00558             mf.newdir(uppath);
00559             mf.newfile(file);
00560         }
00561     }
00562
00563     if( !BrowserGetMultiFiles("Select the external diff application", mf, true, kSelectExecutable) )
00564         return;
00565
00566     CvsArgs args(false);
00567
00568     const char* dir = (*mf.begin()).add(args);
00569     char* const* argv = args.Argv();
00570
00571     CStr fullpath;
00572     fullpath = dir;
00573
00574     if( !fullpath.endsWith(kPathDelimiter) )
00575         fullpath << kPathDelimiter;
00576
00577     fullpath << argv[0];
00578
00579     m_diffProgEdit.SetWindowText(fullpath);
00580 }
00581
00583 void CGetPrefs_WINCVS::OnExtdiff()
00584 {
00585     m_diffProgEdit.EnableWindow(m_useExtDiffCheck.GetCheck() != 0);
00586     m_extDiffSelButton.EnableWindow(m_useExtDiffCheck.GetCheck() != 0);
00587 }
00588
00590 void CGetPrefs_WINCVS::OnAltsettingschk()
00591 {
00592     const bool useSettingsFolder = m_useSettingsFolderCheck.GetCheck() != 0;
00593
00594     m_settingsFolderEdit.EnableWindow(useSettingsFolder);
00595     m_settingsFolderButton.EnableWindow(useSettingsFolder);
00596
00597     if( useSettingsFolder )
00598     {
00599         CString strSettingsFolder;
00600         m_settingsFolderEdit.GetWindowText(strSettingsFolder);
00601
00602         if( strSettingsFolder.IsEmpty() )
00603         {
00604             CStr settingsFolder;
00605             if( FormatDefaultSettingsLoc(settingsFolder) )
00606             {
00607                 m_settingsFolderEdit.SetWindowText(settingsFolder);
00608             }
00609         }
00610     }
00611 }
00612
00614 void CGetPrefs_WINCVS::OnBtnsettings()
00615 {
00616     CString strSettingsFolder;
00617     m_settingsFolderEdit.GetWindowText(strSettingsFolder);
00618
00619     CStr settingsFolder(strSettingsFolder);
00620     if( BrowserGetDirectory("Select the settings directory", settingsFolder, IsWindow(m_hWnd) ? this : NULL) )
00621     {
00622         m_settingsFolderEdit.SetWindowText(settingsFolder);
00623     }
00624 }
00625
00627 // CGetPrefs_CVS
00628
00629 IMPLEMENT_DYNCREATE(CGetPrefs_CVS, CPropertyPage)
00630
00631 CGetPrefs_CVS::CGetPrefs_CVS() : CPropertyPage(CGetPrefs_CVS::IDD), m_didInteract(false)
00632 {
00633     UStr cvsPath;
00634     //{{AFX_DATA_INIT(CGetPrefs_CVS)
00635     m_home = gCvsPrefs.Home() != 0L ? gCvsPrefs.Home() : "";
00636     m_useAltCvs = gCvsPrefs.WhichCvs(cvsPath, true) != 0L;
00637     m_altCvs = gCvsPrefs.WhichCvs(cvsPath);
00638     //}}AFX_DATA_INIT
00639 }
00640
00641 CGetPrefs_CVS::~CGetPrefs_CVS()
00642 {
00643 }
00644
00645 void CGetPrefs_CVS::DoDataExchange(CDataExchange* pDX)
00646 {
00647     m_didInteract = true;
00648
00649     CPropertyPage::DoDataExchange(pDX);
00650
00651     //{{AFX_DATA_MAP(CGetPrefs_CVS)
00652     DDX_Control(pDX, IDC_ALTCVSPROG, m_altCvsEdit);
00653     DDX_Control(pDX, IDC_ALTCVSSEL, m_selAltCvsButton);
00654     DDX_Control(pDX, IDC_ALTCVSCHK, m_useAltCvsCheck);
00655     DDX_Control(pDX, IDC_HOME, m_homeEdit);
00656     DDX_Text(pDX, IDC_HOME, m_home);
00657     DDX_Check(pDX, IDC_ALTCVSCHK, m_useAltCvs);
00658     DDX_Text(pDX, IDC_ALTCVSPROG, m_altCvs);
00659     //}}AFX_DATA_MAP
00660
00661     DDV_CheckPathExists(pDX, IDC_HOME, m_home);
00662
00663     if( !pDX->m_bSaveAndValidate )
00664     {
00665         OnAltcvschk();
00666     }
00667 }
00668
00670 void CGetPrefs_CVS::StoreValues()
00671 {
00672     if( !m_didInteract )
00673         return;
00674
00675     gCvsPrefs.SetHome(m_home);
00676     gCvsPrefs.SetWhichCvs(m_useAltCvs && !m_altCvs.IsEmpty() ? (LPCTSTR)m_altCvs : "");
00677 }
00678
00679 BEGIN_MESSAGE_MAP(CGetPrefs_CVS, CPropertyPage)
00680     //{{AFX_MSG_MAP(CGetPrefs_CVS)
00681     ON_BN_CLICKED(IDC_BTNHOME, OnBtnhome)
00682     ON_BN_CLICKED(IDC_ALTCVSCHK, OnAltcvschk)
00683     ON_BN_CLICKED(IDC_ALTCVSSEL, OnAltcvssel)
00684     //}}AFX_MSG_MAP
00685 END_MESSAGE_MAP()
00686
00687
00688 void CGetPrefs_CVS::OnBtnhome()
00689 {
00690     CString strHome;
00691     m_homeEdit.GetWindowText(strHome);
00692
00693     CStr home(strHome);
00694     if( BrowserGetDirectory("Select the HOME directory", home, IsWindow(m_hWnd) ? this : NULL) )
00695     {
00696         m_homeEdit.SetWindowText(home);
00697     }
00698 }
00699
00701 void CGetPrefs_CVS::OnAltcvschk()
00702 {
00703     m_altCvsEdit.EnableWindow(m_useAltCvsCheck.GetCheck() != 0);
00704     m_selAltCvsButton.EnableWindow(m_useAltCvsCheck.GetCheck() != 0);
00705 }
00706
00708 void CGetPrefs_CVS::OnAltcvssel()
00709 {
00710     MultiFiles mf;
00711
00712     CString altCvs;
00713     m_altCvsEdit.GetWindowText(altCvs);
00714
00715     if( !altCvs.IsEmpty() )
00716     {
00717         CStr uppath;
00718         CStr file;
00719
00720         if( SplitPath(altCvs, uppath, file) )
00721         {
00722             mf.newdir(uppath);
00723             mf.newfile(file);
00724         }
00725     }
00726
00727     if( !BrowserGetMultiFiles("Select the cvs client application", mf, true, kSelectExecutable) )
00728         return;
00729
00730     CvsArgs args(false);
00731
00732     const char* dir = (*mf.begin()).add(args);
00733     char* const* argv = args.Argv();
00734
00735     CStr fullpath;
00736     fullpath = dir;
00737
00738     if( !fullpath.endsWith(kPathDelimiter) )
00739         fullpath << kPathDelimiter;
00740
00741     fullpath << argv[0];
00742
00743     m_altCvsEdit.SetWindowText(fullpath);
00744 }
00745
00746 // Command Dialogs options page
00747 IMPLEMENT_DYNCREATE(CGetPrefs_CVSCMD_DIALOGS, CPropertyPage)
00748
00749 CGetPrefs_CVSCMD_DIALOGS::CGetPrefs_CVSCMD_DIALOGS() : CPropertyPage(CGetPrefs_CVSCMD_DIALOGS::IDD), m_didInteract(false)
00750 {
00751     //{{AFX_DATA_INIT(CGetPrefs_CVSCMD_DIALOGS)
00752     m_hideUpdate = gCvsPrefs.HideCommandDlgUpdate() != 0L;
00753     m_hideDiff = gCvsPrefs.HideCommandDlgDiff() != 0L;
00754     m_hideGraph = gCvsPrefs.HideCommandDlgGraph() != 0L;
00755     m_hideLog = gCvsPrefs.HideCommandDlgLog() != 0L;
00756     m_keyForce = gCvsPrefs.HideCommandDlgUseShift() != 0L ? 0 : 1;
00757     m_hideAnnotate = gCvsPrefs.HideCommandDlgAnnotate() != 0L;
00758     m_hideStatus = gCvsPrefs.HideCommandDlgStatus() != 0L;
00759     //}}AFX_DATA_INIT
00760 }
00761
00762 CGetPrefs_CVSCMD_DIALOGS::~CGetPrefs_CVSCMD_DIALOGS()
00763 {
00764 }
00765
00766 void CGetPrefs_CVSCMD_DIALOGS::DoDataExchange(CDataExchange* pDX)
00767 {
00768     m_didInteract = true;
00769
00770     CPropertyPage::DoDataExchange(pDX);
00771     //{{AFX_DATA_MAP(CGetPrefs_CVSCMD_DIALOGS)
00772     DDX_Check(pDX, IDC_CHECKUPDATE, m_hideUpdate);
00773     DDX_Check(pDX, IDC_CHECKDIFF, m_hideDiff);
00774     DDX_Check(pDX, IDC_CHECKGRAPH, m_hideGraph);
00775     DDX_Check(pDX, IDC_CHECKLOG, m_hideLog);
00776     DDX_Radio(pDX, IDC_RADIOSHIFT, m_keyForce);
00777     DDX_Check(pDX, IDC_CHECKANNOTATE, m_hideAnnotate);
00778     DDX_Check(pDX, IDC_CHECKSTATUS, m_hideStatus);
00779     //}}AFX_DATA_MAP
00780 }
00781
00783 void CGetPrefs_CVSCMD_DIALOGS::StoreValues()
00784 {
00785     if( !m_didInteract )
00786         return;
00787
00788     gCvsPrefs.SetHideCommandDlgUpdate(m_hideUpdate ? true : false);
00789     gCvsPrefs.SetHideCommandDlgDiff(m_hideDiff ? true : false);
00790     gCvsPrefs.SetHideCommandDlgGraph(m_hideGraph ? true : false);
00791     gCvsPrefs.SetHideCommandDlgAnnotate(m_hideAnnotate ? true : false);
00792     gCvsPrefs.SetHideCommandDlgLog(m_hideLog ? true : false);
00793     gCvsPrefs.SetHideCommandDlgStatus(m_hideStatus ? true : false);
00794     gCvsPrefs.SetHideCommandDlgUseShift(m_keyForce == 0);
00795 }
00796
00797 BEGIN_MESSAGE_MAP(CGetPrefs_CVSCMD_DIALOGS, CPropertyPage)
00798 //{{AFX_MSG_MAP(CGetPrefs_CVSCMD_DIALOGS)
00799 // NOTE: the ClassWizard will add message map macros here
00800 //}}AFX_MSG_MAP
00801 END_MESSAGE_MAP()
00802
00803 #endif //} WIN32
00804
00805 #if qUnix    //{ Unix-Part
00806 class UCvsPrefs_MAIN : public UWidget
00807 {
00808     UDECLARE_DYNAMIC(UCvsPrefs_MAIN)
00809 public:
00810     UCvsPrefs_MAIN() : UWidget(::UEventGetWidID()) {}
00811     virtual ~UCvsPrefs_MAIN() {}
00812
00813     enum
00814     {
00815         kOK = EV_COMMAND_START, // 0
00816         kCancel,                // 1
00817         kTabGeneral             // 2
00818     };
00819
00820     virtual void DoDataExchange(bool fill);
00821
00822 protected:
00823     ev_msg int OnOK(void);
00824     ev_msg int OnCancel(void);
00825
00826     UDECLARE_MESSAGE_MAP()
00827 };
00828
00829 UIMPLEMENT_DYNAMIC(UCvsPrefs_MAIN, UWidget)
00830
00831 UBEGIN_MESSAGE_MAP(UCvsPrefs_MAIN, UWidget)
00832     ON_UCOMMAND(UCvsPrefs_MAIN::kOK, UCvsPrefs_MAIN::OnOK)
00833     ON_UCOMMAND(UCvsPrefs_MAIN::kCancel, UCvsPrefs_MAIN::OnCancel)
00834 UEND_MESSAGE_MAP()
00835
00836 int UCvsPrefs_MAIN::OnOK(void)
00837 {
00838     EndModal(true);
00839     return 0;
00840 }
00841
00842 int UCvsPrefs_MAIN::OnCancel(void)
00843 {
00844     EndModal(false);
00845     return 0;
00846 }
00847
00848 void UCvsPrefs_MAIN::DoDataExchange(bool fill)
00849 {
00850     if(fill)
00851     {
00852     }
00853     else
00854     {
00855     }
00856 }
00857
00858 class UCvsPrefs_CVSROOT : public UWidget
00859 {
00860     UDECLARE_DYNAMIC(UCvsPrefs_CVSROOT)
00861 public:
00862     UCvsPrefs_CVSROOT();
00863     virtual ~UCvsPrefs_CVSROOT() {}
00864
00865     enum
00866     {
00867         kCvsrootCombo = EV_COMMAND_START,   // 0
00868         kRshRadio,              // 1
00869         kPserverRadio,          // 2
00870         kLocalRadio,            // 3
00871         kSshRadio,              // 4
00872         kKerberosRadio,         // 5
00873         kCvsVersionCombo,       // 6
00874         kCvsConsoleRadio        // 7
00875     };
00876
00877     virtual void DoDataExchange(bool fill);
00878
00879     void StoreValues(void);
00880
00881 protected:
00882     UStr m_cvsroot;
00883     AuthenKind m_kind;
00884     bool m_console;
00885
00886     UDECLARE_MESSAGE_MAP()
00887 };
00888
00889 UIMPLEMENT_DYNAMIC(UCvsPrefs_CVSROOT, UWidget)
00890
00891 UBEGIN_MESSAGE_MAP(UCvsPrefs_CVSROOT, UWidget)
00892 UEND_MESSAGE_MAP()
00893
00894 UCvsPrefs_CVSROOT::UCvsPrefs_CVSROOT() : UWidget(::UEventGetWidID())
00895 {
00896     if(!gCvsPrefs.empty())
00897         m_cvsroot = (const char *)gCvsPrefs;
00898     m_kind    = gAuthen.kind();
00899     m_console = gCvsPrefs.CvsConsole();
00900 }
00901
00902 void UCvsPrefs_CVSROOT::StoreValues(void)
00903 {
00904     gCvsPrefs = m_cvsroot;
00905     gAuthen.setkind(m_kind);
00906     gCvsPrefs.SetCvsConsole(m_console != 0);
00907 }
00908
00909 void UCvsPrefs_CVSROOT::DoDataExchange(bool fill)
00910 {
00911     if(fill)
00912     {
00913         UEventSendMessage(GetWidID(), EV_SETTEXT, kCvsrootCombo, (void *)(const char *)m_cvsroot);
00914         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCvsrootCombo, 0L);
00915         for(int i = 0; i < NUM_CVSROOT; i++)
00916         {
00917             const CPStr & strroot =
00918                 (*(const CvsPrefs *)&gCvsPrefs).get_cvsroot_list(i);
00919             if(!strroot.empty())
00920                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
00921                                   kCvsrootCombo, (void *)(const char *)strroot);
00922         }
00923
00924         int item = kLocalRadio;
00925         switch(m_kind)
00926         {
00927         case local: item = kLocalRadio; break;
00928         case kserver: item = kKerberosRadio; break;
00929         case rhosts: item = kRshRadio; break;
00930         case pserver: item = kPserverRadio; break;
00931         case ssh: item = kSshRadio; break;
00932         case ntserver: break;   // not supported under *nix
00933         case gserver: break;    // not supported under *nix
00934         case server: break;     // not supported under *nix
00935         case sspi: break;       // not supported under *nix
00936         }
00937
00938         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(item, 1), 0L);
00939         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCvsConsoleRadio, m_console), 0L);
00940     }
00941     else
00942     {
00943         UEventSendMessage(GetWidID(), EV_GETTEXT, kCvsrootCombo, &m_cvsroot);
00944
00945         m_kind = local;
00946         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kLocalRadio, 0L))
00947             m_kind = local;
00948         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kKerberosRadio, 0L))
00949             m_kind = kserver;
00950         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRshRadio, 0L))
00951             m_kind = rhosts;
00952         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kPserverRadio, 0L))
00953             m_kind = pserver;
00954         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kSshRadio, 0L))
00955             m_kind = ssh;
00956
00957         m_console = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCvsConsoleRadio, 0L) != 0;
00958     }
00959 }
00960
00961 class UCvsPrefs_GLOBALS : public UWidget
00962 {
00963     UDECLARE_DYNAMIC(UCvsPrefs_GLOBALS)
00964 public:
00965     UCvsPrefs_GLOBALS();
00966     virtual ~UCvsPrefs_GLOBALS() {}
00967
00968     enum
00969     {
00970         kcheckoutro = EV_COMMAND_START, // 0
00971         kdirty,                 // 1
00972         ktcpip,                 // 2
00973         kprune,                 // 3
00974         kquiet,                 // 4
00975         kcntladd,               // 5
00976         kzlevel                 // 6
00977     };
00978
00979     virtual void DoDataExchange(bool fill);
00980
00981     void StoreValues(void);
00982     int  OnTcpip(void);
00983
00984 protected:
00985     bool m_checkoutro;
00986     bool m_dirty;
00987     bool m_tcpip;
00988     bool m_prune;
00989     bool m_quiet;
00990     bool m_cntladd;
00991     int  m_zlevel;
00992
00993     UDECLARE_MESSAGE_MAP()
00994 };
00995
00996 UIMPLEMENT_DYNAMIC(UCvsPrefs_GLOBALS, UWidget)
00997
00998 UBEGIN_MESSAGE_MAP(UCvsPrefs_GLOBALS, UWidget)
00999     ON_UCOMMAND(UCvsPrefs_GLOBALS::ktcpip, UCvsPrefs_GLOBALS::OnTcpip)
01000 UEND_MESSAGE_MAP()
01001
01002 UCvsPrefs_GLOBALS::UCvsPrefs_GLOBALS() : UWidget(::UEventGetWidID())
01003 {
01004     m_checkoutro = gCvsPrefs.CheckoutRO();
01005     m_prune      = gCvsPrefs.PruneOption();
01006     m_tcpip      = gCvsPrefs.Z9Option();
01007     m_quiet      = gCvsPrefs.QuietOption();
01008     m_cntladd    = gCvsPrefs.AddControl();
01009     m_dirty      = gCvsPrefs.DirtySupport();
01010     m_zlevel     = gCvsPrefs.ZLevel();
01011 }
01012
01013 void UCvsPrefs_GLOBALS::StoreValues(void)
01014 {
01015     gCvsPrefs.SetCheckoutRO(m_checkoutro);
01016     gCvsPrefs.SetPruneOption(m_prune);
01017     gCvsPrefs.SetZ9Option(m_tcpip);
01018     gCvsPrefs.SetQuietOption(m_quiet);
01019     gCvsPrefs.SetAddControl(m_cntladd);
01020     gCvsPrefs.SetDirtySupport(m_dirty);
01021     gCvsPrefs.SetZLevel(m_zlevel);
01022 }
01023
01024 void UCvsPrefs_GLOBALS::DoDataExchange(bool fill)
01025 {
01026     if(fill)
01027     {
01028         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckoutro, m_checkoutro), 0L);
01029         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kprune,      m_prune),      0L);
01030         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(ktcpip,      m_tcpip),      0L);
01031         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kquiet,      m_quiet),      0L);
01032         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcntladd,    m_cntladd),    0L);
01033         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kdirty,      m_dirty),      0L);
01034         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kzlevel,     m_zlevel),     0L);
01035     }
01036     else
01037     {
01038         m_checkoutro = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckoutro, 0L) != 0;
01039         m_prune      = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kprune,      0L) != 0;
01040         m_tcpip      = UEventSendMessage(GetWidID(), EV_QUERYSTATE, ktcpip,      0L) != 0;
01041         m_quiet      = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kquiet,      0L) != 0;
01042         m_cntladd    = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcntladd,    0L) != 0;
01043         m_dirty      = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kdirty,      0L) != 0;
01044         m_zlevel     = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kzlevel,     0L);
01045     }
01046 }
01047
01048
01049 int UCvsPrefs_GLOBALS::OnTcpip(void)
01050 {
01051     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, ktcpip, 0L);
01052     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kzlevel, state), 0L);
01053     return 0;
01054 }
01055
01056 class UCvsPrefs_PORTS : public UWidget
01057 {
01058     UDECLARE_DYNAMIC(UCvsPrefs_PORTS)
01059 public:
01060     UCvsPrefs_PORTS();
01061     virtual ~UCvsPrefs_PORTS() {}
01062
01063     enum
01064     {
01065         kcheckrhost = EV_COMMAND_START, // 0
01066         kcheckpserver,          // 1
01067         kcheckkserver,          // 2
01068         kchecksname,            // 3
01069         kcheckrsh,              // 4
01070
01071         kportrhost,             // 5
01072         kportpserver,           // 6
01073         kportkserver,           // 7
01074
01075         ksname,                 // 8
01076         krshname                // 9
01077     };
01078
01079     virtual void DoDataExchange(bool fill);
01080
01081     void StoreValues(void);
01082
01083 protected:
01084     bool m_checkrhost;
01085     bool m_checkpserver;
01086     bool m_checkkserver;
01087     bool m_checksname;
01088     bool m_checkrsh;
01089     int m_portrhost;
01090     int m_portpserver;
01091     int m_portkserver;
01092     UStr m_sname;
01093     UStr m_rshname;
01094
01095     ev_msg int OnCheckPorts(int cmd);
01096
01097     UDECLARE_MESSAGE_MAP()
01098 };
01099
01100 UIMPLEMENT_DYNAMIC(UCvsPrefs_PORTS, UWidget)
01101
01102 UBEGIN_MESSAGE_MAP(UCvsPrefs_PORTS, UWidget)
01103     ON_UCOMMAND_RANGE(UCvsPrefs_PORTS::kcheckrhost, UCvsPrefs_PORTS::kcheckrsh, UCvsPrefs_PORTS::OnCheckPorts)
01104 UEND_MESSAGE_MAP()
01105
01106 UCvsPrefs_PORTS::UCvsPrefs_PORTS() : UWidget(::UEventGetWidID())
01107 {
01108     m_checkkserver = gCvsPrefs.KserverPort() != -1;
01109     m_checkpserver = gCvsPrefs.PserverPort() != -1;
01110     m_checkrhost = gCvsPrefs.RhostPort() != -1;
01111     m_checksname = gCvsPrefs.ServerName() != 0L;
01112     m_checkrsh = gCvsPrefs.RshName() != 0L;
01113
01114     m_portkserver = gCvsPrefs.KserverPort() != -1 ? gCvsPrefs.KserverPort() : 0;
01115     m_portpserver = gCvsPrefs.PserverPort() != -1 ? gCvsPrefs.PserverPort() : 0;
01116     m_portrhost = gCvsPrefs.RhostPort() != -1 ? gCvsPrefs.RhostPort() : 0;
01117     m_sname = gCvsPrefs.ServerName() == 0L ? "cvs" : gCvsPrefs.ServerName();
01118     m_rshname = gCvsPrefs.RshName() == 0L ? "ssh" : gCvsPrefs.RshName();
01119 }
01120
01121 void UCvsPrefs_PORTS::StoreValues(void)
01122 {
01123     gCvsPrefs.SetKserverPort(m_checkkserver ? m_portkserver : -1);
01124     gCvsPrefs.SetPserverPort(m_checkpserver ? m_portpserver : -1);
01125     gCvsPrefs.SetRhostPort(m_checkrhost ? m_portrhost : -1);
01126
01127     gCvsPrefs.SetServerName(m_checksname ? (const char *)m_sname : 0L);
01128     gCvsPrefs.SetRshName(m_checkrsh ? (const char *)m_rshname : 0L);
01129 }
01130
01131 int UCvsPrefs_PORTS::OnCheckPorts(int cmd)
01132 {
01133     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
01134     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + (kportrhost-kcheckrhost), state), 0L);
01135
01136     if( cmd == kcheckrhost ) {
01137         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kchecksname, state), 0L);
01138         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcheckrsh, state), 0L);
01139     }
01140
01141     return 0;
01142 }
01143
01144 void UCvsPrefs_PORTS::DoDataExchange(bool fill)
01145 {
01146     if(fill)
01147     {
01148         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckkserver, m_checkkserver), 0L);
01149         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckpserver, m_checkpserver), 0L);
01150         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckrhost, m_checkrhost), 0L);
01151         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kchecksname, m_checksname), 0L);
01152         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kcheckrsh, m_checkrsh), 0L);
01153
01154         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportkserver, m_portkserver), 0L);
01155         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportpserver, m_portpserver), 0L);
01156         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kportrhost, m_portrhost), 0L);
01157         UEventSendMessage(GetWidID(), EV_SETTEXT, ksname, (void *)(const char *)m_sname);
01158         UEventSendMessage(GetWidID(), EV_SETTEXT, krshname, (void *)(const char *)m_rshname);
01159
01160         OnCheckPorts(kcheckrhost);
01161         OnCheckPorts(kcheckpserver);
01162         OnCheckPorts(kcheckkserver);
01163         OnCheckPorts(kchecksname);
01164         OnCheckPorts(kcheckrsh);
01165     }
01166     else
01167     {
01168         m_checkkserver = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckkserver, 0L) != 0;
01169         m_portkserver = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportkserver, 0L);
01170         m_checkpserver = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckpserver, 0L) != 0;
01171         m_portpserver = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportpserver, 0L);
01172         m_checkrhost = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckrhost, 0L) != 0;
01173         m_portrhost = UEventSendMessage(GetWidID(), EV_GETINTEGER, kportrhost, 0L);
01174
01175         UEventSendMessage(GetWidID(), EV_GETTEXT, ksname, &m_sname);
01176         m_checksname = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kchecksname, 0L) != 0;
01177         UEventSendMessage(GetWidID(), EV_GETTEXT, krshname, &m_rshname);
01178         m_checkrsh = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kcheckrsh, 0L) != 0;
01179     }
01180 }
01181
01182 class UCvsPrefs_PROXY : public UWidget
01183 {
01184     UDECLARE_DYNAMIC(UCvsPrefs_PROXY)
01185 public:
01186     UCvsPrefs_PROXY();
01187     virtual ~UCvsPrefs_PROXY() {}
01188
01189     enum
01190     {
01191         kuseproxy = EV_COMMAND_START,   // 0
01192         kproxyhost,             // 1
01193         kproxyport              // 2
01194     };
01195
01196     virtual void DoDataExchange(bool fill);
01197
01198     void StoreValues(void);
01199
01200 protected:
01201     bool m_useproxy;
01202     UStr m_proxyhost;
01203     int m_proxyport;
01204
01205     ev_msg int OnUseProxy(void);
01206
01207     UDECLARE_MESSAGE_MAP()
01208 };
01209
01210 UIMPLEMENT_DYNAMIC(UCvsPrefs_PROXY, UWidget)
01211
01212 UBEGIN_MESSAGE_MAP(UCvsPrefs_PROXY, UWidget)
01213     ON_UCOMMAND(UCvsPrefs_PROXY::kuseproxy, UCvsPrefs_PROXY::OnUseProxy)
01214 UEND_MESSAGE_MAP()
01215
01216 UCvsPrefs_PROXY::UCvsPrefs_PROXY() : UWidget(::UEventGetWidID())
01217 {
01218     m_useproxy = gCvsPrefs.UseProxy();
01219     m_proxyport = gCvsPrefs.ProxyPort();
01220     m_proxyhost = gCvsPrefs.ProxyHost();
01221 }
01222
01223 void UCvsPrefs_PROXY::StoreValues(void)
01224 {
01225     gCvsPrefs.SetUseProxy(m_useproxy);
01226     gCvsPrefs.SetProxyHost(m_proxyhost);
01227     gCvsPrefs.SetProxyPort(m_proxyport);
01228 }
01229
01230 int UCvsPrefs_PROXY::OnUseProxy(void)
01231 {
01232     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseproxy, 0L);
01233     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kproxyhost, state), 0L);
01234     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kproxyport, state), 0L);
01235     return 0;
01236 }
01237
01238 void UCvsPrefs_PROXY::DoDataExchange(bool fill)
01239 {
01240     if(fill)
01241     {
01242         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kuseproxy, m_useproxy), 0L);
01243         UEventSendMessage(GetWidID(), EV_SETINTEGER, UMAKEINT(kproxyport, m_proxyport), 0L);
01244         UEventSendMessage(GetWidID(), EV_SETTEXT, kproxyhost, (void *)(const char *)m_proxyhost);
01245
01246         OnUseProxy();
01247     }
01248     else
01249     {
01250         CStr str;
01251         m_useproxy = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseproxy, 0L) != 0;
01252         UEventSendMessage(GetWidID(), EV_GETTEXT, kproxyhost, &m_proxyhost);
01253         m_proxyport = UEventSendMessage(GetWidID(), EV_GETINTEGER, kproxyport, 0L);
01254     }
01255 }
01256
01257 class UCvsPrefs_GCVS : public UWidget
01258 {
01259     UDECLARE_DYNAMIC(UCvsPrefs_GCVS)
01260 public:
01261     UCvsPrefs_GCVS();
01262     virtual ~UCvsPrefs_GCVS() {}
01263
01264     enum
01265     {
01266         // program paths
01267         kdiffApp = EV_COMMAND_START,  // 0
01268         kviewerApp,                   // 1
01269         kbrowserApp,                  // 2
01270         khelpApp,                     // 3
01271         kcvsApp,                      // 4
01272
01273         // browse button
01274         kdiffBtn,                     // 5
01275         kviewerBtn,                   // 6
01276         kbrowserBtn,                  // 7
01277         khelpBtn,                     // 8
01278         kcvsBtn,                      // 9
01279
01280         kuseAltCvs                    // 10
01281     };
01282
01283     virtual void DoDataExchange(bool fill);
01284
01285     void StoreValues(void);
01286
01287 protected:
01288     UStr m_diffApp;
01289     UStr m_viewerApp;
01290     UStr m_browserApp;
01291     UStr m_helpApp;
01292     bool m_useAltCvs;
01293     UStr m_cvsApp;
01294
01295     ev_msg int OnPickProgram(int cmd);
01296     ev_msg int OnUseAlternateCvs(void);
01297
01298     bool checkCVS(const char* filename);
01299
01300     UDECLARE_MESSAGE_MAP()
01301 };
01302
01303 UIMPLEMENT_DYNAMIC(UCvsPrefs_GCVS, UWidget)
01304
01305 UBEGIN_MESSAGE_MAP(UCvsPrefs_GCVS, UWidget)
01306     ON_UCOMMAND_RANGE(UCvsPrefs_GCVS::kdiffBtn, UCvsPrefs_GCVS::kcvsBtn, UCvsPrefs_GCVS::OnPickProgram)
01307     ON_UCOMMAND(UCvsPrefs_GCVS::kuseAltCvs, UCvsPrefs_GCVS::OnUseAlternateCvs)
01308 UEND_MESSAGE_MAP()
01309
01310 UCvsPrefs_GCVS::UCvsPrefs_GCVS() : UWidget(::UEventGetWidID())
01311 {
01312     UStr cvsPath;
01313     m_diffApp    = gCvsPrefs.ExtDiff();
01314     m_viewerApp  = gCvsPrefs.Viewer();
01315     m_browserApp = gCvsPrefs.Browser();
01316     m_helpApp    = gCvsPrefs.Helper();
01317     m_useAltCvs  = gCvsPrefs.UseAltCvs();
01318     m_cvsApp     = gCvsPrefs.WhichCvs(cvsPath);
01319 }
01320
01321
01322 bool UCvsPrefs_GCVS::checkCVS(const char *filename)
01323 {
01324     CvsArgs args;
01325     int status;
01326
01327     cvs_out("checking cvs\n");
01328
01329     args.add("-v");
01330
01331     status = testCVS(filename, args.Argc(), args.Argv());
01332     switch( status ) {
01333         case 0:
01334             break; // all OK
01335         case errNoCvsguiProtocol:
01336             cvs_err( "actual cvs binary has no support for GUI-pipes.\n");
01337             cvs_err( "Please select another binary and check the 'alternate cvs' settings!\n\n");
01338             break;
01339         default:
01340             break;
01341     }
01342
01343     return ( status == 0 ? true : false );
01344 }
01345 void UCvsPrefs_GCVS::StoreValues(void)
01346 {
01347     gCvsPrefs.SetExtDiff(m_diffApp);
01348     gCvsPrefs.SetViewer(m_viewerApp);
01349     gCvsPrefs.SetBrowser(m_browserApp);
01350     gCvsPrefs.SetHelper(m_helpApp);
01351     gCvsPrefs.SetUseAltCvs(m_useAltCvs);
01352
01353 #ifdef qUnix
01354     // use selected cvs only if it supports '-cvsgui'
01355     if( m_useAltCvs ) {
01356         if( checkCVS( m_cvsApp ) ) {
01357             gCvsPrefs.SetWhichCvs( m_cvsApp );
01358         }
01359     } else {
01360         CStr cvscmd;
01361
01362         // check if actual cvs binary supports cvsgui protocol
01363         checkCVS( gCvsPrefs.WhichCvs(cvscmd, m_useAltCvs) );
01364     }
01365 #else
01366     gCvsPrefs.SetWhichCvs(m_cvsApp);
01367 #endif
01368 }
01369
01370 int UCvsPrefs_GCVS::OnPickProgram(int cmd)
01371 {
01372     UStr appPath;
01373     UEventSendMessage(GetWidID(), EV_GETTEXT, cmd - kdiffBtn + kdiffApp, &appPath);
01374
01375     MultiFiles mf;
01376     if( !appPath.empty() )
01377     {
01378         CStr uppath;
01379         CStr file;
01380
01381         if( SplitPath(appPath, uppath, file) )
01382         {
01383             mf.newdir(uppath);
01384             mf.newfile(file);
01385         }
01386     }
01387
01388     if( !BrowserGetMultiFiles("Select the application", mf, true, kSelectExecutable) )
01389         return 0;
01390
01391     CvsArgs args(false);
01392     const char* dir = (*mf.begin()).add(args);
01393     char* const* argv = args.Argv();
01394     CStr fullpath;
01395     fullpath = dir;
01396     if( !fullpath.endsWith(kPathDelimiter) )
01397         fullpath << kPathDelimiter;
01398
01399     fullpath << argv[0];
01400
01401 #ifdef qUnix
01402     // use selected cvs only if it supports '-cvsgui'
01403     if( ( cmd == kcvsBtn ) && !checkCVS( fullpath.c_str() ) )
01404         return 0;
01405 #endif
01406
01407     UEventSendMessage(GetWidID(), EV_SETTEXT, cmd - kdiffBtn + kdiffApp, (void*)(const char*)fullpath);
01408
01409     return 0;
01410 }
01411
01412 int UCvsPrefs_GCVS::OnUseAlternateCvs(void)
01413 {
01414     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseAltCvs, 0L);
01415     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcvsApp, state), 0L);
01416     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kcvsBtn, state), 0L);
01417     return 0;
01418 }
01419
01420 void UCvsPrefs_GCVS::DoDataExchange(bool fill)
01421 {
01422     if(fill)
01423     {
01424         UEventSendMessage(GetWidID(), EV_SETTEXT, kdiffApp, (void *)(const char *)m_diffApp);
01425         UEventSendMessage(GetWidID(), EV_SETTEXT, kviewerApp, (void *)(const char *)m_viewerApp);
01426         UEventSendMessage(GetWidID(), EV_SETTEXT, kbrowserApp, (void *)(const char *)m_browserApp);
01427         UEventSendMessage(GetWidID(), EV_SETTEXT, khelpApp, (void *)(const char *)m_helpApp);
01428         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kuseAltCvs, m_useAltCvs), 0L);
01429         UEventSendMessage(GetWidID(), EV_SETTEXT, kcvsApp, (void *)(const char *)m_cvsApp);
01430         OnUseAlternateCvs();
01431     }
01432     else
01433     {
01434         UEventSendMessage(GetWidID(), EV_GETTEXT, kdiffApp, &m_diffApp);
01435         UEventSendMessage(GetWidID(), EV_GETTEXT, kviewerApp, &m_viewerApp);
01436         UEventSendMessage(GetWidID(), EV_GETTEXT, kbrowserApp, &m_browserApp);
01437         UEventSendMessage(GetWidID(), EV_GETTEXT, khelpApp, &m_helpApp);
01438         m_useAltCvs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kuseAltCvs, 0L) != 0;
01439         UEventSendMessage(GetWidID(), EV_GETTEXT, kcvsApp, &m_cvsApp);
01440     }
01441 }
01442
01443 #endif //} qUnix
01444
01445 #if qMacCvsPP   //{ Mac-Part
01446
01447 class UCvsPrefs_CVSROOT : public UWidget
01448 {
01449     UDECLARE_DYNAMIC(UCvsPrefs_CVSROOT)
01450 public:
01451     UCvsPrefs_CVSROOT();
01452     virtual ~UCvsPrefs_CVSROOT() {}
01453
01454     enum
01455     {
01456         kAuthenPopup = EV_COMMAND_START + 40,   // 40
01457         kPath,              // 41
01458         kHost,              // 42
01459         kUser,              // 43
01460         kRootPopup,         // 44
01461         kRootStat,          // 45
01462         kCvsVers,           // 46
01463         kAuthenSettings,    // 47
01464         kAuthenDesc         // 48
01465     };
01466
01467     virtual void DoDataExchange(bool fill);
01468
01469 protected:
01470     UStr m_cvsroot;
01471     AuthenKind m_kind;
01472
01473     ev_msg void OnAuthenPopup(int pos, const char *txt);
01474     ev_msg void OnRootPopup(int pos, const char *txt);
01475     ev_msg void OnEditChange(int cmd);
01476     ev_msg int OnAuthenSettings(void);
01477     ev_msg void OnDestroy(void);
01478
01479     UDECLARE_MESSAGE_MAP()
01480 };
01481
01482 UIMPLEMENT_DYNAMIC(UCvsPrefs_CVSROOT, UWidget)
01483
01484 UBEGIN_MESSAGE_MAP(UCvsPrefs_CVSROOT, UWidget)
01485     ON_COMBO_SEL(kAuthenPopup, UCvsPrefs_CVSROOT::OnAuthenPopup)
01486     ON_COMBO_SEL(kRootPopup, UCvsPrefs_CVSROOT::OnRootPopup)
01487     ON_EDITCHANGE_RANGE(kPath, kUser, UCvsPrefs_CVSROOT::OnEditChange)
01488     ON_UCOMMAND(kAuthenSettings, UCvsPrefs_CVSROOT::OnAuthenSettings)
01489     ON_UDESTROY(UCvsPrefs_CVSROOT)
01490 UEND_MESSAGE_MAP()
01491
01492 UCvsPrefs_CVSROOT::UCvsPrefs_CVSROOT() : UWidget(::UEventGetWidID())
01493 {
01494 }
01495
01496 void UCvsPrefs_CVSROOT::OnAuthenPopup(int pos, const char *txt)
01497 {
01498     m_kind = Authen::numToKind(pos);
01499     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01500     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kHost, model->HasHost()), 0L);
01501     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kUser, model->HasUser()), 0L);
01502     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kAuthenSettings, model->HasSettings()), 0L);
01503
01504     if(!model->HasHost())
01505         UEventSendMessage(GetWidID(), EV_SETTEXT, kHost, (void *)"");
01506     if(!model->HasUser())
01507         UEventSendMessage(GetWidID(), EV_SETTEXT, kUser, (void *)"");
01508     UStr desc;
01509     model->GetSettingsDesc(desc);
01510     UEventSendMessage(GetWidID(), EV_SETTEXT, kAuthenDesc, (void *)(const char *)desc);
01511 }
01512
01513 void UCvsPrefs_CVSROOT::OnRootPopup(int pos, const char *txt)
01514 {
01515     m_cvsroot = txt;
01516     UEventSendMessage(GetWidID(), EV_SETTEXT, kRootStat, (void *)txt);
01517
01518     UStr theMethod, theUser, theHost, thePath;
01519
01520     if(Authen::parse_cvsroot(txt, theMethod, theUser, theHost, thePath))
01521     {
01522         UEventSendMessage(GetWidID(), EV_SETTEXT, kPath, (void *)(const char *)thePath);
01523         UEventSendMessage(GetWidID(), EV_SETTEXT, kHost, (void *)(const char *)theHost);
01524         UEventSendMessage(GetWidID(), EV_SETTEXT, kUser, (void *)(const char *)theUser);
01525         if (theMethod.length () > 0)
01526             UEventSendMessage(GetWidID(), EV_COMBO_SETSEL,
01527                               UMAKEINT(kAuthenPopup, Authen::kindToNum(Authen::tokenToKind (theMethod.c_str ()))), 0L);
01528     }
01529 }
01530
01531 void UCvsPrefs_CVSROOT::OnEditChange(int cmd)
01532 {
01533     UStr theUser, theHost, thePath;
01534
01535     UEventSendMessage(GetWidID(), EV_GETTEXT, kPath, &thePath);
01536     UEventSendMessage(GetWidID(), EV_GETTEXT, kHost, &theHost);
01537     UEventSendMessage(GetWidID(), EV_GETTEXT, kUser, &theUser);
01538
01539     m_cvsroot = "";
01540     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01541     if(model->HasUser())
01542         m_cvsroot << theUser;
01543     if(model->HasHost())
01544     {
01545         m_cvsroot << '@';
01546         m_cvsroot << theHost;
01547     }
01548     if(model->HasUser() || model->HasHost())
01549         m_cvsroot << ':';
01550     m_cvsroot << thePath;
01551     UEventSendMessage(GetWidID(), EV_SETTEXT, kRootStat, (void *)(const char *)m_cvsroot);
01552 }
01553
01554 int UCvsPrefs_CVSROOT::OnAuthenSettings(void)
01555 {
01556     AuthenModel *model = AuthenModel::GetInstance(m_kind);
01557     model->DoSettings();
01558     UStr desc;
01559     model->GetSettingsDesc(desc);
01560     UEventSendMessage(GetWidID(), EV_SETTEXT, kAuthenDesc, (void *)(const char *)desc);
01561     return 0;
01562 }
01563
01564 void UCvsPrefs_CVSROOT::OnDestroy(void)
01565 {
01566     delete this;
01567 }
01568
01569 void UCvsPrefs_CVSROOT::DoDataExchange(bool fill)
01570 {
01571     if(fill)
01572     {
01573         if(!gCvsPrefs.empty())
01574             m_cvsroot = (const char *)gCvsPrefs;
01575         m_kind = gAuthen.kind();
01576
01577         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kAuthenPopup, 0L);
01578         std::vector<AuthenModel *> & allAuthen = AuthenModel::GetAllInstances();
01579         std::vector<AuthenModel *>::iterator i;
01580         for(i = allAuthen.begin(); i != allAuthen.end(); ++i)
01581         {
01582             UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01583                               kAuthenPopup, (void *)(*i)->GetToken());
01584         }
01585
01586         AuthenModel *model = AuthenModel::GetInstance(m_kind);
01587         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL,
01588                           UMAKEINT(kAuthenPopup, Authen::kindToNum(model->GetKind())), 0L);
01589
01590         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRootPopup, 0L);
01591 #ifndef MIGRATECVSROOTLIST
01592         for(int i = 0; i < NUM_CVSROOT; i++)
01593         {
01594             const CPStr & strroot =
01595                 (*(const CvsPrefs *)&gCvsPrefs).get_cvsroot_list(i);
01596             if(!strroot.empty())
01597                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01598                                   kRootPopup, (void *)(const char *)strroot);
01599         }
01600 #else
01601         std::vector<CStr>::const_iterator haley;
01602         const std::vector<CStr> & alex = gOldCvsroots.GetList();
01603         for(haley = alex.begin(); haley != alex.end(); ++haley)
01604         {
01605             if(!(*haley).empty())
01606                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND,
01607                                   kRootPopup, (void *)(*haley).c_str());
01608         }
01609 #endif
01610
01611         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCvsVers, 1), 0L);
01612
01613         UStr tmp(m_cvsroot);
01614         OnRootPopup(0, tmp);
01615         OnAuthenPopup(Authen::kindToNum(m_kind), 0L);
01616
01617         UEventSendMessage(GetWidID(), EV_CHGFOCUS, kPath, 0L);
01618     }
01619     else
01620     {
01621         gAuthen.setkind(m_kind);
01622
01623         UStr theUser, theHost, thePath;
01624
01625         UEventSendMessage(GetWidID(), EV_GETTEXT, kPath, &thePath);
01626         UEventSendMessage(GetWidID(), EV_GETTEXT, kHost, &theHost);
01627         UEventSendMessage(GetWidID(), EV_GETTEXT, kUser, &theUser);
01628
01629         UStr root;
01630         if(m_kind != local)
01631         {
01632             root << theUser;
01633             root << '@';
01634             root << theHost;
01635             root << ':';
01636             root << thePath;
01637         }
01638         else
01639             root = thePath;
01640
01641         gCvsPrefs = root;
01642
01643 #ifdef MIGRATECVSROOTLIST
01644         if( !root.empty() )
01645             gOldCvsroots.Insert(root);
01646 #endif
01647     }
01648 }
01649
01650 static void DoDataExchange_Cvsroot(UCvsPrefs_CVSROOT *handler, bool putValue)
01651 {
01652     handler->DoDataExchange(putValue);
01653 }
01654 #endif //} qMacCvsPP
01655
01657 void CompatGetPrefs(void)
01658 {
01659     bool userHitOK = false;
01660
01661     // Store current CVSROOT
01662     const UStr prevCvsroot((const char*)gCvsPrefs);
01663     const AuthenKind prevKind = gAuthen.kind();
01664
01665 #ifdef WIN32   //{ WIN32
01666     CPropertySheet pages("WinCvs Preferences");
01667     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01668
01669     CGetPrefs_CVSROOT page1;
01670     CGetPrefs_GLOBALS page2;
01671     CGetPrefs_CVS page3;
01672     CGetPrefs_WINCVS page4;
01673     CGetPrefs_CVSCMD_DIALOGS page5;
01674
01675     pages.AddPage(&page1);
01676     pages.AddPage(&page2);
01677     pages.AddPage(&page3);
01678     pages.AddPage(&page4);
01679     pages.AddPage(&page5);
01680
01681     if( pages.DoModal() == IDOK )
01682     {
01683         page1.StoreValues();
01684         page2.StoreValues();
01685         page3.StoreValues();
01686         page4.StoreValues();
01687         page5.StoreValues();
01688         userHitOK = true;
01689     }
01690 #endif //} WIN32
01691
01692 #ifdef qMacCvsPP  //{ qMacCvsPP
01693     MacBinMaps maps;
01694     maps.LoadDefaults();
01695     CMacBinTable::SetCurrentMap(&maps);
01696
01697     StDialogHandler theHandler(dlg_Prefs, LCommander::GetTopCommander());
01698     LWindow *theDialog = theHandler.GetDialog();
01699     ThrowIfNil_(theDialog);
01700     static UInt16 sRuntimePanel = 1;
01701
01702     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01703         (theDialog->FindPaneByID(item_MultiViewPrefs));
01704     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01705
01706     UCvsPrefs_CVSROOT *handler = new UCvsPrefs_CVSROOT;
01707     ThrowIfNil_(handler);
01708
01709     UEventSendMessage(handler->GetWidID(), EV_INIT_WIDGET, 0, theDialog);
01710
01711     multiView->SwitchToPanel(5);
01712     DoDataExchange_Fonts(theDialog, true);
01713     multiView->SwitchToPanel(4);
01714     DoDataExchange_BinFiles(theDialog, maps, true);
01715     multiView->SwitchToPanel(3);
01716     DoDataExchange_TextFiles(theDialog, true);
01717     LPushButton *diffbtn = dynamic_cast<LPushButton*>(theDialog->FindPaneByID(item_BrowseExtDiff));
01718     diffbtn->AddListener(&theHandler);
01719     multiView->SwitchToPanel(2);
01720     DoDataExchange_Globals(theDialog, true);
01721     multiView->SwitchToPanel(1);
01722     DoDataExchange_Cvsroot(handler, true);
01723
01724     groupView->SetValue(sRuntimePanel);
01725     theDialog->Show();
01726     MessageT hitMessage;
01727     SInt32    lastDiffToolValue(0);
01728     while (true)
01729     {       // Let DialogHandler process events
01730         hitMessage = theHandler.DoDialog();
01731
01732         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01733             break;
01734
01735         if (hitMessage == item_BrowseExtDiff)
01736         {
01737             MultiFiles mf;
01738             if( BrowserGetMultiFiles("Select the external diff application", mf, true, kSelectExecutable) )
01739             {
01740                 CvsArgs args(false);
01741                 const char *dir = (*mf.begin()).add(args);
01742                 char * const *argv = args.Argv();
01743                 UStr fullpath;
01744                 fullpath = dir;
01745                 if(!fullpath.endsWith(kPathDelimiter))
01746                     fullpath << kPathDelimiter;
01747                 fullpath << argv[0];
01748
01749                 LEditText *editdiff = dynamic_cast<LEditText*>
01750                     (theDialog->FindPaneByID(item_EditExtDiff));
01751                 editdiff->SetText(LStr255(fullpath.c_str()));
01752             }
01753         }
01754         else if ( hitMessage == /*item_UseExtDiff*/0 /*popup group box doesn't send value message?*/ )
01755         {
01756           LPane*  useExtDiff = theDialog->FindPaneByID(item_UseExtDiff);
01757         if ( useExtDiff  &&  useExtDiff->GetValue() != lastDiffToolValue )
01758         {
01759           lastDiffToolValue = useExtDiff->GetValue();
01760         LPane*  editField = theDialog->FindPaneByID(item_EditExtDiff);
01761         LPane*  button = theDialog->FindPaneByID(item_BrowseExtDiff);
01762           if ( lastDiffToolValue != 4 ) // %%% should better not check by item position!
01763           {
01764             if ( editField ) editField->Disable();
01765             if ( button ) button->Disable();
01766           }
01767           else
01768           {
01769             if ( editField ) editField->Enable();
01770             if ( button ) button->Enable();
01771           }
01772       }
01773         }
01774     }
01775     theDialog->Hide();
01776     sRuntimePanel = groupView->GetValue();
01777
01778     if(hitMessage == msg_OK)
01779     {
01780         userHitOK = true;
01781
01782         multiView->SwitchToPanel(1);
01783         DoDataExchange_Cvsroot(handler, false);
01784         multiView->SwitchToPanel(2);
01785         DoDataExchange_Globals(theDialog, false);
01786         multiView->SwitchToPanel(3);
01787         DoDataExchange_TextFiles(theDialog, false);
01788         multiView->SwitchToPanel(4);
01789         DoDataExchange_BinFiles(theDialog, maps, false);
01790         multiView->SwitchToPanel(5);
01791         DoDataExchange_Fonts(theDialog, false);
01792
01793         maps.SaveDefaults();
01794     }
01795 #endif //} qMacCvsPP
01796
01797 #if qUnix  //{ Unix-Part
01798     void *wid = UCreate_gcvs_Settings();
01799
01800     UCvsPrefs_MAIN *dlg = new UCvsPrefs_MAIN();
01801     UCvsPrefs_CVSROOT *tab1 = new UCvsPrefs_CVSROOT();
01802     UCvsPrefs_GLOBALS *tab2 = new UCvsPrefs_GLOBALS();
01803     UCvsPrefs_PORTS *tab3 = new UCvsPrefs_PORTS();
01804     UCvsPrefs_PROXY *tab4 = new UCvsPrefs_PROXY();
01805     UCvsPrefs_GCVS *tab5 = new UCvsPrefs_GCVS();
01806     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01807     dlg->AddPage(tab1, UCvsPrefs_MAIN::kTabGeneral, 0);
01808     dlg->AddPage(tab2, UCvsPrefs_MAIN::kTabGeneral, 1);
01809     dlg->AddPage(tab3, UCvsPrefs_MAIN::kTabGeneral, 2);
01810     dlg->AddPage(tab4, UCvsPrefs_MAIN::kTabGeneral, 3);
01811     dlg->AddPage(tab5, UCvsPrefs_MAIN::kTabGeneral, 4);
01812
01813     if(dlg->DoModal())
01814     {
01815         tab1->StoreValues();
01816         tab2->StoreValues();
01817         tab3->StoreValues();
01818         tab4->StoreValues();
01819         tab5->StoreValues();
01820
01821         userHitOK = true;
01822     }
01823     delete dlg;
01824 #endif //} qUnix
01825
01826     if( userHitOK && !gCvsPrefs.empty() )
01827     {
01828         if( prevCvsroot != (const char*)gCvsPrefs || prevKind != gAuthen.kind() )
01829         {
01830             cvs_out("NEW CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01831             cvs_err("CVSROOT change will only take effect when commands are run from a non-CVS folder.\n"
01832                 "To change the CVSROOT of an existing sandbox please use the ChangeRoot macro.\n");
01833         }
01834         else
01835         {
01836             cvs_out("CVSROOT: %s (%s)\n", (const char*)gCvsPrefs, gAuthen.kindstr());
01837         }
01838
01839         gCvsPrefs.save();
01840     }
01841 }
Generated on Fri Jan 31 12:08:39 2003 for WinCvs Source by doxygen 1.3-rc2


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
00036 #ifdef WIN32
00037
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     // Dialog Data
00049     //{{AFX_DATA(CGetPrefs_CVSROOT)
00050     enum { IDD = IDD_PREFS_CVSROOT };
00051     CStatic m_authenDescEdit;
00052     CButton m_settingsButton;
00053     CEdit   m_pathEdit;
00054     CEdit   m_loginEdit;
00055     CEdit   m_hostEdit;
00056     CSmartComboBox  m_versCombo;
00057     CSmartComboBox  m_authenCombo;
00058     CSmartComboBox  m_cvsrootCombo;
00059     CString     m_cvsroot;
00060     int         m_cvsvers;
00061     AuthenKind  m_authen;
00062     CString m_host;
00063     CString m_login;
00064     CString m_path;
00065     BOOL        m_cvsconsole;
00066     //}}AFX_DATA
00067
00068 // Overrides
00069     // ClassWizard generate virtual function overrides
00070     //{{AFX_VIRTUAL(CGetPrefs_CVSROOT)
00071     protected:
00072     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00073     //}}AFX_VIRTUAL
00074
00075 // Implementation
00076 protected:
00077     bool m_didInteract;
00078     bool m_flag;
00080     void FillFields(void);
00081     void OnChangeFields(void);
00082
00083     // Generated message map functions
00084     //{{AFX_MSG(CGetPrefs_CVSROOT)
00085     afx_msg void OnSelchangeAuthen();
00086     afx_msg void OnChangePath();
00087     afx_msg void OnChangeHost();
00088     afx_msg void OnChangeLogin();
00089     afx_msg void OnSettings();
00090     afx_msg void OnSelchangeComboroot();
00091     afx_msg void OnEditchangeComboroot();
00092     //}}AFX_MSG
00093     DECLARE_MESSAGE_MAP()
00094 public:
00095     // Interface
00096     void StoreValues();
00097 };
00098
00100 class CGetPrefs_GLOBALS : public CPropertyPage
00101 {
00102     DECLARE_DYNCREATE(CGetPrefs_GLOBALS)
00103
00104 // Construction
00105 public:
00106     CGetPrefs_GLOBALS();
00107     ~CGetPrefs_GLOBALS();
00108
00109 // Dialog Data
00110     //{{AFX_DATA(CGetPrefs_GLOBALS)
00111     enum { IDD = IDD_PREFS_GLOBALS };
00112     CSpinButtonCtrl m_logoutSpinButton;
00113     CEdit   m_logoutEdit;
00114     CButton m_logoutCheck;
00115     CSpinButtonCtrl m_zspinSpinButton;
00116     CEdit   m_zlevelEdit;
00117     CButton m_tcpipCheck;
00118     BOOL    m_checkoutro;
00119     BOOL    m_prune;
00120     BOOL    m_tcpip;
00121     BOOL    m_quiet;
00122     BOOL    m_cntladd;
00123     BOOL    m_dirty;
00124     BOOL    m_alwaysroot;
00125     BOOL    m_logout;
00126     BOOL    m_unixlf;
00127     UINT    m_zlevel;
00128     BOOL    m_disableSplashScreen;
00129     UINT    m_logoutTime;
00130     //}}AFX_DATA
00131
00132
00133 // Overrides
00134     // ClassWizard generate virtual function overrides
00135     //{{AFX_VIRTUAL(CGetPrefs_GLOBALS)
00136     protected:
00137     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00138     //}}AFX_VIRTUAL
00139
00140 // Implementation
00141 protected:
00142     bool m_didInteract;
00144     // Generated message map functions
00145     //{{AFX_MSG(CGetPrefs_GLOBALS)
00146     afx_msg void OnLogout();
00147     afx_msg void OnCheckunixlf();
00148     afx_msg void OnTcpip();
00149     virtual BOOL OnInitDialog();
00150     //}}AFX_MSG
00151     DECLARE_MESSAGE_MAP()
00152 public:
00153     // Interface
00154     void StoreValues();
00155 };
00156
00158 class CGetPrefs_WINCVS : public CPropertyPage
00159 {
00160     DECLARE_DYNCREATE(CGetPrefs_WINCVS)
00161
00162 // Construction
00163 public:
00164     CGetPrefs_WINCVS();
00165     ~CGetPrefs_WINCVS();
00166
00167 // Dialog Data
00168     //{{AFX_DATA(CGetPrefs_WINCVS)
00169     enum { IDD = IDD_PREFS_WINCVS };
00170     CEdit   m_viewerEdit;
00171     CButton m_extDiffSelButton;
00172     CEdit   m_diffProgEdit;
00173     CButton m_useExtDiffCheck;
00174     CEdit   m_settingsFolderEdit;
00175     CButton m_settingsFolderButton;
00176     CButton m_useSettingsFolderCheck;
00177     CString m_viewer;
00178     BOOL    m_useViewerAlways;
00179     BOOL    m_useExtDiff;
00180     CString m_diffProg;
00181     BOOL    m_useSettingsFolder;
00182     CString m_settingsFolder;
00183     //}}AFX_DATA
00184
00185
00186 // Overrides
00187     // ClassWizard generate virtual function overrides
00188     //{{AFX_VIRTUAL(CGetPrefs_WINCVS)
00189     protected:
00190     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00191     //}}AFX_VIRTUAL
00192
00193 // Implementation
00194 protected:
00195     bool m_didInteract;
00197     // Generated message map functions
00198     //{{AFX_MSG(CGetPrefs_WINCVS)
00199     afx_msg void OnBtnviewer();
00200     afx_msg void OnExtdiffsel();
00201     afx_msg void OnExtdiff();
00202     afx_msg void OnAltsettingschk();
00203     afx_msg void OnBtnsettings();
00204     //}}AFX_MSG
00205     DECLARE_MESSAGE_MAP()
00206 public:
00207     // Interface
00208     void StoreValues();
00209 };
00210
00212 class CGetPrefs_CVS : public CPropertyPage
00213 {
00214     DECLARE_DYNCREATE(CGetPrefs_CVS)
00215
00216 // Construction
00217 public:
00218     CGetPrefs_CVS();
00219     ~CGetPrefs_CVS();
00220
00221 // Dialog Data
00222     //{{AFX_DATA(CGetPrefs_CVS)
00223     enum { IDD = IDD_PREFS_CVS };
00224     CEdit   m_altCvsEdit;
00225     CButton m_selAltCvsButton;
00226     CButton m_useAltCvsCheck;
00227     CEdit   m_homeEdit;
00228     CString m_home;
00229     BOOL    m_useAltCvs;
00230     CString m_altCvs;
00231     //}}AFX_DATA
00232
00233
00234 // Overrides
00235     // ClassWizard generate virtual function overrides
00236     //{{AFX_VIRTUAL(CGetPrefs_CVS)
00237     protected:
00238     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00239     //}}AFX_VIRTUAL
00240
00241 // Implementation
00242 protected:
00243     bool m_didInteract;
00245     // Generated message map functions
00246     //{{AFX_MSG(CGetPrefs_CVS)
00247     afx_msg void OnBtnhome();
00248     afx_msg void OnAltcvschk();
00249     afx_msg void OnAltcvssel();
00250     //}}AFX_MSG
00251     DECLARE_MESSAGE_MAP()
00252 public:
00253     // Interface
00254     void StoreValues();
00255 };
00256
00258 class CGetPrefs_CVSCMD_DIALOGS : public CPropertyPage
00259 {
00260     DECLARE_DYNCREATE(CGetPrefs_CVSCMD_DIALOGS)
00261
00262 // Construction
00263 public:
00264     CGetPrefs_CVSCMD_DIALOGS();
00265     ~CGetPrefs_CVSCMD_DIALOGS();
00266
00267     void StoreValues();
00268
00269 // Dialog Data
00270     //{{AFX_DATA(CGetPrefs_CVSCMD_DIALOGS)
00271     enum { IDD = IDD_PREFS_CVSCMD_DIALOGS };
00272     BOOL    m_hideUpdate;
00273     BOOL    m_hideDiff;
00274     BOOL    m_hideGraph;
00275     BOOL    m_hideLog;
00276     int     m_keyForce;
00277     BOOL    m_hideAnnotate;
00278     BOOL    m_hideStatus;
00279     //}}AFX_DATA
00280
00281
00282 // Overrides
00283     // ClassWizard generate virtual function overrides
00284     //{{AFX_VIRTUAL(CGetPrefs_CVSCMD_DIALOGS)
00285     protected:
00286     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00287     //}}AFX_VIRTUAL
00288
00289 // Implementation
00290 protected:
00291     bool m_didInteract;
00293     // Generated message map functions
00294     //{{AFX_MSG(CGetPrefs_CVSCMD_DIALOGS)
00295         // NOTE: the ClassWizard will add member functions here
00296     //}}AFX_MSG
00297     DECLARE_MESSAGE_MAP()
00298
00299 };
00300
00301 //{{AFX_INSERT_LOCATION}}
00302 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00303
00304 #endif /* WIN32 */
00305
00306 #endif // !defined(AFX_GETPREFS_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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
00088
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 Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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
00113
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 Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
00051 #include "MultiString.h"
00052 #include "PromptFiles.h"
00053 #include "ItemListDlg.h"
00054 #include "CvsCommands.h"
00055
00056 static char *sDefReleases[] =
00057 {
00058     "V10",
00059     "V101",
00060     0L
00061 };
00062
00063 static char *sDefVendors[] =
00064 {
00065     "GNU",
00066     0L
00067 };
00068
00069 static char *sDefModuleNames[] =
00070 {
00071     "Module",
00072     "Project",
00073     0L
00074 };
00075
00076 static CMString gVendorNames(10, "P_VendorNames", sDefVendors);
00077 CMString gReleasesNames(10, "P_ReleaseNames", sDefReleases);
00078 static CMString gImportModuleNames(10, "P_ImportModuleNames", sDefModuleNames);
00079
00080 #ifdef WIN32
00081 #   include "GetPrefs.h"
00082 #   ifdef _DEBUG
00083 #   define new DEBUG_NEW
00084 #   undef THIS_FILE
00085     static char THIS_FILE[] = __FILE__;
00086 #   endif
00087
00088 IMPLEMENT_DYNAMIC(CImport_MAIN, CPropertyPage)
00089
00090 CImport_MAIN::CImport_MAIN(const MultiFiles* mf,
00091                            const char* logmsg, const char* modname,
00092                            const char* rtag, const char* vtag)
00093                            : m_mf(mf), CPropertyPage(CImport_MAIN::IDD)
00094 {
00095     //{{AFX_DATA_INIT(CImport_MAIN)
00096     m_logmsg = logmsg;
00097     m_vtag = vtag;
00098     m_rtag = rtag;
00099     m_moduleName = modname;
00100     //}}AFX_DATA_INIT
00101
00102     m_moduleCombo.SetItems(&gImportModuleNames);
00103     m_rtagCombo.SetItems(&gReleasesNames);
00104     m_vtagCombo.SetItems(&gVendorNames);
00105 }
00106
00107 CImport_MAIN::~CImport_MAIN()
00108 {
00109 }
00110
00111 void CImport_MAIN::DoDataExchange(CDataExchange* pDX)
00112 {
00113     CPropertyPage::DoDataExchange(pDX);
00114
00115     //{{AFX_DATA_MAP(CImport_MAIN)
00116     DDX_Control(pDX, IDC_COMBOMODNAME, m_moduleCombo);
00117     DDX_Control(pDX, IDC_COMBORTAG, m_rtagCombo);
00118     DDX_Control(pDX, IDC_COMBOVTAG, m_vtagCombo);
00119     DDX_Text(pDX, IDC_LOGMSG, m_logmsg);
00120     DDX_CBString(pDX, IDC_COMBOVTAG, m_vtag);
00121     DDX_CBString(pDX, IDC_COMBORTAG, m_rtag);
00122     DDX_CBString(pDX, IDC_COMBOMODNAME, m_moduleName);
00123     //}}AFX_DATA_MAP
00124
00125     DDV_MinChars(pDX, m_moduleName, 1);
00126     DDV_MinChars(pDX, m_rtag, 1);
00127     DDV_MinChars(pDX, m_vtag, 1);
00128     DDX_ComboMString(pDX, IDC_COMBOMODNAME, m_moduleCombo);
00129     DDX_ComboMString(pDX, IDC_COMBOVTAG, m_vtagCombo);
00130     DDX_ComboMString(pDX, IDC_COMBORTAG, m_rtagCombo);
00131
00132     //error if the vendor and release tags are same
00133     if( pDX->m_bSaveAndValidate )
00134     {
00135         if( m_vtag == m_rtag )
00136         {
00137             AfxMessageBox("Vendor Tag and Release Tag can't have the same values.", MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
00138             pDX->Fail();
00139         }
00140     }
00141 }
00142
00143
00144 BEGIN_MESSAGE_MAP(CImport_MAIN, CPropertyPage)
00145     //{{AFX_MSG_MAP(CImport_MAIN)
00146     ON_BN_CLICKED(IDC_BROWSE_TAG1, OnBrowseTag1)
00147     ON_BN_CLICKED(IDC_BROWSE_TAG2, OnBrowseTag2)
00148     ON_BN_CLICKED(IDC_BROWSE_MODULES, OnBrowseModules)
00149     //}}AFX_MSG_MAP
00150 END_MESSAGE_MAP()
00151
00152 IMPLEMENT_DYNAMIC(CImport_OPTIONS, CPropertyPage)
00153
00154 CImport_OPTIONS::CImport_OPTIONS(const char *path, const bool useDefIgnore, const bool useFilesTime) :
00155     CPropertyPage(CImport_OPTIONS::IDD)
00156 {
00157     //{{AFX_DATA_INIT(CImport_OPTIONS)
00158     m_path = path;
00159     m_useDefIgnore = useDefIgnore;
00160     m_useFilesTime = useFilesTime;
00161     //}}AFX_DATA_INIT
00162 }
00163
00164 CImport_OPTIONS::~CImport_OPTIONS()
00165 {
00166 }
00167
00168 void CImport_OPTIONS::DoDataExchange(CDataExchange* pDX)
00169 {
00170     CPropertyPage::DoDataExchange(pDX);
00171
00172     //{{AFX_DATA_MAP(CImport_OPTIONS)
00173     DDX_Control(pDX, IDC_PATH, m_pathEdit);
00174     DDX_Text(pDX, IDC_PATH, m_path);
00175     DDX_Check(pDX, IDC_USEDEFIGNORE, m_useDefIgnore);
00176     DDX_Check(pDX, IDC_USEFILESTIME, m_useFilesTime);
00177     //}}AFX_DATA_MAP
00178
00179     DDV_CheckPathExists(pDX, IDC_PATH, m_path, false);
00180 }
00181
00182
00183 BEGIN_MESSAGE_MAP(CImport_OPTIONS, CPropertyPage)
00184     //{{AFX_MSG_MAP(CImport_OPTIONS)
00185     ON_BN_CLICKED(IDC_BTNPATH, OnBtnpath)
00186     //}}AFX_MSG_MAP
00187 END_MESSAGE_MAP()
00188
00189
00190 // CImport_OPTIONS message handlers
00191
00192
00193 void CImport_OPTIONS::OnBtnpath()
00194 {
00195     CString strPath;
00196     m_pathEdit.GetWindowText(strPath);
00197
00198     CStr path(strPath);
00199     if( BrowserGetDirectory("Select a directory to import from", path, IsWindow(m_hWnd) ? this : NULL) )
00200     {
00201         m_pathEdit.SetWindowText(m_path);
00202     }
00203 }
00204
00206 void CImport_MAIN::OnBrowseTag1()
00207 {
00208     CStr tagName;
00209     if( CompatGetTagListItem(m_mf, tagName) )
00210     {
00211         m_vtag = (const char*)tagName;
00212         m_vtagCombo.SetWindowText(m_vtag);
00213     }
00214 }
00215
00217 void CImport_MAIN::OnBrowseTag2()
00218 {
00219     CStr tagName;
00220     if( CompatGetTagListItem(m_mf, tagName) )
00221     {
00222         m_rtag = (const char*)tagName;
00223         m_rtagCombo.SetWindowText(m_rtag);
00224     }
00225 }
00226
00228 void CImport_MAIN::OnBrowseModules()
00229 {
00230     CStr moduleName;
00231     if( CompatGetModuleListItem(m_mf, moduleName) )
00232     {
00233         m_moduleName = (const char*)moduleName;
00234         m_moduleCombo.SetWindowText(m_moduleName);
00235     }
00236 }
00237
00238 #endif /* WIN32 */
00239
00240 #ifdef qMacCvsPP
00241 static void DoDataExchange_ImportMain(LWindow *theDialog, CPStr & modname, CStr & logmsg, bool putValue)
00242 {
00243     LEditText *mname = dynamic_cast<LEditText*>
00244         (theDialog->FindPaneByID(item_ModuleName));
00245     LTextEditView *editLog = dynamic_cast<LTextEditView*>
00246         (theDialog->FindPaneByID(item_LogMsg));
00247
00248     if(putValue)
00249     {
00250         mname->SetText((Ptr)(const char *)modname, modname.length());
00251         editLog->SetTextPtr((Ptr)(const char *)logmsg, logmsg.length());
00252         theDialog->SetLatentSub(mname);
00253
00254         // this will take care about an empty module name
00255         mname->AddListener(GetDlgHandler());
00256         if(modname.length() == 0)
00257         {
00258             LPushButton *theOK = dynamic_cast<LPushButton*>
00259                                         (theDialog->FindPaneByID(item_OK));
00260             Assert_(theOK != 0L);
00261             theOK->Disable();
00262         }
00263     }
00264     else
00265     {
00266         Handle hdl = editLog->GetTextHandle();
00267         Assert_(hdl != 0L);
00268         logmsg.set(*hdl, GetHandleSize(hdl));
00269
00270         char buf[512];
00271         Size len;
00272         mname->GetText(buf, 511, &len);
00273         modname.set(buf, len);
00274
00275     }
00276 }
00277
00278 static void DoDataExchange_ImportTags(LWindow *theDialog, CPStr & vendortag, CPStr & reltag, bool putValue)
00279 {
00280     LEditText *vtag = dynamic_cast<LEditText*>
00281         (theDialog->FindPaneByID(item_Vendortag));
00282     LEditText *rtag = dynamic_cast<LEditText*>
00283         (theDialog->FindPaneByID(item_Reltag));
00284
00285     if(putValue)
00286     {
00287         vtag->SetText((Ptr)(const char *)vendortag, vendortag.length());
00288         rtag->SetText((Ptr)(const char *)reltag, reltag.length());
00289         theDialog->SetLatentSub(vtag);
00290     }
00291     else
00292     {
00293         char buf[512];
00294         Size len;
00295         vtag->GetText(buf, 511, &len);
00296         vendortag.set(buf, len);
00297         rtag->GetText(buf, 511, &len);
00298         reltag.set(buf, len);
00299
00300     }
00301 }
00302 #endif /* qMacCvsPP */
00303
00304 #if qUnix
00305 class UCvsImport : public UWidget
00306 {
00307     UDECLARE_DYNAMIC(UCvsImport)
00308 public:
00309     UCvsImport() : UWidget(::UEventGetWidID()) {}
00310     virtual ~UCvsImport() {}
00311
00312     enum
00313     {
00314         kOK = EV_COMMAND_START, // 0
00315         kCancel,                // 1
00316         kTabGeneral             // 2
00317     };
00318
00319     virtual void DoDataExchange(bool fill);
00320
00321 protected:
00322     ev_msg int OnOK(void);
00323     ev_msg int OnCancel(void);
00324
00325     UDECLARE_MESSAGE_MAP()
00326 };
00327
00328 UIMPLEMENT_DYNAMIC(UCvsImport, UWidget)
00329
00330 UBEGIN_MESSAGE_MAP(UCvsImport, UWidget)
00331     ON_UCOMMAND(UCvsImport::kOK, UCvsImport::OnOK)
00332     ON_UCOMMAND(UCvsImport::kCancel, UCvsImport::OnCancel)
00333 UEND_MESSAGE_MAP()
00334
00335 int UCvsImport::OnOK(void)
00336 {
00337     EndModal(true);
00338     return 0;
00339 }
00340
00341 int UCvsImport::OnCancel(void)
00342 {
00343     EndModal(false);
00344     return 0;
00345 }
00346
00347 void UCvsImport::DoDataExchange(bool fill)
00348 {
00349     if(fill)
00350     {
00351     }
00352     else
00353     {
00354     }
00355 }
00356
00357 class UCvsImport_MAIN : public UWidget
00358 {
00359     UDECLARE_DYNAMIC(UCvsImport_MAIN)
00360 public:
00361     UCvsImport_MAIN(const char *logmsg, const char *modname,
00362                     const char *rtag, const char *vtag);
00363     virtual ~UCvsImport_MAIN() {}
00364
00365     enum
00366     {
00367         kEditModule = EV_COMMAND_START, // 0
00368         kEditLog,                       // 1
00369         kEditVendor,                    // 2
00370         kEditRelease                    // 3
00371     };
00372
00373     virtual void DoDataExchange(bool fill);
00374
00375     UStr m_logmsg;
00376     UStr m_modname;
00377     UStr m_rtag;
00378     UStr m_vtag;
00379 protected:
00380
00381     UDECLARE_MESSAGE_MAP()
00382 };
00383
00384 UIMPLEMENT_DYNAMIC(UCvsImport_MAIN, UWidget)
00385
00386 UBEGIN_MESSAGE_MAP(UCvsImport_MAIN, UWidget)
00387 UEND_MESSAGE_MAP()
00388
00389 UCvsImport_MAIN::UCvsImport_MAIN(const char *logmsg, const char *modname,
00390                                  const char *rtag, const char *vtag) : UWidget(::UEventGetWidID())
00391 {
00392     m_logmsg = logmsg;
00393     m_modname = modname;
00394     m_rtag = rtag;
00395     m_vtag = vtag;
00396 }
00397
00398 void UCvsImport_MAIN::DoDataExchange(bool fill)
00399 {
00400     ::DoDataExchange(fill, GetWidID(), kEditModule, gOldModules);
00401     ::DoDataExchange(fill, GetWidID(), kEditRelease, gReleasesNames);
00402     ::DoDataExchange(fill, GetWidID(), kEditVendor, gVendorNames);
00403
00404     if(fill)
00405     {
00406         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditLog, (void *)(const char *)m_logmsg);
00407         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditModule, (void *)(const char *)m_modname);
00408         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditRelease, (void *)(const char *)m_rtag);
00409         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditVendor, (void *)(const char *)m_vtag);
00410     }
00411     else
00412     {
00413         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditLog, &m_logmsg);
00414         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditModule, &m_modname);
00415         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditRelease, &m_rtag);
00416         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditVendor, &m_vtag);
00417     }
00418 }
00419
00420 class UCvsImport_OPTIONS : public UWidget
00421 {
00422     UDECLARE_DYNAMIC(UCvsImport_OPTIONS)
00423 public:
00424     UCvsImport_OPTIONS(const char *path);
00425     virtual ~UCvsImport_OPTIONS() {}
00426
00427     enum
00428     {
00429         kStatPath = EV_COMMAND_START,   // 0
00430         kBtnChange                      // 1
00431     };
00432
00433     virtual void DoDataExchange(bool fill);
00434
00435     UStr m_path;
00436 protected:
00437
00438     ev_msg int OnChange(void);
00439
00440     UDECLARE_MESSAGE_MAP()
00441 };
00442
00443 UIMPLEMENT_DYNAMIC(UCvsImport_OPTIONS, UWidget)
00444
00445 UBEGIN_MESSAGE_MAP(UCvsImport_OPTIONS, UWidget)
00446     ON_UCOMMAND(UCvsImport_OPTIONS::kBtnChange, UCvsImport_OPTIONS::OnChange)
00447 UEND_MESSAGE_MAP()
00448
00449 UCvsImport_OPTIONS::UCvsImport_OPTIONS(const char *path) : UWidget(::UEventGetWidID())
00450 {
00451     m_path = path;
00452 }
00453
00454 int UCvsImport_OPTIONS::OnChange()
00455 {
00456     CStr dir;
00457     if( BrowserGetDirectory("Select a directory to import from", dir) )
00458     {
00459         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void*)dir.c_str());
00460     }
00461
00462     return 0;
00463 }
00464
00465 void UCvsImport_OPTIONS::DoDataExchange(bool fill)
00466 {
00467     if(fill)
00468     {
00469         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)(const char *)m_path);
00470     }
00471     else
00472     {
00473         UEventSendMessage(GetWidID(), EV_GETTEXT, kStatPath, &m_path);
00474     }
00475 }
00476 #endif // qUnix
00477
00479 bool CompatGetImport(const MultiFiles* mf,
00480                      CPStr& modname, CStr& logmsg, CPStr& vendortag,
00481                      CPStr& reltag, CPStr& path,
00482                      bool& useDefIgnore, bool& useFilesTime)
00483 {
00484     bool userHitOK = false;
00485     modname = "";
00486     logmsg = "";
00487     vendortag = "";
00488     reltag = "";
00489     useDefIgnore = false;
00490     useFilesTime = false;
00491
00492     static CPStr sLastModName;  /*Obsolete - remove it and always use sFolder! Get rid after all platforms have combo boxes for recent modules!*/
00493
00494     static CPStr sFolder;
00495     static CStr sLastMsg;
00496     static CPStr sLastVTag("avendor");
00497     static CPStr sLastRTag("arelease");
00498
00499     //dig out the folder so we can suggest the module name
00500     CStr uppath, folder;
00501     if( SplitPath(path, uppath, folder) )
00502         sFolder = folder;
00503
00504     if( sLastModName.length() == 0L )   /*Obsolete - see above*/
00505     {
00506         sLastModName = folder;
00507     }
00508 #ifdef WIN32
00509     CPropertySheet pages("Import settings");
00510     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00511     CImport_MAIN page1(mf, sLastMsg, sFolder, sLastRTag, sLastVTag);
00512     CImport_OPTIONS page2(path, useDefIgnore, useFilesTime);
00513     CGetPrefs_CVSROOT page3;
00514     CGetPrefs_GLOBALS page4;
00515     pages.AddPage(&page1);
00516     pages.AddPage(&page2);
00517     pages.AddPage(&page3);
00518     pages.AddPage(&page4);
00519     if(pages.DoModal() == IDOK)
00520     {
00521         sLastModName = (const char *)page1.m_moduleName;
00522         sLastMsg = (const char *)page1.m_logmsg;
00523         sLastVTag = (const char *)page1.m_vtag;
00524         sLastRTag = (const char *)page1.m_rtag;
00525         path = (const char *)page2.m_path;
00526         useDefIgnore = page2.m_useDefIgnore == TRUE;
00527         useFilesTime = page2.m_useFilesTime == TRUE;
00528
00529         page3.StoreValues();
00530         page4.StoreValues();
00531         userHitOK = true;
00532     }
00533 #endif /* WIN32 */
00534
00535 #ifdef qMacCvsPP
00536     StDialogHandler theHandler(dlg_Import, LCommander::GetTopCommander());
00537     LWindow *theDialog = theHandler.GetDialog();
00538     ThrowIfNil_(theDialog);
00539     static UInt16 sRuntimePanel = 1;
00540
00541     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00542         (theDialog->FindPaneByID(item_MultiViewPrefs));
00543     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00544
00545     multiView->SwitchToPanel(3);
00546     DoDataExchange_Globals(theDialog, true);
00547     multiView->SwitchToPanel(2);
00548     DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, true);
00549     DoDataExchange (theDialog, item_EditPath, path, true);
00550     dynamic_cast<LControl*> (theDialog->FindPaneByID (item_EditPath))->AddListener (&theHandler);
00551
00552     multiView->SwitchToPanel(1);
00553     DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, true);
00554     DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, true);
00555
00556
00557     groupView->SetValue(sRuntimePanel);
00558     theDialog->Show();
00559     MessageT hitMessage;
00560     while (true)
00561     {       // Let DialogHandler process events
00562         hitMessage = theHandler.DoDialog();
00563
00564         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00565             break;
00566
00567         if(hitMessage == item_EditPath)
00568         {
00569             CStr dir;
00570             if( BrowserGetDirectory("Select a directory to import from", dir) )
00571             {
00572                 CPStr tmp(dir.c_str());
00573                 theDialog->SetDescriptorForPaneID(item_EditPath, tmp);
00574             }
00575         }
00576     }
00577     theDialog->Hide();
00578     sRuntimePanel = groupView->GetValue();
00579
00580     if(hitMessage == msg_OK)
00581     {
00582         multiView->SwitchToPanel(1);
00583         DoDataExchange_ImportMain(theDialog, sLastModName, sLastMsg, false);
00584         DoDataExchange_ImportTags(theDialog, sLastVTag, sLastRTag, false);
00585         multiView->SwitchToPanel(2);
00586         DoDataExchange (theDialog, item_ImportCvsIgnore, useDefIgnore, false);
00587         DoDataExchange (theDialog, item_EditPath, path, false);
00588         multiView->SwitchToPanel(3);
00589         DoDataExchange_Globals(theDialog, false);
00590
00591         Assert_(sLastModName.length() != 0);
00592
00593         userHitOK = true;
00594     }
00595 #endif /* qMacCvsPP */
00596
00597 #if qUnix
00598     void *wid = UCreate_ImportDlg();
00599
00600     UCvsImport *dlg = new UCvsImport();
00601     UCvsImport_MAIN *tab1 = new UCvsImport_MAIN(sLastMsg, sLastModName, sLastRTag, sLastVTag);
00602     UCvsImport_OPTIONS *tab2 = new UCvsImport_OPTIONS(path);
00603     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00604     dlg->AddPage(tab1, UCvsImport::kTabGeneral, 0);
00605     dlg->AddPage(tab2, UCvsImport::kTabGeneral, 1);
00606
00607     if(dlg->DoModal())
00608     {
00609         sLastModName = tab1->m_modname;
00610         sLastMsg = tab1->m_logmsg;
00611         sLastVTag = tab1->m_vtag;
00612         sLastRTag = tab1->m_rtag;
00613         path = tab2->m_path;
00614
00615         userHitOK = true;
00616     }
00617
00618     delete dlg;
00619 #endif // qUnix
00620
00621     if(userHitOK)
00622     {
00623         gCvsPrefs.save();
00624         if(sLastMsg.length() == 0)
00625             sLastMsg = "no message";
00626         if(sLastVTag.length() == 0)
00627             sLastVTag = "initial";
00628         if(sLastRTag.length() == 0)
00629             sLastRTag = "start";
00630
00631         modname = sLastModName;
00632         logmsg = sLastMsg;
00633         vendortag = sLastVTag;
00634         reltag = sLastRTag;
00635 #ifdef TARGET_OS_MAC
00636         logmsg.replace('\015', '\012');
00637 #endif /* TARGET_OS_MAC */
00638     }
00639     return userHitOK;
00640 }
Generated on Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 class MultiFiles;
00036
00037 bool CompatGetImport(const MultiFiles* mf,
00038                      CPStr& modname, CStr& logmsg,
00039                      CPStr& vendortag, CPStr& reltag, CPStr& path,
00040                      bool& useDefIgnore, bool& useFilesTime);
00041
00042 #ifdef WIN32
00043
00044 class CImport_MAIN : public CPropertyPage
00045 {
00046     DECLARE_DYNAMIC(CImport_MAIN)
00047
00048 // Construction
00049 public:
00050     CImport_MAIN(const MultiFiles* mf,
00051         const char* logmsg, const char* modname,
00052         const char* rtag, const char* vtag);
00053     ~CImport_MAIN();
00054
00055 // Dialog Data
00056     //{{AFX_DATA(CImport_MAIN)
00057     enum { IDD = IDD_IMPORT_MAIN };
00058     CSmartComboBox  m_moduleCombo;
00059     CSmartComboBox  m_rtagCombo;
00060     CSmartComboBox  m_vtagCombo;
00061     CString m_logmsg;
00062     CString m_vtag;
00063     CString m_rtag;
00064     CString m_moduleName;
00065     //}}AFX_DATA
00066
00067
00068 // Overrides
00069     // ClassWizard generate virtual function overrides
00070     //{{AFX_VIRTUAL(CImport_MAIN)
00071     protected:
00072     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00073     //}}AFX_VIRTUAL
00074
00075 // Implementation
00076 protected:
00077     // Generated message map functions
00078     //{{AFX_MSG(CImport_MAIN)
00079     afx_msg void OnBrowseTag1();
00080     afx_msg void OnBrowseTag2();
00081     afx_msg void OnBrowseModules();
00082     //}}AFX_MSG
00083     DECLARE_MESSAGE_MAP()
00084 private:
00085     const MultiFiles* m_mf;
00086 };
00087
00088 class CImport_OPTIONS : public CPropertyPage
00089 {
00090     DECLARE_DYNAMIC(CImport_OPTIONS)
00091
00092 // Construction
00093 public:
00094     CImport_OPTIONS(const char *path, const bool useDefIgnore, const bool useFilesTime);
00095     ~CImport_OPTIONS();
00096
00097 // Dialog Data
00098     //{{AFX_DATA(CImport_OPTIONS)
00099     enum { IDD = IDD_IMPORT_OPTIONS };
00100     CEdit   m_pathEdit;
00101     CString m_path;
00102     BOOL    m_useDefIgnore;
00103     BOOL    m_useFilesTime;
00104     //}}AFX_DATA
00105
00106
00107 // Overrides
00108     // ClassWizard generate virtual function overrides
00109     //{{AFX_VIRTUAL(CImport_OPTIONS)
00110     protected:
00111     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00112     //}}AFX_VIRTUAL
00113
00114 // Implementation
00115 protected:
00116     // Generated message map functions
00117     //{{AFX_MSG(CImport_OPTIONS)
00118     afx_msg void OnBtnpath();
00119     //}}AFX_MSG
00120     DECLARE_MESSAGE_MAP()
00121
00122 };
00123
00124 //{{AFX_INSERT_LOCATION}}
00125 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00126 #endif /* WIN32 */
00127
00128 #endif // !defined(AFX_IMPORTDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00032 #   include "GUSIInternal.h"
00033 #   include "GUSIFileSpec.h"
00034 #   include "MacMisc.h"
00035 #endif /* TARGET_OS_MAC */
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 TARGET_OS_MAC
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
00081 static void list_add_warning(ReportWarning*& warnings, kTextBinTYPE warn, const char* sample)
00082 {
00083     // Find if it exists already a same kind of warning
00084     ReportWarning* tmp = warnings;
00085     while( tmp != 0L )
00086     {
00087         if( tmp->Kind() == warn )
00088             break;
00089
00090         tmp = tmp->next;
00091     }
00092
00093     if( tmp != 0L && tmp->Kind() == warn )
00094     {
00095         tmp->AddWarning(sample);
00096         return;
00097     }
00098
00099     // Insert new one
00100     tmp = NEW ReportWarning(warn);
00101     if( tmp == 0L )
00102     {
00103         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportWarning));
00104         return;
00105     }
00106
00107     tmp->AddWarning(sample);
00108
00109     if( warnings == 0L )
00110     {
00111         warnings = tmp;
00112     }
00113     else
00114     {
00115         tmp->next = warnings;
00116         warnings = tmp;
00117     }
00118 }
00119
00132 static void list_add_type(ImportReport* impReport, ReportConflict*& conflicts, kFileType fileType,
00133                           const char* sample, const char* fullname,
00134                           int mac_type, int mac_creator)
00135 {
00136     // Look for a matching entry
00137     ReportConflict* entry = conflicts;
00138     while( entry != 0L )
00139     {
00140         if( entry->Match(sample) )
00141         {
00142             if( entry->HasConflict() )
00143                 return;
00144
00145             if( entry->IsBinary() ^ (kFileTypeBin == fileType) )
00146                 entry->SetConflict(fullname);
00147
00148             if( entry->IsUnicode() ^ (kFileTypeUnicode == fileType) )
00149                 entry->SetConflict(fullname);
00150
00151             // Mac only
00152             if( entry->GetMacType() != mac_type || entry->GetMacCreator() != mac_creator )
00153                 entry->SetTypeCreatorConflict(fullname);
00154
00155             // It matches perfectly
00156             return;
00157         }
00158
00159         entry = entry->next;
00160     }
00161
00162     // Find the extension
00163     const char* tmp = sample, *ext = 0L;
00164
00165     while( (tmp = strchr(tmp, '.')) != 0L )
00166     {
00167         ext = tmp++;
00168     }
00169
00170     // Add a new entry
00171     ReportConflict* newc = NEW ReportConflict(mac_type, mac_creator);
00172     if( newc == 0L )
00173     {
00174         cvs_err("Impossible to allocate %d bytes !\n", sizeof(ReportConflict));
00175         return;
00176     }
00177
00178     newc->AddPattern(ext != 0L ? ext : sample, fileType, ext != 0L, fullname);
00179
00180     if( conflicts == 0L )
00181     {
00182         conflicts = newc;
00183     }
00184     else
00185     {
00186         newc->next = conflicts;
00187         conflicts = newc;
00188     }
00189
00190     // MN - Apply ignore filter. If $HOME/.cvsignore tells that
00191     // file should be ignored then set object to ignored state.
00192     if( MatchIgnoredList(sample, impReport->GetIgnoreList()) )
00193         newc->Ignore();
00194 }
00195
00203 kTraversal list_all_types_recur(const char* path, ReportWarning*& warnings, ReportConflict*& conflicts)
00204 {
00205     ImportReport report(path, warnings, conflicts);
00206     return FileTraverse(path, report);
00207 }
00208
00214 void free_list_types(ReportWarning* warnings, ReportConflict* conflicts)
00215 {
00216     ReportWarning* tmpwarn;
00217     ReportWarning* warn = warnings;
00218
00219     while( warn != 0L )
00220     {
00221         tmpwarn = warn;
00222         warn = warn->next;
00223         delete tmpwarn;
00224     }
00225
00226     ReportConflict* tmpconf;
00227     ReportConflict* conf = conflicts;
00228
00229     while( conf != 0L )
00230     {
00231         tmpconf = conf;
00232         conf = conf->next;
00233         delete tmpconf;
00234     }
00235 }
00236
00237 #if qCvsDebug
00238 bool list_all_types(const char* path)
00239 {
00240     ReportWarning* warnings = 0L;
00241     ReportConflict* conflicts = 0L;
00242     list_all_types_recur(path, warnings, conflicts);
00243
00244     cvs_out("Reporting warnings :\n");
00245     ReportWarning* warn = warnings;
00246
00247     while( warn != 0L )
00248     {
00249         warn->PrintOut();
00250         warn = warn->next;
00251     }
00252
00253     cvs_out("Reporting types :\n");
00254     ReportConflict* conf = conflicts;
00255
00256     while( conf != 0L )
00257     {
00258         conf->PrintOut();
00259         conf = conf->next;
00260     }
00261
00262     free_list_types(warnings, conflicts);
00263
00264     return !CvsAlert("Continue importing ?", "Cancel", "Continue");
00265 }
00266 #endif /* qCvsDebug */
00267
00269 // ReportConflict
00270
00271 ReportConflict::ReportConflict(int mac_type, int mac_creator)
00272 {
00273     next = 0L;
00274     status = noConflict;
00275     ftype = mac_type;
00276     fcreator = mac_creator;
00277 }
00278
00279 void ReportConflict::PrintOut(CStr& out) const
00280 {
00281     out = "";
00282     if( HasConflict() )
00283     {
00284         out << "Text/Binary conflict, at least these files :";
00285         out << lf;
00286
00287         if( !sample1.empty() && !sample2.empty() )
00288         {
00289             out << "    ";
00290             out << sample1;
00291             out << " and ";
00292             out << sample2;
00293             out << lf;
00294         }
00295     }
00296     else if( HasTypeCreatorConflict() )
00297     {
00298         out << "Mac signature mismatch for this type, at least these files :";
00299         out << lf;
00300
00301         if( !sample1.empty() && !sample2.empty() )
00302         {
00303             out << "    ";
00304             out << sample1;
00305             out << " and ";
00306             out << sample2;
00307             out << lf;
00308         }
00309     }
00310 }
00311
00312 #if qCvsDebug
00313 void ReportConflict::PrintOut(void) const
00314 {
00315     if( pattern.empty() )
00316         return;
00317
00318     cvs_out("  New type : %s%s (%s)\n",
00319         (status & hasExtension) ? "*" : "",
00320         (const char*)pattern,
00321         (status & isBinary) ? "BINARY" : "TEXT");
00322
00323     if( !sample1.empty() && !sample2.empty() )
00324     {
00325         if( HasConflict() )
00326             cvs_out("    Text/Binary CONFLICT ! %s and %s\n",
00327             (const char*)sample1, (const char*)sample2);
00328
00329         else if( HasTypeCreatorConflict() )
00330             cvs_out("    Mac signature mismatch ! %s and %s\n",
00331             (const char*)sample1, (const char*)sample2);
00332     }
00333 }
00334 #endif /* qCvsDebug */
00335
00336 ReportConflict::~ReportConflict()
00337 {
00338 }
00339
00347 void ReportConflict::AddPattern(const char* newpat, kFileType fileType, bool isExt, const char* sample)
00348 {
00349     pattern = newpat;
00350     sample1 = sample;
00351
00352     switch( fileType )
00353     {
00354     case kFileTypeBin:
00355         status |= isBinary;
00356         break;
00357     case kFileTypeUnicode:
00358         status |= isUnicode;
00359         break;
00360     default:
00361         // nothing to do
00362         break;
00363     }
00364
00365     if( isExt )
00366         status |= hasExtension;
00367 }
00368
00375 bool ReportConflict::Match(const char* pat)
00376 {
00377     if( pat == 0L || pattern.empty() )
00378         return false;
00379
00380     int len = strlen(pat);
00381     int patlen = pattern.length();
00382
00383     if( status & hasExtension )
00384     {
00385         if( len < patlen )
00386             return false;
00387
00388         return strcmp(pattern, pat + len - patlen) == 0;
00389     }
00390
00391     return strcmp(pattern, pat) == 0;
00392 }
00393
00398 void ReportConflict::SetConflict(const char* sample)
00399 {
00400     // one is enough !
00401     if( HasConflict() )
00402         return;
00403
00404     sample2 = sample;
00405     status |= hasConflict;
00406 }
00407
00412 void ReportConflict::SetTypeCreatorConflict(const char* sample)
00413 {
00414     // one is enough !
00415     if( HasTypeCreatorConflict() || HasConflict() )
00416         return;
00417
00418     sample2 = sample;
00419     status |= hasTypeCreatorConflict;
00420 }
00421
00426 bool ReportConflict::HasConflict(void) const
00427 {
00428     return (status & hasConflict) != 0;
00429 }
00430
00436 bool ReportConflict::HasTypeCreatorConflict(void) const
00437 {
00438     return (status & hasTypeCreatorConflict) != 0;
00439 }
00440
00445 bool ReportConflict::IsBinary(void) const
00446 {
00447     return (status & isBinary) != 0;
00448 }
00449
00454 bool ReportConflict::IsUnicode(void) const
00455 {
00456     return (status & isUnicode) != 0;
00457 }
00458
00463 bool ReportConflict::IsExtension(void) const
00464 {
00465     return (status & hasExtension) != 0;
00466 }
00467
00472 const char* ReportConflict::GetPattern(void) const
00473 {
00474     return pattern;
00475 }
00476
00482 int ReportConflict::GetMacType(void) const
00483 {
00484     return ftype;
00485 }
00486
00492 int ReportConflict::GetMacCreator(void) const
00493 {
00494     return fcreator;
00495 }
00496
00500 void ReportConflict::ForceBinary(void)
00501 {
00502     status &= ~(int)userFlags;
00503     status |= (int)forceBinary;
00504 }
00505
00509 void ReportConflict::ForceText(void)
00510 {
00511     status &= ~(int)userFlags;
00512     status |= (int)forceText;
00513 }
00514
00518 void ReportConflict::ForceUnicode(void)
00519 {
00520     status &= ~(int)userFlags;
00521     status |= (int)forceUnicode;
00522 }
00523
00527 void ReportConflict::Ignore(void)
00528 {
00529     status &= ~(int)userFlags;
00530     status |= (int)hasIgnore;
00531 }
00532
00536 void ReportConflict::ForceNoKeywords(void)
00537 {
00538     status &= ~(int)userFlags;
00539     status |= (int)forceNoKeywords;
00540 }
00541
00546 bool ReportConflict::HasForceBinary(void) const
00547 {
00548     return (status & forceBinary) != 0;
00549 }
00550
00555 bool ReportConflict::HasForceText(void) const
00556 {
00557     return (status & forceText) != 0;
00558 }
00559
00564 bool ReportConflict::HasForceUnicode(void) const
00565 {
00566     return (status & forceUnicode) != 0;
00567 }
00568
00573 bool ReportConflict::HasIgnore(void) const
00574 {
00575     return (status & hasIgnore) != 0;
00576 }
00577
00582 bool ReportConflict::HasForceNoKeywords(void) const
00583 {
00584     return (status & forceNoKeywords) != 0;
00585 }
00586
00590 void ReportConflict::DisableUserSettings(void)
00591 {
00592     status &= ~(int)userFlags;
00593 }
00594
00599 CPStr ReportConflict::GetStateDesc() const
00600 {
00601     return HasConflict() ? "Error" : "OK";
00602 }
00603
00608 CPStr ReportConflict::GetDesc() const
00609 {
00610     CPStr desc;
00611
00612     desc << "Type ";
00613     desc << (IsExtension() ? "*" : "");
00614     desc << GetPattern();
00615
00616     return desc;
00617 }
00618
00623 CPStr ReportConflict::GetKindDesc() const
00624 {
00625     if( HasForceBinary() )
00626     {
00627         return "FORCE BINARY";
00628     }
00629     else if( HasForceUnicode() )
00630     {
00631         return "FORCE UNICODE";
00632     }
00633     else if( HasForceText() )
00634     {
00635         return "FORCE TEXT";
00636     }
00637     else if( HasForceNoKeywords() )
00638     {
00639         return "FORCE NO KEYWORDS";
00640     }
00641     else if( HasIgnore() )
00642     {
00643         return "IGNORE";
00644     }
00645     else if( IsBinary() )
00646     {
00647         return "BINARY";
00648     }
00649     else if( IsUnicode() )
00650     {
00651         return "UNICODE";
00652     }
00653
00654     return "TEXT";
00655 }
00656
00658 // ReportWarning
00659
00660 const size_t ReportWarning::maxWarnings = 10;
00661
00662 ReportWarning::ReportWarning(kTextBinTYPE akind)
00663 {
00664     kind = akind;
00665     next = 0L;
00666     tooManyWarnings = false;
00667 }
00668
00669 ReportWarning::~ReportWarning()
00670 {
00671 }
00672
00677 void ReportWarning::PrintOut(CStr& out) const
00678 {
00679     out = "";
00680
00681     if( samples.size() == 0 )
00682         return;
00683
00684     out = "Warning : ";
00685     switch(kind)
00686     {
00687     default:
00688     case kFileIsOK:
00689         out << "Files are OK";
00690         break;
00691     case kFileMissing:
00692         out << "Files are missing or unreadable";
00693         break;
00694     case kFileIsAlias:
00695         out << "Files are aliases";
00696         break;
00697     case kFileInvalidName:
00698         out << "Files have invalid name";
00699         break;
00700     case kTextWrongLF:
00701         out << "Files have the wrong line feed";
00702         break;
00703     case kTextIsBinary:
00704         out << "Files are binary";
00705         break;
00706     case kTextEscapeChar:
00707         out << "Files have escape characters in it";
00708         break;
00709     case kTextWrongSig:
00710         out << "Text files have the wrong signature";
00711         break;
00712     case kBinIsText:
00713         out << "Files are text, should be binary";
00714         break;
00715     case kBinWrongSig:
00716         out << "Binary files have the wrong signature";
00717         break;
00718     case kTextIsUnicode:
00719         out << "Files are unicode, should be text";
00720         break;
00721     case kBinIsUnicode:
00722         out << "Files are unicode, should be binary";
00723         break;
00724     }
00725
00726     out << lf;
00727
00728     std::vector<CStr>::const_iterator i;
00729     for(i = samples.begin(); i != samples.end(); ++i)
00730     {
00731         out << "    ";
00732         out << *i;
00733         out << lf;
00734     }
00735
00736     if( tooManyWarnings )
00737     {
00738         out << "    More files follow";
00739         out << lf;
00740     }
00741 }
00742
00743 #if qCvsDebug
00744 void ReportWarning::PrintOut(void) const
00745 {
00746     if( samples.size() == 0 )
00747         return;
00748
00749     cvs_out("  Warning : ");
00750     switch(kind)
00751     {
00752     default:
00753     case kFileIsOK:
00754         cvs_out("Files are OK\n");
00755         break;
00756     case kFileMissing:
00757         cvs_out("Files are missing or unreadable\n");
00758         break;
00759     case kFileIsAlias:
00760         cvs_out("Files are aliases\n");
00761         break;
00762     case kFileInvalidName:
00763         cvs_out("Files have invalid name\n");
00764         break;
00765     case kTextWrongLF:
00766         cvs_out("Files have the wrong line feed\n");
00767         break;
00768     case kTextIsBinary:
00769         cvs_out("Files are binary\n");
00770         break;
00771     case kTextEscapeChar:
00772         cvs_out("Files have escape characters in it\n");
00773         break;
00774     case kTextWrongSig:
00775         cvs_out("Text files have the wrong signature\n");
00776         break;
00777     case kBinIsText:
00778         cvs_out("Files are text, should be binary\n");
00779         break;
00780     case kBinWrongSig:
00781         cvs_out("Binary files have the wrong signature\n");
00782         break;
00783     case kTextIsUnicode:
00784         cvs_out("Files are unicode, should be text\n");
00785         break;
00786     case kBinIsUnicode:
00787         cvs_out("Files are unicode, should be binary\n");
00788         break;
00789     }
00790
00791     std::vector<CStr>::const_iterator i;
00792     for(i = samples.begin(); i != samples.end(); ++i)
00793     {
00794         cvs_out("    %s\n", (const char*)(*i));
00795     }
00796
00797     if( tooManyWarnings )
00798         cvs_out("    More files follow\n");
00799 }
00800 #endif /* qCvsDebug */
00801
00806 void ReportWarning::AddWarning(const char* sample)
00807 {
00808     // it's enough !
00809     if( samples.size() >= maxWarnings )
00810     {
00811         tooManyWarnings = true;
00812         return;
00813     }
00814
00815     samples.push_back(CStr(sample));
00816 }
00817
00822 kTextBinTYPE ReportWarning::Kind(void) const
00823 {
00824     return kind;
00825 }
00826
00832 bool ReportWarning::IsError() const
00833 {
00834     return Kind() == kFileIsOK || Kind() == kTextEscapeChar;
00835 }
00836
00841 CPStr ReportWarning::GetStateDesc() const
00842 {
00843     if( IsError() )
00844     {
00845         return "Error";
00846     }
00847
00848     return "Warning";
00849 }
00850
00855 CPStr ReportWarning::GetDesc() const
00856 {
00857     CPStr desc;
00858
00859     switch( Kind() )
00860     {
00861     case kFileIsOK:
00862         desc = "File is OK";
00863         break;
00864     case kFileMissing:
00865         desc = "File is missing or unreadable";
00866         break;
00867     case kFileIsAlias:
00868         desc = "File is an alias";
00869         break;
00870     case kFileInvalidName:
00871         desc = "File has an invalid name";
00872         break;
00873     case kTextWrongLF:
00874         desc = "File has the wrong line feed for this machine";
00875         break;
00876     case kTextIsBinary:
00877         desc = "File seems to be binary, while expecting text";
00878         break;
00879     case kTextEscapeChar:
00880         desc = "File has some escape characters in it (0x00-0x20, 0x80-0xFF)";
00881         break;
00882     case kTextIsUnicode:
00883         desc = "File seems to be unicode, while expecting text";
00884         break;
00885     case kBinIsUnicode:
00886         desc = "File seems to be unicode, while expecting binary";
00887         break;
00888     case kTextWrongSig:
00889         desc = "Text File has a wrong mac signature";
00890         break;
00891     case kBinWrongSig:
00892         desc = "Binary File has a wrong mac signature";
00893         break;
00894     default:
00895         desc = "File has some unknown problem";
00896         break;
00897     }
00898
00899     return desc;
00900 }
00901
00903 // ImportReport
00904
00905 ImportReport::ImportReport(const char* path, ReportWarning*& w, ReportConflict*& c)
00906     : warnings(w), conflicts(c), m_progress(true, "Filtering files to import...", kProgressFile)
00907 {
00908     // MN - Apply ignore filter to import file list
00909     BuildIgnoredList(m_ignlist, path);
00910 }
00911
00912 ImportReport::~ImportReport()
00913 {
00914 }
00915
00916 kTraversal ImportReport::EnterDirectory(const char* fullpath, const char* dirname, const UFSSpec* macspec)
00917 {
00918     cvs_out("Filtering \'%s\'...\n", fullpath);
00919     return kContinueTraversal;
00920 }
00921
00922 kTraversal ImportReport::ExitDirectory(const char* fullpath)
00923 {
00924     return kContinueTraversal;
00925 }
00926
00927 kTraversal ImportReport::OnError(const char* err, int errcode)
00928 {
00929     list_add_warning(warnings, kFileMissing, err);
00930     return kContinueTraversal;
00931 }
00932
00933 kTraversal ImportReport::OnIdle(const char* fullpath)
00934 {
00935     if( m_progress.HasAborted() )
00936     {
00937         return kStopTraversal;
00938     }
00939
00940     m_progress.SetProgress(fullpath);
00941
00942     return kContinueTraversal;
00943 }
00944
00945 kTraversal ImportReport::OnDirectory(const char* fullpath, const char* fullname, const char* name,
00946                                      const struct stat& dir, const UFSSpec* macspec)
00947 {
00948 #if defined(WIN32) || defined(TARGET_OS_MAC)
00949     if(stricmp(name, "CVS") == 0)
00950 #else
00951     if(strcmp(name, "CVS") == 0)
00952 #endif
00953         return kSkipFile;
00954
00955     return kContinueTraversal;
00956 }
00957
00958 kTraversal ImportReport::OnFile(const char* fullpath, const char* fullname, const char* name,
00959                                 const struct stat& dir, const UFSSpec* macspec)
00960 {
00961     int mac_type = 0;
00962     int mac_creator = 0;
00963
00964 #ifdef TARGET_OS_MAC
00965 #   define MACSPEC , &fsSpec
00966     GUSIFileSpec inspec(fullname);
00967 #   if TARGET_RT_MAC_CFM
00968     mac_type = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdType;
00969     mac_creator = inspec.CatInfo()->FileInfo().ioFlFndrInfo.fdCreator;
00970 #   else
00971     FInfo finfo;
00972     memcpy(&finfo, inspec.CatInfo()->Info().finderInfo, 2 * sizeof(OSType));
00973     mac_type = finfo.fdType;
00974     mac_creator = finfo.fdCreator;
00975 #   endif
00976     UFSSpec fsSpec = inspec;
00977 #else /* !TARGET_OS_MAC */
00978 #   define MACSPEC
00979 #endif /* !TARGET_OS_MAC */
00980
00981     kFileType newType = kFileTypeText;
00982     kTextBinTYPE filetype = FileIsText(name, fullpath MACSPEC);
00983
00984     if( kTextIsBinary == filetype || kTextWrongSig == filetype )
00985     {
00986         kTextBinTYPE bintype = FileIsBinary(name, fullpath MACSPEC);
00987         if( kFileIsOK != bintype )
00988         {
00989             list_add_warning(warnings, bintype, fullname);
00990         }
00991         else if( kTextWrongSig == filetype )
00992         {
00993             list_add_warning(warnings, filetype, fullname);
00994             filetype = kTextIsBinary;
00995             newType = kFileTypeBin;
00996         }
00997
00998         if( kFileIsOK == bintype )
00999         {
01000             newType = kFileTypeBin;
01001         }
01002     }
01003     else if( kTextIsUnicode == filetype )
01004     {
01005         newType = kFileTypeUnicode;
01006     }
01007     else if( kFileIsOK != filetype )
01008     {
01009         list_add_warning(warnings, filetype, fullname);
01010     }
01011
01012     // Add the type
01013     list_add_type(this, conflicts, newType, name, fullname, mac_type, mac_creator);
01014
01015     return kContinueTraversal;
01016 }
01017
01018 kTraversal ImportReport::OnAlias(const char* fullpath, const char* fullname, const char* name,
01019                                  const struct stat& dir, const UFSSpec* macspec)
01020 {
01021     list_add_warning(warnings, kFileIsAlias, fullname);
01022     return kContinueTraversal;
01023 }
Generated on Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 "CPStr.h"
00034 #include "FileTraversal.h"
00035 #include "ProgressDlg.h"
00036
00037 #ifdef _MSC_VER
00038     using namespace std;
00039 #endif
00040
00041 class ReportWarning;
00042 class ReportConflict;
00043 class ImportReport;
00044
00045 kTraversal list_all_types_recur(const char* path, ReportWarning*& warnings, ReportConflict*& conflicts);
00046 void free_list_types(ReportWarning* warnings, ReportConflict* conflicts);
00047
00048 #if qCvsDebug
00049     bool list_all_types(const char* path);
00050 #endif /* qCvsDebug */
00051
00053 class ReportConflict
00054 {
00055 public:
00056     ReportConflict(int mac_type, int mac_creator);
00057     virtual ~ReportConflict();
00058
00059     ReportConflict* next;
00061
00062     enum
00063     {
00064         noConflict =                0x0000,
00065         hasConflict =               0x0001,
00066         hasExtension =              0x0002,
00067         isBinary =                  0x0004,
00068         forceBinary =               0x0008,
00069         forceText =                 0x0010,
00070         hasIgnore =                 0x0020,
00071         hasTypeCreatorConflict =    0x0040,
00072         forceNoKeywords =           0x0080,
00073         isUnicode =                 0x0100,
00074         forceUnicode =              0x0200,
00075         userFlags = forceText | forceBinary | forceUnicode | hasIgnore | forceNoKeywords
00076     };
00077
00078     void AddPattern(const char* newpat, kFileType fileType, bool isExtension, const char* sample);
00079     void SetConflict(const char* sample);
00080     void SetTypeCreatorConflict(const char* sample); /* mac only */
00081     bool Match(const char* pat);
00082
00083     bool HasConflict(void) const;
00084     bool HasTypeCreatorConflict(void) const;
00085     bool IsBinary(void) const;
00086     bool IsUnicode(void) const;
00087     bool IsExtension(void) const;
00088     const char* GetPattern(void) const;
00089     int GetMacType(void) const;
00090     int GetMacCreator(void) const;
00091
00092     void ForceBinary(void);
00093     void ForceText(void);
00094     void ForceUnicode(void);
00095     void Ignore(void);
00096     void ForceNoKeywords(void);
00097     bool HasForceBinary(void) const;
00098     bool HasForceText(void) const;
00099     bool HasForceUnicode(void) const;
00100     bool HasIgnore(void) const;
00101     bool HasForceNoKeywords(void) const;
00102
00103     void DisableUserSettings(void);
00104
00105     CPStr GetStateDesc() const;
00106     CPStr GetDesc() const;
00107     CPStr GetKindDesc() const;
00108
00109     void PrintOut(CStr& out) const;
00110
00111 #if qCvsDebug
00112     void PrintOut(void) const;
00113 #endif /* qCvsDebug */
00114
00115 protected:
00116     int status;
00117     CStr pattern;
00118     CStr sample1;
00119     CStr sample2;
00120     int ftype;
00121     int fcreator;
00122 };
00123
00125 class ReportWarning
00126 {
00127 public:
00128     ReportWarning(kTextBinTYPE akind);
00129     virtual ~ReportWarning();
00130
00131     ReportWarning* next;
00132     static const size_t maxWarnings;
00134     void AddWarning(const char* sample);
00135     kTextBinTYPE Kind(void) const;
00136
00137     bool IsError() const;
00138     CPStr GetStateDesc() const;
00139     CPStr GetDesc() const;
00140
00141     void PrintOut(CStr& out) const;
00142
00143 #if qCvsDebug
00144     void PrintOut(void) const;
00145 #endif /* qCvsDebug */
00146
00147 protected:
00148     kTextBinTYPE kind;
00149
00150     std::vector<CStr> samples;
00151     bool tooManyWarnings;
00152 };
00153
00155 class ImportReport : public TraversalReport
00156 {
00157 public:
00158     // Construction
00159     ImportReport(const char* path, ReportWarning*& w, ReportConflict*& c);
00160     virtual ~ImportReport();
00161
00162 private:
00163     // Data members
00164     ReportWarning*& warnings;
00165     ReportConflict*& conflicts;
00166     std::vector<CStr> m_ignlist;
00168     CProgress m_progress;
00170 public:
00171     // Interface
00172
00174     std::vector<CStr>& GetIgnoreList() { return m_ignlist; }
00175
00176     virtual kTraversal EnterDirectory(const char* fullpath, const char* dirname, const UFSSpec* macspec);
00177     virtual kTraversal ExitDirectory(const char* fullpath);
00178     virtual kTraversal OnError(const char* err, int errcode);
00179     virtual kTraversal OnIdle(const char* fullpath);
00180
00181     virtual kTraversal OnDirectory(const char* fullpath, const char* fullname, const char* name,
00182         const struct stat& dir, const UFSSpec* macspec);
00183
00184     virtual kTraversal OnFile(const char* fullpath, const char* fullname, const char* name,
00185         const struct stat& dir, const UFSSpec* macspec);
00186
00187     virtual kTraversal OnAlias(const char*fullpath, const char* fullname, const char* name,
00188         const struct stat& dir, const UFSSpec* macspec);
00189 };
00190
00191 #endif // !defined(AFX_IMPORTFILTER_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "AppConsole.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
00063 enum
00064 {
00065     COL_STATE = 0,
00066     COL_DESC,
00067     COL_KIND,
00068     COL_NUM
00069 };
00070
00071
00073 static char *_gszColumnLabel[COL_NUM] =
00074 {
00075     "Entry state", "Entry description", "Entry kind"
00076 };
00077
00079 static int _gnColumnWidth[COL_NUM] =
00080 {
00081 #if qUnix
00082     80, 270, 80
00083 #else
00084     80, 270, 140
00085 #endif
00086 };
00087
00088
00089 #ifdef WIN32
00090
00092 // CImportWarning
00093
00094 CImportWarning::CImportWarning(ReportWarning* warn, CWnd* pParent /*=NULL*/)
00095     : CDialog(CImportWarning::IDD, pParent)
00096 {
00097     CStr print;
00098     warn->PrintOut(print);
00099     //{{AFX_DATA_INIT(CImportWarning)
00100     m_desc = print;
00101     //}}AFX_DATA_INIT
00102 }
00103
00104
00105 void CImportWarning::DoDataExchange(CDataExchange* pDX)
00106 {
00107     CDialog::DoDataExchange(pDX);
00108     //{{AFX_DATA_MAP(CImportWarning)
00109     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00110     //}}AFX_DATA_MAP
00111 }
00112
00113
00114 BEGIN_MESSAGE_MAP(CImportWarning, CDialog)
00115     //{{AFX_MSG_MAP(CImportWarning)
00116         // NOTE: the ClassWizard will add message map macros here
00117     //}}AFX_MSG_MAP
00118 END_MESSAGE_MAP()
00119
00120 CImportEntry::CImportEntry(ReportConflict* entry, CWnd* pParent /*=NULL*/)
00121     : CDialog(CImportEntry::IDD, pParent)
00122 {
00123     CStr print;
00124     entry->PrintOut(print);
00125
00126     //{{AFX_DATA_INIT(CImportEntry)
00127     //}}AFX_DATA_INIT
00128
00129     //keep these outside MFC remarks
00130     m_desc = print;
00131
00132     if( entry->HasForceBinary() )
00133         m_radios = 1;
00134     else if( entry->HasForceUnicode() )
00135         m_radios = 2;
00136     else if( entry->HasForceText() )
00137         m_radios = 3;
00138     else if( entry->HasForceNoKeywords() )
00139         m_radios = 4;
00140     else if( entry->HasIgnore() )
00141         m_radios = 5;
00142     else
00143         m_radios = 0;
00144 }
00145
00146
00147 void CImportEntry::DoDataExchange(CDataExchange* pDX)
00148 {
00149     CDialog::DoDataExchange(pDX);
00150     //{{AFX_DATA_MAP(CImportEntry)
00151     DDX_Text(pDX, IDC_WARNINGDESC, m_desc);
00152     DDX_Radio(pDX, IDC_ENTRYSTATE, m_radios);
00153     //}}AFX_DATA_MAP
00154 }
00155
00156
00157 BEGIN_MESSAGE_MAP(CImportEntry, CDialog)
00158     //{{AFX_MSG_MAP(CImportEntry)
00159         // NOTE: the ClassWizard will add message map macros here
00160     //}}AFX_MSG_MAP
00161 END_MESSAGE_MAP()
00162
00163
00164 // CImportFilterDlg dialog
00165
00166
00167 CImportFilterDlg::CImportFilterDlg(ReportConflict* entries, ReportWarning* warnings,
00168                                    CWnd* pParent /*=NULL*/)
00169     : CDialog(CImportFilterDlg::IDD, pParent)
00170 {
00171     //{{AFX_DATA_INIT(CImportFilterDlg)
00172     m_entries = entries;
00173     m_warnings = warnings;
00174     //}}AFX_DATA_INIT
00175 }
00176
00177
00178 void CImportFilterDlg::DoDataExchange(CDataExchange* pDX)
00179 {
00180     CDialog::DoDataExchange(pDX);
00181     //{{AFX_DATA_MAP(CImportFilterDlg)
00182     DDX_Control(pDX, IDC_LISTENTRIES, m_list);
00183     DDX_Control(pDX, IDC_EDITENTRY, m_edit);
00184     //}}AFX_DATA_MAP
00185 }
00186
00187
00188 BEGIN_MESSAGE_MAP(CImportFilterDlg, CDialog)
00189     //{{AFX_MSG_MAP(CImportFilterDlg)
00190     ON_BN_CLICKED(IDC_EDITENTRY, OnEditentry)
00191     ON_NOTIFY(NM_DBLCLK, IDC_LISTENTRIES, OnDblclkListentries)
00192     //}}AFX_MSG_MAP
00193 END_MESSAGE_MAP()
00194
00195
00196 // CImportFilterDlg message handlers
00197
00198
00199 void CImportFilterDlg::OnEditentry()
00200 {
00201     // The user wants to edit an entry.
00202     // Start at the top of the list and walk through it until an item
00203     // that is selected is found.
00204     int nItem = m_list.GetNextItem(-1, LVNI_ALL);
00205     while( nItem != -1 )
00206     {
00207         UINT nState = m_list.GetItemState(nItem, LVIS_SELECTED);
00208         if( (nState & LVIS_SELECTED) == LVIS_SELECTED )
00209             break;
00210
00211         nItem = m_list.GetNextItem(nItem, LVNI_ALL);
00212     }
00213
00214     if( nItem == -1 )
00215         return;
00216
00217     int i = 0;
00218     ReportWarning* warn = m_warnings;
00219     while( warn != 0L )
00220     {
00221         if( i == nItem )
00222         {
00223             CImportWarning dlg(warn);
00224             dlg.DoModal();
00225             return;
00226         }
00227
00228         warn = warn->next;
00229         i++;
00230     }
00231
00232     ReportConflict* conf = m_entries;
00233     while( conf != 0L )
00234     {
00235         if( i == nItem )
00236         {
00237             CImportEntry dlg(conf);
00238             if( dlg.DoModal() == IDOK )
00239             {
00240                 switch(dlg.m_radios)
00241                 {
00242                 case 0:
00243                     conf->DisableUserSettings();
00244                     break;
00245                 case 1:
00246                     conf->ForceBinary();
00247                     break;
00248                 case 2:
00249                     conf->ForceUnicode();
00250                     break;
00251                 case 3:
00252                     conf->ForceText();
00253                     break;
00254                 case 4:
00255                     conf->ForceNoKeywords();
00256                     break;
00257                 case 5:
00258                     conf->Ignore();
00259                     break;
00260                 }
00261
00262                 m_list.SetItemText(nItem, COL_KIND, conf->GetKindDesc());
00263             }
00264
00265             return;
00266         }
00267
00268         conf = conf->next;
00269         i++;
00270     }
00271 }
00272
00274 void CImportFilterDlg::OnDblclkListentries(NMHDR* pNMHDR, LRESULT* pResult)
00275 {
00276     OnEditentry();
00277     *pResult = 0;
00278 }
00279
00281 BOOL CImportFilterDlg::OnInitDialog()
00282 {
00283     CDialog::OnInitDialog();
00284
00285     // Need to set up to display the little icons next to each entry
00286     if( m_imageList.m_hImageList == 0L )
00287         m_imageList.Create(IDB_IMPORT, 16, 1, RGB(255, 255, 255));
00288
00289     m_list.SetImageList(&m_imageList, LVSIL_SMALL);
00290
00291     // Full row selection
00292     DWORD dwExStyle = m_list.GetExtendedStyle();
00293     dwExStyle |= LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT;
00294     m_list.SetExtendedStyle(dwExStyle);
00295
00296     // Set up columns inside the list view
00297     m_list.InsertColumn(COL_STATE,  _gszColumnLabel[COL_STATE], LVCFMT_LEFT, _gnColumnWidth[COL_STATE]);
00298     m_list.InsertColumn(COL_DESC,   _gszColumnLabel[COL_DESC], LVCFMT_LEFT, _gnColumnWidth[COL_DESC]);
00299     m_list.InsertColumn(COL_KIND,   _gszColumnLabel[COL_KIND], LVCFMT_LEFT, _gnColumnWidth[COL_KIND]);
00300
00301     int i = 0;
00302     ReportWarning* warn = m_warnings;
00303     while( warn != 0L )
00304     {
00305         // Store this information in the list view
00306         m_list.InsertItem(i, "", warn->IsError() ? 0 : 1);
00307
00308         m_list.SetItemText(i, COL_DESC, warn->GetDesc());
00309         m_list.SetItemText(i, COL_STATE, warn->GetStateDesc());
00310
00311         warn = warn->next;
00312         i++;
00313     }
00314
00315     ReportConflict* conf = m_entries;
00316     while( conf != 0L )
00317     {
00318         // Store this information in the list view
00319         m_list.InsertItem(i, "", conf->HasConflict() ? 0 : 1);
00320
00321         m_list.SetItemText(i, COL_STATE, conf->GetStateDesc());
00322         m_list.SetItemText(i, COL_DESC, conf->GetDesc());
00323         m_list.SetItemText(i, COL_KIND, conf->GetKindDesc());
00324
00325         conf = conf->next;
00326         i++;
00327     }
00328
00329     return TRUE;  // return TRUE unless you set the focus to a control
00330                   // EXCEPTION: OCX Property Pages should return FALSE
00331 }
00332
00333 #endif /* WIN32 */
00334
00335 #ifdef qMacCvsPP
00336 static ReportConflict * gEntries;
00337 static ReportWarning * gWarnings;
00338
00339 COutlineTable::COutlineTable(
00340     LStream *inStream )
00341         : LOutlineTable( inStream )
00342 {
00343     // set the table geometry
00344     LTableMultiGeometry *geom = NEW LTableMultiGeometry(this, 50, 20);
00345     ThrowIfNil_(geom);
00346     SetTableGeometry(geom);
00347
00348     // set the table selector
00349     SetTableSelector(NEW LTableSingleSelector( this )/*LOutlineRowSelector*/ );
00350
00351     // and note that we don't set the table storage....
00352
00353     // most of the table classes not only maintain the graphical
00354     // representation of your data but also the data itself. But
00355     // LOutlineTable doesn't really do this...it mostly handles
00356     // graphical representation... you need to handle your data
00357     // maintenance elsewhere by yourself.
00358
00359     // insert a couple columns (name and size)
00360     InsertCols( 3, 0, nil, nil, false );
00361     geom->SetColWidth(80, 1, 1);
00362     geom->SetColWidth(310, 2, 2);
00363     geom->SetColWidth(90, 3, 3);
00364
00365     // Set up keyboard selection and scrolling.
00366     AddAttachment(NEW LOutlineKeySelector(this, msg_AnyMessage));
00367     AddAttachment(NEW LKeyScrollAttachment(this));
00368
00369     // Try to become default commander in the window.
00370     if (mSuperCommander != nil)
00371         mSuperCommander->SetLatentSub(this);
00372
00373     mIconWarning = nil;
00374     mIconError = nil;
00375
00376     OSErr err = ::GetIconSuite( &mIconError, icons_Error, kSelectorAllAvailableData );
00377     ThrowIfOSErr_(err);
00378     ThrowIfResFail_(mIconError);
00379     err = ::GetIconSuite( &mIconWarning, icons_Warning, kSelectorAllAvailableData );
00380     ThrowIfOSErr_(err);
00381     ThrowIfResFail_(mIconWarning);
00382 }
00383
00384 COutlineTable::~COutlineTable()
00385 {
00386     if (mIconWarning != 0L)
00387         ::DisposeIconSuite(mIconWarning, true);
00388     if (mIconError != 0L)
00389         ::DisposeIconSuite(mIconError, true);
00390 }
00391
00392 void COutlineTable::FinishCreateSelf()
00393 {
00394     // insert the root level of the disk into the table
00395     LOutlineItem *theItem = nil;
00396     LOutlineItem *lastItem = nil;
00397
00398     ReportWarning * warn = gWarnings;
00399     while(warn != 0L)
00400     {
00401         // Store this information in the list view
00402         CWarningItem *theItem = NEW CWarningItem(warn, mIconWarning, mIconError);
00403         ThrowIfNil_(theItem);
00404
00405         // and insert it at the end of the table
00406         InsertItem( theItem, nil, lastItem );
00407         lastItem = theItem;
00408
00409         warn = warn->next;
00410     }
00411
00412     ReportConflict * conf = gEntries;
00413     while(conf != 0L)
00414     {
00415         // Store this information in the list view
00416         CEntryItem *theItem = NEW CEntryItem(conf, mIconWarning, mIconError);
00417         ThrowIfNil_(theItem);
00418
00419         // and insert it at the end of the table
00420         InsertItem( theItem, nil, lastItem );
00421         lastItem = theItem;
00422
00423         conf = conf->next;
00424     }
00425 }
00426
00427 CWarningItem::CWarningItem(ReportWarning * entry, Handle war_icon, Handle err_icon)
00428 {
00429     mEntry = entry;
00430     mErrIcon = err_icon;
00431     mWarnIcon = war_icon;
00432 }
00433
00434 CWarningItem::~CWarningItem()
00435 {
00436 }
00437
00438 // this is the routine called to know what to draw within the
00439 // table cell. See the comments in LOutlineItem.cp for more info.
00440 void
00441 CWarningItem::GetDrawContentsSelf(
00442     const STableCell&       inCell,
00443     SOutlineDrawContents&   ioDrawContents)
00444 {
00445     switch (inCell.col)
00446     {
00447     case 1:
00448         bool isError = mEntry->Kind() != kFileIsOK && mEntry->Kind() != kTextEscapeChar;
00449         ioDrawContents.outShowSelection = true;
00450         ioDrawContents.outHasIcon = true;
00451         ioDrawContents.outIconSuite = isError ? mErrIcon : mWarnIcon;
00452
00453         if(isError)
00454         {
00455             LString::CopyPStr("\pError", ioDrawContents.outTextString);
00456             ioDrawContents.outTextTraits.style = bold;
00457         }
00458         else
00459         {
00460             LString::CopyPStr("\pWarning", ioDrawContents.outTextString);
00461             ioDrawContents.outTextTraits.style = 0;
00462         }
00463         break;
00464
00465     case 2:
00466         ioDrawContents.outShowSelection = true;
00467         ioDrawContents.outTextTraits.style = 0;
00468
00469         LString::CopyPStr(mEntry->GetDesc(), ioDrawContents.outTextString);
00470         break;
00471     case 3:
00472         ioDrawContents.outShowSelection = false;
00473         break;
00474     }
00475 }
00476
00477 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00478 // comments for more information). We'll draw a groovy gray background
00479 void
00480 CWarningItem::DrawRowAdornments(
00481     const Rect&     inLocalRowRect )
00482 {
00483     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
00484 }
00485
00486 void CWarningItem::EditImportCell(void)
00487 {
00488     StDialogHandler theHandler(dlg_ImpFilterWarn, LCommander::GetTopCommander());
00489     LWindow *theDialog = theHandler.GetDialog();
00490     ThrowIfNil_(theDialog);
00491
00492     LTextEditView *warn = dynamic_cast<LTextEditView*>
00493         (theDialog->FindPaneByID(item_ImpEditWarn));
00494     CStr print;
00495     mEntry->PrintOut(print);
00496     warn->SetTextPtr((Ptr)(const char *)print, print.length());
00497
00498     theDialog->Show();
00499     MessageT hitMessage;
00500     while (true)
00501     {       // Let DialogHandler process events
00502         hitMessage = theHandler.DoDialog();
00503
00504         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00505             break;
00506     }
00507     theDialog->Hide();
00508 }
00509
00510 void
00511 CWarningItem::DoubleClick(
00512     const STableCell&           /* inCell */,
00513     const SMouseDownEvent&      /* inMouseDown */,
00514     const SOutlineDrawContents& /* inDrawContents */,
00515     Boolean                     /* inHitText */)
00516 {
00517     EditImportCell();
00518 }
00519
00520 CEntryItem::CEntryItem( ReportConflict * entry, Handle war_icon, Handle err_icon)
00521 {
00522     mEntry = entry;
00523     mErrIcon = err_icon;
00524     mWarnIcon = war_icon;
00525 }
00526
00527 CEntryItem::~CEntryItem()
00528 {
00529 }
00530
00531 // this is the routine called to know what to draw within the
00532 // table cell. See the comments in LOutlineItem.cp for more info.
00533 void
00534 CEntryItem::GetDrawContentsSelf(
00535     const STableCell&       inCell,
00536     SOutlineDrawContents&   ioDrawContents)
00537 {
00538     CPStr str;
00539
00540     switch (inCell.col)
00541     {
00542     case 1:
00543         ioDrawContents.outShowSelection = true;
00544         ioDrawContents.outHasIcon = true;
00545         ioDrawContents.outIconSuite = mEntry->HasConflict() ? mErrIcon : mWarnIcon;
00546
00547         if(mEntry->HasConflict())
00548         {
00549             str << "Conflict";
00550             ioDrawContents.outTextTraits.style = bold;
00551         }
00552         else if(mEntry->HasTypeCreatorConflict())
00553         {
00554             str << "Warning";
00555             ioDrawContents.outTextTraits.style = 0;
00556         }
00557         else
00558         {
00559             str << "OK";
00560             ioDrawContents.outTextTraits.style = 0;
00561         }
00562         LString::CopyPStr(str, ioDrawContents.outTextString);
00563         break;
00564
00565     case 2:
00566         ioDrawContents.outShowSelection = true;
00567         ioDrawContents.outHasIcon = false/*true*/;
00568         ioDrawContents.outIconSuite = 0L/*mIconH*/;
00569         ioDrawContents.outTextTraits.style = 0;
00570
00571         str << mEntry->GetDesc();
00572         LString::CopyPStr(str, ioDrawContents.outTextString);
00573         break;
00574
00575     case 3:
00576         ioDrawContents.outShowSelection = true;
00577         ioDrawContents.outHasIcon = false;
00578         ioDrawContents.outTextTraits.style = 0;
00579
00580         if(mEntry->HasForceBinary())
00581         {
00582             LString::CopyPStr("\pFORCE BINARY", ioDrawContents.outTextString);
00583             ioDrawContents.outTextTraits.style = bold;
00584         }
00585         else if(mEntry->HasForceText())
00586         {
00587             LString::CopyPStr("\pFORCE TEXT", ioDrawContents.outTextString);
00588             ioDrawContents.outTextTraits.style = bold;
00589         }
00590         else if(mEntry->HasIgnore())
00591         {
00592             LString::CopyPStr("\pIGNORE", ioDrawContents.outTextString);
00593             ioDrawContents.outTextTraits.style = bold;
00594         }
00595         else if(mEntry->IsBinary())
00596         {
00597             LString::CopyPStr("\pBINARY", ioDrawContents.outTextString);
00598             ioDrawContents.outTextTraits.style = 0;
00599         }
00600         else
00601         {
00602             LString::CopyPStr("\pTEXT", ioDrawContents.outTextString);
00603             ioDrawContents.outTextTraits.style = 0;
00604         }
00605         break;
00606     }
00607 }
00608
00609 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
00610 // comments for more information). We'll draw a groovy gray background
00611 void
00612 CEntryItem::DrawRowAdornments(
00613     const Rect&     inLocalRowRect )
00614 {
00615     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
00616 }
00617
00618 static void DoDataExchange_ImpEditEntry(LWindow *theDialog, ReportConflict * mEntry, bool putValue)
00619 {
00620     LTextEditView *warn = dynamic_cast<LTextEditView*>
00621         (theDialog->FindPaneByID(item_ImpEditWarn));
00622
00623     if(putValue)
00624     {
00625         if(mEntry->HasForceBinary())
00626             theDialog->SetValueForPaneID (item_ImpEntryFBin, Button_On);
00627         else if(mEntry->HasForceText())
00628             theDialog->SetValueForPaneID (item_ImpEntryFText, Button_On);
00629         else if(mEntry->HasIgnore())
00630             theDialog->SetValueForPaneID (item_ImpEntryFIgn, Button_On);
00631         else
00632             theDialog->SetValueForPaneID (item_ImpEntryUnch, Button_On);
00633         CStr print;
00634         mEntry->PrintOut(print);
00635         warn->SetTextPtr((Ptr)(const char *)print, print.length());
00636     }
00637     else
00638     {
00639         if(theDialog->GetValueForPaneID (item_ImpEntryFBin) == Button_On)
00640             mEntry->ForceBinary();
00641         else if(theDialog->GetValueForPaneID (item_ImpEntryFText) == Button_On)
00642             mEntry->ForceText();
00643         else if(theDialog->GetValueForPaneID (item_ImpEntryFIgn) == Button_On)
00644             mEntry->Ignore();
00645         else
00646             mEntry->DisableUserSettings();
00647     }
00648 }
00649
00650 void CEntryItem::EditImportCell(void)
00651 {
00652     StDialogHandler theHandler(dlg_ImpFilterEntry, LCommander::GetTopCommander());
00653     LWindow *theDialog = theHandler.GetDialog();
00654     ThrowIfNil_(theDialog);
00655
00656     DoDataExchange_ImpEditEntry(theDialog, mEntry, true);
00657
00658     theDialog->Show();
00659     MessageT hitMessage;
00660     while (true)
00661     {       // Let DialogHandler process events
00662         hitMessage = theHandler.DoDialog();
00663
00664         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00665             break;
00666     }
00667     theDialog->Hide();
00668
00669     if(hitMessage == msg_OK)
00670     {
00671         DoDataExchange_ImpEditEntry(theDialog, mEntry, false);
00672         mOutlineTable->Refresh();
00673     }
00674 }
00675
00676 void
00677 CEntryItem::DoubleClick(
00678     const STableCell&           /* inCell */,
00679     const SMouseDownEvent&      /* inMouseDown */,
00680     const SOutlineDrawContents& /* inDrawContents */,
00681     Boolean                     /* inHitText */)
00682 {
00683     EditImportCell();
00684 }
00685 #endif /* qMacCvsPP */
00686
00687 #if qUnix
00688 class UCvsImpWarning : public UWidget
00689 {
00690     UDECLARE_DYNAMIC(UCvsImpWarning)
00691 public:
00692     UCvsImpWarning(ReportWarning * warn);
00693     virtual ~UCvsImpWarning() {}
00694
00695     enum
00696     {
00697         kOK = EV_COMMAND_START, // 0
00698         kDesc                   // 1
00699     };
00700
00701     virtual void DoDataExchange(bool fill);
00702
00703 protected:
00704     UStr m_desc;
00705
00706     ev_msg int OnOK(void);
00707
00708     UDECLARE_MESSAGE_MAP()
00709 };
00710
00711 UIMPLEMENT_DYNAMIC(UCvsImpWarning, UWidget)
00712
00713 UBEGIN_MESSAGE_MAP(UCvsImpWarning, UWidget)
00714     ON_UCOMMAND(UCvsImpWarning::kOK, UCvsImpWarning::OnOK)
00715 UEND_MESSAGE_MAP()
00716
00717 UCvsImpWarning::UCvsImpWarning(ReportWarning * warn) : UWidget(::UEventGetWidID())
00718 {
00719     warn->PrintOut(m_desc);
00720 }
00721
00722 int UCvsImpWarning::OnOK(void)
00723 {
00724     EndModal(true);
00725     return 0;
00726 }
00727
00728 void UCvsImpWarning::DoDataExchange(bool fill)
00729 {
00730     if(fill)
00731     {
00732         UEventSendMessage(GetWidID(), EV_SETTEXT, kDesc, (void *)(const char *)m_desc);
00733     }
00734     else
00735     {
00736     }
00737 }
00738
00739 class UCvsImpEntry : public UWidget
00740 {
00741     UDECLARE_DYNAMIC(UCvsImpEntry)
00742 public:
00743     UCvsImpEntry(ReportConflict * entry);
00744     virtual ~UCvsImpEntry() {}
00745
00746     enum
00747     {
00748         kOK = EV_COMMAND_START, // 0
00749         kCancel,                // 1
00750         kRadUnchanged,          // 2
00751         kRadBinary,             // 3
00752         kRadText,               // 4
00753         kRadIgnore,             // 5
00754         kDesc                   // 6
00755     };
00756
00757     virtual void DoDataExchange(bool fill);
00758
00759     int m_radios;
00760 protected:
00761     UStr m_desc;
00762
00763     ev_msg int OnOK(void);
00764     ev_msg int OnCancel(void);
00765     ev_msg int OnRadios(int cmd);
00766
00767     UDECLARE_MESSAGE_MAP()
00768 };
00769
00770 UIMPLEMENT_DYNAMIC(UCvsImpEntry, UWidget)
00771
00772 UBEGIN_MESSAGE_MAP(UCvsImpEntry, UWidget)
00773     ON_UCOMMAND(UCvsImpEntry::kOK, UCvsImpEntry::OnOK)
00774     ON_UCOMMAND(UCvsImpEntry::kCancel, UCvsImpEntry::OnCancel)
00775     ON_UCOMMAND_RANGE(UCvsImpEntry::kRadUnchanged, UCvsImpEntry::kRadIgnore, UCvsImpEntry::OnRadios)
00776 UEND_MESSAGE_MAP()
00777
00778 UCvsImpEntry::UCvsImpEntry(ReportConflict * entry) : UWidget(::UEventGetWidID())
00779 {
00780     entry->PrintOut(m_desc);
00781
00782     if(entry->HasForceBinary())
00783         m_radios = 1;
00784     else if(entry->HasForceText())
00785         m_radios = 2;
00786     else if(entry->HasIgnore())
00787         m_radios = 3;
00788     else
00789         m_radios = 0;
00790 }
00791
00792 int UCvsImpEntry::OnOK(void)
00793 {
00794     EndModal(true);
00795     return 0;
00796 }
00797
00798 int UCvsImpEntry::OnCancel(void)
00799 {
00800     EndModal(false);
00801     return 0;
00802 }
00803
00804 int UCvsImpEntry::OnRadios(int cmd)
00805 {
00806     m_radios = cmd - kRadUnchanged;
00807     return 0;
00808 }
00809
00810 void UCvsImpEntry::DoDataExchange(bool fill)
00811 {
00812     if(fill)
00813     {
00814         UEventSendMessage(GetWidID(), EV_SETTEXT, kDesc, (void *)(const char *)m_desc);
00815         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRadUnchanged + m_radios, 1), 0L);
00816     }
00817     else
00818     {
00819     }
00820 }
00821
00822 #if qGTK
00823 static void *sWarningIcon;
00824 static void *sErrorIcon;
00825 #endif
00826
00827 class UCvsImpFilter : public UWidget
00828 {
00829     UDECLARE_DYNAMIC(UCvsImpFilter)
00830 public:
00831     UCvsImpFilter(ReportConflict * entries, ReportWarning * warnings);
00832     virtual ~UCvsImpFilter() {}
00833
00834     enum
00835     {
00836         kOK = EV_COMMAND_START, // 0
00837         kCancel,                // 1
00838         kList,                  // 2
00839         kEdit                   // 3
00840     };
00841
00842     virtual void DoDataExchange(bool fill);
00843
00844 protected:
00845     ReportConflict *m_entries;
00846     ReportWarning *m_warnings;
00847
00848     ev_msg int OnOK(void);
00849     ev_msg int OnCancel(void);
00850     ev_msg int OnEdit(void);
00851     ev_msg void OnDblClick(void);
00852
00853     UDECLARE_MESSAGE_MAP()
00854 };
00855
00856 UIMPLEMENT_DYNAMIC(UCvsImpFilter, UWidget)
00857
00858 UBEGIN_MESSAGE_MAP(UCvsImpFilter, UWidget)
00859     ON_UCOMMAND(UCvsImpFilter::kOK, UCvsImpFilter::OnOK)
00860     ON_UCOMMAND(UCvsImpFilter::kCancel, UCvsImpFilter::OnCancel)
00861     ON_UCOMMAND(UCvsImpFilter::kEdit, UCvsImpFilter::OnEdit)
00862     ON_LIST_DBLCLICK(UCvsImpFilter::kList, UCvsImpFilter::OnDblClick)
00863 UEND_MESSAGE_MAP()
00864
00865 UCvsImpFilter::UCvsImpFilter(ReportConflict * entries, ReportWarning * warnings) :
00866     UWidget(::UEventGetWidID())
00867 {
00868     m_entries = entries;
00869     m_warnings = warnings;
00870 }
00871
00872 int UCvsImpFilter::OnOK(void)
00873 {
00874     EndModal(true);
00875     return 0;
00876 }
00877
00878 int UCvsImpFilter::OnCancel(void)
00879 {
00880     EndModal(false);
00881     return 0;
00882 }
00883
00884 void UCvsImpFilter::OnDblClick(void)
00885 {
00886     OnEdit();
00887 }
00888
00889 void UCvsImpFilter::DoDataExchange(bool fill)
00890 {
00891     if(sWarningIcon == 0L)
00892     {
00893         sWarningIcon = UCreate_pixmap(this, "warning.xpm");
00894         sErrorIcon = UCreate_pixmap(this, "error.xpm");
00895     }
00896
00897     if(fill)
00898     {
00899         UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kList, 0), 0L);
00900         UEventSendMessage(GetWidID(), EV_LIST_ADDCOLUMNS, UMAKEINT(kList, COL_NUM), 0L);
00901         for(int i = 0; i < COL_NUM; i++)
00902         {
00903             UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kList, i),
00904                               _gszColumnLabel[i]);
00905             UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kList, i),
00906                               (void *)_gnColumnWidth[i]);
00907         }
00908         UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kList, 1), 0L);
00909
00910         UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kList, 0L);
00911
00912         ReportWarning * warn = m_warnings;
00913         while(warn != 0L)
00914         {
00915             int rownum;
00916             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kList, &rownum);
00917             UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kList, rownum), warn);
00918             ULIST_INSERT entry;
00919             entry.row = rownum;
00920
00921             entry.col = 0;
00922             entry.title = warn->GetStateDesc();
00923             entry.icon = 0L;
00924 #if qGTK
00925             entry.icon = warn->IsError() ? sErrorIcon : sWarningIcon;
00926 #endif
00927             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
00928
00929             entry.col = 1;
00930             entry.title = warn->GetDesc();
00931             entry.icon = 0L;
00932             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
00933
00934             warn = warn->next;
00935         }
00936
00937         ReportConflict * conf = m_entries;
00938         while(conf != 0L)
00939         {
00940             int rownum;
00941             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kList, &rownum);
00942             UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kList, rownum), conf);
00943             ULIST_INSERT entry;
00944             entry.row = rownum;
00945
00946             entry.col = 0;
00947             entry.title = conf->GetStateDesc();
00948             entry.icon = 0L;
00949 #if qGTK
00950             entry.icon = conf->HasConflict() ? sErrorIcon : sWarningIcon;
00951 #endif
00952             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
00953
00954             entry.col = 1;
00955             entry.title = conf->GetDesc();
00956             entry.icon = 0L;
00957             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
00958
00959             entry.col = 2;
00960             entry.title = conf->GetKindDesc();
00961             entry.icon = 0L;
00962             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
00963
00964             conf = conf->next;
00965         }
00966     }
00967     else
00968     {
00969     }
00970 }
00971
00972 int UCvsImpFilter::OnEdit()
00973 {
00974     int row = -1;
00975     if((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
00976                                 UMAKEINT(kList, row), 0L)) == -1)
00977         return 0;
00978
00979     ULIST_INFO info;
00980     info.col = 0;
00981     info.row = row;
00982     UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kList, &info);
00983
00984     ReportWarning * warn = m_warnings;
00985     while(warn != 0L)
00986     {
00987         if(warn == info.data)
00988         {
00989             void *wid = UCreate_ImpWarningDlg();
00990             UCvsImpWarning *dlg = new UCvsImpWarning(warn);
00991             UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00992             dlg->DoModal();
00993             delete dlg;
00994             return 0;
00995         }
00996         warn = warn->next;
00997     }
00998
00999     ReportConflict * conf = m_entries;
01000     while(conf != 0L)
01001     {
01002         if(conf == info.data)
01003         {
01004             void *wid = UCreate_ImpEntryDlg();
01005             UCvsImpEntry *dlg = new UCvsImpEntry(conf);
01006             UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01007             if(dlg->DoModal())
01008             {
01009                 ULIST_INSERT entry;
01010                 entry.row = row;
01011
01012                 entry.col = 2;
01013                 entry.title = 0L;
01014                 entry.icon = /*UCvsFiles::GetImageForEntry(data)*/0L;
01015                 switch(dlg->m_radios)
01016                 {
01017                 case 0:
01018                     conf->DisableUserSettings();
01019                     break;
01020                 case 1:
01021                     conf->ForceBinary();
01022                     break;
01023                 case 2:
01024                     conf->ForceText();
01025                     break;
01026                 case 3:
01027                     conf->Ignore();
01028                     break;
01029                 }
01030
01031                 entry.title = conf->GetKindDesc();
01032
01033                 if( entry.title != 0L )
01034                     UEventSendMessage(GetWidID(), EV_LIST_INSERT, kList, &entry);
01035             }
01036             delete dlg;
01037             return 0;
01038         }
01039
01040         conf = conf->next;
01041     }
01042     return 0;
01043 }
01044 #endif /* qUnix */
01045
01047 bool CompatImportFilter(const char* path, ReportConflict*& entries, ReportWarning*& warnings)
01048 {
01049     bool result = false;
01050     entries = 0L;
01051     warnings = 0L;
01052
01053     const kTraversal traversalResult = list_all_types_recur(path, warnings, entries);
01054     if( traversalResult != kContinueTraversal )
01055     {
01056         cvs_err("Import aborted on user's request.\n");
01057
01058         free_list_types(warnings, entries);
01059         entries = 0L;
01060         warnings = 0L;
01061
01062         return false;
01063     }
01064
01065     if( entries == 0L && warnings == 0L )
01066     {
01067         cvs_err("Import aborted - nothing to import.\n");
01068         return false;
01069     }
01070
01071 #ifdef WIN32
01072     CImportFilterDlg pages(entries, warnings);
01073     if( pages.DoModal() == IDOK )
01074     {
01075         result = true;
01076     }
01077     else
01078     {
01079         cvs_err("Import aborted.\n");
01080     }
01081 #endif /* WIN32 */
01082 #ifdef qMacCvsPP
01083     gWarnings = warnings;
01084     gEntries = entries;
01085
01086     StDialogHandler theHandler(dlg_ImpFilter, LCommander::GetTopCommander());
01087     LWindow *theDialog = theHandler.GetDialog();
01088     ThrowIfNil_(theDialog);
01089
01090     theDialog->Show();
01091     MessageT hitMessage;
01092     while (true)
01093     {       // Let DialogHandler process events
01094         hitMessage = theHandler.DoDialog();
01095
01096         if(hitMessage == item_ImpPushEdit)
01097         {
01098             // simulate dbl click
01099             LOutlineTable *tab = dynamic_cast<LOutlineTable*>
01100                 (theDialog->FindPaneByID(item_ImpFilterList));
01101
01102             STableCell  cell = tab->GetFirstSelectedCell();
01103             if(!cell.IsNullCell())
01104             {
01105                 //TableIndexT index;
01106                 //tab->CellToIndex(cell, index);
01107                 CImportItem *item = dynamic_cast<CImportItem*>(tab->FindItemForRow(cell.row));
01108                 Assert_(item != 0L);
01109                 if(item != 0L)
01110                     item->EditImportCell();
01111             }
01112         }
01113
01114         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01115             break;
01116     }
01117     theDialog->Hide();
01118
01119     if(hitMessage == msg_OK)
01120     {
01121         result = true;
01122     }
01123 #endif /* qMacCvsPP */
01124 #if qUnix
01125     void *wid = UCreate_ImportFilterDlg();
01126
01127     UCvsImpFilter *dlg = new UCvsImpFilter(entries, warnings);
01128     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01129
01130     if(dlg->DoModal())
01131     {
01132         result = true;
01133     }
01134
01135     delete dlg;
01136 #endif // qUnix
01137
01138     if( !result )
01139     {
01140         free_list_types(warnings, entries);
01141         entries = 0L;
01142         warnings = 0L;
01143     }
01144
01145     return result;
01146 }
Generated on Fri Jan 31 12:08:41 2003 for WinCvs Source by doxygen 1.3-rc2


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, ReportWarning*& warnings);
00031
00032 #if _MSC_VER >= 1000
00033 #pragma once
00034 #endif // _MSC_VER >= 1000
00035
00036 #ifdef WIN32
00037
00038 // CImportFilterDlg dialog
00039
00040 class CImportFilterDlg : public CDialog
00041 {
00042 // Construction
00043 public:
00044     CImportFilterDlg(ReportConflict* entries, ReportWarning* warnings,
00045         CWnd* pParent = NULL);   // standard constructor
00046
00047 // Dialog Data
00048     //{{AFX_DATA(CImportFilterDlg)
00049     enum { IDD = IDD_IMPORTFILTER };
00050     CListCtrl   m_list;
00051     CButton m_edit;
00052     //}}AFX_DATA
00053
00054
00055 // Overrides
00056     // ClassWizard generated virtual function overrides
00057     //{{AFX_VIRTUAL(CImportFilterDlg)
00058     protected:
00059     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00060     //}}AFX_VIRTUAL
00061
00062 // Implementation
00063 protected:
00064     // Generated message map functions
00065     //{{AFX_MSG(CImportFilterDlg)
00066     afx_msg void OnEditentry();
00067     virtual BOOL OnInitDialog();
00068     afx_msg void OnDblclkListentries(NMHDR* pNMHDR, LRESULT* pResult);
00069     //}}AFX_MSG
00070     DECLARE_MESSAGE_MAP()
00071 private:
00072     CImageList m_imageList;
00073     ReportConflict* m_entries;
00074     ReportWarning* m_warnings;
00075 };
00076
00077 class CImportWarning : public CDialog
00078 {
00079 // Construction
00080 public:
00081     CImportWarning(ReportWarning* warn, CWnd* pParent = NULL);   // standard constructor
00082
00083 // Dialog Data
00084     //{{AFX_DATA(CImportWarning)
00085     enum { IDD = IDD_WARNINGDESC };
00086     CString m_desc;
00087     //}}AFX_DATA
00088
00089
00090 // Overrides
00091     // ClassWizard generated virtual function overrides
00092     //{{AFX_VIRTUAL(CImportWarning)
00093     protected:
00094     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00095     //}}AFX_VIRTUAL
00096
00097 // Implementation
00098 protected:
00099
00100     // Generated message map functions
00101     //{{AFX_MSG(CImportWarning)
00102         // NOTE: the ClassWizard will add member functions here
00103     //}}AFX_MSG
00104     DECLARE_MESSAGE_MAP()
00105 };
00106
00107 class CImportEntry : public CDialog
00108 {
00109 // Construction
00110 public:
00111     CImportEntry(ReportConflict* entry, CWnd* pParent = NULL);   // standard constructor
00112
00113 // Dialog Data
00114     //{{AFX_DATA(CImportEntry)
00115     enum { IDD = IDD_ENTRYDESC };
00116     CString m_desc;
00117     int m_radios;
00118     //}}AFX_DATA
00119
00120
00121 // Overrides
00122     // ClassWizard generated virtual function overrides
00123     //{{AFX_VIRTUAL(CImportEntry)
00124     protected:
00125     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00126     //}}AFX_VIRTUAL
00127
00128 // Implementation
00129 protected:
00130
00131     // Generated message map functions
00132     //{{AFX_MSG(CImportEntry)
00133         // NOTE: the ClassWizard will add member functions here
00134     //}}AFX_MSG
00135     DECLARE_MESSAGE_MAP()
00136 };
00137
00138 //{{AFX_INSERT_LOCATION}}
00139 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00140
00141 #endif /* WIN32 */
00142
00143 #ifdef qMacCvsPP
00144 #include <LOutlineTable.h>
00145 #include <LCommander.h>
00146 #include <LOutlineItem.h>
00147 #include <LString.h>
00148
00149 class COutlineTable : public LOutlineTable, public LCommander
00150 {
00151 public:
00152     enum { class_ID = 'Cout' };
00153
00154     COutlineTable( LStream *inStream );
00155     virtual ~COutlineTable();
00156 protected:
00157     virtual void FinishCreateSelf();
00158
00159     Handle mIconWarning;
00160     Handle mIconError;
00161 private:
00162     // defensive programming
00163     COutlineTable();
00164     COutlineTable( const COutlineTable &inOriginal );
00165     COutlineTable&      operator=( const COutlineTable &inOriginal );
00166 };
00167
00168 class CImportItem : public LOutlineItem
00169 {
00170 public:
00171     virtual void EditImportCell(void) = 0;
00172 };
00173
00174 class CEntryItem : public CImportItem
00175 {
00176 public:
00177     CEntryItem(ReportConflict * entry, Handle war_icon, Handle err_icon);
00178     virtual ~CEntryItem();
00179
00180     virtual void EditImportCell(void);
00181 protected:
00182
00183     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00184
00185     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00186
00187     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00188         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00189
00190     ReportConflict * mEntry;
00191     Handle mErrIcon;
00192     Handle mWarnIcon;
00193 private:
00194     // defensive programming
00195     CEntryItem();
00196     CEntryItem( const CEntryItem &inOriginal );
00197     CEntryItem& operator=( const CEntryItem &inOriginal );
00198 };
00199
00200 class CWarningItem : public CImportItem
00201 {
00202 public:
00203     CWarningItem(ReportWarning * warn, Handle war_icon, Handle err_icon);
00204     virtual ~CWarningItem();
00205
00206     virtual void EditImportCell(void);
00207 protected:
00208
00209     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00210
00211     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00212
00213     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00214         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00215
00216     ReportWarning * mEntry;
00217     Handle mErrIcon;
00218     Handle mWarnIcon;
00219 private:
00220     // defensive programming
00221     CWarningItem();
00222     CWarningItem( const CWarningItem &inOriginal );
00223     CWarningItem&   operator=( const CWarningItem &inOriginal );
00224 };
00225 #endif /* qMacCvsPP */
00226
00227 #endif // !defined(AFX_IMPORTFILDERDLG_H__CFB7AA41_BDDB_11D1_B965_0020AF51D9DA__INCLUDED_)
Generated on Fri Jan 31 12:08:41 2003 for WinCvs Source by doxygen 1.3-rc2


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(bool forceRoot)
00048     : CPropertyPage(CInit_MAIN::IDD)
00049 {
00050     m_forceroot = forceRoot;
00051     m_helpinit = _T("If the CVSROOT (see next tab) is set to ""local"", "
00052         "the CVSROOT should be a Windows path (i.e. c:\\cvsroot). "
00053         "If the CVSROOT points on a remote machine, the path should be a Unix path "
00054         "(i.e. /fscvs/cvsroot : make sure you got the relevant security rights in "
00055         "order to create such a directory on the remote machine.");
00056 }
00057
00058 void CInit_MAIN::DoDataExchange(CDataExchange* pDX)
00059 {
00060     CPropertyPage::DoDataExchange(pDX);
00061     //{{AFX_DATA_MAP(CInit_MAIN)
00062     DDX_Check(pDX, IDC_FORCEROOT, m_forceroot);
00063     DDX_Text(pDX, IDC_HELPINIT, m_helpinit);
00064     //}}AFX_DATA_MAP
00065 }
00066
00067 BEGIN_MESSAGE_MAP(CInit_MAIN, CPropertyPage)
00068     //{{AFX_MSG_MAP(CInit_MAIN)
00069     //}}AFX_MSG_MAP
00070 END_MESSAGE_MAP()
00071
00072 IMPLEMENT_DYNAMIC(CInit_MAIN, CPropertyPage)
00073
00074
00075 // CInit_MAIN message handlers
00076 #endif
00077
00078 bool CompatGetInit(bool & forceCvsroot)
00079 {
00080     bool userHitOK = false;
00081
00082     forceCvsroot = true;
00083
00084 #ifdef WIN32
00085     CPropertySheet pages("Init settings");
00086     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00087     CInit_MAIN page1(forceCvsroot);
00088     CGetPrefs_CVSROOT page2;
00089     CGetPrefs_GLOBALS page3;
00090     pages.AddPage(&page1);
00091     pages.AddPage(&page2);
00092     pages.AddPage(&page3);
00093     if(pages.DoModal() == IDOK)
00094     {
00095         forceCvsroot = page1.m_forceroot == TRUE;
00096
00097         page2.StoreValues();
00098         page3.StoreValues();
00099         userHitOK = true;
00100     }
00101 #endif /* WIN32 */
00102
00103     if(userHitOK)
00104     {
00105         gCvsPrefs.save();
00106     }
00107     return userHitOK;
00108 }
Generated on Fri Jan 31 12:08:41 2003 for WinCvs Source by doxygen 1.3-rc2


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_DYNAMIC(CInit_MAIN)
00044
00045 // Construction
00046 public:
00047     CInit_MAIN(bool forceRoot);
00048
00049 // Dialog Data
00050     //{{AFX_DATA(CInit_MAIN)
00051     enum { IDD = IDD_INIT_MAIN };
00052     BOOL    m_forceroot;
00053     CString m_helpinit;
00054     //}}AFX_DATA
00055
00056
00057 // Overrides
00058     // ClassWizard generated virtual function overrides
00059     //{{AFX_VIRTUAL(CInit_MAIN)
00060     protected:
00061     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00062     //}}AFX_VIRTUAL
00063
00064 // Implementation
00065 protected:
00066
00067     // Generated message map functions
00068     //{{AFX_MSG(CInit_MAIN)
00069     //}}AFX_MSG
00070     DECLARE_MESSAGE_MAP()
00071 };
00072
00073 //{{AFX_INSERT_LOCATION}}
00074 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00075 #endif
00076
00077 #endif // !defined(AFX_INITDLG_H__155D02C3_2323_11D3_B1A6_004095463819__INCLUDED_)
Generated on Fri Jan 31 12:08:41 2003 for WinCvs Source by doxygen 1.3-rc2


common/ItemListDlg.cpp Source File

common/ItemListDlg.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> (Originally: Sebastien Abras <sabdev@ibelgique.com>) --- July 2002
00019  */
00020
00021 // ItemListDlg.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #if qUnix
00027 #   include "UCvsDialogs.h"
00028 #endif
00029
00030 #ifdef WIN32
00031 #   include "wincvs.h"
00032 #   include "wincvsView.h"
00033 #   include "wincvs_winutil.h"
00034 #endif /* !WIN32 */
00035
00036 #ifdef qMacCvsPP
00037 #   include <Icons.h>
00038
00039 #   include <UModalDialogs.h>
00040 #   include <LTableMultiGeometry.h>
00041 #   include <LOutlineKeySelector.h>
00042 #   include <LTableSingleSelector.h>
00043 #   include <LOutlineRowSelector.h>
00044 #   include <UAttachments.h>
00045 #   include <UGAColorRamp.h>
00046 #   include <LTextEditView.h>
00047
00048 #   include "MacCvsConstant.h"
00049 #   include "LPopupFiller.h"
00050 #endif /* qMacCvsPP */
00051
00052 #include "MultiString.h"
00053 #include "ItemListDlg.h"
00054 #include "CvsCommands.h"
00055
00056 #include "CvsArgs.h"
00057 #include "cvsgui_process.h"
00058 #include "AppConsole.h"
00059 #include "CvsEntries.h"
00060 #include "SelectionDetailsDlg.h"
00061 #include "CvsAlert.h"
00062
00063
00064 #ifdef _DEBUG
00065 #define new DEBUG_NEW
00066 #undef THIS_FILE
00067 static char THIS_FILE[] = __FILE__;
00068 #endif
00069
00070
00071 #define STR_ITEMLIST_DIR        "<Dir>"
00072 #define STR_ITEMLIST_UP_DIR     ".."
00073 #define STR_ITEMLIST_BRANCH     "Branch"
00074 #define STR_ITEMLIST_REVISION   "Revision"
00075
00077 CPersistentBool gItemListTagRecurse("P_ItemListTagRecurse", false);
00078
00080 CPersistentBool gItemListModuleList("P_ItemListModuleList", false, kAddSettings);
00081
00083 CPersistentInt gItemListAutoRefreshTag("P_ItemListAutoRefreshTag", kAutoRefreshFirstTime);
00084
00086 CPersistentInt gItemListAutoRefreshModule("P_ItemListAutoRefreshModule", kAutoRefreshFirstTime);
00087
00088
00090 // CItemListConsole
00091
00092 CItemListConsole::CItemListConsole()
00093 {
00094     m_launchRes = 0;
00095 }
00096
00097 CItemListConsole::~CItemListConsole()
00098 {
00099     m_itemList.clear();
00100 }
00101
00102 long CItemListConsole::cvs_out(char*txt, long len)
00103 {
00104     m_cvsOut << txt;
00105     return len;
00106 }
00107
00108 long CItemListConsole::cvs_err(char* txt, long len)
00109 {
00110     cvs_errstr(txt, len);
00111     m_cvsErr << txt;
00112
00113     return len;
00114 }
00115
00122 void CItemListConsole::Parse(int launchRes)
00123 {
00124     m_launchRes = launchRes;
00125     m_cvsOut.clear();
00126 }
00127
00129 int CItemListConsole::GetLaunchRes() const
00130 {
00131     return m_launchRes;
00132 }
00133
00135 stringstream& CItemListConsole::GetCvsErr()
00136 {
00137     return m_cvsErr;
00138 }
00139
00141 const ItemList& CItemListConsole::GetItemList() const
00142 {
00143     return m_itemList;
00144 }
00145
00147 // CTagParserConsole
00148
00149 CTagParserConsole::CTagParserConsole()
00150 {
00151 }
00152
00153 CTagParserConsole::~CTagParserConsole()
00154 {
00155 }
00156
00157 void CTagParserConsole::Parse(int launchRes)
00158 {
00159     bool btag = false;
00160
00161     string line;
00162
00163     while( getline(m_cvsOut, line) )
00164     {
00165         if( btag )
00166         {
00167             if( line.size() == 0 || line.find("keyword substitution:") != -1 )
00168             {
00169                 btag = false;
00170             }
00171             else
00172             {
00173                 stringstream stream;
00174                 string tag;
00175
00176                 stream << line;
00177                 stream >> tag;
00178
00179                 tag.erase(tag.find(':'), tag.size());
00180
00181                 if( !tag.empty() )
00182                 {
00183                     ItemRowInfo rowInfo;
00184                     string type;
00185
00186                     stream >> type;
00187
00188                     if( type.size() > 0 )
00189                     {
00190                         bool isBranch = false;
00191
00192                         const int dotsCount = count(type.begin(), type.end(), '.');
00193                         if( dotsCount > 2 && dotsCount % 2 )
00194                         {
00195                             // If we have even and greater than two number of separated integers
00196                             // then check if it's a magic branch
00197                             string magicTest = type;
00198                             magicTest.erase(magicTest.find_last_of('.'), magicTest.size());
00199                             magicTest.erase(0, magicTest.find_last_of('.') + 1);
00200
00201                             if( !magicTest.empty() && magicTest[0] == '0' )
00202                             {
00203                                 isBranch = true;
00204                             }
00205                         }
00206                         else if( dotsCount > 1 && !(dotsCount % 2) )
00207                         {
00208                             // We have an odd and greater than one number of integers, surely a branch
00209                             isBranch = true;
00210                         }
00211
00212                         // Set the type appropriate to findings
00213                         type = isBranch ? STR_ITEMLIST_BRANCH : STR_ITEMLIST_REVISION;
00214                     }
00215
00216                     ItemList::iterator i = m_itemList.find(tag);
00217                     if( i != m_itemList.end() )
00218                     {
00219                         if( !type.empty() )
00220                         {
00221                             (*i).second.m_description.insert(type);
00222                         }
00223                     }
00224                     else
00225                     {
00226                         if( !type.empty() )
00227                         {
00228                             rowInfo.m_description.insert(type);
00229                         }
00230
00231                         m_itemList.insert(std::make_pair(tag, rowInfo));
00232                     }
00233                 }
00234             }
00235         }
00236
00237         if( line.find("symbolic names:") != -1 )
00238         {
00239             btag = true;
00240         }
00241     }
00242
00243     CItemListConsole::Parse(launchRes);
00244 }
00245
00247 // CModuleParserConsole
00248
00249 CModuleParserConsole::CModuleParserConsole()
00250 {
00251 }
00252
00253 CModuleParserConsole::~CModuleParserConsole()
00254 {
00255 }
00256
00257 void CModuleParserConsole::Parse(int launchRes)
00258 {
00259     string line;
00260
00261     while( getline(m_cvsOut, line) )
00262     {
00263         if( line.size() > 0 && !isspace(line.c_str()[0]) )
00264         {
00265             stringstream stream;
00266             string module;
00267
00268             stream << line;
00269             stream >> module;
00270
00271             if( !module.empty() )
00272             {
00273                 ItemRowInfo rowInfo;
00274
00275                 string definition = line;
00276                 definition.erase(definition.begin(), definition.begin() + module.size());
00277
00278                 while( !definition.empty() && isspace(definition[0]) )
00279                 {
00280                     definition.erase(definition.begin(), definition.begin() + 1);
00281                 }
00282
00283                 if( !definition.empty() )
00284                 {
00285                     stringstream strDefintion;
00286                     string options;
00287                     string directories;
00288                     string token;
00289
00290                     strDefintion << definition;
00291
00292                     bool hasProg = false;
00293
00294                     do{
00295                         strDefintion >> token;
00296                         if( !token.empty() )
00297                         {
00298                             if( directories.empty() )
00299                             {
00300                                 if( options.empty() )
00301                                 {
00302                                     if( token[0] != '-' )
00303                                     {
00304                                         directories += token;
00305                                         continue;
00306                                     }
00307                                 }
00308
00309                                 if( token[0] == '-' || hasProg )
00310                                 {
00311                                     if( !options.empty() )
00312                                     {
00313                                         options += " ";
00314                                     }
00315
00316                                     options += token;
00317
00318                                     if( hasProg )
00319                                     {
00320                                         hasProg = false;
00321                                     }
00322                                     else if( token == "-d" ||
00323                                         token == "-e" ||
00324                                         token == "-i" ||
00325                                         token == "-o" ||
00326                                         token == "-s" ||
00327                                         token == "-t" ||
00328                                         token == "-u" )
00329                                     {
00330                                         hasProg = true;
00331                                     }
00332                                 }
00333                                 else
00334                                 {
00335                                     directories += token;
00336                                 }
00337                             }
00338                             else
00339                             {
00340                                 directories += " ";
00341                                 directories += token;
00342                             }
00343                         }
00344                     }while( !strDefintion.eof());
00345
00346                     rowInfo.m_description.insert(options.c_str());
00347                     rowInfo.m_descriptionEx.insert(directories.c_str());
00348                 }
00349
00350                 m_itemList.insert(std::make_pair(module, rowInfo));
00351             }
00352         }
00353     }
00354
00355     CItemListConsole::Parse(launchRes);
00356 }
00357
00359 // CListParserConsole
00360
00361 CListParserConsole::CListParserConsole()
00362 {
00363 }
00364
00365 CListParserConsole::~CListParserConsole()
00366 {
00367 }
00368
00369 void CListParserConsole::Parse(int launchRes)
00370 {
00371     string line;
00372
00373     while( getline(m_cvsOut, line) )
00374     {
00375         if( line.size() > 0 && !isspace(line.c_str()[0]) )
00376         {
00377             const char entrySeparator = '/';
00378             string entryType;
00379             stringstream entry(line);
00380
00381             if( getline(entry, entryType, entrySeparator) )
00382             {
00383                 if( entryType.size() > 0 && entryType.c_str()[0] == 'D' )
00384                 {
00385                     string directory;
00386
00387                     if( getline(entry, directory, entrySeparator) && !directory.empty() )
00388                     {
00389                         ItemRowInfo rowInfo;
00390                         rowInfo.m_description.insert(STR_ITEMLIST_DIR);
00391
00392                         m_itemList.insert(std::make_pair(directory, rowInfo));
00393                     }
00394                 }
00395                 else
00396                 {
00397                     string file;
00398
00399                     if( getline(entry, file, entrySeparator) && !file.empty() )
00400                     {
00401                         string revision;
00402                         string date;
00403
00404                         if( getline(entry, revision, entrySeparator) &&
00405                             getline(entry, date, entrySeparator) )
00406                         {
00407                             ItemRowInfo rowInfo;
00408                             rowInfo.m_description.insert(revision);
00409                             rowInfo.m_descriptionEx.insert(date);
00410
00411                             m_itemList.insert(std::make_pair(file, rowInfo));
00412                         }
00413                     }
00414                 }
00415             }
00416         }
00417     }
00418
00419     CItemListConsole::Parse(launchRes);
00420 }
00421
00422
00428 static string FormatItemDescription(const ItemDescription& itemDesc)
00429 {
00430     string strRes;
00431
00432     for(ItemDescription::const_iterator it = itemDesc.begin(); it != itemDesc.end(); it++)
00433     {
00434         if( !strRes.empty() )
00435         {
00436             strRes += ", ";
00437         }
00438
00439         strRes += (*it).c_str();
00440     }
00441
00442     return strRes;
00443 }
00444
00452 static string FormatListPath(const ListPath& listPath, const char pathDelimiter = '/')
00453 {
00454     string strRes;
00455
00456     for(ListPath::const_iterator it = listPath.begin(); it != listPath.end(); it++ )
00457     {
00458         strRes += (*it).c_str();
00459         strRes += pathDelimiter;
00460     }
00461
00462     return strRes;
00463 }
00464
00470 static CItemListConsole* LaunchItemListCommand(kItemListDlg type, bool option,
00471                                                const char* readFrom, bool forceCvsroot,
00472                                                const char* revision, const char* date,
00473                                                const ListPath* listPath = NULL)
00474 {
00475     CItemListConsole* itemListConsole = NULL;
00476
00477     CvsArgs args;
00478     MultiFiles mf;
00479
00480     if( forceCvsroot )
00481     {
00482         args.addcvsroot();
00483     }
00484
00485     switch( type )
00486     {
00487     case kItemListTag:
00488         itemListConsole = new CTagParserConsole;
00489
00490         args.add(forceCvsroot ? "rlog" : "log");
00491         args.add("-h");
00492
00493         if( !option )
00494         {
00495             args.add("-l");
00496         }
00497
00498         if( strlen(revision) )
00499         {
00500             string strRevision;
00501
00502             strRevision += "-r";
00503             strRevision += revision;
00504
00505             args.add(strRevision.c_str());
00506         }
00507
00508         if( strlen(date) )
00509         {
00510             args.add("-d");
00511             args.add(date);
00512         }
00513
00514         {
00515             CStr uppath, file;
00516             SplitPath(readFrom, uppath, file, true);
00517
00518             mf.newdir(uppath);
00519
00520             if( !file.empty() )
00521             {
00522                 mf.newfile(file);
00523             }
00524         }
00525         break;
00526     case kItemListModule:
00527         if( option )
00528         {
00529             itemListConsole = new CListParserConsole;
00530
00531             args.add("ls");
00532             args.add("-e");
00533
00534             if( strlen(revision) )
00535             {
00536                 args.add("-r");
00537                 args.add(revision);
00538             }
00539
00540             if( strlen(date) )
00541             {
00542                 args.add("-D");
00543                 args.add(date);
00544             }
00545
00546             if( listPath )
00547             {
00548                 string strListPath = FormatListPath(*listPath);
00549                 if( !strListPath.empty() )
00550                 {
00551                     args.add(strListPath.c_str());
00552                 }
00553                 else
00554                 {
00555                     args.add("/");
00556                 }
00557             }
00558             else
00559             {
00560                 args.add("/");
00561             }
00562         }
00563         else
00564         {
00565             itemListConsole = new CModuleParserConsole;
00566
00567             args.add("checkout");
00568             args.add("-c");
00569         }
00570
00571         mf.newdir(readFrom);
00572         break;
00573     default:
00574 #ifdef WIN32
00575         ASSERT(FALSE);  // unknown option
00576 #endif
00577         break;
00578     }
00579
00580     if( itemListConsole )
00581     {
00582         const char* dir = (*mf.begin()).add(args);
00583
00584         args.print(dir);
00585         const int launchRes = launchCVS(dir, args.Argc(), args.Argv(), itemListConsole);
00586         itemListConsole->Parse(launchRes);
00587     }
00588
00589     return itemListConsole;
00590 }
00591
00592
00594 // ItemDisplayInfo
00595
00601 void ItemDisplayInfo::Create(const string& item, const ItemRowInfo& rowInfo)
00602 {
00603     m_item = item;
00604     m_description = FormatItemDescription(rowInfo.m_description);
00605     m_descriptionEx = FormatItemDescription(rowInfo.m_descriptionEx);
00606
00607     m_rowInfo = rowInfo;
00608 }
00609
00611 const string& ItemDisplayInfo::GetItem() const
00612 {
00613     return m_item;
00614 }
00615
00617 const string& ItemDisplayInfo::GetDescription() const
00618 {
00619     return m_description;
00620 }
00621
00623 const string& ItemDisplayInfo::GetDescriptionEx() const
00624 {
00625     return m_descriptionEx;
00626 }
00627
00629 const ItemRowInfo& ItemDisplayInfo::GetRowInfo() const
00630 {
00631     return m_rowInfo;
00632 }
00633
00634 #ifdef WIN32
00635
00643 int CALLBACK CItemListDlg::CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam)
00644 {
00645     int res = 0;
00646
00647     const CompareInfo* info = (CompareInfo*)lParam;
00648     if( info )
00649     {
00650         ItemDisplayInfo* displayInfo1 = (ItemDisplayInfo*)itemData1;
00651         ItemDisplayInfo* displayInfo2 = (ItemDisplayInfo*)itemData2;
00652
00653         if( displayInfo1 && displayInfo2 )
00654         {
00655             switch( info->m_type )
00656             {
00657             case kItemListTag:
00658                 switch( info->m_column )
00659                 {
00660                 case 0:
00661                     res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00662                     break;
00663                 case 1:
00664                     res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00665                     break;
00666                 default:
00667                     ASSERT(FALSE); // should not come here
00668                     break;
00669                 }
00670                 break;
00671             case kItemListModule:
00672                 if( info->m_option )
00673                 {
00674                     if( strcmp(displayInfo1->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
00675                     {
00676                         res = info->m_asc ? 1 : -1;
00677                     }
00678                     else if( strcmp(displayInfo2->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
00679                     {
00680                         res = info->m_asc ? -1 : 1;
00681                     }
00682                     else
00683                     {
00684                         bool isDir1 = strcmp(displayInfo1->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
00685                         bool isDir2 = strcmp(displayInfo2->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
00686
00687                         if( isDir1 && !isDir2 )
00688                         {
00689                             res = info->m_asc ? 1 : -1;
00690                         }
00691                         else if( !isDir1 && isDir2 )
00692                         {
00693                             res = info->m_asc ? -1 : 1;
00694                         }
00695                         else if( isDir1 && isDir2 )
00696                         {
00697                             res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00698                             if( info->m_column != 0 )
00699                             {
00700                                 if( info->m_asc )
00701                                 {
00702                                     res *= -1;
00703                                 }
00704                             }
00705                         }
00706                         else
00707                         {
00708                             switch( info->m_column )
00709                             {
00710                             case 0:
00711                                 res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00712                                 break;
00713                             case 1:
00714                                 res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00715                                 break;
00716                             case 2:
00717                                 {
00718                                     const time_t time1 = GetDateTime(displayInfo1->GetDescriptionEx().c_str());
00719                                     const time_t time2 = GetDateTime(displayInfo2->GetDescriptionEx().c_str());
00720
00721                                     if( time1 != (time_t)-1 && time2 != (time_t)-1 )
00722                                     {
00723                                         res = time1 < time2 ? -1 : (time1 > time2 ? 1 : 0);
00724                                     }
00725                                     else
00726                                     {
00727                                         res = stricmp(displayInfo1->GetDescriptionEx().c_str(), displayInfo2->GetDescriptionEx().c_str());
00728                                     }
00729                                 }
00730                                 break;
00731                             default:
00732                                 ASSERT(FALSE); // should not come here
00733                                 break;
00734                             }
00735                         }
00736                     }
00737                 }
00738                 else
00739                 {
00740                     switch( info->m_column )
00741                     {
00742                     case 0:
00743                         res = stricmp(displayInfo1->GetItem().c_str(), displayInfo2->GetItem().c_str());
00744                         break;
00745                     case 1:
00746                         res = stricmp(displayInfo1->GetDescription().c_str(), displayInfo2->GetDescription().c_str());
00747                         break;
00748                     case 2:
00749                         res = stricmp(displayInfo1->GetDescriptionEx().c_str(), displayInfo2->GetDescriptionEx().c_str());
00750                         break;
00751                     default:
00752                         ASSERT(FALSE); // should not come here
00753                         break;
00754                     }
00755                 }
00756
00757                 break;
00758             default:
00759                 ASSERT(FALSE);  // unknown type
00760                 break;
00761             }
00762         }
00763     }
00764
00765     if( res )
00766     {
00767         if( info->m_asc )
00768         {
00769             res *= -1;
00770         }
00771     }
00772
00773     return res;
00774 }
00775
00776
00778 // CItemListDlg dialog
00779
00780
00781 CItemListDlg::CItemListDlg(const MultiFiles* mf,
00782                            const char* item, kItemListDlg type, ItemList& itemList, const ListPath* listPath,
00783                            bool forceCvsroot, const char* rev, const char* date,
00784                            CWnd* pParent /*=NULL*/)
00785                            : m_mf(mf), m_itemList(itemList),
00786                            m_readFromCombo(USmartCombo::AutoDropWidth), m_autoRefreshCombo(USmartCombo::AutoDropWidth),
00787                            CDialog(CItemListDlg::IDD, pParent)
00788 {
00789     //{{AFX_DATA_INIT(CItemListDlg)
00790     m_readFrom = _T("");
00791     m_item = _T("");
00792     m_option = FALSE;
00793     m_forceCvsroot = FALSE;
00794     m_hasRev = FALSE;
00795     m_rev = _T("");
00796     m_date = _T("");
00797     m_hasDate = FALSE;
00798     //}}AFX_DATA_INIT
00799
00800     m_item = item;
00801
00802     m_type = type;
00803
00804     switch( m_type )
00805     {
00806     case kItemListTag:
00807         m_option = (bool)gItemListTagRecurse;
00808         break;
00809     case kItemListModule:
00810         m_option = (bool)gItemListModuleList;
00811         break;
00812     default:
00813         // Nothing to do
00814         break;
00815     }
00816
00817     if( listPath )
00818     {
00819         m_listPath = *listPath;
00820     }
00821
00822     m_cvsStopped = false;
00823
00824     m_forceCvsroot = forceCvsroot;
00825     m_rev = rev;
00826     m_date = date;
00827
00828     m_sortAsc = false;
00829     m_sortColumn = 0;
00830
00831     m_revCombo.SetItems(&gRevNames);
00832     m_dateCombo.SetItems(&gDateNames);
00833 }
00834
00835
00836 void CItemListDlg::DoDataExchange(CDataExchange* pDX)
00837 {
00838     CDialog::DoDataExchange(pDX);
00839     //{{AFX_DATA_MAP(CItemListDlg)
00840     DDX_Control(pDX, IDC_AUTO_REFRESH, m_autoRefreshCombo);
00841     DDX_Control(pDX, IDC_SELECTION, m_selectionButton);
00842     DDX_Control(pDX, IDCANCEL, m_cancelButton);
00843     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00844     DDX_Control(pDX, IDC_ITEM, m_itemEdit);
00845     DDX_Control(pDX, IDC_REFRESH, m_refreshButton);
00846     DDX_Control(pDX, IDOK, m_okButton);
00847     DDX_Control(pDX, IDC_BROWSE_READFROM, m_browseReadFromButton);
00848     DDX_Control(pDX, IDC_ITEMLABEL, m_itemLabelStatic);
00849     DDX_Control(pDX, IDC_CHECKDATE, m_hasDateCheck);
00850     DDX_Control(pDX, IDC_CHECKREV, m_hasRevCheck);
00851     DDX_Control(pDX, IDC_FORCEROOT, m_forceCvsrootCheck);
00852     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00853     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00854     DDX_Control(pDX, IDC_OPTION, m_optionCheck);
00855     DDX_Control(pDX, IDC_ITEMLIST, m_itemListCtrl);
00856     DDX_Control(pDX, IDC_READFROM, m_readFromCombo);
00857     DDX_CBString(pDX, IDC_READFROM, m_readFrom);
00858     DDX_Text(pDX, IDC_ITEM, m_item);
00859     DDX_Check(pDX, IDC_OPTION, m_option);
00860     DDX_Check(pDX, IDC_FORCEROOT, m_forceCvsroot);
00861     DDX_Check(pDX, IDC_CHECKREV, m_hasRev);
00862     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00863     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00864     DDX_Check(pDX, IDC_CHECKDATE, m_hasDate);
00865     //}}AFX_DATA_MAP
00866
00867     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00868     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00869
00870     if( pDX->m_bSaveAndValidate )
00871     {
00872         m_itemList.clear();
00873
00874         for(int nIndex = 0; nIndex < m_itemListCtrl.GetItemCount(); nIndex++)
00875         {
00876             ItemDisplayInfo* displayInfo = (ItemDisplayInfo*)m_itemListCtrl.GetItemData(nIndex);
00877             if( displayInfo )
00878             {
00879                 m_itemList.insert(std::make_pair(displayInfo->GetItem(), displayInfo->GetRowInfo()));
00880             }
00881         }
00882     }
00883 }
00884
00885
00886 BEGIN_MESSAGE_MAP(CItemListDlg, CDialog)
00887     //{{AFX_MSG_MAP(CItemListDlg)
00888     ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
00889     ON_BN_CLICKED(IDC_OPTION, OnOption)
00890     ON_BN_CLICKED(IDC_CHECKREV, OnCheckrev)
00891     ON_BN_CLICKED(IDC_CHECKDATE, OnCheckdate)
00892     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00893     ON_NOTIFY(NM_DBLCLK, IDC_ITEMLIST, OnDblclkItemlist)
00894     ON_NOTIFY(LVN_ITEMCHANGED, IDC_ITEMLIST, OnItemchangedItemlist)
00895     ON_NOTIFY(LVN_COLUMNCLICK, IDC_ITEMLIST, OnColumnclickItemlist)
00896     ON_WM_DESTROY()
00897     ON_BN_CLICKED(IDC_FORCEROOT, OnForceroot)
00898     ON_BN_CLICKED(IDC_BROWSE_READFROM, OnBrowseReadfrom)
00899     ON_BN_CLICKED(IDC_SELECTION, OnSelection)
00900     ON_CBN_SELCHANGE(IDC_AUTO_REFRESH, OnSelchangeAutoRefresh)
00901     //}}AFX_MSG_MAP
00902 END_MESSAGE_MAP()
00903
00904
00905 // CItemListDlg message handlers
00906
00907
00908 BOOL CItemListDlg::OnInitDialog()
00909 {
00910     CDialog::OnInitDialog();
00911
00912     // Extra initialization
00913     SetListCtrlExtendedStyle(&m_itemListCtrl, LVS_EX_FULLROWSELECT);
00914
00915     // Setup controls
00916     CHeaderCtrl* headerCtrl = m_itemListCtrl.GetHeaderCtrl();
00917     if( headerCtrl )
00918     {
00919         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00920     }
00921
00922     InitListCtrl(kDisplayData);
00923     InitOptionCtrls();
00924     OnForceroot();
00925
00926     m_itemsImageList.Create(IDR_ITEMLIST, 16, 1, RGB(255, 0, 255));
00927     m_itemListCtrl.SetImageList(&m_itemsImageList, LVSIL_SMALL);
00928
00929     int nReadFromSelection = 0;
00930
00931     if( m_mf )
00932     {
00933         // Add selected directories
00934         for( int nIndex = 0; nIndex < m_mf->NumDirs(); nIndex++ )
00935         {
00936             CStr path;
00937             if( m_mf->getdir(nIndex, path) )
00938             {
00939                 m_readFromCombo.AddString(CString(path));
00940             }
00941         }
00942     }
00943
00944     switch( m_type )
00945     {
00946     case kItemListTag:
00947         // Set windows titles
00948         SetWindowText("Select tag/branch");
00949         m_itemLabelStatic.SetWindowText("&Tag/branch:");
00950         m_optionCheck.SetWindowText("&Recurse");
00951
00952         // The browser selection
00953         if( m_mf && m_mf->TotalNumFiles() )
00954         {
00955             MultiFiles::const_iterator mfi;
00956             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00957             {
00958                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
00959                 {
00960                     UStr path;
00961                     UStr fileName;
00962                     UStr currRev;
00963
00964                     mfi->get(nIndex, path, fileName, currRev);
00965                     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00966                         path << kPathDelimiter;
00967
00968                     path << fileName;
00969
00970                     const int nComboIndex = m_readFromCombo.AddString(path);
00971
00972                     // It's better to have a single file selected initially for the performance reasons
00973                     if( 0 == nReadFromSelection )
00974                     {
00975                         nReadFromSelection = nComboIndex;
00976                     }
00977                 }
00978             }
00979         }
00980
00981         break;
00982     case kItemListModule:
00983         // Set windows titles
00984         SetWindowText("Select module");
00985         m_itemLabelStatic.SetWindowText("&Module:");
00986         m_optionCheck.SetWindowText("&List");
00987
00988         m_browseReadFromButton.ShowWindow(SW_HIDE);
00989         break;
00990     default:
00991         ASSERT(FALSE);  // unknown type
00992         EndDialog(IDCANCEL);
00993         return FALSE;
00994     }
00995
00996     // Set the "read from"
00997     if( m_readFromCombo.GetCount() )
00998     {
00999         m_readFromCombo.SetCurSel(nReadFromSelection);
01000     }
01001
01002     // Trigger refresh
01003     kItemListAutoRefreshType autoRefresh = kAutoRefreshFirstTime;
01004
01005     if( kItemListModule == m_type )
01006     {
01007         autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshModule;
01008     }
01009     else if( kItemListTag == m_type )
01010     {
01011         autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshTag;
01012     }
01013     else
01014     {
01015         ASSERT(FALSE); // unknown type
01016     }
01017
01018     m_autoRefreshCombo.SetCurSel(autoRefresh);
01019
01020     if( (kAutoRefreshAlways == autoRefresh) || (kAutoRefreshFirstTime == autoRefresh && m_itemList.empty()) )
01021     {
01022         // Force the window to show itself
01023         ShowWindow(SW_SHOW);
01024         PostClickRefresh();
01025     }
01026     else
01027     {
01028         DisplayItems(m_itemList, 0, NULL, false);
01029         if( m_itemListCtrl.IsWindowEnabled() )
01030         {
01031             SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01032         }
01033
01034         if( !m_item.IsEmpty() )
01035         {
01036             SelectItem(m_item);
01037         }
01038     }
01039
01040     return TRUE;  // return TRUE unless you set the focus to a control
01041                   // EXCEPTION: OCX Property Pages should return FALSE
01042 }
01043
01048 BOOL CItemListDlg::PostClickRefresh()
01049 {
01050     return PostMessage(WM_COMMAND, MAKEWPARAM(IDC_REFRESH, BN_CLICKED), (LPARAM)NULL);
01051 }
01052
01058 void CItemListDlg::InitListCtrl(const kDisplayType displayType)
01059 {
01060     CWndRedrawMngr redrawMngr(&m_itemListCtrl);
01061
01062     // Remove all items and columns
01063     DeleteAllItems();
01064
01065     int columnCount = m_itemListCtrl.GetHeaderCtrl()->GetItemCount();
01066     while( columnCount-- )
01067     {
01068         m_itemListCtrl.DeleteColumn(0);
01069     }
01070
01071     // Get the client area width to properly size columns
01072     CRect rect;
01073     m_itemListCtrl.GetClientRect(rect);
01074
01075     const int listCtrlWidth = rect.Width();
01076
01077     // Set the appropriate columns
01078     switch( displayType )
01079     {
01080     case kDisplayWait:
01081         m_itemListCtrl.InsertColumn(0, "Action", LVCFMT_LEFT, listCtrlWidth);
01082
01083         m_itemListCtrl.InsertItem(0, "Please wait while retrieving data", kItemImgBlank);
01084         m_itemListCtrl.InsertItem(1, "You can press Stop button to cancel the operation", kItemImgBlank);
01085         break;
01086     case kDisplayData:
01087         {
01088             const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
01089
01090             switch( m_type )
01091             {
01092             case kItemListTag:
01093                 m_itemListCtrl.InsertColumn(0, "Tag/branch", LVCFMT_LEFT, 200);
01094                 m_itemListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, listCtrlWidthNoScroll - 200);
01095                 break;
01096             case kItemListModule:
01097                 if( m_optionCheck.GetCheck() )
01098                 {
01099                     m_itemListCtrl.InsertColumn(0, "Module", LVCFMT_LEFT, 200);
01100                     m_itemListCtrl.InsertColumn(1, "Description", LVCFMT_LEFT, 120);
01101                     m_itemListCtrl.InsertColumn(2, "Timestamp", LVCFMT_LEFT, listCtrlWidthNoScroll - 120 - 200);
01102                 }
01103                 else
01104                 {
01105                     m_itemListCtrl.InsertColumn(0, "Module", LVCFMT_LEFT, 200);
01106                     m_itemListCtrl.InsertColumn(1, "Options", LVCFMT_LEFT, 60);
01107                     m_itemListCtrl.InsertColumn(2, "Directories / Files", LVCFMT_LEFT, listCtrlWidthNoScroll - 60 - 200);
01108                 }
01109                 break;
01110             default:
01111                 ASSERT(FALSE);  // unknown type
01112                 break;
01113             }
01114         }
01115         break;
01116     case kDisplayInfo:
01117         m_itemListCtrl.InsertColumn(0, "Information", LVCFMT_LEFT, listCtrlWidth);
01118         break;
01119     default:
01120         ASSERT(FALSE);  // unknown display type
01121         break;
01122     }
01123 }
01124
01128 void CItemListDlg::InitOptionCtrls()
01129 {
01130     BOOL enableDateRev = (kItemListModule == m_type && !m_optionCheck.GetCheck()) ? false : true;
01131
01132     m_hasRevCheck.EnableWindow(enableDateRev);
01133     m_hasDateCheck.EnableWindow(enableDateRev);
01134
01135     OnCheckrev();
01136     OnCheckdate();
01137
01138     switch( m_type )
01139     {
01140     case kItemListTag:
01141         gItemListTagRecurse = m_optionCheck.GetCheck() != 0;
01142         break;
01143     case kItemListModule:
01144         gItemListModuleList = m_optionCheck.GetCheck() != 0;
01145         break;
01146     default:
01147         // Nothing to do
01148         break;
01149     }
01150 }
01151
01156 void CItemListDlg::EnableControls(BOOL enable)
01157 {
01158     m_okButton.EnableWindow(enable);
01159     m_refreshButton.EnableWindow(enable);
01160     m_readFromCombo.EnableWindow(enable);
01161     m_itemListCtrl.EnableWindow(enable);
01162     m_itemEdit.EnableWindow(enable);
01163     m_selectionButton.EnableWindow(enable);
01164
01165     m_optionCheck.EnableWindow(enable);
01166
01167     m_forceCvsrootCheck.EnableWindow(enable);
01168     m_autoRefreshCombo.EnableWindow(enable);
01169
01170     if( !enable )
01171     {
01172         m_hasRevCheck.EnableWindow(FALSE);
01173         m_revCombo.EnableWindow(FALSE);
01174
01175         m_browseTagButton.EnableWindow(FALSE);
01176
01177         m_hasDateCheck.EnableWindow(FALSE);
01178         m_dateCombo.EnableWindow(FALSE);
01179
01180         m_browseReadFromButton.EnableWindow(FALSE);
01181     }
01182     else
01183     {
01184         InitOptionCtrls();
01185         OnForceroot();
01186     }
01187 }
01188
01190 void CItemListDlg::OnRefresh()
01191 {
01192     m_cvsStopped = false;
01193
01194     // Verify the settings
01195     if( !CheckSettings() )
01196     {
01197         return;
01198     }
01199
01200     // Prepare controls
01201     EnableControls(FALSE);
01202
01203     // Change the Cancel button's name to "Stop"
01204     CString strPrevCancelText;
01205     m_cancelButton.GetWindowText(strPrevCancelText);
01206     m_cancelButton.SetWindowText("Stop");
01207
01208     // Store current item text
01209     CString strItem;
01210     m_itemEdit.GetWindowText(strItem);
01211
01212     // Display the reading data prompt
01213     InitListCtrl(kDisplayWait);
01214
01215     // Select and launch command
01216     CString strReadFrom;
01217     CString revision;
01218     CString date;
01219
01220     m_readFromCombo.GetWindowText(strReadFrom);
01221
01222     if( m_hasRevCheck.GetCheck() )
01223     {
01224         m_revCombo.GetWindowText(revision);
01225     }
01226
01227     if( m_hasDateCheck.GetCheck() )
01228     {
01229         m_dateCombo.GetWindowText(date);
01230     }
01231
01232     const char* readFrom = kItemListModule == m_type &&
01233         m_forceCvsrootCheck.GetCheck() && !m_optionCheck.GetCheck() ? "" : (LPCTSTR)strReadFrom;
01234
01235     std::auto_ptr<CItemListConsole> itemListConsole(LaunchItemListCommand(m_type, m_optionCheck.GetCheck() != 0,
01236         readFrom, m_forceCvsrootCheck.GetCheck() != 0,
01237         revision, date, &m_listPath));
01238
01239     if( !itemListConsole.get() )
01240     {
01241         EndDialog(IDCANCEL);
01242         return;
01243     }
01244
01245     // Initialize list control
01246     InitListCtrl(kDisplayData);
01247
01248     // Restore control's state
01249     EnableControls(TRUE);
01250
01251     // Display data
01252     DisplayItems(itemListConsole->GetItemList(), itemListConsole->GetLaunchRes(), &itemListConsole->GetCvsErr());
01253
01254     // Restore Cancel's button name
01255     m_cancelButton.SetWindowText(strPrevCancelText);
01256
01257     if( m_itemListCtrl.IsWindowEnabled() )
01258     {
01259         // Sort items
01260         SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01261
01262         // Try to select the item
01263         if( strItem.IsEmpty() && m_itemListCtrl.GetItemCount() )
01264         {
01265             strItem = m_itemListCtrl.GetItemText(0, 0);
01266         }
01267
01268         if( !strItem.IsEmpty() )
01269         {
01270             SelectItem(strItem);
01271             GotoDlgCtrl(&m_itemListCtrl);
01272         }
01273     }
01274 }
01275
01280 bool CItemListDlg::CheckSettings()
01281 {
01282     if( m_hasRevCheck.IsWindowEnabled() && m_hasRevCheck.GetCheck() && !m_revCombo.GetWindowTextLength() )
01283     {
01284         AfxMessageBox("Please enter more than 1 character");
01285         GotoDlgCtrl(&m_revCombo);
01286         return false;
01287     }
01288
01289     if( m_hasDateCheck.IsWindowEnabled() && m_hasDateCheck.GetCheck() && !m_dateCombo.GetWindowTextLength() )
01290     {
01291         AfxMessageBox("Please enter more than 1 character");
01292         GotoDlgCtrl(&m_dateCombo);
01293         return false;
01294     }
01295
01296     return true;
01297 }
01298
01306 void CItemListDlg::DisplayItems(const ItemList& itemList, const int launchRes, stringstream* cvsErr /*= NULL*/, const bool showUpDir /*= true*/)
01307 {
01308     if( itemList.size() == 0 )
01309     {
01310         if( !m_cvsStopped )
01311         {
01312             if( launchRes == 0 )
01313             {
01314                 // Show the info if the modules file doesn't contain any modules
01315                 if( kItemListModule == m_type && !m_optionCheck.GetCheck() )
01316                 {
01317                     InitListCtrl(kDisplayInfo);
01318                     m_itemListCtrl.InsertItem(0, "Modules file doesn't contain any modules definitions", kItemImgBlank);
01319                     m_itemListCtrl.EnableWindow(FALSE);
01320                 }
01321             }
01322             else if( cvsErr )
01323             {
01324                 InitListCtrl(kDisplayInfo);
01325
01326                 // Show the error in the list control
01327                 m_itemListCtrl.InsertItem(0, "Command failed:", kItemImgBlank);
01328
01329                 string line;
01330                 while( getline(*cvsErr, line) )
01331                 {
01332                     m_itemListCtrl.InsertItem(m_itemListCtrl.GetItemCount(), line.c_str(), kItemImgBlank);
01333                 }
01334
01335                 m_itemListCtrl.EnableWindow(FALSE);
01336             }
01337         }
01338     }
01339     else
01340     {
01341         // Insert the items
01342         ItemList::const_iterator it = itemList.begin();
01343         while( it != itemList.end() )
01344         {
01345             ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
01346             if( displayInfo )
01347             {
01348                 displayInfo->Create((*it).first, (*it).second);
01349
01350                 const int itemIndex = m_itemListCtrl.InsertItem(m_itemListCtrl.GetItemCount(), displayInfo->GetItem().c_str());
01351                 if( itemIndex > -1 )
01352                 {
01353                     if( kItemListTag == m_type || kItemListModule == m_type )
01354                     {
01355                         m_itemListCtrl.SetItemText(itemIndex, 1, displayInfo->GetDescription().c_str());
01356                     }
01357
01358                     if( kItemListModule == m_type )
01359                     {
01360                         m_itemListCtrl.SetItemText(itemIndex, 2, displayInfo->GetDescriptionEx().c_str());
01361                     }
01362
01363                     if( !m_itemListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
01364                     {
01365                         delete displayInfo;
01366                     }
01367
01368                     const int image = GetImageForItem(m_type, m_optionCheck.GetCheck() != 0, displayInfo);
01369                     if( image > -1 )
01370                     {
01371                         m_itemListCtrl.SetItem(itemIndex, -1, LVIF_IMAGE, NULL, image, 0, 0, 0);
01372                     }
01373                 }
01374                 else
01375                 {
01376                     delete displayInfo;
01377                 }
01378             }
01379
01380             it++;
01381         }
01382     }
01383
01384     if( showUpDir && kItemListModule == m_type && m_optionCheck.GetCheck() && !m_listPath.empty() )
01385     {
01386         // Insert the ".." to move one level up in the directories tree
01387         ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
01388         if( displayInfo )
01389         {
01390             ItemRowInfo rowInfo;
01391             rowInfo.m_description.insert(STR_ITEMLIST_DIR);
01392
01393             displayInfo->Create(string(STR_ITEMLIST_UP_DIR), rowInfo);
01394
01395             const int itemIndex = m_itemListCtrl.InsertItem(0, displayInfo->GetItem().c_str());
01396             if( itemIndex > -1 )
01397             {
01398                 m_itemListCtrl.SetItemText(itemIndex, 1, displayInfo->GetDescription().c_str());
01399
01400                 if( !m_itemListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
01401                 {
01402                     delete displayInfo;
01403                 }
01404
01405                 const int image = GetImageForItem(m_type, m_optionCheck.GetCheck() != 0, displayInfo);
01406                 if( image > -1 )
01407                 {
01408                     m_itemListCtrl.SetItem(itemIndex, -1, LVIF_IMAGE, NULL, image, 0, 0, 0);
01409                 }
01410             }
01411             else
01412             {
01413                 delete displayInfo;
01414             }
01415         }
01416     }
01417 }
01418
01426 int CItemListDlg::GetImageForItem(kItemListDlg type, bool option, const ItemDisplayInfo* displayInfo)
01427 {
01428     int res = -1;
01429
01430     switch( type )
01431     {
01432     case kItemListTag:
01433         {
01434             bool hasRevision = displayInfo->GetDescription().find(STR_ITEMLIST_REVISION) != string::npos;
01435             bool hasBranch = displayInfo->GetDescription().find(STR_ITEMLIST_BRANCH) != string::npos;
01436
01437             if( hasRevision && hasBranch )
01438             {
01439                 res = kItemImgBranchAndRevision;
01440             }
01441             else if( hasBranch )
01442             {
01443                 res = kItemImgBranch;
01444             }
01445             else
01446             {
01447                 res = kItemImgRevision;
01448             }
01449         }
01450         break;
01451     case kItemListModule:
01452         if( option )
01453         {
01454             if( strcmp(displayInfo->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
01455             {
01456                 res = kItemImgUpDir;
01457             }
01458             else
01459             {
01460                 bool isDir = displayInfo->GetDescription().find(STR_ITEMLIST_DIR) != string::npos;
01461                 res = isDir ? kItemImgDir : kItemImgFile;
01462             }
01463         }
01464         else
01465         {
01466             res = kItemImgModule;
01467         }
01468         break;
01469     default:
01470         ASSERT(FALSE);  // unknown type
01471         break;
01472     }
01473
01474     return res;
01475 }
01476
01480 void CItemListDlg::DeleteAllItems()
01481 {
01482     for(int nIndex = 0; nIndex < m_itemListCtrl.GetItemCount(); nIndex++)
01483     {
01484         ItemDisplayInfo* displayInfo = (ItemDisplayInfo*)m_itemListCtrl.GetItemData(nIndex);
01485         delete displayInfo;
01486     }
01487
01488     m_itemListCtrl.DeleteAllItems();
01489 }
01490
01497 bool CItemListDlg::SelectItem(const char* item)
01498 {
01499     bool res = FALSE;
01500
01501     LVFINDINFO findInfo = { 0 };
01502     findInfo.flags = LVFI_STRING | LVFI_PARTIAL;
01503     findInfo.psz = item;
01504
01505     const int index = m_itemListCtrl.FindItem(&findInfo);
01506     if( index > -1 )
01507     {
01508         m_itemListCtrl.EnsureVisible(index, FALSE);
01509         m_itemListCtrl.SetItemState(index, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
01510
01511         res = true;
01512     }
01513
01514     return res;
01515 }
01516
01518 void CItemListDlg::OnOK()
01519 {
01520     switch( m_type )
01521     {
01522     case kItemListTag:
01523         gItemListTagRecurse = m_optionCheck.GetCheck() != 0;
01524         break;
01525     case kItemListModule:
01526         gItemListModuleList = m_optionCheck.GetCheck() != 0;
01527         break;
01528     default:
01529         // Nothing to do
01530         break;
01531     }
01532
01533     CDialog::OnOK();
01534 }
01535
01537 void CItemListDlg::OnCancel()
01538 {
01539     CWincvsApp* app = (CWincvsApp*)AfxGetApp();
01540     if( app && app->IsCvsRunning() && !app->IsCvsStopping() )
01541     {
01542         m_itemListCtrl.DeleteAllItems();
01543         m_itemListCtrl.InsertItem(0, "Stopping...", kItemImgBlank);
01544
01545         m_cvsStopped = true;
01546         stopCVS();
01547         return;
01548     }
01549
01550     CDialog::OnCancel();
01551 }
01552
01554 void CItemListDlg::OnOption()
01555 {
01556     InitOptionCtrls();
01557
01558     if( m_type == kItemListModule )
01559     {
01560         m_listPath.clear();
01561
01562         m_sortAsc = false;
01563         m_sortColumn = 0;
01564     }
01565 }
01566
01568 void CItemListDlg::OnForceroot()
01569 {
01570     bool enableReadFrom = !(kItemListModule == m_type && m_forceCvsrootCheck.GetCheck() && !m_optionCheck.GetCheck());
01571     m_readFromCombo.EnableWindow(enableReadFrom);
01572
01573     bool enableBrowseReadFrom = kItemListTag == m_type && m_forceCvsrootCheck.GetCheck();
01574     m_browseReadFromButton.EnableWindow(enableBrowseReadFrom);
01575 }
01576
01578 void CItemListDlg::OnCheckrev()
01579 {
01580     bool enable = m_hasRevCheck.GetCheck() && !(kItemListModule == m_type && !m_optionCheck.GetCheck());
01581
01582     m_revCombo.EnableWindow(enable);
01583     m_browseTagButton.EnableWindow(enable);
01584 }
01585
01587 void CItemListDlg::OnCheckdate()
01588 {
01589     bool enable = m_hasDateCheck.GetCheck() && !(kItemListModule == m_type && !m_optionCheck.GetCheck());
01590
01591     m_dateCombo.EnableWindow(enable);
01592 }
01593
01595 void CItemListDlg::OnBrowseTag()
01596 {
01597     CStr tagName;
01598     if( CompatGetTagListItem(m_mf, tagName) )
01599     {
01600         m_rev = (const char*)tagName;
01601         m_revCombo.SetWindowText(m_rev);
01602     }
01603 }
01604
01606 void CItemListDlg::OnBrowseReadfrom()
01607 {
01608     CStr moduleName;
01609     if( CompatGetModuleListItem(m_mf, moduleName) )
01610     {
01611         m_readFromCombo.SetWindowText((const char*)moduleName);
01612         GotoDlgCtrl(&m_browseReadFromButton);
01613     }
01614 }
01615
01617 void CItemListDlg::OnSelection()
01618 {
01619     kSelDetType selDetType = kItemListModule == m_type ? kSelDetPath : kSelDetRevision;
01620     CStr selection;
01621
01622     CString strSelection;
01623     m_itemEdit.GetWindowText(strSelection);
01624     selection = (const char*)strSelection;
01625
01626     if( CompatGetSelectionDetails(m_mf, selDetType, selection) )
01627     {
01628         m_itemEdit.SetWindowText(selection.c_str());
01629         OnOK();
01630     }
01631 }
01632
01634 void CItemListDlg::OnDblclkItemlist(NMHDR* pNMHDR, LRESULT* pResult)
01635 {
01636     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01637     if( pNMListView->iItem > -1 )
01638     {
01639         if( kItemListModule == m_type && m_optionCheck.GetCheck() )
01640         {
01641             const CString description = m_itemListCtrl.GetItemText(pNMListView->iItem, 1);
01642             if( description == STR_ITEMLIST_DIR )
01643             {
01644                 const CString item = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01645                 if( item == STR_ITEMLIST_UP_DIR )
01646                 {
01647                     if( !m_listPath.empty() )
01648                     {
01649                         // Set the item for selection in up-level
01650                         const string backItem = m_listPath.back();
01651                         m_itemEdit.SetWindowText(backItem.c_str());
01652
01653                         m_listPath.pop_back();
01654                     }
01655                 }
01656                 else
01657                 {
01658                     // Make it so it's easy to "return" where we came from
01659                     m_itemEdit.SetWindowText(STR_ITEMLIST_UP_DIR);
01660                     m_listPath.push_back((LPCTSTR)item);
01661                 }
01662
01663                 PostClickRefresh();
01664             }
01665         }
01666         else
01667         {
01668             OnOK();
01669         }
01670     }
01671
01672     *pResult = 0;
01673 }
01674
01676 void CItemListDlg::OnItemchangedItemlist(NMHDR* pNMHDR, LRESULT* pResult)
01677 {
01678     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01679     if( pNMListView->iItem > -1 &&
01680         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
01681     {
01682         CString item;
01683
01684         if( kItemListModule == m_type && m_optionCheck.GetCheck() )
01685         {
01686             item = FormatListPath(m_listPath).c_str();
01687
01688             CString selItem = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01689             if( selItem  != STR_ITEMLIST_UP_DIR )
01690             {
01691                 item += selItem;
01692             }
01693             else
01694             {
01695                 item.TrimRight('/');
01696             }
01697         }
01698         else
01699         {
01700             item = m_itemListCtrl.GetItemText(pNMListView->iItem, 0);
01701         }
01702
01703         m_itemEdit.SetWindowText(item);
01704     }
01705
01706     *pResult = 0;
01707 }
01708
01710 void CItemListDlg::OnColumnclickItemlist(NMHDR* pNMHDR, LRESULT* pResult)
01711 {
01712     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
01713
01714     if( m_sortColumn != pNMListView->iSubItem )
01715     {
01716         m_sortAsc = false;
01717     }
01718     else
01719     {
01720         m_sortAsc = !m_sortAsc;
01721     }
01722
01723     m_sortColumn = pNMListView->iSubItem;
01724
01725     SortItems(m_sortColumn, m_sortAsc, m_type, m_optionCheck.GetCheck() != 0);
01726
01727     *pResult = 0;
01728 }
01729
01738 void CItemListDlg::SortItems(int column, bool asc, kItemListDlg type, bool option)
01739 {
01740     m_headerCtrl.SetSortImage(column, asc);
01741
01742     CompareInfo info = { 0 };
01743
01744     info.m_column = column;
01745     info.m_asc = asc;
01746     info.m_type = type;
01747     info.m_option = option;
01748
01749     m_itemListCtrl.SortItems(CompareItems, (DWORD)&info);
01750 }
01751
01753 void CItemListDlg::OnDestroy()
01754 {
01755     DeleteAllItems();
01756
01757     CDialog::OnDestroy();
01758 }
01759
01761 BOOL CItemListDlg::PreTranslateMessage(MSG* pMsg)
01762 {
01763     if( WM_KEYUP == pMsg->message )
01764     {
01765         if( VK_F5 == pMsg->wParam )
01766         {
01767             PostClickRefresh();
01768         }
01769     }
01770
01771     return CDialog::PreTranslateMessage(pMsg);
01772 }
01773
01775 void CItemListDlg::OnSelchangeAutoRefresh()
01776 {
01777     const int autoRefresh = m_autoRefreshCombo.GetCurSel();
01778     if( autoRefresh > -1 )
01779     {
01780         if( kItemListModule == m_type )
01781         {
01782              gItemListAutoRefreshModule = autoRefresh;
01783         }
01784         else if( kItemListTag == m_type )
01785         {
01786             gItemListAutoRefreshTag = autoRefresh;
01787         }
01788         else
01789         {
01790             ASSERT(FALSE); // unknown type
01791         }
01792     }
01793 }
01794
01795 #endif  /* WIN32 */
01796
01797 #ifdef qMacCvsPP
01798 LSelectTable::LSelectTable(
01799     LStream *inStream )
01800         : LOutlineTable( inStream )
01801 {
01802     // set the table geometry
01803     LTableMultiGeometry *geom = NEW LTableMultiGeometry(this, 50, 20);
01804     ThrowIfNil_(geom);
01805     SetTableGeometry(geom);
01806
01807     // set the table selector
01808     SetTableSelector(NEW LTableSingleSelector( this )/*LOutlineRowSelector*/ );
01809
01810     // and note that we don't set the table storage....
01811
01812     // most of the table classes not only maintain the graphical
01813     // representation of your data but also the data itself. But
01814     // LOutlineTable doesn't really do this...it mostly handles
01815     // graphical representation... you need to handle your data
01816     // maintenance elsewhere by yourself.
01817
01818     // insert a couple columns (name and size)
01819     InsertCols( 1, 0, nil, nil, false );
01820     geom->SetColWidth(310, 1, 1);
01821
01822     // Set up keyboard selection and scrolling.
01823     AddAttachment(NEW LOutlineKeySelector(this, msg_AnyMessage));
01824     AddAttachment(NEW LKeyScrollAttachment(this));
01825
01826     // Try to become default commander in the window.
01827     if (mSuperCommander != nil)
01828         mSuperCommander->SetLatentSub(this);
01829
01830     mIconModule = nil;
01831     mIconTag = nil;
01832     mIconBranch = nil;
01833
01834     OSErr err = ::GetIconSuite( &mIconModule, 152, kSelectorAllAvailableData );
01835     ThrowIfOSErr_(err);
01836     ThrowIfResFail_(mIconModule);
01837     err = ::GetIconSuite( &mIconTag, 153, kSelectorAllAvailableData );
01838     ThrowIfOSErr_(err);
01839     ThrowIfResFail_(mIconTag);
01840     err = ::GetIconSuite( &mIconBranch, 154, kSelectorAllAvailableData );
01841     ThrowIfOSErr_(err);
01842     ThrowIfResFail_(mIconBranch);
01843 }
01844
01845 LSelectTable::~LSelectTable()
01846 {
01847     if (mIconModule != 0L)
01848         ::DisposeIconSuite(mIconModule, true);
01849     if (mIconTag != 0L)
01850         ::DisposeIconSuite(mIconTag, true);
01851     if (mIconBranch != 0L)
01852         ::DisposeIconSuite(mIconBranch, true);
01853 }
01854
01855 void LSelectTable::FinishCreateSelf()
01856 {
01857     CSelectItem *theItem = NEW CSelectItem();
01858     ThrowIfNil_(theItem);
01859
01860     // and insert it at the end of the table
01861     InsertItem( theItem, nil, nil );
01862 }
01863
01864 CSelectItem::CSelectItem(const string& item, const ItemRowInfo& rowInfo) : mIcon(0L)
01865 {
01866     m_item = item;
01867     m_description = FormatItemDescription(rowInfo.m_description);
01868     m_descriptionEx = FormatItemDescription(rowInfo.m_descriptionEx);
01869
01870     m_rowInfo = rowInfo;
01871 }
01872
01873 CSelectItem::CSelectItem() : mIcon(0L)
01874 {
01875 }
01876
01877 CSelectItem::~CSelectItem()
01878 {
01879 }
01880
01881 // this is the routine called to know what to draw within the
01882 // table cell. See the comments in LOutlineItem.cp for more info.
01883 void
01884 CSelectItem::GetDrawContentsSelf(
01885     const STableCell&       inCell,
01886     SOutlineDrawContents&   ioDrawContents)
01887 {
01888     switch (inCell.col)
01889     {
01890     case 1:
01891         ioDrawContents.outShowSelection = true;
01892         ioDrawContents.outHasIcon = mIcon != NULL;
01893         ioDrawContents.outIconSuite = mIcon;
01894         ioDrawContents.outTextTraits.style = mIcon == NULL ? italic : normal;
01895
01896         LStr255 pstr(m_item.c_str());
01897         if(mIcon != NULL)
01898             LString::CopyPStr(pstr, ioDrawContents.outTextString);
01899         else
01900             LString::CopyPStr("\pNo selection", ioDrawContents.outTextString);
01901         break;
01902     }
01903 }
01904
01905 // just to be cute, we'll draw an adornment (again, see the LOutlineItem.cp
01906 // comments for more information). We'll draw a groovy gray background
01907 void
01908 CSelectItem::DrawRowAdornments(
01909     const Rect&     inLocalRowRect )
01910 {
01911     ShadeRow(UGAColorRamp::GetColor(0), inLocalRowRect);
01912 }
01913
01914 void
01915 CSelectItem::DoubleClick(
01916     const STableCell&           /* inCell */,
01917     const SMouseDownEvent&      /* inMouseDown */,
01918     const SOutlineDrawContents& /* inDrawContents */,
01919     Boolean                     /* inHitText */)
01920 {
01921     if(mIcon != NULL)
01922     {
01923         LPane * topWind = mOutlineTable;
01924         while(topWind != 0L && topWind->GetSuperView() != 0L)
01925             topWind = topWind->GetSuperView();
01926         LControl*   keyButton = dynamic_cast<LControl*>(topWind->FindPaneByID('ok  '));
01927         ThrowIfNil_(keyButton);
01928         keyButton->SimulateHotSpotClick(kControlButtonPart);
01929     }
01930 }
01931
01932 static void OnRefresh_Select(LWindow *theDialog, kItemListDlg select)
01933 {
01934     bool forceCvsroot = theDialog->GetValueForPaneID(item_CheckForceRoot) == Button_On;
01935     bool recurse = theDialog->GetValueForPaneID(item_ForceRecurse) == Button_On;
01936     LStr255 pstr;
01937     theDialog->GetDescriptorForPaneID(item_ModuleName, pstr);
01938     CStr cstr(pstr);
01939
01940     const char* readFrom = kItemListModule == select && forceCvsroot ? "" : cstr.c_str();
01941     ListPath listPath;
01942
01943     std::auto_ptr<CItemListConsole> itemListConsole(LaunchItemListCommand(select, recurse,
01944         readFrom, forceCvsroot, "", "", &listPath));
01945
01946     LSelectTable *table = dynamic_cast<LSelectTable*>(theDialog->FindPaneByID(item_SelectTagList));
01947     ThrowIfNil_(table);
01948
01949     LArrayIterator iter(table->GetFirstLevelItems());
01950     LOutlineItem* item;
01951     while (iter.Next(&item))
01952     {
01953         table->RemoveItem(item);
01954     }
01955
01956     const ItemList& itemList = itemListConsole->GetItemList();
01957     ItemList::const_iterator it = itemList.begin();
01958     LOutlineItem *lastItem = 0L;
01959     while( it != itemList.end() )
01960     {
01961         CSelectItem *theItem = NEW CSelectItem((*it).first, (*it).second);
01962         ThrowIfNil_(theItem);
01963
01964         // and insert it at the end of the table
01965         table->InsertItem( theItem, nil, lastItem );
01966
01967         Handle icn = 0L;
01968
01969         switch( select )
01970         {
01971         case kItemListTag:
01972         {
01973             bool hasRevision = theItem->m_description.find(STR_ITEMLIST_REVISION) != string::npos;
01974             bool hasBranch = theItem->m_description.find(STR_ITEMLIST_BRANCH) != string::npos;
01975
01976             if( hasBranch )
01977                 icn = table->mIconBranch;
01978             else
01979                 icn = table->mIconTag;
01980         }
01981         break;
01982         case kItemListModule:
01983             icn = table->mIconModule;
01984             break;
01985         }
01986
01987         theItem->mIcon = icn;
01988
01989         it++;
01990         lastItem = theItem;
01991     }
01992 }
01993
01994 static void DoDataExchange_Select(LWindow *theDialog, kItemListDlg select, CStr & name, bool & forceCvsroot, const MultiFiles* mf, bool putValue)
01995 {
01996     DoDataExchange (theDialog, item_CheckForceRoot, forceCvsroot, putValue);
01997
01998     bool recurse = select == kItemListTag ? (bool)gItemListTagRecurse : (bool)gItemListModuleList;
01999     DoDataExchange (theDialog, item_ForceRecurse, recurse, putValue);
02000     if(select == kItemListTag)
02001         gItemListTagRecurse = recurse;
02002     else
02003     {
02004         LPane *pane = theDialog->FindPaneByID(item_ForceRecurse);
02005         pane->Hide();
02006         gItemListModuleList = recurse;
02007     }
02008
02009     CMString files(mf->TotalNumFiles() + mf->NumDirs() + 1, "SelectTagsModules");
02010     CPStr file;
02011     if( mf && putValue)
02012     {
02013         // Add selected directories
02014         for( int nIndex = 0; nIndex < mf->NumDirs(); nIndex++ )
02015         {
02016             CStr path;
02017             if( mf->getdir(nIndex, path) )
02018             {
02019                 files.Insert(path);
02020                 if(file.empty())
02021                     file = path;
02022             }
02023         }
02024
02025         if(select == kItemListTag && mf->TotalNumFiles())
02026         {
02027             file = "";
02028             MultiFiles::const_iterator mfi;
02029             for(mfi = mf->begin(); mfi != mf->end(); ++mfi)
02030             {
02031                 for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
02032                 {
02033                     UStr path;
02034                     UStr fileName;
02035                     UStr currRev;
02036
02037                     mfi->get(nIndex, path, fileName, currRev);
02038                     if( !path.empty() && !path.endsWith(kPathDelimiter) )
02039                         path << kPathDelimiter;
02040
02041                     path << fileName;
02042                     files.Insert(path);
02043                     if(file.empty())
02044                         file = path;
02045                 }
02046             }
02047         }
02048     }
02049
02050     LPopupFiller *filler = dynamic_cast<LPopupFiller*>(theDialog->FindPaneByID(item_PopModName));
02051     filler->DoDataExchange(files, putValue);
02052
02053     DoDataExchange (theDialog, item_ModuleName, file, putValue);
02054
02055     LSelectTable *table = dynamic_cast<LSelectTable*>(theDialog->FindPaneByID(item_SelectTagList));
02056     ThrowIfNil_(table);
02057
02058     if(!putValue)
02059     {
02060         CSelectItem *item;
02061         STableCell cell;
02062         cell = table->GetFirstSelectedCell();
02063         if(!cell.IsNullCell())
02064         {
02065             item = dynamic_cast<CSelectItem*>
02066                 (table->FindItemForRow(cell.row));
02067             ThrowIfNil_(item != 0L);
02068
02069             if(item->mIcon != 0L)
02070                 name = item->m_item.c_str();
02071         }
02072     }
02073 }
02074 #endif /* qMacCvsPP */
02075
02076 #if qUnix
02077 class UCvsItemListDlg : public UWidget
02078 {
02079     UDECLARE_DYNAMIC(UCvsItemListDlg)
02080 public:
02081     UCvsItemListDlg(const MultiFiles* mf,
02082         const char* item, kItemListDlg type, ItemList& itemList, const ListPath* listPath,
02083         bool forceCvsroot, const char* rev, const char* date);   // standard constructor
02084     virtual ~UCvsItemListDlg() {}
02085
02086     enum
02087     {
02088         kOK = EV_COMMAND_START, // 0
02089         kCancel,                // 1
02090         kSelTagBranch,          // 2
02091         kSelectionDetailsKnob,  // 3
02092         kTagBranchList,         // 4
02093         kFilePathList,          // 5
02094         kFilePathBrowse,        // 6
02095         kRefresh,               // 7
02096         kRecurse,               // 8
02097         kForceRoot,             // 9
02098         kRevTag,                // 10
02099         kRevTagCombo,           // 11
02100         kRevTagBrowse,          // 12
02101         kDate,                  // 13
02102         kDateCombo,             // 14
02103         kAutoRefresh,           // 15
02104         kItemDesc,              // 16
02105     };
02106
02107     virtual void DoDataExchange(bool fill);
02108 public:
02109     ListPath m_listPath;
02110     UStr    m_item;
02111     bool    m_forceCvsroot;
02112     bool    m_hasRev;
02113     UStr    m_rev;
02114     UStr    m_date;
02115     bool    m_hasDate;
02116     bool    m_recurse;
02117
02118     int m_sort; // column to sort by
02119     bool m_ascendant; // sort in ascending order
02120     kItemListDlg m_type;
02122 protected:
02123     ev_msg int OnOK(void);
02124     ev_msg int OnCancel(void);
02125     ev_msg int OnDate(void);
02126     ev_msg int OnRev(void);
02127     ev_msg int OnRefresh(void);
02128     ev_msg int OnTagRevBrowse(void);
02129     ev_msg int OnSelectionDetails(void);
02130     ev_msg int OnForceRoot(void);
02131     ev_msg int OnOptionChk(void);
02132     ev_msg int OnReadFromBrowse(void);
02133     ev_msg void OnItemDblClick(void);
02134     ev_msg void OnItemSelect(int entry, const char *txt);
02135     ev_msg void OnSelColumn(int column);
02136
02137     UDECLARE_MESSAGE_MAP()
02138
02139 private:
02140     const MultiFiles* m_mf;
02142     ItemList& m_itemList;
02145     bool CheckSettings( void);
02146     void InitOptionCtrls( void);
02147     void InitListCtrl(const kDisplayType displayType);
02148     void* GetImageForItem( kItemListDlg type, bool option, const ItemDisplayInfo* displayInfo);
02149     void DisplayItems( const ItemList& itemList, const int launchRes,
02150         stringstream* cvsErr = NULL, const bool showUpDir = true);
02151     void PostClickRefresh( void);
02152     void EnableControls(bool enable);
02153
02154     void Resort( void);
02155 };
02156
02157 UIMPLEMENT_DYNAMIC(UCvsItemListDlg, UWidget)
02158
02159 UBEGIN_MESSAGE_MAP(UCvsItemListDlg, UWidget)
02160     ON_UCOMMAND(UCvsItemListDlg::kOK, UCvsItemListDlg::OnOK)
02161     ON_UCOMMAND(UCvsItemListDlg::kCancel, UCvsItemListDlg::OnCancel)
02162     ON_UCOMMAND(UCvsItemListDlg::kDate, UCvsItemListDlg::OnDate)
02163     ON_UCOMMAND(UCvsItemListDlg::kRevTag, UCvsItemListDlg::OnRev)
02164     ON_UCOMMAND(UCvsItemListDlg::kRefresh, UCvsItemListDlg::OnRefresh)
02165     ON_UCOMMAND(UCvsItemListDlg::kRevTagBrowse, UCvsItemListDlg::OnTagRevBrowse)
02166     ON_UCOMMAND(UCvsItemListDlg::kSelectionDetailsKnob, UCvsItemListDlg::OnSelectionDetails)
02167     ON_UCOMMAND(UCvsItemListDlg::kForceRoot, UCvsItemListDlg::OnForceRoot)
02168     ON_UCOMMAND(UCvsItemListDlg::kRecurse, UCvsItemListDlg::OnOptionChk)
02169     ON_UCOMMAND(UCvsItemListDlg::kFilePathBrowse, UCvsItemListDlg::OnReadFromBrowse)
02170     ON_LIST_SELECTING(UCvsItemListDlg::kTagBranchList, UCvsItemListDlg::OnItemSelect)
02171     ON_LIST_DBLCLICK(UCvsItemListDlg::kTagBranchList, UCvsItemListDlg::OnItemDblClick)
02172     ON_LIST_SELCOLUMN(UCvsItemListDlg::kTagBranchList, UCvsItemListDlg::OnSelColumn)
02173 UEND_MESSAGE_MAP()
02174
02175
02176 UCvsItemListDlg::UCvsItemListDlg(const MultiFiles* mf,
02177                            const char* item, kItemListDlg type, ItemList& itemList, const ListPath* listPath,
02178                            bool forceCvsroot, const char* rev, const char* date)
02179                            : m_mf(mf), m_itemList(itemList), m_type( type), m_forceCvsroot( forceCvsroot),
02180                            UWidget(::UEventGetWidID())
02181 {
02182     m_ascendant = true; // default ascending order
02183     m_sort = 0; // default sort by first column
02184     m_hasRev = false;
02185     m_hasDate = false;
02186     switch( m_type )
02187     {
02188     case kItemListTag:
02189         m_recurse = (bool)gItemListTagRecurse;
02190         break;
02191     case kItemListModule:
02192         m_recurse = (bool)gItemListModuleList;
02193         break;
02194     default:
02195         m_recurse = false;
02196         break;
02197     }
02198     if( listPath )
02199     {
02200         m_listPath = *listPath;
02201     }
02202     m_rev = rev;
02203     m_date = date;
02204
02205 }
02206
02207 void UCvsItemListDlg::PostClickRefresh( void)
02208 {
02209     UEventPostMessage(GetWidID(), EV_CMD, kRefresh, 0L);
02210 }
02211
02212 int UCvsItemListDlg::OnOK(void)
02213 {
02214     switch( m_type )
02215     {
02216     case kItemListTag:
02217         gItemListTagRecurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) != 0;
02218         break;
02219     case kItemListModule:
02220         gItemListModuleList = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) != 0;
02221         break;
02222     default:
02223         // Nothing to do
02224         break;
02225     }
02226     EndModal(true);
02227     return 0;
02228 }
02229
02230 int UCvsItemListDlg::OnCancel(void)
02231 {
02232     EndModal(false);
02233     return 0;
02234 }
02235
02236 int UCvsItemListDlg::OnDate()
02237 {
02238     bool enable = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kDate, 0L)
02239         && !(kItemListModule == m_type && !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L));
02240 //  m_hasDate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kDate, 0L);
02241     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kDateCombo, enable), 0L);
02242     return 0;
02243 }
02244
02245 int UCvsItemListDlg::OnRev()
02246 {
02247     bool enable = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRevTag, 0L)
02248         && !(kItemListModule == m_type && !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L));
02249 //  m_hasRev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRevTag, 0L);
02250     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTagCombo, enable), 0L);
02251     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTagBrowse, enable), 0L);
02252     return 0;
02253 }
02254
02255 void UCvsItemListDlg::DoDataExchange(bool fill)
02256 {
02257     if(fill)
02258     {
02259         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kDate, m_hasDate), 0L);
02260         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRevTag, m_hasRev), 0L);
02261         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRecurse, m_recurse), 0L);
02262         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kForceRoot, m_forceCvsroot), 0L);
02263         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kFilePathBrowse, m_forceCvsroot), 0L);
02264
02265         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kRevTagCombo, 0L);
02266         UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRevTagCombo, (void *)(const char *)(m_rev));
02267         const std::vector<UStr> & rlist = gRevNames.GetList();
02268         std::vector<UStr>::const_iterator i;
02269         for(i = rlist.begin(); i != rlist.end(); ++i)
02270         {
02271             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kRevTagCombo, (void *)(const char *)(*i));
02272         }
02273         OnRev();
02274
02275         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kDateCombo, 0L);
02276         UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kDateCombo, (void *)(const char *)(m_date));
02277         const std::vector<UStr> & dlist = gDateNames.GetList();
02278         for(i = dlist.begin(); i != dlist.end(); ++i)
02279         {
02280             UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kDateCombo, (void *)(const char *)(*i));
02281         }
02282         OnDate();
02283
02284         // init dialog style...
02285         if( m_mf )
02286         {
02287             // Add selected directories
02288             for( int nIndex = 0; nIndex < m_mf->NumDirs(); nIndex++ )
02289             {
02290                 UStr path;
02291                 if( m_mf->getdir(nIndex, path) )
02292                 {
02293                     UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kFilePathList, (void*)(const char*)path);
02294                 }
02295             }
02296         }
02297
02298         int nReadFromSelection = UEventSendMessage(GetWidID(), EV_COMBO_GETCOUNT, kFilePathList, 0L);
02299
02300         switch( m_type )
02301         {
02302         case kItemListTag:
02303             // Set windows titles
02304             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void*)"Select tag/branch");
02305             UEventSendMessage(GetWidID(), EV_SETTEXT, kItemDesc, (void*)"Tag/branch:");
02306             UEventSendMessage(GetWidID(), EV_SETTEXT, kRecurse, (void*)"Recurse");
02307
02308             // The browser selection
02309             if( m_mf && m_mf->TotalNumFiles() )
02310             {
02311                 MultiFiles::const_iterator mfi;
02312                 for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
02313                 {
02314                     for( int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++ )
02315                     {
02316                         UStr path;
02317                         UStr fileName;
02318                         UStr currRev;
02319
02320                         mfi->get(nIndex, path, fileName, currRev);
02321                         if( !path.empty() && !path.endsWith(kPathDelimiter) )
02322                             path << kPathDelimiter;
02323
02324                         path << fileName;
02325
02326                         UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kFilePathList, (void*)(const char*)path);
02327                     }
02328                 }
02329                 // It's better to have a single file selected initially for the performance reasons
02330                 if( nReadFromSelection)
02331                     UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kFilePathList, nReadFromSelection+1), 0L);
02332             }
02333
02334             break;
02335         case kItemListModule:
02336             // Set windows titles
02337             UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void*)"Select module");
02338             UEventSendMessage(GetWidID(), EV_SETTEXT, kItemDesc, (void*)"Module:");
02339             UEventSendMessage(GetWidID(), EV_SETTEXT, kRecurse, (void*)"List");
02340
02341             if( nReadFromSelection)
02342                 UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kFilePathList, 0), 0L);
02343
02344             UEventSendMessage(GetWidID(), EV_SHOW_WIDGET, kFilePathBrowse, FALSE);
02345             break;
02346         default:
02347     //      ASSERT(FALSE);  // unknown type
02348             EndModal(false);
02349             return;
02350         }
02351
02352         // Trigger refresh
02353         kItemListAutoRefreshType autoRefresh = kAutoRefreshFirstTime;
02354
02355         if( kItemListModule == m_type )
02356         {
02357             autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshModule;
02358         }
02359         else if( kItemListTag == m_type )
02360         {
02361             autoRefresh = (kItemListAutoRefreshType)(int)gItemListAutoRefreshTag;
02362         }
02363         else
02364         {
02365     //      ASSERT(FALSE); // unknown type
02366         }
02367
02368         UEventSendMessage(GetWidID(), EV_COMBO_SETSEL, UMAKEINT(kAutoRefresh, autoRefresh), 0L);
02369         if( (kAutoRefreshAlways == autoRefresh) || (kAutoRefreshFirstTime == autoRefresh && m_itemList.empty()) )
02370         {
02371             // Force the window to show itself
02372 //          gdk_flush();
02373             PostClickRefresh();
02374         }
02375         else
02376         {
02377             DisplayItems( m_itemList, 0, NULL, false);
02378             Resort();
02379
02380             UStr item;
02381             UEventSendMessage(GetWidID(), EV_GETTEXT, kSelTagBranch, &item);
02382             if( !item.empty() )
02383             {
02384                 UEventSendMessage(GetWidID(), EV_CHGFOCUS, kSelTagBranch, 0L);
02385             }
02386
02387         }
02388     }
02389     else
02390     {
02391         m_forceCvsroot = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRoot, 0L);
02392         m_recurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L);
02393         UEventSendMessage(GetWidID(), EV_GETTEXT, kSelTagBranch, &m_item);
02394         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRevTag, 0L) )
02395         {
02396             UEventSendMessage(GetWidID(), EV_GETTEXT, kRevTagCombo, &m_rev);
02397         }
02398
02399         if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kDate, 0L) )
02400         {
02401             UEventSendMessage(GetWidID(), EV_GETTEXT, kDateCombo, &m_date);
02402         }
02403     }
02404 }
02405
02410 void UCvsItemListDlg::EnableControls(bool enable)
02411 {
02412     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kOK, enable), 0L);
02413     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRefresh, enable), 0L);
02414     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kFilePathList, enable), 0L);
02415     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kTagBranchList, enable), 0L);
02416     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSelTagBranch, enable), 0L);
02417     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kSelectionDetailsKnob, enable), 0L);
02418     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRecurse, enable), 0L);
02419     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kForceRoot, enable), 0L);
02420     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kAutoRefresh, enable), 0L);
02421
02422     if( !enable )
02423     {
02424         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTag, FALSE), 0L);
02425         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTagCombo, FALSE), 0L);
02426         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTagBrowse, FALSE), 0L);
02427         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kDate, FALSE), 0L);
02428         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kDateCombo, FALSE), 0L);
02429         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kFilePathBrowse, FALSE), 0L);
02430     }
02431     else
02432     {
02433         InitOptionCtrls();
02434         OnForceRoot();
02435     }
02436 }
02437
02438 int UCvsItemListDlg::OnRefresh(void)
02439 {
02440
02441     // Verify the settings
02442     if( !CheckSettings() )
02443     {
02444         return 0;
02445     }
02446
02447     // Prepare controls
02448     EnableControls(FALSE);
02449
02450     // Change the Cancel button's name to "Stop"
02451     UStr strPrevCancelText;
02452     UEventSendMessage(GetWidID(), EV_GETTEXT, kCancel, &strPrevCancelText);
02453     UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void*)"Stop");
02454
02455     // Store current item text
02456     UStr strItem;
02457     UEventSendMessage(GetWidID(), EV_GETTEXT, kSelTagBranch, &strItem);
02458
02459     // Display the reading data prompt
02460     InitListCtrl(kDisplayWait);
02461
02462     // Select and launch command
02463     UStr strReadFrom;
02464     UStr revision;
02465     UStr date;
02466
02467     UEventSendMessage(GetWidID(), EV_GETTEXT, kFilePathList, &strReadFrom);
02468
02469     if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRevTag, 0L) )
02470     {
02471         UEventSendMessage(GetWidID(), EV_GETTEXT, kRevTagCombo, &revision);
02472     }
02473
02474     if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kDate, 0L) )
02475     {
02476         UEventSendMessage(GetWidID(), EV_GETTEXT, kDateCombo, &date);
02477     }
02478
02479     const char* readFrom = kItemListModule == m_type &&
02480         UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRoot, 0L) &&
02481         !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) ? "" : (const char*)strReadFrom;
02482
02483     std::auto_ptr<CItemListConsole> itemListConsole(
02484         LaunchItemListCommand(m_type, UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) != 0,
02485             readFrom, UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRoot, 0L) != 0,
02486             revision, date, &m_listPath));
02487
02488     if( !itemListConsole.get() )
02489     {
02490         EndModal(false);
02491         return 0;
02492     }
02493
02494     // Initialize list control
02495     InitListCtrl(kDisplayData);
02496
02497     // Restore control's state
02498     EnableControls(TRUE);
02499
02500     // Display data
02501     DisplayItems( itemListConsole->GetItemList(), itemListConsole->GetLaunchRes(), &itemListConsole->GetCvsErr());
02502
02503     // Restore Cancel's button name
02504     UEventSendMessage(GetWidID(), EV_SETTEXT, kCancel, (void*)(const char*)strPrevCancelText);
02505
02506     // Sort items
02507     Resort();
02508
02509     // Try to select the item
02510     UEventSendMessage(GetWidID(), EV_GETTEXT, kSelTagBranch, &strItem);
02511     if( strItem.empty())
02512     {
02513         int row = -1;
02514         row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
02515                                     UMAKEINT(kTagBranchList, row), 0L);
02516         if( row != -1)
02517         {
02518             ULIST_INFO info1;
02519             info1.col = 1;
02520             info1.row = row;
02521             UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kTagBranchList, &info1);
02522             strItem = ((ItemDisplayInfo*)(info1.data))->GetItem().c_str();
02523             UEventSendMessage(GetWidID(), EV_SETTEXT, kSelTagBranch, (void*)strItem.c_str());
02524         }
02525     }
02526
02527     if( !strItem.empty() )
02528     {
02529         UEventSendMessage(GetWidID(), EV_CHGFOCUS, kSelTagBranch, 0L);
02530     }
02531
02532     return 0;
02533 }
02534
02539 bool UCvsItemListDlg::CheckSettings(void)
02540 {
02541     UStr date;
02542     UStr rev;
02543     if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRevTag, 0L) )
02544     {
02545         UEventSendMessage(GetWidID(), EV_GETTEXT, kRevTagCombo, &rev);
02546         if ( rev.empty())
02547         {
02548             CvsAlert( _i18n("Please enter more than 1 character for revision/tag"), NULL, _i18n("Cancel"));
02549             UEventSendMessage(GetWidID(), EV_CHGFOCUS, kRevTagCombo, 0L);
02550             return false;
02551         }
02552     }
02553
02554     if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kDate, 0L) )
02555     {
02556         UEventSendMessage(GetWidID(), EV_GETTEXT, kDateCombo, &date);
02557         if ( date.empty())
02558         {
02559             CvsAlert( _i18n("Please enter more than 1 character for date"), NULL, _i18n("Cancel"));
02560             UEventSendMessage(GetWidID(), EV_CHGFOCUS, kDateCombo, 0L);
02561             return false;
02562         }
02563     }
02564     return true;
02565 }
02566
02567 int UCvsItemListDlg::OnTagRevBrowse(void)
02568 {
02569     UStr tagName;
02570     if( CompatGetTagListItem( m_mf, tagName) )
02571     {
02572         m_rev = (const char*)tagName;
02573         UEventSendMessage(GetWidID(), EV_SETTEXT, kRevTagCombo, (void*)(const char*)tagName);
02574     }
02575     return 0;
02576 }
02577
02578 int UCvsItemListDlg::OnSelectionDetails(void)
02579 {
02580     kSelDetType selDetType = kItemListModule == m_type ? kSelDetPath : kSelDetRevision;
02581     UStr selection;
02582
02583     UEventSendMessage(GetWidID(), EV_GETTEXT, kSelTagBranch, &selection);
02584
02585     if( CompatGetSelectionDetails( m_mf, selDetType, selection) )
02586     {
02587         UEventSendMessage(GetWidID(), EV_SETTEXT, kSelTagBranch, (void*)(const char*)selection);
02588         OnOK();
02589     }
02590     return 0;
02591 }
02592
02593 int UCvsItemListDlg::OnForceRoot(void)
02594 {
02595     bool enableReadFrom = !(kItemListModule == m_type
02596         && UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRoot, 0L)
02597         && !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L));
02598     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT( kFilePathList, enableReadFrom), 0L);
02599
02600     bool enableBrowseReadFrom = kItemListTag == m_type
02601         && UEventSendMessage(GetWidID(), EV_QUERYSTATE, kForceRoot, 0L);
02602     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT( kFilePathBrowse, enableBrowseReadFrom), 0L);
02603     return 0;
02604 }
02605
02606 int UCvsItemListDlg::OnOptionChk(void)
02607 {
02608     m_recurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L);
02609
02610     InitOptionCtrls();
02611
02612     if( m_type == kItemListModule )
02613     {
02614         m_listPath.clear();
02615
02616         m_ascendant = false;
02617         m_sort = 0;
02618     }
02619
02620     return 0;
02621 }
02622
02623 int UCvsItemListDlg::OnReadFromBrowse(void)
02624 {
02625     UStr moduleName;
02626     if( CompatGetModuleListItem( m_mf, moduleName) )
02627     {
02628         UEventSendMessage(GetWidID(), EV_SETTEXT, kFilePathList, (void*)(const char*)moduleName);
02629         UEventSendMessage(GetWidID(), EV_CHGFOCUS, kFilePathBrowse, 0L);
02630     }
02631     return 0;
02632 }
02633
02637 void UCvsItemListDlg::InitOptionCtrls( void)
02638 {
02639     bool enableDateRev = (kItemListModule == m_type
02640         && !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L)) ? false : true;
02641
02642     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kDate, enableDateRev), 0L);
02643     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kRevTag, enableDateRev), 0L);
02644
02645     OnRev();
02646     OnDate();
02647
02648     switch( m_type )
02649     {
02650     case kItemListTag:
02651         gItemListTagRecurse = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) != 0;
02652         break;
02653     case kItemListModule:
02654         gItemListModuleList = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) != 0;
02655         break;
02656     default:
02657         // Nothing to do
02658         break;
02659     }
02660 }
02661
02662 void UCvsItemListDlg::InitListCtrl(const kDisplayType displayType)
02663 {
02664     // Remove all items and columns
02665     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kTagBranchList, 0), 0L);
02666     // FIX ME remove all ROWSETDATA items here!
02667     UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kTagBranchList, 0L);
02668     UEventSendMessage(GetWidID(), EV_LIST_HIDECOLUMNS, UMAKEINT(kTagBranchList,3), 0L);
02669
02670     // Set the appropriate columns
02671     switch( displayType )
02672     {
02673     case kDisplayWait:
02674         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,0), (void*)"Action");
02675         UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kTagBranchList,1), 0L);
02676         {
02677             int rownum;
02678             ULIST_INSERT entry;
02679             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02680             UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), NULL);
02681             entry.row = rownum;
02682             entry.col = 0;
02683             entry.title = "Please wait while retrieving data";
02684             entry.icon = 0L;
02685             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02686             entry.col = 0;
02687             entry.title = "You can press Stop button to cancel the operation";
02688             entry.icon = 0L;
02689             UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02690         }
02691         break;
02692     case kDisplayData:
02693         {
02694             switch( m_type )
02695             {
02696             case kItemListTag:
02697                 UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,0), (void*)"Tag/branch");
02698                 UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,1), (void*)"Description");
02699                 UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kTagBranchList,2), 0L);
02700                 break;
02701             case kItemListModule:
02702                 if( UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L))
02703                 {
02704                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,0), (void*)"Module");
02705                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,1), (void*)"Description");
02706                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,2), (void*)"Timestamp");
02707                 }
02708                 else
02709                 {
02710                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,0), (void*)"Module");
02711                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,1), (void*)"Options");
02712                     UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,2), (void*)"Directories / Files");
02713                 }
02714                 UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kTagBranchList,3), 0L);
02715                 break;
02716             default:
02717 //              ASSERT(FALSE);  // unknown type
02718                 break;
02719             }
02720         }
02721         break;
02722     case kDisplayInfo:
02723         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kTagBranchList,0), (void*)"Information");
02724         UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kTagBranchList,1), 0L);
02725         break;
02726     default:
02727 //      ASSERT(FALSE);  // unknown display type
02728         break;
02729     }
02730     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kTagBranchList, 1), 0L);
02731 }
02732
02733 void UCvsItemListDlg::DisplayItems(const ItemList& itemList,
02734     const int launchRes,
02735     stringstream* cvsErr /*= NULL*/,
02736     const bool showUpDir /*= true*/)
02737 {
02738
02739     if( itemList.size() == 0 )
02740     {
02741 //      if( !m_cvsStopped )
02742         {
02743             if( launchRes == 0 )
02744             {
02745                 // Show the info if the modules file doesn't contain any modules
02746                 if( kItemListModule == m_type && !UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L))
02747                 {
02748                     InitListCtrl( kDisplayInfo);
02749                     int rownum;
02750                     ULIST_INSERT entry;
02751                     UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02752                     UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), NULL);
02753                     entry.row = rownum;
02754                     entry.col = 0;
02755                     entry.title = "Modules file doesn't contain any modules definitions";
02756                     entry.icon = 0L;
02757                     UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02758                     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kTagBranchList, 0), 0L);
02759                 }
02760             }
02761             else if( cvsErr )
02762             {
02763                 InitListCtrl(kDisplayInfo);
02764
02765                 // Show the error in the list control
02766                 int rownum;
02767                 ULIST_INSERT entry;
02768                 UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02769                 UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), NULL);
02770                 entry.row = rownum;
02771                 entry.col = 0;
02772                 entry.title = "Command failed:";
02773                 entry.icon = 0L;
02774                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02775
02776                 string line;
02777                 while( getline(*cvsErr, line) )
02778                 {
02779                     UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02780                     UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), NULL);
02781                     entry.row = rownum;
02782                     entry.col = 0;
02783                     entry.title = line.c_str();
02784                     entry.icon = 0L;
02785                     UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02786                 }
02787                 UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kTagBranchList, 0), 0L);
02788             }
02789         }
02790     }
02791     else
02792     {
02793         // Insert the items
02794         for( ItemList::const_iterator it = itemList.begin(); it != itemList.end(); ++it)
02795         {
02796             ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
02797             if( displayInfo )
02798             {
02799                 displayInfo->Create((*it).first, (*it).second);
02800                 int rownum;
02801                 ULIST_INSERT entry;
02802                 UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02803                 if ( rownum > -1)
02804                 {
02805                     void* image = GetImageForItem(
02806                         m_type, UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L), displayInfo);
02807                     entry.row = rownum;
02808                     entry.col = 0;
02809                     entry.title = displayInfo->GetItem().c_str();
02810                     entry.icon = image;
02811                     UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02812                     if( kItemListTag == m_type || kItemListModule == m_type )
02813                     {
02814                         entry.col = 1;
02815                         entry.title = displayInfo->GetDescription().c_str();
02816                         entry.icon = 0L;
02817                         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02818                     }
02819                     if( kItemListModule == m_type )
02820                     {
02821                         entry.col = 2;
02822                         entry.title = displayInfo->GetDescriptionEx().c_str();
02823                         entry.icon = 0L;
02824                         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02825                     }
02826                     UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), displayInfo);
02827                 }
02828                 else
02829                 {
02830                     delete displayInfo;
02831                 }
02832             }
02833         }
02834     }
02835
02836     if( showUpDir
02837         && kItemListModule == m_type
02838         && UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L)
02839         && !m_listPath.empty() )
02840     {
02841         // Insert the ".." to move one level up in the directories tree
02842         ItemDisplayInfo* displayInfo = new ItemDisplayInfo;
02843         if( displayInfo )
02844         {
02845             ItemRowInfo rowInfo;
02846             rowInfo.m_description.insert(STR_ITEMLIST_DIR);
02847
02848             displayInfo->Create(string(STR_ITEMLIST_UP_DIR), rowInfo);
02849             int rownum;
02850             ULIST_INSERT entry;
02851             UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kTagBranchList, &rownum);
02852             if ( rownum > -1)
02853             {
02854                 void* image = GetImageForItem(
02855                     m_type, UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L), displayInfo);
02856                 entry.row = rownum;
02857                 entry.col = 0;
02858                 entry.title = displayInfo->GetItem().c_str();
02859                 entry.icon = image;
02860                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02861                 entry.col = 1;
02862                 entry.title = displayInfo->GetDescription().c_str();
02863                 entry.icon = 0L;
02864                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kTagBranchList, &entry);
02865                 UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kTagBranchList, rownum), displayInfo);
02866             }
02867             else
02868             {
02869                 delete displayInfo;
02870             }
02871         }
02872     }
02873 }
02874
02875
02876 #if qGTK
02877 static void* _ImgBranchAndRevision;
02878 static void* _ImgBranch;
02879 static void* _ImgRevision;
02880 static void* _ImgUpDir;
02881 static void* _ImgDir;
02882 static void* _ImgFile;
02883 static void* _ImgModule;
02884 #endif
02885
02886 void* UCvsItemListDlg::GetImageForItem( kItemListDlg type, bool option, const ItemDisplayInfo* displayInfo)
02887 {
02888     void* res = NULL;
02889     if( _ImgBranchAndRevision == 0L)
02890     {
02891 // FIX ME missing icons!
02892         _ImgBranchAndRevision = UCreate_pixmap(this, "branch.xpm");
02893         _ImgBranch = UCreate_pixmap(this, "branch.xpm");
02894         _ImgRevision = UCreate_pixmap(this, "tag.xpm");
02895         _ImgUpDir = UCreate_pixmap(this, "folder.xpm");
02896         _ImgDir = UCreate_pixmap(this, "folder.xpm");
02897         _ImgFile = UCreate_pixmap(this, "cvsfile.xpm");
02898         _ImgModule = UCreate_pixmap(this, "explore.xpm");
02899     }
02900
02901
02902     switch( type )
02903     {
02904     case kItemListTag:
02905         {
02906             bool hasRevision = displayInfo->GetDescription().find(STR_ITEMLIST_REVISION) != string::npos;
02907             bool hasBranch = displayInfo->GetDescription().find(STR_ITEMLIST_BRANCH) != string::npos;
02908
02909             if( hasRevision && hasBranch )
02910             {
02911                 res = _ImgBranchAndRevision;
02912             }
02913             else if( hasBranch )
02914             {
02915                 res = _ImgBranch;
02916             }
02917             else
02918             {
02919                 res = _ImgRevision;
02920             }
02921         }
02922         break;
02923     case kItemListModule:
02924         if( option )
02925         {
02926             if( strcmp(displayInfo->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
02927             {
02928                 res = _ImgUpDir;
02929             }
02930             else
02931             {
02932                 bool isDir = displayInfo->GetDescription().find(STR_ITEMLIST_DIR) != string::npos;
02933                 res = isDir ? _ImgDir : _ImgFile;
02934             }
02935         }
02936         else
02937         {
02938             res = _ImgModule;
02939         }
02940         break;
02941     default:
02942 //      ASSERT(FALSE);  // unknown type
02943         break;
02944     }
02945
02946     return res;
02947 }
02948
02949
02950 void UCvsItemListDlg::OnItemSelect(int entry, const char *txt)
02951 {
02952     ULIST_INFO info;
02953     info.col = 0;
02954     info.row = entry;
02955     UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kTagBranchList, &info);
02956
02957     UStr item;
02958
02959     if( kItemListModule == m_type && UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) )
02960     {
02961         item = FormatListPath(m_listPath).c_str();
02962
02963         UStr selItem = ((ItemDisplayInfo*)(info.data))->GetItem().c_str();
02964         if( selItem  != STR_ITEMLIST_UP_DIR )
02965         {
02966             item += selItem;
02967         }
02968         else
02969         {
02970             while( item.endsWith( '/'))
02971                 item = item.substr( 0, item.length()-1);
02972         }
02973     }
02974     else
02975     {
02976         item = ((ItemDisplayInfo*)(info.data))->GetItem().c_str();
02977     }
02978
02979     UEventSendMessage(GetWidID(), EV_SETTEXT, kSelTagBranch, (void*)(const char*)item);
02980 }
02981
02982 void UCvsItemListDlg::OnItemDblClick(void)
02983 {
02984     int row = -1;
02985     if((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
02986                                 UMAKEINT(kTagBranchList, row), 0L)) == -1)
02987         return;
02988
02989     if( kItemListModule == m_type && UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRecurse, 0L) )
02990     {
02991         ULIST_INFO info1;
02992         info1.col = 1;
02993         info1.row = row;
02994         UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kTagBranchList, &info1);
02995
02996         const UStr description = ((ItemDisplayInfo*)(info1.data))->GetDescription().c_str();
02997         if( description == STR_ITEMLIST_DIR )
02998         {
02999             const UStr item = ((ItemDisplayInfo*)(info1.data))->GetItem().c_str();
03000             if( item == STR_ITEMLIST_UP_DIR )
03001             {
03002                 if( !m_listPath.empty() )
03003                 {
03004                     // Set the item for selection in up-level
03005                     const string backItem = m_listPath.back();
03006                     UEventSendMessage(GetWidID(), EV_SETTEXT, kSelTagBranch, (void*)backItem.c_str());
03007
03008                     m_listPath.pop_back();
03009                 }
03010             }
03011             else
03012             {
03013                 // Make it so it's easy to "return" where we came from
03014                 UEventSendMessage(GetWidID(), EV_SETTEXT, kSelTagBranch, (void*)STR_ITEMLIST_UP_DIR);
03015                 m_listPath.push_back(item.c_str());
03016             }
03017
03018             PostClickRefresh();
03019         }
03020     }
03021     else
03022     {
03023         OnOK();
03024     }
03025 }
03026
03027 void UCvsItemListDlg::OnSelColumn(int column)
03028 {
03029     if(column == m_sort)
03030         m_ascendant = !m_ascendant;
03031     else
03032     {
03033         m_ascendant = true;
03034         m_sort = column;
03035     }
03036     Resort();
03037 }
03038
03039 static int ItemListSorter(UWidget *w, void *data1, void *data2)
03040 {
03041     ItemDisplayInfo *i1 = (ItemDisplayInfo*)data1;
03042     ItemDisplayInfo *i2 = (ItemDisplayInfo*)data2;
03043     UCvsItemListDlg *dlg = (UCvsItemListDlg*)w;
03044     int res = 0;
03045
03046     switch ( dlg->m_type) {
03047     case kItemListModule:
03048         if( dlg->m_recurse )
03049         {
03050             if( strcmp(i1->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
03051             {
03052                 res = dlg->m_ascendant ? 1 : -1;
03053             }
03054             else if( strcmp(i2->GetItem().c_str(), STR_ITEMLIST_UP_DIR) == 0 )
03055             {
03056                 res = dlg->m_ascendant ? -1 : 1;
03057             }
03058             else
03059             {
03060                 bool isDir1 = strcmp(i1->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
03061                 bool isDir2 = strcmp(i2->GetDescription().c_str(), STR_ITEMLIST_DIR) == 0;
03062
03063                 if( isDir1 && !isDir2 )
03064                 {
03065                     res = dlg->m_ascendant ? 1 : -1;
03066                 }
03067                 else if( !isDir1 && isDir2 )
03068                 {
03069                     res = dlg->m_ascendant ? -1 : 1;
03070                 }
03071                 else if( isDir1 && isDir2 )
03072                 {
03073                     res = stricmp(i1->GetItem().c_str(), i2->GetItem().c_str());
03074                     if( dlg->m_sort != 0 )
03075                     {
03076                         if( dlg->m_ascendant )
03077                         {
03078                             res *= -1;
03079                         }
03080                     }
03081                 }
03082                 else
03083                 {
03084                     switch( dlg->m_sort )
03085                     {
03086                     case 0:
03087                         res = stricmp(i1->GetItem().c_str(), i2->GetItem().c_str());
03088                         break;
03089                     case 1:
03090                         res = stricmp(i1->GetDescription().c_str(), i2->GetDescription().c_str());
03091                         break;
03092                     case 2:
03093                         {
03094                             const time_t time1 = GetDateTime(i1->GetDescriptionEx().c_str());
03095                             const time_t time2 = GetDateTime(i2->GetDescriptionEx().c_str());
03096
03097                             if( time1 != (time_t)-1 && time2 != (time_t)-1 )
03098                             {
03099                                 res = time1 < time2 ? -1 : (time1 > time2 ? 1 : 0);
03100                             }
03101                             else
03102                             {
03103                                 res = stricmp(i1->GetDescriptionEx().c_str(), i2->GetDescriptionEx().c_str());
03104                             }
03105                         }
03106                         break;
03107                     default:
03108 //                      g_assert(0); // should not come here
03109                         break;
03110                     }
03111                 }
03112             }
03113         }
03114         else
03115         {
03116             switch( dlg->m_sort )
03117             {
03118             case 0:
03119                 res = stricmp(i1->GetItem().c_str(), i2->GetItem().c_str());
03120                 break;
03121             case 1:
03122                 res = stricmp(i1->GetDescription().c_str(), i2->GetDescription().c_str());
03123                 break;
03124             case 2:
03125                 res = stricmp(i1->GetDescriptionEx().c_str(), i2->GetDescriptionEx().c_str());
03126                 break;
03127             default:
03128 //              g_assert(0); // should not come here
03129                 break;
03130             }
03131         }
03132         break;
03133     case kItemListTag:
03134         switch( dlg->m_sort )
03135         {
03136         case 0:
03137             res = stricmp(i1->GetItem().c_str(), i2->GetItem().c_str());
03138             break;
03139         case 1:
03140             res = stricmp(i1->GetDescription().c_str(), i2->GetDescription().c_str());
03141             break;
03142         default:
03143 //          g_assert(0); // should not come here
03144             break;
03145         }
03146         break;
03147     default:
03148 //      g_assert(0);
03149         break;
03150     }
03151
03152     if( res )
03153     {
03154         if( dlg->m_ascendant)
03155         {
03156             res *= -1;
03157         }
03158     }
03159
03160     return res;
03161 }
03162
03163 void UCvsItemListDlg::Resort( void)
03164 {
03165     UEventSendMessage(GetWidID(), EV_LIST_RESORT, UMAKEINT(kTagBranchList, m_sort), (void *)ItemListSorter);
03166     UEventSendMessage(GetWidID(), EV_LIST_SETSORTDIR, UMAKEINT(kTagBranchList, m_sort), (void *)m_ascendant);
03167 }
03168
03169 #endif /* qUnix */
03170
03172 bool CompatGetTagListItem(const MultiFiles* mf,
03173                           CStr& tagName)
03174 {
03175     bool userHitOK = false;
03176
03177     static CStr sLastTag;
03178     static ItemList sTagList;
03179     static bool sLastForceCvsroot = false;
03180     static CStr sLastRev;
03181     static CStr sLastDate;
03182
03183 #ifdef WIN32
03184     CItemListDlg itemListDlg(mf,
03185         sLastTag, kItemListTag, sTagList, NULL,
03186         sLastForceCvsroot, sLastRev, sLastDate);
03187
03188     if( itemListDlg.DoModal() == IDOK )
03189     {
03190         sLastTag = itemListDlg.m_item;
03191         sLastRev = itemListDlg.m_rev;
03192         sLastDate = itemListDlg.m_date;
03193         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03194
03195         userHitOK = true;
03196     }
03197 #endif /* WIN32 */
03198
03199 #if qUnix
03200     void *wid;
03201 #   if qGTK
03202     wid = UCreate_SelTagBranchDlg();
03203 #   endif
03204
03205     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03206         sLastTag, kItemListTag, sTagList, NULL,
03207         sLastForceCvsroot, sLastRev, sLastDate);
03208     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03209     if(dlg->DoModal())
03210     {
03211         sLastTag = dlg->m_item;
03212         sLastRev = dlg->m_rev;
03213         sLastDate = dlg->m_date;
03214         sLastForceCvsroot = dlg->m_forceCvsroot;
03215
03216         userHitOK = true;
03217     }
03218     delete dlg;
03219
03220 #endif // qUnix
03221
03222 #ifdef qMacCvsPP
03223     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03224     LWindow *theDialog = theHandler.GetDialog();
03225     ThrowIfNil_(theDialog);
03226
03227     theDialog->Show();
03228     theDialog->SetDescriptor(LStr255("Select tag/branch"));
03229
03230     DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, true);
03231
03232     MessageT hitMessage;
03233     while (true)
03234     {       // Let DialogHandler process events
03235         hitMessage = theHandler.DoDialog();
03236
03237         if(hitMessage == 'ENDO')
03238             hitMessage = msg_OK;
03239
03240         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03241             break;
03242
03243         if(hitMessage == item_Refresh)
03244         {
03245             OnRefresh_Select(theDialog, kItemListTag);
03246         }
03247     }
03248     theDialog->Hide();
03249
03250     if(hitMessage == msg_OK)
03251     {
03252         DoDataExchange_Select(theDialog, kItemListTag, sLastTag, sLastForceCvsroot, mf, false);
03253
03254         userHitOK = true;
03255     }
03256 #endif /* qMacCvsPP */
03257
03258     if( userHitOK )
03259     {
03260         tagName = sLastTag;
03261     }
03262
03263     return userHitOK;
03264 }
03265
03267 bool CompatGetModuleListItem(const MultiFiles* mf,
03268                              CStr& moduleName)
03269 {
03270     bool userHitOK = false;
03271
03272     static CStr sLastModule;
03273     static ItemList sLastModuleList;
03274     static ListPath sLastListPath;
03275     static bool sLastForceCvsroot = false;
03276     static CStr sLastRev;
03277     static CStr sLastDate;
03278
03279 #ifdef WIN32
03280     CItemListDlg itemListDlg(mf,
03281         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03282         sLastForceCvsroot, sLastRev, sLastDate);
03283
03284     if( itemListDlg.DoModal() == IDOK )
03285     {
03286         sLastModule = itemListDlg.m_item;
03287         sLastListPath = itemListDlg.m_listPath;
03288         sLastRev = itemListDlg.m_rev;
03289         sLastDate = itemListDlg.m_date;
03290         sLastForceCvsroot = itemListDlg.m_forceCvsroot != 0;
03291
03292         userHitOK = true;
03293     }
03294 #endif /* WIN32 */
03295
03296 #if qUnix
03297     void *wid = NULL;
03298 #   if qGTK
03299     wid = UCreate_SelTagBranchDlg();
03300 #   endif
03301
03302     UCvsItemListDlg *dlg = new UCvsItemListDlg(mf,
03303         sLastModule, kItemListModule, sLastModuleList, &sLastListPath,
03304         sLastForceCvsroot, sLastRev, sLastDate);
03305     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
03306     if(dlg->DoModal())
03307     {
03308         sLastModule = dlg->m_item;
03309         sLastListPath = dlg->m_listPath;
03310         sLastRev = dlg->m_rev;
03311         sLastDate = dlg->m_date;
03312         sLastForceCvsroot = dlg->m_forceCvsroot;
03313
03314         userHitOK = true;
03315     }
03316     delete dlg;
03317
03318 #endif // qUnix
03319
03320 #ifdef qMacCvsPP
03321     StDialogHandler theHandler(dlg_Select, LCommander::GetTopCommander());
03322     LWindow *theDialog = theHandler.GetDialog();
03323     ThrowIfNil_(theDialog);
03324
03325     theDialog->Show();
03326     theDialog->SetDescriptor(LStr255("Select module"));
03327
03328     DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, true);
03329
03330     MessageT hitMessage;
03331     while (true)
03332     {       // Let DialogHandler process events
03333         hitMessage = theHandler.DoDialog();
03334
03335         if(hitMessage == 'ENDO')
03336             hitMessage = msg_OK;
03337
03338         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
03339             break;
03340
03341         if(hitMessage == item_Refresh)
03342         {
03343             OnRefresh_Select(theDialog, kItemListModule);
03344         }
03345     }
03346     theDialog->Hide();
03347
03348     if(hitMessage == msg_OK)
03349     {
03350         DoDataExchange_Select(theDialog, kItemListModule, sLastModule, sLastForceCvsroot, mf, false);
03351
03352         userHitOK = true;
03353     }
03354 #endif /* qMacCvsPP */
03355
03356     if( userHitOK )
03357     {
03358         moduleName = sLastModule;
03359     }
03360
03361     return userHitOK;
03362 }
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


common/ItemListDlg.h Source File

common/ItemListDlg.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> (Originally: Sebastien Abras <sabdev@ibelgique.com>) --- July 2002
00019  */
00020
00021 #if !defined(AFX_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_)
00022 #define AFX_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // ItemListDlg.h : header file
00028 //
00029
00030 #include "MultiFiles.h"
00031 #include "AppGlue.h"
00032 #include "SmartComboBox.h"
00033
00034 #ifdef WIN32
00035 #include "SortHeaderCtrl.h"
00036 #endif
00037
00038 #include <string>
00039 #include <sstream>
00040 #include <set>
00041 #include <list>
00042 #include <map>
00043 #include <algorithm>
00044
00045 using namespace std;
00046
00047 bool CompatGetTagListItem(const MultiFiles* mf, CStr& tagName);
00048 bool CompatGetModuleListItem(const MultiFiles* mf, CStr& moduleName);
00049
00050 // persistent default values for the dates, tags...
00051 extern CMString gRevNames;
00052 extern CMString gDateNames;
00053
00055 typedef enum
00056 {
00057     kItemListTag,
00058     kItemListModule
00059 } kItemListDlg;
00060
00062 typedef enum
00063 {
00064     kAutoRefreshDisable,
00065     kAutoRefreshFirstTime,
00066     kAutoRefreshAlways
00067 } kItemListAutoRefreshType;
00068
00070 typedef std::set<string> ItemDescription;
00071
00073 typedef struct
00074 {
00075     ItemDescription m_description;
00076     ItemDescription m_descriptionEx;
00077 } ItemRowInfo;
00078
00080 typedef std::map<string, ItemRowInfo> ItemList;
00081
00083 typedef std::list<string> ListPath;
00084
00085
00087 class CItemListConsole : public CCvsConsole
00088 {
00089 public:
00090     CItemListConsole();
00091     virtual ~CItemListConsole();
00092
00093     virtual long cvs_out(char* txt, long len);
00094     virtual long cvs_err(char* txt, long len);
00095     virtual void Parse(int launchRes) = 0L;
00096
00097 protected:
00098     ItemList m_itemList;
00099     stringstream m_cvsOut;
00100     stringstream m_cvsErr;
00101     int m_launchRes;
00103 public:
00104     int GetLaunchRes() const;
00105     stringstream& GetCvsErr();
00106     const ItemList& GetItemList() const;
00107 };
00108
00110 class CTagParserConsole : public CItemListConsole
00111 {
00112 public:
00113     CTagParserConsole();
00114     virtual ~CTagParserConsole();
00115
00116     virtual void Parse(int launchRes);
00117 };
00118
00120 class CModuleParserConsole : public CItemListConsole
00121 {
00122 public:
00123     CModuleParserConsole();
00124     virtual ~CModuleParserConsole();
00125
00126     virtual void Parse(int launchRes);
00127 };
00128
00130 class CListParserConsole : public CItemListConsole
00131 {
00132 public:
00133     CListParserConsole();
00134     virtual ~CListParserConsole();
00135
00136     virtual void Parse(int launchRes);
00137 };
00138
00139
00140
00142 typedef enum
00143 {
00144     kDisplayWait,
00145     kDisplayData,
00146     kDisplayInfo
00147 } kDisplayType;
00148
00150 class ItemDisplayInfo
00151 {
00152 private:
00153     // Data members
00154     string m_item;
00155     string m_description;
00156     string m_descriptionEx;
00158     ItemRowInfo m_rowInfo;
00160 public:
00161     // Interface
00162     void Create(const string& item, const ItemRowInfo& rowInfo);
00163
00164     const string& GetItem() const;
00165     const string& GetDescription() const;
00166     const string& GetDescriptionEx() const;
00167
00168     const ItemRowInfo& GetRowInfo() const;
00169 };
00170
00171 #ifdef WIN32
00172
00174 // CItemListDlg dialog
00175
00176 class CItemListDlg : public CDialog
00177 {
00178 // Construction
00179 public:
00180     CItemListDlg(const MultiFiles* mf,
00181         const char* item, kItemListDlg type, ItemList& itemList, const ListPath* listPath,
00182         bool forceCvsroot, const char* rev, const char* date,
00183         CWnd* pParent = NULL);   // standard constructor
00184
00185 // Dialog Data
00186     //{{AFX_DATA(CItemListDlg)
00187     enum { IDD = IDD_ITEM_LIST };
00188     CSmartComboBox  m_autoRefreshCombo;
00189     CButton m_selectionButton;
00190     CButton m_cancelButton;
00191     CButton m_browseTagButton;
00192     CEdit   m_itemEdit;
00193     CButton m_refreshButton;
00194     CButton m_okButton;
00195     CButton m_browseReadFromButton;
00196     CStatic m_itemLabelStatic;
00197     CButton m_hasDateCheck;
00198     CButton m_hasRevCheck;
00199     CButton m_forceCvsrootCheck;
00200     CSmartComboBox  m_dateCombo;
00201     CSmartComboBox  m_revCombo;
00202     CButton m_optionCheck;
00203     CListCtrl   m_itemListCtrl;
00204     CSmartComboBox  m_readFromCombo;
00205     CString m_readFrom;
00206     CString m_item;
00207     BOOL    m_option;
00208     BOOL    m_forceCvsroot;
00209     BOOL    m_hasRev;
00210     CString m_rev;
00211     CString m_date;
00212     BOOL    m_hasDate;
00213     //}}AFX_DATA
00214
00215
00216 // Overrides
00217     // ClassWizard generated virtual function overrides
00218     //{{AFX_VIRTUAL(CItemListDlg)
00219     public:
00220     virtual BOOL PreTranslateMessage(MSG* pMsg);
00221     protected:
00222     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00223     //}}AFX_VIRTUAL
00224
00225 // Implementation
00226 protected:
00227
00228     // Generated message map functions
00229     //{{AFX_MSG(CItemListDlg)
00230     afx_msg void OnRefresh();
00231     virtual BOOL OnInitDialog();
00232     virtual void OnCancel();
00233     afx_msg void OnOption();
00234     afx_msg void OnCheckrev();
00235     afx_msg void OnCheckdate();
00236     afx_msg void OnBrowseTag();
00237     virtual void OnOK();
00238     afx_msg void OnDblclkItemlist(NMHDR* pNMHDR, LRESULT* pResult);
00239     afx_msg void OnItemchangedItemlist(NMHDR* pNMHDR, LRESULT* pResult);
00240     afx_msg void OnColumnclickItemlist(NMHDR* pNMHDR, LRESULT* pResult);
00241     afx_msg void OnDestroy();
00242     afx_msg void OnForceroot();
00243     afx_msg void OnBrowseReadfrom();
00244     afx_msg void OnSelection();
00245     afx_msg void OnSelchangeAutoRefresh();
00246     //}}AFX_MSG
00247     DECLARE_MESSAGE_MAP()
00248 public:
00249     ListPath m_listPath;
00251 private:
00252     const MultiFiles* m_mf;
00254     kItemListDlg m_type;
00255     ItemList& m_itemList;
00256     bool m_cvsStopped;
00258     void InitListCtrl(const kDisplayType displayType);
00259     void InitOptionCtrls();
00260     void EnableControls(BOOL enable);
00261     bool EnableDateRev();
00262
00263     bool CheckSettings();
00264     BOOL PostClickRefresh();
00265
00266     // Items management
00267
00269     enum
00270     {
00271         kItemImgBlank,
00272         kItemImgUpDir,
00273         kItemImgDir,
00274         kItemImgFile,
00275         kItemImgModule,
00276         kItemImgRevision,
00277         kItemImgBranch,
00278         kItemImgBranchAndRevision,
00279     };
00280
00281     CImageList m_itemsImageList;
00282
00283     bool SelectItem(const char* item);
00284     void DisplayItems(const ItemList& itemList, const int launchRes, stringstream* cvsErr = NULL, const bool showUpDir = true);
00285     int GetImageForItem(kItemListDlg type, bool option, const ItemDisplayInfo* displayInfo);
00286     void DeleteAllItems();
00287
00288     // Sorting
00289
00291     typedef struct
00292     {
00293         int m_column;
00294         bool m_asc;
00295         kItemListDlg m_type;
00296         bool m_option;
00297     } CompareInfo;
00298
00299     bool m_sortAsc;
00300     int m_sortColumn;
00301     CSortHeaderCtrl m_headerCtrl;
00302
00303     void SortItems(int column, bool asc, kItemListDlg type, bool option);
00304     static int CALLBACK CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam);
00305 };
00306
00307 //{{AFX_INSERT_LOCATION}}
00308 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00309
00310 #endif // !defined(AFX_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_)
00311
00312 #ifdef qMacCvsPP
00313 #include <LOutlineTable.h>
00314 #include <LCommander.h>
00315 #include <LOutlineItem.h>
00316 #include <LString.h>
00317
00318 class LSelectTable : public LOutlineTable, public LCommander, public LBroadcaster
00319 {
00320 public:
00321     enum { class_ID = 'Sfil' };
00322
00323     LSelectTable( LStream *inStream );
00324     virtual ~LSelectTable();
00325
00326     Handle mIconModule;
00327     Handle mIconTag;
00328     Handle mIconBranch;
00329 protected:
00330     virtual void FinishCreateSelf();
00331 };
00332
00333 class CSelectItem : public LOutlineItem
00334 {
00335 public:
00336     CSelectItem(const string& item, const ItemRowInfo& rowInfo);
00337     CSelectItem();
00338     virtual ~CSelectItem();
00339
00340     string m_item;
00341     string m_description;
00342     string m_descriptionEx;
00343     Handle mIcon;
00344
00345 protected:
00346     virtual void GetDrawContentsSelf(const STableCell& inCell, SOutlineDrawContents& ioDrawContents);
00347
00348     virtual void DrawRowAdornments(const Rect& inLocalRowRect);
00349
00350     virtual void DoubleClick(const STableCell& inCell, const SMouseDownEvent& inMouseDown,
00351         const SOutlineDrawContents& inDrawContents, Boolean inHitText);
00352
00353
00354     ItemRowInfo m_rowInfo;
00355 };
00356 #endif /* qMacCvsPP */
00357
00358 #endif /* WIN32 */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


common/KeywordComboBox.cpp Source File

common/KeywordComboBox.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> --- November 2002
00019  */
00020
00021 // KeywordComboBox.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025 #include "KeywordComboBox.h"
00026
00027 #ifdef _DEBUG
00028 #define new DEBUG_NEW
00029 #undef THIS_FILE
00030 static char THIS_FILE[] = __FILE__;
00031 #endif
00032
00034 struct keywordMode
00035 {
00036   const char* mode;
00037   const char* desc;
00038 };
00039
00040 #define KEYWORD_MODE_COUNT 8
00041
00043 static struct keywordMode gKeywordModes[KEYWORD_MODE_COUNT] = {
00044     {"",        "Current"},
00045     {"-kkv",    "Default"},
00046     {"-kkvl",   "Default with locker's name"},
00047     {"-kk",     "Only keyword names"},
00048     {"-ko",     "Disable"},
00049     {"-kb",     "Binary"},
00050     {"-ku",     "Unicode"},
00051     {"-kv",     "Only keyword values"}
00052 };
00053
00054 #ifdef WIN32
00055
00057 // CKeywordComboBox
00058
00059 CKeywordComboBox::CKeywordComboBox()
00060     : CSmartComboBox(USmartCombo::AutoDropWidth)
00061 {
00062     m_hDesc = NULL;
00063 }
00064
00065 CKeywordComboBox::~CKeywordComboBox()
00066 {
00067 }
00068
00069
00070 BEGIN_MESSAGE_MAP(CKeywordComboBox, CSmartComboBox)
00071     //{{AFX_MSG_MAP(CKeywordComboBox)
00072     ON_CONTROL_REFLECT(CBN_SELCHANGE, OnSelchange)
00073     //}}AFX_MSG_MAP
00074 END_MESSAGE_MAP()
00075
00076
00077 // CKeywordComboBox message handlers
00078
00079
00080 void CKeywordComboBox::OnSelchange()
00081 {
00082     SetDescription();
00083 }
00084
00089 void CKeywordComboBox::SetDescription()
00090 {
00091     if( m_hDesc && ::IsWindow(m_hDesc) )
00092     {
00093         const char* desc = gKeywordModes[0].desc;
00094         const int selItem = GetCurSel();
00095         if( selItem > -1 )
00096         {
00097             desc = (const char*)GetItemData(selItem);
00098         }
00099
00100         ::SetWindowText(m_hDesc, desc);
00101     }
00102 }
00103
00109 void CKeywordComboBox::SetDescriptionWnd(HWND hDesc)
00110 {
00111     m_hDesc = hDesc;
00112     SetDescription();
00113 }
00114
00116 void CKeywordComboBox::PreSubclassWindow()
00117 {
00118     CSmartComboBox::PreSubclassWindow();
00119
00120     for(int nIndex = 0; nIndex < KEYWORD_MODE_COUNT; nIndex++)
00121     {
00122         const int itemIndex = AddString(gKeywordModes[nIndex].mode);
00123         if( itemIndex > -1 )
00124         {
00125             SetItemData(itemIndex, (DWORD)gKeywordModes[nIndex].desc);
00126         }
00127     }
00128 }
00129
00130 #endif /* WIN32 */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


common/KeywordComboBox.h Source File

common/KeywordComboBox.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> --- November 2002
00019  */
00020
00021 #if !defined(AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_)
00022 #define AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // KeywordComboBox.h : header file
00028 //
00029
00030 #include "SmartComboBox.h"
00031
00032 #ifdef WIN32
00033
00035 // CKeywordComboBox window
00036
00042 class CKeywordComboBox : public CSmartComboBox
00043 {
00044 // Construction
00045 public:
00046     CKeywordComboBox();
00047
00048 // Attributes
00049 public:
00050
00051 // Operations
00052 public:
00053
00054 // Overrides
00055     // ClassWizard generated virtual function overrides
00056     //{{AFX_VIRTUAL(CKeywordComboBox)
00057     protected:
00058     virtual void PreSubclassWindow();
00059     //}}AFX_VIRTUAL
00060
00061 // Implementation
00062 public:
00063     virtual ~CKeywordComboBox();
00064
00065     // Generated message map functions
00066 protected:
00067     //{{AFX_MSG(CKeywordComboBox)
00068     afx_msg void OnSelchange();
00069     //}}AFX_MSG
00070
00071     DECLARE_MESSAGE_MAP()
00072 private:
00073     // Data members
00074     HWND m_hDesc;
00076     // Methods
00077     void SetDescription();
00078
00079 public:
00080     // Interface
00081     void SetDescriptionWnd(HWND hDesc);
00082 };
00083
00085
00086 //{{AFX_INSERT_LOCATION}}
00087 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00088 #endif /* WIN32 */
00089
00090 #endif // !defined(AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_)
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 "LineCmd.h"
00042 #include "MultiString.h"
00043 #include "CvsArgs.h"
00044 #include "PromptFiles.h"
00045 #include "CPStr.h"
00046 #include "CvsCommands.h"
00047 #include "MultiFiles.h"
00048 #include "ItemListDlg.h"
00049
00050 #include "GetPrefs.h"
00051 #include "CvsPrefs.h"
00052
00053 #if qUnix
00054 #   include "UCvsDialogs.h"
00055 #endif
00056
00058 char* sDefPrevCvsCmd[] =
00059 {
00060     "cvs --help-options",
00061     "cvs --help-commands",
00062     "cvs --help-synonyms",
00063     "cvs -H <cvs_command>",
00064     0L
00065 };
00066
00067 static CMString gPrevCvsCmd(20, "P_PrevCvsCmd", sDefPrevCvsCmd);
00068 static CMString gPrevCvsCmdDir(20, "P_PrevCvsCmdDir");
00069
00070 #ifdef WIN32
00071 #   ifdef _DEBUG
00072 #   define new DEBUG_NEW
00073 #   undef THIS_FILE
00074     static char THIS_FILE[] = __FILE__;
00075 #   endif
00076 #endif /* WIN32 */
00077
00078 #ifdef qMacCvsPP
00079 static void DoDataExchange_CmdlineMain(LWindow *theDialog, CStr & cmdline, CPStr & path, bool & hasPath, bool putValue)
00080 {
00081     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00082         (theDialog->FindPaneByID(item_CheckGroupPath));
00083     LPushButton *epath = dynamic_cast<LPushButton*>
00084         (theDialog->FindPaneByID(item_EditPath));
00085     LTextEditView *cline = dynamic_cast<LTextEditView*>
00086         (theDialog->FindPaneByID(item_NonEmptyTextEdit));
00087
00088     if(putValue)
00089     {
00090         cline->SetTextPtr((Ptr)(const char *)cmdline, cmdline.length());
00091         cbox->SetValue(hasPath ? Button_On : Button_Off);
00092         epath->SetDescriptor(path);
00093
00094         // this will take care about an empty module name
00095         theDialog->SetLatentSub(cline);
00096         //cline->AddListener(LCommander::GetTopCommander());
00097         if(cmdline.length() == 0)
00098         {
00099             LPushButton *theOK = dynamic_cast<LPushButton*>
00100                                         (theDialog->FindPaneByID(item_OK));
00101             Assert_(theOK != 0L);
00102             theOK->Disable();
00103         }
00104     }
00105     else
00106     {
00107         Handle hdl = cline->GetTextHandle();
00108         Assert_(hdl != 0L);
00109         cmdline.set(*hdl, GetHandleSize(hdl));
00110
00111         Str255 outDescriptor;
00112         epath->GetDescriptor(outDescriptor);
00113         path = outDescriptor;
00114         hasPath = cbox->GetValue() == Button_On;
00115     }
00116 }
00117 #endif /* qMacCvsPP */
00118
00119 #ifdef WIN32
00120 IMPLEMENT_DYNAMIC(CCmdLine_MAIN, CPropertyPage)
00121
00122 CCmdLine_MAIN::CCmdLine_MAIN(const MultiFiles* mf,
00123                              const char* lastcmd, bool hasPath, const char* lastpath,
00124                              bool addDefault, bool addSelection, bool forceRoot)
00125                              : m_mf(mf), CPropertyPage(CCmdLine_MAIN::IDD)
00126 {
00127     //{{AFX_DATA_INIT(CCmdLine_MAIN)
00128     m_checkPath = hasPath;
00129     m_cmdLine = lastcmd;
00130     m_folderLoc = lastpath;
00131     m_addDefault = addDefault;
00132     m_addSelection = addSelection;
00133     m_forceRoot = forceRoot;
00134     //}}AFX_DATA_INIT
00135
00136     m_hasSelection = m_mf->NumDirs() > 0;
00137
00138     m_firstTimeCmdline = true;
00139     m_prevCmdCombo.SetItems(&gPrevCvsCmd);
00140     m_folderLocCombo.SetItems(&gPrevCvsCmdDir);
00141 }
00142
00143 CCmdLine_MAIN::~CCmdLine_MAIN()
00144 {
00145 }
00146
00147 void CCmdLine_MAIN::DoDataExchange(CDataExchange* pDX)
00148 {
00149     CPropertyPage::DoDataExchange(pDX);
00150     //{{AFX_DATA_MAP(CCmdLine_MAIN)
00151     DDX_Control(pDX, IDC_FOLDERLOC, m_folderLocCombo);
00152     DDX_Control(pDX, IDC_ADD_SELECTION, m_addSelectionCheck);
00153     DDX_Control(pDX, IDC_CHECKPATH, m_checkPathCheck);
00154     DDX_Control(pDX, IDC_CMDLINE, m_cmdLineEdit);
00155     DDX_Control(pDX, IDC_PREVCMD, m_prevCmdCombo);
00156     DDX_Control(pDX, IDC_SELFOLDER, m_selFolderButton);
00157     DDX_Check(pDX, IDC_CHECKPATH, m_checkPath);
00158     DDX_Text(pDX, IDC_CMDLINE, m_cmdLine);
00159     DDV_MinChars(pDX, m_cmdLine, 1);
00160     DDX_Text(pDX, IDC_FOLDERLOC, m_folderLoc);
00161     DDX_Check(pDX, IDC_ADD_DEFAULT, m_addDefault);
00162     DDX_Check(pDX, IDC_ADD_SELECTION, m_addSelection);
00163     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00164     //}}AFX_DATA_MAP
00165
00166     if( pDX->m_bSaveAndValidate )
00167     {
00168         if( !m_cmdLine.IsEmpty() && DEF_CVS_CMD != m_cmdLine )
00169         {
00170             gPrevCvsCmd.Insert(m_cmdLine);
00171         }
00172     }
00173     else
00174     {
00175         DDX_ComboMString(pDX, IDC_PREVCMD, m_prevCmdCombo);
00176     }
00177
00178     DDX_ComboMString(pDX, IDC_FOLDERLOC, m_folderLocCombo);
00179
00180     if( m_checkPath )
00181     {
00182         DDV_MinChars(pDX, m_folderLoc, 1);
00183         DDV_CheckPathExists(pDX, IDC_FOLDERLOC, m_folderLoc);
00184     }
00185
00186     if( !pDX->m_bSaveAndValidate )
00187     {
00188         m_selFolderButton.EnableWindow(m_checkPath);
00189     }
00190 }
00191
00192
00193 BEGIN_MESSAGE_MAP(CCmdLine_MAIN, CPropertyPage)
00194     //{{AFX_MSG_MAP(CCmdLine_MAIN)
00195     ON_BN_CLICKED(IDC_CHECKPATH, OnCheckpath)
00196     ON_BN_CLICKED(IDC_SELFOLDER, OnSelfolder)
00197     ON_CBN_SELCHANGE(IDC_PREVCMD, OnSelchangePrevcmd)
00198     ON_EN_SETFOCUS(IDC_CMDLINE, OnSetfocusCmdline)
00199     ON_BN_CLICKED(IDC_TAG, OnTag)
00200     ON_BN_CLICKED(IDC_MODULE, OnModule)
00201     ON_BN_CLICKED(IDC_ADD_SELECTION, OnAddSelection)
00202     //}}AFX_MSG_MAP
00203 END_MESSAGE_MAP()
00204
00205
00206 // CCmdLine_MAIN message handlers
00207
00208
00209 void CCmdLine_MAIN::OnCheckpath()
00210 {
00211     const BOOL enable = m_checkPathCheck.GetCheck();
00212
00213     m_selFolderButton.EnableWindow(enable);
00214     m_folderLocCombo.EnableWindow(enable);
00215     m_addSelectionCheck.EnableWindow(!enable && m_hasSelection);
00216
00217     if( enable && m_hasSelection && m_mf )
00218     {
00219         CString strFolderLoc;
00220         m_folderLocCombo.GetWindowText(strFolderLoc);
00221
00222         if( strFolderLoc.IsEmpty() )
00223         {
00224             CStr path;
00225             if( m_mf->getdir(0, path) )
00226             {
00227                 m_folderLocCombo.SetWindowText(path.c_str());
00228             }
00229         }
00230     }
00231 }
00232
00234 void CCmdLine_MAIN::OnSelfolder()
00235 {
00236     CString strFolderLoc;
00237     m_folderLocCombo.GetWindowText(strFolderLoc);
00238
00239     CStr folderLoc(strFolderLoc);
00240     if( BrowserGetDirectory("Select where to execute", folderLoc, IsWindow(m_hWnd) ? this : NULL) )
00241     {
00242         m_folderLocCombo.SetWindowText(folderLoc);
00243     }
00244 }
00245
00247 BOOL CCmdLine_MAIN::PreTranslateMessage(MSG* pMsg)
00248 {
00249     if( pMsg->message == WM_KEYDOWN )
00250     {
00251         switch( (int)pMsg->wParam )
00252         {
00253         case VK_ESCAPE:     //dialog can be dismissed by Esc key
00254             EndDialog(IDCANCEL);
00255             break;
00256         case VK_RETURN:     //command can be executed with Enter key
00257             if( UpdateData() )
00258             {
00259                 EndDialog(IDOK);
00260             }
00261             break;
00262         default:
00263             break;
00264         }
00265     }
00266
00267     return CPropertyPage::PreTranslateMessage(pMsg);
00268 }
00269
00271 BOOL CCmdLine_MAIN::OnInitDialog()
00272 {
00273     CPropertyPage::OnInitDialog();
00274
00275     // Extra initialization
00276     OnCheckpath();
00277     OnAddSelection();
00278
00279     return TRUE;  // return TRUE unless you set the focus to a control
00280                   // EXCEPTION: OCX Property Pages should return FALSE
00281 }
00282
00284 void CCmdLine_MAIN::OnSelchangePrevcmd()
00285 {
00286     int sel = m_prevCmdCombo.GetCurSel();
00287     if( sel == CB_ERR )
00288         return;
00289
00290     m_cmdLineEdit.SetSel(0, -1);
00291     const NAMESPACE(std) vector<CStr> & list = gPrevCvsCmd.GetList();
00292     m_cmdLineEdit.ReplaceSel(list[sel]);
00293 }
00294
00296 void CCmdLine_MAIN::OnSetfocusCmdline()
00297 {
00298     if( m_firstTimeCmdline )
00299     {
00300         m_firstTimeCmdline = false;
00301
00302         CString cmdLine;
00303         m_cmdLineEdit.GetWindowText(cmdLine);
00304
00305         if( DEF_CVS_CMD == cmdLine )
00306         {
00307             m_cmdLineEdit.SetSel(-1, -1);
00308         }
00309     }
00310 }
00311
00313 void CCmdLine_MAIN::OnTag()
00314 {
00315     CStr tagName;
00316     if( CompatGetTagListItem(m_mf, tagName) )
00317     {
00318         m_cmdLineEdit.ReplaceSel(tagName.c_str(), TRUE);
00319     }
00320 }
00321
00323 void CCmdLine_MAIN::OnModule()
00324 {
00325     CStr moduleName;
00326     if( CompatGetModuleListItem(m_mf, moduleName) )
00327     {
00328         m_cmdLineEdit.ReplaceSel(moduleName.c_str(), TRUE);
00329     }
00330 }
00331
00333 void CCmdLine_MAIN::OnAddSelection()
00334 {
00335     if( m_addSelectionCheck.IsWindowEnabled() )
00336     {
00337         const BOOL enable = m_addSelectionCheck.GetCheck() ? false : true;
00338
00339         OnCheckpath();
00340
00341         m_checkPathCheck.EnableWindow(enable);
00342         m_selFolderButton.EnableWindow(enable);
00343         m_folderLocCombo.EnableWindow(enable);
00344
00345         if( enable )
00346         {
00347             OnCheckpath();
00348         }
00349     }
00350 }
00351 #endif /* WIN32 */
00352
00353 #if qUnix
00354 class UCvsCmdline : public UWidget
00355 {
00356     UDECLARE_DYNAMIC(UCvsCmdline)
00357 public:
00358     UCvsCmdline() : UWidget(::UEventGetWidID()) {}
00359     virtual ~UCvsCmdline() {}
00360
00361     enum
00362     {
00363         kOK = EV_COMMAND_START, // 0
00364         kCancel,                // 1
00365         kTabGeneral             // 2
00366     };
00367
00368     virtual void DoDataExchange(bool fill);
00369
00370 protected:
00371     ev_msg int OnOK(void);
00372     ev_msg int OnCancel(void);
00373
00374     UDECLARE_MESSAGE_MAP()
00375 };
00376
00377 UIMPLEMENT_DYNAMIC(UCvsCmdline, UWidget)
00378
00379 UBEGIN_MESSAGE_MAP(UCvsCmdline, UWidget)
00380     ON_UCOMMAND(UCvsCmdline::kOK, UCvsCmdline::OnOK)
00381     ON_UCOMMAND(UCvsCmdline::kCancel, UCvsCmdline::OnCancel)
00382 UEND_MESSAGE_MAP()
00383
00384 int UCvsCmdline::OnOK(void)
00385 {
00386     EndModal(true);
00387     return 0;
00388 }
00389
00390 int UCvsCmdline::OnCancel(void)
00391 {
00392     EndModal(false);
00393     return 0;
00394 }
00395
00396 void UCvsCmdline::DoDataExchange(bool fill)
00397 {
00398     if(fill)
00399     {
00400     }
00401     else
00402     {
00403     }
00404 }
00405
00406 class UCvsCmdline_MAIN : public UWidget
00407 {
00408     UDECLARE_DYNAMIC(UCvsCmdline_MAIN)
00409 public:
00410     UCvsCmdline_MAIN(const char *lastcmd, bool hasPath,
00411                      const char *lastpath);
00412     virtual ~UCvsCmdline_MAIN() {}
00413
00414     enum
00415     {
00416         kEditCmd = EV_COMMAND_START,    // 0
00417         kCheckPath,         // 1
00418         kStatPath,          // 2
00419         kBtnPath            // 3
00420     };
00421
00422     virtual void DoDataExchange(bool fill);
00423
00424     bool m_checkpath;
00425     UStr m_cmdline;
00426     UStr m_folderloc;
00427 protected:
00428     ev_msg int OnCheckPath(void);
00429     ev_msg int OnBtnPath(void);
00430
00431     UDECLARE_MESSAGE_MAP()
00432 };
00433
00434 UIMPLEMENT_DYNAMIC(UCvsCmdline_MAIN, UWidget)
00435
00436 UBEGIN_MESSAGE_MAP(UCvsCmdline_MAIN, UWidget)
00437     ON_UCOMMAND(UCvsCmdline_MAIN::kCheckPath, UCvsCmdline_MAIN::OnCheckPath)
00438     ON_UCOMMAND(UCvsCmdline_MAIN::kBtnPath, UCvsCmdline_MAIN::OnBtnPath)
00439 UEND_MESSAGE_MAP()
00440
00441 UCvsCmdline_MAIN::UCvsCmdline_MAIN(const char *lastcmd, bool hasPath,
00442                              const char *lastpath) : UWidget(::UEventGetWidID())
00443 {
00444     m_checkpath = hasPath;
00445     m_cmdline = lastcmd;
00446     m_folderloc = lastpath;
00447 }
00448
00449 int UCvsCmdline_MAIN::OnCheckPath()
00450 {
00451     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPath, 0L);
00452     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kStatPath, state), 0L);
00453     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kBtnPath, state), 0L);
00454     return 0;
00455 }
00456
00457 int UCvsCmdline_MAIN::OnBtnPath()
00458 {
00459     CStr dir;
00460     if( BrowserGetDirectory("Select where to execute", dir) )
00461     {
00462         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void*)dir.c_str());
00463     }
00464
00465     return 0;
00466 }
00467
00468 void UCvsCmdline_MAIN::DoDataExchange(bool fill)
00469 {
00470     if(fill)
00471     {
00472         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckPath, m_checkpath), 0L);
00473         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditCmd, (void *)(const char *)m_cmdline);
00474         UEventSendMessage(GetWidID(), EV_SETTEXT, kStatPath, (void *)(const char *)m_folderloc);
00475
00476         OnCheckPath();
00477     }
00478     else
00479     {
00480         m_checkpath = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckPath, 0L) != 0;
00481         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditCmd, &m_cmdline);
00482         UEventSendMessage(GetWidID(), EV_GETTEXT, kStatPath, &m_folderloc);
00483     }
00484 }
00485 #endif // qUnix
00486
00488 bool CompatGetCommand(const MultiFiles* mf,
00489                       CStr& cmd, CStr& dir, bool& addDefault, bool& addSelection,
00490                       bool& forceCvsroot)
00491 {
00492     bool userHitOK = false;
00493
00494     static CStr sLastCmdline(DEF_CVS_CMD);
00495     static CPStr sLastPath("");
00496     static bool sLastHasPath = false;
00497     static bool lastAddDefault = false;
00498     static bool lastAddSelection = false;
00499     static bool lastForceCvsroot = false;
00500
00501 #ifdef WIN32
00502     CPropertySheet pages("Command line settings");
00503     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00504
00505     CCmdLine_MAIN page1(mf, sLastCmdline, sLastHasPath, sLastPath, lastAddDefault, lastAddSelection, lastForceCvsroot);
00506     CGetPrefs_GLOBALS page2;
00507
00508     pages.AddPage(&page1);
00509     pages.AddPage(&page2);
00510
00511     if( pages.DoModal() == IDOK )
00512     {
00513         sLastCmdline = page1.m_cmdLine;
00514         sLastHasPath = page1.m_checkPath == TRUE;
00515         sLastPath = page1.m_folderLoc;
00516         lastAddDefault = page1.m_addDefault ? true : false;
00517         lastAddSelection = page1.m_addSelection ? true : false;
00518         lastForceCvsroot = page1.m_forceRoot ? true : false;
00519
00520         page2.StoreValues();
00521
00522         userHitOK = true;
00523     }
00524 #endif /* WIN32 */
00525
00526 #if qUnix
00527     void *wid = UCreate_CmdlineDlg();
00528
00529     UCvsCmdline *dlg = new UCvsCmdline();
00530     UCvsCmdline_MAIN *tab1 = new UCvsCmdline_MAIN(sLastCmdline, sLastHasPath, sLastPath);
00531     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00532     dlg->AddPage(tab1, UCvsCmdline::kTabGeneral, 0);
00533
00534     if(dlg->DoModal())
00535     {
00536         sLastCmdline = tab1->m_cmdline;
00537         sLastHasPath = tab1->m_checkpath;
00538         sLastPath = tab1->m_folderloc;
00539
00540         userHitOK = true;
00541     }
00542
00543     delete dlg;
00544 #endif // qUnix
00545
00546 #ifdef qMacCvsPP
00547     StDialogHandler theHandler(dlg_Cmdline, LCommander::GetTopCommander());
00548     LWindow *theDialog = theHandler.GetDialog();
00549     ThrowIfNil_(theDialog);
00550     static UInt16 sRuntimePanel = 1;
00551
00552     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00553         (theDialog->FindPaneByID(item_MultiViewPrefs));
00554     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00555
00556     multiView->SwitchToPanel(2);
00557     DoDataExchange_Globals(theDialog, true);
00558     multiView->SwitchToPanel(1);
00559     DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, true);
00560
00561     LCheckBoxGroupBox *cbox = dynamic_cast<LCheckBoxGroupBox*>
00562         (theDialog->FindPaneByID(item_CheckGroupPath));
00563     LPushButton *epath = dynamic_cast<LPushButton*>
00564         (theDialog->FindPaneByID(item_EditPath));
00565     epath->AddListener(&theHandler);
00566     cbox->AddListener(&theHandler);
00567
00568     groupView->SetValue(sRuntimePanel);
00569     theDialog->Show();
00570     MessageT hitMessage;
00571     while (true)
00572     {       // Let DialogHandler process events
00573         hitMessage = theHandler.DoDialog();
00574
00575         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00576             break;
00577
00578         if(hitMessage == item_CheckGroupPath || hitMessage == item_EditPath)
00579         {
00580             cbox = dynamic_cast<LCheckBoxGroupBox*>
00581                 (theDialog->FindPaneByID(item_CheckGroupPath));
00582             epath = dynamic_cast<LPushButton*>
00583                 (theDialog->FindPaneByID(item_EditPath));
00584             if(cbox->GetValue() == Button_Off)
00585             {
00586                 continue;
00587             }
00588
00589             if( BrowserGetDirectory("Select where to execute", dir) )
00590             {
00591                 CPStr tmp(dir.c_str());
00592                 epath->SetDescriptor(tmp);
00593             }
00594             else if(hitMessage == item_CheckGroupPath)
00595             {
00596                 cbox->SetValue(Button_Off);
00597             }
00598         }
00599
00600     }
00601     theDialog->Hide();
00602     sRuntimePanel = groupView->GetValue();
00603
00604     if(hitMessage == msg_OK)
00605     {
00606         multiView->SwitchToPanel(1);
00607         DoDataExchange_CmdlineMain(theDialog, sLastCmdline, sLastPath, sLastHasPath, false);
00608         multiView->SwitchToPanel(2);
00609         DoDataExchange_Globals(theDialog, false);
00610         Assert_(sLastCmdline.length() != 0);
00611
00612         userHitOK = true;
00613     }
00614 #endif /* qMacCvsPP */
00615
00616     if( userHitOK )
00617     {
00618         cmd = sLastCmdline;
00619         dir = sLastHasPath ? (const char*)sLastPath : 0L;
00620
00621         addDefault = lastAddDefault;
00622         addSelection = lastAddSelection;
00623         forceCvsroot = lastForceCvsroot;
00624
00625         gCvsPrefs.save();
00626     }
00627
00628     return userHitOK;
00629 }
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CPStr.h"
00032
00033 #define DEF_CVS_CMD CVS_CMD " "
00034
00035 class CvsArgs;
00036 class MultiFiles;
00037
00038 bool CompatGetCommand(const MultiFiles* mf,
00039                       CStr& cmd, CStr& dir, bool& addDefault, bool& addSelection,
00040                       bool& forceCvsroot);
00041
00042 #ifdef WIN32
00043
00045 class CCmdLine_MAIN : public CPropertyPage
00046 {
00047     DECLARE_DYNAMIC(CCmdLine_MAIN)
00048
00049 // Construction
00050 public:
00051     CCmdLine_MAIN(const MultiFiles* mf,
00052         const char* lastcmd, bool hasPath, const char* lastpath,
00053         bool addDefault, bool addSelection, bool forceRoot);
00054     ~CCmdLine_MAIN();
00055
00056 // Dialog Data
00057     //{{AFX_DATA(CCmdLine_MAIN)
00058     enum { IDD = IDD_CMDLINE_MAIN };
00059     CSmartComboBox  m_folderLocCombo;
00060     CButton m_addSelectionCheck;
00061     CButton m_checkPathCheck;
00062     CEdit   m_cmdLineEdit;
00063     CSmartComboBox  m_prevCmdCombo;
00064     CButton m_selFolderButton;
00065     BOOL    m_checkPath;
00066     CString m_cmdLine;
00067     CString m_folderLoc;
00068     BOOL    m_addDefault;
00069     BOOL    m_addSelection;
00070     BOOL    m_forceRoot;
00071     //}}AFX_DATA
00072
00073
00074 // Overrides
00075     // ClassWizard generate virtual function overrides
00076     //{{AFX_VIRTUAL(CCmdLine_MAIN)
00077     public:
00078     virtual BOOL PreTranslateMessage(MSG* pMsg);
00079     protected:
00080     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00081     //}}AFX_VIRTUAL
00082
00083 // Implementation
00084 protected:
00085     // Generated message map functions
00086     //{{AFX_MSG(CCmdLine_MAIN)
00087     afx_msg void OnCheckpath();
00088     afx_msg void OnSelfolder();
00089     virtual BOOL OnInitDialog();
00090     afx_msg void OnSelchangePrevcmd();
00091     afx_msg void OnSetfocusCmdline();
00092     afx_msg void OnTag();
00093     afx_msg void OnModule();
00094     afx_msg void OnAddSelection();
00095     //}}AFX_MSG
00096     DECLARE_MESSAGE_MAP()
00097 private:
00098     const MultiFiles* m_mf;
00099     bool m_firstTimeCmdline;
00100     bool m_hasSelection;
00101 };
00102
00103 //{{AFX_INSERT_LOCATION}}
00104 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00105 #endif /* WIN32 */
00106
00107 #endif // !defined(AFX_LINECMD_H__5946A8C5_8517_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 # include "UCommandDialogs.h"
00043 #endif /* qMacCvsPP */
00044
00045 #ifdef WIN32
00046 #   ifdef _DEBUG
00047 #   define new DEBUG_NEW
00048 #   undef THIS_FILE
00049     static char THIS_FILE[] = __FILE__;
00050 #   endif
00051 #endif /* WIN32 */
00052
00053 #if qUnix
00054 #   include "UCvsDialogs.h"
00055 #endif
00056
00057 #include "LogDlg.h"
00058 #include "CvsPrefs.h"
00059 #include "MultiFiles.h"
00060 #include "MultiString.h"
00061 #include "ItemListDlg.h"
00062
00064 char* sDefLogTagNames[] =
00065 {
00066     "1.32:1.35",
00067     "1.32:",
00068     ":1.35",
00069     "branch-release1-0",
00070     "HEAD",
00071     0L
00072 };
00073
00075 char* sDefLogDateNames[] =
00076 {
00077     ">1998-3-24",
00078     "<1998-1-24",
00079     "1998-1-24<1998-3-24",
00080     "<=3-24",
00081     0L
00082 };
00083
00085 char* sDefLogStateNames[] =
00086 {
00087     "mystate",
00088     "dead",
00089     "exp",
00090     "mystate,mystate2",
00091     0L
00092 };
00093
00095 char* sDefLogUserNames[] =
00096 {
00097     "johna",
00098     "garyb",
00099     "johna,garyb",
00100     0L
00101 };
00102
00103 static CMString gLogRevNames(10, "P_LogTagNames", sDefLogTagNames);
00104 static CMString gLogDateNames(10, "P_LogDateNames", sDefLogDateNames);
00105 static CMString gLogStateNames(10, "P_LogStateNames", sDefLogStateNames);
00106 static CMString gLogUserNames(10, "P_LogUserNames", sDefLogUserNames);
00107
00108 static CPersistentBool gLogSupress("P_LogSupress", false, kAddSettings);
00109
00110
00111 #ifdef WIN32
00112 #include "GetPrefs.h"
00113
00115 // CLogMain
00116
00117 IMPLEMENT_DYNAMIC(CLogMain, CPropertyPage)
00118
00119 CLogMain::CLogMain(bool supress) : CPropertyPage(CLogMain::IDD)
00120 {
00121     //{{AFX_DATA_INIT(CLogMain)
00122     m_supress = supress;
00123     m_defBranch = FALSE;
00124     m_noRecurs = FALSE;
00125     m_noTags = FALSE;
00126     m_onlyRCS = FALSE;
00127     m_headerOnly = FALSE;
00128     m_headerDesc = FALSE;
00129     //}}AFX_DATA_INIT
00130 }
00131
00132 CLogMain::~CLogMain()
00133 {
00134 }
00135
00136 void CLogMain::DoDataExchange(CDataExchange* pDX)
00137 {
00138     CPropertyPage::DoDataExchange(pDX);
00139     //{{AFX_DATA_MAP(CLogMain)
00140     DDX_Control(pDX, IDC_HEADERSDESC, m_headerDescCheck);
00141     DDX_Control(pDX, IDC_HEADERS, m_headerOnlyCheck);
00142     DDX_Check(pDX, IDC_SUPRESS, m_supress);
00143     DDX_Check(pDX, IDC_DEFBRANCH, m_defBranch);
00144     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00145     DDX_Check(pDX, IDC_NOTAGS, m_noTags);
00146     DDX_Check(pDX, IDC_ONLYRCS, m_onlyRCS);
00147     DDX_Check(pDX, IDC_HEADERS, m_headerOnly);
00148     DDX_Check(pDX, IDC_HEADERSDESC, m_headerDesc);
00149     //}}AFX_DATA_MAP
00150 }
00151
00152
00153 BEGIN_MESSAGE_MAP(CLogMain, CPropertyPage)
00154     //{{AFX_MSG_MAP(CLogMain)
00155     ON_BN_CLICKED(IDC_HEADERS, OnHeaders)
00156     ON_BN_CLICKED(IDC_HEADERSDESC, OnHeadersdesc)
00157     //}}AFX_MSG_MAP
00158 END_MESSAGE_MAP()
00159
00160
00161 void CLogMain::OnHeaders()
00162 {
00163     if( m_headerOnlyCheck.GetCheck() && m_headerDescCheck.GetCheck() )
00164     {
00165         m_headerDescCheck.SetCheck(0);
00166     }
00167 }
00168
00170 void CLogMain::OnHeadersdesc()
00171 {
00172     if( m_headerDescCheck.GetCheck() && m_headerOnlyCheck.GetCheck() )
00173     {
00174         m_headerOnlyCheck.SetCheck(0);
00175     }
00176 }
00177
00179 // CLogFilters
00180
00181 IMPLEMENT_DYNAMIC(CLogFilters, CPropertyPage)
00182
00183 CLogFilters::CLogFilters(const MultiFiles* mf,
00184                          const char* sLastDate, const char* sLastRev,
00185                          const char* sLastUsers, const char* sLastStates)
00186                          : m_mf(mf), CPropertyPage(CLogFilters::IDD)
00187 {
00188     //{{AFX_DATA_INIT(CLogFilters)
00189     m_date = sLastDate;
00190     m_rev = sLastRev;
00191     m_state = sLastStates;
00192     m_user = sLastUsers;
00193     m_hasDate = FALSE;
00194     m_hasRev = FALSE;
00195     m_hasState = FALSE;
00196     m_hasUser = FALSE;
00197     //}}AFX_DATA_INIT
00198
00199     m_revCombo.SetItems(&gLogRevNames);
00200     m_dateCombo.SetItems(&gLogDateNames);
00201     m_userCombo.SetItems(&gLogUserNames);
00202     m_stateCombo.SetItems(&gLogStateNames);
00203 }
00204
00205 CLogFilters::~CLogFilters()
00206 {
00207 }
00208
00209 void CLogFilters::DoDataExchange(CDataExchange* pDX)
00210 {
00211     CPropertyPage::DoDataExchange(pDX);
00212     //{{AFX_DATA_MAP(CLogFilters)
00213     DDX_Control(pDX, IDC_USER, m_hasUserCheck);
00214     DDX_Control(pDX, IDC_STATE, m_hasStateCheck);
00215     DDX_Control(pDX, IDC_REV, m_hasRevCheck);
00216     DDX_Control(pDX, IDC_DATE, m_hasDateCheck);
00217     DDX_Control(pDX, IDC_BROWSE_TAG, m_browseTagButton);
00218     DDX_Control(pDX, IDC_COMBOUSER, m_userCombo);
00219     DDX_Control(pDX, IDC_COMBOSTATE, m_stateCombo);
00220     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00221     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00222     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00223     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00224     DDX_CBString(pDX, IDC_COMBOSTATE, m_state);
00225     DDX_CBString(pDX, IDC_COMBOUSER, m_user);
00226     DDX_Check(pDX, IDC_DATE, m_hasDate);
00227     DDX_Check(pDX, IDC_REV, m_hasRev);
00228     DDX_Check(pDX, IDC_STATE, m_hasState);
00229     DDX_Check(pDX, IDC_USER, m_hasUser);
00230     //}}AFX_DATA_MAP
00231
00232     if( m_hasDate )
00233     {
00234         DDV_MinChars(pDX, m_date, 1);
00235     }
00236
00237     if( m_hasState )
00238     {
00239         DDV_MinChars(pDX, m_state, 1);
00240     }
00241
00242     if( !pDX->m_bSaveAndValidate )
00243     {
00244         OnRev();
00245         OnDate();
00246         OnState();
00247         OnUser();
00248     }
00249
00250     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00251     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00252     DDX_ComboMString(pDX, IDC_COMBOUSER, m_userCombo);
00253     DDX_ComboMString(pDX, IDC_COMBOSTATE, m_stateCombo);
00254 }
00255
00256
00257 BEGIN_MESSAGE_MAP(CLogFilters, CPropertyPage)
00258     //{{AFX_MSG_MAP(CLogFilters)
00259     ON_BN_CLICKED(IDC_DATE, OnDate)
00260     ON_BN_CLICKED(IDC_REV, OnRev)
00261     ON_BN_CLICKED(IDC_STATE, OnState)
00262     ON_BN_CLICKED(IDC_USER, OnUser)
00263     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00264     //}}AFX_MSG_MAP
00265 END_MESSAGE_MAP()
00266
00267
00268 // CLogFilters message handlers
00269
00270
00271 void CLogFilters::OnDate()
00272 {
00273     m_dateCombo.EnableWindow(m_hasDateCheck.GetCheck());
00274 }
00275
00277 void CLogFilters::OnRev()
00278 {
00279     m_revCombo.EnableWindow(m_hasRevCheck.GetCheck());
00280     m_browseTagButton.EnableWindow(m_hasRevCheck.GetCheck());
00281 }
00282
00284 void CLogFilters::OnBrowseTag()
00285 {
00286     CStr tagName;
00287     if( CompatGetTagListItem(m_mf, tagName) )
00288     {
00289         m_rev = tagName.c_str();
00290         m_revCombo.SetWindowText(m_rev);
00291     }
00292 }
00293
00295 void CLogFilters::OnState()
00296 {
00297     m_stateCombo.EnableWindow(m_hasStateCheck.GetCheck());
00298 }
00299
00301 void CLogFilters::OnUser()
00302 {
00303     m_userCombo.EnableWindow(m_hasUserCheck.GetCheck());
00304 }
00305 #endif /* WIN32 */
00306
00307 #ifdef qMacCvsPP
00308 static void DoDataExchange_LogFilters(LWindow *theDialog, bool & hasDate, bool & hasStates,
00309         bool & hasRev, bool & hasUsers,
00310         CPStr & sLastDate, CPStr & sLastRev,
00311         CPStr & sLastUsers, CPStr & sLastStates, bool putValue)
00312 {
00313     LCheckBox *chkd = dynamic_cast<LCheckBox*>
00314         (theDialog->FindPaneByID(item_LogCheckByDate));
00315     LEditText *editd = dynamic_cast<LEditText*>
00316         (theDialog->FindPaneByID(item_LogEditByDate));
00317     LCheckBox *chks = dynamic_cast<LCheckBox*>
00318         (theDialog->FindPaneByID(item_LogCheckByState));
00319     LEditText *edits = dynamic_cast<LEditText*>
00320         (theDialog->FindPaneByID(item_LogEditByState));
00321     LCheckBox *chkr = dynamic_cast<LCheckBox*>
00322         (theDialog->FindPaneByID(item_LogCheckByRev));
00323     LEditText *editr = dynamic_cast<LEditText*>
00324         (theDialog->FindPaneByID(item_LogEditByRev));
00325     LCheckBox *chku = dynamic_cast<LCheckBox*>
00326         (theDialog->FindPaneByID(item_LogCheckByUser));
00327     LEditText *editu = dynamic_cast<LEditText*>
00328         (theDialog->FindPaneByID(item_LogEditByUser));
00329     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00330         (theDialog->FindPaneByID(item_LogFillByDate));
00331     LPopupFiller *fillState = dynamic_cast<LPopupFiller*>
00332         (theDialog->FindPaneByID(item_LogFillByState));
00333     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00334         (theDialog->FindPaneByID(item_LogFillByRev));
00335     LPopupFiller *fillUser = dynamic_cast<LPopupFiller*>
00336         (theDialog->FindPaneByID(item_LogFillByUser));
00337
00338     fillDate->DoDataExchange(gLogDateNames, putValue);
00339     fillState->DoDataExchange(gLogStateNames, putValue);
00340     fillRev->DoDataExchange(gLogRevNames, putValue);
00341     fillUser->DoDataExchange(gLogUserNames, putValue);
00342
00343     if(putValue)
00344     {
00345         chkd->SetValue(hasDate ? Button_On : Button_Off);
00346         editd->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00347
00348         chks->SetValue(hasStates ? Button_On : Button_Off);
00349         edits->SetText((Ptr)(const char *)sLastStates, sLastStates.length());
00350
00351         chkr->SetValue(hasRev ? Button_On : Button_Off);
00352         editr->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00353
00354         chku->SetValue(hasUsers ? Button_On : Button_Off);
00355         editu->SetText((Ptr)(const char *)sLastUsers, sLastUsers.length());
00356     }
00357     else
00358     {
00359         char str[255];
00360         Size len;
00361
00362         hasDate = chkd->GetValue() == Button_On;
00363         editd->GetText(str, 254, &len);
00364         sLastDate.set(str, len);
00365
00366         hasStates = chks->GetValue() == Button_On;
00367         edits->GetText(str, 254, &len);
00368         sLastStates.set(str, len);
00369
00370         hasRev = chkr->GetValue() == Button_On;
00371         editr->GetText(str, 254, &len);
00372         sLastRev.set(str, len);
00373
00374         hasUsers = chku->GetValue() == Button_On;
00375         editu->GetText(str, 254, &len);
00376         sLastUsers.set(str, len);
00377     }
00378 }
00379
00380 static void DoDataExchange_LogSettings(LWindow *theDialog, bool & noRecurs, bool & defBranch,
00381     bool & headerOnly, bool & noTags, bool & onlyRCSfile, bool putValue)
00382 {
00383     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00384         (theDialog->FindPaneByID(item_NoRecurs));
00385     LCheckBox *chkDefBranch = dynamic_cast<LCheckBox*>
00386         (theDialog->FindPaneByID(item_LogDefBranch));
00387     LCheckBox *chkHeaderOnly = dynamic_cast<LCheckBox*>
00388         (theDialog->FindPaneByID(item_LogNoUserLogs));
00389     LCheckBox *chkNoTags = dynamic_cast<LCheckBox*>
00390         (theDialog->FindPaneByID(item_LogNoTags));
00391     LCheckBox *chkOnlyRCSfile = dynamic_cast<LCheckBox*>
00392         (theDialog->FindPaneByID(item_LogOnlyRcs));
00393
00394     if(putValue)
00395     {
00396         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00397         chkDefBranch->SetValue(defBranch ? Button_On : Button_Off);
00398         chkHeaderOnly->SetValue(headerOnly ? Button_On : Button_Off);
00399         chkNoTags->SetValue(noTags ? Button_On : Button_Off);
00400         chkOnlyRCSfile->SetValue(onlyRCSfile ? Button_On : Button_Off);
00401     }
00402     else
00403     {
00404         noRecurs = chkNoRecurs->GetValue() == Button_On;
00405         defBranch = chkDefBranch->GetValue() == Button_On;
00406         headerOnly = chkHeaderOnly->GetValue() == Button_On;
00407         noTags = chkNoTags->GetValue() == Button_On;
00408         onlyRCSfile = chkOnlyRCSfile->GetValue() == Button_On;
00409     }
00410 }
00411 #endif /* qMacCvsPP */
00412
00413 #if qUnix
00414 class UCvsLog : public UWidget
00415 {
00416     UDECLARE_DYNAMIC(UCvsLog)
00417 public:
00418     UCvsLog() : UWidget(::UEventGetWidID()) {}
00419     virtual ~UCvsLog() {}
00420
00421     enum
00422     {
00423         kOK = EV_COMMAND_START, // 0
00424         kCancel,                // 1
00425         kTabGeneral             // 2
00426     };
00427
00428     virtual void DoDataExchange(bool fill);
00429
00430 protected:
00431     ev_msg int OnOK(void);
00432     ev_msg int OnCancel(void);
00433
00434     UDECLARE_MESSAGE_MAP()
00435 };
00436
00437 UIMPLEMENT_DYNAMIC(UCvsLog, UWidget)
00438
00439 UBEGIN_MESSAGE_MAP(UCvsLog, UWidget)
00440     ON_UCOMMAND(UCvsLog::kOK, UCvsLog::OnOK)
00441     ON_UCOMMAND(UCvsLog::kCancel, UCvsLog::OnCancel)
00442 UEND_MESSAGE_MAP()
00443
00444 int UCvsLog::OnOK(void)
00445 {
00446     EndModal(true);
00447     return 0;
00448 }
00449
00450 int UCvsLog::OnCancel(void)
00451 {
00452     EndModal(false);
00453     return 0;
00454 }
00455
00456 void UCvsLog::DoDataExchange(bool fill)
00457 {
00458     if(fill)
00459     {
00460     }
00461     else
00462     {
00463     }
00464 }
00465
00466 class UCvsLog_MAIN : public UWidget
00467 {
00468     UDECLARE_DYNAMIC(UCvsLog_MAIN)
00469 public:
00470     UCvsLog_MAIN();
00471     virtual ~UCvsLog_MAIN() {}
00472
00473     enum
00474     {
00475         kCheckBranch = EV_COMMAND_START,    // 0
00476         kCheckRecurs,           // 1
00477         kCheckRCS,              // 2
00478         kCheckTags,             // 3
00479         kCheckUsers             // 4
00480     };
00481
00482     virtual void DoDataExchange(bool fill);
00483
00484     bool m_defbranch;
00485     bool m_norecurs;
00486     bool m_notags;
00487     bool m_nousers;
00488     bool m_onlyrcs;
00489
00490 protected:
00491     UDECLARE_MESSAGE_MAP()
00492 };
00493
00494 UIMPLEMENT_DYNAMIC(UCvsLog_MAIN, UWidget)
00495
00496 UBEGIN_MESSAGE_MAP(UCvsLog_MAIN, UWidget)
00497 UEND_MESSAGE_MAP()
00498
00499 UCvsLog_MAIN::UCvsLog_MAIN() : UWidget(::UEventGetWidID())
00500 {
00501     m_defbranch = false;
00502     m_norecurs = false;
00503     m_notags = false;
00504     m_nousers = false;
00505     m_onlyrcs = false;
00506 }
00507
00508 void UCvsLog_MAIN::DoDataExchange(bool fill)
00509 {
00510     if(fill)
00511     {
00512         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckBranch, m_defbranch), 0L);
00513         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00514         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTags, m_notags), 0L);
00515         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUsers, m_nousers), 0L);
00516         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRCS, m_onlyrcs), 0L);
00517     }
00518     else
00519     {
00520         m_defbranch = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckBranch, 0L);
00521         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00522         m_notags = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTags, 0L);
00523         m_nousers = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUsers, 0L);
00524         m_onlyrcs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRCS, 0L);
00525     }
00526 }
00527
00528 class UCvsLog_FILTERS : public UWidget
00529 {
00530     UDECLARE_DYNAMIC(UCvsLog_FILTERS)
00531 public:
00532     UCvsLog_FILTERS(const char * sLastDate, const char * sLastRev,
00533         const char * sLastUsers, const char * sLastStates);
00534     virtual ~UCvsLog_FILTERS() {}
00535
00536     enum
00537     {
00538         kCheckTag = EV_COMMAND_START,   // 0
00539         kCheckDate,         // 1
00540         kCheckState,        // 2
00541         kCheckUser,         // 3
00542         kComboTag,          // 4
00543         kComboDate,         // 5
00544         kComboState,        // 6
00545         kComboUser          // 7
00546     };
00547
00548     virtual void DoDataExchange(bool fill);
00549
00550     UStr m_date;
00551     UStr m_rev;
00552     UStr m_state;
00553     UStr m_user;
00554     bool m_hasrev;
00555     bool m_hasuser;
00556     bool m_hasdate;
00557     bool m_hasstate;
00558 protected:
00559
00560     ev_msg int OnSelect(int cmd);
00561
00562     UDECLARE_MESSAGE_MAP()
00563 };
00564
00565 UIMPLEMENT_DYNAMIC(UCvsLog_FILTERS, UWidget)
00566
00567 UBEGIN_MESSAGE_MAP(UCvsLog_FILTERS, UWidget)
00568     ON_UCOMMAND_RANGE(UCvsLog_FILTERS::kCheckTag, UCvsLog_FILTERS::kCheckUser, UCvsLog_FILTERS::OnSelect)
00569 UEND_MESSAGE_MAP()
00570
00571 UCvsLog_FILTERS::UCvsLog_FILTERS(const char * sLastDate, const char * sLastRev,
00572         const char * sLastUsers, const char * sLastStates) : UWidget(::UEventGetWidID())
00573 {
00574     m_date = sLastDate;
00575     m_rev = sLastRev;
00576     m_state = sLastStates;
00577     m_user = sLastUsers;
00578     m_hasrev = false;
00579     m_hasuser = false;
00580     m_hasdate = false;
00581     m_hasstate = false;
00582 }
00583
00584 int UCvsLog_FILTERS::OnSelect(int cmd)
00585 {
00586     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00587     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 4, state), 0L);
00588     return 0;
00589 }
00590
00591 void UCvsLog_FILTERS::DoDataExchange(bool fill)
00592 {
00593     ::DoDataExchange(fill, GetWidID(), kComboTag, gLogRevNames);
00594     ::DoDataExchange(fill, GetWidID(), kComboDate, gLogDateNames);
00595     ::DoDataExchange(fill, GetWidID(), kComboUser, gLogUserNames);
00596     ::DoDataExchange(fill, GetWidID(), kComboState, gLogStateNames);
00597
00598     if(fill)
00599     {
00600         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00601         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckTag, m_hasrev), 0L);
00602         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckState, m_hasstate), 0L);
00603         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUser, m_hasuser), 0L);
00604
00605         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00606         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboTag, (void *)(const char *)m_rev);
00607         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboState, (void *)(const char *)m_state);
00608         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboUser, (void *)(const char *)m_user);
00609
00610         OnSelect(kCheckDate);
00611         OnSelect(kCheckTag);
00612         OnSelect(kCheckUser);
00613         OnSelect(kCheckState);
00614     }
00615     else
00616     {
00617         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00618         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckTag, 0L);
00619         m_hasstate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckState, 0L);
00620         m_hasuser = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUser, 0L);
00621
00622         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00623         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboTag, &m_rev);
00624         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboState, &m_state);
00625         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboUser, &m_user);
00626     }
00627 }
00628 #endif // qUnix
00629
00631 bool CompatGetLog(const MultiFiles* mf,
00632                   bool& noRecurs, bool& defBranch, CPStr& date,
00633                   bool& headerOnly, bool& headerDesc, bool& supress,
00634                   bool& noTags, bool& onlyRCSfile, bool& hasRev,
00635                   CPStr& rev, CPStr& states, bool& hasUsers, CPStr& users,
00636                   bool outGraph /*= false*/)
00637 {
00638     bool userHitOK = false;
00639
00640     static CPStr sLastDate;
00641     static CPStr sLastRev;
00642     static CPStr sLastUsers;
00643     static CPStr sLastStates;
00644
00645     bool hasDate = false;
00646     bool hasStates = false;
00647
00648     hasRev = false;
00649     hasUsers = false;
00650     date = "";
00651     rev = "";
00652     states = "";
00653     users = "";
00654     noRecurs = false;
00655     defBranch = false;
00656     headerOnly = false;
00657     headerDesc = false;
00658     supress = (bool)gLogSupress;
00659     noTags = false;
00660     onlyRCSfile = false;
00661
00662 #ifdef WIN32
00663     COptionalPropertySheet pages(outGraph ? gCvsPrefs.HideCommandDlgGraph() : gCvsPrefs.HideCommandDlgLog(),
00664         outGraph ? "Graph settings" : "Log settings");
00665     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00666
00667     CLogMain page1(supress);
00668     CLogFilters page2(mf, sLastDate, sLastRev, sLastUsers, sLastStates);
00669     CGetPrefs_GLOBALS page3;
00670
00671     pages.AddPage(&page1);
00672     pages.AddPage(&page2);
00673     pages.AddPage(&page3);
00674
00675     if( pages.DoModal() == IDOK )
00676     {
00677         gLogSupress = page1.m_supress ? true : false;
00678
00679         noRecurs = page1.m_noRecurs == TRUE;
00680         defBranch = page1.m_defBranch == TRUE;
00681         headerOnly = page1.m_headerOnly == TRUE;
00682         headerDesc = page1.m_headerDesc == TRUE;
00683         noTags = page1.m_noTags == TRUE;
00684         onlyRCSfile = page1.m_onlyRCS == TRUE;
00685
00686         sLastDate = page2.m_date;
00687         sLastRev = page2.m_rev;
00688         sLastUsers = page2.m_user;
00689         sLastStates = page2.m_state;
00690
00691         hasRev = page2.m_hasRev == TRUE;
00692         hasUsers = page2.m_hasUser == TRUE;
00693         hasDate = page2.m_hasDate == TRUE;
00694         hasStates = page2.m_hasState == TRUE;
00695
00696         page3.StoreValues();
00697
00698         if( outGraph )
00699         {
00700             gCvsPrefs.SetHideCommandDlgGraph(pages.GetHideCommandDlg());
00701         }
00702         else
00703         {
00704             gCvsPrefs.SetHideCommandDlgLog(pages.GetHideCommandDlg());
00705         }
00706
00707         userHitOK = true;
00708     }
00709 #endif /* WIN32 */
00710 #ifdef qMacCvsPP
00711     StOptionalDialogHandler theHandler(dlg_Log, gCvsPrefs.HideCommandDlgLog(), LCommander::GetTopCommander());
00712     LWindow *theDialog = theHandler.GetDialog();
00713     ThrowIfNil_(theDialog);
00714     static UInt16 sRuntimePanel = 1;
00715
00716     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00717         (theDialog->FindPaneByID(item_MultiViewPrefs));
00718     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00719
00720     multiView->SwitchToPanel(3);
00721     DoDataExchange_Globals(theDialog, true);
00722     multiView->SwitchToPanel(2);
00723     DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00724         sLastDate, sLastRev, sLastUsers, sLastStates, true);
00725     multiView->SwitchToPanel(1);
00726     DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, true);
00727
00728     groupView->SetValue(sRuntimePanel);
00729     theHandler.ShowDialog();
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     sRuntimePanel = groupView->GetValue();
00740
00741     if(hitMessage == msg_OK)
00742     {
00743         multiView->SwitchToPanel(1);
00744         DoDataExchange_LogSettings(theDialog, noRecurs, defBranch, headerOnly, noTags, onlyRCSfile, false);
00745         multiView->SwitchToPanel(2);
00746         DoDataExchange_LogFilters(theDialog, hasDate, hasStates, hasRev, hasUsers,
00747         sLastDate, sLastRev, sLastUsers, sLastStates, false);
00748         multiView->SwitchToPanel(3);
00749         DoDataExchange_Globals(theDialog, false);
00750         gCvsPrefs.SetHideCommandDlgLog(theHandler.GetHideCommandDlg());
00751         userHitOK = true;
00752     }
00753 #endif /* qMacCvsPP */
00754 #if qUnix
00755     void *wid = UCreate_LogDlg();
00756
00757     UCvsLog *dlg = new UCvsLog();
00758     UCvsLog_MAIN *tab1 = new UCvsLog_MAIN();
00759     UCvsLog_FILTERS *tab2 = new UCvsLog_FILTERS(sLastDate, sLastRev, sLastUsers, sLastStates);
00760     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00761     dlg->AddPage(tab1, UCvsLog::kTabGeneral, 0);
00762     dlg->AddPage(tab2, UCvsLog::kTabGeneral, 1);
00763
00764     if(dlg->DoModal())
00765     {
00766         noRecurs = tab1->m_norecurs;
00767         defBranch = tab1->m_defbranch;
00768         headerOnly = tab1->m_nousers;
00769         noTags = tab1->m_notags;
00770         onlyRCSfile = tab1->m_onlyrcs;
00771
00772         sLastDate = tab2->m_date;
00773         sLastRev = tab2->m_rev;
00774         sLastUsers = tab2->m_user;
00775         sLastStates = tab2->m_state;
00776
00777         hasRev = tab2->m_hasrev;
00778         hasUsers = tab2->m_hasuser;
00779         hasDate = tab2->m_hasdate;
00780         hasStates = tab2->m_hasstate;
00781
00782         userHitOK = true;
00783     }
00784
00785     delete dlg;
00786 #endif // qUnix
00787
00788     if( userHitOK )
00789     {
00790         supress = (bool)gLogSupress;
00791
00792         if( hasDate && !sLastDate.empty() )
00793             date = sLastDate;
00794
00795         if( hasRev )
00796             rev = sLastRev;
00797
00798         if( hasUsers )
00799             users = sLastUsers;
00800
00801         if( hasStates && !sLastStates.empty() )
00802             states = sLastStates;
00803
00804         gCvsPrefs.save();
00805     }
00806
00807     return userHitOK;
00808 }
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 class MultiFiles;
00036
00037 bool CompatGetLog(const MultiFiles* mf,
00038                   bool& noRecurs, bool& defBranch, CPStr& date,
00039                   bool& headerOnly, bool& headerDesc, bool& supress,
00040                   bool& noTags, bool& onlyRCSfile, bool& hasRev,
00041                   CPStr& rev, CPStr& states, bool& hasUser, CPStr& users,
00042                   bool outGraph = false);
00043
00044 #ifdef WIN32
00045
00047 class CLogMain : public CPropertyPage
00048 {
00049     DECLARE_DYNAMIC(CLogMain)
00050
00051 // Construction
00052 public:
00053     CLogMain(bool supress);
00054     ~CLogMain();
00055
00056 // Dialog Data
00057     //{{AFX_DATA(CLogMain)
00058     enum { IDD = IDD_LOG_MAIN };
00059     CButton m_headerDescCheck;
00060     CButton m_headerOnlyCheck;
00061     BOOL    m_supress;
00062     BOOL    m_defBranch;
00063     BOOL    m_noRecurs;
00064     BOOL    m_noTags;
00065     BOOL    m_onlyRCS;
00066     BOOL    m_headerOnly;
00067     BOOL    m_headerDesc;
00068     //}}AFX_DATA
00069
00070
00071 // Overrides
00072     // ClassWizard generate virtual function overrides
00073     //{{AFX_VIRTUAL(CLogMain)
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(CLogMain)
00082     afx_msg void OnHeaders();
00083     afx_msg void OnHeadersdesc();
00084     //}}AFX_MSG
00085     DECLARE_MESSAGE_MAP()
00086 };
00087
00089 class CLogFilters : public CPropertyPage
00090 {
00091     DECLARE_DYNAMIC(CLogFilters)
00092
00093 // Construction
00094 public:
00095     CLogFilters(const MultiFiles* mf,
00096         const char* sLastDate, const char* sLastRev,
00097         const char* sLastUsers, const char* sLastStates);
00098     ~CLogFilters();
00099
00100 // Dialog Data
00101     //{{AFX_DATA(CLogFilters)
00102     enum { IDD = IDD_LOG_FILTERS };
00103     CButton m_hasUserCheck;
00104     CButton m_hasStateCheck;
00105     CButton m_hasRevCheck;
00106     CButton m_hasDateCheck;
00107     CButton m_browseTagButton;
00108     CSmartComboBox  m_userCombo;
00109     CSmartComboBox  m_stateCombo;
00110     CSmartComboBox  m_revCombo;
00111     CSmartComboBox  m_dateCombo;
00112     CString m_date;
00113     CString m_rev;
00114     CString m_state;
00115     CString m_user;
00116     BOOL    m_hasDate;
00117     BOOL    m_hasRev;
00118     BOOL    m_hasState;
00119     BOOL    m_hasUser;
00120     //}}AFX_DATA
00121
00122
00123 // Overrides
00124     // ClassWizard generate virtual function overrides
00125     //{{AFX_VIRTUAL(CLogFilters)
00126     protected:
00127     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00128     //}}AFX_VIRTUAL
00129
00130 // Implementation
00131 protected:
00132     // Generated message map functions
00133     //{{AFX_MSG(CLogFilters)
00134     afx_msg void OnDate();
00135     afx_msg void OnRev();
00136     afx_msg void OnState();
00137     afx_msg void OnUser();
00138     afx_msg void OnBrowseTag();
00139     //}}AFX_MSG
00140     DECLARE_MESSAGE_MAP()
00141 private:
00142     const MultiFiles* m_mf;
00143 };
00144
00145 //{{AFX_INSERT_LOCATION}}
00146 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00147 #endif /* WIN32 */
00148
00149 #endif // !defined(AFX_LOGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


common/LoginDlg.cpp Source File

common/LoginDlg.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 2002
00019  */
00020
00021 /*
00022  * LoginDlg.cpp : the cvs login dialog implementation file
00023  */
00024
00025 #include "stdafx.h"
00026
00027 #ifdef WIN32
00028 #   include "wincvs.h"
00029 #endif /* WIN32 */
00030
00031 #include "LoginDlg.h"
00032 #include "CvsPrefs.h"
00033 #include "GetPrefs.h"
00034
00035 #ifdef WIN32
00036
00037 #ifdef _DEBUG
00038 #define new DEBUG_NEW
00039 #undef THIS_FILE
00040 static char THIS_FILE[] = __FILE__;
00041 #endif
00042
00044 // CLogin_MAIN property page
00045
00046 IMPLEMENT_DYNAMIC(CLogin_MAIN, CPropertyPage)
00047
00048 CLogin_MAIN::CLogin_MAIN(bool forceRoot)
00049     : CPropertyPage(CLogin_MAIN::IDD)
00050 {
00051     //{{AFX_DATA_INIT(CLogin_MAIN)
00052     //}}AFX_DATA_INIT
00053
00054     m_forceRoot = forceRoot;
00055
00056     m_helpLogin = _T("Select \"Force using the CVSROOT\" option to login according to your general preferences settings "
00057         "(otherwise current sandbox settings will be used by CVS client executable).\r\n"
00058         "\r\n"
00059         "Login command is interactive and it will ask you for password.\r\n"
00060         "Entered password will be cached by CVS so you need to login only once for each CVSROOT.\r\n"
00061         "\r\n"
00062         "To remove the password from CVS cache use the logout command.");
00063 }
00064
00065 CLogin_MAIN::~CLogin_MAIN()
00066 {
00067 }
00068
00069 void CLogin_MAIN::DoDataExchange(CDataExchange* pDX)
00070 {
00071     CPropertyPage::DoDataExchange(pDX);
00072     //{{AFX_DATA_MAP(CLogin_MAIN)
00073     DDX_Check(pDX, IDC_FORCEROOT, m_forceRoot);
00074     DDX_Text(pDX, IDC_HELPLOGIN, m_helpLogin);
00075     //}}AFX_DATA_MAP
00076 }
00077
00078
00079 BEGIN_MESSAGE_MAP(CLogin_MAIN, CPropertyPage)
00080     //{{AFX_MSG_MAP(CLogin_MAIN)
00081         // NOTE: the ClassWizard will add message map macros here
00082     //}}AFX_MSG_MAP
00083 END_MESSAGE_MAP()
00084
00085
00086 // CLogin_MAIN message handlers
00087
00088 #endif
00089
00091 bool CompatGetLogin(bool& forceCvsroot)
00092 {
00093     bool userHitOK = false;
00094
00095     forceCvsroot = true;
00096
00097 #ifdef WIN32
00098     CPropertySheet pages("Login settings");
00099     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00100
00101     CLogin_MAIN page1(forceCvsroot);
00102     CGetPrefs_CVSROOT page2;
00103     CGetPrefs_GLOBALS page3;
00104     pages.AddPage(&page1);
00105     pages.AddPage(&page2);
00106     pages.AddPage(&page3);
00107
00108     if( pages.DoModal() == IDOK )
00109     {
00110         forceCvsroot = page1.m_forceRoot == TRUE;
00111
00112         page2.StoreValues();
00113         page3.StoreValues();
00114         userHitOK = true;
00115     }
00116 #else
00117   userHitOK = true;
00118 #endif /* WIN32 */
00119
00120     if( userHitOK )
00121     {
00122         gCvsPrefs.save();
00123     }
00124
00125     return userHitOK;
00126 }
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


common/LoginDlg.h Source File

common/LoginDlg.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 2002
00019  */
00020
00021 /*
00022  * LoginDlg.h : the cvs login dialog header file
00023  */
00024
00025 #if !defined(AFX_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_)
00026 #define AFX_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 bool CompatGetLogin(bool& forceCvsroot);
00033
00034 #ifdef WIN32
00035
00036 // CLogin_MAIN dialog
00037
00038 class CLogin_MAIN : public CPropertyPage
00039 {
00040     DECLARE_DYNAMIC(CLogin_MAIN)
00041
00042 // Construction
00043 public:
00044     CLogin_MAIN(bool forceRoot);
00045     ~CLogin_MAIN();
00046
00047 // Dialog Data
00048     //{{AFX_DATA(CLogin_MAIN)
00049     enum { IDD = IDD_LOGIN_MAIN };
00050     BOOL    m_forceRoot;
00051     CString m_helpLogin;
00052     //}}AFX_DATA
00053
00054
00055 // Overrides
00056     // ClassWizard generate virtual function overrides
00057     //{{AFX_VIRTUAL(CLogin_MAIN)
00058     protected:
00059     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00060     //}}AFX_VIRTUAL
00061
00062 // Implementation
00063 protected:
00064     // Generated message map functions
00065     //{{AFX_MSG(CLogin_MAIN)
00066         // NOTE: the ClassWizard will add member functions here
00067     //}}AFX_MSG
00068     DECLARE_MESSAGE_MAP()
00069
00070 };
00071
00072 //{{AFX_INSERT_LOCATION}}
00073 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00074 #endif
00075
00076 #endif // !defined(AFX_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_)
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00040 #   include <unistd.h>
00041 #   include "MacCvsApp.h"
00042 #   include "CTreeView.h"
00043 #endif /* TARGET_OS_MAC */
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 Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 /* TARGET_OS_MAC */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 /* TARGET_OS_MAC */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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,
00151     const char* inDesc, bool createFolder)
00152 {
00153     OSErr err;
00154 #if TARGET_RT_MAC_CFM
00155     short foundVRefNum;
00156     long foundDirID;
00157     char theCPath[256];
00158
00159     err = FindFolder(kOnSystemDisk, inType,
00160         createFolder, &foundVRefNum, &foundDirID);
00161     if (err != noErr)
00162     {
00163         cvs_err("MacCvs: Unable to find the %s folder (error %d)\n", inDesc, err);
00164         return err;
00165     }
00166
00167     if(PathNameFromDirID(foundDirID, foundVRefNum, theCPath) != noErr)
00168     {
00169         cvs_err("MacCvs: Unable to convert path name\n");
00170         return fnfErr;
00171     }
00172     thePath = theCPath;
00173
00174     err = FSMakeFSSpecCompat(foundVRefNum, foundDirID, "\p", theFolder);
00175 #else
00176     err = ::FSFindFolder(kOnAppropriateDisk, inType,
00177                     createFolder, &theFolder);
00178     if (err != noErr)
00179     {
00180         cvs_err("MacCvs: Unable to find the %s folder (error %d)\n", inDesc, err);
00181         return err;
00182     }
00183
00184     GUSIFileSpec spec(theFolder);
00185     thePath = spec.FullPath();
00186 #endif
00187
00188     return err;
00189 }
00190
00191 OSErr
00192 MacGetTempFolder(UFSSpec & theFolder, UStr & thePath)
00193 {
00194     static UFSSpec cacheFile = {0, 0, '\0'};
00195     static UStr cachePath;
00196     if(!cachePath.empty())
00197     {
00198         theFolder = cacheFile;
00199         thePath = cachePath;
00200         return noErr;
00201     }
00202
00203     OSErr err = MacGetSpecialFolder (theFolder, thePath, kTemporaryFolderType, "temporary", true);
00204     if(err == noErr)
00205     {
00206         cacheFile = theFolder;
00207         cachePath = thePath;
00208     }
00209
00210     return err;
00211 }
00212
00213 OSErr
00214 MacGetPrefsFolder(UFSSpec & theFolder, UStr & thePath)
00215 {
00216     static UFSSpec cacheFile = {0, 0, '\0'};
00217     static UStr cachePath;
00218     if(!cachePath.empty())
00219     {
00220         theFolder = cacheFile;
00221         thePath = cachePath;
00222         return noErr;
00223     }
00224
00225     OSErr err = MacGetSpecialFolder (theFolder, thePath, kPreferencesFolderType, "preferences");
00226     if(err == noErr)
00227     {
00228         cacheFile = theFolder;
00229         cachePath = thePath;
00230     }
00231
00232     return err;
00233 }
00234
00235 #endif /* TARGET_OS_MAC */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 #endif
00043
00044 OSErr MacGetSpecialFolder(UFSSpec & theFolder, UStr & thePath, OSType inType,
00045     const char* inDesc, bool createFolder = false);
00046 OSErr MacGetTempFolder(UFSSpec & theFolder, UStr & thePath);
00047 OSErr MacGetPrefsFolder(UFSSpec & theFolder, UStr & thePath);
00048
00049 #endif /* MACMISC_H */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CvsCommands.h"
00049
00050 #ifdef TARGET_OS_MAC
00051 #   include "MacMisc.h"
00052 #   include <errno.h>
00053 #endif
00054
00055 #ifdef qMacCvsPP
00056 #   include "MacCvsApp.h"
00057 #endif /* qMacCvsPP */
00058
00059 #include "getopt.h"
00060
00061 #ifdef WIN32
00062 #   include "wincvs.h"
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 CMacroSet gMacrosAdmin;
00071 CMacroSet gMacrosSel;
00072
00073 static void getLoc(CStr & path, const char *subFolder)
00074 {
00075     path = "";
00076 #ifdef WIN32
00077     CWincvsApp* pApp = (CWincvsApp *)AfxGetApp();
00078     pApp->GetAppPath(path);
00079
00080     CString appPath = path;
00081     // first the macro folder may be ./macro
00082     CString test = appPath;
00083     test.TrimRight('\\');
00084     test += "\\";
00085     test += subFolder;
00086
00087     struct stat sb;
00088     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00089     {
00090         path = test;
00091         return;
00092     }
00093
00094     CStr uppath, file;
00095     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00096     {
00097         test = uppath;
00098         test.TrimRight('\\');
00099         test += "\\";
00100         test += subFolder;
00101
00102         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00103         {
00104             path = test;
00105             return;
00106         }
00107         appPath = uppath;
00108     }
00109     path = test;
00110 #elif defined(qUnix)
00111     struct stat sb;
00112     path = PACKAGE_DATA_DIR;
00113     if(stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
00114     {
00115         path = PACKAGE_SOURCE_DIR;
00116         CStr uppath, folder;
00117         SplitPath(path, uppath, folder);
00118         path = uppath;
00119         if(!path.endsWith(kPathDelimiter))
00120             path << kPathDelimiter;
00121         path << subFolder;
00122     }
00123 #elif qMacCvsPP
00124     UStr appPath = CMacCvsApp::GetAppPath();
00125     if(!appPath.endsWith(kPathDelimiter))
00126         appPath << kPathDelimiter;
00127     UStr test = appPath;
00128     test << subFolder;
00129
00130     struct stat sb;
00131     if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00132     {
00133         path = test;
00134         return;
00135     }
00136
00137     UStr uppath, file;
00138     while(SplitPath(appPath, uppath, file) && !uppath.empty())
00139     {
00140         test = uppath;
00141         if(!test.endsWith(kPathDelimiter))
00142             test << kPathDelimiter;
00143         test << subFolder;
00144
00145         if(stat(test, &sb) != -1 && S_ISDIR(sb.st_mode))
00146         {
00147             path = test;
00148             return;
00149         }
00150         appPath = uppath;
00151     }
00152     path = test;
00153 #else
00154     if(!path.empty() && !path.endsWith(kPathDelimiter))
00155     {
00156         path << kPathDelimiter;
00157     }
00158     path << subFolder;
00159 #endif
00160 }
00161
00162 void MacrosGetLoc(CStr & path)
00163 {
00164     getLoc(path, MACROS_FOLDER);
00165 }
00166
00167 void PythonLibGetLoc(CStr & path)
00168 {
00169     getLoc(path, PYTHONLIB_FOLDER);
00170 }
00171
00172 static void MacrosFlushAll(void)
00173 {
00174     gMacrosAdmin.Flush();
00175     gMacrosSel.Flush();
00176 }
00177
00178 class MacroTraversal : public TraversalReport
00179 {
00180 public:
00181     virtual kTraversal OnError(const char *err, int errcode)
00182     {
00183         cvs_err(err);
00184         cvs_err("\n");
00185         return kTraversalError;
00186     }
00187
00188     virtual kTraversal OnFile(const char *fullpath,
00189         const char *fullname,
00190         const char *name,
00191         const struct stat & dir, const UFSSpec * macspec);
00192 };
00193
00194 kTraversal MacroTraversal::OnFile(const char *fullpath,
00195     const char *fullname,
00196     const char *name,
00197     const struct stat & dir, const UFSSpec * macspec)
00198 {
00199     if(stricmp(name + strlen(name) - 4, ".tcl"))
00200         return kContinueTraversal;
00201
00202     FILE *fpin = fopen(fullname, "r");
00203     if(fpin == 0L)
00204     {
00205         cvs_err("Impossible to open '%s' (error %d)\n", fullname, errno);
00206         return kContinueTraversal;
00207     }
00208
00209     char *oldline = 0L;
00210     int line_length;
00211     size_t line_chars_allocated = 0;
00212     CvsArgs args(false);
00213     args.add("dummy");
00214
00215     if((line_length = getline (&oldline, &line_chars_allocated, fpin)) > 0 &&
00216         strnicmp(oldline, "#!CVSGUI1.0", strlen("#!CVSGUI1.0")) == 0)
00217     {
00218         char *line = oldline + strlen("#!CVSGUI1.0");
00219
00220         while(*line)
00221         {
00222             int hasQuote = 0;
00223             char *temp;
00224
00225             // Search for the non space char
00226             while(*line && isspace(*line))
00227                 ++line;
00228
00229             // handle the quote
00230             if((*line) == '"')
00231             {
00232                 hasQuote = 1;
00233                 line++;
00234             }
00235             for(temp=line;*line;++line)
00236             {
00237                 if((*line) == '"')
00238                 {
00239                     if(hasQuote)
00240                     {
00241                         hasQuote = 0; /* ok doc */
00242                         break;
00243                     }
00244                 }
00245                 if(isspace(*line) && !hasQuote)
00246                     break;
00247             }
00248             if(hasQuote) /* mismatch quote */
00249                 temp = line;
00250
00251             if(temp != line)
00252             {
00253                 CStr arg;
00254                 arg.set(temp, line - temp);
00255                 args.add(arg);
00256             }
00257         }
00258
00259         static struct option long_options[] =
00260         {
00261             {"admin", no_argument, 0L, 1},
00262             {"selection", no_argument, 0L, 2},
00263             {"name", required_argument, 0L, 3},
00264             {0, 0, 0, 0}
00265         };
00266         bool hasAdmin = false;
00267         bool hasSel = false;
00268         CStr dispname;
00269
00270         optind = 0;
00271         int option_index = 0, c;
00272         while ((c = getopt_long
00273             (args.Argc(), args.Argv(), "+", long_options, &option_index)) != EOF)
00274         {
00275             switch (c)
00276             {
00277             case 1:
00278                 hasAdmin = true;
00279                 break;
00280             case 2:
00281                 hasSel = true;
00282                 break;
00283             case 3:
00284                 dispname = optarg;
00285                 break;
00286             default:
00287                 cvs_err("Warning : unknown option in the file '%s'\n", fullname);
00288                 break;
00289             }
00290         }
00291
00292         if(dispname.empty())
00293         {
00294             dispname = name;
00295         }
00296
00297         if(hasAdmin)
00298         {
00299             gMacrosAdmin.Add(fullname, dispname);
00300         }
00301         else if(hasSel)
00302         {
00303             gMacrosSel.Add(fullname, dispname);
00304         }
00305         else
00306         {
00307             cvs_err("Warning : no option <admin|selection> in the file '%s'\n", fullname);
00308         }
00309     }
00310
00311     free (oldline);
00312
00313     fclose(fpin);
00314
00315     return kContinueTraversal;
00316 }
00317
00318 void MacrosReloadAll(void)
00319 {
00320     MacrosFlushAll();
00321
00322     // get the macro folder
00323     CStr path;
00324     MacrosGetLoc(path);
00325
00326     // traverse the macro folder
00327     MacroTraversal traverse;
00328     FileTraverse(path, traverse);
00329 }
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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
00085     bool invalFlag;
00086
00087     void Flush(void)
00088     {
00089         entries.erase(entries.begin(), entries.end());
00090         invalFlag = true;
00091     }
00092
00093     void Add(const char *fullname, const char *name)
00094     {
00095         std::vector<CMacroEntry>::iterator j;
00096
00097         for(j = entries.begin(); j != entries.end(); ++j) {
00098             if( stricmp((*j).name, name) > 0 )
00099                 break;
00100         }
00101
00102         entries.insert(j, CMacroEntry(fullname, name));
00103     }
00104 };
00105
00106 extern CMacroSet gMacrosAdmin;
00107 extern CMacroSet gMacrosSel;
00108
00109 void MacrosReloadAll(void);
00110     // reload the available macros
00111     // TO_OBSOLETE
00112
00113 void MacrosGetLoc(CStr & path);
00114     // return the macros location
00115
00116 void PythonLibGetLoc(CStr & path);
00117     // return python library root path
00118
00119 #endif /* MACROSSETUP_H */
Generated on Fri Jan 31 12:08:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00026 #   include "GUSIInternal.h"
00027 #   include "GUSIFileSpec.h"
00028
00029 #   include <Files.h>
00030 #   include <Folders.h>
00031 #   include <AERegistry.h>
00032 #   include <AEPackObject.h>
00033 #   include <AEObjects.h>
00034
00035 #endif /* TARGET_OS_MAC */
00036
00037 #ifdef qUnix
00038 #   include <stdio.h>
00039 #endif /* qUnix */
00040
00041 #ifdef HAVE_UNISTD_H
00042 #   include <unistd.h>
00043 #endif
00044
00045 #include "MoveToTrash.h"
00046 #include "CPStr.h"
00047 #include "FileTraversal.h"
00048 #include "AppConsole.h"
00049
00050 #ifdef WIN32
00051 #   include <direct.h>
00052 #endif /* WIN32 */
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 TARGET_OS_MAC
00063     static OSErr    GetAddressOfFinder (
00064         AEAddressDesc*  outFinderAddress);
00065     static OSErr    SendFilesToTrash (
00066         AEAddressDesc const*    inFinderAddress,
00067         short                   inFileCount,
00068         const UFSSpec*          inFileList);
00069     static OSErr    PutFilesInAE (
00070         short           inFileCount,
00071         const UFSSpec*  inFileList,
00072         AppleEvent  *   ioAppleEvent);
00073     static OSErr ToolboxMoveToTrash(const UFSSpec* spec);
00074
00075     const   OSType  kFinderSignature    =   'MACS';
00076
00077     static std::vector<UFSSpec> sToTrash;
00078     static bool sTrashRetainer = false;
00079
00080     static OSErr    MoveToTrash (const std::vector<UFSSpec> & inFiles)
00081     {
00082         OSErr   err = noErr;
00083         AEDesc  finderAddress = {typeNull, nil};
00084
00085         /*  First unlock the file so that the Finder can rename it
00086             if there are already files of that name in the Trash */
00087         std::vector<UFSSpec>::const_iterator i;
00088         for(i = inFiles.begin(); i != inFiles.end(); ++i)
00089         {
00090 #if TARGET_RT_MAC_CFM
00091             err = FSpRstFLock (&*i);
00092 #else
00093             FSCatalogInfo info;
00094             if((err = FSGetCatalogInfo(&*i, kFSCatInfoNodeFlags, &info, NULL, NULL, NULL)) == noErr &&
00095                 (info.nodeFlags & kFSNodeLockedMask) != 0)
00096             {
00097                 info.nodeFlags = info.nodeFlags & ~kFSNodeLockedMask;
00098                 err = FSSetCatalogInfo(&*i, kFSCatInfoNodeFlags, &info);
00099             }
00100 #endif
00101             if (err != noErr)
00102                 goto cleanup;
00103         }
00104
00105         err = GetAddressOfFinder (&finderAddress);
00106         if (err != noErr)
00107             goto cleanup;
00108
00109         err = SendFilesToTrash (&finderAddress, inFiles.size(), &inFiles[0]);
00110         if (err != noErr)
00111             goto cleanup;
00112
00113     cleanup:
00114         if (finderAddress.dataHandle != nil) {
00115             AEDisposeDesc (&finderAddress);
00116         }
00117         if(err != noErr)
00118         {
00119             /* try the toolbox way */
00120             for(i = inFiles.begin(); i != inFiles.end(); ++i)
00121             {
00122                 err = ToolboxMoveToTrash(&*i);
00123             }
00124         }
00125
00126         return err;
00127     }
00128
00129     static OSErr    MoveToTrash (const UFSSpec* inFile)
00130     {
00131         OSErr   err = noErr;
00132         AEDesc  finderAddress = {typeNull, nil};
00133
00134         /*  First unlock the file so that the Finder can rename it
00135             if there are already files of that name in the Trash */
00136
00137 #if TARGET_RT_MAC_CFM
00138         err = FSpRstFLock (inFile);
00139 #else
00140         FSCatalogInfo info;
00141         if((err = FSGetCatalogInfo(inFile, kFSCatInfoNodeFlags, &info, NULL, NULL, NULL)) == noErr &&
00142             (info.nodeFlags & kFSNodeLockedMask) != 0)
00143         {
00144             info.nodeFlags = info.nodeFlags & ~kFSNodeLockedMask;
00145             err = FSSetCatalogInfo(inFile, kFSCatInfoNodeFlags, &info);
00146         }
00147 #endif
00148         if (err != noErr)
00149             goto cleanup;
00150
00151         err = GetAddressOfFinder (&finderAddress);
00152         if (err != noErr)
00153             goto cleanup;
00154
00155         err = SendFilesToTrash (&finderAddress, 1, inFile);
00156         if (err != noErr)
00157             goto cleanup;
00158
00159     cleanup:
00160         if (finderAddress.dataHandle != nil) {
00161             AEDisposeDesc (&finderAddress);
00162         }
00163         if(err != noErr)
00164         {
00165             /* try the toolbox way */
00166             err = ToolboxMoveToTrash(inFile);
00167         }
00168
00169         return err;
00170     }
00171
00172     static OSErr
00173     ToolboxMoveToTrash(const UFSSpec* spec)
00174     {
00175         OSErr err;
00176
00177 #if TARGET_RT_MAC_CFM
00178         short foundVRefNum;
00179         long foundDirID;
00180
00181         err = FindFolder(spec->vRefNum, kTrashFolderType, kDontCreateFolder,
00182             &foundVRefNum, &foundDirID);
00183
00184         if(err != noErr)
00185             return err;
00186
00187         err = CatMove(spec->vRefNum, spec->parID, spec->name, foundDirID, "\p:"/*spec.name*/);
00188 #else
00189         FSRef              folder;
00190         FSVolumeRefNum     volume(kOnAppropriateDisk);
00191     FSCatalogInfo      info;
00192     // get the volume the file resides on and use this as the base for finding the trash folder
00193     // since each volume will contain it's own trash folder...
00194     //
00195         if ( FSGetCatalogInfo(spec, kFSCatInfoVolume, &info, NULL, NULL, NULL) == noErr )
00196           volume = info.volume;
00197         // go ahead and find the trash folder on that volume.
00198         // the trash folder for the current user may not yet exist on that volume,
00199         // so ask to automatically create it
00200         //
00201         err = FSFindFolder(volume, kTrashFolderType, kCreateFolder, &folder);
00202
00203         if(err != noErr)
00204             return err;
00205
00206         err = FSMoveObject(spec, &folder, NULL);
00207 #endif
00208
00209         return err;
00210     }
00211
00212     /* get address of the Finder (to use as the destination of our appleevents) */
00213
00214     static OSErr
00215     GetAddressOfFinder (
00216         AEAddressDesc*  outFinderAddress)
00217     {
00218         return (AECreateDesc (typeApplSignature, (Ptr) &kFinderSignature, sizeof (long), outFinderAddress));
00219     }
00220
00221     /* Tell Finder to send a list of files to the trash */
00222
00223     static OSErr
00224     SendFilesToTrash (
00225         AEAddressDesc const*    inFinderAddress,
00226         short                   inFileCount,
00227         const UFSSpec*          inFileList)
00228     {
00229         OSErr       err = noErr;
00230         AppleEvent  theAppleEvent = {typeNull, nil};
00231         AppleEvent  theReply = {typeNull, nil};
00232         DescType    trashType = kTrashFolderType;
00233         AEDesc      keyData = {typeNull, nil};
00234         AEDesc      trashSpecifier = {typeNull, nil};
00235         AEDesc      nullDescriptor = {typeNull, nil};
00236
00237
00238         /* create the appleevent */
00239         err = AECreateAppleEvent (kAECoreSuite, kAEMove, inFinderAddress, kAutoGenerateReturnID, kAnyTransactionID, &theAppleEvent);
00240         if (err != noErr)
00241             goto cleanup;
00242
00243         /* put the files into the direct object of the appleevent */
00244         err = PutFilesInAE (inFileCount, inFileList, &theAppleEvent);
00245         if (err != noErr)
00246             goto cleanup;
00247
00248         /* create a descriptor for trash */
00249         err = AECreateDesc (typeType, (Ptr) &trashType, sizeof (DescType) , &keyData);
00250         if (err != noErr)
00251             goto cleanup;
00252
00253         /* get specifier for trash object */
00254         err = CreateObjSpecifier (typeProperty, &nullDescriptor, formPropertyID, &keyData, true, &trashSpecifier);
00255         if (err != noErr)
00256             goto cleanup;
00257
00258         /* put the trash specifier as the indirect object in the appleevent */
00259         err = AEPutParamDesc (&theAppleEvent, keyAEInsertHere, &trashSpecifier);
00260         if (err != noErr)
00261             goto cleanup;
00262
00263         /* send the appleevent */
00264         err = AESend (&theAppleEvent, &theReply, kAEWaitReply, kAENormalPriority, kAEDefaultTimeout, nil, nil);
00265         if (err != noErr)
00266             goto cleanup;
00267
00268         /* ignore the reply */
00269
00270     cleanup:
00271
00272         /* dispose of the stuff that we allocated */
00273         if (theAppleEvent.dataHandle != nil) {
00274             AEDisposeDesc (&theAppleEvent);
00275         }
00276         if (theReply.dataHandle != nil) {
00277             AEDisposeDesc (&theReply);
00278         }
00279         if (keyData.dataHandle != nil) {
00280             AEDisposeDesc (&keyData);
00281         }
00282         if (trashSpecifier.dataHandle != nil) {
00283             AEDisposeDesc (&trashSpecifier);
00284         }
00285         /* don't have to dispose of nullDescriptor because it's null */
00286
00287         return err;
00288     }
00289
00290     /* put a list of files into the direct object of an apple event */
00291
00292     static OSErr
00293     PutFilesInAE (
00294         short               inFileCount,
00295         const UFSSpec*      inFileList,
00296         AppleEvent*         ioAppleEvent)
00297     {
00298         OSErr       err;
00299         AEDescList  fileList = {typeNull, nil};
00300         short       i;
00301 #if TARGET_RT_MAC_MACHO
00302         AliasHandle alias;
00303 #endif
00304
00305         err = AECreateList(nil, 0, false, &fileList);
00306         if (err != noErr) return err;
00307
00308         for (i = 1; i <= inFileCount; i++) {
00309 #if TARGET_RT_MAC_CFM
00310             err = AEPutPtr(&fileList, i, typeFSS,
00311                             (Ptr) (inFileList + i - 1), sizeof(UFSSpec));
00312 #else
00313             err = ::FSNewAlias(NULL, inFileList + i - 1, &alias);
00314             if (err != noErr) goto cleanup;
00315
00316             ::HLock((Handle)alias);
00317             err = AEPutPtr(&fileList, i, typeAlias, *alias, ::GetHandleSize((Handle)alias));
00318             ::HUnlock((Handle)alias);
00319
00320             ::DisposeHandle((Handle)alias);
00321 #endif
00322             if (err != noErr) goto cleanup;
00323         }
00324
00325         err = AEPutParamDesc(ioAppleEvent, keyDirectObject, &fileList);
00326
00327     cleanup:
00328         if (fileList.dataHandle != nil) {
00329             AEDisposeDesc(&fileList);
00330         }
00331
00332         return err;
00333     }
00334 #endif /* TARGET_OS_MAC */
00335
00336 void CompatBeginMoveToTrash(void)
00337 {
00338 #ifdef TARGET_OS_MAC
00339     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00340     sTrashRetainer = true;
00341 #endif
00342 }
00343
00344 void CompatEndMoveToTrash(void)
00345 {
00346 #ifdef TARGET_OS_MAC
00347     if(sToTrash.size() > 0)
00348     {
00349         OSErr err;
00350         err = MoveToTrash(sToTrash);
00351         if(err != noErr)
00352             cvs_err("Unable to send files to the trash (Error %d)\n", err);
00353         else
00354             cvs_out("Files has been moved successfully to the trash...\n");
00355     }
00356
00357     sToTrash.erase(sToTrash.begin(), sToTrash.end());
00358     sTrashRetainer = false;
00359 #endif
00360 }
00361
00362 bool CompatMoveToTrash(const char *file, const char *dir, const UFSSpec *spec)
00363 {
00364 #ifdef TARGET_OS_MAC
00365     if(sTrashRetainer)
00366     {
00367         if(spec)
00368             sToTrash.push_back(*spec);
00369         else
00370         {
00371             CStr fullpath(dir);
00372             if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00373             {
00374                 fullpath << kPathDelimiter;
00375             }
00376             fullpath << file;
00377             GUSIFileSpec mspec(fullpath);
00378             if(mspec.Error() != noErr)
00379             {
00380                 errno = mspec.Error();
00381                 return false;
00382             }
00383             sToTrash.push_back(mspec);
00384         }
00385
00386         return true;
00387     }
00388
00389     return spec != NULL ? MoveToTrash(spec) == noErr : false;
00390 #elif defined(WIN32)
00391     SHFILEOPSTRUCT fileop;
00392     CStr fullpath(dir);
00393     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00394     {
00395         fullpath << kPathDelimiter;
00396     }
00397     fullpath << file;
00398     fullpath << ' ';
00399     fullpath[fullpath.length() - 1] = '\0';
00400
00401     fileop.hwnd     = *AfxGetMainWnd();
00402     fileop.wFunc    = FO_DELETE;
00403     fileop.pFrom    = fullpath;
00404     fileop.pTo      = 0L;
00405     fileop.fFlags   = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
00406
00407     if(SHFileOperation(&fileop) != 0)
00408     {
00409         if(dir != 0L && chdir(dir) != 0)
00410             return false;
00411
00412         cvs_err("Unable to send \'%s\' to the recycle bin (error %d)\n",
00413             file, GetLastError());
00414         cvs_err("Trying now to delete \'%s\' instead\n", file);
00415         return remove(file) == 0;
00416     }
00417     return true;
00418 #else /* !TARGET_OS_MAC && !WIN32 */
00419     CStr fullpath(dir);
00420     if(!fullpath.empty() && !fullpath.endsWith(kPathDelimiter))
00421     {
00422         fullpath << kPathDelimiter;
00423     }
00424     fullpath << file;
00425
00426     return remove(fullpath) == 0;
00427 #endif /* !TARGET_OS_MAC && !WIN32 */
00428 }
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include <map>
00038 #include <utility>
00039 #include <algorithm>
00040
00041 #ifdef WIN32
00042 #   ifdef _DEBUG
00043 #   define new DEBUG_NEW
00044 #   undef THIS_FILE
00045     static char THIS_FILE[] = __FILE__;
00046 #   endif
00047 #endif /* WIN32 */
00048
00050 //
00051
00052 FileEntry::FileEntry()
00053 {
00054 }
00055
00056 FileEntry::FileEntry(const char* filename, const UFSSpec* macspec /*= 0L*/, const char* currRevision /*= 0L*/)
00057 {
00058     file = filename;
00059
00060     if( currRevision != 0L )
00061         currRev = currRevision;
00062
00063     if( macspec != 0L )
00064         spec = *macspec;
00065 }
00066
00067 FileEntry::FileEntry(const FileEntry& entry)
00068 {
00069     *this = entry;
00070 }
00071
00072 FileEntry& FileEntry::operator=(const FileEntry& entry)
00073 {
00074     file = entry.file;
00075     currRev = entry.currRev;
00076     spec = entry.spec;
00077     return *this;
00078 }
00079
00080
00082 // MultiFilesEntry
00083
00084 MultiFilesEntry::MultiFilesEntry()
00085 {
00086 }
00087
00088 MultiFilesEntry::MultiFilesEntry(const char* path)
00089 {
00090     dir = path;
00091 }
00092
00093 MultiFilesEntry::MultiFilesEntry(const MultiFilesEntry& entries)
00094 {
00095     *this = entries;
00096 }
00097
00098 MultiFilesEntry& MultiFilesEntry::operator=(const MultiFilesEntry& entries)
00099 {
00100     dir = entries.dir;
00101     files = entries.files;
00102     return *this;
00103 }
00104
00106 void MultiFilesEntry::setdir(const char* newdir)
00107 {
00108     dir = newdir;
00109 }
00110
00112 void MultiFilesEntry::add(const char* file, const UFSSpec* spec, const char* currRevision)
00113 {
00114     FileEntry entry(file, spec, currRevision);
00115     files.push_back(entry);
00116 }
00117
00119 bool MultiFilesEntry::get(int index, CStr& path, CStr& fileName, CStr& currRev) const
00120 {
00121     if( index < 0 || (size_t)index >= files.size() )
00122         return false;
00123
00124     path = dir;
00125     fileName = files[index].file;
00126     currRev = files[index].currRev;
00127
00128     return true;
00129 }
00130
00132 const char* MultiFilesEntry::add(CvsArgs& args) const
00133 {
00134     std::vector<FileEntry>::const_iterator i;
00135     for(i = files.begin(); i != files.end(); ++i)
00136     {
00137         args.addfile((*i).file, dir, &(*i).spec, (*i).currRev);
00138     }
00139
00140     return dir;
00141 }
00142
00144 // MultiFiles
00145
00146 MultiFiles::MultiFiles()
00147 {
00148 }
00149
00151 void MultiFiles::newdir(const char* dir)
00152 {
00153     MultiFilesEntry entry(dir);
00154     dirs.push_back(dir);
00155 }
00156
00158 void MultiFiles::newfile(const char* file, const UFSSpec* spec, const char* currRevision)
00159 {
00160     if( dirs.size() == 0 )
00161         return;
00162
00163     MultiFilesEntry& entry = dirs[dirs.size() - 1];
00164     entry.add(file, spec, currRevision);
00165 }
00166
00168 bool MultiFiles::getdir(int index, CStr& path) const
00169 {
00170     if( index < 0 || index >= (int)dirs.size() )
00171         return false;
00172
00173     const MultiFilesEntry& entry = dirs[index];
00174
00175     path = entry.dir;
00176
00177     return true;
00178 }
00179
00181 void MultiFiles::reset()
00182 {
00183     dirs.erase(dirs.begin(), dirs.end());
00184 }
00185
00187 int MultiFiles::TotalNumFiles(void) const
00188 {
00189     int total = 0;
00190
00191     std::vector<MultiFilesEntry>::const_iterator i;
00192     for(i = dirs.begin(); i != dirs.end(); ++i)
00193     {
00194         total += i->NumFiles();
00195     }
00196
00197     return total;
00198 }
00199
00201 // \result returns true when the name passed was indeed a partial path
00202 static bool split(const CStr& inPartialPath, CStr& outPath, CStr& outName)
00203 {
00204     int     delimiterPos(inPartialPath.rfind(kPathDelimiter));
00205     if ( delimiterPos )
00206     {
00207         inPartialPath.substr(delimiterPos+1, inPartialPath.length()-delimiterPos-1, outName);
00208         inPartialPath.substr(0, delimiterPos+1, outPath); // includes trailing delimiter
00209         return true;
00210     }
00211     else
00212     {
00213         outName = inPartialPath;
00214         outPath = (const char*)NULL;
00215         return false;
00216     }
00217 }
00218
00220 struct match_dir
00221 {
00222     const CStr& dirPath;
00223     match_dir(const CStr& inDirPath) : dirPath(inDirPath) {}
00224     bool operator()(const MultiFilesEntry& inEntry) const
00225     {
00226         return dirPath == inEntry.getdir();
00227     }
00228 };
00229
00231 bool MultiFiles::Normalize()
00232 {
00233     std::vector<MultiFilesEntry>    workingCopy(dirs);
00234     dirs.clear();
00235
00236     for ( std::vector<MultiFilesEntry>::const_iterator i(workingCopy.begin()); i != workingCopy.end(); ++i )
00237       if ( i->files.empty() )
00238       {
00239         // special case for empty directories in MultiFiles:
00240         // just add the directory to our directory list
00241         //
00242             std::vector<MultiFilesEntry>::iterator      found;
00243             found = std::find_if(dirs.begin(), dirs.end(), match_dir(i->dir));
00244             if ( found == dirs.end() )
00245             {
00246                 // directory not found in list -> create new directory
00247                 this->newdir(i->dir);
00248             }
00249       }
00250         else for ( std::vector<FileEntry>::const_iterator j(i->files.begin()); j != i->files.end(); j++ )
00251         {
00252             // split into partial path and name
00253             //
00254             CStr        fullDirPath, dir, name;
00255             if ( split(j->file, dir, name) )
00256             {
00257                 // insert current directory path in front of partial path
00258                 //
00259                 fullDirPath = i->dir;
00260                 if ( !i->dir.endsWith(kPathDelimiter) )
00261                     fullDirPath << kPathDelimiter;
00262                 fullDirPath << dir;
00263             }
00264             else fullDirPath = i->dir; // file does not have a partial path
00265
00266             std::vector<MultiFilesEntry>::iterator      found;
00267             found = std::find_if(dirs.begin(), dirs.end(), match_dir(fullDirPath));
00268             if ( found != dirs.end() )
00269             {
00270                 // directory already in list -> just append the new file entry
00271                 found->add(name, &j->spec, j->currRev);
00272             }
00273             else
00274             {
00275                 // directory not found in list -> create new directory and append the file to the new directory
00276                 this->newdir(fullDirPath);
00277                 this->newfile(name, &j->spec, j->currRev);
00278             }
00279         }
00280
00281     return true;
00282 }
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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
00040 class FileEntry
00041 {
00042 public:
00043     FileEntry();
00044     FileEntry(const char* filename, const UFSSpec* macspec = 0L, const char* currRevision = 0L);
00045     FileEntry(const FileEntry& entry);
00046
00047     FileEntry& operator=(const FileEntry& entry);
00048
00049 protected:
00050     CStr file;
00051     CStr currRev;
00052     UFSSpec spec;
00053
00054 friend class MultiFilesEntry;
00055 friend class MultiFiles;
00056 };
00057
00059 class MultiFilesEntry
00060 {
00061 public:
00062     MultiFilesEntry();
00063     MultiFilesEntry(const char* path);
00064     MultiFilesEntry(const MultiFilesEntry& entries);
00065
00066     MultiFilesEntry& operator=(const MultiFilesEntry& entries);
00067
00068     void setdir(const char* newdir);
00069     void add(const char* file, const UFSSpec* spec = 0L, const char* currRevision = 0L);
00070
00071     bool get(int index, CStr& path, CStr& fileName, CStr& currRev) const;
00072
00074     int NumFiles(void) const { return files.size(); }
00075
00077     const char* getdir() const { return dir; }
00078
00080     const char* add(CvsArgs& args) const;
00081
00082 protected:
00083     CStr dir;
00084     std::vector<FileEntry> files;
00085
00086 friend class MultiFiles;
00087 };
00088
00090 class MultiFiles
00091 {
00092 public:
00093     MultiFiles();
00094
00095     void newdir(const char* dir);
00096     void newfile(const char* file, const UFSSpec* spec = 0L, const char* currRevision = 0L);
00097
00098     typedef std::vector<MultiFilesEntry>::const_iterator const_iterator;
00099
00100     const_iterator begin() const { return dirs.begin(); }
00101     const_iterator end() const { return dirs.end(); }
00102
00103     bool getdir(int index, CStr& path) const;
00104
00105     int NumDirs(void) const { return dirs.size(); }
00106     int TotalNumFiles(void) const;
00107
00108     void reset();
00109
00110     bool Normalize();
00111
00112 protected:
00113     std::vector<MultiFilesEntry> dirs;
00114 };
00115
00117 class MultiFilesEntryIndex
00118 {
00119 public:
00120     MultiFilesEntryIndex(int index, MultiFiles::const_iterator mfi)
00121         : m_index(index), m_mfi(mfi)
00122     {
00123     }
00124
00125     int GetIndex() const { return m_index; }
00126     MultiFiles::const_iterator GetIterator() const { return m_mfi; }
00127
00128 private:
00129     int m_index;
00130     MultiFiles::const_iterator m_mfi;
00131 };
00132
00133 #endif /* MULTIFILES_H */
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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     typename 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     typename 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 #if (__GNUC__ > 2)
00114     // prevent compiler warnings if gcc 3.x is used
00115     typename TMString<T>::list_t::const_iterator i;
00116 #else
00117     TMString<T>::list_t::const_iterator i;
00118 #endif
00119     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00120         if(Compare(*i, instr) == 0) break;
00121
00122     return i;
00123 }
00124
00125 template<class T>
00126 void TMString<T>::Insert(const char *newstr)
00127 {
00128     TouchTimeStamp();
00129
00130     typename NAMESPACE(std) vector<T>::iterator i;
00131     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00132     {
00133         if(Compare(*i, newstr) == 0)
00134         {
00135             fAllStrs.erase(i);
00136             fAllStrs.insert(fAllStrs.begin(), T(newstr));
00137             return;
00138         }
00139     }
00140     fAllStrs.insert(fAllStrs.begin(), T(newstr));
00141     if(fAllStrs.size() > fMaxStr)
00142     {
00143         fAllStrs.erase(fAllStrs.begin() + fMaxStr, fAllStrs.end());
00144     }
00145 }
00146
00147 template<class T>
00148 bool TMString<T>::Remove(const char *newstr)
00149 {
00150
00151     typename NAMESPACE(std) vector<T>::iterator i;
00152     for(i = fAllStrs.begin(); i != fAllStrs.end(); ++i)
00153     {
00154         if(Compare(*i, newstr) == 0)
00155         {
00156             TouchTimeStamp();
00157             fAllStrs.erase(i);
00158             return true;
00159         }
00160     }
00161
00162     return false;
00163 }
00164
00165 template class TMString<CStr>;
00166 template class TMString<CPStr>;
00167
00168 UIMPLEMENT_DYNAMIC(CMString, CPersistent)
00169 UIMPLEMENT_DYNAMIC(CMPString, CPersistent)
00170
00171 void CKeyString::Concatenate(UStr & res, const char *key, const char *value)
00172 {
00173     char c;
00174     while((c = *key++) != '\0')
00175     {
00176         if(c == '@' || c == '\\')
00177             res << '\\';
00178         res << c;
00179     }
00180     res << '@';
00181     while((c = *value++) != '\0')
00182     {
00183         if(c == '@' || c == '\\')
00184             res << '\\';
00185         res << c;
00186     }
00187 }
00188
00189 void CKeyString::Split(const char *str, UStr & key, UStr & value)
00190 {
00191     key = "";
00192     value = "";
00193     char c;
00194     bool inKey = true;
00195     while((c = *str++) != 0)
00196     {
00197         if(c == '\\')
00198             c = *str++;
00199         else if(c == '@')
00200         {
00201             inKey = false;
00202             continue;
00203         }
00204
00205         if(inKey)
00206             key << c;
00207         else
00208             value << c;
00209     }
00210 }
00211
00212 int CKeyString::Compare(const char *s1, const char *s2) const
00213 {
00214     UStr key1, key2, val1, val2;
00215     Split(s1, key1, val1);
00216     Split(s2, key2, val2);
00217     return strcmp(key1, key2);
00218 }
00219
00220 #if qUnix
00221 void DoDataExchange(bool fill, int widid, int cmdid, CMString & mstr)
00222 {
00223     if(fill)
00224     {
00225         UEventSendMessage(widid, EV_COMBO_RESETALL, cmdid, 0L);
00226         const NAMESPACE(std) vector<CStr> & list = mstr.GetList();
00227                 NAMESPACE(std) vector<CStr>::const_iterator i;
00228         for(i = list.begin(); i != list.end(); ++i)
00229         {
00230             UEventSendMessage(widid, EV_COMBO_APPEND, cmdid, (void *)(const char *)*i);
00231         }
00232     }
00233     else
00234     {
00235         UStr value;
00236         UEventSendMessage(widid, EV_GETTEXT, cmdid, &value);
00237         if(!value.empty())
00238         {
00239             mstr.Insert(value);
00240         }
00241     }
00242 }
00243 #endif // qUnix
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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(typename 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 typename list_t::const_iterator begin() const { return GetList ().begin ();};
00119     inline typename 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 Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CvsPrefs.h"
00028 #include "wincvs_winutil.h"
00029
00030
00031 #ifdef _DEBUG
00032 #define new DEBUG_NEW
00033 #undef THIS_FILE
00034 static char THIS_FILE[] = __FILE__;
00035 #endif
00036
00038 // COptionalPropertySheet
00039
00040 IMPLEMENT_DYNAMIC(COptionalPropertySheet, CPropertySheet)
00041
00042 COptionalPropertySheet::COptionalPropertySheet(bool bOptionChecked, UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
00043     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
00044 {
00045     m_bOptionChecked = bOptionChecked;
00046 }
00047
00048 COptionalPropertySheet::COptionalPropertySheet(bool bOptionChecked, LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
00049     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
00050 {
00051     m_bOptionChecked = bOptionChecked;
00052 }
00053
00054 COptionalPropertySheet::~COptionalPropertySheet()
00055 {
00056 }
00057
00058
00059 BEGIN_MESSAGE_MAP(COptionalPropertySheet, CPropertySheet)
00060 //{{AFX_MSG_MAP(COptionalPropertySheet)
00061 //}}AFX_MSG_MAP
00062 END_MESSAGE_MAP()
00063
00064
00065 // COptionalPropertySheet message handlers
00066
00067
00068 BOOL COptionalPropertySheet::OnInitDialog()
00069 {
00070     CPropertySheet::OnInitDialog();
00071
00072     // Add the option check box
00073     CRect rectWnd;
00074     GetOptionCheckRect(rectWnd);
00075
00076     CString strOptionText;
00077     strOptionText.Format(_T("Display only if %s key is down"), gCvsPrefs.HideCommandDlgUseShift() ? "Shift" : "Ctrl");
00078
00079     m_optionCheck.Create(strOptionText,
00080         WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | WS_TABSTOP,
00081         rectWnd, this, IDC_OPTIONCHECK_BUTTON);
00082
00083     m_optionCheck.SetFont(GetFont());
00084
00085     // Set the checkbox
00086     m_optionCheck.SetCheck(m_bOptionChecked);
00087
00088     return TRUE;  // return TRUE unless you set the focus to a control
00089                   // EXCEPTION: OCX Property Pages should return FALSE
00090 }
00091
00096 void COptionalPropertySheet::GetOptionCheckRect(LPRECT lpRect)
00097 {
00098     if( lpRect )
00099     {
00100         CWnd* pOkWnd = GetDlgItem(IDOK);
00101         if( pOkWnd )
00102         {
00103             CRect rectOkWnd;
00104             pOkWnd->GetWindowRect(rectOkWnd);
00105
00106             CRect rectWnd;
00107             GetWindowRect(rectWnd);
00108
00109             const int margin = rectWnd.bottom - rectOkWnd.bottom;
00110             const int height = IsLargeFonts() ? 19 : 16;
00111             const int width = rectOkWnd.left  - rectWnd.left - (margin * 2);
00112
00113             GetClientRect(rectWnd);
00114
00115             lpRect->left = rectWnd.left + margin;
00116             lpRect->right = lpRect->left + width;
00117
00118             lpRect->bottom = rectWnd.bottom - margin - (rectOkWnd.Height() - height) / 4;
00119             lpRect->top = lpRect->bottom - height;
00120         }
00121         else
00122         {
00123             ASSERT(FALSE);  // Can't get the OK button window?
00124
00125             CRect rectWnd;
00126             GetClientRect(rectWnd);
00127
00128             rectWnd.bottom -= 13;
00129             rectWnd.left   += 7;
00130             rectWnd.top     = rectWnd.bottom - (IsLargeFonts() ? 19 : 16);
00131             rectWnd.right   = rectWnd.left   + (IsLargeFonts() ? 235 : 180);
00132
00133             lpRect->bottom = rectWnd.bottom;
00134             lpRect->left = rectWnd.left;
00135             lpRect->top = rectWnd.top;
00136             lpRect->right = rectWnd.right;
00137         }
00138     }
00139     else
00140     {
00141         ASSERT(FALSE);  // Bad pointer
00142     }
00143 }
00144
00146 int COptionalPropertySheet::DoModal()
00147 {
00148     return !m_bOptionChecked || (m_bOptionChecked && IsHideCommandKeyPressed()) ? CPropertySheet::DoModal() : IDOK;
00149 }
00150
00152 BOOL COptionalPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
00153 {
00154     if( wParam == IDOK )
00155     {
00156         // Save the check state of the display option
00157         m_bOptionChecked = (m_optionCheck.GetCheck() == 1);
00158     }
00159
00160     return CPropertySheet::OnCommand(wParam, lParam);
00161 }
00162
00164 bool COptionalPropertySheet::GetHideCommandDlg()
00165 {
00166     return m_bOptionChecked;
00167 }
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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
00030 #define IDC_OPTIONCHECK_BUTTON  4
00031
00033 // COptionalPropertySheet
00034
00035 class COptionalPropertySheet : public CPropertySheet
00036 {
00037     DECLARE_DYNAMIC(COptionalPropertySheet)
00038
00039 // Construction
00040 public:
00041     COptionalPropertySheet(bool bOptionChecked, UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00042     COptionalPropertySheet(bool bOptionChecked, LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
00043
00044 // Attributes
00045 public:
00046
00047 // Operations
00048 public:
00049
00050 // Overrides
00051     // ClassWizard generated virtual function overrides
00052     //{{AFX_VIRTUAL(COptionalPropertySheet)
00053     public:
00054     virtual int DoModal();
00055     protected:
00056     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
00057     //}}AFX_VIRTUAL
00058
00059 // Implementation
00060 public:
00061     virtual ~COptionalPropertySheet();
00062
00063     // Generated message map functions
00064 protected:
00065     //{{AFX_MSG(COptionalPropertySheet)
00066     virtual BOOL OnInitDialog();
00067     //}}AFX_MSG
00068     DECLARE_MESSAGE_MAP()
00069 protected:
00070     bool m_bOptionChecked;
00071     CButton m_optionCheck;
00073     void GetOptionCheckRect(LPRECT lpRect);
00074
00075 public:
00076     bool GetHideCommandDlg();
00077 };
00078
00080
00081 //{{AFX_INSERT_LOCATION}}
00082 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00083
00084 #endif // !defined(AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_)
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 #include "CvsCommands.h"
00062
00063 #ifdef TARGET_OS_MAC
00064 #   include <Resources.h>
00065 #   include <TextUtils.h>
00066 #   include <Folders.h>
00067 #   include "VolsPaths.h"
00068 #   include "MacMisc.h"
00069 #   ifndef Assert_ // for mpw
00070 #       include <assert.h>
00071 #       define Assert_(cond) assert(cond)
00072 #   endif
00073 #endif /* TARGET_OS_MAC */
00074
00075 #if qMacCvsPP
00076 #   include "MacCvsApp.h"
00077 #   include "MacCvsConstant.h"
00078 #endif
00079
00080 #if TARGET_RT_MAC_MACHO
00081 #   include <LCFString.h>
00082 #endif
00083
00084 #if qUnix
00085 #   include "UCvsDialogs.h"
00086 #endif
00087
00088 #ifdef WIN32
00089 #   ifdef _DEBUG
00090 #   define new DEBUG_NEW
00091 #   undef THIS_FILE
00092     static char THIS_FILE[] = __FILE__;
00093 #   endif
00094 #endif /* WIN32 */
00095
00096 #ifndef NEW
00097 #define NEW new
00098 #endif
00099
00100 std::vector<CPersistent::CPersistentEntry>* CPersistent::fAllEntries = 0L;
00101
00102 UIMPLEMENT_DYNAMIC(CPersistent, UObject)
00103 UIMPLEMENT_DYNAMIC(CPersistentInt, CPersistent)
00104 UIMPLEMENT_DYNAMIC(CPersistentBool, CPersistent)
00105 UIMPLEMENT_DYNAMIC(PCStr, CPersistent)
00106 UIMPLEMENT_DYNAMIC(PCPStr, CPersistent)
00107
00108 CPersistent::CPersistent(const char* uniqueName, kClassPersistent pclass) : fTimeStamp(0)
00109 {
00110     Register(this, uniqueName, pclass);
00111     TouchTimeStamp();
00112 }
00113
00114 CPersistent::~CPersistent()
00115 {
00116     UnRegister(this);
00117 }
00118
00119 void CPersistent::Register(CPersistent* value, const char* uniqueName, kClassPersistent pclass)
00120 {
00121     std::vector<CPersistentEntry>::const_iterator i;
00122     if( fAllEntries == 0L )
00123         fAllEntries = NEW std::vector<CPersistentEntry>;
00124
00125     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00126     {
00127         if(strcmp(uniqueName, (*i).fUniqueName) == 0)
00128         {
00129             UAppConsole("Error : duplicate persistent %s !\n", uniqueName);
00130         }
00131     }
00132
00133     CPersistentEntry newentry;
00134     newentry.fClass = pclass;
00135     newentry.fUniqueName = uniqueName;
00136     newentry.fValue = value;
00137
00138     fAllEntries->push_back(newentry);
00139 }
00140
00141 void CPersistent::UnRegister(CPersistent* value)
00142 {
00143     std::vector<CPersistentEntry>::iterator i;
00144     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00145     {
00146         if( value == (*i).fValue )
00147             break;
00148     }
00149
00150     if( i == fAllEntries->end() )
00151     {
00152         UAppConsole("Error : Unknown persistent value !\n");
00153         return;
00154     }
00155
00156     fAllEntries->erase(i);
00157     if( fAllEntries->size() == 0 )
00158     {
00159         delete fAllEntries;
00160         fAllEntries = 0L;
00161     }
00162 }
00163
00165 static int simple_diff(const char* file1, const char* file2)
00166 {
00167     FILE* f1 = fopen(file1, "rb");
00168     if(f1 == 0L)
00169         return -1;
00170
00171     FILE* f2 = fopen(file2, "rb");
00172     if( f2 == 0L )
00173     {
00174         fclose(f1);
00175         return 1;
00176     }
00177
00178     int res = -1;
00179     char buf1[8000];
00180     char buf2[8000];
00181     size_t num1, num2;
00182
00183     while( !feof(f1) && !feof(f2) && !ferror(f1) && !ferror(f2) )
00184     {
00185         num1 = fread(buf1, sizeof(char), 8000, f1);
00186         num2 = fread(buf2, sizeof(char), 8000, f2);
00187         if( num1 != num2 || (res = memcmp(buf1, buf2, num1 * sizeof(char))) != 0 )
00188             goto fail;
00189     }
00190
00191     if( ferror(f1) || ferror(f2) )
00192         goto fail;
00193
00194     if( feof(f1) ^ feof(f2) )
00195         goto fail;
00196
00197     res = 0;
00198
00199 fail:
00200     fclose(f1);
00201     fclose(f2);
00202
00203     return res;
00204 }
00205
00206 bool CPersistent::SaveAllSettings(const char* settingFileName, const char* forPath)
00207 {
00208     UStr tmpSettingsFile(settingFileName);
00209     tmpSettingsFile << "__";
00210     FILE* fd = fopen(tmpSettingsFile, "w");
00211     if( fd == 0L )
00212     {
00213         cvs_err("Failed to open the setting file '%s' for writing (error %d)", (const char*)tmpSettingsFile, errno);
00214         return false;
00215     }
00216
00217     fprintf(fd, "VERSION=%d\n", 1);
00218
00219     UStr path(forPath);
00220     if( path.endsWith(kPathDelimiter) )
00221         path[path.length() - 1] = '\0';
00222
00223     fprintf(fd, "PATH=%s\n", (const char*)path);
00224     fprintf(fd, "AUTHENTICATION=%s\n", (const char*)Authen::kindToToken(gAuthen.kind()));
00225     fprintf(fd, "CVSROOT=%s\n", (const char*)gCvsPrefs);
00226
00227     std::vector<CPersistentEntry>::const_iterator i;
00228     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00229     {
00230         const CPersistentEntry& entry = *i;
00231         if( (entry.fClass & kAddSettings) == 0 )
00232             continue;
00233
00234         if( entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)) )
00235         {
00236             CPersistentBool* pbool = (CPersistentBool*)entry.fValue;
00237             bool state = *pbool;
00238             fprintf(fd, "%s=%s\n", entry.fUniqueName, state ? "true" : "false");
00239         }
00240         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)) )
00241         {
00242             CPersistentInt* pint = (CPersistentInt*)entry.fValue;
00243             int val = *pint;
00244             fprintf(fd, "%s=%d\n", entry.fUniqueName, val);
00245         }
00246         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(PCStr)) )
00247         {
00248             PCStr* pstr = (PCStr*)entry.fValue;
00249             const char* str = *pstr;
00250             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char*)(str == 0L ? "" : str));
00251         }
00252         else if( entry.fValue->IsKindOf(URUNTIME_CLASS(PCPStr)) )
00253         {
00254             PCPStr* pstr = (PCPStr*)entry.fValue;
00255             const char* str = *pstr;
00256             fprintf(fd, "%s=%s\n", entry.fUniqueName, (const char*)(str == 0L ? "" : str));
00257         }
00258         else
00259         {
00260             cvs_err("Unknown persistent value '%s'\n", entry.fUniqueName);
00261         }
00262     }
00263
00264     fclose(fd);
00265
00266     if( simple_diff(tmpSettingsFile, settingFileName) == 0 )
00267     {
00268         if( unlink(tmpSettingsFile) != 0 && errno != ENOENT )
00269             cvs_err("Could not remove file '%s' (error %d)\n", (const char*)tmpSettingsFile, errno);
00270
00271         return false;
00272     }
00273
00274     if( unlink(settingFileName) != 0 && errno != ENOENT )
00275     {
00276         cvs_err("Could not remove file '%s' (error %d)\n", (const char*)settingFileName, errno);
00277         return false;
00278     }
00279
00280     if( rename(tmpSettingsFile, settingFileName) != 0 )
00281     {
00282         cvs_err("Could not rename file '%s' (error %d)\n", (const char*)tmpSettingsFile, errno);
00283         return false;
00284     }
00285
00286     return true;
00287 }
00288
00289 #ifdef TARGET_OS_MAC
00290     static OSErr GetPreferencesFile(FSSpec & mMacFileSpec)
00291     {
00292         OSErr   theErr;
00293     #if TARGET_RT_MAC_CFM
00294         short   theVRef;
00295         long    theDirID;
00296         Str255 name = {'\0'};
00297
00298         theErr = ::FindFolder(kOnSystemDisk, kPreferencesFolderType,
00299                         kDontCreateFolder, &theVRef, &theDirID);
00300
00301         if( theErr == noErr )
00302         {
00303             GUSIFileSpec spec(theVRef, theDirID, name);
00304             theErr = spec.Error();
00305             if( theErr == noErr )
00306             {
00307                 spec += kCVS_prefName;
00308                 theErr = spec.Error();
00309                 if( theErr == noErr || theErr == fnfErr )
00310                 {
00311                     mMacFileSpec = spec;
00312                 }
00313             }
00314         }
00315     #else
00316         FSRef ref, newref;
00317         theErr = ::FSFindFolder(kOnAppropriateDisk, kPreferencesFolderType,
00318                         kDontCreateFolder, &ref);
00319
00320         if( theErr == noErr )
00321         {
00322             LCFString str(kCVS_prefName);
00323             UniChar buffer[PATH_MAX];
00324             CFRange range = {0, str.GetLength()};
00325             ::CFStringGetCharacters(str, range, buffer);
00326
00327             theErr = ::FSMakeFSRefUnicode(&ref, str.GetLength(), buffer, kTextEncodingDefaultFormat, &newref);
00328
00329             if( theErr == noErr )
00330             {
00331                 return ::FSGetCatalogInfo(&newref, kFSCatInfoNone, NULL, NULL, &mMacFileSpec, NULL);
00332             }
00333             else if( theErr == fnfErr )
00334             {
00335                 return ::FSCreateFileUnicode(&ref, str.GetLength(), buffer, kFSCatInfoNone,
00336                     NULL, NULL, &mMacFileSpec);
00337             }
00338         }
00339     #endif
00340
00341         return theErr;
00342     }
00343 #endif // TARGET_OS_MAC
00344
00345 void CPersistent::SaveAll(void)
00346 {
00347 #ifdef TARGET_OS_MAC
00348     short FRef, oldRef;
00349     OSErr err;
00350     FSSpec thePrefFile;
00351
00352     err = GetPreferencesFile(thePrefFile);
00353
00354     if( err != noErr )
00355     {
00356         cvs_err("Error while searching preference folder (error %d)!\n", err);
00357         return;
00358     }
00359
00360     oldRef = CurResFile();
00361
00362     FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00363     if( FRef < 0 )
00364     {
00365         ::FSpCreateResFile (&thePrefFile, 'mCVS', 'pref', smRoman);
00366         FRef = FSpOpenResFile(&thePrefFile, fsRdWrPerm);
00367         if( FRef < 0 )
00368         {
00369             cvs_err("Error while saving preferences (error %d)!\n", ResError());
00370             return;
00371         }
00372     }
00373
00374     UseResFile (FRef);
00375     CPStr name;
00376
00377     std::vector<CPersistentEntry>::iterator i;
00378     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00379     {
00380         CPersistentEntry & entry = *i;
00381         int size = entry.fValue->SizeOf();
00382         if( size <= 0 )
00383             continue;
00384
00385         //short id = Unique1ID(kCVS_prefID);
00386         name = entry.fUniqueName;
00387
00388         Handle removing = Get1NamedResource(kCVS_prefID, name);
00389
00390         if( removing != nil )
00391         {
00392             RemoveResource(removing);
00393             Assert_(ResError() == noErr);
00394             DisposeHandle(removing);
00395         }
00396
00397         short theID;
00398         do
00399         {
00400             theID = Unique1ID(kCVS_prefID);
00401         }
00402         while( theID <= 127 );
00403
00404         Handle hdl = NewHandle(size);
00405         Assert_(hdl != 0L);
00406         HLock(hdl);
00407         BlockMove(entry.fValue->GetData(), *hdl, size);
00408         HUnlock(hdl);
00409         AddResource(hdl, kCVS_prefID, theID, name);
00410         Assert_(ResError() == noErr);
00411         UpdateResFile(FRef);
00412         Assert_(ResError() == noErr);
00413         ReleaseResource(hdl);
00414         Assert_(ResError() == noErr);
00415     }
00416
00417     UseResFile(oldRef);
00418     Assert_(ResError() == noErr);
00419     CloseResFile (FRef);
00420     Assert_(ResError() == noErr);
00421 #endif /* TARGET_OS_MAC */
00422 #ifdef WIN32
00423     std::vector<CPersistentEntry>::iterator i;
00424     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00425     {
00426         CPersistentEntry& entry = *i;
00427         unsigned int size = entry.fValue->SizeOf();
00428         if( size == 0 )
00429             continue;
00430
00431         if( !AfxGetApp()->WriteProfileBinary(PROFILE_NAME, entry.fUniqueName, (BYTE*)entry.fValue->GetData(), size) )
00432         {
00433             cvs_err("Error while saving preferences !\n");
00434             break;
00435         }
00436     }
00437 #endif /* WIN32 */
00438 #ifdef qUnix
00439     CStr home;
00440     home = gCvsPrefs.Home();
00441     if( !home.endsWith(kPathDelimiter) )
00442         home << kPathDelimiter;
00443
00444     home << ".gcvsrc";
00445     FILE* out = fopen(home, "wb");
00446     if( out == 0L )
00447     {
00448         cvs_err("Unable to open '%s' for writing (error %d)", (char*)home, errno);
00449         return;
00450     }
00451
00452     int version = 1;
00453     fwrite(&version, sizeof(int), 1, out);
00454     int numEntries = fAllEntries->size();
00455     fwrite(&numEntries, sizeof(int), 1, out);
00456     std::vector<CPersistentEntry>::iterator i;
00457     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00458     {
00459         CPersistentEntry& entry = *i;
00460         unsigned int size = entry.fValue->SizeOf();
00461
00462         fwrite(entry.fUniqueName, sizeof(char), strlen(entry.fUniqueName) + 1, out);
00463         fwrite(&size, sizeof(unsigned int), 1, out);
00464         fwrite(entry.fValue->GetData(), 1, size, out);
00465     }
00466
00467     if( ferror(out) )
00468         cvs_err("Error while writing '%s' (error %d)", (char*)home, errno);
00469
00470     fclose(out);
00471 #endif /* qUnix */
00472
00473     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00474     {
00475         CPersistentEntry& entry = *i;
00476         entry.fValue->ResetTimeStamp();
00477     }
00478 }
00479
00480 bool CPersistent::LoadAll(const char* only)
00481 {
00482     bool found_one = false;
00483     std::vector<CPersistentEntry>::iterator i;
00484 #ifdef TARGET_OS_MAC
00485     FSSpec thePrefFile;
00486     short FRef, oldRef;
00487     OSErr err;
00488
00489     err = GetPreferencesFile(thePrefFile);
00490
00491     if( err != noErr )
00492         return false;
00493
00494     oldRef = CurResFile();
00495     FRef = FSpOpenResFile(&thePrefFile, fsRdPerm);
00496     if( FRef < 0 )
00497         return false;
00498
00499     CPStr name;
00500     UseResFile(FRef);
00501
00502     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00503     {
00504         CPersistentEntry& entry = *i;
00505         name = entry.fUniqueName;
00506
00507         Handle hdl = Get1NamedResource(kCVS_prefID, name);
00508         if( hdl == 0L || (only && strcmp(only, name) != 0) )
00509             continue;
00510
00511         HLock(hdl);
00512         found_one = true;
00513         entry.fValue->SetData(*hdl, GetHandleSize(hdl));
00514         entry.fValue->ResetTimeStamp();
00515         HUnlock(hdl);
00516     }
00517
00518     // migrate to the new gOldCvsroots container
00519     if( gOldCvsroots.GetList().size() == 0 && only == 0L )
00520     {
00521         for(int nIndex = 0; nIndex <= NUM_CVSROOT; nIndex++)
00522         {
00523             char tmp[20];
00524             sprintf(tmp, "P_Cvsroot%d", nIndex);
00525
00526             CPStr pstr(tmp);
00527             Handle hdl = Get1NamedResource(kCVS_prefID, pstr);
00528             if( hdl == 0L )
00529                 continue;
00530
00531             CStr root((char*)*hdl);
00532             if( !root.empty() )
00533                 gOldCvsroots.Insert(root);
00534         }
00535     }
00536
00537     CloseResFile(FRef);
00538     UseResFile(oldRef);
00539 #endif /* TARGET_OS_MAC */
00540 #ifdef WIN32
00541     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00542     {
00543         CPersistentEntry & entry = *i;
00544         BYTE* ppData;
00545         UINT pBytes;
00546
00547         if( only && strcmp(only, entry.fUniqueName) != 0 )
00548             continue;
00549
00550         if( !AfxGetApp()->GetProfileBinary(PROFILE_NAME, entry.fUniqueName, &ppData, &pBytes))
00551         {
00552             continue;
00553         }
00554
00555         found_one = true;
00556         entry.fValue->SetData(ppData, pBytes);
00557         entry.fValue->ResetTimeStamp();
00558
00559         delete ppData;
00560     }
00561 #endif /* WIN32 */
00562 #ifdef qUnix
00563     CStr home;
00564     bool error     = false;
00565
00566     home = gCvsPrefs.Home();
00567     if( !home.endsWith(kPathDelimiter) )
00568         home << kPathDelimiter;
00569
00570     home << ".gcvsrc";
00571
00572     FILE* out = fopen(home, "rb");
00573     if( out == 0L )
00574         return false;
00575
00576     int version;
00577     int numEntries;
00578     CStaticAllocT<char> alloc;
00579
00580     fread(&version, sizeof(int), 1, out);
00581     if( version != 1 )
00582     {
00583         cvs_err("Unexpected version %d in the file '%s'\n", version, (char*)home);
00584         error = true;
00585     } else {
00586         fread(&numEntries, sizeof(int), 1, out);
00587         if( numEntries < 0 )
00588         {
00589             cvs_err("Unexpected # %d in the file '%s'\n", numEntries, (char*)home);
00590             error = true;
00591         }
00592     }
00593
00594     /* something has gone wrong !!!! */
00595     if( error ) {
00596         fclose(out);
00597         return false;
00598     }
00599
00600     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00601     {
00602         CStr name;
00603         while( !feof(out) && !ferror(out) )
00604         {
00605             int c = getc(out);
00606             name << (char)c;
00607             if( c == '\0' )
00608                 break;
00609         }
00610
00611         if( feof(out) )
00612             cvs_err("Unexpected end of file in '%s'\n", (char*)home);
00613
00614         if( ferror(out) )
00615             cvs_err("Unexpected error %d in '%s'\n", errno, (char*)home);
00616
00617         if( feof(out) || ferror(out) ) {
00618             continue;
00619         }
00620
00621         CPersistentEntry& entry = *i;
00622         unsigned int size;
00623         fread(&size, sizeof(unsigned int), 1, out);
00624
00625         alloc.AdjustSize(size);
00626         fread((char*)alloc, 1, size, out);
00627         if( only && strcmp(only, entry.fUniqueName) != 0 )
00628             continue;
00629
00630         found_one = true;
00631         entry.fValue->SetData((char*)alloc, size);
00632         entry.fValue->ResetTimeStamp();
00633     }
00634
00635     if( ferror(out) )
00636         cvs_err("Error while reading '%s' (error %d)", (char*)home, errno);
00637
00638     fclose(out);
00639 #endif /* qUnix */
00640
00641     return found_one;
00642 }
00643
00644 CPersistent::CPersistentEntry* CPersistent::Find(const char* uniqueName)
00645 {
00646     std::vector<CPersistentEntry>::iterator i;
00647     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00648     {
00649         CPersistentEntry& entry = *i;
00650         if( !strcmp(uniqueName, entry.fUniqueName) )
00651             return &entry;
00652     }
00653
00654     return 0L;
00655 }
00656
00657 bool CPersistent::NeedSave(bool onlySettings)
00658 {
00659     std::vector<CPersistentEntry>::const_iterator i;
00660     for(i = fAllEntries->begin(); i != fAllEntries->end(); ++i)
00661     {
00662         const CPersistentEntry& entry = *i;
00663         if( onlySettings && (entry.fClass & kAddSettings) == 0 )
00664             continue;
00665
00666         if( entry.fValue->fTimeStamp != 0 )
00667             return true;
00668     }
00669
00670     return false;
00671 }
00672
00673 #if !qMPWCvs
00674
00676 // Settings management
00677
00683 bool FormatDefaultSettingsLoc(CStr& path)
00684 {
00685 #ifdef WIN32
00686     CWincvsApp* pApp = (CWincvsApp*)AfxGetApp();
00687     if( !pApp )
00688     {
00689         return false;
00690     }
00691
00692     pApp->GetAppPath(path);
00693
00694 #elif defined(qUnix)
00695     struct stat sb;
00696
00697     path = gCvsPrefs.Home();
00698     if( !path.endsWith(kPathDelimiter) )
00699         path << kPathDelimiter;
00700
00701     path << ".gcvs";
00702
00703     if( stat(path, &sb) != -1 )
00704     {
00705         if( !S_ISDIR(sb.st_mode) )
00706         {
00707             cvs_err("The file '%s' already exists and is not a directory", (char*)path, errno);
00708             return false;
00709         }
00710     }
00711     else if( mkdir(path, 0750) != 0 )
00712     {
00713         cvs_err("Unable to create the directory '%s' (error %d)", (char*)path, errno);
00714         return false;
00715     }
00716
00717 #elif defined(qMacCvsPP)
00718     path = CMacCvsApp::GetMacCvsPrefsPath();
00719 #endif
00720
00721     if( !path.empty() && !path.endsWith(kPathDelimiter) )
00722     {
00723         path << kPathDelimiter;
00724     }
00725
00726     path << "Settings";
00727
00728     return true;
00729 }
00730
00736 static bool SettingsGetLoc(UStr& path)
00737 {
00738     struct stat sb;
00739
00740     path = "";
00741
00742     if( gCvsPrefs.SettingsFolder() != 0L )
00743     {
00744         path = gCvsPrefs.SettingsFolder();
00745     }
00746     else
00747     {
00748         if( !FormatDefaultSettingsLoc(path) )
00749         {
00750             return false;
00751         }
00752     }
00753
00754     if( stat(path, &sb) != -1 && S_ISDIR(sb.st_mode) )
00755         return true;
00756
00757 #if qUnix || TARGET_RT_MAC_MACHO
00758     if( mkdir(path, 0750) != 0 )
00759 #else
00760     if( mkdir(path) != 0 )
00761 #endif
00762     {
00763         cvs_err("Failed to create the setting folder '%s' (error %d)", (const char*)path, errno);
00764         return false;
00765     }
00766
00767     return true;
00768 }
00769
00770 class USaveSettings : public UWidget
00771 {
00772 public:
00773     UDECLARE_DYNAMIC(USaveSettings)
00774 public:
00775     USaveSettings(const char* path, const char* oldname);
00776     virtual ~USaveSettings();
00777
00778     virtual void DoDataExchange(bool fill);
00779
00780     enum
00781     {
00782 #if qUnix
00783         kOK = EV_COMMAND_START,
00784         kCancel,
00785         kSettingName,
00786 #else
00787         kSettingName = EV_COMMAND_START,
00788 #endif
00789         kCopyPath,
00790         kCopyFrom,
00791         kCopyList
00792     };
00793
00794     UStr m_settingName;
00795     UStr m_copyFromPath;
00796
00797 protected:
00798     UStr m_path;
00799     UStr m_oldname;
00800     std::map<UStr, UStr> m_list;
00801
00802     ev_msg int OnCopyFrom(void);
00803 #if qUnix
00804     ev_msg int OnOK(void);
00805     ev_msg int OnCancel(void);
00806 #endif
00807
00808     UDECLARE_MESSAGE_MAP()
00809 };
00810
00811 UIMPLEMENT_DYNAMIC(USaveSettings, UWidget)
00812
00813 UBEGIN_MESSAGE_MAP(USaveSettings, UWidget)
00814     ON_UCOMMAND(USaveSettings::kCopyFrom, USaveSettings::OnCopyFrom)
00815 #if qUnix
00816     ON_UCOMMAND(USaveSettings::kOK, USaveSettings::OnOK)
00817     ON_UCOMMAND(USaveSettings::kCancel, USaveSettings::OnCancel)
00818 #endif
00819 UEND_MESSAGE_MAP()
00820
00821 #if qUnix
00822 int USaveSettings::OnOK(void)
00823 {
00824     EndModal(true);
00825     return 0;
00826 }
00827
00828 int USaveSettings::OnCancel(void)
00829 {
00830     EndModal(false);
00831     return 0;
00832 }
00833 #endif
00834
00835 USaveSettings::USaveSettings(const char* path, const char* oldname) :
00836     UWidget(::UEventGetWidID()), m_path(path), m_oldname(oldname)
00837 {
00838 }
00839
00840 USaveSettings::~USaveSettings()
00841 {
00842 }
00843
00844 static bool GetAllPersistentSettings(std::map<UStr, UStr>& res);
00845
00846 void USaveSettings::DoDataExchange(bool fill)
00847 {
00848     if( fill )
00849     {
00850         UEventSendMessage(GetWidID(), EV_SETTEXT, kCopyPath, (void*)(const char*)m_path);
00851
00852         UStr defname;
00853         if( m_oldname.empty() )
00854         {
00855             UStr uppath;
00856             SplitPath(m_path, uppath, defname);
00857         }
00858         else
00859             defname = m_oldname;
00860
00861         UEventSendMessage(GetWidID(), EV_SETTEXT, kSettingName, (void*)(const char*)defname);
00862
00863         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, 0), 0L);
00864
00865         UEventSendMessage(GetWidID(), EV_COMBO_RESETALL, kCopyList, 0L);
00866
00867         if(GetAllPersistentSettings(m_list))
00868         {
00869             std::map<UStr, UStr>::const_iterator i;
00870             for(i = m_list.begin(); i != m_list.end(); ++i)
00871             {
00872                 UEventSendMessage(GetWidID(), EV_COMBO_APPEND, kCopyList,
00873                     (void*)(const char*)(*i).first);
00874             }
00875         }
00876     }
00877     else
00878     {
00879         UEventSendMessage(GetWidID(), EV_GETTEXT, kSettingName, &m_settingName);
00880
00881         int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00882         if( state )
00883         {
00884             UStr what;
00885             UEventSendMessage(GetWidID(), EV_COMBO_GETSEL, kCopyList, &what);
00886
00887             std::map<UStr, UStr>::const_iterator i;
00888             i = m_list.find(what);
00889             if(i != m_list.end())
00890             {
00891                 m_copyFromPath = (*i).second;
00892             }
00893         }
00894     }
00895 }
00896
00897 int USaveSettings::OnCopyFrom(void)
00898 {
00899     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCopyFrom, 0L);
00900     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kCopyList, state), 0L);
00901     return 1;
00902 }
00903
00904 static bool loadSettingsInternal(const char* fullname,
00905                                  bool (*func)(const char* token, const char* value, void* data), void* data)
00906 {
00907     bool res = false;
00908     int line_length;
00909     char* line = 0L;
00910     size_t line_chars_allocated = 0;
00911     FILE* fp = fopen(fullname, "r");
00912
00913     if( fp == 0L )
00914     {
00915         cvs_err("Failed to open the setting file '%s' for reading (error %d)", fullname, errno);
00916         goto fail;
00917     }
00918
00919     while( (line_length = getline (&line, &line_chars_allocated, fp)) > 0 )
00920     {
00921         // read each token=value
00922         char* tmp = 0L;
00923
00924         if( (tmp = strchr(line, '\n')) != 0L )
00925             *tmp = '\0';
00926
00927         tmp = line;
00928         while( isspace(*tmp) && *tmp != '\0' )
00929             tmp++;
00930
00931         if( *tmp == '\0' || *tmp == '#' )
00932             continue;
00933
00934         UStr token;
00935         UStr value;
00936         const char* tmp2 = strchr(tmp, '=');
00937         if( tmp2 == 0L )
00938             continue;
00939
00940         token.set(tmp, tmp2 - tmp);
00941         value = tmp2 + 1;
00942
00943         // check version
00944         if( strcmp(token, "VERSION") == 0 )
00945         {
00946             if( atoi(value) != 1 )
00947             {
00948                 cvs_err("Newer format than expected in the setting file '%s'\n", fullname);
00949                 goto fail;
00950             }
00951
00952             continue;
00953         }
00954
00955         if( func(token, value, data) )
00956             break;
00957     }
00958
00959     if( line_length < 0 && !feof (fp) )
00960     {
00961         cvs_err("Cannot read file (error %d)\n", errno);
00962         goto fail;
00963     }
00964
00965     res = true;
00966
00967 fail:
00968     if( line != 0L )
00969         free(line);
00970
00971     if( fp!= 0L )
00972         fclose(fp);
00973
00974     return res;
00975 }
00976
00977 static void getSettingName(const char* fromfile, UStr& res)
00978 {
00979     CStr base, ext, uppath, filename;
00980     SplitPath(fromfile, uppath, filename);
00981     GetExtension(filename, base, ext);
00982
00983     if( !base.empty() && stricmp(ext, "txt") == 0 )
00984         res = base;
00985     else
00986         res = filename;
00987 }
00988
00989 class CFindSettings : public TraversalReport
00990 {
00991 public:
00992     CFindSettings(const char* findPath) : m_pathToFind(findPath), m_list(0L)
00993     {
00994         if( m_pathToFind.endsWith(kPathDelimiter) )
00995             m_pathToFind[m_pathToFind.length() - 1] = '\0';
00996     }
00997
00998     CFindSettings(std::map<UStr, UStr>& list) : m_list(&list)
00999     {
01000     }
01001
01002     virtual ~CFindSettings() {}
01003
01004     virtual kTraversal OnError(const char* err, int errcode)
01005     {
01006         cvs_err(err);
01007         cvs_err("\n");
01008         return kTraversalError;
01009     }
01010
01011     virtual kTraversal OnFile(const char* fullpath,
01012         const char* fullname,
01013         const char* name,
01014         const struct stat& dir, const UFSSpec* macspec);
01015
01016     static bool searchPath(const char* token, const char* value, void* data);
01017     static bool searchAllPath(const char* token, const char* value, void* data);
01018
01019     UStr m_pathToFind;
01020     UStr m_settingsFile;
01021     bool m_foundIt;
01022     UStr m_topfolder;
01023     std::map<UStr, UStr>* m_list;
01024 };
01025
01026 bool CFindSettings::searchPath(const char* token, const char* value, void* data)
01027 {
01028     CFindSettings* loader = (CFindSettings*)data;
01029     // if we give a sub-folder to look for, it will return the
01030     // top folder's settings
01031     if( strcmp(token, "PATH") == 0 &&
01032 #if qUnix
01033         strcmp(value, loader->m_pathToFind) == 0
01034 #else
01035         stricmp(value, loader->m_pathToFind) == 0
01036 #endif
01037         )
01038     {
01039         loader->m_foundIt = true;
01040         loader->m_topfolder = value;
01041
01042         return true;
01043     }
01044
01045     return false;
01046 }
01047
01048 bool CFindSettings::searchAllPath(const char* token, const char* value, void* data)
01049 {
01050     CFindSettings *loader = (CFindSettings*)data;
01051     if( strcmp(token, "PATH") == 0 )
01052     {
01053         getSettingName(loader->m_settingsFile, loader->m_settingsFile);
01054         std::map<UStr, UStr>::value_type v(loader->m_settingsFile, UStr(value));
01055         loader->m_list->insert(v);
01056
01057         return true;
01058     }
01059
01060     return false;
01061 }
01062
01063 kTraversal CFindSettings::OnFile(const char* fullpath,
01064         const char* fullname,
01065         const char* name,
01066         const struct stat& dir, const UFSSpec* macspec)
01067 {
01068     m_foundIt = false;
01069
01070     if( m_list == 0L )
01071     {
01072         loadSettingsInternal(fullname, searchPath, this);
01073     }
01074     else
01075     {
01076         m_settingsFile = fullname;
01077         loadSettingsInternal(fullname, searchAllPath, this);
01078     }
01079
01080     if( m_foundIt )
01081         m_settingsFile = fullname;
01082
01083     return m_foundIt ? kStopTraversal : kContinueTraversal;
01084 }
01085
01086 static bool GetAllPersistentSettings(std::map<UStr, UStr>& res)
01087 {
01088     UStr settingsDir;
01089     if( !SettingsGetLoc(settingsDir) )
01090         return false;
01091
01092     CFindSettings finder(res);
01093     FileTraverse(settingsDir, finder);
01094
01095     return !res.empty();
01096 }
01097
01098 bool HasPersistentSettings(const char* path)
01099 {
01100     UStr settingsDir;
01101     if( !SettingsGetLoc(settingsDir) )
01102         return false;
01103
01104     CFindSettings finder(path);
01105     FileTraverse(settingsDir, finder);
01106
01107     return !finder.m_settingsFile.empty();
01108 }
01109
01110 static bool _loadPersistentSettings(const char* token, const char* value, void* data)
01111 {
01112     if( strcmp(token, "CVSROOT") == 0 )
01113     {
01114         gCvsPrefs = value;
01115     }
01116     else if( strcmp(token, "AUTHENTICATION") == 0 )
01117     {
01118         gAuthen.setkind(Authen::tokenToKind(value));
01119     }
01120     else if( strcmp(token, "PATH") == 0 )
01121     {
01122     }
01123     else
01124     {
01125         CPersistent::CPersistentEntry* entry = CPersistent::Find(token);
01126         if( entry == 0L )
01127         {
01128             //cvs_err("Persistent value '%s' is not registred\n", token);
01129         }
01130         else
01131         {
01132             if( entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentBool)) )
01133             {
01134                 CPersistentBool* pbool = (CPersistentBool*)entry->fValue;
01135                 if( strcmp(value, "true") == 0 )
01136                     *pbool = true;
01137                 else if( strcmp(value, "false") == 0 )
01138                     *pbool = false;
01139                 else
01140                     cvs_err("Invalid value '%s' for persistent '%s'\n", (const char*)value, entry->fUniqueName);
01141             }
01142             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(CPersistentInt)) )
01143             {
01144                 CPersistentInt* pint = (CPersistentInt*)entry->fValue;
01145                 int aint;
01146                 int check = sscanf(value, "%d", &aint);
01147                 if( check == 1 )
01148                     *pint = aint;
01149                 else
01150                     cvs_err("Invalid value '%s' for persistent '%s'\n", (const char*)value, entry->fUniqueName);
01151             }
01152             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(PCStr)) )
01153             {
01154                 PCStr* pstr = (PCStr*)entry->fValue;
01155                 *pstr = value;
01156             }
01157             else if( entry->fValue->IsKindOf(URUNTIME_CLASS(PCPStr)) )
01158             {
01159                 PCPStr* pstr = (PCPStr*)entry->fValue;
01160                 *pstr = value;
01161             }
01162             else
01163             {
01164                 cvs_err("Unknown persistent value '%s'\n", entry->fUniqueName);
01165             }
01166         }
01167     }
01168
01169     return false;
01170 }
01171
01172 void LoadPersistentSettings(const char* path, bool quiet)
01173 {
01174     UStr settingsDir;
01175     if( !SettingsGetLoc(settingsDir) )
01176         return;
01177
01178     CFindSettings finder(path);
01179     FileTraverse(settingsDir, finder);
01180
01181     if( finder.m_settingsFile.empty() )
01182         return;
01183
01184     if( loadSettingsInternal(finder.m_settingsFile, _loadPersistentSettings, 0L) && !quiet )
01185     {
01186         CColorConsole out;
01187         out << kBold << "Loaded settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01188     }
01189 }
01190
01191 static void SaveAsPersistentSettings(const char* name, const char* path)
01192 {
01193     UStr settingFileName;
01194     if( !SettingsGetLoc(settingFileName) )
01195         return;
01196
01197     if( !settingFileName.empty() && !settingFileName.endsWith(kPathDelimiter) )
01198         settingFileName << kPathDelimiter;
01199
01200     settingFileName << name;
01201     settingFileName << ".txt";
01202
01203     if( CPersistent::SaveAllSettings(settingFileName, path) )
01204     {
01205         CColorConsole out;
01206         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01207     }
01208 }
01209
01210 void AskCreatePersistentSettings(const char* path)
01211 {
01212     UStr settingsDir;
01213     if( !SettingsGetLoc(settingsDir) )
01214         return;
01215
01216     int id = 0;
01217
01218 #ifdef WIN32
01219     id = IDD_SAVESETTINGS;
01220 #endif
01221 #ifdef qMacCvsPP
01222     id = dlg_SaveSettings;
01223 #endif
01224
01225     CFindSettings finder(path);
01226     FileTraverse(settingsDir, finder);
01227
01228     UStr oldName;
01229
01230     if( !finder.m_settingsFile.empty() )
01231     {
01232         getSettingName(finder.m_settingsFile, oldName);
01233     }
01234
01235     USaveSettings* dlg = NEW USaveSettings(path, oldName);
01236
01237 #if qUnix
01238     void* wid;
01239 #   if qGTK
01240     wid = UCreate_SettingsDlg();
01241 #   endif
01242
01243     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01244 #endif
01245
01246     if( dlg->DoModal(id) )
01247     {
01248         UStr name = dlg->m_settingName;
01249         UStr fileToDelete;
01250
01251         if( !name.empty() )
01252         {
01253             if( !oldName.empty() )
01254             {
01255                 if( stricmp(oldName, name) != 0 )
01256                 {
01257                     UStr prompt("The setting '");
01258                     prompt << oldName;
01259                     prompt << "' already points on the same folder. ";
01260                     prompt << "Press 'Delete' if you want to overide this setting ";
01261                     prompt << "(two settings cannot point on the same location).";
01262
01263                     if( CvsAlert(prompt, "Cancel", "Delete") )
01264                     {
01265                         delete dlg;
01266                         return;
01267                     }
01268
01269                     fileToDelete = finder.m_settingsFile;
01270                 }
01271             }
01272
01273             if( !dlg->m_copyFromPath.empty() )
01274                 LoadPersistentSettings(dlg->m_copyFromPath);
01275
01276             SaveAsPersistentSettings(name, path);
01277
01278             if( !fileToDelete.empty() )
01279             {
01280                 if( remove(fileToDelete) != 0 )
01281                     cvs_err("Error while deleting '%s' (error %d)\n", (const char*)fileToDelete, errno);
01282             }
01283         }
01284     }
01285
01286     delete dlg;
01287 }
01288
01289 void SavePersistentSettings(const char* path)
01290 {
01291     UStr settingsDir;
01292     if( !SettingsGetLoc(settingsDir) )
01293         return;
01294
01295     CFindSettings finder(path);
01296     FileTraverse(settingsDir, finder);
01297
01298     if( finder.m_settingsFile.empty() )
01299         return;
01300
01301     if( CPersistent::SaveAllSettings(finder.m_settingsFile, finder.m_topfolder) )
01302     {
01303         CColorConsole out;
01304         out << kBold << "Saved settings for " << kNormal << kUnderline << path << kNormal << kBold << " successfully..." << kNormal << kNL;
01305     }
01306 }
01307
01308 #endif // !qMPWCvs
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 persistent 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 TARGET_OS_MAC
00033 #   include <Files.h>
00034 #endif /* TARGET_OS_MAC */
00035
00036 #if TARGET_OS_MAC
00037 #   define kCVS_prefID 'cprf'
00038 #   define kCVS_prefName "\pMacCvs Prefs"
00039 #endif
00040
00041 #ifdef WIN32
00042
00043 #   define PROFILE_NAME "CVS settings"
00044 #endif /* WIN32 */
00045
00047 #define PERSISTENT_CAST(T) \
00048     inline operator const T&() const {return fValue;} \
00049     inline T& operator=(const T& val) { TouchTimeStamp(); return fValue = val;} \
00050     inline bool operator==(const T& val) const {return fValue == val;}
00051     /* inline const T * operator ->() const {return &fValue;} */ \
00052
00054 typedef enum
00055 {
00056     kNoClass = 0x00,
00057     kAddSettings = 0x01
00058 } kClassPersistent;
00059
00060 class UStr;
00061
00062 // Persistent settings API
00063 void LoadPersistentSettings(const char* path, bool quiet = false);
00064 bool HasPersistentSettings(const char* path);
00065 void AskCreatePersistentSettings(const char* path);
00066 void SavePersistentSettings(const char* path);
00067 bool FormatDefaultSettingsLoc(UStr& path);
00068
00070 class CPersistent : public UObject
00071 {
00072     UDECLARE_DYNAMIC(CPersistent)
00073 public:
00074     CPersistent(const char* uniqueName, kClassPersistent pclass);
00075     virtual ~CPersistent();
00076
00077     virtual unsigned int SizeOf(void) const = 0L;
00078     virtual const void* GetData(void) const = 0L;
00079     virtual void SetData(const void* ptr, unsigned int size) = 0L;
00080         // virtual access
00081
00082     static void SaveAll(void);
00083     static bool LoadAll(const char* only = 0L);
00084         // save/load the registred values
00085         // 'only' can be used to force go load only this persistent value
00086         // form the disk
00087
00088     static bool SaveAllSettings(const char* settingFileName, const char* forPath);
00089         // save all the persistent values with the class 'kAddSettings'
00090
00091     struct CPersistentEntry
00092     {
00093         const char* fUniqueName;
00094         CPersistent* fValue;
00095         kClassPersistent fClass;
00096     };
00097
00098     static CPersistentEntry* Find(const char* uniqueName);
00099
00100     // handle modification flag (see if we really need to save it)
00101     inline void ResetTimeStamp() { fTimeStamp = 0; }
00102     inline long GetTimeStamp() const { return fTimeStamp; }
00103     inline void TouchTimeStamp() { fTimeStamp++; }
00104
00105     static bool NeedSave(bool onlySettings = false);
00106
00107 private:
00108     static void Register(CPersistent* value, const char* uniqueName,
00109         kClassPersistent pclass);
00110     static void UnRegister(CPersistent* value);
00111         // register/unregister a value to store/load
00112
00113 protected:
00114     long fTimeStamp;
00115     static std::vector<CPersistentEntry>* fAllEntries;
00116 };
00117
00119 template <class T>
00120 class CPersistentT : public CPersistent
00121 {
00122 public:
00123     CPersistentT(const char* uniqueName, T defValue, kClassPersistent pclass) : CPersistent(uniqueName, pclass)
00124     {
00125         fValue = fDefValue = defValue;
00126     }
00127
00128     virtual ~CPersistentT()
00129     {
00130     }
00131
00132     PERSISTENT_CAST(T)
00133
00134     virtual unsigned int SizeOf(void) const {return sizeof(T);}
00135     virtual const void* GetData(void) const {return &fValue;}
00136     virtual void SetData(const void* ptr, unsigned int size)
00137     {
00138         if( size == sizeof(T) )
00139             memcpy(&fValue, ptr, size);
00140     }
00141
00142 protected:
00143     T fDefValue, fValue;
00144 };
00145
00147 class CPersistentBool : public CPersistentT<bool>
00148 {
00149     UDECLARE_DYNAMIC(CPersistentBool)
00150 public:
00151     CPersistentBool(const char* uniqueName, bool defValue,
00152         kClassPersistent pclass = kNoClass) :
00153       CPersistentT<bool>(uniqueName, defValue, pclass)
00154     {
00155     }
00156
00157     virtual ~CPersistentBool()
00158     {
00159     }
00160
00161     PERSISTENT_CAST(bool)
00162 };
00163
00165 class CPersistentInt : public CPersistentT<int>
00166 {
00167     UDECLARE_DYNAMIC(CPersistentInt)
00168 public:
00169     CPersistentInt(const char* uniqueName, int defValue,
00170         kClassPersistent pclass = kNoClass) :
00171             CPersistentT<int>(uniqueName, defValue, pclass)
00172     {
00173     }
00174
00175     virtual ~CPersistentInt()
00176     {
00177     }
00178
00179     PERSISTENT_CAST(int)
00180 };
00181
00182 #endif /* PERSISTENT_H */
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


common/ProgressDlg.cpp Source File

common/ProgressDlg.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>
00019  */
00020
00021 // ProgressDlg.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #ifdef WIN32
00027 #   include "wincvs.h"
00028 #endif /* WIN32 */
00029
00030 #include "ProgressDlg.h"
00031 #include "AppConsole.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00040 // CProgress
00041
00042 CProgress::CProgress(bool interruptable, const char* title, kProgressType progressType /*= kProgressBar*/)
00043     : m_abort(false)
00044 {
00045 #ifdef WIN32
00046     m_dlg = new CProgressDlg(m_abort, interruptable, title, progressType);
00047     if( !m_dlg || !m_dlg->Create() )
00048     {
00049         cvs_err("Failed to create Progress dialog\n");
00050
00051         delete m_dlg;
00052         m_dlg = 0L;
00053
00054         return;
00055     }
00056
00057     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00058 #endif /* WIN32 */
00059 }
00060
00061 CProgress::~CProgress()
00062 {
00063 #ifdef WIN32
00064     if( m_dlg != 0L )
00065         m_dlg->DestroyWindow();
00066 #endif /* WIN32 */
00067 }
00068
00073 void CProgress::SetProgress(int percent)
00074 {
00075 #ifdef WIN32
00076     if( m_dlg == 0L )
00077         return;
00078
00079     m_dlg->SetProgress(percent);
00080
00081     if( m_abort )
00082         m_dlg = 0L;
00083 #endif /* WIN32 */
00084 }
00085
00090 void CProgress::SetProgress(const char* text)
00091 {
00092 #ifdef WIN32
00093     if( m_dlg == 0L )
00094         return;
00095
00096     m_dlg->SetProgress(text);
00097
00098     if( m_abort )
00099         m_dlg = 0L;
00100 #endif /* WIN32 */
00101 }
00102
00107 void CProgress::ForceAbort(void)
00108 {
00109 #ifdef WIN32
00110     if( m_dlg != 0L )
00111     {
00112         m_dlg->DestroyWindow();
00113     }
00114
00115     m_dlg = 0L;
00116 #endif /* WIN32 */
00117 }
00118
00119 #ifdef WIN32
00120
00122 // CProgressDlg dialog
00123
00124 CProgressDlg::CProgressDlg(bool& abort, bool interruptable,
00125                            const char* title /*= NULL*/, kProgressType progressType /*= kProgressBar*/,
00126                            CWnd* pParent /*=NULL*/)
00127     : m_abort(abort), m_interruptable(interruptable),
00128     m_title(title), m_progressType(progressType),
00129     m_pParent(pParent), m_hWndParent(0L),
00130     CDialog(CProgressDlg::IDD, pParent)
00131 {
00132     //{{AFX_DATA_INIT(CProgressDlg)
00133     //}}AFX_DATA_INIT
00134 }
00135
00136
00137 void CProgressDlg::DoDataExchange(CDataExchange* pDX)
00138 {
00139     CDialog::DoDataExchange(pDX);
00140     //{{AFX_DATA_MAP(CProgressDlg)
00141     DDX_Control(pDX, IDOK, m_cancelButton);
00142     DDX_Control(pDX, IDC_PROGRESS, m_progressCtrl);
00143     DDX_Control(pDX, IDC_PROGRESS_TEXT, m_progressTextStatic);
00144     //}}AFX_DATA_MAP
00145 }
00146
00147
00148 BEGIN_MESSAGE_MAP(CProgressDlg, CDialog)
00149     //{{AFX_MSG_MAP(CProgressDlg)
00150     //}}AFX_MSG_MAP
00151 END_MESSAGE_MAP()
00152
00153
00154 // CProgressDlg message handlers
00155
00156
00160 BOOL CProgressDlg::Create()
00161 {
00162     m_hWndParent = PreModal();
00163     return CDialog::Create(CProgressDlg::IDD, m_pParent);
00164 }
00165
00167 BOOL CProgressDlg::OnInitDialog()
00168 {
00169     CenterWindow();
00170
00171     CDialog::OnInitDialog();
00172
00173     // Enable/disable controls
00174     m_cancelButton.EnableWindow(m_interruptable);
00175
00176     // Show progress indicator
00177     switch( m_progressType )
00178     {
00179     default:
00180     case kProgressBar:
00181         m_progressTextStatic.ShowWindow(SW_HIDE);
00182         break;
00183     case kProgressText:
00184     case kProgressFile:
00185         m_progressCtrl.ShowWindow(SW_HIDE);
00186
00187         if( kProgressText == m_progressType )
00188         {
00189             m_progressTextStatic.ModifyStyle(0, SS_ENDELLIPSIS);
00190         }
00191         else if( kProgressFile == m_progressType )
00192         {
00193             m_progressTextStatic.ModifyStyle(0, SS_PATHELLIPSIS);
00194         }
00195
00196         break;
00197     }
00198
00199     // Set the window title
00200     if( !m_title.IsEmpty() )
00201     {
00202         SetWindowText(m_title);
00203     }
00204
00205     // Show the main window
00206     ShowWindow(SW_SHOW);
00207
00208     return TRUE;  // return TRUE unless you set the focus to a control
00209 }
00210
00212 void CProgressDlg::OnOK()
00213 {
00214     m_abort = true;
00215     DestroyWindow();
00216 }
00217
00219 void CProgressDlg::PostNcDestroy()
00220 {
00221     MSG msg;
00222     if( m_hWndParent != NULL && ::GetActiveWindow() == m_hWnd )
00223     {
00224         ::SetActiveWindow(m_hWndParent);
00225     }
00226
00227     PostModal();
00228
00229     while( PeekMessage(&msg, m_hWnd, 0, 0, PM_NOREMOVE) == TRUE )
00230     {
00231         AfxGetApp()->PumpMessage();
00232     }
00233
00234     delete this;
00235 }
00236
00241 void CProgressDlg::SetProgress(int percent)
00242 {
00243     m_progressCtrl.SetPos(percent);
00244
00245     CProgressDlg::FlushDisplay(this, m_abort);
00246     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00247 }
00248
00253 void CProgressDlg::SetProgress(const char* text)
00254 {
00255     m_progressTextStatic.SetWindowText(text);
00256
00257     CProgressDlg::FlushDisplay(this, m_abort);
00258     ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
00259 }
00260
00266 void CProgressDlg::FlushDisplay(const CDialog* dlg, const bool& abort)
00267 {
00268     MSG msg;
00269     while( PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_NOREMOVE) == TRUE )
00270     {
00271         AfxGetApp()->PumpMessage();
00272     }
00273
00274     while( PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_NOREMOVE) == TRUE )
00275     {
00276         CPoint pt(LOWORD(msg.lParam), HIWORD(msg.lParam));
00277         ::ClientToScreen(msg.hwnd, &pt);
00278
00279         CWnd* wnd = CWnd::WindowFromPoint(pt);
00280
00281         if( !abort && wnd && dlg && (wnd->GetSafeHwnd() == dlg->GetSafeHwnd() || dlg->IsChild(wnd)) )
00282         {
00283             AfxGetApp()->PumpMessage();
00284         }
00285         else
00286         {
00287             PeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE);
00288         }
00289     }
00290 }
00291
00292 #endif  /* WIN32 */
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


common/ProgressDlg.h Source File

common/ProgressDlg.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>
00019  */
00020
00021 #if !defined(AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_)
00022 #define AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // ProgressDialog.h : header file
00028 //
00029
00031 typedef enum
00032 {
00033     kProgressBar,
00034     kProgressText,
00035     kProgressFile
00036 } kProgressType;
00037
00038 #ifdef WIN32
00039 class CProgressDlg;
00040 #endif /* WIN32 */
00041
00043 // CProgress
00044
00046 class CProgress
00047 {
00048 public:
00049     // Construction
00050     CProgress(bool interruptable, const char* title = 0L, kProgressType progressType = kProgressBar);
00051     virtual ~CProgress();
00052
00053 private:
00054     // Data members
00055     bool m_abort;
00057 #ifdef WIN32
00058     CProgressDlg* m_dlg;
00059 #endif /* WIN32 */
00060
00061     // Methods
00062     void ForceAbort(void);
00063
00064 public:
00065     // Interface
00066
00071     inline bool HasAborted(void) const { return m_abort; }
00072
00073     void SetProgress(int percent);
00074     void SetProgress(const char* text);
00075 };
00076
00077 #ifdef WIN32
00078
00079 // CProgressDlg dialog
00080
00082 class CProgressDlg : public CDialog
00083 {
00084 public:
00085 // Construction
00086     CProgressDlg(bool& abort, bool interruptable,
00087         const char* title = NULL, kProgressType progressType = kProgressBar,
00088         CWnd* pParent = NULL);   // standard constructor
00089
00090 // Dialog Data
00091     //{{AFX_DATA(CProgressDlg)
00092     enum { IDD = IDD_PROGRESS };
00093     CButton m_cancelButton;
00094     CProgressCtrl   m_progressCtrl;
00095     CStatic m_progressTextStatic;
00096     //}}AFX_DATA
00097
00098 // Overrides
00099     // ClassWizard generated virtual function overrides
00100     //{{AFX_VIRTUAL(CProgressDlg)
00101     protected:
00102     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00103     virtual void PostNcDestroy();
00104     //}}AFX_VIRTUAL
00105
00106 // Implementation
00107 protected:
00108
00109     // Generated message map functions
00110     //{{AFX_MSG(CProgressDlg)
00111     virtual BOOL OnInitDialog();
00112     virtual void OnOK();
00113     //}}AFX_MSG
00114     DECLARE_MESSAGE_MAP()
00115 private:
00116     // Data members
00117     bool& m_abort;
00118     bool m_interruptable;
00119     CString m_title;
00120     kProgressType m_progressType;
00122     CWnd* m_pParent;
00123     HWND m_hWndParent;
00125     // Methods
00126     static void FlushDisplay(const CDialog* dlg, const bool& abort);
00127
00128 public:
00129     // Interface
00130     BOOL Create();
00131
00132     void SetProgress(int percent);
00133     void SetProgress(const char* text);
00134 };
00135
00136 //{{AFX_INSERT_LOCATION}}
00137 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00138
00139 #endif  /* WIN32 */
00140
00141 #endif // !defined(AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_)
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
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 /* TARGET_OS_MAC */
00037
00038 #if qMacPP
00039 #   include <UConditionalDialogs.h>
00040 #   include <UNavServicesDialogs.h>
00041 #endif
00042
00043 #ifdef qGTK
00044 #   include <gtk/gtk.h>
00045 #   include <sys/stat.h>
00046 #   include "TextBinary.h"
00047 #endif /* qGTK */
00048
00049 #include "PromptFiles.h"
00050 #include "MultiFiles.h"
00051 #include "AppConsole.h"
00052 #include "CvsCommands.h"
00053 #include "CvsArgs.h"
00054
00055 #ifdef qQT
00056 #   include "qcvsapp.h"
00057 #   include "CPStr.h"
00058 #   include "TextBinary.h"
00059 #   include <qfiledialog.h>
00060 #   include <vector>
00061 #   include <stdlib.h>
00062 #endif /* qQT */
00063
00064 #ifdef WIN32
00065 #include "MfFileDialog.h"
00066
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
00075 #ifdef WIN32
00076 // Open file dialog filter defines
00077 #define FILTER_SEPARATOR    "|"
00078 #define FILTER_EXECUTABLE   "Executable Files (*.exe)" FILTER_SEPARATOR "*.exe"
00079 #define FILTER_ALL          "All Files (*.*)" FILTER_SEPARATOR "*.*"
00080 #define FILTER_END          FILTER_SEPARATOR FILTER_SEPARATOR
00081
00082 #endif
00083
00084
00085 #ifdef TARGET_OS_MAC   //{ Mac - Part
00086 extern "C"
00087 {
00089     static void MacEnumFiles_hook(UFSSpec* newFile, MultiFiles* mf)
00090     {
00091 #if TARGET_RT_MAC_CFM
00092         char cname[64];
00093         p2cstrcpy(cname, newFile->name);
00094         mf->newfile(cname, newFile);
00095 #else
00096         UInt8 utf8path[PATH_MAX];
00097         if( FSRefMakePath(newFile, utf8path, sizeof(utf8path)) == noErr )
00098         {
00099             UStr uppath, cname;
00100             SplitPath(utf8_to_posix(utf8path), uppath, cname);
00101             mf->newfile(cname, newFile);
00102         }
00103 #endif
00104     }
00105 }
00106 #endif  //{ TARGET_OS_MAC
00107
00108 #ifdef qQT  //{ QT - Part
00109
00110 extern "C"
00111 {
00112     static int compareCStr(const CStr *s1, const CStr *s2)
00113     {
00114         return strcmp(*s1, *s2);
00115     }
00116 }
00117
00118 #endif //} qQT
00119
00120
00121 #ifdef qGTK  //{ GTK - Part
00122 static CStr gtksel;
00123 static bool gtkModalLoop;
00124
00125 static gint gtkcancel(GtkWidget *widget, gpointer data)
00126 {
00127     gtkModalLoop = false;
00128     return TRUE;
00129 }
00130
00131 static void file_ok_sel (GtkWidget *w, gpointer data)
00132 {
00133     gtkModalLoop = false;
00134     gtksel = gtk_file_selection_get_filename(GTK_FILE_SELECTION (data));
00135 }
00136
00137 static void file_cancel_sel (GtkWidget *w, gpointer data)
00138 {
00139     gtkModalLoop = false;
00140 }
00141
00142 static void fileop_c_dir_sel (GtkWidget *w, gpointer data)
00143 {
00144     GtkWidget *dialog     = GTK_FILE_SELECTION (GTK_WIDGET (data))->fileop_dialog;
00145
00146     gtk_grab_add (dialog);
00147
00148     // remove grab from fileselection dialog
00149     gtk_grab_remove (GTK_WIDGET (data));
00150     fprintf(stderr, "fileop_c_dir open\n");
00151 }
00152 #endif //}  qGTK
00153
00161 bool BrowserGetDirectory(const char* prompt, CStr& dir, CWnd* pParentWnd /*= NULL*/)
00162 {
00163     bool result = false;
00164
00165 #ifdef WIN32  //{ Win32 - Part
00166     CCJShell m_shell;
00167     m_shell.m_strTitle = prompt;
00168     m_shell.m_strSelDir = dir;
00169
00170     if( m_shell.BrowseForFolder(pParentWnd != 0L ? pParentWnd : AfxGetMainWnd()) )
00171     {
00172         dir = m_shell.m_strPath;
00173         result = true;
00174     }
00175 #endif //{ WIN32
00176
00177 #ifdef TARGET_OS_MAC   //{ Mac - Part
00178
00179 #   if qMacPP
00180 #       if !qCarbon
00181     if(UConditionalDialogs::UseNavServices())
00182 #       else
00183         if(1)
00184 #       endif
00185         {
00186             UNavServicesDialogs::LFileChooser chooser;
00187
00188             FSSpec folderReply;
00189             SInt32 outFolderDirID;
00190             if( chooser.AskChooseFolder(folderReply, outFolderDirID) )
00191             {
00192                 GUSIFileSpec dirSpec(folderReply);
00193                 dir = dirSpec.FullPath();
00194                 result = true;
00195             }
00196         }
00197 #   endif
00198 #   if !qCarbon
00199         FSSpec folderReply;
00200         Point apt = {-1, -1};
00201         Str255 pprompt;
00202
00203         strcpy((char*)pprompt, prompt);
00204         c2pstr((char*)pprompt);
00205         if( SF_PromptForFolder(apt, pprompt, &folderReply) )
00206         {
00207             GUSIFileSpec spec = folderReply;
00208             if( spec.Error() == noErr )
00209             {
00210                 dir = spec.FullPath();
00211                 result = true;
00212             }
00213             else
00214             {
00215                 cvs_err("MacCvs: Unable to convert path name\n");
00216             }
00217         }
00218 #   endif
00219
00220 #endif  //{ TARGET_OS_MAC
00221
00222 #ifdef qQT  //{ QT - Part
00223     QFileDialog::Mode mode = QFileDialog::Directory;
00224     QString start(QDir::currentDirPath());
00225     QString filter("*");
00226     QString caption(prompt);
00227
00228     QFileDialog fd(start, filter, 0, 0L, TRUE);
00229     fd.setMode(mode);
00230     fd.setCaption(caption);
00231     fd.setSelection(start);
00232     if( fd.exec() == QDialog::Accepted )
00233     {
00234         dir = fd.dirPath();
00235         result = true;
00236     }
00237 #endif //} qQT
00238
00239 #ifdef qGTK  //{ GTK - Part
00240     /* Create a new file selection widget */
00241     GtkWidget* filew = gtk_file_selection_new (prompt);
00242
00243     gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00244                        GTK_SIGNAL_FUNC(gtkcancel), 0L);
00245
00246     /* Connect the ok_button to file_ok_sel function */
00247     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00248                       "clicked", (GtkSignalFunc) file_ok_sel, filew);
00249     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00250                       "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00251     //{ WORKAROUND  Bug #440874
00252     // call 'fileop_c_dir_sel' when file options selected
00253     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->fileop_c_dir),
00254                       "clicked", (GtkSignalFunc) fileop_c_dir_sel, filew);
00255     //}  WORKAROUND  Bug #440874
00256
00257     gtkModalLoop = true;
00258     gtksel = "";
00259     gtk_widget_show(filew);
00260     //{ WORKAROUND Bug 440874: blocks keyboard in create dialog if uncommented
00261     gtk_grab_add(filew);
00262     //} WORKAROUND Bug 440874
00263     while( gtkModalLoop )
00264     {
00265         gtk_main_iteration_do(TRUE);
00266     }
00267
00268     //{ WORKAROUND Bug 440874: blocks keyboard in create dialog if uncommented
00269     gtk_grab_remove (filew);
00270     //} BWORKAROUND Bug 440874
00271
00272     gtk_widget_destroy(filew);
00273
00274     if( !gtksel.empty() )
00275     {
00276         static CStr fname;
00277
00278         fname = gtksel;
00279         if( !fname.empty() )
00280         {
00281             struct stat sb;
00282             if( stat(fname, &sb) != -1 && S_ISREG(sb.st_mode) )
00283             {
00284                 CStr uppath, file;
00285                 SplitPath(fname, uppath, file);
00286                 fname = uppath;
00287             }
00288
00289             if( fname.endsWith(kPathDelimiter) )
00290                 fname[fname.length() - 1] = '\0';
00291
00292             dir = fname;
00293             result = true;
00294         }
00295     }
00296 #endif //}  qGTK
00297
00298     return result;
00299 }
00300
00309 bool BrowserGetMultiFiles(const char* prompt, MultiFiles& mf, bool single,
00310                           const kFilesSelectionType selectionType /*= kSelectAny*/)
00311 {
00312     bool result = false;
00313
00314     // Extract the directory and file to select
00315     CStr selDir;    // Directory to be initially selected (browse starting from that directory)
00316     CStr selFile;   // File to be initially selected
00317
00318     // Check the passed file/directory
00319     if( mf.TotalNumFiles() > 0 )
00320     {
00321         MultiFiles::const_iterator mfi = mf.begin();
00322         if( mfi != mf.end() )
00323         {
00324             CvsArgs args(false);
00325             selDir = mfi->add(args);
00326
00327             // Single file passed - we can select it
00328             if( mf.TotalNumFiles() == 1 )
00329             {
00330                 CStr path;
00331                 CStr fileName;
00332                 CStr currRev;
00333
00334                 if( mfi->get(0, path, fileName, currRev) )
00335                 {
00336                     selFile = fileName;
00337                 }
00338             }
00339         }
00340     }
00341
00342     // Clear the selection object
00343     mf.reset();
00344
00345 #ifdef WIN32  //{ Win32 - Part
00346     const char* lpszFilter = FILTER_ALL FILTER_END;
00347     if( selectionType == kSelectExecutable )
00348     {
00349         lpszFilter = FILTER_EXECUTABLE FILTER_SEPARATOR FILTER_ALL FILTER_END;
00350     }
00351
00352     if( selDir.empty() )
00353     {
00354         // No selection specified, use current directory
00355         TCHAR curDir[_MAX_PATH] = { 0 };
00356         GetCurrentDirectory(_MAX_PATH-1, curDir);
00357         selDir = curDir;
00358     }
00359
00360     DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |  OFN_FILEMUSTEXIST;
00361     if( !single )
00362     {
00363         dwFlags |= OFN_ALLOWMULTISELECT;
00364     }
00365
00366     CMfFileDialog mfFileDialog(mf, NULL, selFile.c_str(), dwFlags, lpszFilter);
00367
00368     mfFileDialog.m_ofn.lpstrTitle = prompt;
00369     mfFileDialog.m_ofn.lpstrInitialDir = selDir.c_str();
00370
00371     if( mfFileDialog.DoModal() == IDOK )
00372     {
00373         result = true;
00374     }
00375 #endif //{ WIN32
00376
00377 #ifdef TARGET_OS_MAC   //{ Mac - Part
00378     Point apt = {-1, -1};
00379     Str255 pprompt;
00380
00381     c2pstrcpy(pprompt, prompt);
00382
00383     if(!SF_PromptForMFiles(apt, pprompt))
00384         return false;
00385
00386     SF_PFMF_INFO info;
00387     UFSSpec dirSpec;
00388
00389     SF_PFMF_BeginTraversal(&info);
00390     while( 1 )
00391     {
00392         if( !SF_PFMF_GetCurrentDir(&info, &dirSpec) )
00393             break;
00394
00395         char aPath[255];
00396         GUSIFileSpec spec = dirSpec;
00397         strcpy(aPath, spec.FullPath());
00398         if( spec.Error() == noErr )
00399         {
00400             mf.newdir(aPath);
00401
00402             if( SF_PFMF_DoTraversal(&info, true, (SF_PFMF_HOOK)MacEnumFiles_hook, &mf) )
00403             {
00404                 result = true;
00405             }
00406         }
00407         else
00408         {
00409             cvs_err("MacCvs: Unable to convert path name\n");
00410         }
00411
00412     }
00413     SF_PFMF_EndTraversal(&info);
00414
00415 #endif  //{ TARGET_OS_MAC
00416
00417 #ifdef qQT  //{ QT - Part
00418     QStringList s = QFileDialog::getOpenFileNames();
00419     vector<CStr> allpaths;
00420     QStringList::Iterator f;
00421     for(f = s.begin(); f != s.end(); f++)
00422     {
00423         allpaths.push_back(CStr(*f));
00424     }
00425
00426     if( allpaths.size() > 0 )
00427     {
00428         qsort(&allpaths[0], allpaths.size(), sizeof(CStr), (int(*)(const void*, const void*))compareCStr);
00429
00430         vector<CStr>::const_iterator i;
00431         CStr uppath, file, oldpath;
00432         for(i = allpaths.begin(); i != allpaths.end(); ++i)
00433         {
00434             SplitPath(*i, uppath, file);
00435             if( strcmp(uppath, oldpath) != 0 )
00436                 mf.newdir(uppath);
00437
00438             oldpath = uppath;
00439             mf.newfile(file);
00440         }
00441
00442         result = true;
00443     }
00444 #endif //} qQT
00445
00446 #ifdef qGTK  //{ GTK - Part
00447     /* Create a new file selection widget */
00448     GtkWidget* filew = gtk_file_selection_new(prompt);
00449
00450     gtk_signal_connect(GTK_OBJECT(filew), "delete_event",
00451         GTK_SIGNAL_FUNC(gtkcancel), 0L);
00452
00453     /* Connect the ok_button to file_ok_sel function */
00454     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->ok_button),
00455         "clicked", (GtkSignalFunc) file_ok_sel, filew);
00456     gtk_signal_connect(GTK_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button),
00457         "clicked", (GtkSignalFunc) file_cancel_sel, filew);
00458
00459     gtkModalLoop = true;
00460     gtksel = "";
00461     gtk_widget_show(filew);
00462
00463     //{ WORKAROUND Bug 440874: Directory creation is not necessary in this file selection box
00464     gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(filew));
00465     //{ WORKAROUND Bug 440874
00466
00467     gtk_grab_add(filew);
00468     while( gtkModalLoop )
00469     {
00470         gtk_main_iteration_do(TRUE);
00471     }
00472
00473     gtk_grab_remove (filew);
00474     gtk_widget_destroy(filew);
00475
00476     if( !gtksel.empty() )
00477     {
00478         CStr fname = gtksel;
00479         if( !fname.empty() )
00480         {
00481             CStr uppath, file;
00482             SplitPath(fname, uppath, file);
00483             mf.newdir(uppath);
00484             mf.newfile(file);
00485
00486             result = true;
00487         }
00488     }
00489 #endif //}  qGTK
00490
00491     return result;
00492 }
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 --- functions to pick set of files and folder
00023  */
00024
00025 #ifndef PROMPTFILES_H
00026 #define PROMPTFILES_H
00027
00028 class MultiFiles;
00029 class CStr;
00030 class CWnd;
00031
00033 typedef enum
00034 {
00035     kSelectAny,
00036     kSelectExecutable
00037 } kFilesSelectionType;
00038
00039 bool BrowserGetDirectory(const char* prompt, CStr& dir, CWnd* pParentWnd = NULL);
00040 bool BrowserGetMultiFiles(const char* prompt, MultiFiles& mf, bool single,
00041                           const kFilesSelectionType selectionType = kSelectAny);
00042
00043 #endif /* PROMPTFILES_H */
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 !defined(USE_PYTHON)
00025 #   define USE_PYTHON 1
00026 #endif
00027
00028 #if defined(WIN32) && !qCvsDebug /* || qCarbon */
00029     // force to not import Python
00030 #   define USE_DL_EXPORT
00031 #endif
00032
00033 #if USE_PYTHON
00034 #include <Python.h>
00035 #if TARGET_RT_MAC_CFM
00036 #   include <macglue.h>
00037 #endif
00038 #include <exception>
00039 #include <vector>
00040 #include "PythonMacros.h"
00041 #include "PythonGlue.impl.h"
00042
00043 typedef void (*PyRegistry_InitValues)(PyObject *d);
00044
00045 /*
00046  * Each C++ for Python has a registry which help us registring
00047  * the object to Python
00048  */
00049
00050 class PyRegistry
00051 {
00052 public:
00053     PyRegistry(const char *name, size_t size, destructor d, getattrfunc g,
00054         PyRegistry_InitValues v, PyCFunction c, const char *doc);
00055     ~PyRegistry();
00056
00057     PyTypeObject m_type;
00058
00059     static void RegisterAllObjects(std::vector<PyMethodDef> & methods);
00060         // initialize each wrapper class and return a method table
00061         // for the module
00062
00063     static void CallInitValues(PyObject *dict);
00064         // give a chance for each container to make some registrations
00065
00066 protected:
00067     PyRegistry *m_next;
00068     PyRegistry_InitValues m_v;
00069     PyCFunction m_c;
00070     const char *m_doc;
00071
00072     static PyRegistry *m_all;
00073 };
00074
00075 /*
00076  * Base for a C++ container wrapper
00077  */
00078
00079 class PyContainer
00080 {
00081 public:
00082     PyContainer() {}
00083     virtual ~PyContainer() {}
00084
00085     virtual PyObject *GetAttr(char *name) { return NULL; }
00086         // overide to implement attributes
00087
00088     static PyObject *True() { Py_INCREF(GetPyTrue()); return GetPyTrue(); }
00089     static PyObject *False() { Py_INCREF(GetPyFalse()); return GetPyFalse(); }
00090     static PyObject *Void() { Py_INCREF(GetPyNone()); return GetPyNone(); }
00091         // goodies for returning void or boolean to python
00092
00093     static void RegisterValue(PyObject *d, char *name, int value);
00094         // register a single constant value in the module dictionary
00095 };
00096
00097 // smart pointer for python PyObject
00098 template <class T>
00099 class PyAutoObject
00100 {
00101 public:
00102     inline PyAutoObject() : m_o(NULL)
00103     {
00104     }
00105
00106     inline PyAutoObject(T *o) : m_o(o)
00107     {
00108         Ref();
00109     }
00110
00111     inline PyAutoObject(PyObject *o) : m_o((T *)o)
00112     {
00113         Ref();
00114     }
00115
00116     inline PyAutoObject(PyAutoObject & obj) : m_o((T *)obj.CopyReturn())
00117     {
00118     }
00119
00120     inline operator T*() const  { return m_o; }
00121
00122     inline ~PyAutoObject()
00123     {
00124         UnRef();
00125     }
00126
00127     inline PyAutoObject & operator=(T *o)
00128     {
00129         UnRef();
00130         m_o = o;
00131         Ref();
00132         return *this;
00133     }
00134
00135     inline PyAutoObject & operator=(PyObject *o)
00136     {
00137         UnRef();
00138         m_o = (T *)o;
00139         Ref();
00140         return *this;
00141     }
00142
00143     inline PyAutoObject & operator=(PyAutoObject & obj)
00144     {
00145         UnRef();
00146         m_o = (T *)obj.CopyReturn();
00147         return *this;
00148     }
00149
00150     inline PyObject *CopyReturn(void)
00151     {
00152         Ref();
00153         return (PyObject *)m_o;
00154     }
00155
00156     inline bool IsValid(void)
00157     {
00158         return m_o != 0L;
00159     }
00160
00161     inline T *operator->(void)
00162     {
00163         return m_o;
00164     }
00165
00166 protected:
00167     inline void Ref(void)
00168     {
00169         if(m_o)
00170             Py_INCREF(m_o);
00171     }
00172
00173     inline void UnRef(void)
00174     {
00175         if(m_o)
00176         {
00177             Py_DECREF(m_o);
00178             m_o = NULL;
00179         }
00180     }
00181
00182     T *m_o;
00183 };
00184
00185 extern PyObject *gCvsguiErr;
00186 #endif // USE_PYTHON
00187
00188 #endif
Generated on Fri Jan 31 12:08:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 <osdefs.h>
00057 #endif
00058
00059 #if qMacCvsPP
00060 #   include "MacCvsApp.h"
00061 #   include "MacCvsConstant.h"
00062 #   include "MacMisc.h"
00063 #endif
00064
00065 #if qCarbon
00066 #   include "TclGlue.mac.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 TARGET_RT_MAC_MACHO
00083 #   define CompatLoadLibrary CarbonCompatLoadLibrary
00084 #   define CompatCloseLibrary CarbonCompatCloseLibrary
00085 #   define _CompatCallLibrary _CarbonCompatCallLibrary
00086 #endif
00087
00088 #if USE_PYTHON
00089
00090 PyThreadState *CPython_Interp::m_mainInterpreter = 0L;
00091 static bool gUICacheValid = false;
00092 static std::vector<ENTNODE> gUICache;
00093 static PyObject *gUICacheObj = NULL;
00094
00095 class CPyThreadState
00096 {
00097 public:
00098     CPyThreadState(PyThreadState *p) : m_p(p)
00099     {
00100         m_p = PyThreadState_Swap(p);
00101     }
00102     ~CPyThreadState()
00103     {
00104         PyThreadState_Swap(m_p);
00105     }
00106 protected:
00107     PyThreadState *m_p;
00108 };
00109
00110 enum
00111 {
00112     _stdout_style = 15,
00113     _stderr_style = 16,
00114     _trace_style = 17
00115 };
00116
00117 static PyObject *cvsgui_write(PyObject *self, PyObject *args)
00118 {
00119     char *str;
00120     int style;
00121     PyObject *shell;
00122
00123     if(!PyArg_ParseTuple(args, "siO", &str, &style, &shell))
00124         return NULL;
00125
00126     TRY
00127     {
00128         if(style == _stdout_style)
00129             cvs_outstr(str, strlen(str));
00130         else
00131             cvs_errstr(str, strlen(str));
00132     }
00133     CATCH_ALL(e)
00134     {
00135         PyHandleCvsguiError(e);
00136         return NULL;
00137     }
00138     END_CATCH_ALL
00139
00140     return PyContainer::Void();
00141 }
00142
00143 static PyObject *cvsgui_GetMainMenuWidget(PyObject *self, PyObject *args)
00144 {
00145     int res = 0;
00146
00147     if(!PyArg_ParseTuple(args, ""))
00148         return NULL;
00149
00150     TRY
00151     {
00152     }
00153     CATCH_ALL(e)
00154     {
00155         PyHandleCvsguiError(e);
00156         return NULL;
00157     }
00158     END_CATCH_ALL
00159
00160     return PyInt_FromLong(res);
00161 }
00162
00163 static PyObject *cvsgui_GetTopMacroSelectionMenu(PyObject *self, PyObject *args)
00164 {
00165     static UMENU macroMenu = 0L;
00166
00167     if(!PyArg_ParseTuple(args, ""))
00168         return NULL;
00169
00170     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00171     if (!res.IsValid())
00172         return NULL;
00173
00174     TRY
00175     {
00176 #ifdef WIN32
00177         int pos;
00178         if(macroMenu == 0L)
00179         {
00180             CMenu *top = GetMenuEntry(ID_MACRO_SEL, pos);
00181             if(top)
00182             {
00183                 top->DeleteMenu(pos, MF_BYPOSITION);
00184                 macroMenu = (UMENU)(HMENU)*top;
00185             }
00186         }
00187 #endif
00188 #if qMacCvsPP
00189         if(macroMenu == 0L)
00190         {
00191             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00192             LMenu *menu = menuBar->FetchMenu(menu_MacroSel);
00193             if(menu)
00194                 macroMenu = menu->GetMenuID();
00195         }
00196 #endif
00197
00198         res->m_object = new PyMenuMgr(macroMenu);
00199     }
00200     CATCH_ALL(e)
00201     {
00202         PyHandleCvsguiError(e);
00203         return NULL;
00204     }
00205     END_CATCH_ALL
00206
00207     return res.CopyReturn();
00208 }
00209
00210 static PyObject *cvsgui_GetTopMacroAdminMenu(PyObject *self, PyObject *args)
00211 {
00212     static UMENU macroMenu = 0L;
00213
00214     if(!PyArg_ParseTuple(args, ""))
00215         return NULL;
00216
00217     PyAutoObject<PyMenuMgr::obj_t> res = PyMenuMgr::New();
00218     if (!res.IsValid())
00219         return NULL;
00220
00221     TRY
00222     {
00223 #ifdef WIN32
00224         int pos;
00225         if(macroMenu == 0L)
00226         {
00227             CMenu *top = GetMenuEntry(ID_MACRO_ADMIN, pos);
00228             if(top)
00229             {
00230                 top->DeleteMenu(pos, MF_BYPOSITION);
00231                 macroMenu = (UMENU)(HMENU)*top;
00232             }
00233         }
00234 #endif
00235 #if qMacCvsPP
00236         if(macroMenu == 0L)
00237         {
00238             LMenuBar *menuBar   = LMenuBar::GetCurrentMenuBar();
00239             LMenu *menu = menuBar->FetchMenu(menu_MacroAdmin);
00240             if(menu)
00241                 macroMenu = menu->GetMenuID();
00242         }
00243 #endif
00244         res->m_object = new PyMenuMgr(macroMenu);
00245     }
00246     CATCH_ALL(e)
00247     {
00248         PyHandleCvsguiError(e);
00249         return NULL;
00250     }
00251     END_CATCH_ALL
00252
00253     return res.CopyReturn();
00254 }
00255
00256 static PyObject *cvsgui_GetSelection(PyObject *self, PyObject *args)
00257 {
00258     if(!PyArg_ParseTuple(args, ""))
00259         return NULL;
00260
00261     if(gUICacheObj != 0L)
00262     {
00263         Py_INCREF(gUICacheObj);
00264         return gUICacheObj;
00265     }
00266
00267     gUICacheObj = PyTuple_New(gUICache.size());
00268     if(gUICacheObj == NULL)
00269         return NULL;
00270
00271     std::vector<ENTNODE>::const_iterator i;
00272     int cnt;
00273     for(cnt = 0, i = gUICache.begin(); i != gUICache.end(); ++i, ++cnt)
00274     {
00275         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00276         if (!res.IsValid())
00277             return NULL;
00278
00279         res->m_object = new PyCvsEntry(*i);
00280
00281         PyTuple_SET_ITEM(gUICacheObj, cnt, res.CopyReturn());
00282     }
00283
00284     Py_INCREF(gUICacheObj);
00285     return gUICacheObj;
00286 }
00287
00288 class CFillPyEntries : public TraversalReport
00289 {
00290 public:
00291     CSortList<ENTNODE> & m_entries;
00292     std::vector<CStr> m_ignlist;
00293
00294     CFillPyEntries(CSortList<ENTNODE> & entries) :
00295         m_entries(entries) {}
00296
00297     virtual ~CFillPyEntries() {}
00298
00299     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const UFSSpec * macspec)
00300     {
00301         Entries_Open (m_entries, fullpath);
00302         BuildIgnoredList(m_ignlist, fullpath);
00303         return kContinueTraversal;
00304     }
00305
00306     virtual kTraversal ExitDirectory(const char *fullpath)
00307     {
00308         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00309         return kContinueTraversal;
00310     }
00311
00312     virtual kTraversal OnError(const char *err, int errcode)
00313     {
00314         return kTraversalError;
00315     }
00316
00317     virtual kTraversal OnIdle(const char *fullpath)
00318     {
00319         return kContinueTraversal;
00320     }
00321
00322     virtual kTraversal OnDirectory(const char *fullpath,
00323         const char *fullname,
00324         const char *name,
00325         const struct stat & dir, const UFSSpec * macspec)
00326     {
00327 #if defined(WIN32) || defined(TARGET_OS_MAC)
00328         if(stricmp(name, "CVS") == 0)
00329 #else
00330         if(strcmp(name, "CVS") == 0)
00331 #endif
00332             return kSkipFile;
00333
00334         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00335
00336         return kSkipFile;
00337     }
00338
00339     virtual kTraversal OnAlias(const char *fullpath,
00340         const char *fullname,
00341         const char *name,
00342         const struct stat & dir, const UFSSpec * macspec)
00343     {
00344         return OnFile(fullpath, fullname, name, dir, macspec);
00345     }
00346
00347     virtual kTraversal OnFile(const char *fullpath,
00348         const char *fullname,
00349         const char *name,
00350         const struct stat & dir, const UFSSpec * macspec)
00351     {
00352         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00353
00354         return kContinueTraversal;
00355     }
00356 };
00357
00358 static PyObject *cvsgui_GetCvsEntries(PyObject *self, PyObject *args)
00359 {
00360     char *path;
00361
00362     if(!PyArg_ParseTuple(args, "s", &path))
00363         return NULL;
00364
00365     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00366     CFillPyEntries traverse(entries);
00367     /*kTraversal res = */FileTraverse(path, traverse);
00368
00369     // add the missing files
00370     Entries_SetMissing(entries);
00371
00372     int numEntries = entries.NumOfElements();
00373     PyObject *obj = PyTuple_New(numEntries);
00374     if(obj == NULL)
00375         return NULL;
00376
00377     for(int i = 0; i < numEntries; i++)
00378     {
00379         const ENTNODE & theNode = entries.Get(i);
00380         EntnodeData *data = theNode.Data();
00381
00382         PyAutoObject<PyCvsEntry::obj_t> res = PyCvsEntry::New();
00383         if (!res.IsValid())
00384             return NULL;
00385
00386         res->m_object = new PyCvsEntry(data);
00387
00388         PyTuple_SET_ITEM(obj, i, res.CopyReturn());
00389     }
00390
00391     return obj;
00392 }
00393
00394 #if defined(WIN32)
00395 //
00396 // Get correct (UTC) file modification time.
00397 // Used for dealing with notorious DST bug.
00398 //
00399 static PyObject * cvsgui_GetFileModTime(PyObject *self, PyObject *args)
00400 {
00401     struct wnt_stat sb;
00402     struct tm * p_utc = NULL;
00403
00404     const char *path;
00405
00406 // PyObject_Length exists only for debugging version (ActiveState Python 2.1)
00407 #if defined(_DEBUG)
00408     int len = PyObject_Length(args);
00409     if (len < 1)
00410     {
00411         char errstr[255];
00412         sprintf(errstr, "Too few arguments (%d, expected 1)", len);
00413         PyErr_SetString(gCvsguiErr, errstr);
00414         return NULL;
00415     }
00416     else if (len > 1)
00417     {
00418         char errstr[255];
00419         sprintf(errstr, "Too many arguments (%d, expected 1)", len);
00420         PyErr_SetString(gCvsguiErr, errstr);
00421         return NULL;
00422     }
00423 #endif
00424
00425     if(!PyArg_ParseTuple(args, "s", &path))
00426         return NULL;
00427
00428     if (wnt_stat(path, &sb) != 0)
00429     {
00430         char errstr[255];
00431         sprintf(errstr, "Could not find file \"%s\"", path);
00432         PyErr_SetString(gCvsguiErr, errstr);
00433         return NULL;
00434     }
00435
00436     p_utc = gmtime(& sb.st_mtime);
00437     return Py_BuildValue("s", asctime(p_utc));
00438 }
00439 #endif  // defined(_WIN32)
00440
00441 static PyObject *cvsgui_LaunchTclMacro(PyObject *self, PyObject *args)
00442 {
00443     char *macroName;
00444
00445     if(!PyArg_ParseTuple(args, "s", &macroName) || !CTcl_Interp::IsAvail())
00446         return NULL;
00447
00448     std::vector<ENTNODE>::const_iterator i;
00449     TclBrowserReset();
00450     for(i = gUICache.begin(); i != gUICache.end(); ++i)
00451     {
00452         EntnodeData *data = *i;
00453         TclBrowserAppend((*data)[EntnodeData::kPath], data);
00454     }
00455
00456     CTcl_Interp interp;
00457     CStr path = macroName;
00458     CTcl_Interp::Unixfy(path);
00459     interp.DoScriptVar("source \"%s\"", (const char *)path);
00460
00461     return PyContainer::Void();
00462 }
00463
00464 class CBuffer
00465 {
00466 public:
00467     CBuffer() : m_curSize(0)
00468     {
00469     }
00470
00471     void append(const char *ptr, size_t s)
00472     {
00473         if((s + m_curSize) > m_buf.size())
00474         {
00475             size_t step = s > 1024 ? s : 1024;
00476             m_buf.AdjustSize(m_buf.size() + step);
00477         }
00478 #ifdef WIN32
00479         char *tmp = (char *)m_buf + m_curSize;
00480         size_t incs = 0;
00481         while(s--)
00482         {
00483             char c = *ptr++;
00484             if(c == '\r')
00485                 continue;
00486             *tmp++ = c;
00487             incs++;
00488         }
00489         m_curSize += incs;
00490 #elif defined(TARGET_OS_MAC)
00491         char *tmp = (char *)m_buf + m_curSize;
00492         size_t cnt = s;
00493         while(cnt--)
00494         {
00495             char c = *ptr++;
00496             if(c == '\r')
00497                 c = '\n';
00498             *tmp++ = c;
00499         }
00500         m_curSize += s;
00501 #else
00502         memcpy((char *)m_buf + m_curSize, ptr, s * sizeof(char));
00503         m_curSize += s;
00504 #endif
00505     }
00506
00507     inline size_t size() const { return m_curSize; }
00508     inline operator char *(void) const { return m_buf; }
00509
00510 protected:
00511     size_t m_curSize;
00512     CStaticAllocT<char> m_buf;
00513 };
00514
00515 class CPyCvsConsole : public CCvsConsole
00516 {
00517 public:
00518     CPyCvsConsole() {}
00519     virtual ~CPyCvsConsole() {}
00520
00521     virtual long cvs_out(char *txt, long len)
00522     {
00523         m_out.append(txt, len);
00524         return len;
00525     }
00526
00527     virtual long cvs_err(char *txt, long len)
00528     {
00529         m_err.append(txt, len);
00530         return len;
00531     }
00532
00533     CBuffer m_out;
00534     CBuffer m_err;
00535 };
00536
00537 static PyObject *cvsgui_PromptMessage(PyObject *self, PyObject *args)
00538 {
00539     char *msg, *title, *ok, *cncl;
00540
00541     if(!PyArg_ParseTuple(args, "ssss", &msg, &title, &ok, &cncl))
00542         return NULL;
00543
00544     bool res;
00545
00546     TRY
00547     {
00548         res = PromptMessage(msg, title, ok, cncl);
00549     }
00550     CATCH_ALL(e)
00551     {
00552         PyHandleCvsguiError(e);
00553         return NULL;
00554     }
00555     END_CATCH_ALL
00556
00557     if(res)
00558     {
00559         return PyContainer::True();
00560     }
00561
00562     return PyContainer::False();
00563 }
00564
00565 static PyObject *cvsgui_PromptEditMessage(PyObject *self, PyObject *args)
00566 {
00567     char *msg, *title, *ok, *cncl, *edit;
00568
00569     if(!PyArg_ParseTuple(args, "sssss", &msg, &edit, &title, &ok, &cncl))
00570         return NULL;
00571
00572     bool res;
00573     UStr ed;
00574
00575     TRY
00576     {
00577         ed = edit;
00578         res = PromptEditMessage(msg, ed, title, ok, cncl);
00579     }
00580     CATCH_ALL(e)
00581     {
00582         PyHandleCvsguiError(e);
00583         return NULL;
00584     }
00585     END_CATCH_ALL
00586
00587     return Py_BuildValue("(is)", res ? 1 : 0, ed.empty() ? "" : ed.c_str());
00588 }
00589
00590 static PyObject *cvsgui_LaunchBrowser(PyObject *self, PyObject *args)
00591 {
00592     char *url;
00593
00594     if(!PyArg_ParseTuple(args, "s", &url))
00595         return NULL;
00596
00597 #ifdef WIN32
00598     ShellExecute(NULL, "open", url, /*postData*/0L, NULL, SW_SHOWNORMAL);
00599 #endif
00600
00601     return PyContainer::Void();
00602 }
00603
00604 static void outputXML(FILE *out, CLogNode *node)
00605 {
00606     switch(node->GetType())
00607     {
00608         case kNodeHeader :
00609         {
00610             fputs("<RCS>\n", out);
00611             const CRcsFile rcs = **(CLogNodeHeader *)node;
00612             fprintf(out, "<RCSFILE>%s</RCSFILE>\n", rcs.RcsFile().c_str());
00613             fprintf(out, "<WORKINGFILE>%s</WORKINGFILE>\n", rcs.WorkingFile().c_str());
00614             fprintf(out, "<HEADREV>%s</HEADREV>\n", rcs.HeadRev().c_str());
00615             fprintf(out, "<BRANCHREV>%s</BRANCHREV>\n", rcs.BranchRev().c_str());
00616             fprintf(out, "<KEYWORDSUBST>%s</KEYWORDSUBST>\n", rcs.KeywordSubst().c_str());
00617             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rcs.DescLog().c_str());
00618             fprintf(out, "<SELREVISIONS>%d</SELREVISIONS>\n", rcs.SelRevisions());
00619             fprintf(out, "<TOTREVISIONS>%d</TOTREVISIONS>\n", rcs.TotRevisions());
00620             fprintf(out, "<LOCKSTRICT>%d</LOCKSTRICT>\n", rcs.LockStrict() ? 1 : 0);
00621
00622             fputs("<ACCESSLIST>\n", out);
00623             const std::vector<CLogStr> & ac = rcs.AccessList();
00624             std::vector<CLogStr>::const_iterator i;
00625             for(i = ac.begin(); i != ac.end(); ++i)
00626             {
00627                 fprintf(out, "<ACCESS>%s</ACCESS>\n", (*i).c_str());
00628             }
00629             fputs("</ACCESSLIST>\n", out);
00630
00631             fputs("<SYMBOLICLIST>\n", out);
00632             const std::vector<CRevNumber> & sy = rcs.SymbolicList();
00633             std::vector<CRevNumber>::const_iterator j;
00634             for(j = sy.begin(); j != sy.end(); ++j)
00635             {
00636                 fprintf(out, "<SYMBOLIC>%s</SYMBOLIC>\n", (*j).c_str());
00637             }
00638             fputs("</SYMBOLICLIST>\n", out);
00639
00640             fputs("<LOCKLIST>\n", out);
00641             const std::vector<CRevNumber> & lo = rcs.LocksList();
00642             for(j = lo.begin(); j != lo.end(); ++j)
00643             {
00644                 fprintf(out, "<LOCK>%s</LOCK>\n", (*j).c_str());
00645             }
00646             fputs("</LOCKLIST>\n", out);
00647             break;
00648         }
00649         case kNodeRev :
00650         {
00651             const CRevFile & rev = **(CLogNodeRev *)node;
00652             fputs("<REVISION>\n", out);
00653             fprintf(out, "<NUMBER>%s</NUMBER>\n", rev.RevNum().c_str());
00654             const struct tm & tm = rev.RevTime();
00655             fprintf(out, "<DATE>%d/%d/%d %d:%d:%d</DATE>\n", (tm.tm_year + 1900),
00656                 tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
00657             fprintf(out, "<AUTHOR>%s</AUTHOR>\n", rev.Author().c_str());
00658             fprintf(out, "<STATE>%s</STATE>\n", rev.State().c_str());
00659             fprintf(out, "<CHANGES>+%d%d</CHANGES>\n", rev.ChgPos(), rev.ChgNeg());
00660             fprintf(out, "<DESCRIPTION>%s</DESCRIPTION>\n", rev.DescLog().c_str());
00661
00662             fputs("<BRANCHLIST>\n", out);
00663             const std::vector<CRevNumber> & sy = rev.BranchesList();
00664             std::vector<CRevNumber>::const_iterator j;
00665             for(j = sy.begin(); j != sy.end(); ++j)
00666             {
00667                 fprintf(out, "<REVBRANCH>%s</REVBRANCH>\n", (*j).c_str());
00668             }
00669             fputs("</BRANCHLIST>\n", out);
00670             break;
00671         }
00672         case kNodeBranch :
00673         {
00674             fputs("<BRANCH>\n", out);
00675             const CLogStr & branch = **(CLogNodeBranch *)node;
00676             fprintf(out, "<BRANCHNAME>%s</BRANCHNAME>\n", branch.c_str());
00677             break;
00678         }
00679         case kNodeTag :
00680         {
00681             fputs("<TAG>\n", out);
00682             const CLogStr & tag = **(CLogNodeTag *)node;
00683             fprintf(out, "<TAGNAME>%s</TAGNAME>\n", tag.c_str());
00684             break;
00685         }
00686     }
00687
00688     if(node->Childs().size() > 0)
00689     {
00690         fputs("<REVISIONS>\n", out);
00691         std::vector<CLogNode *>::const_iterator i;
00692         for(i = node->Childs().begin(); i != node->Childs().end(); ++i)
00693         {
00694             outputXML(out, *i);
00695         }
00696         fputs("</REVISIONS>\n", out);
00697     }
00698
00699     switch(node->GetType())
00700     {
00701         case kNodeHeader :
00702             fputs("</RCS>\n", out);
00703             break;
00704         case kNodeRev :
00705             fputs("</REVISION>\n", out);
00706             break;
00707         case kNodeBranch :
00708             fputs("</BRANCH>\n", out);
00709             break;
00710         case kNodeTag :
00711             fputs("</TAG>\n", out);
00712             break;
00713     }
00714
00715     if(node->Next() != 0L)
00716     {
00717         outputXML(out, node->Next());
00718     }
00719 }
00720
00721 static PyObject *cvsgui_GetHistoryAsXML(PyObject *self, PyObject *args)
00722 {
00723     PyObject *logfile, *xmlfile;
00724
00725     if(!PyArg_ParseTuple(args, "O!O!", GetPyFile_Type(), &logfile,
00726         GetPyFile_Type(), &xmlfile))
00727             return NULL;
00728
00729     TRY
00730     {
00731         std::vector<CRcsFile> & allRcs = CvsLogParse(PyFile_AsFile(logfile));
00732
00733         std::vector<CRcsFile>::iterator i;
00734         FILE *xml = PyFile_AsFile(xmlfile);
00735         fputs("<ROOT>\n", xml);
00736         for(i = allRcs.begin(); i != allRcs.end(); ++i)
00737         {
00738             std::auto_ptr<CLogNode> node(CvsLogGraph(*i));
00739             outputXML(xml, node.get());
00740         }
00741         fputs("</ROOT>\n", xml);
00742
00743         CvsLogReset();
00744     }
00745     CATCH_ALL(e)
00746     {
00747         PyHandleCvsguiError(e);
00748         return NULL;
00749     }
00750     END_CATCH_ALL
00751
00752     return PyContainer::Void();
00753 }
00754
00755 static PyObject *cvsgui_RunCvs(PyObject *self, PyObject *args)
00756 {
00757     CvsArgs arg;
00758     PyObject *cargs;
00759     int exitOnError = 1;
00760     int exitc;
00761     CPyCvsConsole console;
00762
00763     if(!PyArg_ParseTuple(args, "O!|i", GetPyTuple_Type(), &cargs, &exitOnError))
00764         return NULL;
00765
00766     TRY
00767     {
00768         int argc = PyTuple_Size(cargs);
00769         for(int i = 0; i < argc; i++)
00770         {
00771             PyObject *o = PyTuple_GET_ITEM(cargs, i);
00772             if(!PyString_Check(o))
00773             {
00774                 PyErr_SetString(gCvsguiErr, "Wrong argument type, should be string");
00775                 return NULL;
00776             }
00777
00778             arg.add(PyString_AsString(o));
00779         }
00780
00781         exitc = launchCVS(0L, arg.Argc(), arg.Argv(), &console);
00782
00783         if(exitOnError && exitc != 0)
00784         {
00785             UStr str;
00786             str.set(console.m_err, console.m_err.size());
00787             str << "cvs returned an non-zero error code (";
00788             str << exitc;
00789             str << ")\n";
00790             PyErr_SetString(gCvsguiErr, str);
00791             return NULL;
00792         }
00793     }
00794     CATCH_ALL(e)
00795     {
00796         PyHandleCvsguiError(e);
00797         return NULL;
00798     }
00799     END_CATCH_ALL
00800
00801     return Py_BuildValue("(is#s#)", exitc, (char *)console.m_out, console.m_out.size(),
00802         (char *)console.m_err, console.m_err.size());
00803 }
00804
00805 static PyMethodDef cvsgui_methods[] =
00806 {
00807     {"write", (PyCFunction)cvsgui_write, METH_VARARGS, ""},
00808     {"GetMainMenuWidget", (PyCFunction)cvsgui_GetMainMenuWidget, METH_VARARGS, ""},
00809     {"GetTopMacroSelectionMenu", (PyCFunction)cvsgui_GetTopMacroSelectionMenu, METH_VARARGS, ""},
00810     {"GetTopMacroAdminMenu", (PyCFunction)cvsgui_GetTopMacroAdminMenu, METH_VARARGS, ""},
00811     {"GetSelection", (PyCFunction)cvsgui_GetSelection, METH_VARARGS, ""},
00812     {"GetCvsEntries", (PyCFunction)cvsgui_GetCvsEntries, METH_VARARGS, ""},
00813 #if defined(WIN32)
00814     {"GetFileModTime", (PyCFunction)cvsgui_GetFileModTime, METH_VARARGS, ""},
00815 #endif
00816     {"LaunchTclMacro", (PyCFunction)cvsgui_LaunchTclMacro, METH_VARARGS, ""},
00817     {"RunCvs", (PyCFunction)cvsgui_RunCvs, METH_VARARGS, ""},
00818     {"PromptMessage", (PyCFunction)cvsgui_PromptMessage, METH_VARARGS, ""},
00819     {"PromptEditMessage", (PyCFunction)cvsgui_PromptEditMessage, METH_VARARGS, ""},
00820     {"LaunchBrowser", (PyCFunction)cvsgui_LaunchBrowser, METH_VARARGS, ""},
00821     {"GetHistoryAsXML", (PyCFunction)cvsgui_GetHistoryAsXML, METH_VARARGS, ""},
00822     {NULL, NULL}
00823 };
00824
00825 static std::vector<PyMethodDef> gAllMethods;
00826
00827 static void InitializeInterp(PyThreadState *interp)
00828 {
00829     CPyThreadState lock(interp);
00830
00831     // first time, create the method table for cvsgui module
00832     if(gAllMethods.empty())
00833     {
00834         PyMethodDef *tmp = cvsgui_methods;
00835         while(tmp->ml_name)
00836         {
00837             gAllMethods.push_back(*tmp);
00838             tmp++;
00839         }
00840
00841         PyRegistry::RegisterAllObjects(gAllMethods);
00842     }
00843
00844     // this module contains the glue code functions
00845     PyObject *m = Py_InitModule4("_cvsgui", &gAllMethods[0],
00846         "The cvsgui glue functions", (PyObject*)NULL,PYTHON_API_VERSION);
00847
00848     if(m == NULL)
00849     {
00850         cvs_err("Could not create the Python cvsgui module !\n");
00851         return;
00852     }
00853
00854     // this is the exception we raised when the error comes from us
00855     PyObject *d = PyModule_GetDict(m);
00856     if(gCvsguiErr == NULL)
00857         gCvsguiErr = PyErr_NewException("_cvsgui.error", NULL, NULL);
00858     if (gCvsguiErr != NULL)
00859         PyDict_SetItemString(d, "error", gCvsguiErr);
00860
00861     PyRegistry::CallInitValues(d);
00862
00863     // Ideally we need to use Jonathan's mechanism
00864     PyObject *ver = PyString_FromString("1.3");
00865     if (ver != NULL) {
00866         PyDict_SetItemString(d, "CVSGUI_VERSION", ver);
00867         Py_DECREF(ver);
00868     }
00869
00870     char *script = NULL;
00871
00872 #ifdef WIN32
00873     HINSTANCE hInst = ::AfxGetInstanceHandle();
00874     HRSRC rsrc = FindResource(hInst, "PYSHELL", "PYSCRIPT");
00875
00876     if(rsrc)
00877     {
00878         HGLOBAL h = LoadResource(hInst, rsrc);
00879         if(h)
00880         {
00881             DWORD size = SizeofResource(hInst, rsrc);
00882             script = (char *)malloc(size + 1);
00883             char *ptr = (char *)LockResource(h);
00884
00885             if(script)
00886             {
00887                 char *tmp = script;
00888                 while(size--)
00889                 {
00890                     char c = *ptr++;
00891                     if(c == '\r')
00892                         continue;
00893                     *tmp++ = c;
00894                 }
00895                 *tmp = '\0';
00896             }
00897
00898             FreeResource(h);
00899         }
00900     }
00901
00902 #endif // WIN32
00903 #if qMacCvsPP
00904     StResource rsrcH(FOUR_CHAR_CODE('PYTH'), 128);
00905     size_t size = GetHandleSize(rsrcH);
00906     script = (char *)malloc(size + 1);
00907     if(script)
00908     {
00909         char *ptr = (char *)*rsrcH;
00910         char *tmp = script;
00911         while(size--)
00912         {
00913             char c = *ptr++;
00914             if(c == '\r')
00915                 c = '\n';
00916             *tmp++ = c;
00917         }
00918         *tmp = '\0';
00919     }
00920 #endif
00921
00922     // augment the library path of python with our library
00923     CStr ourLibPath;
00924     PythonLibGetLoc(ourLibPath);
00925
00926     UStr libPath = Py_GetPath();
00927     if(!ourLibPath.empty())
00928     {
00929         libPath << DELIM;
00930         libPath << ourLibPath;
00931         PySys_SetPath((char *)(const char *)libPath);
00932     }
00933
00934     // this is the script to setup stdout/stderr and reroute it
00935     // to the console window
00936     if(script)
00937     {
00938         PyRun_SimpleString(script);
00939
00940         free(script);
00941     }
00942     else
00943     {
00944         cvs_err("Could not initialize properly the Python interpreter !\n");
00945     }
00946 }
00947 #endif // USE_PYTHON
00948
00949 CPython_Interp::CPython_Interp(bool mainInterp)
00950 {
00951     fInterp = 0L;
00952
00953 #if USE_PYTHON
00954     if(!CPython_Interp::IsAvail())
00955     {
00956         cvs_err("Python is not available !\n");
00957         return;
00958     }
00959
00960     if(mainInterp)
00961     {
00962         fInterp = m_mainInterpreter;
00963         gCvsPrefs.SetTclFileRunning(true);
00964         return;
00965     }
00966
00967     {
00968         CPyThreadState lock(0L);
00969
00970         fInterp = Py_NewInterpreter();
00971         if(fInterp == NULL)
00972             return;
00973     }
00974
00975     InitializeInterp(fInterp);
00976     gCvsPrefs.SetTclFileRunning(true);
00977 #endif
00978 }
00979
00980 CPython_Interp::~CPython_Interp()
00981 {
00982 #if USE_PYTHON
00983     if(fInterp != 0L)
00984     {
00985         gCvsPrefs.SetTclFileRunning(false);
00986
00987         if(fInterp != m_mainInterpreter)
00988         {
00989             CPyThreadState lock(fInterp);
00990
00991             Py_EndInterpreter(fInterp);
00992         }
00993     }
00994 #endif
00995 }
00996
00997 bool CPython_Interp::IsAvail(void)
00998 {
00999 #if USE_PYTHON
01000 #   if TARGET_RT_MAC_CFM
01001     return PyThreadState_Swap != 0L;
01002 #   elif (defined(WIN32) && !qCvsDebug) || TARGET_RT_MAC_MACHO
01003     static bool firstTime = true;
01004     static bool pyAvail = false;
01005     if(firstTime)
01006     {
01007 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01008         CompatConnectID connID;
01009 #   endif
01010
01011 #   ifdef WIN32
01012         if(!pyAvail)
01013             pyAvail = CompatLoadLibrary(&connID, "python21.dll") != 0 ||
01014                 CompatLoadLibrary(&connID, "python22.dll") != 0;
01015 #   endif
01016
01017 #   if TARGET_RT_MAC_MACHO
01018         pyAvail = CompatLoadLibrary(&connID, "/Library/Frameworks/Python.framework") ||
01019             CompatLoadLibrary(&connID, "/System/Library/Frameworks/Python.framework");
01020 #   endif
01021
01022 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01023 #   define LOAD_CODEFRAG(name) \
01024         if(pyAvail) \
01025             pyAvail = (*(void **)&name##_glue = \
01026                 _CompatCallLibrary(connID, #name)) != 0L
01027 #   endif
01028 #   if defined(WIN32) || TARGET_RT_MAC_MACHO
01029         LOAD_CODEFRAG(PyThreadState_Swap);
01030         LOAD_CODEFRAG(PyDict_SetItemString);
01031         LOAD_CODEFRAG(PyErr_Clear);
01032         LOAD_CODEFRAG(PyInt_FromLong);
01033         LOAD_CODEFRAG(PyErr_SetString);
01034         LOAD_CODEFRAG(PyArg_ParseTuple);
01035         LOAD_CODEFRAG(PyTuple_New);
01036         LOAD_CODEFRAG(Py_BuildValue);
01037         LOAD_CODEFRAG(PyFile_AsFile);
01038         LOAD_CODEFRAG(PyString_AsString);
01039         LOAD_CODEFRAG(PyTuple_Size);
01040         LOAD_CODEFRAG(PyRun_SimpleString);
01041         LOAD_CODEFRAG(PyRun_SimpleFile);
01042         LOAD_CODEFRAG(Py_SetProgramName);
01043         LOAD_CODEFRAG(Py_Initialize);
01044         LOAD_CODEFRAG(Py_Finalize);
01045         LOAD_CODEFRAG(Py_IsInitialized);
01046         LOAD_CODEFRAG(Py_NewInterpreter);
01047         LOAD_CODEFRAG(Py_EndInterpreter);
01048         LOAD_CODEFRAG(PyString_FromString);
01049         LOAD_CODEFRAG(PyErr_NewException);
01050         LOAD_CODEFRAG(PyModule_GetDict);
01051         LOAD_CODEFRAG(Py_InitModule4);
01052         LOAD_CODEFRAG(PyEval_InitThreads);
01053         LOAD_CODEFRAG(Py_FindMethod);
01054         LOAD_CODEFRAG(_PyObject_New);
01055 #   if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3
01056         LOAD_CODEFRAG(_PyObject_Del);
01057 #   else
01058         LOAD_CODEFRAG(PyObject_Free);
01059 #   endif
01060         LOAD_CODEFRAG(PySys_SetPath);
01061         LOAD_CODEFRAG(Py_GetPath);
01062
01063         LOAD_CODEFRAG(PyType_Type);
01064         LOAD_CODEFRAG(PyFile_Type);
01065         LOAD_CODEFRAG(PyString_Type);
01066         LOAD_CODEFRAG(PyTuple_Type);
01067         LOAD_CODEFRAG(PyInt_Type);
01068         LOAD_CODEFRAG(_Py_NoneStruct);
01069         LOAD_CODEFRAG(_Py_ZeroStruct);
01070         LOAD_CODEFRAG(_Py_TrueStruct);
01071
01072 #       ifdef WIN32
01073         if(!pyAvail)
01074         {
01075             WarnNoPython();
01076         }
01077 #       endif
01078 #   endif /* WIN32 */
01079
01080         firstTime = false;
01081     }
01082
01083     return pyAvail;
01084 #   else
01085     return true;
01086 #   endif
01087 #else // !USE_PYTHON
01088     return false;
01089 #endif // !USE_PYTHON
01090 }
01091
01092 int CPython_Interp::DoScript(const char *script)
01093 {
01094 #if USE_PYTHON
01095     if(fInterp == 0L)
01096         return -1;
01097
01098     CPyThreadState lock(fInterp);
01099
01100     PyRun_SimpleString((char *)script);
01101
01102     return 0;
01103 #else
01104     return -1;
01105 #endif
01106 }
01107
01108 int CPython_Interp::DoScriptVar(const char *format, ...)
01109 {
01110 #if USE_PYTHON
01111     if(fInterp == 0L)
01112         return -1;
01113
01114     va_list args;
01115     char script[1024] = {'\0'};
01116
01117     va_start (args, format);
01118     vsprintf (script, format, args);
01119     va_end (args);
01120
01121     return DoScript(script);
01122 #else
01123     return -1;
01124 #endif
01125 }
01126
01127 int CPython_Interp::DoFile(const char *file)
01128 {
01129 #if USE_PYTHON
01130     if(fInterp == 0L)
01131         return -1;
01132
01133     CPyThreadState lock(fInterp);
01134
01135     FILE *f = fopen(file, "r");
01136     if(f)
01137     {
01138         PyRun_SimpleFile(f, (char *)file);
01139         fclose(f);
01140     }
01141
01142     return 0;
01143 #else
01144     return -1;
01145 #endif
01146 }
01147
01148 #if TARGET_RT_MAC_CFM
01149     // work around for a bug of Python 2.2 which draws the
01150     // Sioux menu even though we have a custom console
01151 extern int console_output_state;
01152 #endif
01153
01154 void CPython_Interp::InitPythonSupport(void)
01155 {
01156 #if USE_PYTHON
01157     if(!CPython_Interp::IsAvail())
01158         return;
01159
01160 #ifdef WIN32
01161     Py_SetProgramName("wincvs");
01162     Py_Initialize();
01163 #elif TARGET_RT_MAC_CFM
01164     console_output_state = 1;
01165
01166     PyMac_SetConsoleHandler(PyMac_DummyReadHandler, PyMac_DummyWriteHandler,
01167         PyMac_DummyWriteHandler);
01168
01169     PyMacSchedParams scp;
01170
01171     PyMac_GetSchedParams(&scp);
01172     scp.process_events = 0;
01173     PyMac_SetSchedParams(&scp);
01174
01175     Py_SetProgramName("maccvs");
01176     PyMac_Initialize();
01177 #elif TARGET_RT_MAC_MACHO
01178     Py_SetProgramName("maccvsX");
01179     Py_Initialize();
01180 #else
01181     Py_SetProgramName("gcvs");
01182     Py_Initialize();
01183 #endif
01184
01185     PyEval_InitThreads();
01186     m_mainInterpreter = PyThreadState_Swap(NULL);
01187
01188     InitializeInterp(m_mainInterpreter);
01189 #endif
01190 }
01191
01192 void CPython_Interp::ClosePythonSupport(void)
01193 {
01194 #if USE_PYTHON
01195     if(!CPython_Interp::IsAvail())
01196         return;
01197
01198     PyThreadState_Swap(m_mainInterpreter);
01199 //  PyEval_ReleaseLock();
01200
01201     PyInvalUICache();
01202
01203     Py_Finalize();
01204     m_mainInterpreter = 0L;
01205 #endif
01206 }
01207
01208 void PyMacrosReloadAll(void)
01209 {
01210     // get the macro folder
01211     UStr path;
01212     MacrosGetLoc(path);
01213
01214 #ifdef WIN32
01215     CString newpath(path);
01216     newpath.Replace("\\", "\\\\");
01217     path = newpath;
01218 #endif
01219
01220     CPython_Interp interp;
01221     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01222         "gMacroRegistry.LoadMacros(\"%s\")", (char *)path.c_str());;
01223 }
01224
01225 void PyDoCmdUI(UCmdUI *ucmdui)
01226 {
01227     CPython_Interp interp;
01228     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01229         "from cvsgui.CmdUI import *; "
01230         "gMacroRegistry.DoCmdUI(CmdUI(%d), %d)", (long)ucmdui, ucmdui->m_nID);
01231 }
01232
01233 void PyDoPython(int cmd)
01234 {
01235     CPython_Interp interp;
01236     interp.DoScriptVar("from cvsgui.MacroRegistry import *; "
01237         "gMacroRegistry.DoCmd(%d)", cmd);
01238 }
01239
01240 bool PyIsUICacheValid()
01241 {
01242 #if USE_PYTHON
01243     return gUICacheValid;
01244 #else
01245     return false;
01246 #endif
01247 }
01248
01249 void PyValidUICache()
01250 {
01251 #if USE_PYTHON
01252     gUICacheValid = true;
01253 #endif
01254 }
01255
01256 void PyInvalUICache()
01257 {
01258 #if USE_PYTHON
01259     gUICache.erase(gUICache.begin(), gUICache.end());
01260     gUICacheValid = false;
01261     Py_XDECREF(gUICacheObj);
01262     gUICacheObj = 0L;
01263 #endif
01264 }
01265
01266 void PyAppendCache(EntnodeData *data)
01267 {
01268 #if USE_PYTHON
01269     Py_XDECREF(gUICacheObj);
01270     gUICacheObj = 0L;
01271     gUICache.push_back(ENTNODE(data));
01272     gUICacheValid = true;
01273 #endif
01274 }
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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) || TARGET_RT_MAC_MACHO
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 #   if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3
00063     PYTHONGLUE_EXTERN void DEC_GLUE(_PyObject_Del) (PyObject *);
00064 #   else
00065     PYTHONGLUE_EXTERN void DEC_GLUE(PyObject_Free) (void *);
00066 #   endif
00067     PYTHONGLUE_EXTERN void DEC_GLUE(PySys_SetPath) (char *);
00068     PYTHONGLUE_EXTERN char * DEC_GLUE(Py_GetPath) (void);
00069
00070     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyType_Type);
00071     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyFile_Type);
00072     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyString_Type);
00073     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyTuple_Type);
00074     PYTHONGLUE_EXTERN PyTypeObject * VAR_GLUE(PyInt_Type);
00075     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_NoneStruct);
00076     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_ZeroStruct);
00077     PYTHONGLUE_EXTERN PyObject * VAR_GLUE(_Py_TrueStruct);
00078
00079 #   define GLUE_WRAP(f) f##_glue
00080
00081 #   define PyThreadState_Swap GLUE_WRAP(PyThreadState_Swap)
00082 #   define PyDict_SetItemString GLUE_WRAP(PyDict_SetItemString)
00083 #   define PyErr_Clear GLUE_WRAP(PyErr_Clear)
00084 #   define PyInt_FromLong GLUE_WRAP(PyInt_FromLong)
00085 #   define PyErr_SetString GLUE_WRAP(PyErr_SetString)
00086 #   define PyArg_ParseTuple GLUE_WRAP(PyArg_ParseTuple)
00087 #   define PyTuple_New GLUE_WRAP(PyTuple_New)
00088 #   define Py_BuildValue GLUE_WRAP(Py_BuildValue)
00089 #   define PyFile_AsFile GLUE_WRAP(PyFile_AsFile)
00090 #   define PyString_AsString GLUE_WRAP(PyString_AsString)
00091 #   define PyTuple_Size GLUE_WRAP(PyTuple_Size)
00092 #   define PyRun_SimpleString GLUE_WRAP(PyRun_SimpleString)
00093 #   define PyRun_SimpleFile GLUE_WRAP(PyRun_SimpleFile)
00094 #   define Py_SetProgramName GLUE_WRAP(Py_SetProgramName)
00095 #   define Py_Initialize GLUE_WRAP(Py_Initialize)
00096 #   define Py_Finalize GLUE_WRAP(Py_Finalize)
00097 #   define Py_IsInitialized GLUE_WRAP(Py_IsInitialized)
00098 #   define Py_NewInterpreter GLUE_WRAP(Py_NewInterpreter)
00099 #   define Py_EndInterpreter GLUE_WRAP(Py_EndInterpreter)
00100 #   define PyString_FromString GLUE_WRAP(PyString_FromString)
00101 #   define PyErr_NewException GLUE_WRAP(PyErr_NewException)
00102 #   define PyModule_GetDict GLUE_WRAP(PyModule_GetDict)
00103 #   define Py_InitModule4 GLUE_WRAP(Py_InitModule4)
00104 #   define PyEval_InitThreads GLUE_WRAP(PyEval_InitThreads)
00105 #   define Py_FindMethod GLUE_WRAP(Py_FindMethod)
00106 #   define _PyObject_New GLUE_WRAP(_PyObject_New)
00107 #   if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 3
00108 #       define _PyObject_Del GLUE_WRAP(_PyObject_Del)
00109 #   else
00110 #       define PyObject_Free GLUE_WRAP(PyObject_Free)
00111 #   endif
00112 #   define PySys_SetPath GLUE_WRAP(PySys_SetPath)
00113 #   define Py_GetPath GLUE_WRAP(Py_GetPath)
00114
00115     extern PyTypeObject *GetPyType_Type();
00116     extern PyTypeObject *GetPyFile_Type();
00117     extern PyTypeObject *GetPyString_Type();
00118     extern PyTypeObject *GetPyTuple_Type();
00119     extern PyTypeObject *GetPyInt_Type();
00120     extern PyObject *GetPyNone();
00121     extern PyObject *GetPyTrue();
00122     extern PyObject *GetPyFalse();
00123
00124 #   undef PyString_Check
00125 #   define PyString_Check(op) ((op)->ob_type == GetPyString_Type())
00126 #   undef PyTuple_Check
00127 #   define PyTuple_Check(op) ((op)->ob_type == GetPyTuple_Type())
00128 #   undef PyInt_Check
00129 #   define PyInt_Check(op) ((op)->ob_type == GetPyInt_Type())
00130
00131 #else /* (!WIN32 || qCvsDebug) && !TARGET_RT_MAC_MACHO */
00132     inline PyTypeObject *GetPyType_Type() { return &PyType_Type; }
00133     inline PyTypeObject *GetPyFile_Type() { return &PyFile_Type; }
00134     inline PyTypeObject *GetPyString_Type() { return &PyString_Type; }
00135     inline PyTypeObject *GetPyTuple_Type() { return &PyTuple_Type; }
00136     inline PyTypeObject *GetPyInt_Type() { return &PyInt_Type; }
00137     inline PyObject *GetPyNone() { return Py_None; }
00138     inline PyObject *GetPyTrue() { return Py_True; }
00139     inline PyObject *GetPyFalse() { return Py_False; }
00140 #endif /* !WIN32 || qCvsDebug */
00141
00142 #endif /* PYTHONGLUE_IMPL_H */
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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         CPersistent::LoadAll(uniqueName);
00426     }
00427     CATCH_ALL(e)
00428     {
00429         PyHandleCvsguiError(e);
00430         return NULL;
00431     }
00432     END_CATCH_ALL
00433
00434     return self.CopyReturn();
00435 }
00436
00437 void PyPersistent::InitValues(PyObject *d)
00438 {
00439 }
00440
00441 PyObject *PyPersistent::SetValue(PyObject *args)
00442 {
00443     char *s;
00444
00445     if (!PyArg_ParseTuple(args, "s", &s))
00446         return NULL;
00447
00448     m_cstr = s;
00449     gCvsPrefs.save();
00450
00451     return Void();
00452 }
00453
00454 PyObject *PyPersistent::GetValue(PyObject *args)
00455 {
00456     if (!PyArg_ParseTuple(args, ""))
00457         return NULL;
00458
00459     return PyString_FromString(m_cstr);
00460 }
00461
00462 #if (defined(WIN32) && !qCvsDebug) || TARGET_RT_MAC_MACHO
00463
00464 #undef PYTHONGLUE_IMPL_H
00465 #undef PYTHONGLUE_EXTERN
00466 #define PYTHONGLUE_EXTERN
00467 #include "PythonGlue.impl.h"
00468
00469 PyTypeObject *GetPyType_Type()
00470 {
00471     return PyType_Type_glue;
00472 }
00473
00474 PyTypeObject *GetPyFile_Type()
00475 {
00476     return PyFile_Type_glue;
00477 }
00478
00479 PyTypeObject *GetPyString_Type()
00480 {
00481     return PyString_Type_glue;
00482 }
00483
00484 PyTypeObject *GetPyTuple_Type()
00485 {
00486     return PyTuple_Type_glue;
00487 }
00488
00489 PyTypeObject *GetPyInt_Type()
00490 {
00491     return PyInt_Type_glue;
00492 }
00493
00494 PyObject *GetPyNone()
00495 {
00496     return _Py_NoneStruct_glue;
00497 }
00498
00499 PyObject *GetPyTrue()
00500 {
00501     return _Py_TrueStruct_glue;
00502 }
00503
00504 PyObject *GetPyFalse()
00505 {
00506     return _Py_ZeroStruct_glue;
00507 }
00508 #endif // WIN32 && !qCvsDebug
00509
00510 #endif // USE_PYTHON
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "MultiFiles.h"
00033 #include "GetPrefs.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 #ifdef WIN32
00044
00045 // CRelease_MAIN property page
00046
00047 IMPLEMENT_DYNAMIC(CRelease_MAIN, CPropertyPage)
00048
00049 CRelease_MAIN::CRelease_MAIN(const char* dir)
00050     : CPropertyPage(CRelease_MAIN::IDD)
00051 {
00052     //{{AFX_DATA_INIT(CRelease_MAIN)
00053     m_dir = dir;
00054     //}}AFX_DATA_INIT
00055
00056     m_removeDirectoryOption = kReleaseNoDel;
00057 }
00058
00059 CRelease_MAIN::~CRelease_MAIN()
00060 {
00061 }
00062
00063 void CRelease_MAIN::DoDataExchange(CDataExchange* pDX)
00064 {
00065     CPropertyPage::DoDataExchange(pDX);
00066     //{{AFX_DATA_MAP(CRelease_MAIN)
00067     DDX_Control(pDX, IDC_DELDIR, m_delDirCheck);
00068     DDX_Control(pDX, IDC_DELCVSINFO, m_delCvsInfoCheck);
00069     DDX_Control(pDX, IDC_DELALL, m_delAllCheck);
00070     DDX_Text(pDX, IDC_DIRECTORY, m_dir);
00071     //}}AFX_DATA_MAP
00072
00073     if( pDX->m_bSaveAndValidate )
00074     {
00075         if( m_delAllCheck.GetCheck() )
00076         {
00077             m_removeDirectoryOption = kReleaseDelAll;
00078         }
00079         else if( m_delCvsInfoCheck.GetCheck() )
00080         {
00081             m_removeDirectoryOption = kReleaseDelCvsInfo;
00082         }
00083         else if( m_delDirCheck.GetCheck() )
00084         {
00085             m_removeDirectoryOption = kReleaseDelDir;
00086         }
00087     }
00088 }
00089
00090
00091 BEGIN_MESSAGE_MAP(CRelease_MAIN, CPropertyPage)
00092     //{{AFX_MSG_MAP(CRelease_MAIN)
00093     ON_BN_CLICKED(IDC_DELALL, OnDelall)
00094     ON_BN_CLICKED(IDC_DELCVSINFO, OnDelcvsinfo)
00095     ON_BN_CLICKED(IDC_DELDIR, OnDeldir)
00096     //}}AFX_MSG_MAP
00097 END_MESSAGE_MAP()
00098
00099
00100 // CRelease_MAIN message handlers
00101
00102
00106 kReleaseDelType CRelease_MAIN::GetRemoveDirectoryOption() const
00107 {
00108     return m_removeDirectoryOption;
00109 }
00110
00112 void CRelease_MAIN::OnDelall()
00113 {
00114     if( m_delAllCheck.GetCheck() )
00115     {
00116         m_delCvsInfoCheck.SetCheck(0);
00117         m_delDirCheck.SetCheck(0);
00118     }
00119 }
00120
00122 void CRelease_MAIN::OnDelcvsinfo()
00123 {
00124     if( m_delCvsInfoCheck.GetCheck() )
00125     {
00126         m_delAllCheck.SetCheck(0);
00127         m_delDirCheck.SetCheck(0);
00128     }
00129 }
00130
00132 void CRelease_MAIN::OnDeldir()
00133 {
00134     if( m_delDirCheck.GetCheck() )
00135     {
00136         m_delCvsInfoCheck.SetCheck(0);
00137         m_delAllCheck.SetCheck(0);
00138     }
00139 }
00140 #endif /* WIN32 */
00141
00143 bool CompatGetRelease(const MultiFiles* mf, const char* dir, kReleaseDelType& removeDirectoryOption)
00144 {
00145     bool userHitOK = false;
00146
00147 #ifdef WIN32
00148     CPropertySheet pages("Release settings");
00149     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00150
00151     CRelease_MAIN page1(dir);
00152     CGetPrefs_GLOBALS page2;
00153     pages.AddPage(&page1);
00154     pages.AddPage(&page2);
00155
00156     if( pages.DoModal() == IDOK )
00157     {
00158         removeDirectoryOption = page1.GetRemoveDirectoryOption();
00159
00160         page2.StoreValues();
00161         userHitOK = true;
00162     }
00163
00164 #endif /* WIN32 */
00165
00166 #ifdef qMacCvsPP
00167     userHitOK = true;
00168 #endif /* qMacCvsPP */
00169
00170 #if qUnix
00171     userHitOK = true;
00172 #endif // qUnix
00173
00174     return userHitOK;
00175 }
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 class MultiFiles;
00033
00035 typedef enum
00036 {
00037     kReleaseNoDel,
00038     kReleaseDelDir,
00039     kReleaseDelAll,
00040     kReleaseDelCvsInfo
00041 } kReleaseDelType;
00042
00043 bool CompatGetRelease(const MultiFiles* mf, const char* dir, kReleaseDelType& removeDirectoryOption);
00044
00045 #ifdef WIN32
00046
00048 // CRelease_MAIN dialog
00049
00050 class CRelease_MAIN : public CPropertyPage
00051 {
00052     DECLARE_DYNAMIC(CRelease_MAIN)
00053
00054 // Construction
00055 public:
00056     CRelease_MAIN(const char* dir);
00057     ~CRelease_MAIN();
00058
00059 // Dialog Data
00060     //{{AFX_DATA(CRelease_MAIN)
00061     enum { IDD = IDD_RELEASE_MAIN };
00062     CButton m_delDirCheck;
00063     CButton m_delCvsInfoCheck;
00064     CButton m_delAllCheck;
00065     CString m_dir;
00066     //}}AFX_DATA
00067
00068
00069 // Overrides
00070     // ClassWizard generate virtual function overrides
00071     //{{AFX_VIRTUAL(CRelease_MAIN)
00072     protected:
00073     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00074     //}}AFX_VIRTUAL
00075
00076 // Implementation
00077 protected:
00078     // Generated message map functions
00079     //{{AFX_MSG(CRelease_MAIN)
00080     afx_msg void OnDelall();
00081     afx_msg void OnDelcvsinfo();
00082     afx_msg void OnDeldir();
00083     //}}AFX_MSG
00084     DECLARE_MESSAGE_MAP()
00085 private:
00086     // Data members
00087     kReleaseDelType m_removeDirectoryOption;
00089 public:
00090     // Interface
00091     kReleaseDelType GetRemoveDirectoryOption() const;
00092 };
00093 //{{AFX_INSERT_LOCATION}}
00094 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00095
00096 #endif /* WIN32 */
00097
00098
00099 #endif // !defined(AFX_RELEASEDLG_H__12B5FA97_703E_4616_B361_F2917D45E54A__INCLUDED_)
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
00052 #include "UpdateDlg.h"
00053 #include "ItemListDlg.h"
00054
00055 #ifdef WIN32
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 #ifdef WIN32
00064
00065 // CRtag_MAIN property page
00066
00067 IMPLEMENT_DYNAMIC(CRtag_MAIN, CPropertyPage)
00068
00069 CRtag_MAIN::CRtag_MAIN(const MultiFiles* mf,
00070                        kRtagDlgType type,
00071                        const char *sLastModule, const char *sLastTag,
00072                        bool noRecurs, bool lookAttic, bool overwriteExist /*= false*/)
00073                        : m_mf(mf), CPropertyPage(CRtag_MAIN::IDD)
00074 {
00075     m_type = type;
00076
00077     m_tagName = sLastTag;
00078     m_moduleName = sLastModule;
00079     m_noRecurs = noRecurs;
00080     m_lookAttic = lookAttic;
00081     m_overwriteExisting = overwriteExist;
00082
00083     m_moduleCombo.SetItems(&gOldModules);
00084     m_tagCombo.SetItems(&gRevNames);
00085 }
00086
00087 CRtag_MAIN::~CRtag_MAIN()
00088 {
00089 }
00090
00091 void CRtag_MAIN::DoDataExchange(CDataExchange* pDX)
00092 {
00093     CPropertyPage::DoDataExchange(pDX);
00094     //{{AFX_DATA_MAP(CRtag_MAIN)
00095     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00096     DDX_Control(pDX, IDC_MODULEDESC_TEXT, m_moduleDescStatic);
00097     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00098     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00099     DDX_Control(pDX, IDC_MODNAME, m_moduleCombo);
00100     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00101     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00102     DDX_CBString(pDX, IDC_MODNAME, m_moduleName);
00103     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00104     DDX_Check(pDX, IDC_ATTIC, m_lookAttic);
00105     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00106     //}}AFX_DATA_MAP
00107
00108     DDV_MinChars(pDX, m_moduleName, 1);
00109     DDV_MinChars(pDX, m_tagName, 1);
00110
00111     DDX_ComboMString(pDX, IDC_MODNAME, m_moduleCombo);
00112     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00113 }
00114
00115
00116 BEGIN_MESSAGE_MAP(CRtag_MAIN, CPropertyPage)
00117     //{{AFX_MSG_MAP(CRtag_MAIN)
00118     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00119     ON_BN_CLICKED(IDC_BROWSE_MODULES, OnBrowseModules)
00120     //}}AFX_MSG_MAP
00121 END_MESSAGE_MAP()
00122
00123
00124 // CRtag_MAIN message handlers
00125
00126 BOOL CRtag_MAIN::OnInitDialog()
00127 {
00128     CPropertyPage::OnInitDialog();
00129
00130     // set the type-specific data
00131     CString strGrpBox;
00132     CString strTagDesc;
00133     CString strmoduleDesc;
00134
00135     switch( m_type )
00136     {
00137     case kRtagAdd:
00138         strGrpBox = "Enter the tag name and which module to tag:";
00139         strTagDesc = "New &tag name:";
00140         strmoduleDesc = "&Module to tag:";
00141         break;
00142     case kRtagDelete:
00143         strGrpBox = "Enter the tag name to delete and which module to untag:";
00144         strTagDesc = "Delete &tag name:";
00145         strmoduleDesc = "&Module to untag:";
00146
00147         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00148         break;
00149     case kRtagFork:
00150         strGrpBox = "Enter the branch name and which module to fork:";
00151         strTagDesc = "New &branch name:";
00152         strmoduleDesc = "&Module to fork:";
00153
00154         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00155         break;
00156     default:
00157         ASSERT(FALSE); //unknown type
00158     }
00159
00160     m_grpBox.SetWindowText(strGrpBox);
00161     m_tagDescStatic.SetWindowText(strTagDesc);
00162     m_moduleDescStatic.SetWindowText(strmoduleDesc);;
00163
00164     return TRUE;  // return TRUE unless you set the focus to a control
00165                   // EXCEPTION: OCX Property Pages should return FALSE
00166 }
00167
00168 void CRtag_MAIN::OnBrowseTag()
00169 {
00170     CStr tagName;
00171     if( CompatGetTagListItem(m_mf, tagName) )
00172     {
00173         m_tagName = (const char*)tagName;
00174         m_tagCombo.SetWindowText(m_tagName);
00175     }
00176 }
00177
00178 void CRtag_MAIN::OnBrowseModules()
00179 {
00180     CStr moduleName;
00181     if( CompatGetModuleListItem(m_mf, moduleName) )
00182     {
00183         m_moduleName = (const char*)moduleName;
00184         m_moduleCombo.SetWindowText(m_moduleName);
00185     }
00186 }
00187
00189 // CRtag_OPTIONS property page
00190
00191 IMPLEMENT_DYNAMIC(CRtag_OPTIONS, CPropertyPage)
00192
00193 CRtag_OPTIONS::CRtag_OPTIONS(const MultiFiles* mf,
00194                              kRtagDlgType type,
00195                              bool hasDate, bool hasRev,
00196                              const char *sLastDate, const char *sLastRev,
00197                              bool useMostRecent)
00198                              : m_mf(mf), CPropertyPage(CRtag_OPTIONS::IDD)
00199 {
00200     m_type = type;
00201
00202     m_date = sLastDate;
00203     m_rev = sLastRev;
00204     m_hasDate = hasDate;
00205     m_hasRev = hasRev;
00206     m_useMostRecent = useMostRecent;
00207
00208     m_revCombo.SetItems(&gRevNames);
00209     m_dateCombo.SetItems(&gDateNames);
00210 }
00211
00212 CRtag_OPTIONS::CRtag_OPTIONS() : CPropertyPage(CRtag_OPTIONS::IDD)
00213 {
00214     //{{AFX_DATA_INIT(CRtag_OPTIONS)
00215     m_date = _T("");
00216     m_rev = _T("");
00217     m_hasDate = FALSE;
00218     m_hasRev = FALSE;
00219     m_useMostRecent = FALSE;
00220     //}}AFX_DATA_INIT
00221 }
00222
00223 CRtag_OPTIONS::~CRtag_OPTIONS()
00224 {
00225 }
00226
00227 void CRtag_OPTIONS::DoDataExchange(CDataExchange* pDX)
00228 {
00229     CPropertyPage::DoDataExchange(pDX);
00230     //{{AFX_DATA_MAP(CRtag_OPTIONS)
00231     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00232     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00233     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00234     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00235     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00236     DDX_Check(pDX, IDC_DATE, m_hasDate);
00237     DDX_Check(pDX, IDC_REV, m_hasRev);
00238     DDX_Check(pDX, IDC_MATCH, m_useMostRecent);
00239     //}}AFX_DATA_MAP
00240
00241     if( m_hasRev )
00242     {
00243         DDV_MinChars(pDX, m_rev, 1);
00244     }
00245
00246     if( m_hasDate )
00247     {
00248         DDV_MinChars(pDX, m_date, 1);
00249     }
00250
00251     if( !pDX->m_bSaveAndValidate )
00252     {
00253         OnDate();
00254         OnRev();
00255     }
00256
00257     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00258     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00259 }
00260
00261
00262 BEGIN_MESSAGE_MAP(CRtag_OPTIONS, CPropertyPage)
00263     //{{AFX_MSG_MAP(CRtag_OPTIONS)
00264     ON_BN_CLICKED(IDC_DATE, OnDate)
00265     ON_BN_CLICKED(IDC_REV, OnRev)
00266     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00267     //}}AFX_MSG_MAP
00268 END_MESSAGE_MAP()
00269
00270
00271 // CRtag_OPTIONS message handlers
00272
00273 void CRtag_OPTIONS::OnDate()
00274 {
00275     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00276     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00277     wnd->EnableWindow(but->GetCheck() == 1);
00278 }
00279
00280 void CRtag_OPTIONS::OnRev()
00281 {
00282     CButton* but = (CButton *)GetDlgItem(IDC_REV);
00283     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00284     wnd->EnableWindow(but->GetCheck() == 1);
00285 }
00286
00287 BOOL CRtag_OPTIONS::OnInitDialog()
00288 {
00289     CPropertyPage::OnInitDialog();
00290
00291     // set the type-specific data
00292     CString strGrpBox;
00293
00294     switch( m_type )
00295     {
00296     case kRtagAdd:
00297         strGrpBox = "Optionally use this revision/tag/date to create the tag:";
00298         break;
00299     case kRtagDelete:
00300         ASSERT(FALSE); //delete tag has no options
00301         break;
00302     case kRtagFork:
00303         strGrpBox = "Optionally use this revision/tag/date to create the branch:";
00304         break;
00305     default:
00306         ASSERT(FALSE); //unknown type
00307     }
00308
00309     m_grpBox.SetWindowText(strGrpBox);
00310
00311     return TRUE;  // return TRUE unless you set the focus to a control
00312                   // EXCEPTION: OCX Property Pages should return FALSE
00313 }
00314
00315 void CRtag_OPTIONS::OnBrowseTag()
00316 {
00317     CStr tagName;
00318     if( CompatGetTagListItem(m_mf, tagName) )
00319     {
00320         m_rev = (const char*)tagName;
00321         m_revCombo.SetWindowText(m_rev);
00322     }
00323 }
00324
00325 #endif /* WIN32 */
00326
00327 #ifdef qMacCvsPP
00328 static void DoDataExchange_RtagCreateMain(LWindow *theDialog, const MultiFiles* mf,
00329     CPStr & sLastModule, CPStr & sLastTag,
00330     bool & hasDate, bool & hasRev,
00331     CPStr & sLastDate, CPStr & sLastRev,
00332     bool & useMostRecent, bool & lookAttic, bool putValue)
00333 {
00334     LEditText *mname = dynamic_cast<LEditText*>
00335         (theDialog->FindPaneByID(item_ModuleName));
00336     LEditText *tname = dynamic_cast<LEditText*>
00337         (theDialog->FindPaneByID(item_BranchRev));
00338     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00339         (theDialog->FindPaneByID(item_CheckDate));
00340     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00341         (theDialog->FindPaneByID(item_CheckRevTag));
00342     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00343         (theDialog->FindPaneByID(item_MostRecentRev));
00344     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00345         (theDialog->FindPaneByID(item_InAttic));
00346     LEditText *editDate = dynamic_cast<LEditText*>
00347         (theDialog->FindPaneByID(item_EditDate));
00348     LEditText *editRev = dynamic_cast<LEditText*>
00349         (theDialog->FindPaneByID(item_EditRevTag));
00350     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00351         (theDialog->FindPaneByID(item_FillerRev1));
00352     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00353         (theDialog->FindPaneByID(item_FillerTag));
00354     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00355         (theDialog->FindPaneByID(item_FillerDate));
00356
00357     LTagWrapper *wrapper1 = putValue ? NEW LTagWrapper(fillRev, mf) : 0L;
00358     fillRev->DoDataExchange(gRevNames, putValue, wrapper1);
00359     LTagWrapper *wrapper2 = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00360     fillTag->DoDataExchange(gRevNames, putValue, wrapper2);
00361     fillDate->DoDataExchange(gDateNames, putValue);
00362
00363     if(putValue)
00364     {
00365         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00366         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00367         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00368         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00369         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00370         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00371         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00372         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00373     }
00374     else
00375     {
00376         hasDate = chkHasDate->GetValue() == Button_On;
00377         hasRev = chkHasRev->GetValue() == Button_On;
00378         useMostRecent = chkMostRecent->GetValue() == Button_On;
00379         lookAttic = chkLookAttic->GetValue() == Button_On;
00380
00381         char str[255];
00382         Size len;
00383
00384         mname->GetText(str, 254, &len);
00385         sLastModule.set(str, len);
00386         tname->GetText(str, 254, &len);
00387         sLastTag.set(str, len);
00388         editDate->GetText(str, 254, &len);
00389         sLastDate.set(str, len);
00390         editRev->GetText(str, 254, &len);
00391         sLastRev.set(str, len);
00392     }
00393 }
00394
00395 static void DoDataExchange_RtagCreateOptions(LWindow *theDialog,
00396     bool & noRecurs, bool & overwriteExist, bool putValue)
00397 {
00398     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00399         (theDialog->FindPaneByID(item_NoRecurs));
00400     LCheckBox *chkOverwrite = dynamic_cast<LCheckBox*>
00401         (theDialog->FindPaneByID(item_OverwriteRev));
00402
00403     if(putValue)
00404     {
00405         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00406         chkOverwrite->SetValue(overwriteExist ? Button_On : Button_Off);
00407     }
00408     else
00409     {
00410         noRecurs = chkNoRecurs->GetValue() == Button_On;
00411         overwriteExist = chkOverwrite->GetValue() == Button_On;
00412     }
00413 }
00414
00415 static void DoDataExchange_RtagDeleteMain(LWindow *theDialog, const MultiFiles* mf,
00416     CPStr & sLastModule, CPStr & sLastTag,
00417     bool & noRecurs, bool & lookAttic, bool putValue)
00418 {
00419     LEditText *mname = dynamic_cast<LEditText*>
00420         (theDialog->FindPaneByID(item_ModuleName));
00421     LEditText *tname = dynamic_cast<LEditText*>
00422         (theDialog->FindPaneByID(item_BranchRev));
00423     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00424         (theDialog->FindPaneByID(item_InAttic));
00425     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00426         (theDialog->FindPaneByID(item_NoRecurs));
00427     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00428         (theDialog->FindPaneByID(item_FillerTag));
00429
00430     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00431     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00432
00433     if(putValue)
00434     {
00435         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00436         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00437         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00438         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00439     }
00440     else
00441     {
00442         lookAttic = chkLookAttic->GetValue() == Button_On;
00443         noRecurs = chkNoRecurs->GetValue() == Button_On;
00444
00445         char str[255];
00446         Size len;
00447
00448         mname->GetText(str, 254, &len);
00449         sLastModule.set(str, len);
00450         tname->GetText(str, 254, &len);
00451         sLastTag.set(str, len);
00452     }
00453 }
00454
00455 static void DoDataExchange_RtagBranchMain(LWindow *theDialog, const MultiFiles* mf,
00456     CPStr & sLastModule, CPStr & sLastBranch,
00457     bool & hasDate, bool & hasRev,
00458     CPStr & sLastDate, CPStr & sLastRev,
00459     bool & useMostRecent, bool & lookAttic, bool putValue)
00460 {
00461     LEditText *mname = dynamic_cast<LEditText*>
00462         (theDialog->FindPaneByID(item_ModuleName));
00463     LEditText *tname = dynamic_cast<LEditText*>
00464         (theDialog->FindPaneByID(item_BranchRev));
00465     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00466         (theDialog->FindPaneByID(item_CheckDate));
00467     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00468         (theDialog->FindPaneByID(item_CheckRevTag));
00469     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00470         (theDialog->FindPaneByID(item_MostRecentRev));
00471     LCheckBox *chkLookAttic = dynamic_cast<LCheckBox*>
00472         (theDialog->FindPaneByID(item_InAttic));
00473     LEditText *editDate = dynamic_cast<LEditText*>
00474         (theDialog->FindPaneByID(item_EditDate));
00475     LEditText *editRev = dynamic_cast<LEditText*>
00476         (theDialog->FindPaneByID(item_EditRevTag));
00477     LPopupFiller *fillRev = dynamic_cast<LPopupFiller*>
00478         (theDialog->FindPaneByID(item_FillerRev1));
00479     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00480         (theDialog->FindPaneByID(item_FillerTag));
00481     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00482         (theDialog->FindPaneByID(item_FillerDate));
00483
00484     LTagWrapper *wrapper1 = putValue ? NEW LTagWrapper(fillRev, mf) : 0L;
00485     fillRev->DoDataExchange(gRevNames, putValue, wrapper1);
00486     LTagWrapper *wrapper2 = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00487     fillTag->DoDataExchange(gRevNames, putValue, wrapper2);
00488     fillDate->DoDataExchange(gDateNames, putValue);
00489
00490     if(putValue)
00491     {
00492         mname->SetText((Ptr)(const char *)sLastModule, sLastModule.length());
00493         tname->SetText((Ptr)(const char *)sLastBranch, sLastBranch.length());
00494         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00495         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00496         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00497         chkLookAttic->SetValue(lookAttic ? Button_On : Button_Off);
00498         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00499         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00500     }
00501     else
00502     {
00503         hasDate = chkHasDate->GetValue() == Button_On;
00504         hasRev = chkHasRev->GetValue() == Button_On;
00505         useMostRecent = chkMostRecent->GetValue() == Button_On;
00506         lookAttic = chkLookAttic->GetValue() == Button_On;
00507
00508         char str[255];
00509         Size len;
00510
00511         mname->GetText(str, 254, &len);
00512         sLastModule.set(str, len);
00513         tname->GetText(str, 254, &len);
00514         sLastBranch.set(str, len);
00515         editDate->GetText(str, 254, &len);
00516         sLastDate.set(str, len);
00517         editRev->GetText(str, 254, &len);
00518         sLastRev.set(str, len);
00519     }
00520 }
00521
00522 static void DoDataExchange_RtagBranchOptions(LWindow *theDialog,
00523     bool & noRecurs, bool putValue)
00524 {
00525     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00526         (theDialog->FindPaneByID(item_NoRecurs));
00527
00528     if(putValue)
00529     {
00530         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00531     }
00532     else
00533     {
00534         noRecurs = chkNoRecurs->GetValue() == Button_On;
00535     }
00536 }
00537 #endif /* qMacCvsPP */
00538
00539 #if qUnix
00540 class UCvsRtagCreate : public UWidget
00541 {
00542     UDECLARE_DYNAMIC(UCvsRtagCreate)
00543 public:
00544     UCvsRtagCreate() : UWidget(::UEventGetWidID()) {}
00545     virtual ~UCvsRtagCreate() {}
00546
00547     enum
00548     {
00549         kOK = EV_COMMAND_START, // 0
00550         kCancel,                // 1
00551         kTabGeneral             // 2
00552     };
00553
00554     virtual void DoDataExchange(bool fill);
00555
00556 protected:
00557     ev_msg int OnOK(void);
00558     ev_msg int OnCancel(void);
00559
00560     UDECLARE_MESSAGE_MAP()
00561 };
00562
00563 UIMPLEMENT_DYNAMIC(UCvsRtagCreate, UWidget)
00564
00565 UBEGIN_MESSAGE_MAP(UCvsRtagCreate, UWidget)
00566     ON_UCOMMAND(UCvsRtagCreate::kOK, UCvsRtagCreate::OnOK)
00567     ON_UCOMMAND(UCvsRtagCreate::kCancel, UCvsRtagCreate::OnCancel)
00568 UEND_MESSAGE_MAP()
00569
00570 int UCvsRtagCreate::OnOK(void)
00571 {
00572     EndModal(true);
00573     return 0;
00574 }
00575
00576 int UCvsRtagCreate::OnCancel(void)
00577 {
00578     EndModal(false);
00579     return 0;
00580 }
00581
00582 void UCvsRtagCreate::DoDataExchange(bool fill)
00583 {
00584     if(fill)
00585     {
00586     }
00587     else
00588     {
00589     }
00590 }
00591
00592 class UCvsRtagCreate_MAIN : public UWidget
00593 {
00594     UDECLARE_DYNAMIC(UCvsRtagCreate_MAIN)
00595 public:
00596     UCvsRtagCreate_MAIN(const char * sLastModule, const char * sLastTag,
00597                         bool hasDate, bool hasRev,
00598                         const char * sLastDate, const char * sLastRev,
00599                         bool noRecurs, bool overwriteExist,
00600                         bool useMostRecent, bool lookAttic);
00601     virtual ~UCvsRtagCreate_MAIN() {}
00602
00603     enum
00604     {
00605         kEditTag = EV_COMMAND_START,    // 0
00606         kEditMod,           // 1
00607         kCheckRev,          // 2
00608         kCheckDate,         // 3
00609         kComboRev,          // 4
00610         kComboDate,         // 5
00611         kCheckRecurs,       // 6
00612         kCheckAttic,        // 7
00613         kCheckOverwrite,    // 8
00614         kCheckMatch         // 9
00615     };
00616
00617     virtual void DoDataExchange(bool fill);
00618
00619     bool m_attic;
00620     UStr m_date;
00621     UStr m_rev;
00622     bool m_hasdate;
00623     bool m_hasrev;
00624     bool m_norecurs;
00625     bool m_match;
00626     UStr m_modname;
00627     UStr m_tagname;
00628     bool m_overwrite;
00629 protected:
00630     ev_msg int OnChecks(int cmd);
00631
00632     UDECLARE_MESSAGE_MAP()
00633 };
00634
00635 UIMPLEMENT_DYNAMIC(UCvsRtagCreate_MAIN, UWidget)
00636
00637 UBEGIN_MESSAGE_MAP(UCvsRtagCreate_MAIN, UWidget)
00638     ON_UCOMMAND_RANGE(UCvsRtagCreate_MAIN::kCheckRev, UCvsRtagCreate_MAIN::kCheckDate, UCvsRtagCreate_MAIN::OnChecks)
00639 UEND_MESSAGE_MAP()
00640
00641 UCvsRtagCreate_MAIN::UCvsRtagCreate_MAIN(const char * sLastModule, const char * sLastTag,
00642                                          bool hasDate, bool hasRev,
00643                                          const char * sLastDate, const char * sLastRev,
00644                                          bool noRecurs, bool overwriteExist,
00645                                          bool useMostRecent, bool lookAttic) : UWidget(::UEventGetWidID())
00646 {
00647     m_attic = lookAttic;
00648     m_date = sLastDate;
00649     m_rev = sLastRev;
00650     m_hasdate = hasDate;
00651     m_hasrev = hasRev;
00652     m_norecurs = noRecurs;
00653     m_match = useMostRecent;
00654     m_modname = sLastModule;
00655     m_tagname = sLastTag;
00656     m_overwrite = overwriteExist;
00657 }
00658
00659 int UCvsRtagCreate_MAIN::OnChecks(int cmd)
00660 {
00661     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00662     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 2, state), 0L);
00663     return 0;
00664 }
00665
00666 void UCvsRtagCreate_MAIN::DoDataExchange(bool fill)
00667 {
00668     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00669     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00670
00671     if(fill)
00672     {
00673         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00674         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00675         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev, (void *)(const char *)m_rev);
00676         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00677
00678         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00679         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00680         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00681         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00682         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckOverwrite, m_overwrite), 0L);
00683         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00684
00685         OnChecks(kCheckRev);
00686         OnChecks(kCheckDate);
00687     }
00688     else
00689     {
00690         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00691         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00692         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00693         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00694
00695         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00696         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00697         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00698         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00699         m_overwrite = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckOverwrite, 0L);
00700         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00701     }
00702 }
00703
00704 class UCvsRtagDel : public UWidget
00705 {
00706     UDECLARE_DYNAMIC(UCvsRtagDel)
00707 public:
00708     UCvsRtagDel() : UWidget(::UEventGetWidID()) {}
00709     virtual ~UCvsRtagDel() {}
00710
00711     enum
00712     {
00713         kOK = EV_COMMAND_START, // 0
00714         kCancel,                // 1
00715         kTabGeneral             // 2
00716     };
00717
00718     virtual void DoDataExchange(bool fill);
00719
00720 protected:
00721     ev_msg int OnOK(void);
00722     ev_msg int OnCancel(void);
00723
00724     UDECLARE_MESSAGE_MAP()
00725 };
00726
00727 UIMPLEMENT_DYNAMIC(UCvsRtagDel, UWidget)
00728
00729 UBEGIN_MESSAGE_MAP(UCvsRtagDel, UWidget)
00730     ON_UCOMMAND(UCvsRtagDel::kOK, UCvsRtagDel::OnOK)
00731     ON_UCOMMAND(UCvsRtagDel::kCancel, UCvsRtagDel::OnCancel)
00732 UEND_MESSAGE_MAP()
00733
00734 int UCvsRtagDel::OnOK(void)
00735 {
00736     EndModal(true);
00737     return 0;
00738 }
00739
00740 int UCvsRtagDel::OnCancel(void)
00741 {
00742     EndModal(false);
00743     return 0;
00744 }
00745
00746 void UCvsRtagDel::DoDataExchange(bool fill)
00747 {
00748     if(fill)
00749     {
00750     }
00751     else
00752     {
00753     }
00754 }
00755
00756 class UCvsRtagDel_MAIN : public UWidget
00757 {
00758     UDECLARE_DYNAMIC(UCvsRtagDel_MAIN)
00759 public:
00760     UCvsRtagDel_MAIN(const char * sLastModule,
00761                      const char * sLastTag, bool noRecurs,
00762                      bool lookAttic);
00763     virtual ~UCvsRtagDel_MAIN() {}
00764
00765     enum
00766     {
00767         kEditTag = EV_COMMAND_START,    // 0
00768         kEditMod,           // 1
00769         kCheckRecurs,       // 2
00770         kCheckAttic         // 3
00771     };
00772
00773     virtual void DoDataExchange(bool fill);
00774
00775     bool m_attic;
00776     bool m_norecurs;
00777     UStr m_modname;
00778     UStr m_tagname;
00779 protected:
00780
00781     UDECLARE_MESSAGE_MAP()
00782 };
00783
00784 UIMPLEMENT_DYNAMIC(UCvsRtagDel_MAIN, UWidget)
00785
00786 UBEGIN_MESSAGE_MAP(UCvsRtagDel_MAIN, UWidget)
00787 UEND_MESSAGE_MAP()
00788
00789 UCvsRtagDel_MAIN::UCvsRtagDel_MAIN(const char * sLastModule,
00790                                    const char * sLastTag, bool noRecurs,
00791                                    bool lookAttic) : UWidget(::UEventGetWidID())
00792 {
00793     m_attic = lookAttic;
00794     m_norecurs = noRecurs;
00795     m_modname = sLastModule;
00796     m_tagname = sLastTag;
00797 }
00798
00799 void UCvsRtagDel_MAIN::DoDataExchange(bool fill)
00800 {
00801     if(fill)
00802     {
00803         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00804         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00805
00806         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00807         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00808     }
00809     else
00810     {
00811         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00812         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00813
00814         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00815         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00816     }
00817 }
00818
00819 class UCvsRtagBranch : public UWidget
00820 {
00821     UDECLARE_DYNAMIC(UCvsRtagBranch)
00822 public:
00823     UCvsRtagBranch() : UWidget(::UEventGetWidID()) {}
00824     virtual ~UCvsRtagBranch() {}
00825
00826     enum
00827     {
00828         kOK = EV_COMMAND_START, // 0
00829         kCancel,                // 1
00830         kTabGeneral             // 2
00831     };
00832
00833     virtual void DoDataExchange(bool fill);
00834
00835 protected:
00836     ev_msg int OnOK(void);
00837     ev_msg int OnCancel(void);
00838
00839     UDECLARE_MESSAGE_MAP()
00840 };
00841
00842 UIMPLEMENT_DYNAMIC(UCvsRtagBranch, UWidget)
00843
00844 UBEGIN_MESSAGE_MAP(UCvsRtagBranch, UWidget)
00845     ON_UCOMMAND(UCvsRtagBranch::kOK, UCvsRtagBranch::OnOK)
00846     ON_UCOMMAND(UCvsRtagBranch::kCancel, UCvsRtagBranch::OnCancel)
00847 UEND_MESSAGE_MAP()
00848
00849 int UCvsRtagBranch::OnOK(void)
00850 {
00851     EndModal(true);
00852     return 0;
00853 }
00854
00855 int UCvsRtagBranch::OnCancel(void)
00856 {
00857     EndModal(false);
00858     return 0;
00859 }
00860
00861 void UCvsRtagBranch::DoDataExchange(bool fill)
00862 {
00863     if(fill)
00864     {
00865     }
00866     else
00867     {
00868     }
00869 }
00870
00871 class UCvsRtagBranch_MAIN : public UWidget
00872 {
00873     UDECLARE_DYNAMIC(UCvsRtagBranch_MAIN)
00874 public:
00875     UCvsRtagBranch_MAIN(const char * sLastModule, const char * sLastTag,
00876                         bool hasDate, bool hasRev,
00877                         const char * sLastDate, const char * sLastRev,
00878                         bool noRecurs, bool useMostRecent, bool lookAttic);
00879     virtual ~UCvsRtagBranch_MAIN() {}
00880
00881     enum
00882     {
00883         kEditTag = EV_COMMAND_START,    // 0
00884         kEditMod,           // 1
00885         kCheckRev,          // 2
00886         kCheckDate,         // 3
00887         kComboRev,          // 4
00888         kComboDate,         // 5
00889         kCheckRecurs,       // 6
00890         kCheckAttic,        // 7
00891         kCheckMatch         // 9
00892     };
00893
00894     virtual void DoDataExchange(bool fill);
00895
00896     bool m_attic;
00897     UStr m_date;
00898     UStr m_rev;
00899     bool m_hasdate;
00900     bool m_hasrev;
00901     bool m_norecurs;
00902     bool m_match;
00903     UStr m_modname;
00904     UStr m_tagname;
00905 protected:
00906     ev_msg int OnChecks(int cmd);
00907
00908     UDECLARE_MESSAGE_MAP()
00909 };
00910
00911 UIMPLEMENT_DYNAMIC(UCvsRtagBranch_MAIN, UWidget)
00912
00913 UBEGIN_MESSAGE_MAP(UCvsRtagBranch_MAIN, UWidget)
00914     ON_UCOMMAND_RANGE(UCvsRtagBranch_MAIN::kCheckRev, UCvsRtagBranch_MAIN::kCheckDate, UCvsRtagBranch_MAIN::OnChecks)
00915 UEND_MESSAGE_MAP()
00916
00917 UCvsRtagBranch_MAIN::UCvsRtagBranch_MAIN(const char * sLastModule, const char * sLastTag,
00918                                              bool hasDate, bool hasRev, const char * sLastDate,
00919                                              const char * sLastRev, bool noRecurs, bool useMostRecent,
00920                                              bool lookAttic) : UWidget(::UEventGetWidID())
00921 {
00922     m_attic = lookAttic;
00923     m_date = sLastDate;
00924     m_rev = sLastRev;
00925     m_hasdate = hasDate;
00926     m_hasrev = hasRev;
00927     m_norecurs = noRecurs;
00928     m_match = useMostRecent;
00929     m_modname = sLastModule;
00930     m_tagname = sLastTag;
00931 }
00932
00933 int UCvsRtagBranch_MAIN::OnChecks(int cmd)
00934 {
00935     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, cmd, 0L);
00936     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(cmd + 2, state), 0L);
00937     return 0;
00938 }
00939
00940 void UCvsRtagBranch_MAIN::DoDataExchange(bool fill)
00941 {
00942     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00943     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00944
00945     if(fill)
00946     {
00947         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00948         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditMod, (void *)(const char *)m_modname);
00949         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboRev, (void *)(const char *)m_rev);
00950         UEventSendMessage(GetWidID(), EV_SETTEXT, kComboDate, (void *)(const char *)m_date);
00951
00952         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00953         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00954         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckAttic, m_attic), 0L);
00955         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00956         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00957
00958         OnChecks(kCheckRev);
00959         OnChecks(kCheckDate);
00960     }
00961     else
00962     {
00963         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00964         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditMod, &m_modname);
00965         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00966         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00967
00968         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00969         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00970         m_attic = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckAttic, 0L);
00971         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00972         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00973     }
00974 }
00975
00976 #endif // qUnix
00977
00979 bool CompatRtagCreate(const MultiFiles* mf,
00980                       bool& noRecurs, bool& overwriteExisting, CPStr& tagName,
00981                       CPStr& modName, CPStr& date, CPStr& rev,
00982                       bool& useMostRecent, bool& lookAttic)
00983 {
00984     bool userHitOK = false;
00985
00986     static CPStr sLastModule;
00987     static CPStr sLastTag;
00988     static CPStr sLastDate;
00989     static CPStr sLastRev;
00990
00991     bool hasDate = false;
00992     bool hasRev = false;
00993
00994     date = "";
00995     rev = "";
00996     tagName = "";
00997     modName = "";
00998     noRecurs = false;
00999     overwriteExisting = false;
01000     useMostRecent = false;
01001     lookAttic = false;
01002
01003 #ifdef WIN32
01004     CPropertySheet pages("Create tag settings");
01005     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01006     CRtag_MAIN page1(mf, kRtagAdd, sLastModule, sLastTag, noRecurs, lookAttic, overwriteExisting);
01007     CRtag_OPTIONS page2(mf, kRtagAdd, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01008     CGetPrefs_GLOBALS page3;
01009     pages.AddPage(&page1);
01010     pages.AddPage(&page2);
01011     pages.AddPage(&page3);
01012     if(pages.DoModal() == IDOK)
01013     {
01014         sLastModule = page1.m_moduleName;
01015         sLastTag = page1.m_tagName;
01016         noRecurs = page1.m_noRecurs == TRUE;
01017         overwriteExisting = page1.m_overwriteExisting == TRUE;
01018         lookAttic = page1.m_lookAttic == TRUE;
01019
01020         sLastDate = page2.m_date;
01021         sLastRev = page2.m_rev;
01022         hasDate = page2.m_hasDate == TRUE;
01023         hasRev = page2.m_hasRev == TRUE;
01024         useMostRecent = page2.m_useMostRecent == TRUE;
01025
01026         page3.StoreValues();
01027         userHitOK = true;
01028     }
01029 #endif /* WIN32 */
01030 #if qUnix
01031     void *wid = UCreate_TagModDlg();
01032
01033     UCvsRtagCreate *dlg = new UCvsRtagCreate();
01034     UCvsRtagCreate_MAIN *tab1 =
01035         new UCvsRtagCreate_MAIN(sLastModule, sLastTag, hasDate, hasRev,
01036                                 sLastDate, sLastRev, noRecurs, overwriteExisting,
01037                                 useMostRecent, lookAttic);
01038     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01039     dlg->AddPage(tab1, UCvsRtagCreate::kTabGeneral, 0);
01040
01041     if(dlg->DoModal())
01042     {
01043         lookAttic = tab1->m_attic;
01044         sLastDate = tab1->m_date;
01045         sLastRev = tab1->m_rev;
01046         hasDate = tab1->m_hasdate;
01047         hasRev = tab1->m_hasrev;
01048         noRecurs = tab1->m_norecurs;
01049         useMostRecent = tab1->m_match;
01050         sLastModule = tab1->m_modname;
01051         sLastTag = tab1->m_tagname;
01052         overwriteExisting = tab1->m_overwrite;
01053
01054         userHitOK = true;
01055     }
01056
01057     delete dlg;
01058 #endif // qUnix
01059 #ifdef qMacCvsPP
01060     StDialogHandler theHandler(dlg_RtagCreate, LCommander::GetTopCommander());
01061     LWindow *theDialog = theHandler.GetDialog();
01062     ThrowIfNil_(theDialog);
01063     static UInt16 sRuntimePanel = 1;
01064
01065     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01066         (theDialog->FindPaneByID(item_MultiViewPrefs));
01067     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01068
01069     multiView->SwitchToPanel(3);
01070     DoDataExchange_Globals(theDialog, true);
01071     multiView->SwitchToPanel(2);
01072     DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, true);
01073     multiView->SwitchToPanel(1);
01074     DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01075         hasDate, hasRev, sLastDate, sLastRev,
01076         useMostRecent, lookAttic, true);
01077
01078     groupView->SetValue(sRuntimePanel);
01079     theDialog->Show();
01080     MessageT hitMessage;
01081     while (true)
01082     {       // Let DialogHandler process events
01083         hitMessage = theHandler.DoDialog();
01084
01085         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01086             break;
01087     }
01088     theDialog->Hide();
01089     sRuntimePanel = groupView->GetValue();
01090
01091     if(hitMessage == msg_OK)
01092     {
01093         multiView->SwitchToPanel(1);
01094         DoDataExchange_RtagCreateMain(theDialog, mf, sLastModule, sLastTag,
01095             hasDate, hasRev, sLastDate, sLastRev,
01096             useMostRecent, lookAttic, false);
01097         multiView->SwitchToPanel(2);
01098         DoDataExchange_RtagCreateOptions(theDialog, noRecurs, overwriteExisting, false);
01099         multiView->SwitchToPanel(3);
01100         DoDataExchange_Globals(theDialog, false);
01101         userHitOK = true;
01102     }
01103 #endif /* qMacCvsPP */
01104
01105     if(userHitOK)
01106     {
01107         if(hasDate && !sLastDate.empty())
01108             date = sLastDate;
01109         if(hasRev && !sLastRev.empty())
01110             rev = sLastRev;
01111
01112         tagName = sLastTag;
01113         modName = sLastModule;
01114
01115         gCvsPrefs.save();
01116     }
01117
01118     return userHitOK;
01119 }
01120
01122 bool CompatRtagDelete(const MultiFiles* mf,
01123                       bool& noRecurs, bool& lookAttic,
01124                       CPStr& tagName, CPStr& modName)
01125 {
01126
01127     bool userHitOK = false;
01128
01129     static CPStr sLastModule;
01130     static CPStr sLastTag;
01131
01132     tagName = "";
01133     modName = "";
01134     noRecurs = false;
01135     lookAttic = false;
01136
01137 #ifdef WIN32
01138     CPropertySheet pages("Delete tag settings");
01139     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01140     CRtag_MAIN page1(mf, kRtagDelete, sLastModule, sLastTag, noRecurs, lookAttic);
01141     CGetPrefs_GLOBALS page2;
01142     pages.AddPage(&page1);
01143     pages.AddPage(&page2);
01144     if(pages.DoModal() == IDOK)
01145     {
01146         lookAttic = page1.m_lookAttic == TRUE;
01147         noRecurs = page1.m_noRecurs == TRUE;
01148         sLastModule = page1.m_moduleName;
01149         sLastTag = page1.m_tagName;
01150
01151         page2.StoreValues();
01152         userHitOK = true;
01153     }
01154 #endif /* WIN32 */
01155 #if qUnix
01156     void *wid = UCreate_UntagModDlg();
01157
01158     UCvsRtagDel *dlg = new UCvsRtagDel();
01159     UCvsRtagDel_MAIN *tab1 = new UCvsRtagDel_MAIN(sLastModule, sLastTag,
01160                                                   noRecurs, lookAttic);
01161     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01162     dlg->AddPage(tab1, UCvsRtagDel::kTabGeneral, 0);
01163
01164     if(dlg->DoModal())
01165     {
01166         lookAttic = tab1->m_attic;
01167         noRecurs = tab1->m_norecurs;
01168         sLastModule = tab1->m_modname;
01169         sLastTag = tab1->m_tagname;
01170
01171         userHitOK = true;
01172     }
01173
01174     delete dlg;
01175 #endif // qUnix
01176 #ifdef qMacCvsPP
01177     StDialogHandler theHandler(dlg_RtagDelete, LCommander::GetTopCommander());
01178     LWindow *theDialog = theHandler.GetDialog();
01179     ThrowIfNil_(theDialog);
01180     static UInt16 sRuntimePanel = 1;
01181
01182     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01183         (theDialog->FindPaneByID(item_MultiViewPrefs));
01184     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01185
01186     multiView->SwitchToPanel(2);
01187     DoDataExchange_Globals(theDialog, true);
01188     multiView->SwitchToPanel(1);
01189     DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01190         noRecurs, lookAttic, true);
01191
01192     groupView->SetValue(sRuntimePanel);
01193     theDialog->Show();
01194     MessageT hitMessage;
01195     while (true)
01196     {       // Let DialogHandler process events
01197         hitMessage = theHandler.DoDialog();
01198
01199         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01200             break;
01201     }
01202     theDialog->Hide();
01203     sRuntimePanel = groupView->GetValue();
01204
01205     if(hitMessage == msg_OK)
01206     {
01207         multiView->SwitchToPanel(1);
01208         DoDataExchange_RtagDeleteMain(theDialog, mf, sLastModule, sLastTag,
01209             noRecurs, lookAttic, false);
01210         multiView->SwitchToPanel(2);
01211         DoDataExchange_Globals(theDialog, false);
01212         userHitOK = true;
01213     }
01214 #endif /* qMacCvsPP */
01215
01216     if(userHitOK)
01217     {
01218         tagName = sLastTag;
01219         modName = sLastModule;
01220
01221         gCvsPrefs.save();
01222     }
01223
01224     return userHitOK;
01225 }
01226
01228 bool CompatRtagBranch(const MultiFiles* mf,
01229                       bool& noRecurs, CPStr& branchName,
01230                       CPStr& modName, CPStr& date, CPStr& rev,
01231                       bool& useMostRecent, bool& lookAttic)
01232 {
01233     bool userHitOK = false;
01234
01235     static CPStr sLastModule;
01236     static CPStr sLastBranch;
01237     static CPStr sLastDate;
01238     static CPStr sLastRev;
01239
01240     bool hasDate = false;
01241     bool hasRev = false;
01242
01243     date = "";
01244     rev = "";
01245     branchName = "";
01246     modName = "";
01247     noRecurs = false;
01248     useMostRecent = false;
01249     lookAttic = false;
01250
01251 #ifdef WIN32
01252     CPropertySheet pages("Create branch settings");
01253     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
01254
01255     CRtag_MAIN page1(mf, kRtagFork, sLastModule, sLastBranch, noRecurs, lookAttic);
01256     CRtag_OPTIONS page2(mf, kRtagFork, hasDate, hasRev, sLastDate, sLastRev, useMostRecent);
01257     CGetPrefs_GLOBALS page3;
01258     pages.AddPage(&page1);
01259     pages.AddPage(&page2);
01260     pages.AddPage(&page3);
01261     if(pages.DoModal() == IDOK)
01262     {
01263         sLastModule = page1.m_moduleName;
01264         sLastBranch = page1.m_tagName;
01265         noRecurs = page1.m_noRecurs == TRUE;
01266         lookAttic = page1.m_lookAttic == TRUE;
01267         sLastDate = page2.m_date;
01268         sLastRev = page2.m_rev;
01269         hasDate = page2.m_hasDate == TRUE;
01270         hasRev = page2.m_hasRev == TRUE;
01271         useMostRecent = page2.m_useMostRecent == TRUE;
01272
01273         page3.StoreValues();
01274         userHitOK = true;
01275     }
01276 #endif /* WIN32 */
01277 #if qUnix
01278     void *wid = UCreate_BranchModDlg();
01279
01280     UCvsRtagBranch *dlg = new UCvsRtagBranch();
01281     UCvsRtagBranch_MAIN *tab1 =
01282         new UCvsRtagBranch_MAIN(sLastModule, sLastBranch, hasDate, hasRev,
01283                                   sLastDate, sLastRev, noRecurs, useMostRecent,
01284                                   lookAttic);
01285     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
01286     dlg->AddPage(tab1, UCvsRtagBranch::kTabGeneral, 0);
01287
01288     if(dlg->DoModal())
01289     {
01290         lookAttic = tab1->m_attic;
01291         sLastDate = tab1->m_date;
01292         sLastRev = tab1->m_rev;
01293         hasDate = tab1->m_hasdate;
01294         hasRev = tab1->m_hasrev;
01295         noRecurs = tab1->m_norecurs;
01296         useMostRecent = tab1->m_match;
01297         sLastModule = tab1->m_modname;
01298         sLastBranch = tab1->m_tagname;
01299
01300         userHitOK = true;
01301     }
01302
01303     delete dlg;
01304 #endif // qUnix
01305 #ifdef qMacCvsPP
01306     StDialogHandler theHandler(dlg_RtagBranch, LCommander::GetTopCommander());
01307     LWindow *theDialog = theHandler.GetDialog();
01308     ThrowIfNil_(theDialog);
01309     static UInt16 sRuntimePanel = 1;
01310
01311     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
01312         (theDialog->FindPaneByID(item_MultiViewPrefs));
01313     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
01314
01315     multiView->SwitchToPanel(3);
01316     DoDataExchange_Globals(theDialog, true);
01317     multiView->SwitchToPanel(2);
01318     DoDataExchange_RtagBranchOptions(theDialog, noRecurs, true);
01319     multiView->SwitchToPanel(1);
01320     DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01321         hasDate, hasRev, sLastDate, sLastRev,
01322         useMostRecent, lookAttic, true);
01323
01324     groupView->SetValue(sRuntimePanel);
01325     theDialog->Show();
01326     MessageT hitMessage;
01327     while (true)
01328     {       // Let DialogHandler process events
01329         hitMessage = theHandler.DoDialog();
01330
01331         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
01332             break;
01333     }
01334     theDialog->Hide();
01335     sRuntimePanel = groupView->GetValue();
01336
01337     if(hitMessage == msg_OK)
01338     {
01339         multiView->SwitchToPanel(1);
01340         DoDataExchange_RtagBranchMain(theDialog, mf, sLastModule, sLastBranch,
01341             hasDate, hasRev, sLastDate, sLastRev,
01342             useMostRecent, lookAttic, false);
01343         multiView->SwitchToPanel(2);
01344         DoDataExchange_RtagBranchOptions(theDialog, noRecurs, false);
01345         multiView->SwitchToPanel(3);
01346         DoDataExchange_Globals(theDialog, false);
01347         userHitOK = true;
01348     }
01349 #endif /* qMacCvsPP */
01350
01351     if(userHitOK)
01352     {
01353         if(hasDate && !sLastDate.empty())
01354             date = sLastDate;
01355         if(hasRev && !sLastRev.empty())
01356             rev = sLastRev;
01357
01358         branchName = sLastBranch;
01359         modName = sLastModule;
01360
01361         gCvsPrefs.save();
01362     }
01363
01364     return userHitOK;
01365 }
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 class MultiFiles;
00036
00037 bool CompatRtagCreate(const MultiFiles* mf,
00038                       bool& noRecurs, bool& overwriteExisting, CPStr& tagName,
00039                       CPStr& modName, CPStr& date, CPStr& rev,
00040                       bool& useMostRecent, bool& lookAttic);
00041
00042 bool CompatRtagDelete(const MultiFiles* mf,
00043                       bool& noRecurs, bool& lookAttic,
00044                       CPStr& tagName, CPStr& modName);
00045
00046 bool CompatRtagBranch(const MultiFiles* mf,
00047                       bool& noRecurs, CPStr& branchName,
00048                       CPStr& modName, CPStr& date, CPStr& rev,
00049                       bool& useMostRecent, bool& lookAttic);
00050
00051 extern CMString gOldModules;
00052
00054 typedef enum
00055 {
00056     kRtagAdd,
00057     kRtagDelete,
00058     kRtagFork
00059 } kRtagDlgType;
00060
00061 #ifdef WIN32
00062
00063 // CRtag_MAIN dialog
00064
00065 class CRtag_MAIN : public CPropertyPage
00066 {
00067     DECLARE_DYNAMIC(CRtag_MAIN)
00068
00069 // Construction
00070 public:
00071     CRtag_MAIN(const MultiFiles* mf,
00072         kRtagDlgType type,
00073         const char *sLastModule, const char *sLastTag,
00074         bool noRecurs, bool lookAttic, bool overwriteExist = false);
00075     ~CRtag_MAIN();
00076
00077 // Dialog Data
00078     //{{AFX_DATA(CRtag_MAIN)
00079     enum { IDD = IDD_RTAG_MAIN };
00080     CButton m_overwriteExistingCheck;
00081     CStatic m_moduleDescStatic;
00082     CStatic m_tagDescStatic;
00083     CButton m_grpBox;
00084     CSmartComboBox  m_moduleCombo;
00085     CSmartComboBox  m_tagCombo;
00086     CString m_tagName;
00087     CString m_moduleName;
00088     BOOL    m_noRecurs;
00089     BOOL    m_lookAttic;
00090     BOOL    m_overwriteExisting;
00091     //}}AFX_DATA
00092
00093
00094 // Overrides
00095     // ClassWizard generate virtual function overrides
00096     //{{AFX_VIRTUAL(CRtag_MAIN)
00097     protected:
00098     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00099     //}}AFX_VIRTUAL
00100
00101 // Implementation
00102 protected:
00103     // Generated message map functions
00104     //{{AFX_MSG(CRtag_MAIN)
00105     virtual BOOL OnInitDialog();
00106     afx_msg void OnBrowseTag();
00107     afx_msg void OnBrowseModules();
00108     //}}AFX_MSG
00109     DECLARE_MESSAGE_MAP()
00110 private:
00111     const MultiFiles* m_mf;
00112     kRtagDlgType m_type;
00113 };
00114
00116 // CRtag_OPTIONS dialog
00117
00118 class CRtag_OPTIONS : public CPropertyPage
00119 {
00120     DECLARE_DYNAMIC(CRtag_OPTIONS)
00121
00122 // Construction
00123 public:
00124     CRtag_OPTIONS(const MultiFiles* mf,
00125         kRtagDlgType type,
00126         bool hasDate, bool hasRev,
00127         const char* sLastDate, const char* sLastRev,
00128         bool useMostRecent);
00129     CRtag_OPTIONS();
00130     ~CRtag_OPTIONS();
00131
00132 // Dialog Data
00133     //{{AFX_DATA(CRtag_OPTIONS)
00134     enum { IDD = IDD_RTAG_OPTIONS };
00135     CSmartComboBox  m_revCombo;
00136     CSmartComboBox  m_dateCombo;
00137     CButton m_grpBox;
00138     CString m_date;
00139     CString m_rev;
00140     BOOL    m_hasDate;
00141     BOOL    m_hasRev;
00142     BOOL    m_useMostRecent;
00143     //}}AFX_DATA
00144
00145
00146 // Overrides
00147     // ClassWizard generate virtual function overrides
00148     //{{AFX_VIRTUAL(CRtag_OPTIONS)
00149     protected:
00150     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00151     //}}AFX_VIRTUAL
00152
00153 // Implementation
00154 protected:
00155     // Generated message map functions
00156     //{{AFX_MSG(CRtag_OPTIONS)
00157     afx_msg void OnDate();
00158     afx_msg void OnRev();
00159     virtual BOOL OnInitDialog();
00160     afx_msg void OnBrowseTag();
00161     //}}AFX_MSG
00162     DECLARE_MESSAGE_MAP()
00163 private:
00164     const MultiFiles* m_mf;
00165     kRtagDlgType m_type;
00166 };
00167
00168 //{{AFX_INSERT_LOCATION}}
00169 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00170 #endif /* WIN32 */
00171
00172 #endif // !defined(AFX_RTAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


common/SelectionDetailsDlg.cpp Source File

common/SelectionDetailsDlg.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> --- January 2003
00019  */
00020
00021 // SelectionDetailsDlg.cpp : implementation file
00022 //
00023
00024 #include "stdafx.h"
00025
00026 #if qUnix
00027 #   include "UCvsDialogs.h"
00028 #endif
00029
00030 #ifdef WIN32
00031 #   include "wincvs.h"
00032 #   include "wincvs_winutil.h"
00033 #endif /* !WIN32 */
00034
00035 #include "SelectionDetailsDlg.h"
00036
00037 #ifdef _DEBUG
00038 #define new DEBUG_NEW
00039 #undef THIS_FILE
00040 static char THIS_FILE[] = __FILE__;
00041 #endif
00042
00043
00044 #ifdef WIN32
00045
00047 // SelectionDisplayInfo
00048
00055 void SelectionDisplayInfo::Create(const string& fileName, const string& revision, const string& path)
00056 {
00057     m_fileName = fileName;
00058     m_revision = revision;
00059     m_path = path;
00060 }
00061
00063 const string& SelectionDisplayInfo::GetFileName() const
00064 {
00065     return m_fileName;
00066 }
00067
00069 const string& SelectionDisplayInfo::GetRevision() const
00070 {
00071     return m_revision;
00072 }
00073
00075 const string& SelectionDisplayInfo::GetPath() const
00076 {
00077     return m_path;
00078 }
00079
00080
00088 int CALLBACK CSelectionDetailsDlg::CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam)
00089 {
00090     int res = 0;
00091
00092     const CompareInfo* info = (CompareInfo*)lParam;
00093     if( info )
00094     {
00095         SelectionDisplayInfo* displayInfo1 = (SelectionDisplayInfo*)itemData1;
00096         SelectionDisplayInfo* displayInfo2 = (SelectionDisplayInfo*)itemData2;
00097
00098         if( displayInfo1 && displayInfo2 )
00099         {
00100             switch( info->m_column )
00101             {
00102             case 0:
00103                 res = stricmp(displayInfo1->GetFileName().c_str(), displayInfo2->GetFileName().c_str());
00104                 break;
00105             case 1:
00106                 res = stricmp(displayInfo1->GetRevision().c_str(), displayInfo2->GetRevision().c_str());
00107                 break;
00108             case 2:
00109                 res = stricmp(displayInfo1->GetPath().c_str(), displayInfo2->GetPath().c_str());
00110                 break;
00111             default:
00112                 ASSERT(FALSE); // should not come here
00113                 break;
00114             }
00115         }
00116     }
00117
00118     if( res )
00119     {
00120         if( info->m_asc )
00121         {
00122             res *= -1;
00123         }
00124     }
00125
00126     return res;
00127 }
00128
00130 // CSelectionDetailsDlg dialog
00131
00132 CSelectionDetailsDlg::CSelectionDetailsDlg(const MultiFiles* mf, const kSelDetType selDetType, const char* selection,
00133                                            CWnd* pParent /*=NULL*/)
00134     : m_mf(mf), CDialog(CSelectionDetailsDlg::IDD, pParent)
00135 {
00136     //{{AFX_DATA_INIT(CSelectionDetailsDlg)
00137     m_selection = selection;
00138     m_selDetType = selDetType;
00139     //}}AFX_DATA_INIT
00140
00141     m_sortAsc = false;
00142     m_sortColumn = 0;
00143 }
00144
00145
00146 void CSelectionDetailsDlg::DoDataExchange(CDataExchange* pDX)
00147 {
00148     CDialog::DoDataExchange(pDX);
00149     //{{AFX_DATA_MAP(CSelectionDetailsDlg)
00150     DDX_Control(pDX, IDC_REVISION, m_revisionCheck);
00151     DDX_Control(pDX, IDC_FILENAME, m_fileNameCheck);
00152     DDX_Control(pDX, IDC_PATH, m_pathCheck);
00153     DDX_Control(pDX, IDC_SELECTION, m_selectionEdit);
00154     DDX_Control(pDX, IDC_REVISION_SPIN, m_revisionSpinCtrl);
00155     DDX_Control(pDX, IDC_SELECTIONLIST, m_selectionListCtrl);
00156     DDX_Text(pDX, IDC_SELECTION, m_selection);
00157     DDX_Radio(pDX, IDC_FILENAME, m_selDetType);
00158     //}}AFX_DATA_MAP
00159 }
00160
00161
00162 BEGIN_MESSAGE_MAP(CSelectionDetailsDlg, CDialog)
00163     //{{AFX_MSG_MAP(CSelectionDetailsDlg)
00164     ON_NOTIFY(NM_DBLCLK, IDC_SELECTIONLIST, OnDblclkSelectionlist)
00165     ON_NOTIFY(LVN_COLUMNCLICK, IDC_SELECTIONLIST, OnColumnclickSelectionlist)
00166     ON_NOTIFY(LVN_ITEMCHANGED, IDC_SELECTIONLIST, OnItemchangedSelectionlist)
00167     ON_NOTIFY(UDN_DELTAPOS, IDC_REVISION_SPIN, OnDeltaposRevisionSpin)
00168     ON_BN_CLICKED(IDC_FILENAME, OnFilename)
00169     ON_BN_CLICKED(IDC_PATH, OnPath)
00170     ON_BN_CLICKED(IDC_REVISION, OnRevision)
00171     ON_WM_DESTROY()
00172     //}}AFX_MSG_MAP
00173 END_MESSAGE_MAP()
00174
00175
00176 // CSelectionDetailsDlg message handlers
00177
00178
00179 BOOL CSelectionDetailsDlg::OnInitDialog()
00180 {
00181     CDialog::OnInitDialog();
00182
00183     // Extra initialization
00184     SetListCtrlExtendedStyle(&m_selectionListCtrl, LVS_EX_FULLROWSELECT);
00185     m_revisionSpinCtrl.SetRange(0, 100);
00186
00187     // Setup controls
00188     CHeaderCtrl* headerCtrl = m_selectionListCtrl.GetHeaderCtrl();
00189     if( headerCtrl )
00190     {
00191         m_headerCtrl.SubclassWindow(headerCtrl->m_hWnd);
00192     }
00193
00194     EnableControls();
00195
00196     // Display items
00197     DisplaySelection();
00198
00199     return TRUE;  // return TRUE unless you set the focus to a control
00200                   // EXCEPTION: OCX Property Pages should return FALSE
00201 }
00202
00206 void CSelectionDetailsDlg::DisplaySelection()
00207 {
00208     CWndRedrawMngr redrawMngr(&m_selectionListCtrl);
00209
00210     // Get the client area width to properly size columns
00211     CRect rect;
00212     m_selectionListCtrl.GetClientRect(rect);
00213
00214     const int listCtrlWidth = rect.Width();
00215     const int listCtrlWidthNoScroll = listCtrlWidth - GetSystemMetrics(SM_CXVSCROLL);
00216
00217     // Insert columns
00218     m_selectionListCtrl.InsertColumn(0, "Filename", LVCFMT_LEFT, 200);
00219     m_selectionListCtrl.InsertColumn(1, "Revision", LVCFMT_LEFT, 60);
00220     m_selectionListCtrl.InsertColumn(2, "Path", LVCFMT_LEFT, listCtrlWidthNoScroll - 60 - 200);
00221
00222     // The browser selection
00223     if( m_mf )
00224     {
00225         if( m_mf->TotalNumFiles() )
00226         {
00227             MultiFiles::const_iterator mfi;
00228             for(mfi = m_mf->begin(); mfi != m_mf->end(); ++mfi)
00229             {
00230                 for(int nIndex = 0; nIndex < mfi->NumFiles(); nIndex++)
00231                 {
00232                     CStr fileName;
00233                     CStr currRev;
00234                     CStr path;
00235
00236                     if( mfi->get(nIndex, path, fileName, currRev) )
00237                     {
00238                         const int itemIndex = m_selectionListCtrl.InsertItem(m_selectionListCtrl.GetItemCount(), fileName.c_str());
00239                         if( itemIndex > -1 )
00240                         {
00241                             m_selectionListCtrl.SetItemText(itemIndex, 1, currRev.c_str());
00242                             m_selectionListCtrl.SetItemText(itemIndex, 2, path.c_str());
00243
00244                             SelectionDisplayInfo* displayInfo = new SelectionDisplayInfo;
00245                             if( displayInfo )
00246                             {
00247                                 displayInfo->Create(string(fileName.c_str()), string(currRev.c_str()), string(path.c_str()));
00248                                 if( !m_selectionListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
00249                                 {
00250                                     delete displayInfo;
00251                                 }
00252                             }
00253                         }
00254                     }
00255                 }
00256             }
00257         }
00258         else if( m_mf->NumDirs() )
00259         {
00260             for(int nIndex = 0; nIndex < m_mf->NumDirs(); nIndex++)
00261             {
00262                 CStr path;
00263                 if( m_mf->getdir(nIndex, path) )
00264                 {
00265                     const int itemIndex = m_selectionListCtrl.InsertItem(m_selectionListCtrl.GetItemCount(), "");
00266                     if( itemIndex > -1 )
00267                     {
00268                         m_selectionListCtrl.SetItemText(itemIndex, 2, path.c_str());
00269
00270                         SelectionDisplayInfo* displayInfo = new SelectionDisplayInfo;
00271                         if( displayInfo )
00272                         {
00273                             displayInfo->Create(string(""), string(""), string(path.c_str()));
00274                             if( !m_selectionListCtrl.SetItemData(itemIndex, (DWORD)displayInfo) )
00275                             {
00276                                 delete displayInfo;
00277                             }
00278                         }
00279                     }
00280                 }
00281             }
00282         }
00283     }
00284 }
00285
00289 void CSelectionDetailsDlg::DeleteAllItems()
00290 {
00291     for(int nIndex = 0; nIndex < m_selectionListCtrl.GetItemCount(); nIndex++)
00292     {
00293         SelectionDisplayInfo* displayInfo = (SelectionDisplayInfo*)m_selectionListCtrl.GetItemData(nIndex);
00294         delete displayInfo;
00295     }
00296
00297     m_selectionListCtrl.DeleteAllItems();
00298 }
00299
00301 void CSelectionDetailsDlg::OnDestroy()
00302 {
00303     DeleteAllItems();
00304
00305     CDialog::OnDestroy();
00306 }
00307
00309 void CSelectionDetailsDlg::OnDblclkSelectionlist(NMHDR* pNMHDR, LRESULT* pResult)
00310 {
00311     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00312     if( pNMListView->iItem > -1 )
00313     {
00314         OnOK();
00315     }
00316
00317     *pResult = 0;
00318 }
00319
00321 void CSelectionDetailsDlg::OnColumnclickSelectionlist(NMHDR* pNMHDR, LRESULT* pResult)
00322 {
00323     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00324
00325     if( m_sortColumn != pNMListView->iSubItem )
00326     {
00327         m_sortAsc = false;
00328     }
00329     else
00330     {
00331         m_sortAsc = !m_sortAsc;
00332     }
00333
00334     m_sortColumn = pNMListView->iSubItem;
00335
00336     SortItems(m_sortColumn, m_sortAsc);
00337
00338     *pResult = 0;
00339 }
00340
00347 void CSelectionDetailsDlg::SortItems(int column, bool asc)
00348 {
00349     m_headerCtrl.SetSortImage(column, asc);
00350
00351     CompareInfo info = { 0 };
00352
00353     info.m_column = column;
00354     info.m_asc = asc;
00355
00356     m_selectionListCtrl.SortItems(CompareItems, (DWORD)&info);
00357 }
00358
00360 void CSelectionDetailsDlg::OnItemchangedSelectionlist(NMHDR* pNMHDR, LRESULT* pResult)
00361 {
00362     NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
00363     if( pNMListView->iItem > -1 &&
00364         pNMListView->uChanged & LVIF_STATE && pNMListView->uNewState & (LVIS_SELECTED | LVIS_FOCUSED) )
00365     {
00366         UpdateSelect(pNMListView->iItem);
00367     }
00368
00369     *pResult = 0;
00370 }
00371
00373 void CSelectionDetailsDlg::OnDeltaposRevisionSpin(NMHDR* pNMHDR, LRESULT* pResult)
00374 {
00375     NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
00376
00377     if( m_revisionCheck.GetCheck() )
00378     {
00379         CString selection;
00380         m_selectionEdit.GetWindowText(selection);
00381
00382         const int dotPos = selection.ReverseFind('.');
00383         if( dotPos > 0 && dotPos < selection.GetLength() - 1 )
00384         {
00385             CString revLast = selection.Mid(dotPos + 1);
00386             int revLastNum = atoi(revLast);
00387             if( revLastNum > 0 )
00388             {
00389                 revLastNum += pNMUpDown->iDelta;
00390                 if( revLastNum > 0 )
00391                 {
00392                     revLast.Format("%d", revLastNum);
00393                     selection = selection.Left(dotPos + 1) + revLast;
00394
00395                     m_selectionEdit.SetWindowText(selection);
00396                 }
00397             }
00398         }
00399     }
00400
00401     // We do not allow to change position
00402     *pResult = 1;
00403 }
00404
00406 void CSelectionDetailsDlg::OnFilename()
00407 {
00408     EnableControls();
00409     UpdateSelect(-1);
00410 }
00411
00413 void CSelectionDetailsDlg::OnPath()
00414 {
00415     EnableControls();
00416     UpdateSelect(-1);
00417 }
00418
00420 void CSelectionDetailsDlg::OnRevision()
00421 {
00422     EnableControls();
00423     UpdateSelect(-1);
00424 }
00425
00429 void CSelectionDetailsDlg::EnableControls()
00430 {
00431     m_revisionSpinCtrl.EnableWindow(m_revisionCheck.GetCheck());
00432 }
00433
00438 void CSelectionDetailsDlg::UpdateSelect(int item)
00439 {
00440     if( item < 0 )
00441     {
00442         // Get the currently selected item
00443         POSITION pos = m_selectionListCtrl.GetFirstSelectedItemPosition();
00444         if( pos )
00445         {
00446             item = m_selectionListCtrl.GetNextSelectedItem(pos);
00447         }
00448     }
00449
00450     if( item > -1 && item < m_selectionListCtrl.GetItemCount() )
00451     {
00452         // Update the select edit box
00453         int subItem = 0;
00454
00455         if( m_revisionCheck.GetCheck() )
00456         {
00457             subItem = 1;
00458         }
00459         else if( m_pathCheck.GetCheck() )
00460         {
00461             subItem = 2;
00462         }
00463
00464         m_selectionEdit.SetWindowText(m_selectionListCtrl.GetItemText(item, subItem));
00465     }
00466 }
00467
00468 #endif /* !WIN32 */
00469
00470 #if qUnix
00471 class UCvsSelectionDetailsDlg : public UWidget
00472 {
00473     UDECLARE_DYNAMIC(UCvsSelectionDetailsDlg)
00474 public:
00475     UCvsSelectionDetailsDlg(const MultiFiles* mf, const kSelDetType selDetType, const char* selection);
00476     virtual ~UCvsSelectionDetailsDlg() {}
00477
00478     enum
00479     {
00480         kOK = EV_COMMAND_START, // 0
00481         kCancel,                // 1
00482     };
00483
00484     virtual void DoDataExchange(bool fill);
00485 public:
00486     UStr    m_selection;
00487     kSelDetType  m_selDetType;
00488
00489 protected:
00490     ev_msg int OnOK(void);
00491     ev_msg int OnCancel(void);
00492
00493     UDECLARE_MESSAGE_MAP()
00494 private:
00495     const MultiFiles* m_mf;
00496 };
00497
00498 UIMPLEMENT_DYNAMIC(UCvsSelectionDetailsDlg, UWidget)
00499
00500 UBEGIN_MESSAGE_MAP(UCvsSelectionDetailsDlg, UWidget)
00501     ON_UCOMMAND(UCvsSelectionDetailsDlg::kOK, UCvsSelectionDetailsDlg::OnOK)
00502     ON_UCOMMAND(UCvsSelectionDetailsDlg::kCancel, UCvsSelectionDetailsDlg::OnCancel)
00503 UEND_MESSAGE_MAP()
00504
00505 UCvsSelectionDetailsDlg::UCvsSelectionDetailsDlg(const MultiFiles* mf, const kSelDetType selDetType, const char* selection)
00506     : m_mf(mf), m_selection( selection), m_selDetType( selDetType), UWidget(::UEventGetWidID() )
00507 {
00508 }
00509
00510 int UCvsSelectionDetailsDlg::OnOK(void)
00511 {
00512     EndModal(true);
00513     return 0;
00514 }
00515
00516 int UCvsSelectionDetailsDlg::OnCancel(void)
00517 {
00518     EndModal(false);
00519     return 0;
00520 }
00521
00522 void UCvsSelectionDetailsDlg::DoDataExchange(bool fill)
00523 {
00524     if(fill)
00525     {
00526     }
00527     else
00528     {
00529     }
00530 }
00531
00532 #endif /* qUnix */
00533
00535 bool CompatGetSelectionDetails(const MultiFiles* mf, kSelDetType& selDetType, CStr& selection)
00536 {
00537     bool userHitOK = false;
00538
00539 #ifdef WIN32
00540     CSelectionDetailsDlg selectionDetailsDlg(mf, selDetType, selection.c_str());
00541
00542     if( selectionDetailsDlg.DoModal() == IDOK )
00543     {
00544         selection = selectionDetailsDlg.m_selection;
00545         selDetType = (kSelDetType)selectionDetailsDlg.m_selDetType;
00546
00547         userHitOK = true;
00548     }
00549 #endif /* WIN32 */
00550
00551 #if qUnix
00552     void *wid;
00553 #   if qGTK
00554     wid = UCreate_SelDetailsDlg();
00555 #   endif
00556
00557     UCvsSelectionDetailsDlg *dlg = new UCvsSelectionDetailsDlg( mf, selDetType, selection.c_str());
00558     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00559     if(dlg->DoModal())
00560     {
00561         selection = dlg->m_selection;
00562         selDetType = dlg->m_selDetType;
00563
00564         userHitOK = true;
00565     }
00566     delete dlg;
00567
00568 #endif // qUnix
00569
00570 #ifdef qMacCvsPP
00571 #endif /* qMacCvsPP */
00572
00573     return userHitOK;
00574 }
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


common/SelectionDetailsDlg.h Source File

common/SelectionDetailsDlg.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> --- January 2003
00019  */
00020
00021 #if !defined(AFX_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_)
00022 #define AFX_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 // SelectionDetailsDlg.h : header file
00028 //
00029
00030 #include "MultiFiles.h"
00031
00032 #ifdef WIN32
00033 #include "SortHeaderCtrl.h"
00034 #endif
00035
00037 typedef enum
00038 {
00039     kSelDetFile,
00040     kSelDetRevision,
00041     kSelDetPath
00042 } kSelDetType;
00043
00044
00045 bool CompatGetSelectionDetails(const MultiFiles* mf, kSelDetType& selDetType, CStr& selection);
00046
00047
00048 #ifdef WIN32
00049
00051 class SelectionDisplayInfo
00052 {
00053 private:
00054     // Data members
00055     string m_fileName;
00056     string m_revision;
00057     string m_path;
00059 public:
00060     // Interface
00061     void Create(const string& fileName, const string& revision, const string& path);
00062
00063     const string& GetFileName() const;
00064     const string& GetRevision() const;
00065     const string& GetPath() const;
00066 };
00067
00069 // CSelectionDetailsDlg dialog
00070
00071 class CSelectionDetailsDlg : public CDialog
00072 {
00073 // Construction
00074 public:
00075     CSelectionDetailsDlg(const MultiFiles* mf, const kSelDetType selDetType, const char* selection,
00076         CWnd* pParent = NULL);   // standard constructor
00077
00078 // Dialog Data
00079     //{{AFX_DATA(CSelectionDetailsDlg)
00080     enum { IDD = IDD_SELECTION_DETAILS };
00081     CButton m_revisionCheck;
00082     CButton m_fileNameCheck;
00083     CButton m_pathCheck;
00084     CEdit   m_selectionEdit;
00085     CSpinButtonCtrl m_revisionSpinCtrl;
00086     CListCtrl   m_selectionListCtrl;
00087     CString m_selection;
00088     int     m_selDetType;
00089     //}}AFX_DATA
00090
00091
00092 // Overrides
00093     // ClassWizard generated virtual function overrides
00094     //{{AFX_VIRTUAL(CSelectionDetailsDlg)
00095     protected:
00096     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00097     //}}AFX_VIRTUAL
00098
00099 // Implementation
00100 protected:
00101
00102     // Generated message map functions
00103     //{{AFX_MSG(CSelectionDetailsDlg)
00104     virtual BOOL OnInitDialog();
00105     afx_msg void OnDblclkSelectionlist(NMHDR* pNMHDR, LRESULT* pResult);
00106     afx_msg void OnColumnclickSelectionlist(NMHDR* pNMHDR, LRESULT* pResult);
00107     afx_msg void OnItemchangedSelectionlist(NMHDR* pNMHDR, LRESULT* pResult);
00108     afx_msg void OnDeltaposRevisionSpin(NMHDR* pNMHDR, LRESULT* pResult);
00109     afx_msg void OnFilename();
00110     afx_msg void OnPath();
00111     afx_msg void OnRevision();
00112     afx_msg void OnDestroy();
00113     //}}AFX_MSG
00114     DECLARE_MESSAGE_MAP()
00115 private:
00116     // Data members
00117     const MultiFiles* m_mf;
00119     // Methods
00120     void DisplaySelection();
00121     void DeleteAllItems();
00122
00123     void EnableControls();
00124     void UpdateSelect(int item);
00125
00126     // Sorting
00127
00129     typedef struct
00130     {
00131         int m_column;
00132         bool m_asc;
00133     } CompareInfo;
00134
00135     bool m_sortAsc;
00136     int m_sortColumn;
00137     CSortHeaderCtrl m_headerCtrl;
00138
00139     void SortItems(int column, bool asc);
00140     static int CALLBACK CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam);
00141 };
00142
00143 //{{AFX_INSERT_LOCATION}}
00144 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00145 #endif /* !WIN32 */
00146
00147 #endif // !defined(AFX_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_)
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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
00061 void USmartCombo::SetFeature(int feature)
00062 {
00063     m_feature = feature;
00064     SetReadOnly(0 != (m_feature & USmartCombo::ReadOnly));
00065 }
00066
00072 bool USmartCombo::HasFeature(int feature) const
00073 {
00074     return (m_feature & feature) != 0;
00075 }
00076
00085 void USmartCombo::SetItems(CMString* pstrItems)
00086 {
00087     m_pstrItems = pstrItems;
00088     if( m_pstrItems )
00089     {
00090         m_feature |= USmartCombo::RemoveItems;
00091     }
00092     else
00093     {
00094         m_feature &= ~USmartCombo::RemoveItems;
00095     }
00096 }
00097
00103 CMString* USmartCombo::GetItems()
00104 {
00105     return m_pstrItems;
00106 }
00107
00113 int USmartCombo::CalcDroppedWidth()
00114 {
00115     return 0;
00116 }
00117
00123 void USmartCombo::SetReadOnly(bool readOnly /*= true*/)
00124 {
00125     if( readOnly )
00126     {
00127         m_feature |= USmartCombo::ReadOnly;
00128     }
00129     else
00130     {
00131         m_feature &= ~USmartCombo::ReadOnly;
00132     }
00133 }
00134
00141 bool USmartCombo::RemoveItem(const char* strItem)
00142 {
00143     UStr prompt("Do you want to remove that item from the list?\n");
00144     prompt << "Item: ";
00145     prompt << strItem;
00146
00147     bool res = CvsAlert(prompt, "Yes", "No");
00148     if( res )
00149     {
00150         m_pstrItems->Remove(strItem);
00151     }
00152
00153     return res;
00154 }
00155
00156 #ifdef WIN32
00157
00158 // CSmartComboBox
00159
00160 CSmartComboBox::CSmartComboBox(int feature /*= USmartCombo::DefaultFeature*/)
00161     : USmartCombo(feature)
00162 {
00163 }
00164
00165 CSmartComboBox::~CSmartComboBox()
00166 {
00167 }
00168
00169
00170 BEGIN_MESSAGE_MAP(CSmartComboBox, CComboBox)
00171     //{{AFX_MSG_MAP(CSmartComboBox)
00172     ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
00173     //}}AFX_MSG_MAP
00174     ON_MESSAGE(WM_SMCB_SETFEATURE, OnSetFeature)
00175     ON_MESSAGE(WM_SMCB_SETITEMS, OnSetItems)
00176     ON_MESSAGE(WM_SMCB_SETREADONLY, OnSetReadOnly)
00177 END_MESSAGE_MAP()
00178
00179
00180 // CSmartComboBox message handlers
00181
00182
00183 void CSmartComboBox::OnDropdown()
00184 {
00185     if( HasFeature(USmartCombo::AutoDropWidth) )
00186     {
00187         SetDroppedWidth(CalcDroppedWidth());
00188     }
00189 }
00190
00192 BOOL CSmartComboBox::PreTranslateMessage(MSG* pMsg)
00193 {
00194     if( HasFeature(USmartCombo::RemoveItems) )
00195     {
00196         if( DelKeyTest(pMsg) )
00197         {
00198             return TRUE;
00199         }
00200     }
00201
00202     return CComboBox::PreTranslateMessage(pMsg);
00203 }
00204
00206 int CSmartComboBox::CalcDroppedWidth()
00207 {
00208     int maxSize = 0;
00209
00210     CClientDC ClientDC(this);
00211     int savedDC = ClientDC.SaveDC();
00212     ClientDC.SelectObject(GetFont());
00213
00214     CString strLBText;
00215     for( int nIndex = 0; nIndex < GetCount(); nIndex++ )
00216     {
00217         GetLBText( nIndex, strLBText );
00218         CSize size = ClientDC.GetTextExtent(strLBText);
00219
00220         if( size.cx > maxSize )
00221         {
00222             maxSize = size.cx;
00223         }
00224     }
00225     ClientDC.RestoreDC(savedDC);
00226
00227     maxSize += ::GetSystemMetrics(SM_CXVSCROLL) + 3*::GetSystemMetrics(SM_CXEDGE);
00228
00229     CRect rect;
00230     GetWindowRect(rect);
00231     maxSize = min(ClientDC.GetDeviceCaps(HORZRES) - rect.TopLeft().x, maxSize);
00232
00233     return maxSize;
00234 }
00235
00242 BOOL CSmartComboBox::DelKeyTest(MSG* pMsg)
00243 {
00244     CMString* pstrItems = GetItems();
00245     ASSERT(pstrItems != NULL);
00246
00247     BOOL bRes = FALSE;
00248
00249     if( WM_KEYDOWN == pMsg->message &&
00250         VK_DELETE == (int)pMsg->wParam &&
00251         pstrItems &&
00252         GetDroppedState() )
00253     {
00254         int sel = GetCurSel();
00255         if( CB_ERR < sel )
00256         {
00257             CString strItem;
00258             GetLBText(sel, strItem);
00259
00260             if( RemoveItem(strItem) )
00261             {
00262                 DeleteString(sel);
00263             }
00264
00265             //we have to prevent it going to another window
00266             bRes = TRUE;
00267         }
00268     }
00269
00270     return bRes;
00271 }
00272
00274 void CSmartComboBox::PreSubclassWindow()
00275 {
00276     if( HasFeature(USmartCombo::ReadOnly) )
00277     {
00278         SetReadOnly();
00279     }
00280
00281     CComboBox::PreSubclassWindow();
00282 }
00283
00289 void CSmartComboBox::SetReadOnly(bool readOnly /*= true*/)
00290 {
00291     USmartCombo::SetReadOnly(readOnly);
00292
00293     if( IsWindow(m_hWnd) )
00294     {
00295         CEdit* pEdit = (CEdit*)GetDlgItem(1001);
00296         if( pEdit && IsWindow(pEdit->m_hWnd) )
00297         {
00298             pEdit->SetReadOnly(readOnly);
00299         }
00300     }
00301 }
00302
00309 LRESULT CSmartComboBox::OnSetFeature(WPARAM wParam, LPARAM lParam)
00310 {
00311     SetFeature((int)wParam);
00312     return 0;
00313 }
00314
00321 LRESULT CSmartComboBox::OnSetItems(WPARAM wParam, LPARAM lParam)
00322 {
00323     SetItems((CMString*)wParam);
00324     return 0;
00325 }
00326
00333 LRESULT CSmartComboBox::OnSetReadOnly(WPARAM wParam, LPARAM lParam)
00334 {
00335     SetReadOnly(0 != wParam);
00336     return 0;
00337 }
00338
00339 #endif /* WIN32 */
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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
00040 class USmartCombo
00041 {
00042 public:
00043     // Construction
00044     USmartCombo(int feature);
00045     virtual ~USmartCombo();
00046
00047 private:
00048     int m_feature;
00049     CMString* m_pstrItems;
00051 public:
00053
00054     enum Feature{
00055         None =          0x00,
00056         AutoDropWidth = 0x01,
00057         RemoveItems =   0x02,
00058         ReadOnly =      0x04,
00059         //
00060         DefaultFeature = AutoDropWidth | RemoveItems
00061     };
00062
00063 public:
00064     // Get / Set methods
00065     void SetFeature(int feature);
00066     bool HasFeature(int feature) const;
00067
00068     void SetItems(CMString* pstrItems);
00069     CMString* GetItems();
00070
00071     // Overrides
00072     virtual int CalcDroppedWidth();
00073     virtual void SetReadOnly(bool readOnly = true);
00074     virtual bool RemoveItem(const char* strItem);
00075 };
00076
00077 #ifdef WIN32
00078
00080 // CSmartComboBox window
00081
00083 enum{
00084     WM_SMCB_MIN = WM_APP + 1,
00085     WM_SMCB_SETFEATURE,
00086     WM_SMCB_SETITEMS,
00087     WM_SMCB_SETREADONLY,
00088     WM_SMCB_MAX
00089 };
00090
00091
00104 class CSmartComboBox : public CComboBox, public USmartCombo
00105 {
00106 // Construction
00107 public:
00108     CSmartComboBox(int feature = USmartCombo::DefaultFeature);
00109
00110 // Attributes
00111 public:
00112
00113 // Operations
00114 public:
00115
00116 // Overrides
00117     // ClassWizard generated virtual function overrides
00118     //{{AFX_VIRTUAL(CSmartComboBox)
00119     public:
00120     virtual BOOL PreTranslateMessage(MSG* pMsg);
00121     protected:
00122     virtual void PreSubclassWindow();
00123     //}}AFX_VIRTUAL
00124
00125 // Implementation
00126 public:
00127     virtual ~CSmartComboBox();
00128
00129     // Generated message map functions
00130 protected:
00131     //{{AFX_MSG(CSmartComboBox)
00132     afx_msg void OnDropdown();
00133     //}}AFX_MSG
00134     afx_msg LRESULT OnSetFeature(WPARAM wParam, LPARAM lParam);
00135     afx_msg LRESULT OnSetItems(WPARAM wParam, LPARAM lParam);
00136     afx_msg LRESULT OnSetReadOnly(WPARAM wParam, LPARAM lParam);
00137
00138     DECLARE_MESSAGE_MAP()
00139 private:
00140     // Methods
00141     virtual int CalcDroppedWidth();
00142     BOOL DelKeyTest(MSG* pMsg);
00143
00144 public:
00145     // Interface
00146     virtual void SetReadOnly(bool readOnly = true);
00147 };
00148
00150
00151 //{{AFX_INSERT_LOCATION}}
00152 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00153 #endif /* WIN32 */
00154
00155 #endif // !defined(AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_)
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


common/StatusDlg.cpp Source File

common/StatusDlg.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> --- March 2002
00019  */
00020
00021 /*
00022  * StatusDlg.cpp : the cvs status 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 "StatusDlg.h"
00049 #include "MultiFiles.h"
00050
00051 #ifdef WIN32
00052 #include "GetPrefs.h"
00053
00054 #ifdef _DEBUG
00055 #define new DEBUG_NEW
00056 #undef THIS_FILE
00057 static char THIS_FILE[] = __FILE__;
00058 #endif
00059
00061 // CStatus_MAIN property page
00062
00063 IMPLEMENT_DYNAMIC(CStatus_MAIN, CPropertyPage)
00064
00065 CStatus_MAIN::CStatus_MAIN(bool noRecurs, STATUSOUTPUT_TYPE outputType)
00066     : CPropertyPage(CStatus_MAIN::IDD)
00067 {
00068     m_noRecurs = noRecurs;
00069     m_outputType = (int)outputType;
00070 }
00071
00072 CStatus_MAIN::~CStatus_MAIN()
00073 {
00074 }
00075
00076 void CStatus_MAIN::DoDataExchange(CDataExchange* pDX)
00077 {
00078     CPropertyPage::DoDataExchange(pDX);
00079     //{{AFX_DATA_MAP(CStatus_MAIN)
00080     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00081     DDX_Radio(pDX, IDC_OUTPUT_STANDARD, m_outputType);
00082     //}}AFX_DATA_MAP
00083 }
00084
00085
00086 BEGIN_MESSAGE_MAP(CStatus_MAIN, CPropertyPage)
00087     //{{AFX_MSG_MAP(CStatus_MAIN)
00088         // NOTE: the ClassWizard will add message map macros here
00089     //}}AFX_MSG_MAP
00090 END_MESSAGE_MAP()
00091
00092
00093 // CStatus_MAIN message handlers
00094
00095 #endif /* WIN32 */
00096
00098 bool CompatGetStatus(const MultiFiles* mf, bool& noRecurs, STATUSOUTPUT_TYPE& outputType)
00099 {
00100     bool userHitOK = false;
00101
00102     noRecurs = false;
00103     outputType = gCvsPrefs.StatusOutputType();
00104
00105 #ifdef WIN32
00106     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgStatus(), "Status settings");
00107     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00108     CStatus_MAIN page1(noRecurs, outputType);
00109     CGetPrefs_GLOBALS page2;
00110     pages.AddPage(&page1);
00111     pages.AddPage(&page2);
00112
00113     if( pages.DoModal() == IDOK )
00114     {
00115         noRecurs = page1.m_noRecurs ? true : false;
00116         gCvsPrefs.SetStatusOutputType((STATUSOUTPUT_TYPE)page1.m_outputType);
00117
00118         page2.StoreValues();
00119         gCvsPrefs.SetHideCommandDlgStatus(pages.GetHideCommandDlg());
00120         userHitOK = true;
00121     }
00122 #endif /* WIN32 */
00123
00124 #ifdef qMacCvsPP
00125     userHitOK = true;
00126 #endif /* qMacCvsPP */
00127
00128 #if qUnix
00129     userHitOK = true;
00130 #endif // qUnix
00131
00132     if( userHitOK )
00133     {
00134         outputType = gCvsPrefs.StatusOutputType();
00135
00136         gCvsPrefs.save();
00137     }
00138
00139     return userHitOK;
00140 }
Generated on Fri Jan 31 12:08:44 2003 for WinCvs Source by doxygen 1.3-rc2


common/StatusDlg.h Source File

common/StatusDlg.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> --- March 2002
00019  */
00020
00021 /*
00022  * StatusDlg.cpp : the cvs status dialog
00023  */
00024
00025 #if !defined(AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_)
00026 #define AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_
00027
00028 #if _MSC_VER > 1000
00029 #pragma once
00030 #endif // _MSC_VER > 1000
00031
00032 #include "CvsPrefs.h"
00033
00034 class MultiFiles;
00035
00036 bool CompatGetStatus(const MultiFiles* mf, bool& noRecurs, STATUSOUTPUT_TYPE& outputType);
00037
00038 #ifdef WIN32
00039
00041 // CStatus_MAIN dialog
00042
00043 class CStatus_MAIN : public CPropertyPage
00044 {
00045     DECLARE_DYNAMIC(CStatus_MAIN)
00046
00047 // Construction
00048 public:
00049     CStatus_MAIN(bool noRecurs, STATUSOUTPUT_TYPE outputType);
00050     ~CStatus_MAIN();
00051
00052 // Dialog Data
00053     //{{AFX_DATA(CStatus_MAIN)
00054     enum { IDD = IDD_STATUS_MAIN };
00055     BOOL    m_noRecurs;
00056     int     m_outputType;
00057     //}}AFX_DATA
00058
00059
00060 // Overrides
00061     // ClassWizard generate virtual function overrides
00062     //{{AFX_VIRTUAL(CStatus_MAIN)
00063     protected:
00064     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00065     //}}AFX_VIRTUAL
00066
00067 // Implementation
00068 protected:
00069     // Generated message map functions
00070     //{{AFX_MSG(CStatus_MAIN)
00071         // NOTE: the ClassWizard will add member functions here
00072     //}}AFX_MSG
00073     DECLARE_MESSAGE_MAP()
00074
00075 };
00076
00077 //{{AFX_INSERT_LOCATION}}
00078 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00079
00080 #endif // !defined(AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_)
00081
00082 #endif /* WIN32 */
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 "MultiFiles.h"
00051 #include "UpdateDlg.h"
00052 #include "ItemListDlg.h"
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 WIN32
00063
00065 // CTag_MAIN property page
00066
00067 IMPLEMENT_DYNAMIC(CTag_MAIN, CPropertyPage)
00068
00069 CTag_MAIN::CTag_MAIN(const MultiFiles* mf,
00070                      kTagDlgType type,
00071                      const char* sLastTag,
00072                      bool noRecurs, bool checkUnmod /*= false*/, bool overwriteExisting /*= false*/)
00073                      : m_mf(mf), CPropertyPage(CTag_MAIN::IDD)
00074 {
00075     m_type = type;
00076
00077     m_noRecurs = noRecurs;
00078     m_checkUnmod = checkUnmod;
00079     m_overwriteExisting = overwriteExisting;
00080     m_tagName = sLastTag;
00081
00082     m_tagCombo.SetItems(&gRevNames);
00083 }
00084
00085 CTag_MAIN::~CTag_MAIN()
00086 {
00087 }
00088
00089 void CTag_MAIN::DoDataExchange(CDataExchange* pDX)
00090 {
00091     CPropertyPage::DoDataExchange(pDX);
00092     //{{AFX_DATA_MAP(CTag_MAIN)
00093     DDX_Control(pDX, IDC_TAGDESC_TEXT, m_tagDescStatic);
00094     DDX_Control(pDX, IDC_GRPBOX_TEXT, m_grpBox);
00095     DDX_Control(pDX, IDC_OVERWRITE, m_overwriteExistingCheck);
00096     DDX_Control(pDX, IDC_CHECKUNMOD, m_checkUnmodCheck);
00097     DDX_Control(pDX, IDC_TAGNAME, m_tagCombo);
00098     DDX_Check(pDX, IDC_NORECURS, m_noRecurs);
00099     DDX_Check(pDX, IDC_CHECKUNMOD, m_checkUnmod);
00100     DDX_Check(pDX, IDC_OVERWRITE, m_overwriteExisting);
00101     DDX_CBString(pDX, IDC_TAGNAME, m_tagName);
00102     //}}AFX_DATA_MAP
00103
00104     DDV_MinChars(pDX, m_tagName, 1);
00105     DDX_ComboMString(pDX, IDC_TAGNAME, m_tagCombo);
00106 }
00107
00108
00109 BEGIN_MESSAGE_MAP(CTag_MAIN, CPropertyPage)
00110     //{{AFX_MSG_MAP(CTag_MAIN)
00111     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00112     //}}AFX_MSG_MAP
00113 END_MESSAGE_MAP()
00114
00115
00116 // CTag_MAIN message handlers
00117
00118 BOOL CTag_MAIN::OnInitDialog()
00119 {
00120     CPropertyPage::OnInitDialog();
00121
00122     // set the type-specific data
00123     CString strGrpBox;
00124     CString strTagDesc;
00125
00126     switch( m_type )
00127     {
00128     case kTagAdd:
00129         strGrpBox = "Enter the tag name to create:";
00130         strTagDesc = "New tag &name:";
00131         break;
00132     case kTagDelete:
00133         strGrpBox = "Enter the tag name to delete:";
00134         strTagDesc = "Delete tag &name:";
00135
00136         m_checkUnmodCheck.ShowWindow(SW_HIDE);
00137         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00138         break;
00139     case kTagBranch:
00140         strGrpBox = "Enter the branch name to create:";
00141         strTagDesc = "New branch &name:";
00142
00143         m_overwriteExistingCheck.ShowWindow(SW_HIDE);
00144         break;
00145     default:
00146         ASSERT(FALSE); //unknown type
00147     }
00148
00149     m_grpBox.SetWindowText(strGrpBox);
00150     m_tagDescStatic.SetWindowText(strTagDesc);
00151
00152     return TRUE;  // return TRUE unless you set the focus to a control
00153                   // EXCEPTION: OCX Property Pages should return FALSE
00154 }
00155
00156 void CTag_MAIN::OnBrowseTag()
00157 {
00158     CStr tagName;
00159     if( CompatGetTagListItem(m_mf, tagName) )
00160     {
00161         m_tagName = (const char*)tagName;
00162         m_tagCombo.SetWindowText(m_tagName);
00163     }
00164 }
00165
00166 #endif /* WIN32 */
00167
00168 #ifdef qMacCvsPP
00169 static void DoDataExchange_TagCreateMain(LWindow *theDialog, const MultiFiles* mf,
00170     CPStr & sLastTag, bool & noRecurs, bool & overwriteExist,
00171     bool & checkUnmod, bool putValue)
00172 {
00173     LEditText *tname = dynamic_cast<LEditText*>
00174         (theDialog->FindPaneByID(item_BranchRev));
00175     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00176         (theDialog->FindPaneByID(item_NoRecurs));
00177     LCheckBox *chkOverwrite = dynamic_cast<LCheckBox*>
00178         (theDialog->FindPaneByID(item_OverwriteRev));
00179     LCheckBox *chkUnmod = dynamic_cast<LCheckBox*>
00180         (theDialog->FindPaneByID(item_CheckUnmod));
00181     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00182         (theDialog->FindPaneByID(item_FillerTag));
00183
00184     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00185     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00186
00187     if(putValue)
00188     {
00189         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00190         chkOverwrite->SetValue(overwriteExist ? Button_On : Button_Off);
00191         chkUnmod->SetValue(checkUnmod ? Button_On : Button_Off);
00192         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00193     }
00194     else
00195     {
00196         char str[255];
00197         Size len;
00198
00199         tname->GetText(str, 254, &len);
00200         sLastTag.set(str, len);
00201         noRecurs = chkNoRecurs->GetValue() == Button_On;
00202         overwriteExist = chkOverwrite->GetValue() == Button_On;
00203         checkUnmod = chkUnmod->GetValue() == Button_On;
00204     }
00205 }
00206
00207 static void DoDataExchange_TagDeleteMain(LWindow *theDialog, const MultiFiles* mf,
00208     CPStr & sLastTag, bool & noRecurs, bool putValue)
00209 {
00210     LEditText *tname = dynamic_cast<LEditText*>
00211         (theDialog->FindPaneByID(item_BranchRev));
00212     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00213         (theDialog->FindPaneByID(item_NoRecurs));
00214     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00215         (theDialog->FindPaneByID(item_FillerTag));
00216
00217     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00218     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00219
00220     if(putValue)
00221     {
00222         tname->SetText((Ptr)(const char *)sLastTag, sLastTag.length());
00223         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00224     }
00225     else
00226     {
00227         noRecurs = chkNoRecurs->GetValue() == Button_On;
00228
00229         char str[255];
00230         Size len;
00231
00232         tname->GetText(str, 254, &len);
00233         sLastTag.set(str, len);
00234     }
00235 }
00236
00237 static void DoDataExchange_TagBranchMain(LWindow *theDialog, const MultiFiles* mf,
00238     CPStr & sLastBranch, bool & noRecurs, bool & checkUnmod, bool putValue)
00239 {
00240     LEditText *tname = dynamic_cast<LEditText*>
00241         (theDialog->FindPaneByID(item_BranchRev));
00242     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00243         (theDialog->FindPaneByID(item_NoRecurs));
00244     LCheckBox *chkUnmod = dynamic_cast<LCheckBox*>
00245         (theDialog->FindPaneByID(item_CheckUnmod));
00246     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00247         (theDialog->FindPaneByID(item_FillerTag));
00248
00249     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00250     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00251
00252     if(putValue)
00253     {
00254         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00255         chkUnmod->SetValue(checkUnmod ? Button_On : Button_Off);
00256         tname->SetText((Ptr)(const char *)sLastBranch, sLastBranch.length());
00257     }
00258     else
00259     {
00260         char str[255];
00261         Size len;
00262
00263         tname->GetText(str, 254, &len);
00264         sLastBranch.set(str, len);
00265         noRecurs = chkNoRecurs->GetValue() == Button_On;
00266         checkUnmod = chkUnmod->GetValue() == Button_On;
00267     }
00268 }
00269
00270 static void DoDataExchange_TagBranchOptions(LWindow *theDialog,
00271     bool & noRecurs, bool putValue)
00272 {
00273     LCheckBox *chkNoRecurs = dynamic_cast<LCheckBox*>
00274         (theDialog->FindPaneByID(item_NoRecurs));
00275
00276     if(putValue)
00277     {
00278         chkNoRecurs->SetValue(noRecurs ? Button_On : Button_Off);
00279     }
00280     else
00281     {
00282         noRecurs = chkNoRecurs->GetValue() == Button_On;
00283     }
00284 }
00285 #endif /* qMacCvsPP */
00286
00287 #if qUnix
00288 class UCvsTagCreate : public UWidget
00289 {
00290     UDECLARE_DYNAMIC(UCvsTagCreate)
00291 public:
00292     UCvsTagCreate() : UWidget(::UEventGetWidID()) {}
00293     virtual ~UCvsTagCreate() {}
00294
00295     enum
00296     {
00297         kOK = EV_COMMAND_START, // 0
00298         kCancel,                // 1
00299         kTabGeneral             // 2
00300     };
00301
00302     virtual void DoDataExchange(bool fill);
00303
00304 protected:
00305     ev_msg int OnOK(void);
00306     ev_msg int OnCancel(void);
00307
00308     UDECLARE_MESSAGE_MAP()
00309 };
00310
00311 UIMPLEMENT_DYNAMIC(UCvsTagCreate, UWidget)
00312
00313 UBEGIN_MESSAGE_MAP(UCvsTagCreate, UWidget)
00314     ON_UCOMMAND(UCvsTagCreate::kOK, UCvsTagCreate::OnOK)
00315     ON_UCOMMAND(UCvsTagCreate::kCancel, UCvsTagCreate::OnCancel)
00316 UEND_MESSAGE_MAP()
00317
00318 int UCvsTagCreate::OnOK(void)
00319 {
00320     EndModal(true);
00321     return 0;
00322 }
00323
00324 int UCvsTagCreate::OnCancel(void)
00325 {
00326     EndModal(false);
00327     return 0;
00328 }
00329
00330 void UCvsTagCreate::DoDataExchange(bool fill)
00331 {
00332     if(fill)
00333     {
00334     }
00335     else
00336     {
00337     }
00338 }
00339
00340 class UCvsTagCreate_MAIN : public UWidget
00341 {
00342     UDECLARE_DYNAMIC(UCvsTagCreate_MAIN)
00343 public:
00344     UCvsTagCreate_MAIN(const char * sLastTag, bool noRecurs,
00345                        bool overwriteExist, bool checkUnmod);
00346     virtual ~UCvsTagCreate_MAIN() {}
00347
00348     enum
00349     {
00350         kEditTag = EV_COMMAND_START,    // 0
00351         kCheckRecurs,       // 1
00352         kCheckUnmod,        // 2
00353         kCheckOverwrite,    // 3
00354     };
00355
00356     virtual void DoDataExchange(bool fill);
00357
00358     UStr m_tagname;
00359     bool m_norecurs;
00360     bool m_checkunmod;
00361     bool m_overwrite;
00362 protected:
00363
00364     UDECLARE_MESSAGE_MAP()
00365 };
00366
00367 UIMPLEMENT_DYNAMIC(UCvsTagCreate_MAIN, UWidget)
00368
00369 UBEGIN_MESSAGE_MAP(UCvsTagCreate_MAIN, UWidget)
00370 UEND_MESSAGE_MAP()
00371
00372 UCvsTagCreate_MAIN::UCvsTagCreate_MAIN(const char * sLastTag, bool noRecurs,
00373                        bool overwriteExist, bool checkUnmod) : UWidget(::UEventGetWidID())
00374 {
00375     m_tagname = sLastTag;
00376     m_norecurs = noRecurs;
00377     m_checkunmod = checkUnmod;
00378     m_overwrite = overwriteExist;
00379 }
00380
00381 void UCvsTagCreate_MAIN::DoDataExchange(bool fill)
00382 {
00383     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00384
00385     if(fill)
00386     {
00387         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00388
00389         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUnmod, m_checkunmod), 0L);
00390         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00391         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckOverwrite, m_overwrite), 0L);
00392     }
00393     else
00394     {
00395         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00396
00397         m_checkunmod = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUnmod, 0L);
00398         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00399         m_overwrite = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckOverwrite, 0L);
00400     }
00401 }
00402
00403 class UCvsTagDel : public UWidget
00404 {
00405     UDECLARE_DYNAMIC(UCvsTagDel)
00406 public:
00407     UCvsTagDel() : UWidget(::UEventGetWidID()) {}
00408     virtual ~UCvsTagDel() {}
00409
00410     enum
00411     {
00412         kOK = EV_COMMAND_START, // 0
00413         kCancel,                // 1
00414         kTabGeneral             // 2
00415     };
00416
00417     virtual void DoDataExchange(bool fill);
00418
00419 protected:
00420     ev_msg int OnOK(void);
00421     ev_msg int OnCancel(void);
00422
00423     UDECLARE_MESSAGE_MAP()
00424 };
00425
00426 UIMPLEMENT_DYNAMIC(UCvsTagDel, UWidget)
00427
00428 UBEGIN_MESSAGE_MAP(UCvsTagDel, UWidget)
00429     ON_UCOMMAND(UCvsTagDel::kOK, UCvsTagDel::OnOK)
00430     ON_UCOMMAND(UCvsTagDel::kCancel, UCvsTagDel::OnCancel)
00431 UEND_MESSAGE_MAP()
00432
00433 int UCvsTagDel::OnOK(void)
00434 {
00435     EndModal(true);
00436     return 0;
00437 }
00438
00439 int UCvsTagDel::OnCancel(void)
00440 {
00441     EndModal(false);
00442     return 0;
00443 }
00444
00445 void UCvsTagDel::DoDataExchange(bool fill)
00446 {
00447     if(fill)
00448     {
00449     }
00450     else
00451     {
00452     }
00453 }
00454
00455 class UCvsTagDel_MAIN : public UWidget
00456 {
00457     UDECLARE_DYNAMIC(UCvsTagDel_MAIN)
00458 public:
00459     UCvsTagDel_MAIN(const char * sLastTag, bool noRecurs);
00460     virtual ~UCvsTagDel_MAIN() {}
00461
00462     enum
00463     {
00464         kEditTag = EV_COMMAND_START,    // 0
00465         kCheckRecurs        // 1
00466     };
00467
00468     virtual void DoDataExchange(bool fill);
00469
00470     bool m_norecurs;
00471     UStr m_tagname;
00472 protected:
00473
00474     UDECLARE_MESSAGE_MAP()
00475 };
00476
00477 UIMPLEMENT_DYNAMIC(UCvsTagDel_MAIN, UWidget)
00478
00479 UBEGIN_MESSAGE_MAP(UCvsTagDel_MAIN, UWidget)
00480 UEND_MESSAGE_MAP()
00481
00482 UCvsTagDel_MAIN::UCvsTagDel_MAIN(const char * sLastTag, bool noRecurs) : UWidget(::UEventGetWidID())
00483 {
00484     m_norecurs = noRecurs;
00485     m_tagname = sLastTag;
00486 }
00487
00488 void UCvsTagDel_MAIN::DoDataExchange(bool fill)
00489 {
00490     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00491     if(fill)
00492     {
00493         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00494
00495         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00496     }
00497     else
00498     {
00499         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00500
00501         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00502     }
00503 }
00504
00505 class UCvsTagBranch : public UWidget
00506 {
00507     UDECLARE_DYNAMIC(UCvsTagBranch)
00508 public:
00509     UCvsTagBranch() : UWidget(::UEventGetWidID()) {}
00510     virtual ~UCvsTagBranch() {}
00511
00512     enum
00513     {
00514         kOK = EV_COMMAND_START, // 0
00515         kCancel,                // 1
00516         kTabGeneral             // 2
00517     };
00518
00519     virtual void DoDataExchange(bool fill);
00520
00521 protected:
00522     ev_msg int OnOK(void);
00523     ev_msg int OnCancel(void);
00524
00525     UDECLARE_MESSAGE_MAP()
00526 };
00527
00528 UIMPLEMENT_DYNAMIC(UCvsTagBranch, UWidget)
00529
00530 UBEGIN_MESSAGE_MAP(UCvsTagBranch, UWidget)
00531     ON_UCOMMAND(UCvsTagBranch::kOK, UCvsTagBranch::OnOK)
00532     ON_UCOMMAND(UCvsTagBranch::kCancel, UCvsTagBranch::OnCancel)
00533 UEND_MESSAGE_MAP()
00534
00535 int UCvsTagBranch::OnOK(void)
00536 {
00537     EndModal(true);
00538     return 0;
00539 }
00540
00541 int UCvsTagBranch::OnCancel(void)
00542 {
00543     EndModal(false);
00544     return 0;
00545 }
00546
00547 void UCvsTagBranch::DoDataExchange(bool fill)
00548 {
00549     if(fill)
00550     {
00551     }
00552     else
00553     {
00554     }
00555 }
00556
00557 class UCvsTagBranch_MAIN : public UWidget
00558 {
00559     UDECLARE_DYNAMIC(UCvsTagBranch_MAIN)
00560 public:
00561     UCvsTagBranch_MAIN(const char * sLastTag, bool noRecurs,
00562                        bool checkUnmod);
00563     virtual ~UCvsTagBranch_MAIN() {}
00564
00565     enum
00566     {
00567         kEditTag = EV_COMMAND_START,    // 0
00568         kCheckRecurs,       // 1
00569         kCheckUnmod         // 2
00570     };
00571
00572     virtual void DoDataExchange(bool fill);
00573
00574     UStr m_tagname;
00575     bool m_norecurs;
00576     bool m_checkunmod;
00577 protected:
00578
00579     UDECLARE_MESSAGE_MAP()
00580 };
00581
00582 UIMPLEMENT_DYNAMIC(UCvsTagBranch_MAIN, UWidget)
00583
00584 UBEGIN_MESSAGE_MAP(UCvsTagBranch_MAIN, UWidget)
00585 UEND_MESSAGE_MAP()
00586
00587 UCvsTagBranch_MAIN::UCvsTagBranch_MAIN(const char * sLastTag, bool noRecurs,
00588                                        bool checkUnmod) : UWidget(::UEventGetWidID())
00589 {
00590     m_tagname = sLastTag;
00591     m_norecurs = noRecurs;
00592     m_checkunmod = checkUnmod;
00593 }
00594
00595 void UCvsTagBranch_MAIN::DoDataExchange(bool fill)
00596 {
00597     ::DoDataExchange(fill, GetWidID(), kEditTag, gRevNames);
00598
00599     if(fill)
00600     {
00601         UEventSendMessage(GetWidID(), EV_SETTEXT, kEditTag, (void *)(const char *)m_tagname);
00602
00603         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckUnmod, m_checkunmod), 0L);
00604         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurs, m_norecurs), 0L);
00605     }
00606     else
00607     {
00608         UEventSendMessage(GetWidID(), EV_GETTEXT, kEditTag, &m_tagname);
00609
00610         m_checkunmod = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckUnmod, 0L);
00611         m_norecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurs, 0L);
00612     }
00613 }
00614 #endif // qUnix
00615
00617 bool CompatTagCreate(const MultiFiles* mf,
00618                      bool& noRecurs, bool& overwriteExisting,
00619                      CPStr& tagName, bool& checkUnmod)
00620 {
00621     bool userHitOK = false;
00622
00623     static CPStr sLastTag;
00624
00625     tagName = "";
00626     noRecurs = false;
00627     overwriteExisting = false;
00628     checkUnmod = false;
00629
00630 #ifdef WIN32
00631     CPropertySheet pages("Create tag settings");
00632     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00633     CTag_MAIN page1(mf, kTagAdd, sLastTag, noRecurs, checkUnmod, overwriteExisting);
00634     CGetPrefs_GLOBALS page2;
00635     pages.AddPage(&page1);
00636     pages.AddPage(&page2);
00637     if(pages.DoModal() == IDOK)
00638     {
00639         checkUnmod = page1.m_checkUnmod == TRUE;
00640         noRecurs = page1.m_noRecurs == TRUE;
00641         sLastTag = page1.m_tagName;
00642         overwriteExisting = page1.m_overwriteExisting == TRUE;
00643
00644         page2.StoreValues();
00645         userHitOK = true;
00646     }
00647 #endif /* WIN32 */
00648 #if qUnix
00649     void *wid = UCreate_TagDlg();
00650
00651     UCvsTagCreate *dlg = new UCvsTagCreate();
00652     UCvsTagCreate_MAIN *tab1 =
00653         new UCvsTagCreate_MAIN(sLastTag, noRecurs, overwriteExisting, checkUnmod);
00654     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00655     dlg->AddPage(tab1, UCvsTagCreate::kTabGeneral, 0);
00656
00657     if(dlg->DoModal())
00658     {
00659         checkUnmod = tab1->m_checkunmod;
00660         noRecurs = tab1->m_norecurs;
00661         sLastTag = tab1->m_tagname;
00662         overwriteExisting = tab1->m_overwrite;
00663
00664         userHitOK = true;
00665     }
00666
00667     delete dlg;
00668 #endif // qUnix
00669 #ifdef qMacCvsPP
00670     StDialogHandler theHandler(dlg_TagCreate, LCommander::GetTopCommander());
00671     LWindow *theDialog = theHandler.GetDialog();
00672     ThrowIfNil_(theDialog);
00673     static UInt16 sRuntimePanel = 1;
00674
00675     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00676         (theDialog->FindPaneByID(item_MultiViewPrefs));
00677     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00678
00679     multiView->SwitchToPanel(2);
00680     DoDataExchange_Globals(theDialog, true);
00681     multiView->SwitchToPanel(1);
00682     DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00683         noRecurs, overwriteExisting, checkUnmod, true);
00684
00685     groupView->SetValue(sRuntimePanel);
00686     theDialog->Show();
00687     MessageT hitMessage;
00688     while (true)
00689     {       // Let DialogHandler process events
00690         hitMessage = theHandler.DoDialog();
00691
00692         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00693             break;
00694     }
00695     theDialog->Hide();
00696     sRuntimePanel = groupView->GetValue();
00697
00698     if(hitMessage == msg_OK)
00699     {
00700         multiView->SwitchToPanel(1);
00701         DoDataExchange_TagCreateMain(theDialog, mf, sLastTag,
00702             noRecurs, overwriteExisting, checkUnmod, false);
00703         multiView->SwitchToPanel(2);
00704         DoDataExchange_Globals(theDialog, false);
00705         userHitOK = true;
00706     }
00707 #endif /* qMacCvsPP */
00708
00709     if(userHitOK)
00710     {
00711         tagName = sLastTag;
00712
00713         gCvsPrefs.save();
00714     }
00715
00716     return userHitOK;
00717 }
00718
00720 bool CompatTagDelete(const MultiFiles* mf,
00721                      bool& noRecurs, CPStr& tagName)
00722 {
00723
00724     bool userHitOK = false;
00725
00726     static CPStr sLastTag;
00727
00728     tagName = "";
00729     noRecurs = false;
00730
00731 #ifdef WIN32
00732     CPropertySheet pages("Delete tag settings");
00733     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00734     CTag_MAIN page1(mf, kTagDelete, sLastTag, noRecurs);
00735     CGetPrefs_GLOBALS page2;
00736     pages.AddPage(&page1);
00737     pages.AddPage(&page2);
00738     if(pages.DoModal() == IDOK)
00739     {
00740         noRecurs = page1.m_noRecurs == TRUE;
00741         sLastTag = page1.m_tagName;
00742
00743         page2.StoreValues();
00744         userHitOK = true;
00745     }
00746 #endif /* WIN32 */
00747 #if qUnix
00748     void *wid = UCreate_UntagDlg();
00749
00750     UCvsTagDel *dlg = new UCvsTagDel();
00751     UCvsTagDel_MAIN *tab1 = new UCvsTagDel_MAIN(sLastTag, noRecurs);
00752     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00753     dlg->AddPage(tab1, UCvsTagDel::kTabGeneral, 0);
00754
00755     if(dlg->DoModal())
00756     {
00757         noRecurs = tab1->m_norecurs;
00758         sLastTag = tab1->m_tagname;
00759
00760         userHitOK = true;
00761     }
00762
00763     delete dlg;
00764 #endif // qUnix
00765 #ifdef qMacCvsPP
00766     StDialogHandler theHandler(dlg_TagDelete, LCommander::GetTopCommander());
00767     LWindow *theDialog = theHandler.GetDialog();
00768     ThrowIfNil_(theDialog);
00769     static UInt16 sRuntimePanel = 1;
00770
00771     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00772         (theDialog->FindPaneByID(item_MultiViewPrefs));
00773     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00774
00775     multiView->SwitchToPanel(2);
00776     DoDataExchange_Globals(theDialog, true);
00777     multiView->SwitchToPanel(1);
00778     DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, true);
00779
00780     groupView->SetValue(sRuntimePanel);
00781     theDialog->Show();
00782     MessageT hitMessage;
00783     while (true)
00784     {       // Let DialogHandler process events
00785         hitMessage = theHandler.DoDialog();
00786
00787         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00788             break;
00789     }
00790     theDialog->Hide();
00791     sRuntimePanel = groupView->GetValue();
00792
00793     if(hitMessage == msg_OK)
00794     {
00795         multiView->SwitchToPanel(1);
00796         DoDataExchange_TagDeleteMain(theDialog, mf, sLastTag, noRecurs, false);
00797         multiView->SwitchToPanel(2);
00798         DoDataExchange_Globals(theDialog, false);
00799         userHitOK = true;
00800     }
00801 #endif /* qMacCvsPP */
00802
00803     if(userHitOK)
00804     {
00805         tagName = sLastTag;
00806
00807         gCvsPrefs.save();
00808     }
00809
00810     return userHitOK;
00811 }
00812
00814 bool CompatTagBranch(const MultiFiles* mf,
00815                      bool& noRecurs, CPStr& branchName,
00816                      bool& checkUnmod)
00817 {
00818     bool userHitOK = false;
00819
00820     static CPStr sLastBranch;
00821
00822     branchName = "";
00823     noRecurs = false;
00824     checkUnmod = false;
00825
00826 #ifdef WIN32
00827     CPropertySheet pages("Create branch settings");
00828     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00829     CTag_MAIN page1(mf, kTagBranch, sLastBranch, noRecurs, checkUnmod);
00830     CGetPrefs_GLOBALS page2;
00831     pages.AddPage(&page1);
00832     pages.AddPage(&page2);
00833     if(pages.DoModal() == IDOK)
00834     {
00835         checkUnmod = page1.m_checkUnmod == TRUE;
00836         noRecurs = page1.m_noRecurs == TRUE;
00837         sLastBranch = page1.m_tagName;
00838
00839         page2.StoreValues();
00840         userHitOK = true;
00841     }
00842 #endif /* WIN32 */
00843 #if qUnix
00844     void *wid = UCreate_BranchDlg();
00845
00846     UCvsTagBranch *dlg = new UCvsTagBranch();
00847     UCvsTagBranch_MAIN *tab1 = new UCvsTagBranch_MAIN(sLastBranch, noRecurs, checkUnmod);
00848     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00849     dlg->AddPage(tab1, UCvsTagBranch::kTabGeneral, 0);
00850
00851     if(dlg->DoModal())
00852     {
00853         checkUnmod = tab1->m_checkunmod;
00854         noRecurs = tab1->m_norecurs;
00855         sLastBranch = tab1->m_tagname;
00856
00857         userHitOK = true;
00858     }
00859
00860     delete dlg;
00861 #endif // qUnix
00862 #ifdef qMacCvsPP
00863     StDialogHandler theHandler(dlg_TagBranch, LCommander::GetTopCommander());
00864     LWindow *theDialog = theHandler.GetDialog();
00865     ThrowIfNil_(theDialog);
00866     static UInt16 sRuntimePanel = 1;
00867
00868     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00869         (theDialog->FindPaneByID(item_MultiViewPrefs));
00870     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00871
00872     multiView->SwitchToPanel(2);
00873     DoDataExchange_Globals(theDialog, true);
00874     multiView->SwitchToPanel(1);
00875     DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00876         noRecurs, checkUnmod, true);
00877
00878     groupView->SetValue(sRuntimePanel);
00879     theDialog->Show();
00880     MessageT hitMessage;
00881     while (true)
00882     {       // Let DialogHandler process events
00883         hitMessage = theHandler.DoDialog();
00884
00885         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00886             break;
00887     }
00888     theDialog->Hide();
00889     sRuntimePanel = groupView->GetValue();
00890
00891     if(hitMessage == msg_OK)
00892     {
00893         multiView->SwitchToPanel(1);
00894         DoDataExchange_TagBranchMain(theDialog, mf, sLastBranch,
00895             noRecurs, checkUnmod, false);
00896         multiView->SwitchToPanel(2);
00897         DoDataExchange_Globals(theDialog, false);
00898         userHitOK = true;
00899     }
00900 #endif /* qMacCvsPP */
00901
00902     if(userHitOK)
00903     {
00904         branchName = sLastBranch;
00905
00906         gCvsPrefs.save();
00907     }
00908
00909     return userHitOK;
00910 }
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 class MultiFiles;
00036
00037 bool CompatTagCreate(const MultiFiles* mf,
00038                      bool& noRecurs, bool& overwriteExisting,
00039                      CPStr& tagName, bool& checkUnmod);
00040
00041 bool CompatTagDelete(const MultiFiles* mf,
00042                      bool& noRecurs, CPStr& tagName);
00043
00044 bool CompatTagBranch(const MultiFiles* mf,
00045                      bool& noRecurs, CPStr& branchName,
00046                      bool& checkUnmod);
00047
00049 typedef enum
00050 {
00051     kTagAdd,
00052     kTagDelete,
00053     kTagBranch
00054 } kTagDlgType;
00055
00056 #ifdef WIN32
00057
00059 // CTag_MAIN dialog
00060
00061 class CTag_MAIN : public CPropertyPage
00062 {
00063     DECLARE_DYNAMIC(CTag_MAIN)
00064
00065 // Construction
00066 public:
00067     CTag_MAIN(const MultiFiles* mf,
00068         kTagDlgType type,
00069         const char* sLastTag,
00070         bool noRecurs, bool checkUnmod = false, bool overwriteExisting = false);
00071     ~CTag_MAIN();
00072
00073 // Dialog Data
00074     //{{AFX_DATA(CTag_MAIN)
00075     enum { IDD = IDD_TAG_MAIN };
00076     CStatic m_tagDescStatic;
00077     CButton m_grpBox;
00078     CButton m_overwriteExistingCheck;
00079     CButton m_checkUnmodCheck;
00080     CSmartComboBox  m_tagCombo;
00081     BOOL    m_noRecurs;
00082     BOOL    m_checkUnmod;
00083     BOOL    m_overwriteExisting;
00084     CString m_tagName;
00085     //}}AFX_DATA
00086
00087
00088 // Overrides
00089     // ClassWizard generate virtual function overrides
00090     //{{AFX_VIRTUAL(CTag_MAIN)
00091     protected:
00092     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00093     //}}AFX_VIRTUAL
00094
00095 // Implementation
00096 protected:
00097     // Generated message map functions
00098     //{{AFX_MSG(CTag_MAIN)
00099     virtual BOOL OnInitDialog();
00100     afx_msg void OnBrowseTag();
00101     //}}AFX_MSG
00102     DECLARE_MESSAGE_MAP()
00103 private:
00104     const MultiFiles* m_mf;
00105     kTagDlgType m_type;
00106 };
00107
00108 //{{AFX_INSERT_LOCATION}}
00109 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00110 #endif /* WIN32 */
00111
00112 #endif // !defined(AFX_TAGDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00028 #   include "MacMisc.h"
00029 #endif
00030
00031 #include <stdarg.h>
00032 #include <string.h>
00033
00034 #if !defined(USE_TCL)
00035 #   define USE_TCL 1
00036 #endif
00037
00038 #ifdef qMacCvsPP
00039 #   include "MacCvsApp.h"
00040 #endif /* qMacCvsPP */
00041
00042 #if qCarbon
00043 #   include "TclGlue.mac.h"
00044 #endif
00045
00046 // this cannot work before the stub library is linked with wrong libraries
00047 // and it causes WinCvs to crash
00048 //#define USE_TCL_STUBS
00049
00050 #if !defined(__STDC__) && (defined(TARGET_OS_MAC) || defined(WIN32))
00051 #   define __STDC__ 1
00052 #   define UNDEF_STDC
00053 #endif
00054
00055 #if USE_TCL
00056 #include "tcl.h"
00057
00058 #if TCL_MAJOR_VERSION != 8 && TCL_MINOR_VERSION < 1
00059 #   error "You need the Tcl 8.1.x header (or above) from Scriptics for this"
00060 #endif
00061 #endif
00062
00063 #ifdef UNDEF_STDC
00064 #   undef __STDC__
00065 #   define __STDC__ 0
00066 #
00067 #endif
00068
00069 #if 0//def WIN32
00070 //  this comes with the Scriptic release, or
00071 //  you can compile your own from generic/tclStubLib.c
00072 //  in the source release of Tcl and build it with any
00073 //  combination of the C runtime to match WinCVS, so you
00074 //  don't get those:
00075 // LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library
00076 #pragma comment(lib,"tclstub81.lib")
00077 #endif
00078
00079 #include "TclGlue.h"
00080 #include "AppConsole.h"
00081 #include "AppGlue.h"
00082 #include "CvsArgs.h"
00083 #include "CvsEntries.h"
00084 #include "dll_loader.h"
00085 #include "FileTraversal.h"
00086 #include "MacrosSetup.h"
00087 #include "MoveToTrash.h"
00088 #include "CvsPrefs.h"
00089 #include "CvsCommands.h"
00090
00091 #ifdef WIN32
00092 #   include "wincvs.h"
00093 #   include "wincvsdebug.h"
00094
00095 #   ifdef _DEBUG
00096 #   define new DEBUG_NEW
00097 #   undef THIS_FILE
00098     static char THIS_FILE[] = __FILE__;
00099 #   endif
00100 #endif /* WIN32 */
00101
00102 #ifndef NEW
00103 #define NEW new
00104 #endif
00105
00106 #if defined(_MSC_VER)
00107 #   define DECLC extern "C"
00108 #else
00109 #   define DECLC
00110 #endif
00111
00112 #if USE_TCL
00113
00114 #if defined(WIN32) || qCarbon
00115 #   define DEC_GLUE(f) (*f##_glue)
00116
00117     Tcl_Command DEC_GLUE(Tcl_CreateCommand)
00118         _ANSI_ARGS_((Tcl_Interp *interp, char *cmdName, Tcl_CmdProc *proc,
00119             ClientData clientData, Tcl_CmdDeleteProc *deleteProc));
00120     Tcl_Interp * DEC_GLUE(Tcl_CreateInterp) _ANSI_ARGS_((void));
00121     void DEC_GLUE(Tcl_AppendResult) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
00122     void DEC_GLUE(Tcl_SetResult) _ANSI_ARGS_((Tcl_Interp *interp, char *string, Tcl_FreeProc *freeProc));
00123     void DEC_GLUE(Tcl_DeleteInterp) _ANSI_ARGS_((Tcl_Interp *interp));
00124     int DEC_GLUE(Tcl_Eval) _ANSI_ARGS_((Tcl_Interp *interp, char *string));
00125     int DEC_GLUE(Tcl_EvalFile) _ANSI_ARGS_((Tcl_Interp *interp, char *fileName));
00126     char *      DEC_GLUE(Tcl_Alloc) _ANSI_ARGS_((unsigned int size));
00127     void        DEC_GLUE(Tcl_Free) _ANSI_ARGS_((char *ptr));
00128     char *      DEC_GLUE(Tcl_Realloc) _ANSI_ARGS_((char *ptr,
00129                     unsigned int size));
00130     int     DEC_GLUE(Tcl_ExprLong) _ANSI_ARGS_((Tcl_Interp *interp,
00131                 char *string, long *ptr));
00132     char *      DEC_GLUE(Tcl_Concat) _ANSI_ARGS_((int argc, char **argv));
00133     char *      DEC_GLUE(Tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp *interp,
00134                 char *part1, char *part2, char *newValue,
00135                 int flags));
00136     void        DEC_GLUE(Tcl_DStringStartSublist) _ANSI_ARGS_((
00137                 Tcl_DString *dsPtr));
00138     void        DEC_GLUE(Tcl_DStringEndSublist) _ANSI_ARGS_((Tcl_DString *dsPtr));
00139     void        DEC_GLUE(Tcl_DStringFree) _ANSI_ARGS_((Tcl_DString *dsPtr));
00140     void        DEC_GLUE(Tcl_DStringInit) _ANSI_ARGS_((Tcl_DString *dsPtr));
00141     void        DEC_GLUE(Tcl_DStringResult) _ANSI_ARGS_((Tcl_Interp *interp,
00142                 Tcl_DString *dsPtr));
00143     char *      DEC_GLUE(Tcl_DStringAppendElement) _ANSI_ARGS_((
00144                 Tcl_DString *dsPtr, CONST char *string));
00145     void        DEC_GLUE(TclFreeObj) _ANSI_ARGS_((Tcl_Obj *objPtr));
00146     void        DEC_GLUE(Tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp *interp,
00147                 Tcl_Obj *resultObjPtr));
00148     Tcl_Obj *   DEC_GLUE(Tcl_NewStringObj) _ANSI_ARGS_((CONST char *bytes,
00149                 int length));
00150     Tcl_Obj *   DEC_GLUE(Tcl_NewListObj) _ANSI_ARGS_((int objc,
00151                 Tcl_Obj *CONST objv[]));
00152     int     DEC_GLUE(Tcl_ListObjAppendElement) _ANSI_ARGS_((
00153                 Tcl_Interp *interp, Tcl_Obj *listPtr,
00154                 Tcl_Obj *objPtr));
00155
00156     void        DEC_GLUE(Tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp));
00157     int     DEC_GLUE(Tcl_Init) _ANSI_ARGS_((Tcl_Interp * interp));
00158     char *      DEC_GLUE(Tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp,
00159                 char * varName, char * newValue, int flags));
00160     void        DEC_GLUE(Tcl_FindExecutable) _ANSI_ARGS_((CONST char * argv0));
00161
00162 #   define GLUE_WRAP(f) f##_glue
00163 #   define Tcl_CreateCommand GLUE_WRAP(Tcl_CreateCommand)
00164 #   define Tcl_CreateInterp GLUE_WRAP(Tcl_CreateInterp)
00165 #   define Tcl_AppendResult GLUE_WRAP(Tcl_AppendResult)
00166 #   define Tcl_SetResult GLUE_WRAP(Tcl_SetResult)
00167 #   define Tcl_DeleteInterp GLUE_WRAP(Tcl_DeleteInterp)
00168 #   define Tcl_Eval GLUE_WRAP(Tcl_Eval)
00169 #   define Tcl_EvalFile GLUE_WRAP(Tcl_EvalFile)
00170 #   define Tcl_Alloc GLUE_WRAP(Tcl_Alloc)
00171 #   define Tcl_Free GLUE_WRAP(Tcl_Free)
00172 #   define Tcl_Realloc GLUE_WRAP(Tcl_Realloc)
00173 #   define Tcl_ExprLong GLUE_WRAP(Tcl_ExprLong)
00174 #   define Tcl_Concat GLUE_WRAP(Tcl_Concat)
00175 #   define Tcl_SetVar2 GLUE_WRAP(Tcl_SetVar2)
00176 #   define Tcl_DStringStartSublist GLUE_WRAP(Tcl_DStringStartSublist)
00177 #   define Tcl_DStringEndSublist GLUE_WRAP(Tcl_DStringEndSublist)
00178 #   define Tcl_DStringFree GLUE_WRAP(Tcl_DStringFree)
00179 #   define Tcl_DStringInit GLUE_WRAP(Tcl_DStringInit)
00180 #   define Tcl_DStringResult GLUE_WRAP(Tcl_DStringResult)
00181 #   define Tcl_DStringAppendElement GLUE_WRAP(Tcl_DStringAppendElement)
00182 #   define TclFreeObj GLUE_WRAP(TclFreeObj)
00183 #   define Tcl_SetObjResult GLUE_WRAP(Tcl_SetObjResult)
00184 #   define Tcl_NewStringObj GLUE_WRAP(Tcl_NewStringObj)
00185 #   define Tcl_NewListObj GLUE_WRAP(Tcl_NewListObj)
00186 #   define Tcl_ListObjAppendElement GLUE_WRAP(Tcl_ListObjAppendElement)
00187 #   define Tcl_SourceRCFile GLUE_WRAP(Tcl_SourceRCFile)
00188 #   define Tcl_Init GLUE_WRAP(Tcl_Init)
00189 #   define Tcl_SetVar GLUE_WRAP(Tcl_SetVar)
00190 #   define Tcl_FindExecutable GLUE_WRAP(Tcl_FindExecutable)
00191 #endif /* WIN32 */
00192
00193 #if qCarbon
00194 # if TARGET_RT_MAC_CFM
00195     // our app on OSX is CFM, while TCL is mach-o. We need to re-encode the function pointer
00196     // we give to the mach-o code
00197 #    define _TCL_CALLBACK(f) ((Tcl_CmdProc *)_tcl_cfm_macho(f))
00198 # elif TARGET_RT_MAC_MACHO
00199 #    define _TCL_CALLBACK(f) ((Tcl_CmdProc *)(f))
00200 # endif
00201 #   define CompatLoadLibrary CarbonCompatLoadLibrary
00202 #   define CompatCloseLibrary CarbonCompatCloseLibrary
00203 #   define _CompatCallLibrary _CarbonCompatCallLibrary
00204 #else
00205 #   ifdef qUnix
00206 #       define _TCL_CALLBACK(f) ((Tcl_CmdProc *)(f))
00207 #       ifdef CONST84 // is defined at tcl8.4
00208 #           define _TCL84_CONST CONST84
00209 #       endif
00210 #   else
00211 #       define _TCL_CALLBACK(f) f
00212 #   endif
00213 #endif
00214
00215 #ifndef _TCL84_CONST
00216 #   define _TCL84_CONST
00217 #endif
00218
00219 extern "C"
00220 {
00221     static int tclCvsProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00222     static int tclHelpProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00223     static int tclCvsOutProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00224     static int tclCvsErrProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00225     static int tclCvsBrowserProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00226     static int tclCvsEntriesProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00227     static void tclCvsEntriesDeleteProc(ClientData clientData);
00228 #ifdef WIN32
00229     static int tclDirProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00230 #endif /* WIN32 */
00231
00232     static int tclCvsExitOnErrorProc(ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00233     static int tclCvsLastErrorCodeProc(ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]);
00234     /* not used at the moment
00235        static Tcl_CmdProc tclSetDebugLevelProc(ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[]); */
00236 }
00237
00238 // the tcl browser class entity
00239 class CTCLBrowserEnt
00240 {
00241 public:
00242     CTCLBrowserEnt()
00243     {}
00244
00245     CTCLBrowserEnt(EntnodeData *data)
00246     : node(data)
00247     {}
00248
00249     CTCLBrowserEnt(const CTCLBrowserEnt & ent)
00250     : node(ent.node)
00251     {}
00252
00253     ~CTCLBrowserEnt()
00254     {}
00255
00256     CTCLBrowserEnt & operator=(const CTCLBrowserEnt & ent)
00257     {
00258         node = ent.node;
00259         return *this;
00260     }
00261
00262     bool IsSamePath(const char * pathstr) const
00263     {
00264         CStr path = pathstr;
00265         CTcl_Interp::Deunixfy(path);
00266
00267         CStr file;
00268         node.Data()->GetFullPathName(file);
00269         CTcl_Interp::Deunixfy(file);
00270
00271         return path.compare(file) == 0;
00272     }
00273
00274     EntnodeData* GetData() const
00275     {
00276         return node.Data();
00277     }
00278
00279     // returns normalized path and file name (GetName() may return relative path)
00280     void GetNormalized(CStr& path, CStr& fname) const
00281     {
00282         CStr file;
00283         node.Data()->GetFullPathName(file);
00284         CTcl_Interp::Deunixfy(file);
00285         SplitPath(file, path, fname);
00286     }
00287
00288 private:
00289     ENTNODE node;
00290 };
00291
00292 static std::vector<CTCLBrowserEnt> sTclBrowser;
00293
00294 class CTCLCvsConsole : public CCvsConsole
00295 {
00296 public:
00297     CTCLCvsConsole(Tcl_Interp *interp) : fInterp(interp)
00298     {
00299         fLen = 100;
00300         fAlloc = (char *)malloc((fLen + 1) * sizeof(char));
00301     }
00302     virtual ~CTCLCvsConsole()
00303     {
00304         if(fAlloc != 0L)
00305             free(fAlloc);
00306     }
00307
00308     virtual long cvs_out(char *txt, long len)
00309     {
00310         if(fAlloc == 0L)
00311             return 0;
00312
00313         if(len > fLen)
00314         {
00315             fLen = len;
00316             fAlloc = (char *)realloc(fAlloc, (fLen + 1) * sizeof(char));
00317         }
00318         if(fAlloc == 0L)
00319             return 0;
00320
00321         memcpy(fAlloc, txt, len * sizeof(char));
00322         fAlloc[len] = '\0';
00323
00324         Tcl_AppendResult(fInterp, fAlloc, 0L);
00325         return len;
00326     }
00327
00328     virtual long cvs_err(char *txt, long len)
00329     {
00330         return cvs_out(txt, len);
00331     }
00332 protected:
00333     Tcl_Interp *fInterp;
00334     int fLen;
00335     char *fAlloc;
00336 };
00337
00338 DECLC static int tclCvsProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00339 {
00340     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00341     CvsArgs args;
00342
00343     for(int i = 1; i < argc; i++)
00344     {
00345         args.add(argv[i]);
00346     }
00347
00348     CTCLCvsConsole console(interp);
00349     int exitc = launchCVS(0L, args.Argc(), args.Argv(), &console);
00350
00351     //
00352     // Set CvsLastErrorCode value. TCL script can query
00353     // this value using cvslasterrorcode command
00354     //
00355     tcl_interp->SetCvsLastErrorCode(exitc);
00356
00357     //
00358     // If command succeeded then return always TCL_OK and
00359     // proceed with script. If command failed (exitc != 0)
00360     // then exit only if CvsExitOnError is TRUE.
00361     //
00362     if(exitc == 0)
00363         return TCL_OK;
00364     else
00365         return tcl_interp->GetCvsExitOnError() ? TCL_ERROR : TCL_OK;
00366 }
00367
00368 DECLC static int tclHelpProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00369 {
00370     Tcl_AppendResult(interp, "Help :\n", 0L);
00371     Tcl_AppendResult(interp, "   cvs  : the cvs tool.\n", 0L);
00372     Tcl_AppendResult(interp, "   help : this help.\n", 0L);
00373     Tcl_AppendResult(interp, "Others commands :\n", 0L);
00374     Tcl_AppendResult(interp, "   cd   : change directory\n", 0L);
00375     Tcl_AppendResult(interp, "   pwd  : print current directory\n", 0L);
00376     Tcl_AppendResult(interp, "   ls   : list the current directory\n", 0L);
00377     Tcl_AppendResult(interp, "   info ?  : misc. informations\n", 0L);
00378     Tcl_AppendResult(interp, "   info commands : all the TCL commands\n", 0L);
00379     return TCL_OK;
00380 }
00381
00382 DECLC static int tclCvsOutProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00383 {
00384     for(int i = 1; i < argc; i++)
00385     {
00386         cvs_outstr(argv[i], strlen(argv[i]));
00387     }
00388     return TCL_OK;
00389 }
00390
00391 DECLC static int tclCvsErrProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00392 {
00393     for(int i = 1; i < argc; i++)
00394     {
00395         cvs_errstr(argv[i], strlen(argv[i]));
00396     }
00397     return TCL_OK;
00398 }
00399
00400 DECLC static int tclCvsBrowserProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00401 {
00402     if(argc < 2)
00403     {
00404         Tcl_AppendResult(interp, argv[0], " : Missing arguments\n", 0L);
00405         return TCL_ERROR;
00406     }
00407
00408     std::vector<CTCLBrowserEnt> & browser = clientData != 0L ?
00409         *(std::vector<CTCLBrowserEnt> *)clientData : sTclBrowser;
00410     if(strcmp(argv[1], "get") == 0)
00411     {
00412         if(argc != 2)
00413         {
00414             char *str = Tcl_Concat(argc, argv);
00415             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00416             Tcl_Free(str);
00417             return TCL_ERROR;
00418         }
00419
00420         Tcl_Obj *list = Tcl_NewListObj(0, 0L);
00421         std::vector<CTCLBrowserEnt>::const_iterator i;
00422         for(i = browser.begin(); i != browser.end(); ++i)
00423         {
00424             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00425             CStr path;
00426             entry->GetData()->GetFullPathName(path);
00427             CTcl_Interp::Unixfy(path);
00428
00429             Tcl_Obj * obj = Tcl_NewStringObj(path, path.length());
00430             Tcl_ListObjAppendElement(interp, list, obj);
00431             //TclFreeObj(obj);
00432         }
00433         Tcl_SetObjResult(interp, list);
00434         //TclFreeObj(list);
00435     }
00436     else if(strcmp(argv[1], "info") == 0)
00437     {
00438         if(argc != 4)
00439         {
00440             char *str = Tcl_Concat(argc, argv);
00441             Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00442             Tcl_Free(str);
00443             return TCL_ERROR;
00444         }
00445
00446         std::vector<CTCLBrowserEnt>::const_iterator i;
00447         for(i = browser.begin(); i != browser.end(); ++i)
00448         {
00449             const std::vector<CTCLBrowserEnt>::const_iterator entry = i;
00450             if(entry->IsSamePath(argv[2]))
00451             {
00452                 EntnodeData* data = entry->GetData();
00453                 CStr path, fname, value;
00454                 entry->GetNormalized(path, fname);
00455                 const char *res = Tcl_SetVar2(interp, argv[3], "name", fname, 0);
00456                 if(res == 0L)
00457                     goto err1;
00458
00459                 value = data->GetType() == ENT_FILE ? "file" : "folder";
00460                 res = Tcl_SetVar2(interp, argv[3], "kind", value, 0);
00461                 if(res == 0L)
00462                     goto err1;
00463
00464                 res = Tcl_SetVar2(interp, argv[3], "path", path, 0);
00465                 if(res == 0L)
00466                     goto err1;
00467
00468                 value = (*data)[EntnodeData::kStatus];
00469                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00470                 if(res == 0L)
00471                     goto err1;
00472
00473                 value = data->IsMissing() ? "1" : "0";
00474                 res = Tcl_SetVar2(interp, argv[3], "missing", value, 0);
00475                 if(res == 0L)
00476                     goto err1;
00477
00478                 value = data->IsUnknown() ? "1" : "0";
00479                 res = Tcl_SetVar2(interp, argv[3], "unknown", value, 0);
00480                 if(res == 0L)
00481                     goto err1;
00482
00483                 value = data->IsIgnored() ? "1" : "0";
00484                 res = Tcl_SetVar2(interp, argv[3], "ignored", value, 0);
00485                 if(res == 0L)
00486                     goto err1;
00487
00488                 value = data->IsLocked() ? "1" : "0";
00489                 res = Tcl_SetVar2(interp, argv[3], "locked", value, 0);
00490                 if(res == 0L)
00491                     goto err1;
00492
00493                 value = data->IsUnmodified() ? "0" : "1";
00494                 res = Tcl_SetVar2(interp, argv[3], "modified", value, 0);
00495                 if(res == 0L)
00496                     goto err1;
00497
00498                 value = data->GetDesc();
00499                 res = Tcl_SetVar2(interp, argv[3], "status", value, 0);
00500                 if(res == 0L)
00501                     goto err1;
00502
00503                 if(data->GetType() == ENT_FILE)
00504                 {
00505                     value = (*data)[EntnodeFile::kVN];
00506                     res = Tcl_SetVar2(interp, argv[3], "revision", value, 0);
00507                     if(res == 0L)
00508                         goto err1;
00509
00510                     value = (*data)[EntnodeFile::kTS];
00511                     res = Tcl_SetVar2(interp, argv[3], "timestamp", value, 0);
00512                     if(res == 0L)
00513                         goto err1;
00514
00515                     value = (*data)[EntnodeFile::kOption];
00516                     res = Tcl_SetVar2(interp, argv[3], "option", value, 0);
00517                     if(res == 0L)
00518                         goto err1;
00519
00520                     value = (*data)[EntnodeFile::kTag];
00521                     res = Tcl_SetVar2(interp, argv[3], "tag", value, 0);
00522                     if(res == 0L)
00523                         goto err1;
00524
00525                     value = (*data)[EntnodeFile::kConflict];
00526                     res = Tcl_SetVar2(interp, argv[3], "conflict", value, 0);
00527                     if(res == 0L)
00528                         goto err1;
00529                 }
00530
00531                 goto ok1;
00532 err1:
00533                 Tcl_AppendResult(interp, argv[0], " : Error while creating '", argv[3], "'\n", 0L);
00534                 return TCL_ERROR;
00535 ok1:
00536                 break;
00537             }
00538         }
00539     }
00540     else
00541     {
00542         char *str = Tcl_Concat(argc, argv);
00543         Tcl_AppendResult(interp, argv[0], " : Wrong arguments : '", str, "'\n", 0L);
00544         Tcl_Free(str);
00545         return TCL_ERROR;
00546     }
00547     return TCL_OK;
00548 }
00549
00550 class CFillTclEntries : public TraversalReport
00551 {
00552 public:
00553     CSortList<ENTNODE> & m_entries;
00554     std::vector<CStr> m_ignlist;
00555
00556     CFillTclEntries(CSortList<ENTNODE> & entries) :
00557         m_entries(entries) {}
00558
00559     virtual ~CFillTclEntries() {}
00560
00561     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const UFSSpec * macspec)
00562     {
00563         Entries_Open (m_entries, fullpath);
00564         BuildIgnoredList(m_ignlist, fullpath);
00565         return kContinueTraversal;
00566     }
00567
00568     virtual kTraversal ExitDirectory(const char *fullpath)
00569     {
00570         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00571         return kContinueTraversal;
00572     }
00573
00574     virtual kTraversal OnError(const char *err, int errcode)
00575     {
00576         return kTraversalError;
00577     }
00578
00579     virtual kTraversal OnIdle(const char *fullpath)
00580     {
00581         return kContinueTraversal;
00582     }
00583
00584     virtual kTraversal OnDirectory(const char *fullpath,
00585         const char *fullname,
00586         const char *name,
00587         const struct stat & dir, const UFSSpec * macspec)
00588     {
00589 #if defined(WIN32) || defined(TARGET_OS_MAC)
00590         if(stricmp(name, "CVS") == 0)
00591 #else
00592         if(strcmp(name, "CVS") == 0)
00593 #endif
00594             return kSkipFile;
00595
00596         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00597
00598         return kSkipFile;
00599     }
00600
00601     virtual kTraversal OnAlias(const char *fullpath,
00602         const char *fullname,
00603         const char *name,
00604         const struct stat & dir, const UFSSpec * macspec)
00605     {
00606         return OnFile(fullpath, fullname, name, dir, macspec);
00607     }
00608
00609     virtual kTraversal OnFile(const char *fullpath,
00610         const char *fullname,
00611         const char *name,
00612         const struct stat & dir, const UFSSpec * macspec)
00613     {
00614         /*EntnodeData *data = */Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00615
00616         return kContinueTraversal;
00617     }
00618 };
00619
00620
00621 DECLC static void tclCvsEntriesDeleteProc(ClientData clientData)
00622 {
00623     if(clientData != 0L)
00624         delete (std::vector<CTCLBrowserEnt> *)clientData;
00625 }
00626
00627 DECLC static int tclCvsEntriesProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00628 {
00629     if(argc != 3)
00630     {
00631         Tcl_AppendResult(interp, argv[0], " : Wrong # of arguments\n", 0L);
00632         return TCL_ERROR;
00633     }
00634
00635     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00636
00637     // refetch all items
00638     CFillTclEntries traverse(entries);
00639     CStr path(argv[1]);
00640     CTcl_Interp::Deunixfy(path);
00641     /*kTraversal res = */FileTraverse(path, traverse);
00642
00643     // add the missing files
00644     Entries_SetMissing(entries);
00645
00646     // now make the TCL entries
00647     std::vector<CTCLBrowserEnt> *browser = NEW std::vector<CTCLBrowserEnt>;
00648
00649     int numEntries = entries.NumOfElements();
00650     for(int i = 0; i < numEntries; i++)
00651     {
00652         const ENTNODE & theNode = entries.Get(i);
00653         EntnodeData *data = theNode.Data();
00654         browser->push_back(CTCLBrowserEnt(data));
00655     }
00656
00657     Tcl_Command cmd = Tcl_CreateCommand (interp, argv[2], _TCL_CALLBACK(tclCvsBrowserProc),
00658         (ClientData)browser, tclCvsEntriesDeleteProc);
00659
00660     return cmd != 0L ? TCL_OK : TCL_ERROR;
00661 }
00662
00663 #ifdef WIN32
00664 class LSReport : public TraversalReport
00665 {
00666 public:
00667     Tcl_Interp *fInterp;
00668     int fState;
00669
00670     LSReport(Tcl_Interp *interp) : fInterp(interp), fState(TCL_OK) {}
00671
00672     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const UFSSpec * macspec)
00673     {
00674         return kContinueTraversal;
00675     }
00676
00677     virtual kTraversal ExitDirectory(const char *fullpath)
00678     {
00679         return kContinueTraversal;
00680     }
00681
00682     virtual kTraversal OnError(const char *err, int errcode)
00683     {
00684         fState = TCL_ERROR;
00685         Tcl_AppendResult(fInterp, err, "\n", 0L);
00686         return kTraversalError;
00687     }
00688
00689     virtual kTraversal OnIdle(const char *fullpath)
00690     {
00691         return kContinueTraversal;
00692     }
00693
00694     virtual kTraversal OnAnyDevice(const char *fullpath,
00695         const char *fullname,
00696         const char *name,
00697         const struct stat & dir, const UFSSpec * macspec)
00698     {
00699         Tcl_AppendResult(fInterp, name, "\n", 0L);
00700         return kSkipFile;
00701     }
00702 };
00703
00704 DECLC static int tclDirProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00705 {
00706     LSReport report(interp);
00707     char path[256];
00708     getcwd(path, 256);
00709     kTraversal res = FileTraverse(path, report);
00710     return report.fState;
00711 }
00712 #endif /* WIN32 */
00713
00714 DECLC static int tclSafeRemove (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00715 {
00716     if(argc < 2)
00717     {
00718         Tcl_AppendResult(interp, argv[0], " : Missing list of files\n", 0L);
00719         return TCL_ERROR;
00720     }
00721
00722     for(int i = 1; i < argc; i++)
00723     {
00724         CStr fn(argv[i]);
00725         CTcl_Interp::Deunixfy(fn);
00726         if(!CompatMoveToTrash(fn, 0))  // dir is not needed, TCL profides fully qualified file name
00727         {
00728             cvs_err("Unable to trash '%s'\n", (char *)fn);
00729         }
00730     }
00731
00732     return TCL_OK;
00733 }
00734
00735 DECLC static int tclCvsExitOnErrorProc(ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00736 {
00737     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00738
00739     //
00740     // CvsExitOnError command can be used to define whether TCL macro
00741     // is automatically terminated if CVS command returned error (non zero).
00742     //
00743     // CvsExitOnError has following modes:
00744     //   false  = Do not exit automaticaly. CvsLastErrorCode constains the last error code.
00745     //   true   = Exit TCL script in error (default).
00746     //
00747     if(argc < 2)
00748     {
00749         Tcl_AppendResult(interp, argv[0], " : Missing argument (true|false)\n", 0L);
00750         return TCL_ERROR;
00751     }
00752
00753     if(strcmp(argv[1], "true") == 0)
00754         tcl_interp->SetCvsExitOnError(true);
00755     else if(strcmp(argv[1], "false") == 0)
00756         tcl_interp->SetCvsExitOnError(false);
00757     else
00758     {
00759         char *str = Tcl_Concat(argc, argv);
00760         Tcl_AppendResult(interp, argv[0], " : Wrong argument : '", str, "'\n", 0L);
00761         Tcl_Free(str);
00762
00763         return TCL_ERROR;
00764     }
00765
00766     return TCL_OK;
00767 }
00768
00769 DECLC static int tclCvsLastErrorCodeProc(ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00770 {
00771     CTcl_Interp *tcl_interp = (CTcl_Interp*) clientData;
00772
00773     if(argc < 2)
00774     {
00775         char value[35];
00776
00777         // CvsLastErrorCode called without arguments, so return current value
00778         sprintf(value, "%d", tcl_interp->GetCvsLastErrorCode());
00779         Tcl_AppendResult(interp, value, 0L);
00780     }
00781     else
00782     {
00783         // Set the value of LastErrorCode variable
00784         tcl_interp->SetCvsLastErrorCode(atoi(argv[1]));
00785     }
00786
00787     return TCL_OK;
00788 }
00789
00790 #if defined(WIN32)
00791 DECLC static int tclGetFileModTimeProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00792 {
00793     struct wnt_stat sb;
00794     struct tm * p_utc = NULL;
00795
00796     if (argc < 2)
00797     {
00798         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00799         return TCL_ERROR;
00800     }
00801
00802     if (argc > 2)
00803     {
00804         char * str = Tcl_Concat(argc, argv);
00805         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00806         Tcl_Free(str);
00807         return TCL_ERROR;
00808     }
00809
00810     if (wnt_stat(argv[1], &sb) != 0)
00811     {
00812         Tcl_AppendResult(interp, argv[0], " : Could not find file : '", argv[1], "'\n", 0L);
00813         return TCL_ERROR;
00814     }
00815
00816     p_utc = gmtime(& sb.st_mtime);
00817     Tcl_AppendResult(interp, asctime(p_utc), 0L);
00818     return TCL_OK;
00819 }
00820
00821 DECLC static int tclSetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00822 {
00823     if (argc < 2)
00824     {
00825         Tcl_AppendResult(interp, argv[0], " : Missing argument (int)\n", 0L);
00826         return TCL_ERROR;
00827     }
00828
00829     if (argc > 3)
00830     {
00831         char * str = Tcl_Concat(argc, argv);
00832         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00833         Tcl_Free(str);
00834         return TCL_ERROR;
00835     }
00836
00837     char * endc = NULL;
00838     unsigned long n;
00839     bool b;
00840
00841     n = strtoul(argv[1], & endc, 0);
00842     if (*endc)
00843     {
00844         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00845         return TCL_ERROR;
00846     }
00847
00848     if (argc == 2)
00849     {
00850         SetWinCvsDebugMask(n);
00851         return TCL_OK;
00852     }
00853
00854
00855     if (!stricmp(argv[2], "true"))
00856     {
00857         b = true;
00858     }
00859     else if (!stricmp(argv[2], "false"))
00860     {
00861         b = false;
00862     }
00863     else
00864     {
00865         b = strtoul(argv[2], & endc, 0) != 0;
00866         if (*endc)
00867         {
00868             Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[2], "'\n", 0L);
00869             return TCL_ERROR;
00870         }
00871     }
00872
00873     SetWinCvsDebugMaskBit(n,b);
00874     return TCL_OK;
00875 }
00876
00877 DECLC static int tclGetDebugMaskProc (ClientData clientData, Tcl_Interp *interp, int argc, _TCL84_CONST char *argv[])
00878 {
00879     char retstr[32];
00880     if (argc < 2)
00881     {
00882         _snprintf(retstr,32,"%u",GetWinCvsDebugMask());
00883         Tcl_AppendResult(interp, retstr, 0L);
00884         return TCL_OK;
00885     }
00886
00887     if (argc > 3)
00888     {
00889         char * str = Tcl_Concat(argc, argv);
00890         Tcl_AppendResult(interp, argv[0], " : Too many arguments : '", str, "'\n", 0L);
00891         Tcl_Free(str);
00892         return TCL_ERROR;
00893     }
00894
00895     char * endc = NULL;
00896     unsigned long n;
00897
00898     n = strtoul(argv[1], & endc, 0);
00899     if (*endc)
00900     {
00901         Tcl_AppendResult(interp, argv[0], " : Could not understand argument '", argv[1], "'\n", 0L);
00902         return TCL_ERROR;
00903     }
00904
00905     _snprintf(retstr, 32, "%u", GetWinCvsDebugMaskBit(n));
00906     Tcl_AppendResult(interp, retstr, 0L);
00907
00908     return TCL_OK;
00909 }
00910 #endif  // WIN32
00911
00912 #endif // USE_TCL
00913
00914 void TclBrowserReset(void)
00915 {
00916 #if USE_TCL
00917     sTclBrowser.erase(sTclBrowser.begin(), sTclBrowser.end());
00918 #endif
00919 }
00920
00921 // note that although 'path' is not used here any longer, it makes sense to retain
00922 // that attribute since it gives you an option to figure out relative filename,
00923 // relative to 'path' that designates the folder in which the operation takes place
00924 void TclBrowserAppend(const char * /*path*/, EntnodeData *data)
00925 {
00926 #if USE_TCL
00927     sTclBrowser.push_back(CTCLBrowserEnt(data));
00928 #endif
00929 }
00930
00931 static Tcl_Interp *myTcl_CreateInterp(void)
00932 {
00933 #if USE_TCL
00934 #   ifdef WIN32
00935     CWincvsApp* app = (CWincvsApp *)AfxGetApp();
00936     CStr path;
00937     app->GetAppModule(path);
00938     Tcl_FindExecutable(path);
00939 #   endif
00940 #endif
00941
00942 #   ifdef qMacCvsPP
00943     CStr appPath = CMacCvsApp::GetAppPath();
00944     Tcl_FindExecutable(appPath);
00945 #   endif
00946
00947 #   if USE_TCL
00948     Tcl_Interp *res = Tcl_CreateInterp();
00949     return res;
00950 #   else
00951     return NULL;
00952 #   endif
00953 }
00954
00955 CTcl_Interp::CTcl_Interp()
00956 {
00957     fInterp = 0L;
00958
00959     fExitOnError = true;
00960     fLastErrorCode = 0;
00961
00962 #if USE_TCL
00963     if(!CTcl_Interp::IsAvail())
00964     {
00965         cvs_err("TCL is not available !\n");
00966         return;
00967     }
00968
00969     fInterp = myTcl_CreateInterp();
00970     if(fInterp == 0L)
00971     {
00972         cvs_err("Unable to create a new TCL interpreter !\n");
00973         return;
00974     }
00975
00976     Tcl_Command cmd;
00977
00978     // this parameter is used to get access to CTcl_Interp::SetCvsLastErrorCode
00979     // in tclCvsProc method
00980     cmd = Tcl_CreateCommand (fInterp, "cvs", _TCL_CALLBACK(tclCvsProc),
00981         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
00982
00983     cmd = Tcl_CreateCommand (fInterp, "help", _TCL_CALLBACK(tclHelpProc),
00984         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00985     cmd = Tcl_CreateCommand (fInterp, "cvsout", _TCL_CALLBACK(tclCvsOutProc),
00986         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00987     cmd = Tcl_CreateCommand (fInterp, "cvserr", _TCL_CALLBACK(tclCvsErrProc),
00988         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00989     cmd = Tcl_CreateCommand (fInterp, "cvsbrowser", _TCL_CALLBACK(tclCvsBrowserProc),
00990         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00991     cmd = Tcl_CreateCommand (fInterp, "cvsentries", _TCL_CALLBACK(tclCvsEntriesProc),
00992         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00993 #ifdef WIN32
00994     cmd = Tcl_CreateCommand (fInterp, "ls", _TCL_CALLBACK(tclDirProc),
00995         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00996     cmd = Tcl_CreateCommand (fInterp, "dir", _TCL_CALLBACK(tclDirProc),
00997         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
00998 #endif /* WIN32 */
00999     cmd = Tcl_CreateCommand (fInterp, "trash", _TCL_CALLBACK(tclSafeRemove),
01000         (ClientData)0L, (Tcl_CmdDeleteProc *)0L);
01001
01002     cmd = Tcl_CreateCommand (fInterp, "cvsexitonerror", _TCL_CALLBACK(tclCvsExitOnErrorProc),
01003         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01004
01005     cmd = Tcl_CreateCommand (fInterp, "cvslasterrorcode", _TCL_CALLBACK(tclCvsLastErrorCodeProc),
01006         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01007 #if defined(WIN32)
01008     cmd = Tcl_CreateCommand (fInterp, "cvssetdebugmask", _TCL_CALLBACK(tclSetDebugMaskProc),
01009         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01010     cmd = Tcl_CreateCommand (fInterp, "cvsgetdebugmask", _TCL_CALLBACK(tclGetDebugMaskProc),
01011         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01012     cmd = Tcl_CreateCommand (fInterp, "cvsfilemodtime", _TCL_CALLBACK(tclGetFileModTimeProc),
01013         (ClientData)this, (Tcl_CmdDeleteProc *)0L);
01014 #endif  // defined(WIN32)
01015
01016     CStr rcfile;
01017     MacrosGetLoc(rcfile);
01018     if(!rcfile.endsWith(kPathDelimiter))
01019         rcfile << kPathDelimiter;
01020     rcfile << "startup.tcl";
01021     Tcl_SetVar(fInterp, "tcl_rcFileName", rcfile, TCL_GLOBAL_ONLY);
01022     Tcl_SetVar(fInterp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
01023     Tcl_Init(fInterp);
01024     Tcl_SourceRCFile(fInterp);
01025 #endif
01026 }
01027
01028 CTcl_Interp::~CTcl_Interp()
01029 {
01030 #if USE_TCL
01031     if(fInterp != 0L)
01032         Tcl_DeleteInterp(fInterp);
01033 #endif
01034 }
01035
01036 bool CTcl_Interp::IsAvail(void)
01037 {
01038 #if USE_TCL
01039 #if defined(TARGET_OS_MAC) && !qCarbon
01040     return Tcl_CreateInterp != 0L;
01041 #else /* !TARGET_OS_MAC */
01042     static bool firstTime = true;
01043     static bool tclAvail = false;
01044     if(firstTime)
01045     {
01046 #   if defined(WIN32) || qCarbon
01047         CompatConnectID connID;
01048 #   endif
01049
01050 #   ifdef WIN32
01051         extern char *findTcl (char *_minVer, int _exact, int _dbgOnly);
01052         char *tclver = 0L;
01053         try
01054         {
01055             tclver = findTcl("8.1", 0, 0);
01056         }
01057         catch(...)
01058         {
01059         }
01060
01061         if(tclver != 0L)
01062             tclAvail = CompatLoadLibrary(&connID, tclver) != 0;
01063
01064         if(!tclAvail)
01065             tclAvail = CompatLoadLibrary(&connID, "tcl87.dll") != 0 ||
01066             CompatLoadLibrary(&connID, "tcl86.dll") != 0 ||
01067             CompatLoadLibrary(&connID, "tcl85.dll") != 0 ||
01068             CompatLoadLibrary(&connID, "tcl84.dll") != 0 ||
01069             CompatLoadLibrary(&connID, "tcl83.dll") != 0 ||
01070             CompatLoadLibrary(&connID, "tcl82.dll") != 0 ||
01071             CompatLoadLibrary(&connID, "tcl81.dll") != 0;
01072 #   endif
01073
01074 #   if TARGET_RT_MAC_CFM
01075         if (UEnvironment::GetOSVersion() >= 0x1000)
01076             tclAvail = CompatLoadLibrary(&connID, "/System/Library/Frameworks/Tcl.framework");
01077         else
01078             tclAvail = CompatLoadLibrary(&connID, "tcl8.3");
01079 #   endif
01080 #   if TARGET_RT_MAC_MACHO
01081         tclAvail = CompatLoadLibrary(&connID, "/usr/lib/libtcl.dylib");
01082 #   endif
01083
01084 #   if defined(WIN32) || qCarbon
01085 #   define LOAD_CODEFRAG(name) \
01086         if(tclAvail) \
01087             tclAvail = (*(void **)&name##_glue = \
01088                 _CompatCallLibrary(connID, #name)) != 0L
01089 #   endif
01090 #   if defined(WIN32) || TARGET_API_MAC_CARBON
01091         LOAD_CODEFRAG(Tcl_CreateCommand);
01092         LOAD_CODEFRAG(Tcl_CreateInterp);
01093         LOAD_CODEFRAG(Tcl_AppendResult);
01094         LOAD_CODEFRAG(Tcl_SetResult);
01095         LOAD_CODEFRAG(Tcl_DeleteInterp);
01096         LOAD_CODEFRAG(Tcl_Eval);
01097         LOAD_CODEFRAG(Tcl_EvalFile);
01098         LOAD_CODEFRAG(Tcl_Alloc);
01099         LOAD_CODEFRAG(Tcl_Free);
01100         LOAD_CODEFRAG(Tcl_Realloc);
01101         LOAD_CODEFRAG(Tcl_ExprLong);
01102         LOAD_CODEFRAG(Tcl_Concat);
01103         LOAD_CODEFRAG(Tcl_SetVar2);
01104         LOAD_CODEFRAG(Tcl_DStringStartSublist);
01105         LOAD_CODEFRAG(Tcl_DStringEndSublist);
01106         LOAD_CODEFRAG(Tcl_DStringFree);
01107         LOAD_CODEFRAG(Tcl_DStringInit);
01108         LOAD_CODEFRAG(Tcl_DStringResult);
01109         LOAD_CODEFRAG(Tcl_DStringAppendElement);
01110         LOAD_CODEFRAG(TclFreeObj);
01111         LOAD_CODEFRAG(Tcl_SetObjResult);
01112         LOAD_CODEFRAG(Tcl_NewStringObj);
01113         LOAD_CODEFRAG(Tcl_NewListObj);
01114         LOAD_CODEFRAG(Tcl_ListObjAppendElement);
01115         LOAD_CODEFRAG(Tcl_SourceRCFile);
01116         LOAD_CODEFRAG(Tcl_Init);
01117         LOAD_CODEFRAG(Tcl_SetVar);
01118         LOAD_CODEFRAG(Tcl_FindExecutable);
01119
01120         if(!tclAvail)
01121             return false;
01122 #   endif /* WIN32 */
01123
01124         Tcl_Interp *interp = myTcl_CreateInterp();
01125         tclAvail = interp != 0L;
01126         if (!tclAvail)
01127             return false;
01128
01129         Tcl_Init(interp);
01130
01131         /* Destroy the interp we needed just for this */
01132         Tcl_DeleteInterp(interp);
01133
01134         firstTime = false;
01135     }
01136
01137     return tclAvail;
01138 #endif /* !TARGET_OS_MAC */
01139 #else
01140     return false;
01141 #endif
01142 }
01143
01144 kTclRes CTcl_Interp::DoScript(const char *script)
01145 {
01146 #if USE_TCL
01147     bool bTclFileStarted;
01148
01149     if(fInterp == 0L)
01150         return false;
01151
01152     // If script cmd begins with "source " then this
01153     // must be TCL file execution.
01154     bTclFileStarted = (strncmp(script, "source ", 7) == 0);
01155     if(bTclFileStarted)
01156         gCvsPrefs.SetTclFileRunning(true);
01157
01158     int exitc = Tcl_Eval(fInterp, (char *)script);
01159
01160     if(bTclFileStarted)
01161         gCvsPrefs.SetTclFileRunning(false);
01162
01163     size_t len = strlen(fInterp->result);
01164     if(exitc == TCL_ERROR)
01165     {
01166         cvs_errstr(fInterp->result, len);
01167         if(len != 0 && fInterp->result[len - 1] != '\n')
01168             cvs_errstr("\n", 1);
01169     }
01170     else
01171     {
01172         cvs_outstr(fInterp->result, len);
01173         if(len != 0 && fInterp->result[len - 1] != '\n')
01174             cvs_outstr("\n", 1);
01175     }
01176
01177     return exitc;
01178 #else
01179     return false;
01180 #endif
01181 }
01182
01183 kTclRes CTcl_Interp::DoScriptVar(const char *format, ...)
01184 {
01185 #if USE_TCL
01186     if(fInterp == 0L)
01187         return false;
01188
01189     va_list args;
01190     char script[1024] = {'\0'};
01191
01192     va_start (args, format);
01193     vsprintf (script, format, args);
01194     va_end (args);
01195
01196     return DoScript(script);
01197 #else
01198     return false;
01199 #endif
01200 }
01201
01202 kTclRes CTcl_Interp::DoFile(const char *file)
01203 {
01204 #if USE_TCL
01205     if(fInterp == 0L)
01206         return false;
01207
01208     int exitc = Tcl_EvalFile(fInterp, (char *)file);
01209     size_t len = strlen(fInterp->result);
01210     if(exitc == TCL_ERROR)
01211     {
01212         cvs_errstr(fInterp->result, len);
01213         if(len != 0 && fInterp->result[len - 1] != '\n')
01214             cvs_errstr("\n", 1);
01215     }
01216     else
01217     {
01218         cvs_outstr(fInterp->result, len);
01219         if(len != 0 && fInterp->result[len - 1] != '\n')
01220             cvs_outstr("\n", 1);
01221     }
01222
01223     return exitc;
01224 #else
01225     return false;
01226 #endif
01227 }
01228
01229 void CTcl_Interp::Unixfy(CStr & path)
01230 {
01231     char *ptr = path;
01232   if ( kTCLPathDelimiter != kPathDelimiter )
01233     while((ptr = strchr(ptr, kPathDelimiter)) != 0L)
01234     {
01235         *ptr++ = kTCLPathDelimiter;
01236     }
01237     ptr = (char *)path + path.length() - 1;
01238     if(*ptr == kTCLPathDelimiter)
01239     {
01240         *ptr = '\0';
01241     }
01242 }
01243
01244 void CTcl_Interp::Deunixfy(CStr & path)
01245 {
01246   if ( kTCLPathDelimiter != kPathDelimiter )
01247   {
01248     char *ptr = path;
01249     while((ptr = strchr(ptr, kTCLPathDelimiter)) != 0L)
01250     {
01251         *ptr++ = kPathDelimiter;
01252     }
01253   }
01254 }
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if !defined(TARGET_OS_MAC)  ||  TARGET_RT_MAC_MACHO
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 Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 #if TARGET_RT_MAC_MACHO
00039 # include "AppConsole.h"
00040 # include <mach-o/dyld.h>
00041 #endif
00042
00043 // struct to keep necessary logistic data for maintaining a connection
00044 // to a shared library on various implementations
00045 //
00046 struct _CompatConnectID
00047 {
00048     CFURLRef          bundleURL;
00049     CFBundleRef     myBundle;
00050 #if TARGET_RT_MAC_MACHO
00051     const struct mach_header *      dyld_header;
00052 #endif
00053   _CompatConnectID() :
00054       bundleURL(NULL),
00055       myBundle(NULL)
00056 #if TARGET_RT_MAC_MACHO
00057      ,dyld_header(NULL)
00058 #endif
00059   {
00060   }
00061 };
00062
00063 #if TARGET_RT_MAC_CFM
00064 static ProcPtr getSymFunctionCFM(CompatConnectID connID, const Str255 name)
00065 {
00066     long symCount;
00067     Ptr symAddr;
00068     int i;
00069     OSErr err = CountSymbols(connID, &symCount);
00070     if(err != noErr)
00071         return 0L;
00072
00073     for(i = 0; i < symCount; i++)
00074     {
00075         CFragSymbolClass symClass;
00076         Str255 symName;
00077         err = GetIndSymbol(connID, i, symName, &symAddr, &symClass);
00078         if(err != noErr)
00079             return 0L;
00080         if(memcmp(symName, name, name[0]) == 0)
00081             break;
00082     }
00083     if(i == symCount)
00084         return 0L;
00085     return (ProcPtr)symAddr;
00086 }
00087 #endif // TARGET_RT_MAC_CFM
00088
00089 int CarbonCompatLoadLibrary(CompatConnectID * connID, const char *name_dll)
00090 {
00091     if(connID == 0L)
00092         return 0;
00093
00094 #if TARGET_RT_MAC_CFM
00095     if (UEnvironment::GetOSVersion() < 0x1000)
00096     {
00097         OSErr err;
00098         Ptr mainAddr;
00099         Str255 errMessage;
00100         Str255 pname;
00101
00102         c2pstrcpy(pname, name_dll);
00103         err = GetSharedLibrary(pname, kPowerPCCFragArch, kPrivateCFragCopy, connID, &mainAddr, errMessage);
00104         return err == noErr;
00105     }
00106     else
00107 #endif // TARGET_RT_MAC_CFM
00108     {
00109         *connID = 0L;
00110
00111         _CompatConnectID *c = new _CompatConnectID;
00112
00113         *connID = (CompatConnectID)c;
00114
00115         if(c == 0L)
00116             return 0;
00117
00118         CFStringRef s = CFStringCreateWithCString(0L, name_dll, kCFStringEncodingUTF8);
00119         if(s == 0L)
00120             goto fail;
00121
00122         c->bundleURL    = CFURLCreateWithFileSystemPath(0L, s, kCFURLPOSIXPathStyle, false );
00123         if(c->bundleURL == 0L)
00124             goto fail;
00125
00126         c->myBundle = CFBundleCreate(0L, c->bundleURL );
00127         if(c->myBundle == 0L)
00128         {
00129 #if TARGET_RT_MAC_MACHO
00130       // check whether file exists
00131       //
00132       FSRef   libFile;
00133       FSCatalogInfo   libFileInfo;
00134       if ( CFURLGetFSRef(c->bundleURL, &libFile)  &&
00135            FSGetCatalogInfo(&libFile, kFSCatInfoNodeFlags, &libFileInfo, NULL, NULL, NULL) == noErr  &&
00136            (libFileInfo.nodeFlags & kFSNodeIsDirectoryMask) == 0 )
00137       {
00138         CFRelease(c->bundleURL);
00139         c->bundleURL = 0L;
00140
00141         c->dyld_header = NSAddImage(name_dll, NSADDIMAGE_OPTION_NONE);
00142         if ( c->dyld_header == NULL )
00143         {
00144             cvs_err("Error loading %s\n", name_dll);
00145             goto fail;
00146         }
00147       }
00148       else goto fail; // not a file or file not found
00149 #else
00150             goto fail;
00151 #endif
00152     }
00153     else
00154     {
00155         if(!CFBundleLoadExecutable( c->myBundle ))
00156             goto fail;
00157     }
00158
00159         CFRelease( s );
00160         return 1;
00161     fail:
00162         if(s != 0L)
00163             CFRelease( s );
00164         if(c != 0L)
00165         {
00166             if(c->bundleURL != 0L)
00167               CFRelease( c->bundleURL );
00168             if(c->myBundle != 0L)
00169               CFRelease( c->myBundle );
00170             *connID = 0L;
00171             delete c;
00172         }
00173         return 0;
00174     }
00175 }
00176
00177 int CarbonCompatCloseLibrary(CompatConnectID * connID)
00178 {
00179     if(connID == 0L)
00180         return 0;
00181
00182 #if TARGET_RT_MAC_CFM
00183     if (UEnvironment::GetOSVersion() < 0x1000)
00184     {
00185         CloseConnection(connID);
00186     }
00187     else
00188 #endif // TARGET_RT_MAC_CFM
00189     {
00190         _CompatConnectID *c = (_CompatConnectID *)*connID;
00191         if(c != 0L)
00192         {
00193 #if TARGET_RT_MAC_MACHO
00194             if ( c->dyld_header )
00195             {
00196 // %%% ??? how to unload an image ???
00197             }
00198             else
00199 #endif
00200             {
00201             CFBundleUnloadExecutable( c->myBundle );
00202             CFRelease( c->bundleURL );
00203             CFRelease( c->myBundle );
00204         }
00205             delete c;
00206         }
00207         *connID = 0L;
00208     }
00209     return 1;
00210 }
00211
00212 void *_CarbonCompatCallLibrary(CompatConnectID connID, const char *name_func)
00213 {
00214 #if TARGET_RT_MAC_CFM
00215     if (UEnvironment::GetOSVersion() < 0x1000)
00216     {
00217         ProcPtr symAddr;
00218         Str255 pname;
00219
00220         c2pstrcpy(pname, name_func);
00221
00222         symAddr = getSymFunctionCFM(connID, pname);
00223 #if qCvsDebug
00224     if ( symAddr == NULL ) cvs_err("_CarbonCompatCallLibrary(CFM): symbol '%s' not found!\n", name_func);
00225 #endif
00226         return symAddr;
00227     }
00228     else
00229 #endif // TARGET_RT_MAC_CFM
00230     {
00231         _CompatConnectID *c = (_CompatConnectID *)connID;
00232 #if TARGET_RT_MAC_MACHO
00233     if ( c->dyld_header )
00234     {
00235         char funcname[258];
00236
00237         sprintf(funcname, "_%.200s", name_func);
00238         if (NSIsSymbolNameDefinedInImage(c->dyld_header, funcname)) {
00239           NSSymbol theSym;
00240           void* p;
00241             theSym = NSLookupSymbolInImage(c->dyld_header, funcname, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND);
00242             p = NSAddressOfSymbol(theSym);
00243 #if qCvsDebug
00244         if ( p == NULL ) cvs_err("_CarbonCompatCallLibrary(dyld): symbol '%s' not found!\n", name_func);
00245 #endif
00246             return p;
00247         }
00248
00249 #if qCvsDebug
00250       cvs_err("_CarbonCompatCallLibrary(dyld): symbol '%s' not found!\n", name_func);
00251 #endif
00252         return 0L;
00253     }
00254     else
00255 #endif
00256         {
00257         CFStringRef s = CFStringCreateWithCString(0L, name_func, kCFStringEncodingMacRoman);
00258         if(s == 0L)
00259             return 0L;
00260
00261         void *ptr = CFBundleGetFunctionPointerForName(c->myBundle, s);
00262         CFRelease( s );
00263
00264 #if qCvsDebug
00265       if ( ptr == NULL ) cvs_err("_CarbonCompatCallLibrary(CFBundle): symbol '%s' not found!\n", name_func);
00266 #endif
00267           return ptr;
00268     }
00269     }
00270
00271 #if qCvsDebug
00272   cvs_err("_CarbonCompatCallLibrary: symbol '%s' not found!\n", name_func);
00273 #endif
00274
00275     return 0L;
00276 }
00277
00278 #define CompatLoadLibrary CarbonCompatLoadLibrary
00279 #define CompatCloseLibrary CarbonCompatCloseLibrary
00280 #define _CompatCallLibrary _CarbonCompatCallLibrary
00281
00282 #if TARGET_RT_MAC_CFM
00283 void *_tcl_cfm_macho(void *func)
00284 {
00285     static UInt32 templ[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420};
00286
00287     // nothing to do on OS9, cause we call a CFM code in this case
00288     if (UEnvironment::GetOSVersion() < 0x1000)
00289         return func;
00290
00291 #pragma message(" Memory leak here, fix me !")
00292     UInt32  *mfp = (UInt32*) NewPtr( sizeof(templ) );       //  Must later dispose of allocated memory
00293     if(mfp == 0L)
00294         return 0L;
00295
00296     mfp[0] = templ[0] | ((UInt32)func >> 16);
00297     mfp[1] = templ[1] | ((UInt32)func & 0xFFFF);
00298     mfp[2] = templ[2];
00299     mfp[3] = templ[3];
00300     mfp[4] = templ[4];
00301     mfp[5] = templ[5];
00302     MakeDataExecutable( mfp, sizeof(templ) );
00303
00304     return mfp;
00305 }
00306 #endif // TARGET_RT_MAC_CFM
00307
00308 #if 0 // TARGET_RT_MAC_MACHO
00309 typedef void *dl_funcptr;
00310
00311 static dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname, const char *pathname)
00312 {
00313     dl_funcptr p = NULL;
00314     char funcname[258];
00315
00316     sprintf(funcname, "_init%.200s", shortname);
00317
00318     /* This is also NeXT-specific. However, frameworks (the new style
00319     of shared library) and rld() can't be used in the same program;
00320     instead, you have to use dyld, which is mostly unimplemented. */
00321     {
00322         NSObjectFileImageReturnCode rc;
00323         NSObjectFileImage image;
00324         NSModule newModule;
00325         NSSymbol theSym;
00326         const char *errString;
00327
00328         if (NSIsSymbolNameDefined(funcname)) {
00329             theSym = NSLookupAndBindSymbol(funcname);
00330             p = (dl_funcptr)NSAddressOfSymbol(theSym);
00331             return p;
00332         }
00333         rc = NSCreateObjectFileImageFromFile(pathname, &image);
00334         switch(rc) {
00335             default:
00336             case NSObjectFileImageFailure:
00337             case NSObjectFileImageFormat:
00338             /* for these a message is printed on stderr by dyld */
00339             errString = "Can't create object file image";
00340             break;
00341             case NSObjectFileImageSuccess:
00342             errString = NULL;
00343             break;
00344             case NSObjectFileImageInappropriateFile:
00345             errString = "Inappropriate file type for dynamic loading";
00346             break;
00347             case NSObjectFileImageArch:
00348             errString = "Wrong CPU type in object file";
00349             break;
00350             case NSObjectFileImageAccess:
00351             errString = "Can't read object file (no access)";
00352             break;
00353         }
00354         if (errString == NULL) {
00355             newModule = NSLinkModule(image, pathname,
00356                 NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
00357             if (!newModule)
00358                 errString = "Failure linking new module";
00359         }
00360         if (errString != NULL) {
00361             cvs_err("%s\n", errString);
00362             return NULL;
00363         }
00364         if (!NSIsSymbolNameDefined(funcname)) {
00365             /* UnlinkModule() isn't implemented in current versions, but calling it does no harm */
00366             NSUnLinkModule(newModule, FALSE);
00367             cvs_err("Loaded module does not contain symbol %.200s", funcname);
00368             return NULL;
00369         }
00370         theSym = NSLookupAndBindSymbol(funcname);
00371         p = (dl_funcptr)NSAddressOfSymbol(theSym);
00372     }
00373
00374     return p;
00375 }
00376
00377 void *_tcl_cfm_macho(void *func)
00378 {
00379   return func;
00380 }
00381
00382 int CarbonCompatLoadLibrary(CompatConnectID * connID, const char *name_dll)
00383 {
00384     NSObjectFileImageReturnCode rc;
00385     NSObjectFileImage image;
00386     NSModule newModule;
00387     NSSymbol theSym;
00388     const char *errString;
00389
00390     *connID = 0L;
00391
00392     rc = NSCreateObjectFileImageFromFile(name_dll, &image);
00393     switch(rc) {
00394         default:
00395         case NSObjectFileImageFailure:
00396         case NSObjectFileImageFormat:
00397         /* for these a message is printed on stderr by dyld */
00398         errString = "Can't create object file image";
00399         break;
00400         case NSObjectFileImageSuccess:
00401         errString = NULL;
00402         break;
00403         case NSObjectFileImageInappropriateFile:
00404         errString = "Inappropriate file type for dynamic loading";
00405         break;
00406         case NSObjectFileImageArch:
00407         errString = "Wrong CPU type in object file";
00408         break;
00409         case NSObjectFileImageAccess:
00410         errString = "Can't read object file (no access)";
00411         break;
00412     }
00413     if (errString == NULL) {
00414         newModule = NSLinkModule(image, name_dll,
00415             NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
00416         if (!newModule)
00417             errString = "Failure linking new module";
00418     }
00419     if (errString != NULL) {
00420         cvs_err(errString);
00421         return 0;
00422     }
00423
00424     *connID = (CompatConnectID)newModule;
00425
00426     return 1;
00427 }
00428
00429 int CarbonCompatCloseLibrary(CompatConnectID * connID)
00430 {
00431     if(connID == 0L || *connID == 0L)
00432         return 0;
00433
00434     NSUnLinkModule((NSModule)*connID, FALSE);
00435     *connID = 0L;
00436
00437     return 1;
00438 }
00439
00440 void *_CarbonCompatCallLibrary(CompatConnectID connID, const char *name_func)
00441 {
00442     dl_funcptr p = NULL;
00443     char funcname[258];
00444
00445     sprintf(funcname, "_init%.200s", name_func);
00446
00447     /* This is also NeXT-specific. However, frameworks (the new style
00448     of shared library) and rld() can't be used in the same program;
00449     instead, you have to use dyld, which is mostly unimplemented. */
00450     NSSymbol theSym;
00451
00452     if (NSIsSymbolNameDefined(funcname)) {
00453         theSym = NSLookupAndBindSymbol(funcname);
00454         p = (dl_funcptr)NSAddressOfSymbol(theSym);
00455         return p;
00456     }
00457
00458     return 0L;
00459 }
00460
00461 #endif // TARGET_RT_MAC_MACHO
00462
00463 #endif // qCarbon
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00034 #   include <Resources.h>
00035 #   include <unistd.h>
00036 #   include <sys/types.h>
00037 #   include <sys/stat.h>
00038 #   include "MacMisc.h"
00039 #endif /* TARGET_OS_MAC */
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) == TRUE;
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 TARGET_OS_MAC
00138                 && c != (unsigned char)'Ñ' && c != (unsigned char)'¥' /* powerplant */
00139 #endif /* TARGET_OS_MAC */
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 != 0)
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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
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 TARGET_OS_MAC
00346     state = GetMacSig(arg, dir, spec, false);
00347     if(state != kFileIsOK)
00348         return state;
00349 #endif /* TARGET_OS_MAC */
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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00390     if(state != kFileIsOK)
00391         return state;
00392 #endif /* !TARGET_OS_MAC */
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 TARGET_OS_MAC
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 /* !TARGET_OS_MAC */
00422     if(state != kFileIsOK)
00423         return state;
00424 #endif /* !TARGET_OS_MAC */
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 }
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 TARGET_OS_MAC
00031 #   include <Files.h>
00032 #   if TARGET_API_MAC_OSX
00033 #       define UFSSpec FSRef
00034 #   else
00035 #       define UFSSpec FSSpec
00036 #   endif
00037 #else /* !TARGET_OS_MAC */
00038     typedef int FSSpec;
00039 #   define UFSSpec FSSpec
00040 #endif /* !TARGET_OS_MAC */
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 #endif /* TEXTBINARY_H */
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 "UCvsFrame.h"
00053 #include "UCvsFolders.h"
00054 #include "UCvsFiles.h"
00055 #include "TclGlue.h"
00056 #include "GetPrefs.h"
00057 #include "CvsArgs.h"
00058 #include "CvsPrefs.h"
00059 #include "AppConsole.h"
00060 #include "MacrosSetup.h"
00061 #include "Authen.h"
00062 #include "getopt.h"
00063
00064 UIMPLEMENT_DYNAMIC (UCvsApp, UWidget)
00065 UBEGIN_MESSAGE_MAP (UCvsApp, UWidget)
00066 ON_TIMER (UCvsApp::kProcessTimer, UCvsApp::OnMainTimer)
00067 UEND_MESSAGE_MAP ()
00068     UCvsApp *UCvsApp::gApp = 0L;
00069     CvsProcess *UCvsApp::gCvsProcess = 0L;
00070
00071      static void usage (void)
00072 {
00073     fprintf (stderr, "gcvs [--root=path]\n");
00074 }
00075
00076 UCvsApp::UCvsApp (int argc, char **argv):
00077 UWidget (::UEventGetWidID ()),
00078 gCvsRunning (false),
00079 gCvsStopping (false)
00080 {
00081     gApp = this;
00082
00083 #if qGTK
00084     add_pixmap_directory (PACKAGE_DATA_DIR "/pixmaps");
00085     add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps");
00086 #endif
00087
00088     // load the persistent values (i.e. preferences) and the locate the macros
00089     gCvsPrefs.load ();
00090     MacrosReloadAll ();
00091
00092     AddTimer (50, kProcessTimer);
00093
00094     m_mainFrame = new UCvsFrame();
00095
00096     if (argc > 0)
00097     {
00098         static struct option long_options[] = {
00099             {"root", required_argument, 0L, 1},
00100             {0, 0, 0, 0}
00101         };
00102         optind = 0;
00103         int option_index = 0, c;
00104         while ((c = getopt_long
00105             (argc, argv, "+", long_options,
00106              &option_index)) != EOF)
00107         {
00108             switch (c)
00109             {
00110             case 1:
00111                 UCvsFolders::SetDefaultRoot (optarg);
00112                 break;
00113             default:
00114                 cvs_err (_("Warning : unknown option\n"));
00115                 usage ();
00116                 break;
00117             }
00118         }
00119
00120     }
00121 }
00122
00123 UCvsApp::~UCvsApp ()
00124 {
00125 }
00126
00127 void
00128 UCvsApp::SayWelcome (void)
00129 {
00130     // say hello from the application, optionnaly prompt for the CVSROOT
00131     cvs_out (_("Welcome to %s %s\n"), PACKAGE, VERSION);
00132     if (gCvsPrefs.empty ())
00133         CompatGetPrefs ();
00134     else
00135         cvs_out ("CVSROOT: %s (%s)\n", (const char *) gCvsPrefs,
00136              gAuthen.kindstr ());
00137
00138     if (CTcl_Interp::IsAvail ())
00139     {
00140         cvs_out (_("TCL is available, shell and macros are enabled : help (select and press enter)\n"));
00141     }
00142     else
00143     {
00144         cvs_err (_("TCL is *not* available, shell and macros are disabled\n"));
00145     }
00146 }
00147
00148 void
00149 UCvsApp::SetCvsRunning (bool state)
00150 {
00151     if (state ^ gCvsRunning)
00152     {
00153         gCvsRunning = state;
00154     }
00155 }
00156
00157 void
00158 UCvsApp::SetCvsStopping (bool state)
00159 {
00160     if (state ^ gCvsStopping)
00161     {
00162         gCvsStopping = state;
00163     }
00164 }
00165
00166 UCvsFolders *
00167 UCvsApp::GetBrowserView (void)
00168 {
00169     UCmdTarget *cmd = UEventQueryWidget (kUCvsFoldersID);
00170     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFolders)))
00171         return (UCvsFolders *) cmd;
00172
00173     return 0L;
00174 }
00175
00176 UCvsFiles *
00177 UCvsApp::GetFilesView (void)
00178 {
00179     UCmdTarget *cmd = UEventQueryWidget (kUCvsFilesID);
00180     if (cmd != 0L && cmd->IsKindOf (URUNTIME_CLASS (UCvsFiles)))
00181         return (UCvsFiles *) cmd;
00182
00183     return 0L;
00184 }
00185
00186 const char *
00187 UCvsApp::GetAppName () const
00188 {
00189 #ifdef macintosh
00190     return "MacCvs";
00191 #elif defined(WIN32)
00192     return "WinCvs";
00193 #elif defined(qUnix)
00194     return PACKAGE;
00195 #endif
00196 }
00197
00198 const char *
00199 UCvsApp::GetAppVersion () const
00200 {
00201 #ifdef macintosh
00202
00203 #elif defined(WIN32)
00204
00205 #elif defined(qUnix)
00206     return VERSION;
00207 #endif
00208 }
00209
00210
00211 void UCvsApp::PeekPumpAndIdle(bool doIdle)
00212 {
00213     while (gtk_events_pending())
00214         gtk_main_iteration();
00215
00216     UEventGiveTime();
00217     if(doIdle) {
00218         // nothing to do on idle time yet
00219         /*long lIdle = 0;
00220
00221         while( OnIdle(lIdle++) )
00222             ; */
00223     }
00224 }
00225
00226 // retrieve filtering model to use
00227 KiFilterModel* UCvsApp::GetFilterModel() const
00228 {
00229         return m_mainFrame->GetFilterModel();
00230 }
00231
00232 // retrieve recursion model to use
00233 KiRecursionModel* UCvsApp::GetRecursionModel() const
00234 {
00235         return m_mainFrame->GetRecursionModel();
00236 }
00237
00238 KiIgnoreModel* UCvsApp::GetIgnoreModel() const
00239 {
00240         return m_mainFrame->GetIgnoreModel();
00241 }
00242
00243 /*const char *
00244 UCvsApp::GetAppLibFolder () const
00245 {
00246 #if qUnix
00247     return EXECLIB;
00248 #else
00249     return 0L;
00250 #endif
00251 }*/
00252
00253 #if qUnix
00254 static void
00255 set_cloexec (gint fd)
00256 {
00257     fcntl (fd, F_SETFD, FD_CLOEXEC);
00258 }
00259
00260 static int
00261 gnome_execute_async_with_env_fds (const char *dir, int argc,
00262                   char *const argv[], int envc,
00263                   char *const envv[], gboolean close_fds)
00264 {
00265     int parent_comm_pipes[2], child_comm_pipes[2];
00266     int child_errno, itmp, i, open_max;
00267     int res;
00268     char **cpargv;
00269     pid_t child_pid, immediate_child_pid;   /* XXX this routine assumes
00270                          * pid_t is signed */
00271
00272     if (pipe (parent_comm_pipes))
00273         return -1;
00274
00275     child_pid = immediate_child_pid = fork ();
00276
00277     switch (child_pid)
00278     {
00279     case -1:
00280         close (parent_comm_pipes[0]);
00281         close (parent_comm_pipes[1]);
00282         return -1;
00283
00284     case 0:     /* START PROCESS 1: child */
00285         child_pid = -1;
00286         res = pipe (child_comm_pipes);
00287         close (parent_comm_pipes[0]);
00288         if (!res)
00289             child_pid = fork ();
00290
00291         switch (child_pid)
00292         {
00293         case -1:
00294             itmp = errno;
00295             child_pid = -1; /* simplify parent code */
00296             write (parent_comm_pipes[1], &child_pid,
00297                    sizeof (child_pid));
00298             write (parent_comm_pipes[1], &itmp, sizeof (itmp));
00299             close (child_comm_pipes[0]);
00300             close (child_comm_pipes[1]);
00301             _exit (0);
00302             break;  /* END PROCESS 1: monkey in the middle dies */
00303
00304         default:
00305         {
00306             char buf[16];
00307
00308             close (child_comm_pipes[1]);
00309             while ((res =
00310                 read (child_comm_pipes[0], buf,
00311                       sizeof (buf))) > 0)
00312                 write (parent_comm_pipes[1], buf, res);
00313             close (child_comm_pipes[0]);
00314             _exit (0);  /* END PROCESS 1: monkey in the middle dies */
00315         }
00316             break;
00317
00318         case 0: /* START PROCESS 2: child of child */
00319             close (parent_comm_pipes[1]);
00320             /* pre-exec setup */
00321             close (child_comm_pipes[0]);
00322             set_cloexec (child_comm_pipes[1]);
00323             child_pid = getpid ();
00324             res = write (child_comm_pipes[1], &child_pid,
00325                      sizeof (child_pid));
00326
00327             if (envv)
00328             {
00329                 for (itmp = 0; itmp < envc; itmp++)
00330                     putenv (envv[itmp]);
00331             }
00332
00333             if (dir)
00334                 chdir (dir);
00335
00336             cpargv = (char **) malloc ((argc + 1) *
00337                            sizeof (char *));
00338             memcpy (cpargv, argv, argc * sizeof (char *));
00339             cpargv[argc] = NULL;
00340
00341             if (close_fds)
00342             {
00343                 int stdinfd;
00344                 /* Close all file descriptors but stdin stdout and stderr */
00345                 open_max = sysconf (_SC_OPEN_MAX);
00346                 for (i = 3; i < open_max; i++)
00347                     set_cloexec (i);
00348
00349                 if (child_comm_pipes[1] != 0)
00350                 {
00351                     close (0);
00352                     /* Open stdin as being nothingness, so that if someone tries to
00353                      * read from this they don't hang up the whole GNOME session. BUGFIX #1548 */
00354                     stdinfd =
00355                         open ("/dev/null", O_RDONLY);
00356                     g_assert (stdinfd >= 0);
00357                     if (stdinfd != 0)
00358                     {
00359                         dup2 (stdinfd, 0);
00360                         close (stdinfd);
00361                     }
00362                 }
00363             }
00364             signal (SIGPIPE, SIG_DFL);
00365             /* doit */
00366             execvp (cpargv[0], cpargv);
00367             free (cpargv);
00368
00369             /* failed */
00370             itmp = errno;
00371             write (child_comm_pipes[1], &itmp, sizeof (itmp));
00372             _exit (1);
00373             break;  /* END PROCESS 2 */
00374         }
00375         break;
00376
00377     default:        /* parent process */
00378         /* do nothing */
00379         break;
00380     }
00381
00382     close (parent_comm_pipes[1]);
00383
00384     res = read (parent_comm_pipes[0], &child_pid, sizeof (child_pid));
00385     if (res != sizeof (child_pid))
00386     {
00387         g_message ("res is %d instead of %d", res,
00388                sizeof (child_pid));
00389         child_pid = -1; /* really weird things happened */
00390     }
00391     else if (read
00392          (parent_comm_pipes[0], &child_errno,
00393           sizeof (child_errno)) == sizeof (child_errno))
00394     {
00395         errno = child_errno;
00396         child_pid = -1;
00397     }
00398
00399     /* do this after the read's in case some OS's handle blocking on pipe writes
00400      * differently */
00401     waitpid (immediate_child_pid, &itmp, 0);    /* eat zombies */
00402
00403     close (parent_comm_pipes[0]);
00404
00405     if (child_pid < 0)
00406         g_message ("gnome_execute_async_with_env_fds: returning %d",
00407                child_pid);
00408
00409     return child_pid;
00410 }
00411 #endif
00412
00413 void
00414 UCvsApp::Execute (int argc, char *const *argv)
00415 {
00416 #if qUnix
00417     // The Authentication code (AnthenModel) nulls home
00418     // after a CVS call so rather that mess with it (somebody
00419     // apparently meant to do it) we will make sure HOME is set
00420     // for our child process here.
00421     CvsArgs args(false);
00422     UStr home;
00423     home = "HOME=";
00424     home << gCvsPrefs.Home();
00425     args.add(home);
00426
00427     gnome_execute_async_with_env_fds (0L, argc, argv, args.Argc(), args.Argv(), true);
00428 #endif
00429 }
00430
00431 void
00432 UCvsApp::OnMainTimer (long time)
00433 {
00434     if (gCvsProcess != 0L)
00435     {
00436         cvs_process_give_time ();
00437         if (!cvs_process_is_active (gCvsProcess))
00438         {
00439             UCvsApp::gApp->SetCvsRunning (false);
00440             UCvsApp::gApp->SetCvsProcess((CvsProcess*)0L);
00441             UWidget::DoValidUI (false);
00442             UCvsApp::gApp->GetFilesView ()->ResetView ();
00443         }
00444     }
00445 }
00446
00447 #if qGTK
00448 #   define NEWDLG(name) \
00449     void *UCreate_##name(void) \
00450     { \
00451         return create_##name(); \
00452     }
00453 NEWDLG (MainWindow)
00454 NEWDLG (GraphWindow)
00455 NEWDLG (AskYesNo)
00456 NEWDLG (gcvs_Settings)
00457 NEWDLG (UpdateDlg)
00458 NEWDLG (PasswdDlg)
00459 NEWDLG (CommitDlg)
00460 NEWDLG (DiffDlg)
00461 NEWDLG (CheckoutDlg)
00462 NEWDLG (LogDlg)
00463 NEWDLG (ImportFilterDlg)
00464 NEWDLG (ImpWarningDlg)
00465 NEWDLG (ImpEntryDlg)
00466 NEWDLG (ImportDlg)
00467 NEWDLG (CmdlineDlg)
00468 NEWDLG (TagModDlg)
00469 NEWDLG (BranchModDlg)
00470 NEWDLG (UntagModDlg)
00471 NEWDLG (TagDlg)
00472 NEWDLG (BranchDlg)
00473 NEWDLG (UntagDlg)
00474 NEWDLG (SettingsDlg)
00475 NEWDLG (AboutDlg)
00476 NEWDLG (SelTagBranchDlg)
00477 NEWDLG (SelDetailsDlg)
00478 #endif
00479      void *
00480      UCreate_pixmap (UWidget * parent, const char *fileIcon)
00481 {
00482 #if qGTK
00483     GtkWidget *wid = (GtkWidget *) parent->GetWidget (kUMainWidget);
00484     return GTK_PIXMAP (create_pixmap (wid, fileIcon));
00485 #else
00486     return 0L;
00487 #endif
00488 }
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "BrowseViewModel.h"
00031
00032 class UCvsFrame;
00033 class UCvsFolders;
00034 class UCvsFiles;
00035
00036 class UCvsApp : public UWidget
00037 {
00038     UDECLARE_DYNAMIC(UCvsApp)
00039 public:
00040     UCvsApp(int argc, char **argv);
00041     virtual ~UCvsApp();
00042
00043     static UCvsApp *gApp;
00044         // a pointer on the pseudo application
00045
00046     void SayWelcome(void);
00047         // make the greetings and ask for the CVSROOT if necessary
00048
00049     inline void SetCvsProcess(CvsProcess* proc) { gCvsProcess = proc; };
00050     inline CvsProcess *GetCvsProcess(void) { return gCvsProcess; }
00051         // the cvs processus (or thread) when running
00052
00053     void SetCvsRunning(bool state);
00054     inline bool IsCvsRunning(void) { return gCvsRunning; }
00055         // when the cvs processus (or thread) is running
00056
00057     void SetCvsStopping(bool state);
00058     inline bool IsCvsStopping(void) { return gCvsStopping; }
00059         // when the cvs processus is stopping (it may take a while)
00060
00061     UCvsFolders *GetBrowserView(void);
00062         // get the left pane browser tree
00063
00064     UCvsFiles *GetFilesView(void);
00065         // get the right pane file list
00066
00067     const char *GetAppName(void) const;
00068     const char *GetAppLibFolder(void) const;
00069     const char *GetAppVersion(void) const;
00070
00071     void Execute(int argc, char * const *argv);
00072
00073     void PeekPumpAndIdle(bool);
00074
00075     KiFilterModel* GetFilterModel() const;
00076         // retrieve filtering model to use
00077
00078     KiRecursionModel* GetRecursionModel() const;
00079         // retrieve recursion model to use
00080
00081     KiIgnoreModel* GetIgnoreModel() const;
00082         // ignore model in use
00083
00084     UCvsFrame* GetMainFrame(void) { return m_mainFrame; }
00085         // get the document
00086
00087     enum
00088     {
00089         kProcessTimer = EV_COMMAND_START
00090     };
00091
00092 protected:
00093     UCvsFrame* m_mainFrame;
00094
00095     // please use public function to change or read
00096     bool gCvsRunning;
00097     bool gCvsStopping;
00098
00099     // the running process (if any)
00100     static CvsProcess *gCvsProcess;
00101
00102     ev_msg void OnMainTimer(long time);
00103
00104     UDECLARE_MESSAGE_MAP()
00105 };
00106
00107 #endif
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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     kUCvsBrowseToolbarID,       /* the browse toolbar */
00040     kUCvsFilterToolbarID,       /* the filter toolbar */
00041     kUCvsMenubarID              /* the menubar */
00042 };
00043
00044 // commands shared over the pseudo-widgets : thse commands are dispatched
00045 // mainly by the toolbar and the menubar.
00046 enum
00047 {
00048     cmdSAVE = EV_COMMAND_START + 100,
00049     cmdSAVE_AS,
00050     cmdPRINT,
00051     cmdPRINT_PREVIEW,
00052     cmdPRINT_SETUP,
00053     cmdSEND_MAIL,
00054     cmdEXIT,
00055     cmdUNDO,
00056     cmdCUT,
00057     cmdCOPY,
00058     cmdPASTE,
00059     cmdSELECT_ALL,
00060     cmdCLEAR_ALL,
00061     cmdFIND,
00062     cmdREPEAT,
00063     cmdFONT,
00064     cmdTOOLBAR,
00065     cmdSTATUS_BAR,
00066     cmdBROWSER_BAR,
00067     cmdFILES_BAR,
00068     cmdMULTI_BAR,
00069     cmdTAGS_BAR,
00070     cmdCONSOLE_BAR,
00071     cmdWORKSPACE,
00072     cmdOPEN,
00073     cmdPREFERENCES,
00074     cmdCMDLINE,
00075     cmdLOGIN,
00076     cmdLOGOUT,
00077     cmdSTOPCVS,
00078     cmdINIT,
00079     cmdIMPORT,
00080     cmdCHECKOUT,
00081     cmdRTAGCREATE,
00082     cmdRTAGDELETE,
00083     cmdRTAGBRANCH,
00084     cmdUPDATE,
00085     cmdCOMMIT,
00086     cmdADD,
00087     cmdADDB,
00088     cmdRMV,
00089     cmdTRASH,
00090     cmdTAGNEW,
00091     cmdTAGDELETE,
00092     cmdTAGBRANCH,
00093     cmdEXPLORE,
00094     cmdQUERYUPDATE,
00095     cmdRELOAD,
00096     cmdEDITSEL,
00097     cmdEDITSELDEF,
00098     cmdDIFF,
00099     cmdLOG,
00100     cmdSTATUS,
00101     cmdGRAPH,
00102     cmdLOCKF,
00103     cmdUNLOCKF,
00104     cmdEDIT,
00105     cmdUNEDIT,
00106     cmdWATCHON,
00107     cmdWATCHOFF,
00108     cmdRELEASE,
00109     cmdWATCHERS,
00110     cmdEDITORS,
00111     cmdCASCADE,
00112     cmdTILE_HORZ,
00113     cmdARRANGE,
00114     cmdFINDER,
00115     cmdCVS,
00116     cmdCVSCLIENT,
00117     cmdABOUT,
00118     cmdIGNORE,
00119     cmdUPFOLDER,
00120     cmdSAVESETTINGS,
00121     cmdFLAT,
00122     cmdFILTERMASK,
00123     cmdVIEW_ADDED,
00124     cmdVIEW_REMOVED,
00125     cmdVIEW_CHANGED,
00126     cmdHIDE_UNKNOWN,
00127     cmdVIEW_UNKNOWN,
00128     cmdVIEW_MODIFIED,
00129     cmdVIEW_MISSING,
00130     cmdVIEW_CONFLICT,
00131
00132     cmdSELMACRO, // contiguous BEGIN
00133     cmdSELMACROEND = cmdSELMACRO + 30,
00134
00135     cmdMACROADMIN, // contiguous BEGIN
00136     cmdMACROADMINEND = cmdMACROADMIN + 20,
00137
00138     cmdCREDITS, // contiguous BEGIN
00139     cmdCOPYRIGHTS // END
00140 };
00141
00142 #endif
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 extern void *UCreate_AboutDlg (void);
00057 extern void *UCreate_SelTagBranchDlg (void);
00058 extern void *UCreate_SelDetailsDlg (void);
00059
00060 #endif
Generated on Fri Jan 31 12:08:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 <string>
00040
00041 #include "BrowseViewModel.h"
00042 #include "BrowseViewColumn.h"
00043 #include "UCvsFiles.h"
00044 #include "UCvsDialogs.h"
00045 #include "UCvsFolders.h"
00046 #include "UCvsCommands.h"
00047 #include "UCvsFrame.h"
00048 #include "UCvsApp.h"
00049 #include "CvsPrefs.h"
00050 #include "FileTraversal.h"
00051 #include "MultiFiles.h"
00052 #include "CvsCommands.h"
00053 #include "CvsArgs.h"
00054 #include "TclGlue.h"
00055 #include "AppConsole.h"
00056 #include "MoveToTrash.h"
00057 #include "MacrosSetup.h"
00058
00059 #ifndef NAMESPACE
00060 #       if defined(_MSC_VER) || defined(__MWERKS__) || (__GNUC__ > 2)
00061 #               define NAMESPACE(w) w::
00062 #       else
00063 #               define NAMESPACE(w) ::
00064 #       endif
00065 #endif
00066
00067 #   define CBrowseFileView UCvsFiles
00068
00069 UIMPLEMENT_DYNAMIC(UCvsFiles, UWidget)
00070
00071 UBEGIN_MESSAGE_MAP(UCvsFiles, UWidget)
00072     ON_UUPDATECMD(cmdUPDATE, UCvsFiles::OnCmdUIUpdate)
00073     ON_UUPDATECMD(cmdCOMMIT, UCvsFiles::OnCmdUIUpdate)
00074     ON_UUPDATECMD(cmdDIFF, UCvsFiles::OnCmdUIUpdate)
00075     ON_UUPDATECMD(cmdEDIT, UCvsFiles::OnCmdUIUpdate)
00076     ON_UUPDATECMD(cmdEDITORS, UCvsFiles::OnCmdUIUpdate)
00077     ON_UUPDATECMD(cmdLOCKF, UCvsFiles::OnCmdUIUpdate)
00078     ON_UUPDATECMD(cmdLOG, UCvsFiles::OnCmdUIUpdate)
00079     ON_UUPDATECMD(cmdTAGNEW, UCvsFiles::OnCmdUIUpdate)
00080     ON_UUPDATECMD(cmdTAGDELETE, UCvsFiles::OnCmdUIUpdate)
00081     ON_UUPDATECMD(cmdTAGBRANCH, UCvsFiles::OnCmdUIUpdate)
00082     ON_UUPDATECMD(cmdSTATUS, UCvsFiles::OnCmdUIUpdate)
00083     ON_UUPDATECMD(cmdUNEDIT, UCvsFiles::OnCmdUIUpdate)
00084     ON_UUPDATECMD(cmdQUERYUPDATE, UCvsFiles::OnCmdUIUpdate)
00085     ON_UUPDATECMD(cmdUNLOCKF, UCvsFiles::OnCmdUIUpdate)
00086     ON_UUPDATECMD(cmdWATCHERS, UCvsFiles::OnCmdUIUpdate)
00087     ON_UUPDATECMD(cmdWATCHON, UCvsFiles::OnCmdUIUpdate)
00088     ON_UUPDATECMD(cmdWATCHOFF, UCvsFiles::OnCmdUIUpdate)
00089     ON_UUPDATECMD(cmdADD, UCvsFiles::OnCmdUIAdd)
00090     ON_UUPDATECMD(cmdADDB, UCvsFiles::OnCmdUIAddB)
00091     ON_UUPDATECMD(cmdRELEASE, UCvsFiles::OnCmdUIRelease)
00092     ON_UUPDATECMD(cmdRMV, UCvsFiles::OnCmdUIRmv)
00093     ON_UUPDATECMD(cmdGRAPH, UCvsFiles::OnCmdUIGraph)
00094     ON_UUPDATECMD(cmdEDITSELDEF, UCvsFiles::OnCmdUIEditseldef)
00095     ON_UUPDATECMD(cmdRELOAD, UCvsFiles::OnCmdUIReload)
00096     ON_UUPDATECMD(cmdUPFOLDER, UCvsFiles::OnCmdUIUpone)
00097     ON_UUPDATECMD(cmdTRASH, UCvsFiles::OnCmdUITrash)
00098     ON_UUPDATECMD(cmdEXPLORE, UCvsFiles::OnCmdUIExplore)
00099     ON_UUPDATECMD(cmdIGNORE, UCvsFiles::OnCmdUIIgnore)
00100     ON_UUPDATECMD(cmdEDITSEL, UCvsFiles::OnCmdUITrash)
00101     ON_UUPDATECMD_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFiles::OnCmdUIMacroSel)
00102     ON_UUPDATECMD(cmdFLAT, UCvsFiles::OnCmdUIViewRecursive)
00103     ON_UCOMMAND(cmdUPDATE, UCvsFiles::OnCmdUpdate)
00104     ON_UCOMMAND(cmdADD, UCvsFiles::OnCmdAdd)
00105     ON_UCOMMAND(cmdADDB, UCvsFiles::OnCmdAddb)
00106     ON_UCOMMAND(cmdCOMMIT, UCvsFiles::OnCmdCommit)
00107     ON_UCOMMAND(cmdRMV, UCvsFiles::OnCmdRmv)
00108     ON_UCOMMAND(cmdQUERYUPDATE, UCvsFiles::OnCmdQueryUpdate)
00109     ON_UCOMMAND(cmdRELOAD, UCvsFiles::OnCmdReload)
00110     ON_UCOMMAND(cmdUPFOLDER, UCvsFiles::OnCmdUpone)
00111     ON_UCOMMAND(cmdTRASH, UCvsFiles::OnCmdTrash)
00112     ON_UCOMMAND(cmdDIFF, UCvsFiles::OnCmdDiff)
00113     ON_UCOMMAND(cmdLOG, UCvsFiles::OnCmdLog)
00114     ON_UCOMMAND(cmdGRAPH, UCvsFiles::OnCmdGraph)
00115     ON_UCOMMAND(cmdSTATUS, UCvsFiles::OnCmdStatus)
00116     ON_UCOMMAND(cmdLOCKF, UCvsFiles::OnCmdLock)
00117     ON_UCOMMAND(cmdUNLOCKF, UCvsFiles::OnCmdUnlock)
00118     ON_UCOMMAND(cmdWATCHON, UCvsFiles::OnCmdWatchOn)
00119     ON_UCOMMAND(cmdWATCHOFF, UCvsFiles::OnCmdWatchOff)
00120     ON_UCOMMAND(cmdEDIT, UCvsFiles::OnCmdEdit)
00121     ON_UCOMMAND(cmdUNEDIT, UCvsFiles::OnCmdUnedit)
00122     ON_UCOMMAND(cmdWATCHERS, UCvsFiles::OnCmdWatchers)
00123     ON_UCOMMAND(cmdEDITORS, UCvsFiles::OnCmdEditors)
00124     ON_UCOMMAND(cmdRELEASE, UCvsFiles::OnCmdRelease)
00125     ON_UCOMMAND(cmdTAGNEW, UCvsFiles::OnCmdTagNew)
00126     ON_UCOMMAND(cmdTAGDELETE, UCvsFiles::OnCmdTagDelete)
00127     ON_UCOMMAND(cmdTAGBRANCH, UCvsFiles::OnCmdTagBranch)
00128     ON_UCOMMAND(cmdEXPLORE, UCvsFiles::OnCmdExplore)
00129     ON_UCOMMAND(cmdIGNORE, UCvsFiles::OnCmdIgnore)
00130     ON_UCOMMAND(cmdEDITSEL, UCvsFiles::OnCmdEditsel)
00131     ON_UCOMMAND(cmdEDITSELDEF, UCvsFiles::OnCmdEditseldef)
00132     ON_UCOMMAND(cmdFLAT, UCvsFiles::OnViewRecursive)
00133     ON_UCOMMAND_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFiles::OnMacroSel)
00134     ON_LIST_DBLCLICK(kUMainWidget, UCvsFiles::OnDblClick)
00135     ON_LIST_POPUP(kUMainWidget, UCvsFiles::OnPopup)
00136     ON_LIST_SELCOLUMN(kUMainWidget, UCvsFiles::OnSelColumn)
00137     ON_UDESTROY(UCvsFiles)
00138     ON_UCREATE(UCvsFiles)
00139 UEND_MESSAGE_MAP()
00140
00141 #if _0_
00142     ON_UUPDATECMD(cmdSMALLICONS, OnCmdUISmallIcons)
00143     ON_UUPDATECMD(cmdFULLLIST, OnCmdUIList)
00144     ON_UUPDATECMD(cmdROWDETAILS, OnCmdUIFullRowDetails)
00145     ON_COMMAND(ID_VIEW_SMALLICONS, OnViewSmallIcons)
00146     ON_COMMAND(ID_VIEW_FULLLIST, OnViewList)
00147     ON_COMMAND(ID_VIEW_ROWDETAILS, OnViewFullRowDetails)
00148     ON_WM_LBUTTONDOWN()
00149     ON_WM_RBUTTONDOWN()
00150     ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
00151     ON_NOTIFY_REFLECT(LVN_KEYDOWN, OnKeydown)
00152     ON_WM_TIMER()
00153
00154     //}}AFX_MSG_MAP
00155     ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
00156     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
00157 #endif
00158
00159 static void *sFileIconTextIcon;
00160 static void *sFileIconBinaryIcon;
00161 static void *sFileIconUnknownIcon;
00162 static void *sFileIconAddedIcon;
00163 static void *sFileIconConflictIcon;
00164 static void *sFileIconMissIcon;
00165 static void *sFolderIconIcon;
00166 static void *sFolderIconUnknownIcon;
00167 static void *sFolderIconMissIcon;
00168 static void *sFileIconTextModIcon;
00169 static void *sFileIconBinaryModIcon;
00170 static void *sFileIconIgnoredIcon;
00171 static void *sFolderIconIgnoredIcon;
00172 static void *sFileIconRemovedIcon;
00173
00174 /*
00175 kFileIconText,cvsfile
00176 kFileIconBinary,binfile
00177 kFileIconUnknown,unkfile
00178 kFileIconAdded,addfile
00179 kFileIconConflict,conflict
00180 kFileIconMiss,missfile
00181 kFolderIcon,folder
00182 kFolderIconUnknown,foldunk
00183 kFolderIconMiss,foldmiss
00184 kFileIconTextMod,modfile
00185 kFileIconBinaryMod,modbin
00186 kFileIconIgnored,ignfile
00187 kFolderIconIgnored,foldign
00188 kFileIconRemoved,delfile
00189 */
00190
00191 enum
00192 {
00193     kFileIconText = 0,
00194     kFileIconBinary,
00195     kFileIconUnknown,
00196     kFileIconAdded,
00197     kFileIconConflict,
00198     kFileIconMiss,
00199     kFolderIcon,
00200     kFolderIconUnknown,
00201     kFolderIconMiss,
00202     kFileIconTextMod,
00203     kFileIconBinaryMod,
00204     kFileIconIgnored,
00205     kFolderIconIgnored,
00206     kFileIconRemoved
00207 };
00208
00209 #ifdef _0_
00210 static const char * month_names[12] =
00211 {
00212         "Jan", "Feb", "Mar", "Apr",
00213         "May", "Jun", "Jul", "Aug",
00214         "Sep", "Oct", "Nov", "Dec"
00215 };
00216 #endif
00217
00218 CPersistentInt gFileViewSort("P_FileViewSort", EntnodeData::kName);
00219 CPersistentBool gFileViewSortAsc("P_FileViewSortAsc", true);
00220 struct CSortParam *gSortParam;
00221
00222 // context for traversing
00223 class KoTraversalContext
00224 {
00225     bool m_isRecursive;
00226     bool m_isShowIgnored;
00227     KiFilterModel* m_filter;
00228
00229 public:
00230     CBrowseFileView* m_view;
00231
00232     KoTraversalContext(CBrowseFileView* view)
00233         : m_isRecursive(false), m_isShowIgnored(false), m_filter(NULL), m_view(view)
00234     {
00235 #ifdef WIN32
00236         CWincvsApp* app = (CWincvsApp *)AfxGetApp()
00237 #elif qUnix
00238         UCvsApp* app = UCvsApp::gApp;
00239 #elif TARGET_RT_MAC_MACHO
00240         CMacCvsApp* app = CMacCvsApp::gApp;
00241 #endif
00242         if (app)
00243         {
00244             m_filter = app->GetFilterModel();
00245             m_isRecursive = app->GetRecursionModel()->IsShowRecursive();
00246             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00247         }
00248     }
00249
00250     bool IsRecursive() const
00251     {
00252         return m_isRecursive;
00253     }
00254
00255     bool IsShowIgnored() const
00256     {
00257         return m_isShowIgnored;
00258     }
00259
00260     bool IsMatch(EntnodeData* data) const
00261     {
00262         return m_filter->IsMatch(data);
00263     }
00264 };
00265
00266 class TViewFill : public TraversalReport
00267 {
00268 public:
00269     CSortList<ENTNODE> /*&*/ m_entries;
00270
00271     NAMESPACE(std) vector<CStr> m_ignlist;
00272     const KoTraversalContext *m_context;
00273     bool m_isShowIgnored;
00274
00275     TViewFill(const KoTraversalContext* context) :
00276         m_entries(200, ENTNODE::Compare), m_context(context) {}
00277
00278     TViewFill(const KoTraversalContext* context, CSortList<ENTNODE> & entries) :
00279         m_entries(entries), m_context(context) {}
00280
00281
00282     virtual ~TViewFill() {}
00283
00284     UCvsFiles* GetView() const
00285     {
00286         return m_context->m_view;
00287     }
00288
00289     int GetListCtrl() const
00290     {
00291         return GetView()->GetWidID();
00292     }
00293
00294     bool IsRecursive() const
00295     {
00296         //fprintf(stderr, "context_recur: %d\n", m_context->IsRecursive());
00297         return m_context->IsRecursive();
00298     }
00299
00300     bool IsShowIgnored() const
00301     {
00302         return m_context->IsShowIgnored();
00303     }
00304
00305     // initializes and adds new item to list view
00306     int InitItem(EntnodeData *data, void* iImage, const char *tag = 0L)
00307     {
00308             KoColumnContext context(GetView()->GetPath());
00309             char buf[256];
00310             GetView()->GetColumnModel()->GetAt(0)->GetText(&context, data, buf, 256);
00311
00312             int rownum;
00313             UEventSendMessage(GetListCtrl(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00314             UEventSendMessage(GetListCtrl(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00315             ULIST_INSERT entry;
00316             entry.row = rownum;
00317             entry.col = 0;
00318             entry.title = buf;
00319             entry.icon = /*UCvsFiles::GetImageForEntry(data);*/iImage;
00320             UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00321
00322             entry.icon = 0L;
00323
00324             if(rownum >= 0) {
00325                 data->Ref();
00326
00327 #if 0 /* TODO */
00328             lvi.state = data->IsLocked() ?
00329                 INDEXTOSTATEIMAGEMASK(2) : INDEXTOSTATEIMAGEMASK(1);
00330 #endif
00331
00332                 // set item text for additional columns
00333                 KiColumnModel* model = GetView()->GetColumnModel();
00334                 int columnCount = model->GetCount();
00335                 for(int j = 1; j < columnCount; j++)
00336                 {
00337                     char buf[256];
00338                     model->GetAt(j)->GetText(&context, data, buf, 256);
00339
00340                     if(buf[0] != 0L)
00341                     {
00342                         entry.col = j;
00343                         entry.title = buf;
00344                         UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00345                     }
00346                 }
00347
00348                 entry.col = model->GetColumn(EntnodeData::kStatus);
00349                 entry.title = data->GetDesc();
00350                 UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00351
00352                 if(tag != 0L && tag[0] != '\0' && !IsRecursive()) {
00353                     entry.col = model->GetColumn(EntnodeFile::kTag);
00354                     entry.title = tag == 0L ? "" : (const char *)tag;
00355                     UEventSendMessage(GetListCtrl(), EV_LIST_INSERT, kUMainWidget, &entry);
00356                 }
00357             }
00358             return rownum;
00359     }
00360
00361     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00362     {
00363         Entries_Open (m_entries, fullpath);
00364         BuildIgnoredList(m_ignlist, fullpath);
00365
00366         return kContinueTraversal;
00367     }
00368
00369     virtual kTraversal ExitDirectory(const char *fullpath)
00370     {
00371         // add the missing files
00372         Entries_SetMissing(m_entries);
00373
00374         int numEntries = m_entries.NumOfElements();
00375         for(int i = 0; i < numEntries; i++)
00376         {
00377             const ENTNODE & theNode = m_entries.Get(i);
00378             EntnodeData *data = theNode.Data();
00379             if (data->IsMissing() && m_context->IsMatch(data))
00380             {
00381                 if (!IsRecursive() || data->GetType() == ENT_FILE)
00382                 {
00383                     InitItem(data, UCvsFiles::GetImageForEntry(data));
00384                 }
00385             }
00386         }
00387
00388         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00389         return kContinueTraversal;
00390     }
00391
00392     virtual kTraversal OnError(const char *err, int errcode)
00393     {
00394         return kTraversalError;
00395     }
00396
00397     virtual kTraversal OnIdle(const char *fullpath)
00398     {
00399         return kContinueTraversal;
00400     }
00401
00402     virtual kTraversal OnDirectory(const char *fullpath,
00403         const char *fullname,
00404         const char *name,
00405         const struct stat & dir, const FSSpec * macspec)
00406     {
00407 #if qUnix
00408         if(strcmp(name, "CVS") == 0)
00409 #else
00410         if(stricmp(name, "CVS") == 0)
00411 #endif
00412             return kSkipFile;
00413
00414         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00415         if(!IsShowIgnored() && data->IsIgnored())
00416             return kSkipFile;
00417
00418         if (IsRecursive())
00419         {
00420             if (!data->IsIgnored() && !data->IsUnknown() && !data->IsMissing())
00421             {
00422                 TViewFill traverse(m_context);
00423                 FileTraverse(fullname, traverse);
00424             }
00425             return kSkipFile;
00426         }
00427
00428         // get the tag
00429         CStr subCVS;
00430         CStr tagName;
00431         subCVS = fullname;
00432         if(!subCVS.endsWith(kPathDelimiter))
00433             subCVS << kPathDelimiter;
00434         subCVS << "CVS";
00435         if(chdir(subCVS) == 0)
00436             Tag_Open(tagName, subCVS);
00437         if(chdir(fullpath) != 0)
00438             return kTraversalError;
00439
00440         InitItem(data, UCvsFiles::GetImageForEntry(data), tagName);
00441
00442         return kSkipFile;
00443     }
00444
00445     virtual kTraversal OnAlias(const char *fullpath,
00446         const char *fullname,
00447         const char *name,
00448         const struct stat & dir, const FSSpec * macspec)
00449     {
00450         return OnFile(fullpath, fullname, name, dir, macspec);
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         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, false, &m_ignlist);
00459         if(!IsShowIgnored() && data->IsIgnored())
00460             return kContinueTraversal;
00461
00462         if( m_context->IsMatch(data) )
00463         {
00464             InitItem(data, UCvsFiles::GetImageForEntry(data));
00465         }
00466
00467         return kContinueTraversal;
00468     }
00469 };
00470
00471 UCvsFiles::UCvsFiles() : UWidget(kUCvsFilesID), m_entries(200, ENTNODE::Compare), m_entriesMod(0), m_entriesLogMod(0)
00472
00473 {
00474     m_sort = (int)gFileViewSort;
00475     m_ascendant = (bool)gFileViewSortAsc;
00476
00477     SetRecursive(false);
00478 }
00479
00480 UCvsFiles::~UCvsFiles()
00481 {
00482     gFileViewSort = m_sort;
00483     gFileViewSortAsc = m_ascendant;
00484 }
00485
00486 int UCvsFiles::ProcessSelectionCommand(KiSelectionHandler& handler)
00487 {
00488   int nItem = -1;
00489
00490   MultiFiles mf;
00491   mf.newdir(GetPath());
00492   int pathLen = GetPath().length();
00493
00494   // first add the folders
00495   while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00496   {
00497     EntnodeData *data;
00498     UStr buf;
00499
00500     UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00501     const char* fullpath = data->GetFullPathName(buf);
00502
00503     if(data->GetType() == ENT_SUBDIR)
00504     {
00505         handler.OnFolder(fullpath);
00506     }
00507     else
00508     {
00509         const char* fn = data->GetFullPathName(buf) + pathLen;
00510         if(*fn == kPathDelimiter ) {
00511             fn++;
00512         }
00513
00514
00515         mf.newfile(fn, 0, (*data)[EntnodeFile::kVN]);
00516     }
00517   }
00518   if(mf.TotalNumFiles() != 0)
00519   {
00520     handler.OnFiles(&mf);
00521
00522     ResetView(handler.GetNeedViewReset());
00523   }
00524
00525   return 0;
00526 }
00527
00528 void UCvsFiles::OnDestroy(void)
00529 {
00530     // unregister notifications
00531     if (UCvsApp* app = UCvsApp::gApp)
00532     {
00533         app->GetFilterModel()->GetNotificationManager()->CheckOut(this);
00534         app->GetRecursionModel()->GetNotificationManager()->CheckOut(this);
00535         app->GetIgnoreModel()->GetNotificationManager()->CheckOut(this);
00536     }
00537
00538     delete this;
00539 }
00540
00541 static void onFilteringChanged(CObject* obj)
00542 {
00543         ((UCvsFiles *)obj)->OnFilteringChanged();
00544 }
00545
00546 void UCvsFiles::OnCreate(void)
00547 {
00548     KoTraversalContext context(this);
00549     bool recursive;
00550
00551     if(sFileIconTextIcon == 0L)
00552     {
00553         sFileIconTextIcon = UCreate_pixmap(this, "cvsfile.xpm");
00554         sFileIconBinaryIcon = UCreate_pixmap(this, "binfile.xpm");
00555         sFileIconUnknownIcon = UCreate_pixmap(this, "unkfile.xpm");
00556         sFileIconAddedIcon = UCreate_pixmap(this, "addfile.xpm");
00557         sFileIconConflictIcon = UCreate_pixmap(this, "conflict.xpm");
00558         sFileIconMissIcon = UCreate_pixmap(this, "missfile.xpm");
00559         sFolderIconIcon = UCreate_pixmap(this, "folder.xpm");
00560         sFolderIconUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00561         sFolderIconMissIcon = UCreate_pixmap(this, "foldmiss.xpm");
00562         sFileIconTextModIcon = UCreate_pixmap(this, "modfile.xpm");
00563         sFileIconBinaryModIcon = UCreate_pixmap(this, "modbin.xpm");
00564         sFileIconIgnoredIcon = UCreate_pixmap(this, "ignfile.xpm");
00565         sFolderIconIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00566         sFileIconRemovedIcon = UCreate_pixmap(this, "delfile.xpm");
00567     }
00568
00569     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 0), 0L);
00570
00571     recursive = context.IsRecursive();
00572
00573     SetRecursive(!recursive);
00574     HideColumns();
00575
00576     SetRecursive(recursive);
00577     ShowColumns();
00578
00579     if( UCvsApp* app = UCvsApp::gApp ) {
00580         app->GetFilterModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00581         app->GetRecursionModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00582         app->GetIgnoreModel()->GetNotificationManager()->CheckIn(this, onFilteringChanged);
00583     }
00584     UEventSendMessage(GetWidID(), EV_LIST_SETFEEDBACK, UMAKEINT(kUMainWidget, 1), 0L);
00585 }
00586
00587 void UCvsFiles::ResetView(const char *path, bool notifyBrowser)
00588 {
00589     m_path = path;
00590     ResetView(true);
00591
00592     UStr title(UCvsApp::gApp->GetAppName());
00593     title << ": ";
00594     title << GetPath();
00595     UEventSendMessage(kUCvsFrameID, EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00596
00597     if(notifyBrowser)
00598     {
00599         // notify the tree
00600         UCvsApp::gApp->GetBrowserView()->StepToLocation(path);
00601     }
00602 }
00603
00604 void UCvsFiles::GetEntriesModTime(time_t & newEntriesMod, time_t & newEntriesLogMod)
00605 {
00606     newEntriesMod = 0;
00607     newEntriesLogMod = 0;
00608     if(chdir(GetPath()) != 0)
00609         return;
00610     if(chdir("CVS") != 0)
00611         return;
00612
00613     struct stat sb;
00614     if (stat("Entries", &sb) != -1)
00615         newEntriesMod = sb.st_mtime;
00616     if (stat("Entries.log", &sb) != -1)
00617         newEntriesLogMod = sb.st_mtime;
00618     chdir(GetPath());
00619 }
00620
00621 int UCvsFiles::Search(const char *title)
00622 {
00623     int row = -1;
00624     while((row = UEventSendMessage(GetWidID(), EV_LIST_GETNEXT,
00625                                      UMAKEINT(kUMainWidget, row), 0L)) != -1)
00626     {
00627         ULIST_INFO info;
00628         info.col = 0;
00629         info.row = row;
00630         UEventSendMessage(GetWidID(), EV_LIST_GETINFO, kUMainWidget, &info);
00631         if(info.title == 0L)
00632             continue;
00633
00634 #if qUnix
00635         if(strcmp(title, info.title) == 0)
00636 #else
00637         if(stricmp(title, info.title) == 0)
00638 #endif
00639             return row;
00640     }
00641
00642     return -1;
00643 }
00644
00645 void UCvsFiles::ResetView(bool forceReload, bool notifyBrowser)
00646 {
00647     UWaitCursor wait;
00648
00649     static bool sSemaphore = false;
00650     USemaphore policeman(sSemaphore);
00651     if(policeman.IsEnteredTwice())
00652         return;
00653
00654     // - check if we really need to reload (forceReload == false)
00655     // - wait a bit for the watcher in order to let him tell us
00656     // if something was modified.
00657     time_t newEntriesMod;
00658     time_t newEntriesLogMod;
00659     GetEntriesModTime(newEntriesMod, newEntriesLogMod);
00660     if(!forceReload)
00661     {
00662         if(m_entriesMod == newEntriesMod && m_entriesLogMod == newEntriesLogMod)
00663             return;
00664     }
00665
00666     // reset all the watchers
00667     m_entriesMod = newEntriesMod;
00668     m_entriesLogMod = newEntriesLogMod;
00669
00670     // get the selection to later try to restore it
00671     CvsArgs selection(false);
00672     int nItem = -1;
00673     UStr buf;
00674
00675     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL,
00676                                      UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00677     {
00678         EntnodeData *data;
00679         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00680         //selection.add((*data)[EntnodeData::kName]);
00681         selection.add(data->GetFullPathName(buf));
00682     }
00683
00684     UEventSendMessage(GetWidID(), EV_LIST_RESETALL, kUMainWidget, 0L);
00685
00686     // make sure columns are ok
00687     KoTraversalContext context(this);
00688
00689     if ((context.IsRecursive() && !m_isRecursive) || (!context.IsRecursive() && m_isRecursive))
00690     {
00691
00692         KiColumnModel* oldModel = GetColumnModel();
00693         int oldCount = oldModel->GetCount();
00694         const KiColumn* oldColumn = (0 <= m_sort && m_sort < oldCount) ? oldModel->GetAt(m_sort) : NULL;
00695         HideColumns();
00696
00697         SetRecursive(context.IsRecursive());
00698         ShowColumns();
00699
00700         if (oldColumn == NULL)
00701         {
00702                 m_sort = 0;
00703         }
00704         else
00705         {
00706             KiColumnModel* newModel = GetColumnModel();
00707             int newCount = newModel->GetCount();
00708             int sort = -1;
00709             for (int pos = 0; pos < newCount && sort == -1; pos++)
00710             {
00711                 if (newModel->GetAt(pos) == oldColumn)
00712                 {
00713                     sort = pos;
00714                 }
00715             }
00716             m_sort = (sort >= 0) ? sort : 0;
00717         }
00718     }
00719
00720     // refetch all items
00721     TViewFill traverse(/*this, */&context, m_entries);
00722     /*kTraversal res = */FileTraverse(GetPath(), traverse);
00723
00724     // add the missing files
00725     Entries_SetMissing(m_entries);
00726
00727     int numEntries = m_entries.NumOfElements();
00728     for(int i = 0; i < numEntries; i++)
00729     {
00730         const ENTNODE & theNode = m_entries.Get(i);
00731         EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00732         if(!data->IsMissing())
00733             continue;
00734
00735         //TViewFill::
00736         traverse.InitItem(data, UCvsFiles::GetImageForEntry(data));
00737 #ifdef _0_
00738         int rownum;
00739         UEventSendMessage(GetWidID(), EV_LIST_NEWROW, kUMainWidget, &rownum);
00740         UEventSendMessage(GetWidID(), EV_LIST_ROWSETDATA, UMAKEINT(kUMainWidget, rownum), data);
00741         ULIST_INSERT entry;
00742         entry.row = rownum;
00743
00744         entry.col = 0;
00745         entry.title = (*data)[EntnodeData::kName];
00746         entry.icon = UCvsFiles::GetImageForEntry(data);
00747         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00748
00749         entry.icon = 0L;
00750
00751         // set item text for additional columns
00752         for(int j = 1; j < m_modelColumns->GetCount(); j++)
00753         {
00754             const char *info = (*data)[j];
00755             if(info != 0L)
00756             {
00757                 entry.col = j;
00758                 entry.title = info;
00759                 UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00760             }
00761         }
00762         entry.col = EntnodeData::kStatus;
00763         entry.title = data->GetDesc();
00764         UEventSendMessage(GetWidID(), EV_LIST_INSERT, kUMainWidget, &entry);
00765 #endif
00766     }
00767
00768     Resort();
00769
00770     // now restore the selection
00771     int argc = selection.Argc(), c;
00772     char * const *argv = selection.Argv();
00773     for(c = 0; c < argc; c++)
00774     {
00775         int row = Search(argv[c]);
00776         if(row != -1)
00777             UEventSendMessage(GetWidID(), EV_LIST_ADDSEL, UMAKEINT(kUMainWidget, row), 0L);
00778     }
00779
00780     if(notifyBrowser)
00781     {
00782         // notify the tree
00783         UCvsApp::gApp->GetBrowserView()->ResetView(forceReload);
00784     }
00785 }
00786
00787 void *UCvsFiles::GetImageForEntry(EntnodeData *data)
00788 {
00789     int result;
00790     void *resIcon = 0L;
00791
00792     if(data->GetType() == ENT_FILE)
00793     {
00794         const char *info = 0L;
00795         if(data->IsIgnored())
00796         {
00797             result = kFileIconIgnored;
00798         }
00799         else if(data->IsUnknown())
00800         {
00801             result = kFileIconUnknown;
00802         }
00803         else if(data->IsMissing())
00804         {
00805             result = data->IsRemoved() ? kFileIconRemoved : kFileIconMiss;
00806         }
00807         else if((*data)[EntnodeFile::kConflict] != 0L)
00808         {
00809             result = kFileIconConflict;
00810         }
00811         else if(data->IsRemoved())
00812         {
00813             result = kFileIconRemoved;
00814         }
00815         else if((info = (*data)[EntnodeFile::kOption]) != 0L && strcmp(info, "-kb") == 0)
00816         {
00817             result = data->IsUnmodified() ? kFileIconBinary : kFileIconBinaryMod;
00818         }
00819         else
00820         {
00821             result = data->IsUnmodified() ? kFileIconText : kFileIconTextMod;
00822         }
00823     }
00824     else
00825     {
00826         if(data->IsIgnored())
00827         {
00828             result = kFolderIconIgnored;
00829         }
00830         else if(data->IsUnknown())
00831         {
00832             result = kFolderIconUnknown;
00833         }
00834         else if(data->IsMissing())
00835         {
00836             result = kFolderIconMiss;
00837         }
00838         else
00839         {
00840             result = kFolderIcon;
00841         }
00842     }
00843
00844 #if qGTK
00845     void *pixmap = 0L;
00846     switch(result)
00847     {
00848     case kFileIconText:
00849         pixmap = sFileIconTextIcon;
00850         break;
00851     case kFileIconBinary:
00852         pixmap = sFileIconBinaryIcon;
00853         break;
00854     case kFileIconUnknown:
00855         pixmap = sFileIconUnknownIcon;
00856         break;
00857     case kFileIconAdded:
00858         pixmap = sFileIconAddedIcon;
00859         break;
00860     case kFileIconConflict:
00861         pixmap = sFileIconConflictIcon;
00862         break;
00863     case kFileIconMiss:
00864         pixmap = sFileIconMissIcon;
00865         break;
00866     case kFolderIcon:
00867         pixmap = sFolderIconIcon;
00868         break;
00869     case kFolderIconUnknown:
00870         pixmap = sFolderIconUnknownIcon;
00871         break;
00872     case kFolderIconMiss:
00873         pixmap = sFolderIconMissIcon;
00874         break;
00875     case kFileIconTextMod:
00876         pixmap = sFileIconTextModIcon;
00877         break;
00878     case kFileIconBinaryMod:
00879         pixmap = sFileIconBinaryModIcon;
00880         break;
00881     case kFileIconIgnored:
00882         pixmap = sFileIconIgnoredIcon;
00883         break;
00884     case kFolderIconIgnored:
00885         pixmap = sFolderIconIgnoredIcon;
00886         break;
00887     case kFileIconRemoved:
00888         pixmap = sFileIconRemovedIcon;
00889         break;
00890     }
00891     if(pixmap != 0L)
00892     {
00893         resIcon = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00894     }
00895 #endif
00896
00897     return resIcon;
00898 }
00899
00900
00901 int UCvsFiles::OnCmdUpdate(void)
00902 {
00903   KoUpdateHandler handler;
00904
00905   return ProcessSelectionCommand(handler);
00906 }
00907
00908 bool UCvsFiles::DisableGeneric(bool needSelection)
00909 {
00910     return ((UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L) == -1) && needSelection) ||
00911         UCvsApp::gApp->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00912 }
00913
00914 bool UCvsFiles::DisableGeneric()
00915 {
00916     return DisableGeneric(true);
00917 }
00918
00919 void UCvsFiles::OnCmdUIUpdate(UCmdUI *pCmdUI)
00920 {
00921     if(DisableGeneric())
00922     {
00923         pCmdUI->Enable(false);
00924         return;
00925     }
00926
00927     int nItem = -1;
00928     bool res = true;
00929     int numFiles = 0;
00930     int numFolders = 0;
00931
00932     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00933     {
00934         EntnodeData *data;
00935         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00936
00937         if(data->IsUnknown())
00938         {
00939             res = false;
00940             break;
00941         }
00942         if(data->GetType() == ENT_FILE)
00943             numFiles++;
00944         else
00945             numFolders++;
00946
00947         if((numFiles != 0) && (numFolders != 0))
00948         {
00949             res = false;
00950             break;
00951         }
00952     }
00953
00954     pCmdUI->Enable(res);
00955 }
00956
00957 void UCvsFiles::OnCmdUIAdd(UCmdUI *pCmdUI)
00958 {
00959     if(DisableGeneric())
00960     {
00961         pCmdUI->Enable(false);
00962         return;
00963     }
00964
00965     int nItem = -1;
00966     bool res = true;
00967     int numFiles = 0;
00968     int numFolders = 0;
00969
00970     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
00971     {
00972         EntnodeData *data;
00973         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
00974
00975         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
00976         {
00977             res = false;
00978             break;
00979         }
00980         if(data->GetType() == ENT_FILE)
00981         {
00982             numFiles++;
00983         }
00984         else
00985             numFolders++;
00986
00987         if((numFiles != 0) && (numFolders != 0))
00988         {
00989             res = false;
00990             break;
00991         }
00992     }
00993
00994     pCmdUI->Enable(res);
00995 }
00996
00997 void UCvsFiles::OnCmdUIAddB(UCmdUI *pCmdUI)
00998 {
00999     if(DisableGeneric())
01000     {
01001         pCmdUI->Enable(false);
01002         return;
01003     }
01004
01005     int nItem = -1;
01006     bool res = true;
01007
01008     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01009     {
01010         EntnodeData *data;
01011         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01012
01013         if(data->GetType() != ENT_FILE)
01014         {
01015             res = false;
01016             break;
01017         }
01018         if(!(data->IsUnknown() || (data->IsRemoved() && data->IsMissing())))
01019         {
01020             res = false;
01021             break;
01022         }
01023     }
01024
01025     pCmdUI->Enable(res);
01026 }
01027
01028 void UCvsFiles::OnCmdUIRelease(UCmdUI *pCmdUI)
01029 {
01030     if(DisableGeneric())
01031     {
01032         pCmdUI->Enable(false);
01033         return;
01034     }
01035
01036     int nItem = -1;
01037     bool res = true;
01038     int numFolders = 0;
01039
01040     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01041     {
01042         EntnodeData *data;
01043         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01044
01045         if(data->IsUnknown() || data->GetType() != ENT_SUBDIR)
01046         {
01047             res = false;
01048             break;
01049         }
01050         numFolders++;
01051
01052         if(numFolders > 1)
01053         {
01054             res = false;
01055             break;
01056         }
01057     }
01058
01059     pCmdUI->Enable(res);
01060 }
01061
01062 void UCvsFiles::OnCmdUIRmv(UCmdUI *pCmdUI)
01063 {
01064     if(DisableGeneric())
01065     {
01066         pCmdUI->Enable(false);
01067         return;
01068     }
01069
01070     int nItem = -1;
01071     bool res = true;
01072
01073     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01074     {
01075         EntnodeData *data;
01076         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01077
01078         if(data->IsUnknown() || data->IsRemoved() || data->GetType() == ENT_SUBDIR)
01079         {
01080             res = false;
01081             break;
01082         }
01083     }
01084
01085     pCmdUI->Enable(res);
01086 }
01087
01088 void UCvsFiles::OnCmdUIGraph(UCmdUI *pCmdUI)
01089 {
01090     if(DisableGeneric())
01091     {
01092         pCmdUI->Enable(false);
01093         return;
01094     }
01095
01096     int nItem = -1;
01097     bool res = true;
01098
01099     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01100     {
01101         EntnodeData *data;
01102         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01103
01104         if(data->IsUnknown() || data->GetType() == ENT_SUBDIR)
01105         {
01106             res = false;
01107             break;
01108         }
01109     }
01110
01111     pCmdUI->Enable(res);
01112 }
01113
01114 void UCvsFiles::OnCmdUIEditseldef(UCmdUI *pCmdUI)
01115 {
01116     if(DisableGeneric())
01117     {
01118         pCmdUI->Enable(false);
01119         return;
01120     }
01121
01122     int nItem = -1;
01123     bool res = true;
01124
01125     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01126     {
01127         EntnodeData *data;
01128         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01129
01130         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01131         {
01132             res = false;
01133             break;
01134         }
01135     }
01136
01137     pCmdUI->Enable(res);
01138     if(gCvsPrefs.Viewer() != 0L)
01139     {
01140         CStr title(_i18n("Edit with "));
01141         title << gCvsPrefs.Viewer();
01142         pCmdUI->SetText(title);
01143     }
01144 }
01145
01146 void UCvsFiles::OnCmdUIReload(UCmdUI *pCmdUI)
01147 {
01148     pCmdUI->Enable(!DisableGeneric());
01149 }
01150
01151 void UCvsFiles::OnCmdUIUpone(UCmdUI *pCmdUI)
01152 {
01153     pCmdUI->Enable(!DisableGeneric());
01154 }
01155
01156 void UCvsFiles::OnCmdUITrash(UCmdUI *pCmdUI)
01157 {
01158     if(DisableGeneric())
01159     {
01160         pCmdUI->Enable(false);
01161         return;
01162     }
01163
01164     int nItem = -1;
01165     bool res = true;
01166
01167     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01168     {
01169         EntnodeData *data;
01170         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01171         if(data->GetType() == ENT_SUBDIR || data->IsMissing())
01172         {
01173             res = false;
01174             break;
01175         }
01176     }
01177
01178     pCmdUI->Enable(res);
01179 }
01180
01181 void UCvsFiles::OnCmdUIExplore(UCmdUI *pCmdUI)
01182 {
01183     if(DisableGeneric())
01184     {
01185         pCmdUI->Enable(false);
01186         return;
01187     }
01188
01189     int nItem = -1;
01190     bool res = true;
01191     int numItem = 0;
01192
01193     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01194     {
01195         EntnodeData *data;
01196         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01197
01198         if(data->IsMissing() || ++numItem > 1)
01199         {
01200             res = false;
01201             break;
01202         }
01203     }
01204
01205     pCmdUI->Enable(res);
01206 }
01207
01208 void UCvsFiles::OnCmdUIIgnore(UCmdUI *pCmdUI)
01209 {
01210     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01211     pCmdUI->Enable(!DisableGeneric(false));
01212     pCmdUI->Check(m_ignore->IsShowIgnored());
01213 }
01214
01215 void UCvsFiles::OnCmdUIViewRecursive(UCmdUI *pCmdUI)
01216 {
01217     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01218     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01219     pCmdUI->Check(m_recursion->IsShowRecursive());
01220 }
01221
01222 void UCvsFiles::OnCmdUIMacroSel(int cmd, UCmdUI *pCmdUI)
01223 {
01224     if(DisableGeneric())
01225     {
01226         pCmdUI->Enable(false);
01227         return;
01228     }
01229
01230     int nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, -1), 0L);
01231     pCmdUI->Enable(nItem != -1 && CTcl_Interp::IsAvail());
01232 }
01233
01234 int UCvsFiles::OnCmdAdd(void)
01235 {
01236   KoAddHandler handler;
01237
01238   return ProcessSelectionCommand(handler);
01239 }
01240
01241 void UCvsFiles::OnViewRecursive(void)
01242 {
01243     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01244     m_recursion->ToggleRecursion();
01245     ResetView(true, true);
01246
01247     UCvsApp::gApp->GetMainFrame()->OnFilterMaskEntered();
01248 }
01249
01250 int UCvsFiles::OnCmdAddb(void)
01251 {
01252   KoAddBinaryHandler handler;
01253
01254   return ProcessSelectionCommand(handler);
01255 }
01256
01257 int UCvsFiles::OnCmdCommit(void)
01258 {
01259   KoCommitHandler handler;
01260   return ProcessSelectionCommand(handler);
01261 }
01262
01263 int UCvsFiles::OnCmdRmv(void)
01264 {
01265   KoFileRemoveHandler handler;
01266
01267   return ProcessSelectionCommand(handler);
01268 }
01269
01270 int UCvsFiles::OnCmdQueryUpdate(void)
01271 {
01272   KoQueryUpdateHandler handler;
01273
01274   return ProcessSelectionCommand(handler);
01275 }
01276
01277 int UCvsFiles::OnCmdReload(void)
01278 {
01279     ResetView(true, true);
01280     return 0;
01281 }
01282
01283 int UCvsFiles::OnCmdUpone(void)
01284 {
01285     UStr uppath, filename;
01286     SplitPath(GetPath(), uppath, filename);
01287     ResetView(uppath, true);
01288     return 0;
01289 }
01290
01291 int UCvsFiles::OnCmdTrash(void)
01292 {
01293   KoMoveToTrashHandler handler;
01294
01295   return ProcessSelectionCommand(handler);
01296 }
01297
01298 int UCvsFiles::OnCmdDiff(void)
01299 {
01300   KoDiffHandler handler;
01301
01302   return ProcessSelectionCommand(handler);
01303 }
01304
01305 int UCvsFiles::OnCmdLog(void)
01306 {
01307   KoLogHandler handler;
01308
01309   return ProcessSelectionCommand(handler);
01310 }
01311
01312 int UCvsFiles::OnCmdGraph(void)
01313 {
01314   KoGraphHandler handler;
01315
01316   return ProcessSelectionCommand(handler);
01317 }
01318
01319 int UCvsFiles::OnCmdStatus(void)
01320 {
01321   KoStatusHandler handler;
01322
01323   return ProcessSelectionCommand(handler);
01324 }
01325
01326 int UCvsFiles::OnCmdLock(void)
01327 {
01328   KoLockHandler handler;
01329
01330   return ProcessSelectionCommand(handler);
01331 }
01332
01333 int UCvsFiles::OnCmdUnlock(void)
01334 {
01335   KoUnlockHandler handler;
01336
01337   return ProcessSelectionCommand(handler);
01338 }
01339
01340 int UCvsFiles::OnCmdWatchOn(void)
01341 {
01342   KoWatchOnHandler handler;
01343
01344   return ProcessSelectionCommand(handler);
01345 }
01346
01347 int UCvsFiles::OnCmdWatchOff(void)
01348 {
01349   KoWatchOnHandler handler;
01350
01351   return ProcessSelectionCommand(handler);
01352 }
01353
01354 int UCvsFiles::OnCmdEdit(void)
01355 {
01356   KoEditHandler handler;
01357
01358   return ProcessSelectionCommand(handler);
01359 }
01360
01361 int UCvsFiles::OnCmdUnedit(void)
01362 {
01363   KoUneditHandler handler;
01364
01365   return ProcessSelectionCommand(handler);
01366 }
01367
01368 int UCvsFiles::OnCmdWatchers(void)
01369 {
01370   KoWatchersHandler handler;
01371
01372   return ProcessSelectionCommand(handler);
01373 }
01374
01375 int UCvsFiles::OnCmdEditors(void)
01376 {
01377   KoEditorsHandler handler;
01378
01379   return ProcessSelectionCommand(handler);
01380 }
01381
01382 int UCvsFiles::OnCmdRelease(void)
01383 {
01384   KoReleaseHandler handler;
01385
01386   return ProcessSelectionCommand(handler);
01387 }
01388
01389
01390 int UCvsFiles::OnCmdTagNew(void)
01391 {
01392   KoCreateTagHandler handler;
01393
01394   return ProcessSelectionCommand(handler);
01395 }
01396
01397 int UCvsFiles::OnCmdTagDelete(void)
01398 {
01399   KoDeleteTagHandler handler;
01400
01401   return ProcessSelectionCommand(handler);
01402 }
01403
01404 int UCvsFiles::OnCmdTagBranch(void)
01405 {
01406   KoBranchTagHandler handler;
01407
01408   return ProcessSelectionCommand(handler);
01409 }
01410
01411
01412 int UCvsFiles::OnCmdExplore(void)
01413 {
01414     const char* fullpath = GetPath();
01415
01416     int nItem = -1;
01417
01418     // first add the folders
01419     if((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01420     {
01421         EntnodeData *data;
01422         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01423
01424         UStr buf;
01425         fullpath = data->GetFullPathName(buf);
01426
01427 #ifdef WIN32
01428         HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", fullpath,
01429                                        0L, 0L, SW_SHOWDEFAULT);
01430         if((long)hInst < 32)
01431         {
01432             cvs_err(_i18n("Unable to explore '%s' (error %d)\n", (char *)GetPath(), GetLastError());
01433         }
01434 #endif
01435 #ifdef qUnix
01436         CvsArgs args(false);
01437         args.add(gCvsPrefs.Browser());
01438         args.add(fullpath);
01439         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01440 #endif
01441     }
01442     return 0;
01443 }
01444
01445 int UCvsFiles::OnCmdIgnore(void)
01446 {
01447     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01448     m_ignore->ToggleIgnore();
01449
01450     ResetView(true);
01451     return 0;
01452 }
01453
01454 int UCvsFiles::OnCmdEditsel(void)
01455 {
01456     int nItem = -1;
01457
01458     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01459     {
01460         EntnodeData *data;
01461         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01462         EditSel(data);
01463     }
01464     return 0;
01465 }
01466
01467 int UCvsFiles::OnCmdEditseldef(void)
01468 {
01469     int nItem = -1;
01470
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         EditSel(data, true);
01476     }
01477     return 0;
01478 }
01479
01480 int UCvsFiles::OnMacroSel(int cmd)
01481 {
01482     CTcl_Interp interp;
01483     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01484     CStr path = entry.path;
01485     CTcl_Interp::Unixfy(path);
01486
01487     TclBrowserReset();
01488
01489     int nItem = -1;
01490     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01491     {
01492         EntnodeData *data;
01493         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01494         TclBrowserAppend(GetPath(), data);
01495     }
01496
01497     interp.DoScriptVar("source \"%s\"", (const char *)path);
01498
01499     ResetView(true, true);
01500
01501     return 0;
01502 }
01503
01504 void UCvsFiles::EditSel(EntnodeData *data, bool useDefault)
01505 {
01506     UStr buf;
01507     CStr fullpath = data->GetFullPathName(buf);
01508
01509     if(data->GetType() == ENT_SUBDIR)
01510     {
01511         ResetView(fullpath, true);
01512     }
01513     else
01514     {
01515 #ifdef WIN32
01516         // This replaces huge chunk of code for now, even thought it's not ever called
01517         LaunchViewer((*data)[EntnodeData::kName]);
01518 #endif
01519 #ifdef qUnix
01520         CStr fullpath = data->GetFullPathName(buf);
01521
01522         CvsArgs args(false);
01523         args.add(gCvsPrefs.Viewer());
01524         args.add(fullpath);
01525         UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01526 #endif
01527     }
01528 }
01529
01530 void UCvsFiles::OnDblClick(void)
01531 {
01532     int nItem = -1;
01533
01534     while((nItem = UEventSendMessage(GetWidID(), EV_LIST_GETNEXTSEL, UMAKEINT(kUMainWidget, nItem), 0L)) != -1)
01535     {
01536         EntnodeData *data;
01537         UEventSendMessage(GetWidID(), EV_LIST_ROWGETDATA, UMAKEINT(kUMainWidget, nItem), &data);
01538         EditSel(data);
01539     }
01540 }
01541
01542 void UCvsFiles::OnPopup(void)
01543 {
01544     fprintf(stderr, "UCvsFiles: Popup called\n");
01545 }
01546
01547 #ifdef _0_
01548 static int compareName(UWidget *wid, void *data1, void *data2)
01549 {
01550     UCvsFiles *w = (UCvsFiles *)wid;
01551     EntnodeData *d1 = (EntnodeData *)data1;
01552     EntnodeData *d2 = (EntnodeData *)data2;
01553     int res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01554     return w->IsSortAscendant() ? res : -res;
01555 }
01556
01557 static int compareStatus(UWidget *wid, void *data1, void *data2)
01558 {
01559     UCvsFiles *w = (UCvsFiles *)wid;
01560     EntnodeData *d1 = (EntnodeData *)data1;
01561     EntnodeData *d2 = (EntnodeData *)data2;
01562     int res = stricmp((*d1)[EntnodeData::kStatus], (*d2)[EntnodeData::kStatus]);
01563     if(res == 0)
01564         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01565     return w->IsSortAscendant() ? res : -res;
01566 }
01567
01568 static int compareOption(UWidget *wid, void *data1, void *data2)
01569 {
01570     UCvsFiles *w = (UCvsFiles *)wid;
01571     EntnodeData *d1 = (EntnodeData *)data1;
01572     EntnodeData *d2 = (EntnodeData *)data2;
01573     const char *s1 = (*d1)[EntnodeFile::kOption];
01574     const char *s2 = (*d2)[EntnodeFile::kOption];
01575     int res;
01576     if(s1 != 0L && s2 != 0L)
01577         res = strcmp(s1, s2);
01578     else
01579         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01580     if(res == 0)
01581         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01582     return w->IsSortAscendant() ? res : -res;
01583 }
01584
01585 static int revcmp(const char *rev1, const char *rev2)
01586 {
01587     if(rev1 == 0L && rev2 == 0L)
01588         return 0;
01589     else if(rev1 == 0L || rev2 == 0L)
01590         return rev1 == 0L ? -1 : 1;
01591
01592     CStr r1(rev1), r2(rev2);
01593     CStr q1, q2;
01594     char *tmp;
01595     int v1, v2;
01596
01597     if((tmp = strchr(r1, '.')) != 0L)
01598     {
01599         tmp[0] = '\0';
01600         q1 = tmp + 1;
01601     }
01602
01603     v1 = atoi(r1);
01604
01605     if((tmp = strchr(r2, '.')) != 0L)
01606     {
01607         tmp[0] = '\0';
01608         q2 = tmp + 1;
01609     }
01610     v2 = atoi(r2);
01611
01612     if(v1 == v2)
01613         return revcmp(q1.empty() ? (char *)0L : (const char *)q1, q2.empty() ? (char *)0L : (const char *)q2);
01614
01615     return v1 < v2 ? -1 : 1;
01616 }
01617
01618 static int compareRevs(UWidget *wid, void * data1, void * data2)
01619 {
01620     UCvsFiles *w = (UCvsFiles *)wid;
01621     EntnodeData *d1 = (EntnodeData *)data1;
01622     EntnodeData *d2 = (EntnodeData *)data2;
01623     const char *s1 = (*d1)[EntnodeFile::kVN];
01624     const char *s2 = (*d2)[EntnodeFile::kVN];
01625     int res;
01626     if(s1 != 0L && s2 != 0L)
01627         res = revcmp(s1, s2);
01628     else
01629         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01630     if(res == 0)
01631         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01632     return w->IsSortAscendant() ? res : -res;
01633 }
01634
01635 static int compareTag(UWidget *wid, void * data1, void * data2)
01636 {
01637     UCvsFiles *w = (UCvsFiles *)wid;
01638     EntnodeData *d1 = (EntnodeData *)data1;
01639     EntnodeData *d2 = (EntnodeData *)data2;
01640     const char *s1 = (*d1)[EntnodeFile::kTag];
01641     const char *s2 = (*d2)[EntnodeFile::kTag];
01642     int res;
01643     if(s1 != 0L && s2 != 0L)
01644         res = strcmp(s1, s2);
01645     else
01646         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01647     if(res == 0)
01648         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01649     return w->IsSortAscendant() ? res : -res;
01650 }
01651
01652 static int compareConflict(UWidget *wid, void * data1, void * data2)
01653 {
01654     UCvsFiles *w = (UCvsFiles *)wid;
01655     EntnodeData *d1 = (EntnodeData *)data1;
01656     EntnodeData *d2 = (EntnodeData *)data2;
01657     const char *s1 = (*d1)[EntnodeFile::kConflict];
01658     const char *s2 = (*d2)[EntnodeFile::kConflict];
01659     int res;
01660     if(s1 != 0L && s2 != 0L)
01661         res = strcmp(s1, s2);
01662     else
01663         res = (long)s1 < (long)s2 ? -1 : ((long)s1 > (long)s2 ? 1 : 0);
01664     if(res == 0)
01665         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01666     return w->IsSortAscendant() ? res : -res;
01667 }
01668
01669 static int compareTimestamp(UWidget *wid, void *data1, void *data2)
01670 {
01671     UCvsFiles *w = (UCvsFiles *)wid;
01672     EntnodeData *d1 = (EntnodeData *)data1;
01673     EntnodeData *d2 = (EntnodeData *)data2;
01674
01675     const char *s1 = (*d1)[EntnodeFile::kTS];
01676     const char *s2 = (*d2)[EntnodeFile::kTS];
01677
01678     int res;
01679
01680     if(s1 != 0L && s2 != 0L ) {
01681         UStr str[2] = {s1, s2};
01682
01683         UStr t[2];
01684
01685         for(int i=0; i < 2; i++) {
01686             // put the year in front of the date string
01687             t[i] = str[i].substr(str[i].rfind(" ")+1, 4);
01688             t[i] += " ";
01689
01690             // convert month name to month number
01691             for(int j=0; j < 12; j++) {
01692                 if( !(strcmp(str[i].substr(4,3), month_names[j]) ) ) {
01693                     if(j<9)
01694                         t[i] += "0";
01695
01696                     t[i] += j+1;
01697
01698                     break;
01699                 }
01700             }
01701
01702             t[i] += " ";
01703             // paste day and time to time string
01704             t[i] += str[i].substr(8, str[i].rfind(" ")-4);
01705         }
01706
01707         res = t[0].compare(t[1]);
01708
01709 #ifdef DEBUG
01710         fprintf(stderr, "%s %c %s\n", t[0].c_str(), (res==1?'<':'>') , t[1].c_str());
01711 #endif
01712
01713     } else {
01714         res = s1 < s2 ? -1 : (s1 > s2 ? 1 : 0);
01715     }
01716
01717     if(res == 0)
01718         res = stricmp((*d1)[EntnodeData::kName], (*d2)[EntnodeData::kName]);
01719
01720     return w->IsSortAscendant() ? res : -res;
01721 }
01722 #endif
01723
01724 static int gtkCompareWrap(UWidget *wid, void *data1, void *data2)
01725 {
01726     return _Compare(data1, data2, gSortParam);
01727 }
01728
01729 void UCvsFiles::Resort(void)
01730 {
01731     KiColumnModel* model = GetColumnModel();
01732     KoColumnContext context(GetPath());
01733     gSortParam = new CSortParam (m_ascendant, true, model->GetAt(m_sort), model->GetAt(EntnodeData::kName), &context);
01734
01735     UEventSendMessage(GetWidID(), EV_LIST_RESORT, UMAKEINT(kUMainWidget, m_sort), (void *)gtkCompareWrap);
01736     UEventSendMessage(GetWidID(), EV_LIST_SETSORTDIR, UMAKEINT(kUMainWidget, m_sort), (void *)m_ascendant);
01737 }
01738
01739 void UCvsFiles::OnSelColumn(int column)
01740 {
01741     if(column == m_sort)
01742         m_ascendant = !m_ascendant;
01743     else
01744     {
01745         m_ascendant = true;
01746         switch(column)
01747         {
01748         case EntnodeData::kName:
01749         case EntnodeData::kStatus:
01750         case EntnodeFile::kOption:
01751         case EntnodeFile::kTag:
01752         case EntnodeFile::kConflict:
01753         case EntnodeFile::kTS:
01754         case EntnodeFile::kVN:
01755             m_sort = column;
01756             break;
01757         }
01758     }
01759
01760     Resort();
01761 }
01762
01763 void UCvsFiles::SetRecursive(bool isRecursive)
01764 {
01765     m_isRecursive = isRecursive;
01766     m_modelColumns = (m_isRecursive) ? KiColumnModel::GetRecursiveModel() : KiColumnModel::GetRegularModel();
01767 }
01768
01769 void UCvsFiles::ShowColumns(void)
01770 {
01771     KiColumnModel* model = GetColumnModel();
01772     int columnCount = model->GetCount();
01773
01774     UEventSendMessage(GetWidID(), EV_LIST_SHOWCOLUMNS, UMAKEINT(kUMainWidget, columnCount), 0L);
01775
01776     for(int i = 0; i<columnCount; i++)
01777     {
01778         LV_COLUMN lv;
01779
01780         m_modelColumns->GetAt(i)->GetSetupData(&lv);
01781         UEventSendMessage(GetWidID(), EV_LIST_SETCOLTITLE, UMAKEINT(kUMainWidget, i), (char*)lv.name);
01782         UEventSendMessage(GetWidID(), EV_LIST_SETCOLWIDTH, UMAKEINT(kUMainWidget, i), (void *)lv.width);
01783     }
01784 }
01785
01786 void UCvsFiles::HideColumns(void)
01787 {
01788     KiColumnModel* model = GetColumnModel();
01789     int columnCount = model->GetCount();
01790
01791     UEventSendMessage(GetWidID(), EV_LIST_HIDECOLUMNS, UMAKEINT(kUMainWidget, columnCount), 0L);
01792 }
01793
01794 void UCvsFiles::OnFilteringChanged()
01795 {
01796 //  if( !m_isResetViewPending ) {
01797 //      m_isResetViewPending = true;
01798     ResetView(true);
01799 //  }
01800 }
01801
01802 //bool UCvsFiles::FreshenFileMask()
01803 //{
01804 //        CString strFileMask;
01805 //        m_comboFilterMask.GetWindowText(strFileMask);
01806 //        return m_filter.SetMask(strFileMask);
01807 //}
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "BrowseViewHandlers.h"
00031 #include "BrowseViewModel.h"
00032 #include "BrowseViewColumn.h"
00033
00034 class UCvsFiles : public UWidget
00035 {
00036     UDECLARE_DYNAMIC(UCvsFiles)
00037 public:
00038     UCvsFiles();
00039     virtual ~UCvsFiles();
00040
00041     void OnFilteringChanged();
00042         // called to notify the view that app's filtering has changed
00043
00044     void ResetView(const char *path, bool notifyBrowser = false);
00045         // reset to this path and notify optionally the directories tree
00046
00047     void ResetView(bool forceReload = false, bool notifyBrowser = false);
00048         // - reload and try to guess if something changed
00049         // according to the mod. time of CVS
00050         // - notify optionally the directories tree
00051
00052     static void *GetImageForEntry(EntnodeData *data);
00053         // return the icon of the image which symbolizes the
00054         // state of the file/directory
00055
00056     inline bool IsSortAscendant(void) { return m_ascendant; }
00057
00058     // retrieves columnar model of the data
00059     KiColumnModel* GetColumnModel() const
00060     {
00061         return m_modelColumns;
00062     }
00063
00064 protected:
00065     void GetEntriesModTime(time_t & newEntriesMod, time_t & newEntriesLogMod);
00066         // used internally to get the time stamp of the CVS/Entries
00067
00068     void EditSel(EntnodeData *data, bool useDefault = false);
00069         // used internally to open a file
00070
00071     void Resort(void);
00072         // resort according to the current key
00073
00074     CSortList<ENTNODE> m_entries;
00075         // CVS/Entries infos
00076     CStr m_path;
00077         // current path
00078     time_t m_entriesMod;
00079     time_t m_entriesLogMod;
00080         // time stamp of CVS/
00081     int m_sort;
00082         // sort key
00083     bool m_ascendant;
00084         // sort flag
00085
00086     KiColumnModel* m_modelColumns;
00087         // columnar model in use
00088
00089     bool DisableGeneric(bool needSelection);
00090     bool DisableGeneric(void);
00091         // used for the handling of EV_UPDTCMD
00092
00093     int Search(const char *title);
00094
00095     int ProcessSelectionCommand(KiSelectionHandler& handler);
00096
00097     void SaveColumns(void);
00098         // saves column state
00099
00100     bool LoadColumns(void);
00101         // loads column state
00102
00103     void ShowColumns(void);
00104         // show all columns of the actual model
00105
00106     void HideColumns(void);
00107         // hide all columns of the actual model
00108
00109     void SetRecursive(bool isRecursive);
00110
00111     bool m_isRecursive;
00112         // true if displaying recursively
00113
00114     ev_msg void OnDestroy();
00115     ev_msg void OnCreate();
00116     ev_msg int OnCmdUpdate(void);
00117     ev_msg int OnCmdAdd(void);
00118     ev_msg int OnCmdAddb(void);
00119     ev_msg int OnCmdCommit(void);
00120     ev_msg int OnCmdRmv(void);
00121     ev_msg int OnCmdQueryUpdate(void);
00122     ev_msg int OnCmdReload(void);
00123     ev_msg int OnCmdUpone(void);
00124     ev_msg int OnCmdTrash(void);
00125     ev_msg int OnCmdDiff(void);
00126     ev_msg int OnCmdLog(void);
00127     ev_msg int OnCmdGraph(void);
00128     ev_msg int OnCmdStatus(void);
00129     ev_msg int OnCmdLock(void);
00130     ev_msg int OnCmdUnlock(void);
00131     ev_msg int OnCmdWatchOn(void);
00132     ev_msg int OnCmdWatchOff(void);
00133     ev_msg int OnCmdEdit(void);
00134     ev_msg int OnCmdUnedit(void);
00135     ev_msg int OnCmdWatchers(void);
00136     ev_msg int OnCmdEditors(void);
00137     ev_msg int OnCmdRelease(void);
00138     ev_msg int OnCmdTagNew(void);
00139     ev_msg int OnCmdTagDelete(void);
00140     ev_msg int OnCmdTagBranch(void);
00141     ev_msg int OnCmdExplore(void);
00142     ev_msg int OnCmdIgnore(void);
00143     ev_msg int OnCmdEditsel(void);
00144     ev_msg int OnCmdEditseldef(void);
00145     ev_msg int OnMacroSel(int cmd);
00146     ev_msg void OnCmdUIUpdate(UCmdUI *pCmdUI);
00147     ev_msg void OnCmdUIAdd(UCmdUI *pCmdUI);
00148     ev_msg void OnCmdUIAddB(UCmdUI *pCmdUI);
00149     ev_msg void OnCmdUIRelease(UCmdUI *pCmdUI);
00150     ev_msg void OnCmdUIRmv(UCmdUI *pCmdUI);
00151     ev_msg void OnCmdUIGraph(UCmdUI *pCmdUI);
00152     ev_msg void OnCmdUIEditseldef(UCmdUI *pCmdUI);
00153     ev_msg void OnCmdUIReload(UCmdUI *pCmdUI);
00154     ev_msg void OnCmdUIUpone(UCmdUI *pCmdUI);
00155     ev_msg void OnCmdUITrash(UCmdUI *pCmdUI);
00156     ev_msg void OnCmdUIExplore(UCmdUI *pCmdUI);
00157     ev_msg void OnCmdUIIgnore(UCmdUI *pCmdUI);
00158     ev_msg void OnCmdUIMacroSel(int cmd, UCmdUI *pCmdUI);
00159     ev_msg void OnCmdUIViewRecursive(UCmdUI *pCmdUI);
00160     ev_msg void OnDblClick(void);
00161     ev_msg void OnPopup(void);
00162     ev_msg void OnSelColumn(int column);
00163     ev_msg void OnViewRecursive(void);
00164
00165     UDECLARE_MESSAGE_MAP()
00166 public:
00167     // member access
00168     const CStr& GetPath() const { return m_path; };
00169 };
00170
00171 #endif
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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(cmdFLAT, UCvsFolders::OnCmdUIViewRecursive)
00108     ON_UUPDATECMD_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFolders::OnCmdUIMacrosSel)
00109     ON_UDESTROY(UCvsFolders)
00110     ON_UCREATE(UCvsFolders)
00111     ON_TREE_EXPANDING(kUMainWidget, UCvsFolders::OnTreeExpanding)
00112     ON_TREE_SELECTING(kUMainWidget, UCvsFolders::OnTreeSelecting)
00113     ON_UCOMMAND(cmdUPDATE, UCvsFolders::OnCmdUpdate)
00114     ON_UCOMMAND(cmdADD, UCvsFolders::OnCmdAdd)
00115     ON_UCOMMAND(cmdCOMMIT, UCvsFolders::OnCmdCommit)
00116     ON_UCOMMAND(cmdQUERYUPDATE, UCvsFolders::OnCmdQueryUpdate)
00117     ON_UCOMMAND(cmdDIFF, UCvsFolders::OnCmdDiff)
00118     ON_UCOMMAND(cmdLOG, UCvsFolders::OnCmdLog)
00119     ON_UCOMMAND(cmdSTATUS, UCvsFolders::OnCmdStatus)
00120     ON_UCOMMAND(cmdLOCKF, UCvsFolders::OnCmdLock)
00121     ON_UCOMMAND(cmdUNLOCKF, UCvsFolders::OnCmdUnlock)
00122     ON_UCOMMAND(cmdWATCHON, UCvsFolders::OnCmdWatchOn)
00123     ON_UCOMMAND(cmdWATCHOFF, UCvsFolders::OnCmdWatchOff)
00124     ON_UCOMMAND(cmdEDIT, UCvsFolders::OnCmdEdit)
00125     ON_UCOMMAND(cmdUNEDIT, UCvsFolders::OnCmdUnedit)
00126     ON_UCOMMAND(cmdWATCHERS, UCvsFolders::OnCmdWatchers)
00127     ON_UCOMMAND(cmdEDITORS, UCvsFolders::OnCmdEditors)
00128     ON_UCOMMAND(cmdRELEASE, UCvsFolders::OnCmdRelease)
00129     ON_UCOMMAND(cmdTAGNEW, UCvsFolders::OnCmdTagNew)
00130     ON_UCOMMAND(cmdTAGDELETE, UCvsFolders::OnCmdTagDelete)
00131     ON_UCOMMAND(cmdTAGBRANCH, UCvsFolders::OnCmdTagBranch)
00132     ON_UCOMMAND(cmdEXPLORE, UCvsFolders::OnCmdExplore)
00133     ON_UCOMMAND(cmdRELOAD, UCvsFolders::OnCmdReload)
00134     ON_UCOMMAND(cmdIGNORE, UCvsFolders::OnCmdIgnore)
00135     ON_UCOMMAND(cmdCHECKOUT, UCvsFolders::OnCmdCheckout)
00136     ON_UCOMMAND(cmdIMPORT, UCvsFolders::OnCmdImport)
00137     ON_UCOMMAND(cmdFLAT, UCvsFolders::OnViewRecursive)
00138     ON_UCOMMAND_RANGE(cmdSELMACRO, cmdSELMACROEND, UCvsFolders::OnCmdMacrosSel)
00139 UEND_MESSAGE_MAP()
00140
00141 #if 0
00142     ON_WM_RBUTTONDOWN() // TODO
00143 #endif
00144
00145 static bool sTemporaryTurnOffNotify = false;
00146
00147 class CTempToggleBool
00148 {
00149 public:
00150     CTempToggleBool(bool & value) : m_value(value), m_didSetIt(false)
00151     {
00152         if(!m_value)
00153         {
00154             m_didSetIt = true;
00155             m_value = true;
00156         }
00157     }
00158
00159     ~CTempToggleBool()
00160     {
00161         if(m_didSetIt)
00162             m_value = false;
00163     }
00164 protected:
00165     bool & m_value;
00166     bool m_didSetIt;
00167 };
00168
00169 static void *GetIcon(UCvsFolders *treeCrtl, UTREEITEM item, bool hasCvsInfos, bool expand, EntnodeData *data)
00170 {
00171     int newImage;
00172     void *result = 0L;
00173
00174     if(data == 0L)
00175     {
00176         if(expand)
00177             newImage = hasCvsInfos ? kIconFolderCVSOpened : kIconFolderOpened;
00178         else
00179             newImage = hasCvsInfos ? kIconFolderCVSClosed : kIconFolderClosed;
00180     }
00181     else
00182     {
00183         if(expand)
00184         {
00185             if(data->IsIgnored())
00186                 newImage = kIconFolderIgnoreOpened;
00187             else if(data->IsUnknown())
00188                 newImage = kIconFolderOpened;
00189             else if(data->IsMissing())
00190                 newImage = kIconFolderIgnoreLost;
00191             else
00192                 newImage = kIconFolderCVSOpened;
00193         }
00194         else
00195         {
00196             if(data->IsIgnored())
00197                 newImage = kIconFolderIgnoreClosed;
00198             else if(data->IsUnknown())
00199                 newImage = kIconFolderClosed;
00200             else if(data->IsMissing())
00201                 newImage = kIconFolderIgnoreLost;
00202             else
00203                 newImage = kIconFolderCVSClosed;
00204         }
00205     }
00206
00207 #if qGTK
00208     void *pixmap = 0L;
00209     switch(newImage)
00210     {
00211     case kIconFolderClosed:
00212     case kIconFolderOpened:
00213         pixmap = sFolderUnknownIcon;
00214         break;
00215     case kIconFolderCVSClosed:
00216     case kIconFolderCVSOpened:
00217         pixmap = sFolderIcon;
00218         break;
00219     case kIconFolderIgnoreClosed:
00220     case kIconFolderIgnoreOpened:
00221         pixmap = sFolderIgnoredIcon;
00222         break;
00223     case kIconFolderIgnoreLost:
00224         pixmap = sFolderMissingIcon;
00225         break;
00226     }
00227     if(pixmap != 0L)
00228     {
00229         result = gtk_pixmap_new (GTK_PIXMAP(pixmap)->pixmap, GTK_PIXMAP(pixmap)->mask);
00230     }
00231 #endif
00232
00233     return result;
00234 }
00235
00236 // regarding a path and a root item, create an
00237 // item with a dummy item inside if and only if
00238 // the folder is not empty.
00239 class TBrowserFillDummy : public TraversalReport
00240 {
00241 public:
00242     UTREEITEM   m_root;
00243     UTREEITEM   m_item;
00244     UCvsFolders *m_treeCtrl;
00245     bool        m_empty;
00246     bool        m_hascvs;
00247     EntnodeData *m_data;
00248     UStr        m_dirname;
00249
00250     TBrowserFillDummy(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, EntnodeData *data) :
00251         m_root(root), m_item(item), m_treeCtrl(treeCtrl), m_empty(true),
00252         m_hascvs(false), m_data(data) {}
00253
00254     virtual ~TBrowserFillDummy() {}
00255
00256     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00257     {
00258         m_dirname = dirname;
00259 #if qUnix
00260         if(m_dirname.empty())
00261             m_dirname = fullpath; // '/'
00262 #endif
00263         return kContinueTraversal;
00264     }
00265
00266     virtual kTraversal ExitDirectory(const char *fullpath)
00267     {
00268         if(m_item == 0L)
00269         {
00270             UTREE_INSERT insert;
00271             insert.parent = m_root;
00272             insert.icon = GetIcon(m_treeCtrl, m_item, m_hascvs, false, m_data);
00273             insert.title = m_dirname;
00274             insert.data = 0L;
00275             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00276             m_item = insert.result;
00277         }
00278
00279         // assign the entries to this item
00280         UTREE_INFO query;
00281         query.item = m_item;
00282         if(m_data != 0L)
00283         {
00284             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00285             EntnodeData *data = (EntnodeData *)query.data;
00286
00287             if(m_data != 0L)
00288                 m_data->Ref();
00289
00290             query.data = m_data;
00291             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETDATA, kUMainWidget, &query);
00292
00293             if(data != 0L)
00294                 data->UnRef();
00295         }
00296         else
00297         {
00298             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00299             m_data = (EntnodeData *)query.data;
00300         }
00301
00302         if(m_empty)
00303             return kContinueTraversal;
00304
00305         // add a dummy item to simulate the folder
00306         // is not empty. This dummy item will be
00307         // replaced by a complete listing when the
00308         // node is expanding...
00309
00310         UTREE_INSERT insert;
00311         insert.parent = m_item;
00312         insert.icon = 0L;
00313         insert.title = gDummyFile;
00314         insert.data = 0L;
00315         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00316
00317         return kContinueTraversal;
00318     }
00319
00320     virtual kTraversal OnError(const char *err, int errcode)
00321     {
00322     cvs_err(err);
00323     cvs_err("\n");
00324     cvs_err(strerror(errcode));
00325     cvs_err("\n");
00326         return kTraversalError;
00327     }
00328
00329     virtual kTraversal OnIdle(const char *fullpath)
00330     {
00331         return kContinueTraversal;
00332     }
00333
00334     virtual kTraversal OnDirectory(const char *fullpath,
00335         const char *fullname,
00336         const char *name,
00337         const struct stat & dir, const FSSpec * macspec)
00338     {
00339 #if qUnix
00340         if(strcmp(name, "CVS") == 0)
00341 #else
00342         if(stricmp(name, "cvs") == 0)
00343 #endif
00344             m_hascvs = true;
00345         else
00346             m_empty = false;
00347
00348         return kSkipFile;
00349     }
00350 };
00351
00352 // regarding a path and a root item, create an
00353 // item with all the subdirectories inside.
00354 class TBrowserFill : public TraversalReport
00355 {
00356 public:
00357     UTREEITEM m_root;
00358     UTREEITEM m_item;
00359     UCvsFolders *m_treeCtrl;
00360     CSortList<ENTNODE> & m_entries;
00361     std::vector<UStr> m_ignlist;
00362     bool m_isShowIgnored;
00363
00364     TBrowserFill(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, CSortList<ENTNODE> & entries) :
00365             m_root(root), m_item(item), m_treeCtrl(treeCtrl),
00366             m_entries(entries), m_isShowIgnored(false)
00367     {
00368         if( UCvsApp* app = UCvsApp::gApp )
00369             m_isShowIgnored = app->GetIgnoreModel()->IsShowIgnored();
00370     }
00371
00372     virtual ~TBrowserFill() {}
00373
00374     virtual kTraversal EnterDirectory(const char *fullpath, const char *dirname, const FSSpec * macspec)
00375     {
00376         ASSERT(m_item != 0L);
00377
00378         // assign the entries to this item
00379         Entries_Open (m_entries, fullpath);
00380         BuildIgnoredList(m_ignlist, fullpath);
00381
00382         return kContinueTraversal;
00383     }
00384
00385     virtual kTraversal ExitDirectory(const char *fullpath)
00386     {
00387         m_ignlist.erase(m_ignlist.begin(), m_ignlist.end());
00388
00389         UTREE_INFO query;
00390         query.item = m_item;
00391         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00392         query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, true, (EntnodeData *)query.data);
00393         UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00394
00395         return kContinueTraversal;
00396     }
00397
00398     virtual kTraversal OnError(const char *err, int errcode)
00399     {
00400         return kTraversalError;
00401     }
00402
00403     virtual kTraversal OnIdle(const char *fullpath)
00404     {
00405         return kContinueTraversal;
00406     }
00407
00408     virtual kTraversal OnDirectory(const char *fullpath,
00409         const char *fullname,
00410         const char *name,
00411         const struct stat & dir, const FSSpec * macspec)
00412     {
00413 #if qUnix
00414         if(strcmp(name, "CVS") == 0)
00415 #else
00416         if(stricmp(name, "cvs") == 0)
00417 #endif
00418             return kSkipFile;
00419
00420         // is the sub-directory ignored ?
00421         EntnodeData *data = Entries_SetVisited(fullpath, m_entries, name, dir, true, &m_ignlist);
00422         if(!m_isShowIgnored && data->IsIgnored())
00423             return kSkipFile;
00424
00425         // create the item for the sub-directory
00426         TBrowserFillDummy traverse(m_treeCtrl, m_item, 0L, data);
00427         /*kTraversal res = */FileTraverse(fullname, traverse);
00428
00429         // assign the icon regarding our Entries info
00430         if(traverse.m_item != 0L)
00431         {
00432             UTREE_INFO query;
00433             query.item = traverse.m_item;
00434             query.icon = GetIcon(m_treeCtrl, m_item, true /*ignored*/, false, data);
00435             UEventSendMessage(m_treeCtrl->GetWidID(), EV_TREE_SETICON, kUMainWidget, &query);
00436         }
00437
00438         return kSkipFile;
00439     }
00440 };
00441
00442 UCvsFolders::UCvsFolders() : UWidget(kUCvsFoldersID)
00443 {
00444 }
00445
00446 UCvsFolders::~UCvsFolders()
00447 {
00448 }
00449
00450 // Process the selection handler command
00451 // param:  handler Command selection handler
00452 // return: true if the command was processed, false otherwise
00453
00454 int UCvsFolders::ProcessSelectionCommand(KiSelectionHandler& handler)
00455 {
00456   bool res = false;
00457   UTREEITEM *selItem;
00458
00459     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00460
00461   if( selItem ) {
00462     UStr path;
00463     RetrievePath(selItem, path);
00464
00465     handler.OnFolder(path);
00466     res = true;
00467   } else {
00468     ASSERT(selItem != 0L);
00469   }
00470
00471   return res;
00472 }
00473
00474 void UCvsFolders::OnDestroy(void)
00475 {
00476     if( UCvsApp* app = UCvsApp::gApp )
00477         app->GetIgnoreModel()->GetNotificationManager()->CheckOut((CObject*)this);
00478
00479     delete this;
00480 }
00481
00482 void onIgnoreChanged(CObject *obj)
00483 {
00484     ((UCvsFolders *)obj)->OnCmdIgnore();
00485 }
00486
00487 void UCvsFolders::OnCreate(void)
00488 {
00489     if(sFolderIcon == 0L)
00490     {
00491         sFolderIcon = UCreate_pixmap(this, "folder.xpm");
00492         sFolderUnknownIcon = UCreate_pixmap(this, "foldunk.xpm");
00493         sFolderIgnoredIcon = UCreate_pixmap(this, "foldign.xpm");
00494         sFolderMissingIcon = UCreate_pixmap(this, "foldmiss.xpm");
00495     }
00496
00497     UStr newpath;
00498     newpath = (const char *)gOldLoc;
00499     if(newpath.empty())
00500         newpath = gCvsPrefs.Home();
00501
00502     // set the initial root
00503     ResetBrowser(newpath, true);
00504
00505     if( UCvsApp* app = UCvsApp::gApp )
00506         app->GetIgnoreModel()->GetNotificationManager()->CheckIn((CObject*)this, onIgnoreChanged);
00507 }
00508
00509 void UCvsFolders::ResetBrowser(const char *path, bool notifyView)
00510 {
00511     UWaitCursor wait;
00512
00513     // Must make a copy of 'path' before calling DeleteAllItems(), since
00514     // this function may have been called with 'm_root' passed as the first
00515     // parameter (in fact it is in several places in the code) whose value
00516     // gets deleted by the call to DeleteAllItems() below, making 'path'
00517     // point to an invalid memory location
00518     CStr pathCopy(path);
00519     DeleteAllItems();
00520     bool isReload = !pathCopy.empty() && !m_root.empty() && stricmp(m_root, pathCopy) == 0;
00521
00522     m_root = pathCopy;
00523
00524     if( pathCopy.empty() )
00525         return;
00526
00527     if(!isReload)
00528     {
00529         if(HasPersistentSettings(m_root))
00530             LoadPersistentSettings(m_root);
00531         else
00532         {
00533             // check if the path has a CVS folder. If not,
00534             // we don't want the user to be prompted (like when
00535             // WinCvs is starting for the first time).
00536             UStr cvsFolder(m_root);
00537             if(!cvsFolder.endsWith(kPathDelimiter))
00538                 cvsFolder << kPathDelimiter;
00539             cvsFolder << "CVS";
00540             struct stat sb;
00541             if (stat(cvsFolder, &sb) != -1 && S_ISDIR(sb.st_mode))
00542                 AskCreatePersistentSettings(m_root);
00543         }
00544     }
00545
00546     if(stricmp(gOldLoc, m_root) != 0)
00547         gOldLoc = m_root;
00548
00549     // update the history combo
00550     gHistoryLocs.Insert(m_root);
00551     UEventSendMessage(kUCvsFrameID, EV_COMBO_RESETALL, UCvsFrame::kDirCombo, 0L);
00552     const std::vector<UStr> & list = gHistoryLocs.GetList();
00553     std::vector<UStr>::const_iterator i;
00554     int pos = 0;
00555     for(i = list.begin(); i != list.end(); ++i, pos++)
00556     {
00557         UEventSendMessage(kUCvsFrameID, EV_COMBO_APPEND,
00558                           UCvsFrame::kDirCombo, (void *)(const char *)*i);
00559     }
00560     UEventSendMessage(kUCvsFrameID, EV_COMBO_SETSEL, UMAKEINT(UCvsFrame::kDirCombo, 0), 0L);
00561
00562     // fill the browser
00563     TBrowserFillDummy traverse(this, 0L, 0L, 0L);
00564     /*kTraversal res = */FileTraverse(m_root, traverse);
00565
00566     if(traverse.m_item != 0L)
00567     {
00568         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), traverse.m_item);
00569         if(notifyView && UCvsApp::gApp->GetFilesView())
00570             UCvsApp::gApp->GetFilesView()->ResetView(path);
00571     }
00572 }
00573
00574 void UCvsFolders::ResetView(bool forceReload, bool notifyView)
00575 {
00576     UWaitCursor doWait;
00577
00578     std::vector<UStr> allExpanded;
00579     StoreExpanded(allExpanded);
00580
00581     bool contentChanged = false;
00582     UStr selPath;
00583     UTREEITEM selItem;
00584     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
00585     if(selItem != 0L)
00586         RetrievePath(selItem, selPath);
00587
00588     if(forceReload)
00589     {
00590         ResetBrowser(m_root);
00591         contentChanged = true;
00592     }
00593
00594     if(contentChanged)
00595     {
00596         // restore the expanded paths and the selected item
00597         std::vector<UStr>::const_iterator i;
00598         for(i = allExpanded.begin(); i != allExpanded.end(); ++i)
00599         {
00600             StepToLocation(*i);
00601         }
00602         if(!selPath.empty())
00603         {
00604             selItem = GetItemByLocation(selPath);
00605             if(selItem != 0L)
00606                 UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), selItem);
00607         }
00608     }
00609
00610     // we don't need to notify the file view if we force the reload
00611     // because that's already done
00612     if(notifyView)
00613     {
00614         UCvsApp::gApp->GetFilesView()->ResetView(forceReload);
00615     }
00616     UEventSendMessage(GetWidID(), EV_CHGFOCUS, kUMainWidget, 0L);
00617 }
00618
00619 void UCvsFolders::StoreExpanded(std::vector<UStr> & allExpanded, UTREEITEM root)
00620 {
00621     UTREE_INFO query;
00622     query.item = root;
00623     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00624
00625     UTREEITEM item = query.item;
00626     if(item == 0L)
00627         return;
00628
00629     if(query.expanded)
00630     {
00631         UStr path;
00632         RetrievePath(item, path);
00633         allExpanded.push_back(path);
00634     }
00635
00636     UTREEITEM childItem = query.child;
00637
00638     while(childItem != 0L)
00639     {
00640         StoreExpanded(allExpanded, childItem);
00641         query.item = childItem;
00642         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00643         childItem = query.next;
00644     }
00645 }
00646
00647 void UCvsFolders::StepToLocation(const char *path, bool notifyView)
00648 {
00649     UStr root(m_root);
00650     if(!root.endsWith(kPathDelimiter))
00651         root << kPathDelimiter;
00652     UStr subpath(path);
00653     if(!subpath.endsWith(kPathDelimiter))
00654         subpath << kPathDelimiter;
00655
00656     // check if it is a sub-path
00657     if(strncmp(root, subpath, root.length()) != 0)
00658         return;
00659
00660     UTREE_INFO query;
00661     query.item = 0L;
00662     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00663
00664     UTREEITEM item = query.item;
00665     UTREEITEM lastitem = 0L;
00666     if(item == 0L)
00667         return;
00668
00669     // step inside synchronized
00670     const char *tmp = (const char *)subpath + root.length() - 1;
00671     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00672     {
00673         const char *name = ++tmp;
00674         if(name[0] == '\0')
00675             break;
00676
00677         UStr subname;
00678         const char *tmp2 = strchr(name, kPathDelimiter);
00679         if(tmp2 == 0L)
00680             subname = name;
00681         else
00682             subname.set(name, tmp2 - name);
00683
00684         query.item = item;
00685         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00686         UTREEITEM childItem = query.child;
00687
00688         // find the subitem which matches this name
00689         while(childItem != 0L)
00690         {
00691             query.item = childItem;
00692             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00693             EntnodeData *data = (EntnodeData *)query.data;
00694             if(data != 0L)
00695             {
00696 #ifdef qUnix
00697                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00698 #else
00699                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00700 #endif
00701                 {
00702                     // found it !
00703                     lastitem = item = childItem;
00704                     UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00705                     break;
00706                 }
00707             }
00708
00709             childItem = query.next;
00710         }
00711     }
00712
00713     // in case this is called by the view, turn off notifying
00714     // when the item gets selected
00715     if(lastitem != 0L)
00716     {
00717         if(!notifyView)
00718         {
00719             CTempToggleBool toggler(sTemporaryTurnOffNotify);
00720             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00721         }
00722         else
00723         {
00724             UEventSendMessage(GetWidID(), EV_TREE_SELECT, UMAKEINT(kUMainWidget, 0), lastitem);
00725         }
00726     }
00727 }
00728
00729 UTREEITEM UCvsFolders::GetItemByLocation(const char *path)
00730 {
00731     UStr root(m_root);
00732     if(!root.endsWith(kPathDelimiter))
00733         root << kPathDelimiter;
00734     UStr subpath(path);
00735     if(!subpath.endsWith(kPathDelimiter))
00736         subpath << kPathDelimiter;
00737
00738     // check if it is a sub-path
00739     if(strncmp(root, subpath, root.length()) != 0)
00740         return 0L;
00741
00742     UTREE_INFO query;
00743     query.item = 0L;
00744     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00745     UTREEITEM item = query.item;
00746     if(item == 0L)
00747         return 0L;
00748
00749     // step inside synchronized
00750     const char *tmp = (const char *)subpath + root.length() - 1;
00751     while((tmp = strchr(tmp, kPathDelimiter)) != 0L)
00752     {
00753         const char *name = ++tmp;
00754         if(name[0] == '\0')
00755             break;
00756
00757         CStr subname;
00758         const char *tmp2 = strchr(name, kPathDelimiter);
00759         if(tmp2 == 0L)
00760             subname = name;
00761         else
00762             subname.set(name, tmp2 - name);
00763
00764         UTREEITEM childItem = query.child;
00765
00766         // find the subitem which matches this name
00767         while(childItem != 0L)
00768         {
00769             query.item = childItem;
00770             UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00771             EntnodeData *data = (EntnodeData *)query.data;
00772             if(data != 0L)
00773             {
00774 #if qUnix
00775                 if(strcmp((*data)[EntnodeData::kName], subname) == 0)
00776 #else
00777                 if(_stricmp((*data)[EntnodeData::kName], subname) == 0)
00778 #endif
00779                 {
00780                     item = childItem;
00781                     break;
00782                 }
00783             }
00784
00785             childItem = query.next;
00786         }
00787         if(childItem == 0L)
00788             return 0L;
00789     }
00790
00791     return item;
00792 }
00793
00794 void UCvsFolders::OnTreeExpanding(int collapse, UTREEITEM item)
00795 {
00796     // many situations make that we enter here twice. Fortunately enough
00797     // we only dare the first signal.
00798     static bool sSemaphore = false;
00799     USemaphore policeman(sSemaphore);
00800     if(policeman.IsEnteredTwice())
00801         return;
00802
00803     UWaitCursor wait;
00804
00805     UTREE_INFO query;
00806     query.item = item;
00807     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00808     EntnodeData *data = (EntnodeData *)query.data;
00809
00810     // we refuse to expand in this case cause the folder is not really here
00811     if(data != 0L && data->IsMissing())
00812     {
00813         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 1), item);
00814         return;
00815     }
00816
00817     // erase all the childs
00818     DeleteAllItems(item);
00819
00820     UStr path;
00821     RetrievePath(item, path);
00822
00823     if(collapse)
00824     {
00825         TBrowserFillDummy traverse(this, 0L, item, 0L);
00826         /*kTraversal res = */FileTraverse(path, traverse);
00827     }
00828     else
00829     {
00830         CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00831         TBrowserFill traverse(this, 0L, item, entries);
00832         /*kTraversal res = */FileTraverse(path, traverse);
00833
00834 #if qGTK
00835         // gtk is closing the tree when we removed everything in it
00836         UEventSendMessage(GetWidID(), EV_TREE_EXPAND, UMAKEINT(kUMainWidget, 0), item);
00837 #endif
00838
00839         // add the missing folders
00840         Entries_SetMissing(entries);
00841         int numEntries = entries.NumOfElements();
00842         for(int i = 0; i < numEntries; i++)
00843         {
00844             const ENTNODE & theNode = entries.Get(i);
00845             EntnodeData *data = ((ENTNODE *)&theNode)->Data();
00846             if(!data->IsMissing() || data->GetType() != ENT_SUBDIR)
00847                 continue;
00848
00849             UTREE_INSERT insert;
00850             insert.parent = item;
00851             insert.icon = GetIcon(this, item, false, false, data->Ref());
00852             insert.title = (*data)[EntnodeData::kName];
00853             insert.data = data;
00854             UEventSendMessage(GetWidID(), EV_TREE_INSERT, kUMainWidget, &insert);
00855         }
00856     }
00857 }
00858
00859 void UCvsFolders::OnTreeSelecting(int deselect, UTREEITEM item)
00860 {
00861     if(deselect)
00862         return;
00863
00864     UTREE_INFO query;
00865     query.item = item;
00866     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00867     EntnodeData *data = (EntnodeData *)query.data;
00868     if(data != 0L && data->IsMissing())
00869         return;
00870
00871     if(!sTemporaryTurnOffNotify)
00872     {
00873         UStr path;
00874         RetrievePath(item, path);
00875         UCvsFiles *fileView = (UCvsFiles *)UEventQueryWidget(kUCvsFilesID);
00876         if(fileView != 0L)
00877         {
00878             ASSERT(fileView->IsKindOf(URUNTIME_CLASS(UCvsFiles)));
00879             fileView->ResetView(path);
00880         }
00881     }
00882
00883 }
00884
00885 void UCvsFolders::SetDefaultRoot(const char *root)
00886 {
00887     struct stat sb;
00888
00889     if (stat(root, &sb) == -1 || !S_ISDIR(sb.st_mode))
00890     {
00891         cvs_err(_i18n("Cannot access directory '%s' (error %d)\n"), root, errno);
00892         return;
00893     }
00894
00895     gOldLoc = root;
00896 }
00897
00898 void UCvsFolders::RetrievePath(UTREEITEM item, UStr & path)
00899 {
00900     UStr tmp, newPath;
00901     path = "";
00902
00903     do
00904     {
00905         UTREE_INFO query;
00906         query.item = item;
00907         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00908
00909         item = query.parent;
00910
00911         tmp = path;
00912         newPath = item == 0L ? (const char *)m_root : query.title;
00913         if(!newPath.endsWith(kPathDelimiter))
00914             newPath << kPathDelimiter;
00915         newPath << path;
00916         path = newPath;
00917     } while(item != 0L);
00918 }
00919
00920 void UCvsFolders::DeleteAllItems(void)
00921 {
00922     DeleteAllItems(NULL);
00923 }
00924
00925 void UCvsFolders::DeleteAllItems(UTREEITEM root)
00926 {
00927     // we don't want the file view to be notified when things get deleted
00928     CTempToggleBool toggler(sTemporaryTurnOffNotify);
00929
00930     UTREE_INFO query;
00931     bool eraseRoot = false;
00932     query.item = root;
00933     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
00934     if(root == 0L)
00935     {
00936         root = query.item;
00937         eraseRoot = true;
00938     }
00939
00940     if(root == 0L)
00941         return;
00942
00943     UTREEITEM childItem = query.child;
00944
00945     // erase all the childs
00946     while(childItem != 0L)
00947     {
00948         UTREE_INFO queryChild;
00949         queryChild.item = childItem;
00950         UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &queryChild);
00951
00952         EntnodeData *data = (EntnodeData *)queryChild.data;
00953         if(data != 0L)
00954         {
00955             queryChild.data = 0L; // So that subsequent references after UnRef() won't SEGV
00956             UEventSendMessage(GetWidID(), EV_TREE_SETDATA, kUMainWidget, &queryChild);
00957             data->UnRef();  // Or move this one after DeleteAllItems? so we don't loose one system call. For now, safe way
00958         }
00959
00960         DeleteAllItems(childItem);
00961
00962         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, childItem);
00963         childItem = queryChild.next;
00964     }
00965
00966     // erase the root only if initially root was 0L
00967     if(eraseRoot)
00968     {
00969         EntnodeData *data = (EntnodeData *)query.data;
00970         ASSERT(data == 0L);
00971
00972         UEventSendMessage(GetWidID(), EV_TREE_DELETE, kUMainWidget, root);
00973     }
00974 }
00975
00976 bool UCvsFolders::DisableGeneric()
00977 {
00978     UCvsApp *app = UCvsApp::gApp;
00979     return app->IsCvsRunning() || gCvsPrefs.empty() || !HasFocus();
00980 }
00981
00982 void UCvsFolders::OnUpdateGeneric(UCmdUI* pCmdUI, bool needCvsInfos)
00983 {
00984     if(DisableGeneric())
00985     {
00986         pCmdUI->Enable(false);
00987         return;
00988     }
00989
00990     UTREEITEM *item;
00991     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
00992     if(item == 0L)
00993     {
00994         pCmdUI->Enable(false);
00995         return;
00996     }
00997
00998     UStr path;
00999     RetrievePath(item, path);
01000     if(!path.endsWith(kPathDelimiter))
01001         path << kPathDelimiter;
01002     path << "CVS";
01003
01004     struct stat sb;
01005     if (stat(path, &sb) == -1 || !S_ISDIR(sb.st_mode))
01006         pCmdUI->Enable(!needCvsInfos);
01007     else
01008         pCmdUI->Enable(needCvsInfos);
01009 }
01010
01011
01012
01013 int UCvsFolders::OnCmdUpdate(void)
01014 {
01015   KoUpdateHandler handler;
01016   return ProcessSelectionCommand(handler);
01017 }
01018
01019 void UCvsFolders::OnCmdUIUpdate(UCmdUI *pCmdUI)
01020 {
01021     OnUpdateGeneric(pCmdUI, true);
01022 }
01023
01024 int UCvsFolders::OnCmdAdd(void)
01025 {
01026     KoAddHandler handler;
01027     return ProcessSelectionCommand(handler);
01028 }
01029
01030 int UCvsFolders::OnCmdCommit(void)
01031 {
01032     KoCommitHandler handler;
01033     return ProcessSelectionCommand(handler);
01034 }
01035
01036 int UCvsFolders::OnCmdQueryUpdate(void)
01037 {
01038     KoQueryUpdateHandler handler;
01039     return ProcessSelectionCommand(handler);
01040 }
01041
01042 int UCvsFolders::OnCmdDiff(void)
01043 {
01044     KoDiffHandler handler;
01045     return ProcessSelectionCommand(handler);
01046 }
01047
01048 int UCvsFolders::OnCmdLog(void)
01049 {
01050     KoLogHandler handler;
01051     return ProcessSelectionCommand(handler);
01052 }
01053
01054 int UCvsFolders::OnCmdStatus(void)
01055 {
01056     KoStatusHandler handler;
01057     return ProcessSelectionCommand(handler);
01058 }
01059
01060 int UCvsFolders::OnCmdLock(void)
01061 {
01062     KoLockHandler handler;
01063     return ProcessSelectionCommand(handler);
01064 }
01065
01066 int UCvsFolders::OnCmdUnlock(void)
01067 {
01068     KoUnlockHandler handler;
01069     return ProcessSelectionCommand(handler);
01070 }
01071
01072 int UCvsFolders::OnCmdWatchOn(void)
01073 {
01074     KoWatchOnHandler handler;
01075     return ProcessSelectionCommand(handler);
01076 }
01077
01078 int UCvsFolders::OnCmdWatchOff(void)
01079 {
01080     KoWatchOffHandler handler;
01081     return ProcessSelectionCommand(handler);
01082 }
01083
01084 int UCvsFolders::OnCmdEdit(void)
01085 {
01086     KoEditHandler handler;
01087     return ProcessSelectionCommand(handler);
01088 }
01089
01090 int UCvsFolders::OnCmdUnedit(void)
01091 {
01092     KoUneditHandler handler;
01093     return ProcessSelectionCommand(handler);
01094 }
01095
01096 int UCvsFolders::OnCmdWatchers(void)
01097 {
01098     KoWatchersHandler handler;
01099     return ProcessSelectionCommand(handler);
01100 }
01101
01102 int UCvsFolders::OnCmdEditors(void)
01103 {
01104     KoEditorsHandler handler;
01105     return ProcessSelectionCommand(handler);
01106 }
01107
01108 int UCvsFolders::OnCmdRelease(void)
01109 {
01110     KoReleaseHandler handler;
01111     return ProcessSelectionCommand(handler);
01112 }
01113
01114 int UCvsFolders::OnCmdTagNew(void)
01115 {
01116     KoCreateTagHandler handler;
01117     return ProcessSelectionCommand(handler);
01118 }
01119
01120 int UCvsFolders::OnCmdTagDelete(void)
01121 {
01122     KoDeleteTagHandler handler;
01123     return ProcessSelectionCommand(handler);
01124 }
01125
01126 int UCvsFolders::OnCmdTagBranch(void)
01127 {
01128     KoBranchTagHandler handler;
01129     return ProcessSelectionCommand(handler);
01130 }
01131
01132 int UCvsFolders::OnCmdExplore(void)
01133 {
01134     UTREEITEM *item;
01135     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &item);
01136     ASSERT(item != 0L);
01137
01138     UStr path;
01139     RetrievePath(item, path);
01140
01141 #ifdef WIN32
01142     HINSTANCE hInst = ShellExecute(*AfxGetMainWnd(), "explore", path,
01143             0L, 0L, SW_SHOWDEFAULT);
01144     if((long)hInst < 32)
01145     {
01146         cvs_err(_i18n("Unable to explore '%s' (error %d)\n"), (const char *)path, GetLastError());
01147     }
01148 #endif
01149 #ifdef qUnix
01150     CvsArgs args(false);
01151     args.add(gCvsPrefs.Browser());
01152     args.add(path);
01153     UCvsApp::gApp->Execute(args.Argc(), args.Argv());
01154 #endif
01155
01156     return 0;
01157 }
01158
01159 int UCvsFolders::OnCmdReload(void)
01160 {
01161     ResetView(true);
01162     return 0;
01163 }
01164
01165 int UCvsFolders::OnCmdIgnore(void)
01166 {
01167     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01168     m_ignore->ToggleIgnore();
01169
01170     ResetView(true);
01171     return 0;
01172 }
01173
01174 int UCvsFolders::OnViewRecursive(void)
01175 {
01176     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01177     m_recursion->ToggleRecursion();
01178
01179     ResetView(true, true);
01180     return 0;
01181 }
01182
01183 int UCvsFolders::OnCmdCheckout(void)
01184 {
01185   KoCheckoutHandler handler;
01186     CvsCmdCheckoutModule(handler);
01187     return 0;
01188 }
01189
01190 int UCvsFolders::OnCmdImport(void)
01191 {
01192   KoImportHandler handler;
01193     CvsCmdImportModule(handler);
01194     return 0;
01195 }
01196
01197 void UCvsFolders::OnCmdUIAdd(UCmdUI *pCmdUI)
01198 {
01199     OnUpdateGeneric(pCmdUI, false);
01200 }
01201
01202 void UCvsFolders::OnCmdUIExplore(UCmdUI *pCmdUI)
01203 {
01204     if(DisableGeneric())
01205     {
01206         pCmdUI->Enable(false);
01207         return;
01208     }
01209     UTREEITEM selItem;
01210     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01211     pCmdUI->Enable(selItem != 0L);
01212 }
01213
01214 void UCvsFolders::OnCmdUIReload(UCmdUI *pCmdUI)
01215 {
01216     UCvsApp *app = UCvsApp::gApp;
01217     pCmdUI->Enable(!app->IsCvsRunning());
01218 }
01219
01220 void UCvsFolders::OnCmdUIIgnore(UCmdUI *pCmdUI)
01221 {
01222     KoIgnoreModel *m_ignore = (KoIgnoreModel *)UCvsApp::gApp->GetIgnoreModel();
01223     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01224     pCmdUI->Check(m_ignore->IsShowIgnored());
01225 }
01226
01227 void UCvsFolders::OnCmdUIViewRecursive(UCmdUI *pCmdUI)
01228 {
01229     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
01230     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
01231     pCmdUI->Check(m_recursion->IsShowRecursive());
01232 }
01233
01234 void UCvsFolders::OnCmdUICheckout(UCmdUI *pCmdUI)
01235 {
01236     UCvsApp *app = UCvsApp::gApp;
01237     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01238 }
01239
01240 void UCvsFolders::OnCmdUIImport(UCmdUI *pCmdUI)
01241 {
01242     UCvsApp *app = UCvsApp::gApp;
01243     pCmdUI->Enable(!app->IsCvsRunning() && !gCvsPrefs.empty());
01244 }
01245
01246 void UCvsFolders::OnCmdUIMacrosSel(int cmd, UCmdUI *pCmdUI)
01247 {
01248     if(DisableGeneric())
01249     {
01250         pCmdUI->Enable(false);
01251         return;
01252     }
01253     UTREEITEM selItem;
01254     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01255     pCmdUI->Enable(selItem != 0L && CTcl_Interp::IsAvail());
01256 }
01257
01258 int UCvsFolders::OnCmdMacrosSel(int cmd)
01259 {
01260     CTcl_Interp interp;
01261     CMacroEntry & entry = gMacrosSel.entries[cmd - cmdSELMACRO];
01262     CStr path = entry.path;
01263     CTcl_Interp::Unixfy(path);
01264
01265     UTREEITEM selItem;
01266     UEventSendMessage(GetWidID(), EV_TREE_GETSEL, kUMainWidget, &selItem);
01267
01268     CStr selPath;
01269     RetrievePath(selItem, selPath);
01270     CStr uppath, folder;
01271     SplitPath(selPath, uppath, folder);
01272
01273     UTREE_INFO query;
01274     query.item = selItem;
01275     UEventSendMessage(GetWidID(), EV_TREE_GETINFO, kUMainWidget, &query);
01276     bool deleteData = false;
01277     EntnodeData *data = (EntnodeData *)query.data;
01278     if(data == 0L)
01279     {
01280         deleteData = true;
01281         EntnodePath *apath = new EntnodePath(uppath);
01282         data = new EntnodeFolder(folder, apath);
01283         apath->UnRef();
01284     }
01285
01286     TclBrowserReset();
01287     TclBrowserAppend(uppath, data);
01288
01289     interp.DoScriptVar("source \"%s\"", (const char *)path);
01290
01291     if(deleteData)
01292         data->UnRef();
01293
01294     ResetView(true, true);
01295
01296     return 0;
01297 }
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CvsEntries.h"
00030 #include "BrowseViewHandlers.h"
00031
00032 class UCvsFolders : public UWidget
00033 {
00034     UDECLARE_DYNAMIC(UCvsFolders)
00035 public:
00036     UCvsFolders();
00037     virtual ~UCvsFolders();
00038
00039     void ResetBrowser(const char *path, bool notifyView = false);
00040         // set the browser root path.
00041
00042     inline const char *GetRoot(void) const { return m_root; }
00043         // get the base of the browser
00044
00045     static void SetDefaultRoot(const char *root);
00046         // set the opening root
00047
00048     void RetrievePath(UTREEITEM item, UStr & path);
00049         // given an item of the tree, guess the full path.
00050
00051     void StepToLocation(const char *path, bool notifyView = false);
00052         // expand and select the path and optionally synchronize the
00053         // file view.
00054
00055     void DeleteAllItems(void);
00056         // used when resetting and take care about our item data
00057         // delete all
00058
00059     void DeleteAllItems(UTREEITEM root);
00060         // used when resetting and take care about our item data
00061         // if root != 0L : delete all childs of root (except root)
00062         // if root == 0L : delete all
00063
00064     void ResetView(bool forceReload = false, bool notifyView = false);
00065         // force reload or check modifications before redrawing
00066         // and optionally synchronize the file view.
00067
00068     int OnCmdIgnore(void);
00069 protected:
00070     UStr m_root;
00071         // current path of the browser
00072
00073     void OnUpdateGeneric(UCmdUI* pCmdUI, bool needCvsInfos);
00074     bool DisableGeneric();
00075         // used for the handling of EV_UPDTCMD
00076
00077     void StoreExpanded(std::vector<UStr> & allExpanded, UTREEITEM root = 0L);
00078     UTREEITEM GetItemByLocation(const char *path);
00079         // used internally
00080
00081     int ProcessSelectionCommand(KiSelectionHandler& handler);
00082     // Process the selection handler command
00083     // param:  handler Command selection handler
00084     // return: true if the command was processed, false otherwise
00085
00086     ev_msg void OnDestroy();
00087     ev_msg void OnCreate();
00088     ev_msg void OnTreeExpanding(int collapse, UTREEITEM item);
00089     ev_msg void OnTreeSelecting(int deselect, UTREEITEM item);
00090     ev_msg void OnCmdUIMacrosSel(int cmd, UCmdUI *pCmdUI);
00091     ev_msg void OnCmdUIUpdate(UCmdUI *pCmdUI);
00092     ev_msg void OnCmdUIAdd(UCmdUI *pCmdUI);
00093     ev_msg void OnCmdUIExplore(UCmdUI *pCmdUI);
00094     ev_msg void OnCmdUIReload(UCmdUI *pCmdUI);
00095     ev_msg void OnCmdUIIgnore(UCmdUI *pCmdUI);
00096     ev_msg void OnCmdUICheckout(UCmdUI *pCmdUI);
00097     ev_msg void OnCmdUIImport(UCmdUI *pCmdUI);
00098     ev_msg void OnCmdUIViewRecursive(UCmdUI *pCmdUI);
00099     ev_msg int OnCmdUpdate(void);
00100     ev_msg int OnCmdAdd(void);
00101     ev_msg int OnCmdCommit(void);
00102     ev_msg int OnCmdQueryUpdate(void);
00103     ev_msg int OnCmdDiff(void);
00104     ev_msg int OnCmdLog(void);
00105     ev_msg int OnCmdStatus(void);
00106     ev_msg int OnCmdLock(void);
00107     ev_msg int OnCmdUnlock(void);
00108     ev_msg int OnCmdWatchOn(void);
00109     ev_msg int OnCmdWatchOff(void);
00110     ev_msg int OnCmdEdit(void);
00111     ev_msg int OnCmdUnedit(void);
00112     ev_msg int OnCmdWatchers(void);
00113     ev_msg int OnCmdEditors(void);
00114     ev_msg int OnCmdRelease(void);
00115     ev_msg int OnCmdTagNew(void);
00116     ev_msg int OnCmdTagDelete(void);
00117     ev_msg int OnCmdTagBranch(void);
00118     ev_msg int OnCmdExplore(void);
00119     ev_msg int OnCmdReload(void);
00120     ev_msg int OnCmdCheckout(void);
00121     ev_msg int OnCmdImport(void);
00122     ev_msg int OnViewRecursive(void);
00123     ev_msg int OnCmdMacrosSel(int cmd);
00124
00125     UDECLARE_MESSAGE_MAP()
00126 };
00127
00128 #endif
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "BrowseViewHandlers.h"
00045 #include "AboutDlg.h"
00046
00047 UIMPLEMENT_DYNAMIC(UCvsFrame, UWidget)
00048
00049 UBEGIN_MESSAGE_MAP(UCvsFrame, UWidget)
00050     ON_UUPDATECMD_RANGE(cmdABOUT, cmdABOUT, UCvsFrame::OnCmdUIAnytime)
00051     ON_UUPDATECMD_RANGE(cmdCREDITS, cmdCOPYRIGHTS, UCvsFrame::OnCmdUIAnytime)
00052     ON_UUPDATECMD_RANGE(UCvsFrame::kDirCombo, UCvsFrame::kBrowserPopup, UCvsFrame::OnCmdUIAnytime)
00053     ON_UUPDATECMD(cmdEXIT, UCvsFrame::OnCmdUIQuit)
00054     ON_UUPDATECMD_RANGE(cmdPREFERENCES, cmdPREFERENCES, UCvsFrame::OnCmdUIAnytime)
00055     ON_UUPDATECMD(cmdSTOPCVS, UCvsFrame::OnCmdUIStopcvs)
00056     ON_UUPDATECMD(cmdRTAGCREATE, UCvsFrame::OnCmdUICvsCmd)
00057     ON_UUPDATECMD(cmdSAVESETTINGS, UCvsFrame::OnCmdUICvsCmd)
00058     ON_UUPDATECMD(cmdIGNORE, UCvsFrame::OnCmdUIViewIgnored)
00059     ON_UUPDATECMD(cmdFILTERMASK, UCvsFrame::OnCmdUIFilterMask)
00060     ON_UUPDATECMD(cmdVIEW_ADDED, UCvsFrame::OnCmdUIViewAdded)
00061     ON_UUPDATECMD(cmdVIEW_MODIFIED, UCvsFrame::OnCmdUIViewModified)
00062     ON_UUPDATECMD(cmdVIEW_CONFLICT, UCvsFrame::OnCmdUIViewConflict)
00063     ON_UUPDATECMD(cmdVIEW_MISSING, UCvsFrame::OnCmdUIViewMissing)
00064     ON_UUPDATECMD(cmdVIEW_UNKNOWN, UCvsFrame::OnCmdUIViewUnknown)
00065     ON_UUPDATECMD(cmdVIEW_REMOVED, UCvsFrame::OnCmdUIViewRemoved)
00066     ON_UUPDATECMD(cmdVIEW_CHANGED, UCvsFrame::OnCmdUIViewChanged)
00067     ON_UUPDATECMD(cmdHIDE_UNKNOWN, UCvsFrame::OnCmdUIHideUnknown)
00068     ON_UUPDATECMD(cmdINIT, UCvsFrame::OnCmdUICvsCmd)
00069     ON_UUPDATECMD(cmdRTAGDELETE, UCvsFrame::OnCmdUICvsCmd)
00070     ON_UUPDATECMD(cmdRTAGBRANCH, UCvsFrame::OnCmdUICvsCmd)
00071     ON_UUPDATECMD(cmdCMDLINE, UCvsFrame::OnCmdUICvsCmd)
00072     ON_UUPDATECMD(cmdLOGIN, UCvsFrame::OnCmdUICvsCmd)
00073     ON_UUPDATECMD(cmdLOGOUT, UCvsFrame::OnCmdUICvsCmd)
00074     ON_UUPDATECMD_RANGE(cmdMACROADMIN, cmdMACROADMINEND, UCvsFrame::OnCmdUIMacroAdmin)
00075     ON_COMBO_SEL(UCvsFrame::kDirCombo, UCvsFrame::OnComboSelDir)
00076     ON_UCOMMAND(UCvsFrame::kBrowserPopup, UCvsFrame::OnBrowserPopup)
00077     ON_UCOMMAND(cmdCOPYRIGHTS, UCvsFrame::OnCopyrights)
00078     ON_UCOMMAND(cmdCREDITS, UCvsFrame::OnCredits)
00079     ON_UCOMMAND(cmdABOUT, UCvsFrame::OnAbout)
00080     ON_UCOMMAND(cmdEXIT, UCvsFrame::OnQuit)
00081     ON_UCOMMAND(cmdPREFERENCES, UCvsFrame::OnCmdPreferences)
00082     ON_UCOMMAND(cmdSAVESETTINGS, UCvsFrame::OnCmdSaveSettings)
00083     ON_UCOMMAND(cmdRTAGCREATE, UCvsFrame::OnCmdRtagNew)
00084     ON_UCOMMAND(cmdRTAGDELETE, UCvsFrame::OnCmdRtagDelete)
00085     ON_UCOMMAND(cmdRTAGBRANCH, UCvsFrame::OnCmdRtagBranch)
00086     ON_UCOMMAND(cmdCMDLINE, UCvsFrame::OnCmdCmdline)
00087     ON_UCOMMAND(cmdLOGIN, UCvsFrame::OnCmdLogin)
00088     ON_UCOMMAND(cmdLOGOUT, UCvsFrame::OnCmdLogout)
00089     ON_UCOMMAND(cmdSTOPCVS, UCvsFrame::OnCmdStopcvs)
00090     ON_UCOMMAND(cmdINIT, UCvsFrame::OnCmdInit)
00091     ON_UCOMMAND(cmdVIEW_ADDED, UCvsFrame::OnViewAdded)
00092     ON_UCOMMAND(cmdVIEW_MODIFIED, UCvsFrame::OnViewModified)
00093     ON_UCOMMAND(cmdVIEW_CONFLICT, UCvsFrame::OnViewConflict)
00094     ON_UCOMMAND(cmdVIEW_MISSING, UCvsFrame::OnViewMissing)
00095     ON_UCOMMAND(cmdVIEW_UNKNOWN, UCvsFrame::OnViewUnknown)
00096     ON_UCOMMAND(cmdVIEW_REMOVED, UCvsFrame::OnViewRemoved)
00097     ON_UCOMMAND(cmdVIEW_CHANGED, UCvsFrame::OnViewChanged)
00098     ON_UCOMMAND(cmdHIDE_UNKNOWN, UCvsFrame::OnHideUnknown)
00099         ON_UCOMMAND_RANGE(cmdMACROADMIN, cmdMACROADMINEND, UCvsFrame::OnCmdMacroAdmin)
00100     ON_UDESTROY(UCvsFrame)
00101 UEND_MESSAGE_MAP()
00102
00103 #if 0
00104     //}}AFX_MSG_MAP
00105     // Enable default OLE container implementation
00106     //ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, CDocument::OnUpdatePasteMenu)
00107     ON_COMMAND_EX_RANGE(ID_MACRO_ADMIN, ID_MACRO_ADMIN + 99, OnMacroAdmin)
00108     ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail)
00109     ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail)
00110 #endif
00111
00112 static bool IsAppEnabled()
00113 {
00114     UCvsApp *app = UCvsApp::gApp;
00115     return !app->IsCvsRunning() && !gCvsPrefs.empty();
00116 }
00117
00118 UCvsFrame::UCvsFrame() : UWidget(kUCvsFrameID)
00119 {
00120 }
00121
00122 UCvsFrame::~UCvsFrame()
00123 {
00124 }
00125
00126 void UCvsFrame::OnDestroy(void)
00127 {
00128 #if qGTK
00129     gtk_main_quit();
00130 #endif /* qGTK */
00131     delete this;
00132 }
00133
00134 bool UCvsFrame::AskForQuitting(void)
00135 {
00136     bool res = true;
00137
00138     if(UCvsApp::gApp->IsCvsRunning())
00139         res = !CvsAlert(_i18n("Cvs is currently running. Are-you sure you want to quit ?"), _i18n("Cancel"), _i18n("Quit"));
00140
00141     gCvsPrefs.save();
00142
00143     return res;
00144 }
00145
00146 void UCvsFrame::OnComboSelDir(int pos, const char *txt)
00147 {
00148     UCvsApp::gApp->GetBrowserView()->ResetBrowser(txt, true);
00149 }
00150
00151 int UCvsFrame::OnBrowserPopup(void)
00152 {
00153     CStr newPath;
00154     if( BrowserGetDirectory(_i18n("Select a folder to open with the browser"), newPath) )
00155     {
00156         UCvsApp::gApp->GetBrowserView()->ResetBrowser(newPath, true);
00157     }
00158
00159     return 0;
00160 }
00161
00162 int UCvsFrame::OnQuit(void)
00163 {
00164     if(!AskForQuitting())
00165         return 0;
00166
00167 #if qGTK
00168     gtk_main_quit();
00169 #endif /* qGTK */
00170
00171     return 0;
00172 }
00173
00174 void UCvsFrame::OnCmdUIQuit(UCmdUI *pCmdUI)
00175 {
00176     pCmdUI->Enable(true);
00177 }
00178
00179 void UCvsFrame::OnCmdUIAnytime(int cmd, UCmdUI *pCmdUI)
00180 {
00181     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00182 }
00183
00184 int UCvsFrame::OnAbout()
00185 {
00186     AboutDialog();
00187     return 0;
00188 }
00189
00190 int UCvsFrame::OnCopyrights()
00191 {
00192     const char *appName = UCvsApp::gApp->GetAppName();
00193
00194     cvs_out(_i18n("\nBoth %s and CVS are distributed under the terms of\n"
00195               "the GNU General Public Licence (GPL).\n\n"), appName);
00196     cvs_out(_i18n("* %s : maintained by Alexandre Parenteau (aubonbeurre@hotmail.com)\n"), appName);
00197     cvs_out("* CVS : Copyright © 1989-1998 Brian Berliner, david d `zoo' zuhn,\n");
00198     cvs_out(_i18n("        Jeff Polk, and other authors\n"));
00199 #ifdef macintosh
00200     printf("* MacCVS : Mike Ladwig, Matthias Neeracher, Alexandre Parenteau\n");
00201     printf("* GUSI : Copyright © 1992-1997 Matthias Neeracher\n");
00202     printf("* Waste : Copyright © 1993-1998 Marco Piovanelli\n");
00203     printf("* CWASTEEdit : Copyright © 1995-1997 Timothy Paustian\n");
00204     printf(_i18n("* ABalloon : Freeware of James W. Walker (jwwalker@kagi.com)\n"));
00205     printf("* Metrowerks Standard Library, PowerPlant & CodeWarrior :\n");
00206     printf("    Copyright © 1996-1997 Metrowerks Inc.\n");
00207     printf("* MPW, MoreFiles : Copyright © Apple Computer Inc.\n");
00208 #endif
00209 #ifdef WIN32
00210     cvs_out(_i18n("* WinCvs documentation : Copyright %c 1999 Don Harper <don@lamrc.com>.\n", '@');
00211     cvs_out("* CJLIB : Copyright © 1998-99 Kirk Stowell <kstowell@codejockeys.com>\n"));
00212     cvs_out("* MFC : Copyright © 1992-1997 Microsoft Corporation\n");
00213 #endif
00214     cvs_out("* Kerberos : Copyright © 1997 Massachusetts Institute of Technology\n");
00215     cvs_out("* TCL : Copyright © Sun Microsystems Inc.\n");
00216     cvs_out(_i18n("\nSome others copyrights may apply, check the source code for details.\n"));
00217     return 0;
00218 }
00219
00220 int UCvsFrame::OnCredits()
00221 {
00222     const char *appName = UCvsApp::gApp->GetAppName();
00223     const char *appVers = UCvsApp::gApp->GetAppVersion();
00224
00225 #ifndef macintosh
00226     cvs_out(_i18n("\n%s %s - Client/Local\n"), appName, appVers);
00227 #else
00228     cvs_out(_i18n("\n%s %s - Client\n"), appName, appVers);
00229 #endif
00230     cvs_out(_i18n("%s is maintained by Alexandre Parenteau\n"), appName);
00231     cvs_out(_i18n("- WinCvs/MacCvs/gcvs page : http://www.wincvs.org or http://cvsgui.sourceforge.net/\n"));
00232     cvs_out(_i18n("- cvs page : http://www.cvshome.org\n"));
00233 #ifdef WIN32
00234     cvs_out(_i18n("- WinCvs documentation : Don Harper <don@lamrc.com>.\n"));
00235     cvs_out(_i18n("- WinHelp cvs documentation : Norbert Klamann.\n"));
00236 #endif
00237 #ifdef macintosh
00238     printf(_i18n("- Mac port :\n"));
00239     printf("\t* Mike Ladwig <mike@twinpeaks.prc.com>\n");
00240     printf("\t* Matthias Neeracher <neeri@iis.ee.ethz.ch>\n");
00241     printf("\t* Alexandre Parenteau <aubonbeurre@hotmail.com>\n");
00242     printf(_i18n("- With contributions of :\n");
00243     printf("\t* Miro Jurisic <meeroh@mit.edu> (Kerberos)\n");
00244     printf("\t* Aleks Totic <atotic@netscape.com> (AppleSingle)\n");
00245     printf("\t* Jocelyn Houle <houlejo@IRO.UMontreal.CA> (Help balloons)\n");
00246 #endif
00247     cvs_out(_i18n("- Special thanks to :\n"));
00248     cvs_out(_i18n("\t* Gary Bringhurst from C3D Digital who gives me time, resources,\n"
00249               "\t  help and ideas for doing this project (http://www.3d.com)\n"));
00250     cvs_out(_i18n("\t* The Freeware community for providing cvs, Linux, Perl, GTK, gcc\n"
00251               "\t  and so many others valuables tools\n"));
00252     cvs_out(_i18n("\t* The users of the CvsGui project (WinCvs, MacCvs, gcvs) who have\n"
00253               "\t  defined all the functionnalities and help every day to enhance it\n"));
00254     cvs_out(_i18n("- Cvs contributors :\n"));
00255     cvs_out(_i18n("\t* Too many to be listed here, see the 'ChangeLog' instead !\n"));
00256     return 0;
00257 }
00258
00259 int UCvsFrame::OnCmdPreferences(void)
00260 {
00261     CompatGetPrefs();
00262     return 0;
00263 }
00264
00265 int UCvsFrame::OnCmdSaveSettings(void)
00266 {
00267     UCvsFolders *browser = UCvsApp::gApp->GetBrowserView();
00268     if(browser != 0L && browser->GetRoot() != 0L)
00269         AskCreatePersistentSettings(browser->GetRoot());
00270     return 0;
00271 }
00272
00273 int UCvsFrame::OnCmdRtagNew(void)
00274 {
00275   KoRtagCreateHandler handler;
00276     CvsCmdRtagCreate(handler);
00277
00278     return 0;
00279 }
00280
00281 int UCvsFrame::OnCmdRtagDelete(void)
00282 {
00283   KoRtagDeleteHandler handler;
00284     CvsCmdRtagDelete(handler);
00285     return 0;
00286 }
00287
00288 int UCvsFrame::OnCmdRtagBranch(void)
00289 {
00290   KoRtagBranchHandler handler;
00291     CvsCmdRtagBranch(handler);
00292     return 0;
00293 }
00294
00295 int UCvsFrame::OnCmdCmdline(void)
00296 {
00297   KoCommandLineHandler handler;
00298     CvsCmdCommandLine(handler);
00299     return 0;
00300 }
00301
00302 int UCvsFrame::OnCmdLogin(void)
00303 {
00304     CvsCmdLogin();
00305     return 0;
00306 }
00307
00308 int UCvsFrame::OnCmdLogout(void)
00309 {
00310     CvsCmdLogout();
00311     return 0;
00312 }
00313
00314 int UCvsFrame::OnCmdStopcvs(void)
00315 {
00316     UCvsApp::gApp->SetCvsStopping(true);
00317     if(UCvsApp::gApp->GetCvsProcess() != 0L && cvs_process_is_active(UCvsApp::gApp->GetCvsProcess()))
00318     {
00319         cvs_process_stop(UCvsApp::gApp->GetCvsProcess());
00320         cvs_out(_i18n("***** CVS stopped on user request !!! *****\n\n"));
00321     }
00322
00323     return 0;
00324 }
00325
00326 int UCvsFrame::OnCmdInit(void)
00327 {
00328     CvsCmdInit();
00329     return 0;
00330 }
00331
00332 int UCvsFrame::OnCmdMacroAdmin(int cmd)
00333 {
00334     CMacroEntry & entry = gMacrosAdmin.entries[cmd - cmdMACROADMIN];
00335     CvsCmdMacrosAdmin(entry.path);
00336     return 0;
00337 }
00338
00339 void UCvsFrame::OnCmdUIStopcvs(UCmdUI *pCmdUI)
00340 {
00341     pCmdUI->Enable(IsAppEnabled());
00342 }
00343
00344 void UCvsFrame::OnCmdUICvsCmd(UCmdUI *pCmdUI)
00345 {
00346     pCmdUI->Enable(IsAppEnabled());
00347 }
00348
00349 void UCvsFrame::OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI)
00350 {
00351     pCmdUI->Enable(IsAppEnabled() && CTcl_Interp::IsAvail());
00352 }
00353
00354 void UCvsFrame::OnViewIgnored()
00355 {
00356     m_ignore.ToggleIgnore();
00357     m_ignore.GetNotificationManager()->NotifyAll();
00358     OnFilterMaskEntered();
00359 }
00360
00361 void UCvsFrame::OnCmdUIViewIgnored(UCmdUI* pCmdUI)
00362 {
00363     pCmdUI->Enable(IsAppEnabled());
00364     pCmdUI->Check(m_ignore.IsShowIgnored());
00365 }
00366
00367 void UCvsFrame::OnCmdUIFilterMask(UCmdUI* pCmdUI)
00368 {
00369     pCmdUI->Enable(IsAppEnabled());
00370 }
00371
00372 void UCvsFrame::OnCmdUIViewRecursive(UCmdUI *pCmdUI)
00373 {
00374     KoRecursionModel *m_recursion = (KoRecursionModel *)UCvsApp::gApp->GetRecursionModel();
00375     pCmdUI->Enable(!UCvsApp::gApp->IsCvsRunning());
00376     pCmdUI->Check(m_recursion->IsShowRecursive());
00377 }
00378
00379 bool UCvsFrame::FreshenFileMask(void)
00380 {
00381     //CString strFileMask;
00382     //m_comboFilterMask.GetWindowText(strFileMask);
00383     return /*false;*/true;
00384     //return m_filter.SetMask(strFileMask);
00385 }
00386
00387 void UCvsFrame::OnViewModified()
00388 {
00389     m_filter.ToggleModified();
00390     FreshenFileMask();
00391     m_filter.GetNotificationManager()->NotifyAll();
00392 }
00393
00394 void UCvsFrame::OnCmdUIViewModified(UCmdUI* pCmdUI)
00395 {
00396     pCmdUI->Enable(IsAppEnabled());
00397     pCmdUI->Check(m_filter.IsModified());
00398 }
00399
00400 void UCvsFrame::OnFilterMaskEntered()
00401 {
00402     if (FreshenFileMask())
00403     {
00404         m_filter.GetNotificationManager()->NotifyAll();
00405     }
00406 }
00407
00408 void UCvsFrame::OnViewConflict()
00409 {
00410     m_filter.ToggleConflict();
00411     FreshenFileMask();
00412     m_filter.GetNotificationManager()->NotifyAll();
00413 }
00414
00415 void UCvsFrame::OnCmdUIViewConflict(UCmdUI* pCmdUI)
00416 {
00417     pCmdUI->Enable(IsAppEnabled());
00418     pCmdUI->Check(m_filter.IsConflict());
00419 }
00420
00421 void UCvsFrame::OnViewUnknown()
00422 {
00423     m_filter.ToggleUnknown();
00424     FreshenFileMask();
00425     m_filter.GetNotificationManager()->NotifyAll();
00426 }
00427
00428 void UCvsFrame::OnCmdUIViewUnknown(UCmdUI* pCmdUI)
00429 {
00430     pCmdUI->Enable(IsAppEnabled());
00431     pCmdUI->Check(m_filter.IsUnknown());
00432 }
00433
00434 void UCvsFrame::OnViewMissing()
00435 {
00436     m_filter.ToggleMissing();
00437     FreshenFileMask();
00438     m_filter.GetNotificationManager()->NotifyAll();
00439 }
00440
00441 void UCvsFrame::OnCmdUIViewMissing(UCmdUI* pCmdUI)
00442 {
00443     pCmdUI->Enable(IsAppEnabled());
00444     pCmdUI->Check(m_filter.IsMissing());
00445 }
00446
00447 void UCvsFrame::OnViewAdded()
00448 {
00449     m_filter.ToggleAdded();
00450     FreshenFileMask();
00451     m_filter.GetNotificationManager()->NotifyAll();
00452 }
00453
00454 void UCvsFrame::OnCmdUIViewAdded(UCmdUI* pCmdUI)
00455 {
00456     pCmdUI->Enable(IsAppEnabled());
00457     pCmdUI->Check(m_filter.IsAdded());
00458 }
00459
00460 void UCvsFrame::OnCmdUIViewRemoved(UCmdUI* pCmdUI)
00461 {
00462     pCmdUI->Enable(IsAppEnabled());
00463     pCmdUI->Check(m_filter.IsRemoved());
00464 }
00465
00466 void UCvsFrame::OnViewRemoved()
00467 {
00468     m_filter.ToggleRemoved();
00469     FreshenFileMask();
00470     m_filter.GetNotificationManager()->NotifyAll();
00471 }
00472
00473 void UCvsFrame::OnViewChanged()
00474 {
00475     m_filter.ToggleChanged();
00476     FreshenFileMask();
00477     m_filter.GetNotificationManager()->NotifyAll();
00478 }
00479
00480 void UCvsFrame::OnCmdUIViewChanged(UCmdUI* pCmdUI)
00481 {
00482     pCmdUI->Enable(IsAppEnabled());
00483     pCmdUI->Check(m_filter.IsChanged());
00484 }
00485
00486 void UCvsFrame::OnHideUnknown()
00487 {
00488     m_filter.ToggleHideUnknown();
00489     FreshenFileMask();
00490     m_filter.GetNotificationManager()->NotifyAll();
00491 }
00492
00493 void UCvsFrame::OnCmdUIHideUnknown(UCmdUI* pCmdUI)
00494 {
00495     pCmdUI->Enable(IsAppEnabled() && m_filter.IsDefaultMode());
00496     pCmdUI->Check(m_filter.IsHideUnknown());
00497 }
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "BrowseViewModel.h"
00031
00032 class UCvsFrame : public UWidget
00033 {
00034     UDECLARE_DYNAMIC(UCvsFrame)
00035 public:
00036     UCvsFrame();
00037     virtual ~UCvsFrame();
00038
00039     bool AskForQuitting(void);
00040         // true if we can quit the application
00041
00042     enum
00043     {
00044         kDirCombo = EV_COMMAND_START,   // 0
00045         kBrowserPopup                   // 1
00046     };
00047
00048 // Attributes
00049 protected:
00050     KoFilterModel m_filter;
00051     KoRecursionModel m_recursion;
00052     KoIgnoreModel m_ignore;
00053
00054 public:
00055     // KiFilterModel implementation
00056     KiFilterModel* GetFilterModel(void)
00057     {
00058         return &m_filter;
00059     }
00060
00061     // KiRecursionModel implementation
00062     KiRecursionModel* GetRecursionModel(void)
00063     {
00064         return &m_recursion;
00065     }
00066
00067     // KiRecursionModel implementation
00068     KiIgnoreModel* GetIgnoreModel(void)
00069     {
00070         return &m_ignore;
00071     }
00072
00073     void OnFilterMaskEntered(void);
00074     bool FreshenFileMask(void);
00075
00076 protected:
00077     ev_msg void OnCmdUIAnytime(int cmd, UCmdUI *pCmdUI);
00078     ev_msg void OnCmdUIViewRecursive(UCmdUI *pCmdUI);
00079     ev_msg void OnCmdUIViewIgnored(UCmdUI *pCmdUI);
00080     ev_msg void OnCmdUIFilterMask(UCmdUI *pCmdUI);
00081     ev_msg void OnCmdUIViewAdded(UCmdUI *pCmdUI);
00082     ev_msg void OnCmdUIViewModified(UCmdUI *pCmdUI);
00083     ev_msg void OnCmdUIViewConflict(UCmdUI *pCmdUI);
00084     ev_msg void OnCmdUIViewUnknown(UCmdUI *pCmdUI);
00085     ev_msg void OnCmdUIViewMissing(UCmdUI *pCmdUI);
00086     ev_msg void OnCmdUIViewRemoved(UCmdUI *pCmdUI);
00087     ev_msg void OnCmdUIViewChanged(UCmdUI *pCmdUI);
00088     ev_msg void OnCmdUIHideUnknown(UCmdUI *pCmdUI);
00089     ev_msg void OnCmdUIQuit(UCmdUI *pCmdUI);
00090     ev_msg void OnCmdUIStopcvs(UCmdUI *pCmdUI);
00091     ev_msg void OnCmdUICvsCmd(UCmdUI *pCmdUI);
00092     ev_msg void OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI);
00093     ev_msg void OnDestroy(void);
00094     ev_msg int OnQuit(void);
00095     ev_msg int OnCopyrights(void);
00096     ev_msg int OnCredits(void);
00097     ev_msg int OnAbout(void);
00098     ev_msg void OnComboSelDir(int pos, const char *txt);
00099     ev_msg int OnBrowserPopup(void);
00100     ev_msg int OnCmdPreferences(void);
00101     ev_msg int OnCmdSaveSettings(void);
00102     ev_msg int OnCmdRtagNew(void);
00103     ev_msg int OnCmdRtagDelete(void);
00104     ev_msg int OnCmdRtagBranch(void);
00105     ev_msg int OnCmdCmdline(void);
00106     ev_msg int OnCmdLogin(void);
00107     ev_msg int OnCmdLogout(void);
00108     ev_msg int OnCmdStopcvs(void);
00109     ev_msg int OnCmdInit(void);
00110     ev_msg int OnCmdMacroAdmin(int cmd);
00111     ev_msg void OnViewIgnored(void);
00112     ev_msg void OnViewRecursive(void);
00113     ev_msg void OnViewAdded(void);
00114     ev_msg void OnViewModified(void);
00115     ev_msg void OnViewConflict(void);
00116     ev_msg void OnViewUnknown(void);
00117     ev_msg void OnViewMissing(void);
00118     ev_msg void OnViewRemoved(void);
00119     ev_msg void OnViewChanged(void);
00120     ev_msg void OnHideUnknown(void);
00121     UDECLARE_MESSAGE_MAP()
00122 };
00123
00124 // little class to get the cursor to wait during the existence of the object
00125 class UWaitCursor
00126 {
00127 public:
00128     UWaitCursor()
00129     {
00130         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursWatch), 0L);
00131     }
00132     virtual ~UWaitCursor()
00133     {
00134         UEventSendMessage(kUCvsFrameID, EV_CHGCURSOR, UMAKEINT(kUMainWidget, uCursArrow), 0L);
00135     }
00136 };
00137
00138 #endif
Generated on Fri Jan 31 12:08:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 "AppConsole.h"
00037 #include "LogParse.h"
00038
00039 UIMPLEMENT_DYNAMIC(UCvsGraph, UWidget)
00040
00041 UBEGIN_MESSAGE_MAP(UCvsGraph, UWidget)
00042     ON_UDESTROY(UCvsGraph)
00043     ON_UCREATE(UCvsGraph)
00044     ON_CUSTOM_DRAW(UCvsGraph::kDrawing, UCvsGraph::OnDrawing)
00045     ON_CUSTOM_CLICK(UCvsGraph::kDrawing, UCvsGraph::OnBtnClick)
00046     ON_RESIZE(UCvsGraph::kDrawing, UCvsGraph::OnDrawing)
00047 UEND_MESSAGE_MAP()
00048
00049 UCvsGraph::UCvsGraph(CLogNode *node, const char *dir) :
00050     UWidget(::UEventGetWidID()), m_node(node), m_dir(dir), m_data(0L)
00051 {
00052     // get the CVS/Entries infos for this file
00053     CSortList<ENTNODE> entries(200, ENTNODE::Compare);
00054     if(!Entries_Open (entries, dir))
00055     {
00056         cvs_err("Warning : Error while accessing the CVS folder in '%s'\n", dir);
00057     }
00058     else
00059     {
00060         if(node->GetType() != kNodeHeader)
00061         {
00062             cvs_err("Warning : Top node is not a RCS file description !\n");
00063         }
00064         else
00065         {
00066             const char *name = (**(CLogNodeHeader *)node).WorkingFile();
00067             struct stat sb;
00068             if (stat(name, &sb) == -1)
00069             {
00070                 cvs_err("Warning : Unknown file '%s'\n", name);
00071             }
00072             else
00073             {
00074                 m_data = Entries_SetVisited(dir, entries, name, sb, false);
00075                 m_data->Ref();
00076                 m_name = name;
00077             }
00078         }
00079     }
00080 }
00081
00082 UCvsGraph::~UCvsGraph()
00083 {
00084     if(m_node != 0L)
00085         delete m_node;
00086     if(m_data != 0L)
00087         m_data->UnRef();
00088 }
00089
00090 void UCvsGraph::OnDestroy(void)
00091 {
00092     delete this;
00093 }
00094
00095 void UCvsGraph::OnCreate(void)
00096 {
00097     UStr title("Graph log : ");
00098     title << m_name;
00099     UEventSendMessage(GetWidID(), EV_SETTEXT, kUMainWidget, (void *)(const char *)title);
00100 }
00101
00102 USize CWinLogHeaderData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00103 {
00104     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00105     return hdc.GetTextExtent((*header).WorkingFile(),
00106         (*header).WorkingFile().length());
00107 }
00108
00109 static void DrawNode(UDC & hdc, const URect & selfB,
00110                      UCOLORREF contour, UCOLORREF shadowc,
00111                      bool isRounded, bool issel)
00112 {
00113     UPen *pOldPen = 0L;
00114     UBrush *pOldBrush = 0L;
00115     UPen pen, pen2;
00116     UBrush brush;
00117     UCOLORREF selcolor = URGB(160, 160, 160);
00118     UCOLORREF wcolor = URGB(255, 255, 255);
00119
00120     try
00121     {
00122         if(!isRounded)
00123         {
00124             if(!issel)
00125             {
00126                 brush.CreateSolidBrush(wcolor);
00127                 pOldBrush = hdc.SelectObject(&brush);
00128                 pen.CreatePen(UPS_SOLID, 1, contour);
00129                 pOldPen = hdc.SelectObject(&pen);
00130                 hdc.Rectangle(selfB);
00131             }
00132             else
00133             {
00134                 brush.CreateSolidBrush(selcolor);
00135                 pOldBrush = hdc.SelectObject(&brush);
00136                 pen.CreatePen(UPS_SOLID, 1, contour);
00137                 pOldPen = hdc.SelectObject(&pen);
00138                 hdc.Rectangle(selfB);
00139             }
00140         }
00141         else
00142         {
00143             URect shadow;
00144             if(!issel)
00145             {
00146                 brush.CreateSolidBrush(shadowc);
00147                 pOldBrush = hdc.SelectObject(&brush);
00148                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00149                 pOldPen = hdc.SelectObject(&pen);
00150                 shadow = selfB;
00151                 shadow.OffsetRect(UPoint(2, 2));
00152                 hdc.RoundRect(&shadow, UPoint(6, 6));
00153
00154                 brush.DeleteObject();
00155                 brush.CreateSolidBrush(wcolor);
00156                 hdc.SelectObject(&brush);
00157                 pen2.CreatePen(UPS_SOLID, 1, contour);
00158                 hdc.SelectObject(&pen2);
00159                 hdc.RoundRect(selfB, UPoint(6, 6));
00160             }
00161             else
00162             {
00163                 brush.CreateSolidBrush(shadowc);
00164                 pOldBrush = hdc.SelectObject(&brush);
00165                 pen.CreatePen(UPS_SOLID, 1, shadowc);
00166                 pOldPen = hdc.SelectObject(&pen);
00167                 shadow = selfB;
00168                 shadow.OffsetRect(UPoint(2, 2));
00169                 hdc.RoundRect(&shadow, UPoint(6, 6));
00170
00171                 brush.DeleteObject();
00172                 brush.CreateSolidBrush(selcolor);
00173                 hdc.SelectObject(&brush);
00174                 pen2.CreatePen(UPS_SOLID, 1, contour);
00175                 hdc.SelectObject(&pen2);
00176                 hdc.RoundRect(selfB, UPoint(6, 6));
00177             }
00178         }
00179
00180         if (pOldPen != 0L)
00181         {
00182             hdc.SelectObject(pOldPen);
00183             pOldPen = 0L;
00184         }
00185         if (pOldBrush != 0L)
00186         {
00187             hdc.SelectObject(pOldBrush);
00188             pOldBrush = 0L;
00189         }
00190
00191         pen.DeleteObject();
00192         pen2.DeleteObject();
00193         brush.DeleteObject();
00194     }
00195     catch(...)
00196     {
00197         if (pOldPen != 0L)
00198             hdc.SelectObject(pOldPen);
00199         if (pOldBrush != 0L)
00200             hdc.SelectObject(pOldBrush);
00201     }
00202 }
00203
00204 void CWinLogHeaderData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00205 {
00206     // draw the node
00207     ::DrawNode(hdc, selfB, URGB(255, 0, 0), URGB(120, 0, 0), true, sel);
00208
00209     // draw the content of the node
00210     UPoint center = selfB.CenterPoint();
00211     int nCenterX = center.x;
00212     int nCenterY = center.y - hdc.GetTextHeight()/2;
00213     CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00214     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00215         (*header).WorkingFile(), (*header).WorkingFile().length());
00216 }
00217
00218 USize CWinLogRevData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00219 {
00220     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00221     USize size = hdc.GetTextExtent((*rev).RevNum().c_str(),
00222         strlen((*rev).RevNum().c_str()));
00223     if(IsDiskNode(entryInfo))
00224     {
00225         size.cx += 2 + 16 + 2;
00226         size.cy = std::max(16, size.cy);
00227     }
00228     return size;
00229 }
00230
00231 void CWinLogRevData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00232 {
00233     URect txtRect = selfB;
00234
00235     if(IsDiskNode(entryInfo))
00236     {
00237         txtRect.left += 2 + 16 + 2;
00238     }
00239
00240     // draw the node
00241     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 0), false, sel);
00242
00243     // draw the state icon if it is the rev. of the disk
00244     if(IsDiskNode(entryInfo))
00245     {
00246         UPoint w(selfB.TopLeft());
00247         w.x += 2;
00248         w.y += (selfB.Height() - 16) / 2;
00249         hdc.DrawBitmap(UCvsFiles::GetImageForEntry(entryInfo), w);
00250     }
00251
00252     // draw the content of the node
00253     UPoint center = txtRect.CenterPoint();
00254     int nCenterX = center.x;
00255     int nCenterY = center.y - hdc.GetTextHeight()/2;
00256     CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00257     hdc.TextOutClipped(nCenterX, nCenterY, &txtRect,
00258             (*rev).RevNum().c_str(), strlen((*rev).RevNum().c_str()));
00259 }
00260
00261 USize CWinLogTagData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00262 {
00263     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00264     return hdc.GetTextExtent(*tag, (*tag).length());
00265 }
00266
00267 void CWinLogTagData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00268 {
00269     // draw the node
00270     ::DrawNode(hdc, selfB, URGB(0, 0, 0), URGB(120, 120, 120), true, sel);
00271
00272     // draw the content of the node
00273     UPoint center = selfB.CenterPoint();
00274     int nCenterX = center.x;
00275     int nCenterY = center.y - hdc.GetTextHeight()/2;
00276     CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00277     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00278         *tag, (*tag).length());
00279 }
00280
00281 USize CWinLogBranchData::GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo)
00282 {
00283     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00284     return hdc.GetTextExtent(*branch, (*branch).length());
00285 }
00286
00287 void CWinLogBranchData::UpdateSelf(UDC & hdc, EntnodeData *entryInfo)
00288 {
00289     // draw the node
00290     ::DrawNode(hdc, selfB, URGB(0, 0, 255), URGB(0, 0, 120), true, sel);
00291
00292     // draw the content of the node
00293     UPoint center = selfB.CenterPoint();
00294     int nCenterX = center.x;
00295     int nCenterY = center.y - hdc.GetTextHeight()/2;
00296     CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00297     hdc.TextOutClipped(nCenterX, nCenterY, &selfB,
00298         *branch, (*branch).length());
00299 }
00300
00301 CWinLogData::CWinLogData(CLogNode *node) : CLogNodeData(node)
00302 {
00303     selfB.SetRectEmpty();
00304     totB.SetRectEmpty();
00305     sel = false;
00306 }
00307
00308 CWinLogData::~CWinLogData()
00309 {
00310 }
00311
00312 const char *CWinLogData::GetStr(void)
00313 {
00314     switch(GetType())
00315     {
00316         case kNodeHeader :
00317         {
00318             CLogNodeHeader & header = *(CLogNodeHeader *)fNode;
00319             return (*header).WorkingFile();
00320             break;
00321         }
00322         case kNodeBranch :
00323         {
00324             CLogNodeBranch & branch = *(CLogNodeBranch *)fNode;
00325             return *branch;
00326             break;
00327         }
00328         case kNodeRev :
00329         {
00330             CLogNodeRev & rev = *(CLogNodeRev *)fNode;
00331             return (*rev).RevNum().c_str();
00332             break;
00333         }
00334         case kNodeTag :
00335         {
00336             CLogNodeTag & tag = *(CLogNodeTag *)fNode;
00337             return *tag;
00338             break;
00339         }
00340     }
00341     return 0L;
00342 }
00343
00344 CWinLogData * CWinLogData::CreateNewData(CLogNode *node)
00345 {
00346     if(node->GetUserData() != 0L)
00347         return (CWinLogData *)node->GetUserData();
00348
00349     CWinLogData *res = 0L;
00350     switch(node->GetType())
00351     {
00352     case kNodeHeader :
00353         res = new CWinLogHeaderData(node);
00354         break;
00355     case kNodeBranch :
00356         res = new CWinLogBranchData(node);
00357         break;
00358     case kNodeRev :
00359         res = new CWinLogRevData(node);
00360         break;
00361     case kNodeTag :
00362         res = new CWinLogTagData(node);
00363         break;
00364     }
00365     node->SetUserData(res);
00366     return res;
00367 }
00368
00369 bool CWinLogData::IsDiskNode(EntnodeData *entryInfo)
00370 {
00371     if(entryInfo == 0L || GetType() != kNodeRev)
00372         return false;
00373     const char *vn = (*entryInfo)[EntnodeFile::kVN];
00374     if(vn == 0L)
00375         return false;
00376
00377     return strcmp(vn, (**(CLogNodeRev *)fNode).RevNum().c_str()) == 0;
00378 }
00379
00380 const int kVChildSpace = 8;
00381 const int kHChildSpace = 40;
00382 const int kInflateNodeSpace = 8;
00383
00384 void CWinLogData::Offset(UPoint o)
00385 {
00386     selfB.OffsetRect(o);
00387     totB.OffsetRect(o);
00388     std::vector<CLogNode *>::iterator i;
00389     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00390     {
00391         CLogNode *subNode = *i;
00392         GetData(subNode)->Offset(o);
00393     }
00394     if(fNode->Next() != 0L)
00395         GetData(fNode->Next())->Offset(o);
00396 }
00397
00398
00399 void CWinLogData::SetSelected(CScrollView *view, bool state)
00400 {
00401     sel = state;
00402
00403     URect invalR = selfB;
00404     invalR.OffsetRect(-view->GetDeviceScrollPosition());
00405     view->InvalidateRect(&invalR);
00406 }
00407
00408 void CWinLogData::UnselectAll(CScrollView *view)
00409 {
00410     if(sel)
00411     {
00412         if(view != NULL)
00413             SetSelected(view, false);
00414         else
00415             SetSelected(false);
00416     }
00417
00418     std::vector<CLogNode *>::iterator i;
00419     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00420     {
00421         CLogNode *subNode = *i;
00422         GetData(subNode)->UnselectAll(view);
00423     }
00424     if(fNode->Next() != 0L)
00425         GetData(fNode->Next())->UnselectAll(view);
00426 }
00427
00428 void CWinLogData::UnselectAll(void)
00429 {
00430     CWinLogData::UnselectAll(NULL);
00431 }
00432
00433 CWinLogData *CWinLogData::HitTest(UPoint point)
00434 {
00435     if(!totB.PtInRect(point))
00436         return 0L;
00437     if(selfB.PtInRect(point))
00438         return this;
00439
00440     CWinLogData *result;
00441     std::vector<CLogNode *>::iterator i;
00442     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00443     {
00444         CLogNode *subNode = *i;
00445         result = GetData(subNode)->HitTest(point);
00446         if(result != 0L)
00447             return result;
00448     }
00449     if(fNode->Next() != 0L)
00450     {
00451         result = GetData(fNode->Next())->HitTest(point);
00452         if(result != 0L)
00453             return result;
00454     }
00455     return 0L;
00456 }
00457
00458 void CWinLogData::Update(UDC & hdc, EntnodeData *entryInfo)
00459 {
00460     CLogNode *subNode;
00461     CLogNode *nextNode = fNode->Next();
00462     UPen *pOldPen = 0L;
00463     UPen pen, pen2;
00464
00465     UpdateSelf(hdc, entryInfo);
00466
00467     try
00468     {
00469         pen.CreatePen(UPS_SOLID, 2, URGB(0, 0, 255));
00470         pen2.CreatePen(UPS_SOLID, 1, URGB(0, 0, 0));
00471         pOldPen = hdc.SelectObject(&pen);
00472
00473         int topY = selfB.TopLeft().y + 2;
00474         int botY = selfB.BottomRight().y - 2;
00475         int lefX = selfB.BottomRight().x + 4;
00476         int count = 1;
00477         int tot = fNode->Childs().size() + 1;
00478
00479         // draw the children
00480         std::vector<CLogNode *>::iterator i;
00481         for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i, ++count)
00482         {
00483             subNode = *i;
00484
00485             // draw the link
00486             URect & cb = GetData(subNode)->SelfBounds();
00487             if(subNode->GetType() == kNodeRev || subNode->GetType() == kNodeBranch)
00488                 hdc.SelectObject(&pen);
00489             else
00490                 hdc.SelectObject(&pen2);
00491             float y = (float)topY + (float)(botY - topY) *
00492                 (float)count / (float)tot;
00493             int rigX = cb.TopLeft().x - 4;
00494             float x = (float)rigX - (float)(rigX - lefX) *
00495                 (float)count / (float)tot;
00496             //int halfX = (cb.TopLeft().x - selfB.BottomRight().x) / 2;
00497             hdc.MoveTo(selfB.BottomRight().x, (int)y);
00498             hdc.LineTo((int)x, (int)y);
00499             hdc.LineTo((int)x, cb.CenterPoint().y);
00500             hdc.LineTo(cb.TopLeft().x, cb.CenterPoint().y);
00501
00502             // draw the sub-node
00503             GetData(subNode)->Update(hdc, entryInfo);
00504         }
00505
00506         // draw the next node
00507         if(nextNode != 0L)
00508         {
00509             // draw the link
00510             URect & nb = GetData(nextNode)->SelfBounds();
00511             if(nextNode->GetType() == kNodeRev || nextNode->GetType() == kNodeBranch)
00512                 hdc.SelectObject(&pen);
00513             else
00514                 hdc.SelectObject(&pen2);
00515             int centerX = selfB.Width() < nb.Width() ?
00516                 selfB.CenterPoint().x : nb.CenterPoint().x;
00517             hdc.MoveTo(centerX, selfB.BottomRight().y);
00518             hdc.LineTo(centerX, nb.TopLeft().y);
00519
00520             // draw the next node
00521             GetData(nextNode)->Update(hdc, entryInfo);
00522         }
00523
00524         if (pOldPen != 0L)
00525         {
00526             hdc.SelectObject(pOldPen);
00527             pOldPen = 0L;
00528         }
00529
00530         pen.DeleteObject();
00531         pen2.DeleteObject();
00532     }
00533     catch(...)
00534     {
00535         if (pOldPen != 0L)
00536             hdc.SelectObject(pOldPen);
00537     }
00538 }
00539
00540 void CWinLogData::ComputeBounds(const UPoint & topLeft, UDC & hdc,
00541                                 EntnodeData *entryInfo)
00542 {
00543     CLogNode *subNode;
00544     CLogNode *nextNode = fNode->Next();
00545
00546     // first compute childrens bounds
00547     std::vector<CLogNode *>::iterator i;
00548     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00549     {
00550         subNode = *i;
00551         CWinLogData::CreateNewData(subNode);
00552         GetData(subNode)->ComputeBounds(topLeft, hdc, entryInfo);
00553     }
00554     if(nextNode != 0L)
00555         CWinLogData::CreateNewData(nextNode);
00556
00557     // compute self place
00558     selfB.SetRectEmpty();
00559     USize size = GetBoundsSelf(hdc, entryInfo);
00560     size.cx += kInflateNodeSpace;
00561     size.cy += kInflateNodeSpace;
00562     selfB.SetRect(0, 0, size.cx, size.cy);
00563
00564     // offset to the place assigned to this node
00565     selfB.OffsetRect(topLeft - selfB.TopLeft());
00566
00567     // calculate the total height of the childrens
00568     int vSize = 0;
00569     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00570     {
00571         subNode = *i;
00572         URect & b = GetData(subNode)->Bounds();
00573         vSize += b.Height();
00574     }
00575     if(!fNode->Childs().empty())
00576         vSize += (fNode->Childs().size() - 1) * kVChildSpace;
00577
00578     // offset the children relative to self
00579     UPoint startChilds(topLeft.x + selfB.Width() + kHChildSpace,
00580         /*selfB.CenterPoint().y - vSize / 2*/topLeft.y);
00581     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00582     {
00583         subNode = *i;
00584         URect curPos = GetData(subNode)->Bounds();
00585         GetData(subNode)->Offset(startChilds - curPos.TopLeft());
00586         startChilds.y += curPos.Height() + kVChildSpace;
00587     }
00588
00589     // calculate the total bounds of the childrens
00590     URect bc;
00591     bc.SetRectEmpty();
00592     for(i = fNode->Childs().begin(); i != fNode->Childs().end(); ++i)
00593     {
00594         subNode = *i;
00595         URect & b = GetData(subNode)->Bounds();
00596         bc.UnionRect(&bc, &b);
00597     }
00598
00599     // now we got the complete size
00600     totB.UnionRect(&selfB, &bc);
00601
00602     if(nextNode != 0L)
00603     {
00604         UPoint nextTopLeft;
00605         nextTopLeft.x = totB.TopLeft().x;
00606         nextTopLeft.y = totB.BottomRight().y + kVChildSpace;
00607         GetData(nextNode)->ComputeBounds(nextTopLeft, hdc, entryInfo);
00608
00609         totB.UnionRect(&totB, &GetData(nextNode)->Bounds());
00610     }
00611 }
00612
00613 void UCvsGraph::CalcImageSize(void)
00614 {
00615     if(m_node == 0L)
00616         return;
00617
00618     // set all the bounds locations
00619     UDC dc(GetWidID(), kDrawing);
00620     CWinLogData *data = CWinLogData::CreateNewData(m_node);
00621     m_node->SetUserData(data);
00622     UPoint start(5, 5);
00623     data->ComputeBounds(start, dc, m_data);
00624
00625     // reoffset from (0, 0)
00626     URect bounds = data->Bounds();
00627     data->Offset(start - bounds.TopLeft());
00628     bounds = data->Bounds();
00629
00630 #if qGTK
00631     GtkWidget *layout = (GtkWidget *)GetWidget(kDrawing);
00632     gtk_drawing_area_size(GTK_DRAWING_AREA(layout), bounds.Width()+5, bounds.Height()+5);
00633 #endif
00634 #if 0
00635     // set the scroll size
00636     SetScrollSizes(MM_TEXT, bounds.Size() + USize(5, 5));
00637 #endif
00638 }
00639
00640 void UCvsGraph::OnDrawing(void *info)
00641 {
00642 #if qGTK
00643     GdkEventExpose *event = (GdkEventExpose *)info;
00644     GtkDrawingArea *drawing = GTK_DRAWING_AREA(GetWidget(kDrawing));
00645     gdk_window_clear_area (drawing->widget.window,
00646                            event->area.x, event->area.y,
00647                            event->area.width, event->area.height);
00648     //fprintf(stderr,"Area: x: %d, y:%d, width: %d, height:%d\n",
00649     //      event->area.x, event->area.y, event->area.width, event->area.height);
00650 #endif
00651     CalcImageSize();
00652
00653     if(m_node == 0L || m_node->GetUserData() == 0L)
00654         return;
00655
00656     OnBlockHandler(drawing, kDrawing, GDK_EXPOSE);
00657
00658     UDC dc(GetWidID(), kDrawing);
00659     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00660     data->Update(dc, m_data);
00661
00662     while (gtk_events_pending())
00663           gtk_main_iteration();
00664
00665     OnUnblockHandler(drawing, kDrawing, GDK_EXPOSE);
00666
00667     /*  GtkWidget *widget = (GtkWidget *)GetWidget(kDrawing);
00668     if(widget == 0L)
00669         return;
00670
00671     GtkDrawingArea *darea;
00672     GdkDrawable *drawable;
00673     GdkGC *black_gc;
00674     GdkGC *gray_gc;
00675     GdkGC *white_gc;
00676     guint max_width;
00677     guint max_height;
00678
00679     g_return_if_fail (widget != NULL);
00680     g_return_if_fail (GTK_IS_DRAWING_AREA (widget));
00681
00682     darea = GTK_DRAWING_AREA (widget);
00683     drawable = widget->window;
00684     white_gc = widget->style->white_gc;
00685     gray_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
00686     black_gc = widget->style->black_gc;
00687     max_width = widget->allocation.width;
00688     max_height = widget->allocation.height;
00689     gdk_draw_rectangle (drawable, black_gc,
00690                         TRUE,
00691                         0,
00692                         max_height / 2,
00693                         max_width,
00694                         max_height / 2);*/
00695 }
00696
00697 void UCvsGraph::OnBtnClick(void *info)
00698 {
00699     GdkEventButton *event = (GdkEventButton *)info;
00700     UPoint point((int)event->x, (int)event->y);
00701     int nFlags = event->state;
00702     CWinLogData *data = (CWinLogData *)m_node->GetUserData();
00703     UDC dc(GetWidID(), kDrawing);
00704
00705     //fprintf(stderr,"x: %f, y:%f, x_root: %f, y_root:%f, state:%d, button:%d\n",
00706     //              event->x, event->y, event->x_root, event->y_root, event->state, event->button);
00707
00708     if(event->button & UK_LBUTTON ) {
00709         if((nFlags & GDK_SHIFT_MASK) == 0 && (nFlags & GDK_CONTROL_MASK) == 0)
00710             data->UnselectAll();
00711
00712         CWinLogData *hit = data->HitTest(point);
00713
00714         if(hit != 0L) {
00715             if((nFlags & GDK_SHIFT_MASK) == 0 && (nFlags & GDK_CONTROL_MASK) == 0) {
00716                 if(!hit->Selected()) {
00717                     CColorConsole out;
00718
00719                     hit->SetSelected(true);
00720
00721                     CvsLogOutput(out, hit->Node());
00722                 }
00723             } else {
00724                 hit->SetSelected(!hit->Selected());
00725             }
00726
00727             data->Update(dc, m_data);
00728         }
00729     }
00730 }
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "CvsLog.h"
00030 #include "udraw.h"
00031
00032 class CLogNode;
00033 class EntnodeData;
00034
00035 class CScrollView
00036 {
00037 public:
00038     UPoint GetDeviceScrollPosition() { return UPoint(0, 0); }
00039     void InvalidateRect(const URECT *r) {}
00040 };
00041
00042 class CWinLogData : public CLogNodeData
00043 {
00044 public:
00045     CWinLogData(CLogNode *node);
00046     virtual ~CWinLogData();
00047
00048     inline kLogNode GetType(void) const { return fNode->GetType(); }
00049     const char *GetStr(void);
00050
00051     void ComputeBounds(const UPoint & topLeft, UDC & hdc,
00052         EntnodeData *entryInfo = 0L);
00053     void Offset(UPoint o);
00054     void Update(UDC & hdc, EntnodeData *entryInfo = 0L);
00055
00056     inline URect & Bounds(void) { return totB; }
00057     inline URect & SelfBounds(void) { return selfB; }
00058
00059     inline bool Selected(void) const { return sel; }
00060     void SetSelected(CScrollView *view, bool state);
00061     inline void SetSelected(bool state) { sel = state; }
00062     void UnselectAll(CScrollView *view);
00063     void UnselectAll(void);
00064     CWinLogData *HitTest(UPoint point);
00065
00066     static CWinLogData *CreateNewData(CLogNode *node);
00067
00068     bool IsDiskNode(EntnodeData *entryInfo);
00069
00070 protected:
00071     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo) = 0;
00072     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo) = 0;
00073
00074     inline CWinLogData *GetData(CLogNode *node)
00075         { return (CWinLogData *)node->GetUserData(); }
00076
00077     URect selfB;
00078     URect totB;
00079     bool sel;
00080 };
00081
00082 class CWinLogHeaderData : public CWinLogData
00083 {
00084 public:
00085     CWinLogHeaderData(CLogNode *node) : CWinLogData(node) {}
00086     virtual ~CWinLogHeaderData() {}
00087
00088 protected:
00089     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00090     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00091 };
00092
00093 class CWinLogRevData : public CWinLogData
00094 {
00095 public:
00096     CWinLogRevData(CLogNode *node) : CWinLogData(node) {}
00097     virtual ~CWinLogRevData() {}
00098
00099 protected:
00100     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00101     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00102 };
00103
00104 class CWinLogTagData : public CWinLogData
00105 {
00106 public:
00107     CWinLogTagData(CLogNode *node) : CWinLogData(node) {}
00108     virtual ~CWinLogTagData() {}
00109
00110 protected:
00111     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00112     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00113 };
00114
00115 class CWinLogBranchData : public CWinLogData
00116 {
00117 public:
00118     CWinLogBranchData(CLogNode *node) : CWinLogData(node) {}
00119     virtual ~CWinLogBranchData() {}
00120
00121 protected:
00122     virtual void UpdateSelf(UDC & hdc, EntnodeData *entryInfo);
00123     virtual USize GetBoundsSelf(UDC & hdc, EntnodeData *entryInfo);
00124 };
00125
00126 class UCvsGraph : public UWidget
00127 {
00128     UDECLARE_DYNAMIC(UCvsGraph)
00129 public:
00130     UCvsGraph(CLogNode *node, const char *dir);
00131     virtual ~UCvsGraph();
00132
00133     enum
00134     {
00135         kDrawing = EV_COMMAND_START // 0
00136     };
00137 protected:
00138     CLogNode *m_node;
00139     UStr m_dir;
00140     UStr m_name;
00141     EntnodeData *m_data;
00142
00143     void CalcImageSize(void);
00144
00145     ev_msg void OnDestroy();
00146     ev_msg void OnCreate();
00147     ev_msg void OnDrawing(void *info);
00148     ev_msg void OnBtnClick(void *info);
00149
00150     UDECLARE_MESSAGE_MAP()
00151 };
00152
00153 #endif
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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, _i18n("&File"), UMENU_NULL);
00061     UMenuAddButton(widid, _i18n("&Save\tCtrl+S"), menu, 0L, cmdSAVE);
00062     UMenuAddButton(widid, _i18n("Save &As..."), menu, 0L, cmdSAVE_AS);
00063     UMenuAddSeparator(widid, menu);
00064     UMenuAddButton(widid, _i18n("&Print...\tCtrl+P"), menu, 0L, cmdPRINT);
00065     UMenuAddButton(widid, _i18n("Print Pre&view"), menu, 0L, cmdPRINT_PREVIEW);
00066     UMenuAddButton(widid, _i18n("P&rint Setup..."), menu, 0L, cmdPRINT_SETUP);
00067     UMenuAddSeparator(widid, menu);
00068     UMenuAddButton(widid, _i18n("Sen&d..."), menu, 0L, cmdSEND_MAIL);
00069     UMenuAddSeparator(widid, menu);
00070     UMenuAddButton(widid, _i18n("E&xit\tCtrl+Q"), menu, 0L, cmdEXIT);
00071
00072     menu = UMenuAddPulldown(widid, _i18n("&Edit"), UMENU_NULL);
00073     UMenuAddButton(widid, _i18n("&Undo\tCtrl+Z"), menu, 0L, cmdUNDO);
00074     UMenuAddSeparator(widid, menu);
00075     UMenuAddButton(widid, _i18n("Cu&t\tCtrl+X"), menu, 0L, cmdCUT);
00076     UMenuAddButton(widid, _i18n("&Copy\tCtrl+C"), menu, 0L, cmdCOPY);
00077     UMenuAddButton(widid, _i18n("&Paste\tCtrl+V"), menu, 0L, cmdPASTE);
00078     UMenuAddSeparator(widid, menu);
00079     UMenuAddButton(widid, _i18n("Select &All\tCtrl+A"), menu, 0L, cmdSELECT_ALL);
00080     UMenuAddButton(widid, _i18n("&Erase all"), menu, 0L, cmdCLEAR_ALL);
00081     UMenuAddSeparator(widid, menu);
00082     UMenuAddButton(widid, _i18n("&Find...\tCtrl+F"), menu, 0L, cmdFIND);
00083     UMenuAddButton(widid, _i18n("Find next\tF3"), menu, 0L, cmdREPEAT);
00084     UMenuAddSeparator(widid, menu);
00085     UMenuAddButton(widid, _i18n("F&ont..."), menu, 0L, cmdFONT);
00086
00087     menu = UMenuAddPulldown(widid, _i18n("&View"), UMENU_NULL);
00088     UMenuAddButton(widid, _i18n("&Toolbar"), menu, 0L, cmdTOOLBAR);
00089     UMenuAddButton(widid, _i18n("&Status Bar"), menu, 0L, cmdSTATUS_BAR);
00090     UMenuAddButton(widid, _i18n("&Browser Bar"), menu, 0L, cmdBROWSER_BAR);
00091     UMenuAddButton(widid, _i18n("&Files Bar"), menu, 0L, cmdFILES_BAR);
00092     UMenuAddButton(widid, _i18n("&Multi-Users Bar"), menu, 0L, cmdMULTI_BAR);
00093     UMenuAddButton(widid, _i18n("T&ags Bar"), menu, 0L, cmdTAGS_BAR);
00094     UMenuAddButton(widid, _i18n("&Console Bar"), menu, 0L, cmdCONSOLE_BAR);
00095     UMenuAddButton(widid, _i18n("&Workspace Bar"), menu, 0L, cmdWORKSPACE);
00096     UMenuAddSeparator(widid, menu);
00097     UMenuAddButton(widid, _i18n("Change browser &location..."), menu, 0L, cmdOPEN);
00098     UMenuAddButton(widid, _i18n("S&ave settings for location..."), menu, 0L, cmdSAVESETTINGS);
00099
00100     menu = UMenuAddPulldown(widid, _i18n("&Admin"), UMENU_NULL);
00101     UMenuAddButton(widid, _i18n("Pr&eferences...\tCtrl+F1"), menu, 0L, cmdPREFERENCES);
00102     UMenuAddButton(widid, _i18n("&Command Line..."), menu, 0L, cmdCMDLINE);
00103     UMenuAddSeparator(widid, menu);
00104     UMenuAddButton(widid, _i18n("&Login..."), menu, 0L, cmdLOGIN);
00105     UMenuAddButton(widid, _i18n("Lo&gout"), menu, 0L, cmdLOGOUT);
00106     UMenuAddSeparator(widid, menu);
00107     UMenuAddButton(widid, _i18n("&Stop cvs"), menu, 0L, cmdSTOPCVS);
00108     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Create"), UMENU_NULL);
00115     UMenuAddButton(widid, _i18n("&Create a new repository..."), menu, 0L, cmdINIT);
00116     UMenuAddSeparator(widid, menu);
00117     UMenuAddButton(widid, _i18n("Import module..."), menu, 0L, cmdIMPORT);
00118     UMenuAddButton(widid, _i18n("Checkout module..."), menu, 0L, cmdCHECKOUT);
00119     UMenuAddSeparator(widid, menu);
00120     UMenuAddButton(widid, _i18n("&Create a tag by module..."), menu, 0L, cmdRTAGCREATE);
00121     UMenuAddButton(widid, _i18n("&Delete a tag by module..."), menu, 0L, cmdRTAGDELETE);
00122     UMenuAddButton(widid, _i18n("Create a &branch by module..."), menu, 0L, cmdRTAGBRANCH);
00123
00124     menu = UMenuAddPulldown(widid, _i18n("&Modify"), UMENU_NULL);
00125     UMenuAddButton(widid, _i18n("&Update selection...\tCtrl+U"), menu, 0L, cmdUPDATE);
00126     UMenuAddButton(widid, _i18n("Co&mmit selection...\tCtrl+M"), menu, 0L, cmdCOMMIT);
00127     UMenuAddSeparator(widid, menu);
00128     UMenuAddButton(widid, _i18n("&Add selection"), menu, 0L, cmdADD);
00129     UMenuAddButton(widid, _i18n("Add selection binar&y"), menu, 0L, cmdADDB);
00130     UMenuAddButton(widid, _i18n("&Remove selection"), menu, 0L, cmdRMV);
00131     UMenuAddSeparator(widid, menu);
00132     UMenuAddButton(widid, _i18n("Erase &selection\tCtrl+Backspace"), menu, 0L, cmdTRASH);
00133     UMenuAddSeparator(widid, menu);
00134     UMenuAddButton(widid, _i18n("&Create a tag on selection..."), menu, 0L, cmdTAGNEW);
00135     UMenuAddButton(widid, _i18n("&Delete a tag on selection..."), menu, 0L, cmdTAGDELETE);
00136     UMenuAddButton(widid, _i18n("Create a &branch on selection..."), menu, 0L, cmdTAGBRANCH);
00137
00138     menu = UMenuAddPulldown(widid, _i18n("&Query"), UMENU_NULL);
00139     UMenuAddButton(widid, _i18n("E&xplore selection\tF2"), menu, 0L, cmdEXPLORE);
00140     UMenuAddButton(widid, _i18n("&Query Update\tF4"), menu, 0L, cmdQUERYUPDATE);
00141     UMenuAddButton(widid, _i18n("R&eload view\tF5"), menu, 0L, cmdRELOAD);
00142     UMenuAddSeparator(widid, menu);
00143     UMenuAddButton(widid, _i18n("View selection\tF7"), menu, 0L, cmdEDITSEL);
00144     UMenuAddButton(widid, _i18n("View default"), menu, 0L, cmdEDITSELDEF);
00145     UMenuAddSeparator(widid, menu);
00146     UMenuAddButton(widid, _i18n("&Diff selection\tCtrl+D"), menu, 0L, cmdDIFF);
00147     UMenuAddButton(widid, _i18n("&Log selection"), menu, 0L, cmdLOG);
00148     UMenuAddButton(widid, _i18n("Status sele&ction"), menu, 0L, cmdSTATUS);
00149     UMenuAddButton(widid, _i18n("Graph selection\tCtrl+G"), menu, 0L, cmdGRAPH);
00150
00151     menu = UMenuAddPulldown(widid, _i18n("&Trace"), UMENU_NULL);
00152     UMenuAddButton(widid, _i18n("Lock selection"), menu, 0L, cmdLOCKF);
00153     UMenuAddButton(widid, _i18n("Unlock selection"), menu, 0L, cmdUNLOCKF);
00154     UMenuAddButton(widid, _i18n("Edit selection"), menu, 0L, cmdEDIT);
00155     UMenuAddButton(widid, _i18n("Unedit selection"), menu, 0L, cmdUNEDIT);
00156     UMenuAddButton(widid, _i18n("Add a Watch on selection"), menu, 0L, cmdWATCHON);
00157     UMenuAddButton(widid, _i18n("Remove a watch from selection"), menu, 0L, cmdWATCHOFF);
00158     UMenuAddSeparator(widid, menu);
00159     UMenuAddButton(widid, _i18n("Release selection"), menu, 0L, cmdRELEASE);
00160     UMenuAddSeparator(widid, menu);
00161     UMenuAddButton(widid, _i18n("Watchers of selection"), menu, 0L, cmdWATCHERS);
00162     UMenuAddButton(widid, _i18n("Editors of selection"), menu, 0L, cmdEDITORS);
00163
00164     menu = UMenuAddPulldown(widid, _i18n("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, _i18n("&Window"), UMENU_NULL);
00171     UMenuAddButton(widid, _i18n("&Cascade"), menu, 0L, cmdCASCADE);
00172     UMenuAddButton(widid, _i18n("&Tile"), menu, 0L, cmdTILE_HORZ);
00173     UMenuAddButton(widid, _i18n("&Arrange Icons"), menu, 0L, cmdARRANGE);
00174
00175     menu = UMenuAddPulldown(widid, _i18n("&Help"), UMENU_NULL);
00176     UMenuAddButton(widid, _i18n("&Help Topics"), menu, 0L, cmdFINDER);
00177     UMenuAddButton(widid, _i18n("Help on cvs-1.10"), menu, 0L, cmdCVS);
00178     UMenuAddButton(widid, _i18n("Help on cvs client"), menu, 0L, cmdCVSCLIENT);
00179     UMenuAddSeparator(widid, menu);
00180     UMenuAddButton(widid, _i18n("&Credits"), menu, 0L, cmdCREDITS);
00181     UMenuAddButton(widid, _i18n("C&opyrights"), menu, 0L, cmdCOPYRIGHTS);
00182     UMenuAddSeparator(widid, menu);
00183 #ifdef WIN32
00184     UMenuAddButton(widid, _i18n("&About wincvs..."), menu, 0L, cmdABOUT);
00185 #endif
00186 #ifdef qUnix
00187     UMenuAddButton(widid, _i18n("&About gcvs..."), menu, 0L, cmdABOUT);
00188 #endif
00189 }
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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(int widid) : UToolbar(widid)
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         _i18n("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         _i18n("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         _i18n("Stop when cvs is running...\nStop cvs...")
00082     };
00083     UTB_BUTTON ignoreBtn = {
00084         "ignore.xpm",
00085         cmdIGNORE,
00086         DDV_NONE,
00087         DDD_NONE,
00088         _i18n("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 //      _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("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         _i18n("Edit the selected files\nEdit selection")
00222     };
00223     UTB_BUTTON uneditBtn = {
00224         "unedit.xpm",
00225         cmdUNEDIT,
00226         DDV_NONE,
00227         DDD_NONE,
00228         _i18n("Unedit the selected files\nUnedit selection")
00229     };
00230     UTB_BUTTON releaseBtn = {
00231         "release.xpm",
00232         cmdRELEASE,
00233         DDV_NONE,
00234         DDD_NONE,
00235         _i18n("Release the selected files\nRelease selection")
00236     };
00237
00238     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &updtBtn);
00239     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &commitBtn);
00240     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00241     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &stopBtn);
00242     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00243     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addBtn);
00244     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &addbBtn);
00245     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &rmvBtn);
00246     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00247     UEventSendMessage(kUCvsToolbarID, EV_TB_CHECKBTN, 0, &ignoreBtn);
00248 //  UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00249     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &exploreBtn);
00250     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &upBtn);
00251     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00252     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &diffBtn);
00253     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &logBtn);
00254     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &statusBtn);
00255     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00256     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &graphBtn);
00257     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00258     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &trashBtn);
00259     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00260     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &tagBtn);
00261     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &untagBtn);
00262     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &branchBtn);
00263     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00264     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &lockBtn);
00265     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unlockBtn);
00266     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00267     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &watchBtn);
00268     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &unwatchBtn);
00269     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00270     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &editBtn);
00271     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &uneditBtn);
00272     UEventSendMessage(kUCvsToolbarID, EV_TB_SEPARATOR, 0, 0L);
00273     UEventSendMessage(kUCvsToolbarID, EV_TB_BUTTON, 0, &releaseBtn);
00274
00275     UEventSendMessage(kUCvsToolbarID, EV_TB_END, 0, 0L);
00276 }
00277
00278 void CreateBrowseToolbar(void)
00279 {
00280     UTB_INIT init;
00281     init.widthbtn = 16;
00282     init.heightbtn = 16;
00283     init.title = "Browse Toolbar";
00284     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_INIT, 0, &init);
00285
00286     UTB_BUTTON flatBtn = {
00287         "flat.xpm",
00288         cmdFLAT,
00289         DDV_NONE,
00290         DDD_NONE,
00291         _i18n("view recursive")
00292     };
00293
00294     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_CHECKBTN, 0, &flatBtn);
00295     UEventSendMessage(kUCvsBrowseToolbarID, EV_TB_END, 0, 0L);
00296 }
00297
00298 void CreateFilterToolbar(void)
00299 {
00300     UTB_INIT init;
00301     init.widthbtn = 16;
00302     init.heightbtn = 16;
00303     init.title = "Filter Toolbar";
00304     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_INIT, 0, &init);
00305
00306     UTB_BUTTON viewModifiedBtn = {
00307         "viewModified.xpm",
00308         cmdVIEW_MODIFIED,
00309         DDV_NONE,
00310         DDD_NONE,
00311         _i18n("view modified files")
00312     };
00313
00314     UTB_BUTTON viewChangedBtn = {
00315         "viewChanged.xpm",
00316         cmdVIEW_CHANGED,
00317         DDV_NONE,
00318         DDD_NONE,
00319         _i18n("view changed files")
00320     };
00321
00322     UTB_BUTTON viewAddedBtn = {
00323         "viewAdded.xpm",
00324         cmdVIEW_ADDED,
00325         DDV_NONE,
00326         DDD_NONE,
00327         _i18n("view added files")
00328     };
00329
00330     UTB_BUTTON viewRemovedBtn = {
00331         "viewRemove.xpm",
00332         cmdVIEW_REMOVED,
00333         DDV_NONE,
00334         DDD_NONE,
00335         _i18n("view removed files")
00336     };
00337
00338     UTB_BUTTON viewConflictBtn = {
00339         "viewConflict.xpm",
00340         cmdVIEW_CONFLICT,
00341         DDV_NONE,
00342         DDD_NONE,
00343         _i18n("view conflict files")
00344     };
00345
00346     UTB_BUTTON viewUnknownBtn = {
00347         "viewUnknown.xpm",
00348         cmdVIEW_UNKNOWN,
00349         DDV_NONE,
00350         DDD_NONE,
00351         _i18n("view unknown files")
00352     };
00353
00354     UTB_BUTTON hideUnknownBtn = {
00355         "hideUnknown.xpm",
00356         cmdHIDE_UNKNOWN,
00357         DDV_NONE,
00358         DDD_NONE,
00359         _i18n("hide unknown files")
00360     };
00361
00362     UTB_BUTTON viewMissingBtn = {
00363         "viewMissing.xpm",
00364         cmdVIEW_MISSING,
00365         DDV_NONE,
00366         DDD_NONE,
00367         _i18n("view only missing files")
00368     };
00369
00370     UTB_BUTTON viewIgnoredBtn = {
00371         "viewIgnored.xpm",
00372         cmdIGNORE,
00373         DDV_NONE,
00374         DDD_NONE,
00375         _i18n("View or hide the cvs ignored files\nIgnore switch")
00376     };
00377
00378     UTB_BUTTON reloadBtn = {
00379         "reload.xpm",
00380         cmdRELOAD,
00381         DDV_NONE,
00382         DDD_NONE,
00383         _i18n("Refresh the views, updating the contents\nRefresh view")
00384     };
00385
00386     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewModifiedBtn);
00387     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewChangedBtn);
00388     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewAddedBtn);
00389     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewRemovedBtn);
00390     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewConflictBtn);
00391     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00392     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewUnknownBtn);
00393     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &hideUnknownBtn);
00394     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00395     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewMissingBtn);
00396     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_CHECKBTN, 0, &viewIgnoredBtn);
00397     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_SEPARATOR, 0, 0L);
00398     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_BUTTON, 0, &reloadBtn);
00399     UEventSendMessage(kUCvsFilterToolbarID, EV_TB_END, 0, 0L);
00400 }
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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(int widid);
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 void CreateBrowseToolbar(void);
00047 void CreateFilterToolbar(void);
00048
00049 #endif
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 # include "UCommandDialogs.h"
00047 #endif /* qMacCvsPP */
00048
00049 #include "UpdateDlg.h"
00050 #include "CvsPrefs.h"
00051 #include "MultiFiles.h"
00052 #include "ItemListDlg.h"
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 char *sDefTagNames[] =
00063 {
00064     "1.1",
00065     "1.6.2.4",
00066     "HEAD",
00067     "branch-release-1-0",
00068     0L
00069 };
00070
00071 char *sDefDateNames[] =
00072 {
00073     "1998-3",
00074     "1998-3-24",
00075     "1998-3-24 20:55",
00076     "24 Mar",
00077     "24 Mar 1998",
00078     "<=1998-3-24",
00079     0L
00080 };
00081
00082 char *sDefRevDateNames[] =
00083 {
00084     "1.1",
00085     "1.6.2.4",
00086     "HEAD",
00087     "branch-release-1-0",
00088     "1998-3",
00089     "1998-3-24",
00090     "1998-3-24 20:55",
00091     "24 Mar",
00092     "24 Mar 1998",
00093     "<=1998-3-24",
00094     0L
00095 };
00096
00097 CMString gRevNames(10, "P_TagNames", sDefTagNames);
00098 CMString gDateNames(10, "P_DateNames", sDefDateNames);
00099 CMString gDateOrRevNames(20, "P_RebDateNames", sDefRevDateNames);
00100
00101 #ifdef WIN32
00102 #include "GetPrefs.h"
00103
00104 IMPLEMENT_DYNAMIC(CUpdateMain, CPropertyPage)
00105
00106 CUpdateMain::CUpdateMain() : CPropertyPage(CUpdateMain::IDD)
00107 {
00108     //{{AFX_DATA_INIT(CUpdateMain)
00109     m_delsticky = FALSE;
00110     m_norecurs = FALSE;
00111     m_stdout = FALSE;
00112     m_createmissdir = FALSE;
00113     m_getcleancopy = FALSE;
00114     //}}AFX_DATA_INIT
00115 }
00116
00117 CUpdateMain::~CUpdateMain()
00118 {
00119 }
00120
00121 void CUpdateMain::DoDataExchange(CDataExchange* pDX)
00122 {
00123     CPropertyPage::DoDataExchange(pDX);
00124     //{{AFX_DATA_MAP(CUpdateMain)
00125     DDX_Check(pDX, IDC_DELSTICKY, m_delsticky);
00126     DDX_Check(pDX, IDC_NORECURS, m_norecurs);
00127     DDX_Check(pDX, IDC_STDOUT, m_stdout);
00128     DDX_Check(pDX, IDC_CREATEMISSDIR, m_createmissdir);
00129     DDX_Check(pDX, IDC_CLEANCOPY, m_getcleancopy);
00130     //}}AFX_DATA_MAP
00131 }
00132
00133
00134 BEGIN_MESSAGE_MAP(CUpdateMain, CPropertyPage)
00135     //{{AFX_MSG_MAP(CUpdateMain)
00136         // NOTE: the ClassWizard will add message map macros here
00137     //}}AFX_MSG_MAP
00138 END_MESSAGE_MAP()
00139
00140 IMPLEMENT_DYNAMIC(CUpdateSticky, CPropertyPage)
00141
00142 CUpdateSticky::CUpdateSticky(const MultiFiles* mf,
00143                              const char* rev, const char* date, const char* keyword)
00144                              : m_mf(mf), CPropertyPage(CUpdateSticky::IDD)
00145 {
00146     //{{AFX_DATA_INIT(CUpdateSticky)
00147     m_date = date;
00148     m_rev = rev;
00149     m_hasdate = FALSE;
00150     m_hasrev = FALSE;
00151     m_match = FALSE;
00152     m_keyword = keyword;
00153     //}}AFX_DATA_INIT
00154
00155     m_revCombo.SetItems(&gRevNames);
00156     m_dateCombo.SetItems(&gDateNames);
00157 }
00158
00159 CUpdateSticky::~CUpdateSticky()
00160 {
00161 }
00162
00163 void CUpdateSticky::DoDataExchange(CDataExchange* pDX)
00164 {
00165     CPropertyPage::DoDataExchange(pDX);
00166     //{{AFX_DATA_MAP(CUpdateSticky)
00167     DDX_Control(pDX, IDC_KEYWORDSUBSTITUTION, m_keywordCombo);
00168     DDX_Control(pDX, IDC_KEYWORDDESC, m_keywordDescStatic);
00169     DDX_Control(pDX, IDC_COMBODATE, m_dateCombo);
00170     DDX_Control(pDX, IDC_COMBOREV, m_revCombo);
00171     DDX_CBString(pDX, IDC_COMBODATE, m_date);
00172     DDX_CBString(pDX, IDC_COMBOREV, m_rev);
00173     DDX_Check(pDX, IDC_DATE, m_hasdate);
00174     DDX_Check(pDX, IDC_REV, m_hasrev);
00175     DDX_Check(pDX, IDC_MATCH, m_match);
00176     DDX_CBString(pDX, IDC_KEYWORDSUBSTITUTION, m_keyword);
00177     //}}AFX_DATA_MAP
00178
00179     if( m_hasrev )
00180     {
00181         DDV_MinChars(pDX, m_rev, 1);
00182     }
00183
00184     if( m_hasdate )
00185     {
00186         DDV_MinChars(pDX, m_date, 1);
00187     }
00188
00189     if( !pDX->m_bSaveAndValidate )
00190     {
00191         OnDate();
00192         OnRev();
00193     }
00194
00195     DDX_ComboMString(pDX, IDC_COMBOREV, m_revCombo);
00196     DDX_ComboMString(pDX, IDC_COMBODATE, m_dateCombo);
00197 }
00198
00199 BEGIN_MESSAGE_MAP(CUpdateSticky, CPropertyPage)
00200     //{{AFX_MSG_MAP(CUpdateSticky)
00201     ON_BN_CLICKED(IDC_DATE, OnDate)
00202     ON_BN_CLICKED(IDC_REV, OnRev)
00203     ON_BN_CLICKED(IDC_BROWSE_TAG, OnBrowseTag)
00204     //}}AFX_MSG_MAP
00205 END_MESSAGE_MAP()
00206
00207
00208
00209 BOOL CUpdateSticky::OnInitDialog()
00210 {
00211     CPropertyPage::OnInitDialog();
00212
00213     // Extra initialization
00214     m_keywordCombo.SetDescriptionWnd(m_keywordDescStatic.m_hWnd);
00215
00216     return TRUE;  // return TRUE unless you set the focus to a control
00217                   // EXCEPTION: OCX Property Pages should return FALSE
00218 }
00219
00220 void CUpdateSticky::OnDate()
00221 {
00222     CButton* but = (CButton *)GetDlgItem(IDC_DATE);
00223     CWnd* wnd = GetDlgItem(IDC_COMBODATE);
00224     wnd->EnableWindow(but->GetCheck() == 1);
00225 }
00226
00227 void CUpdateSticky::OnRev()
00228 {
00229     CButton* but = (CButton*)GetDlgItem(IDC_REV);
00230
00231     CWnd* wnd = GetDlgItem(IDC_COMBOREV);
00232     if( wnd )
00233     {
00234         wnd->EnableWindow(but->GetCheck());
00235     }
00236
00237     wnd = GetDlgItem(IDC_BROWSE_TAG);
00238     if( wnd )
00239     {
00240         wnd->EnableWindow(but->GetCheck());
00241     }
00242 }
00243
00244 void CUpdateSticky::OnBrowseTag()
00245 {
00246     CStr tagName;
00247     if( CompatGetTagListItem(m_mf, tagName) )
00248     {
00249         m_rev = (const char*)tagName;
00250         m_revCombo.SetWindowText(m_rev);
00251     }
00252 }
00253
00254 IMPLEMENT_DYNAMIC(CUpdateMerge, CPropertyPage)
00255
00256 CUpdateMerge::CUpdateMerge(const MultiFiles* mf,
00257                            bool isCheckout,
00258                            const char* rev1, const char* rev2, const char* date1, const char* date2)
00259                            : m_mf(mf), CPropertyPage(CUpdateMerge::IDD)
00260 {
00261     //{{AFX_DATA_INIT(CUpdateMerge)
00262     m_rev1 = rev1;
00263     m_rev2 = rev2;
00264     m_merge = 0;
00265     m_hasDate1 = FALSE;
00266     m_hasDate2 = FALSE;
00267     m_date1 = _T("");
00268     m_date2 = _T("");
00269     //}}AFX_DATA_INIT
00270
00271     m_isCheckout = isCheckout;
00272
00273     m_rev1Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00274     m_rev2Combo.SetItems(m_isCheckout ? &gReleasesNames : &gRevNames);
00275     m_date1Combo.SetItems(&gDateNames);
00276     m_date2Combo.SetItems(&gDateNames);
00277 }
00278
00279 CUpdateMerge::~CUpdateMerge()
00280 {
00281 }
00282
00283 void CUpdateMerge::DoDataExchange(CDataExchange* pDX)
00284 {
00285     CPropertyPage::DoDataExchange(pDX);
00286     //{{AFX_DATA_MAP(CUpdateMerge)
00287     DDX_Control(pDX, IDC_COMBODATE2, m_date2Combo);
00288     DDX_Control(pDX, IDC_COMBODATE1, m_date1Combo);
00289     DDX_Control(pDX, IDC_COMBOREV2, m_rev2Combo);
00290     DDX_Control(pDX, IDC_COMBOREV, m_rev1Combo);
00291     DDX_CBString(pDX, IDC_COMBOREV, m_rev1);
00292     DDX_CBString(pDX, IDC_COMBOREV2, m_rev2);
00293     DDX_Radio(pDX, IDC_MERGE, m_merge);
00294     DDX_Check(pDX, IDC_CHECKDATE1, m_hasDate1);
00295     DDX_Check(pDX, IDC_CHECKDATE2, m_hasDate2);
00296     DDX_CBString(pDX, IDC_COMBODATE1, m_date1);
00297     DDX_CBString(pDX, IDC_COMBODATE2, m_date2);
00298     //}}AFX_DATA_MAP
00299
00300     if( m_merge == 1 || m_merge == 2 )
00301     {
00302         DDV_MinChars(pDX, m_rev1, 1);
00303         if( m_hasDate1 )
00304         {
00305             DDV_MinChars(pDX, m_date1, 1);
00306         }
00307     }
00308
00309     if( m_merge == 2 )
00310     {
00311         DDV_MinChars(pDX, m_rev2, 1);
00312         if( m_hasDate2 )
00313         {
00314             DDV_MinChars(pDX, m_date2, 1);
00315         }
00316     }
00317
00318     if( !pDX->m_bSaveAndValidate )
00319     {
00320         OnMerge();
00321     }
00322
00323     DDX_ComboMString(pDX, IDC_COMBOREV, m_rev1Combo);
00324     DDX_ComboMString(pDX, IDC_COMBOREV2, m_rev2Combo);
00325     DDX_ComboMString(pDX, IDC_COMBODATE1, m_date1Combo);
00326     DDX_ComboMString(pDX, IDC_COMBODATE2, m_date2Combo);
00327 }
00328
00329 void CUpdateMerge::OnMerge()
00330 {
00331     CButton* chkMerge1 = (CButton*)GetDlgItem(IDC_MERGE1);
00332     CButton* chkMerge2 = (CButton*)GetDlgItem(IDC_MERGE2);
00333     CWnd* wndRev1 = GetDlgItem(IDC_COMBOREV);
00334     CWnd* wndRev2 = GetDlgItem(IDC_COMBOREV2);
00335     CWnd* wndBrowseTag1 = GetDlgItem(IDC_BROWSE_TAG1);
00336     CWnd* wndBrowseTag2 = GetDlgItem(IDC_BROWSE_TAG2);
00337
00338     CButton* chkDate1 = (CButton*)GetDlgItem(IDC_CHECKDATE1);
00339     CButton* chkDate2 = (CButton*)GetDlgItem(IDC_CHECKDATE2);
00340     CWnd* wndDate1 = GetDlgItem(IDC_COMBODATE1);
00341     CWnd* wndDate2 = GetDlgItem(IDC_COMBODATE2);
00342
00343     if( chkMerge1->GetCheck() == 1 )
00344     {
00345         wndRev1->EnableWindow(TRUE);
00346         wndRev2->EnableWindow(FALSE);
00347         wndBrowseTag1->EnableWindow(TRUE);
00348         wndBrowseTag2->EnableWindow(FALSE);
00349     }
00350     else if( chkMerge2->GetCheck() == 1 )
00351     {
00352         wndRev1->EnableWindow(TRUE);
00353         wndRev2->EnableWindow(TRUE);
00354         wndBrowseTag1->EnableWindow(TRUE);
00355         wndBrowseTag2->EnableWindow(TRUE);
00356     }
00357     else
00358     {
00359         wndRev1->EnableWindow(FALSE);
00360         wndRev2->EnableWindow(FALSE);
00361         wndBrowseTag1->EnableWindow(FALSE);
00362         wndBrowseTag2->EnableWindow(FALSE);
00363     }
00364
00365     chkDate1->EnableWindow(wndRev1->IsWindowEnabled());
00366     chkDate2->EnableWindow(wndRev2->IsWindowEnabled());
00367     wndDate1->EnableWindow(wndRev1->IsWindowEnabled() && chkDate1->GetCheck());
00368     wndDate2->EnableWindow(wndRev2->IsWindowEnabled() && chkDate2->GetCheck());
00369 }
00370
00371 void CUpdateMerge::OnMerge1()
00372 {
00373     OnMerge();
00374 }
00375
00376 void CUpdateMerge::OnMerge2()
00377 {
00378     OnMerge();
00379 }
00380
00381 void CUpdateMerge::OnCheckdate1()
00382 {
00383     OnMerge();
00384 }
00385
00386 void CUpdateMerge::OnCheckdate2()
00387 {
00388     OnMerge();
00389 }
00390
00391 void CUpdateMerge::OnBrowseTag1()
00392 {
00393     CStr tagName;
00394     if( CompatGetTagListItem(m_mf, tagName) )
00395     {
00396         m_rev1 = (const char*)tagName;
00397         m_rev1Combo.SetWindowText(m_rev1);
00398     }
00399 }
00400
00401 void CUpdateMerge::OnBrowseTag2()
00402 {
00403     CStr tagName;
00404     if( CompatGetTagListItem(m_mf, tagName) )
00405     {
00406         m_rev2 = (const char*)tagName;
00407         m_rev2Combo.SetWindowText(m_rev2);
00408     }
00409 }
00410
00411 BEGIN_MESSAGE_MAP(CUpdateMerge, CPropertyPage)
00412     //{{AFX_MSG_MAP(CUpdateMerge)
00413     ON_BN_CLICKED(IDC_MERGE, OnMerge)
00414     ON_BN_CLICKED(IDC_MERGE1, OnMerge1)
00415     ON_BN_CLICKED(IDC_MERGE2, OnMerge2)
00416     ON_BN_CLICKED(IDC_CHECKDATE1, OnCheckdate1)
00417     ON_BN_CLICKED(IDC_CHECKDATE2, OnCheckdate2)
00418     ON_BN_CLICKED(IDC_BROWSE_TAG1, OnBrowseTag1)
00419     ON_BN_CLICKED(IDC_BROWSE_TAG2, OnBrowseTag2)
00420     //}}AFX_MSG_MAP
00421 END_MESSAGE_MAP()
00422
00423 #endif /* WIN32 */
00424
00425 #ifdef qMacCvsPP
00426 static void DoDataExchange_UpdateMerge(LWindow *theDialog, const MultiFiles* mf,
00427     bool & merge1, bool & merge2,
00428     CPStr & sLastRev1, CPStr & sLastRev2, bool putValue)
00429 {
00430     LRadioButton *chkHasRev = dynamic_cast<LRadioButton*>
00431         (theDialog->FindPaneByID(item_CheckRevTag1));
00432     LEditText *editRev = dynamic_cast<LEditText*>
00433         (theDialog->FindPaneByID(item_EditRevTag1));
00434     LRadioButton *chkHasRev2 = dynamic_cast<LRadioButton*>
00435         (theDialog->FindPaneByID(item_CheckRevTag2));
00436     LEditText *editRev2 = dynamic_cast<LEditText*>
00437         (theDialog->FindPaneByID(item_EditRevTag2));
00438     LPopupFiller *fill1 = dynamic_cast<LPopupFiller*>
00439         (theDialog->FindPaneByID(item_FillerRev1));
00440     LPopupFiller *fill2 = dynamic_cast<LPopupFiller*>
00441         (theDialog->FindPaneByID(item_FillerRev2));
00442
00443     LTagWrapper *wrapper1 = putValue ? NEW LTagWrapper(fill1, mf) : 0L;
00444     fill1->DoDataExchange(gRevNames, putValue, wrapper1);
00445     LTagWrapper *wrapper2 = putValue ? NEW LTagWrapper(fill2, mf) : 0L;
00446     fill2->DoDataExchange(gRevNames, putValue, wrapper2);
00447
00448     if(putValue)
00449     {
00450         if(merge1 && merge2)
00451             theDialog->SetValueForPaneID (item_CheckRevTag2, Button_On);
00452         else if(merge1)
00453             theDialog->SetValueForPaneID (item_CheckRevTag1, Button_On);
00454         else
00455             theDialog->SetValueForPaneID (item_MergeNone, Button_On);
00456
00457         editRev->SetText((Ptr)(const char *)sLastRev1, sLastRev1.length());
00458         editRev2->SetText((Ptr)(const char *)sLastRev2, sLastRev2.length());
00459     }
00460     else
00461     {
00462         if(theDialog->GetValueForPaneID(item_CheckRevTag2) == Button_On)
00463         {
00464             merge1 = merge2 = true;
00465         }
00466         else if (theDialog->GetValueForPaneID(item_CheckRevTag1) == Button_On)
00467         {
00468             merge1 = true;
00469             merge2 = false;
00470         }
00471         else
00472         {
00473             merge1 = merge2 = false;
00474         }
00475
00476         char str[255];
00477         Size len;
00478
00479         editRev->GetText(str, 254, &len);
00480         sLastRev1.set(str, len);
00481         editRev2->GetText(str, 254, &len);
00482         sLastRev2.set(str, len);
00483     }
00484 }
00485
00486 static void DoDataExchange_UpdateSticky(LWindow *theDialog, const MultiFiles* mf,
00487     bool & hasDate, bool & hasRev,
00488     CPStr & sLastDate, CPStr & sLastRev, bool & useMostRecent, bool putValue)
00489 {
00490     LCheckBox *chkHasDate = dynamic_cast<LCheckBox*>
00491         (theDialog->FindPaneByID(item_CheckDate));
00492     LCheckBox *chkHasRev = dynamic_cast<LCheckBox*>
00493         (theDialog->FindPaneByID(item_CheckRevTag));
00494     LCheckBox *chkMostRecent = dynamic_cast<LCheckBox*>
00495         (theDialog->FindPaneByID(item_MostRecentRev));
00496     LEditText *editDate = dynamic_cast<LEditText*>
00497         (theDialog->FindPaneByID(item_EditDate));
00498     LEditText *editRev = dynamic_cast<LEditText*>
00499         (theDialog->FindPaneByID(item_EditRevTag));
00500     LPopupFiller *fillTag = dynamic_cast<LPopupFiller*>
00501         (theDialog->FindPaneByID(item_FillerTag));
00502     LPopupFiller *fillDate = dynamic_cast<LPopupFiller*>
00503         (theDialog->FindPaneByID(item_FillerDate));
00504
00505     LTagWrapper *wrapper = putValue ? NEW LTagWrapper(fillTag, mf) : 0L;
00506     fillTag->DoDataExchange(gRevNames, putValue, wrapper);
00507     fillDate->DoDataExchange(gDateNames, putValue);
00508
00509     if(putValue)
00510     {
00511         chkHasDate->SetValue(hasDate ? Button_On : Button_Off);
00512         chkHasRev->SetValue(hasRev ? Button_On : Button_Off);
00513         chkMostRecent->SetValue(useMostRecent ? Button_On : Button_Off);
00514         editDate->SetText((Ptr)(const char *)sLastDate, sLastDate.length());
00515         editRev->SetText((Ptr)(const char *)sLastRev, sLastRev.length());
00516     }
00517     else
00518     {
00519         hasDate = chkHasDate->GetValue() == Button_On;
00520         hasRev = chkHasRev->GetValue() == Button_On;
00521         useMostRecent = chkMostRecent->GetValue() == Button_On;
00522
00523         char str[255];
00524         Size len;
00525
00526         editDate->GetText(str, 254, &len);
00527         sLastDate.set(str, len);
00528         editRev->GetText(str, 254, &len);
00529         sLastRev.set(str, len);
00530     }
00531 }
00532
00533 static void DoDataExchange_UpdateSettings(LWindow *theDialog, bool & toStdout, bool & noRecurs,
00534     bool & resetSticky, bool & createMissDir, bool & getCleanCopy, bool putValue)
00535 {
00536     DoDataExchange (theDialog, item_NoRecurs, noRecurs, putValue);
00537     DoDataExchange (theDialog, item_ToStout, toStdout, putValue);
00538     DoDataExchange (theDialog, item_ResetSticky, resetSticky, putValue);
00539     DoDataExchange (theDialog, item_CreateMissDir, createMissDir, putValue);
00540     DoDataExchange (theDialog, item_GetCleanCopy, getCleanCopy, putValue);
00541
00542 }
00543 #endif /* qMacCvsPP */
00544
00545 #if qUnix
00546 class UCvsUpdate : public UWidget
00547 {
00548     UDECLARE_DYNAMIC(UCvsUpdate)
00549 public:
00550     UCvsUpdate() : UWidget(::UEventGetWidID()) {}
00551     virtual ~UCvsUpdate() {}
00552
00553     enum
00554     {
00555         kOK = EV_COMMAND_START, // 0
00556         kCancel,                // 1
00557         kTabGeneral             // 2
00558     };
00559
00560     virtual void DoDataExchange(bool fill);
00561
00562 protected:
00563     ev_msg int OnOK(void);
00564     ev_msg int OnCancel(void);
00565
00566     UDECLARE_MESSAGE_MAP()
00567 };
00568
00569 UIMPLEMENT_DYNAMIC(UCvsUpdate, UWidget)
00570
00571 UBEGIN_MESSAGE_MAP(UCvsUpdate, UWidget)
00572     ON_UCOMMAND(UCvsUpdate::kOK, UCvsUpdate::OnOK)
00573     ON_UCOMMAND(UCvsUpdate::kCancel, UCvsUpdate::OnCancel)
00574 UEND_MESSAGE_MAP()
00575
00576 int UCvsUpdate::OnOK(void)
00577 {
00578     EndModal(true);
00579     return 0;
00580 }
00581
00582 int UCvsUpdate::OnCancel(void)
00583 {
00584     EndModal(false);
00585     return 0;
00586 }
00587
00588 void UCvsUpdate::DoDataExchange(bool fill)
00589 {
00590     if(fill)
00591     {
00592     }
00593     else
00594     {
00595     }
00596 }
00597
00598 class UCvsUpdate_MAIN : public UWidget
00599 {
00600     UDECLARE_DYNAMIC(UCvsUpdate_MAIN)
00601 public:
00602     UCvsUpdate_MAIN() : UWidget(::UEventGetWidID()) {}
00603     virtual ~UCvsUpdate_MAIN() {}
00604
00605     enum
00606     {
00607         kCheckStdout = EV_COMMAND_START,    // 0
00608         kCheckRecurse,          // 1
00609         kCheckReset,            // 2
00610         kCheckMissing,          // 3
00611         kGetCleanCopy           // 4
00612     };
00613
00614     virtual void DoDataExchange(bool fill);
00615
00616     bool m_toStdout;
00617     bool m_noRecurs;
00618     bool m_resetSticky;
00619     bool m_createMissDir;
00620     bool m_getCleanCopy;
00621 protected:
00622
00623     UDECLARE_MESSAGE_MAP()
00624 };
00625
00626 UIMPLEMENT_DYNAMIC(UCvsUpdate_MAIN, UWidget)
00627
00628 UBEGIN_MESSAGE_MAP(UCvsUpdate_MAIN, UWidget)
00629 UEND_MESSAGE_MAP()
00630
00631 void UCvsUpdate_MAIN::DoDataExchange(bool fill)
00632 {
00633     if(fill)
00634     {
00635         m_toStdout = false;
00636         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckStdout, m_toStdout), 0L);
00637         m_noRecurs = false;
00638         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRecurse, m_noRecurs), 0L);
00639         m_resetSticky = false;
00640         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckReset, m_resetSticky), 0L);
00641         m_createMissDir = false;
00642         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMissing, m_createMissDir), 0L);
00643         m_getCleanCopy = false;
00644         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kGetCleanCopy, m_getCleanCopy), 0L);
00645     }
00646     else
00647     {
00648         m_toStdout = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckStdout, 0L) != 0;
00649         m_noRecurs = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRecurse, 0L) != 0;
00650         m_resetSticky = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckReset, 0L) != 0;
00651         m_createMissDir = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMissing, 0L) != 0;
00652         m_getCleanCopy = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kGetCleanCopy, 0L) != 0;
00653     }
00654 }
00655
00656 class UCvsUpdate_STICKY : public UWidget
00657 {
00658     UDECLARE_DYNAMIC(UCvsUpdate_STICKY)
00659 public:
00660     UCvsUpdate_STICKY(const char *rev, const char *date);
00661     virtual ~UCvsUpdate_STICKY() {}
00662
00663     enum
00664     {
00665         kCheckDate = EV_COMMAND_START,  // 0
00666         kComboDate,         // 1
00667         kCheckRev,          // 2
00668         kComboRev,          // 3
00669         kCheckMatch         // 4
00670     };
00671
00672     virtual void DoDataExchange(bool fill);
00673
00674     UStr m_date;
00675     UStr m_rev;
00676     bool m_hasdate;
00677     bool m_hasrev;
00678     bool m_match;
00679 protected:
00680
00681     ev_msg int OnDate(void);
00682     ev_msg int OnRev(void);
00683
00684     UDECLARE_MESSAGE_MAP()
00685 };
00686
00687 UIMPLEMENT_DYNAMIC(UCvsUpdate_STICKY, UWidget)
00688
00689 UBEGIN_MESSAGE_MAP(UCvsUpdate_STICKY, UWidget)
00690     ON_UCOMMAND(UCvsUpdate_STICKY::kCheckDate, UCvsUpdate_STICKY::OnDate)
00691     ON_UCOMMAND(UCvsUpdate_STICKY::kCheckRev, UCvsUpdate_STICKY::OnRev)
00692 UEND_MESSAGE_MAP()
00693
00694 UCvsUpdate_STICKY::UCvsUpdate_STICKY(const char *rev, const char *date) : UWidget(::UEventGetWidID())
00695 {
00696     m_date = date;
00697     m_rev = rev;
00698     m_hasdate = false;
00699     m_hasrev = false;
00700     m_match = false;
00701 }
00702
00703 int UCvsUpdate_STICKY::OnDate()
00704 {
00705     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00706     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboDate, state), 0L);
00707     return 0;
00708 }
00709
00710 int UCvsUpdate_STICKY::OnRev()
00711 {
00712     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00713     UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev, state), 0L);
00714     return 0;
00715 }
00716
00717 void UCvsUpdate_STICKY::DoDataExchange(bool fill)
00718 {
00719     ::DoDataExchange(fill, GetWidID(), kComboRev, gRevNames);
00720     ::DoDataExchange(fill, GetWidID(), kComboDate, gDateNames);
00721
00722     if(fill)
00723     {
00724         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckDate, m_hasdate), 0L);
00725         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckRev, m_hasrev), 0L);
00726         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kCheckMatch, m_match), 0L);
00727
00728         OnDate();
00729         OnRev();
00730     }
00731     else
00732     {
00733         m_hasdate = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckDate, 0L);
00734         m_hasrev = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckRev, 0L);
00735         m_match = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kCheckMatch, 0L);
00736
00737         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboDate, &m_date);
00738         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev, &m_rev);
00739     }
00740 }
00741
00742 class UCvsUpdate_MERGE : public UWidget
00743 {
00744     UDECLARE_DYNAMIC(UCvsUpdate_MERGE)
00745 public:
00746     UCvsUpdate_MERGE(const char *rev1, const char *rev2);
00747     virtual ~UCvsUpdate_MERGE() {}
00748
00749     enum
00750     {
00751         kRadioNone = EV_COMMAND_START,  // 0
00752         kRadioMerge1,       // 1
00753         kRadioMerge2,       // 2
00754         kComboRev1,         // 3
00755         kComboRev2          // 4
00756     };
00757
00758     virtual void DoDataExchange(bool fill);
00759
00760     UStr m_rev1;
00761     UStr m_rev2;
00762     int m_merge;
00763 protected:
00764
00765     ev_msg int OnMerge(int cmd);
00766
00767     UDECLARE_MESSAGE_MAP()
00768 };
00769
00770 UIMPLEMENT_DYNAMIC(UCvsUpdate_MERGE, UWidget)
00771
00772 UBEGIN_MESSAGE_MAP(UCvsUpdate_MERGE, UWidget)
00773     ON_UCOMMAND_RANGE(UCvsUpdate_MERGE::kRadioNone, UCvsUpdate_MERGE::kRadioMerge2, UCvsUpdate_MERGE::OnMerge)
00774 UEND_MESSAGE_MAP()
00775
00776 UCvsUpdate_MERGE::UCvsUpdate_MERGE(const char *rev1, const char *rev2) : UWidget(::UEventGetWidID())
00777 {
00778     m_rev1 = rev1;
00779     m_rev2 = rev2;
00780     m_merge = 0;
00781 }
00782
00783 int UCvsUpdate_MERGE::OnMerge(int cmd)
00784 {
00785     int state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioNone, 0L);
00786     if(state)
00787     {
00788         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 0), 0L);
00789         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, 0), 0L);
00790     }
00791     else
00792     {
00793         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev1, 1), 0L);
00794         state = UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioMerge1, 0L);
00795         UEventSendMessage(GetWidID(), EV_ENABLECMD, UMAKEINT(kComboRev2, state == 0), 0L);
00796     }
00797     return 0;
00798 }
00799
00800 void UCvsUpdate_MERGE::DoDataExchange(bool fill)
00801 {
00802     ::DoDataExchange(fill, GetWidID(), kComboRev1, gRevNames);
00803     ::DoDataExchange(fill, GetWidID(), kComboRev2, gRevNames);
00804
00805     if(fill)
00806     {
00807         UEventSendMessage(GetWidID(), EV_SETSTATE, UMAKEINT(kRadioNone + m_merge, 1), 0L);
00808
00809         OnMerge(kRadioNone + m_merge);
00810     }
00811     else
00812     {
00813         if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioNone, 0L))
00814             m_merge = 0;
00815         else if(UEventSendMessage(GetWidID(), EV_QUERYSTATE, kRadioMerge1, 0L))
00816             m_merge = 1;
00817         else
00818             m_merge = 2;
00819
00820         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev1, &m_rev1);
00821         UEventSendMessage(GetWidID(), EV_GETTEXT, kComboRev2, &m_rev2);
00822     }
00823 }
00824 #endif // qUnix
00825
00827 bool CompatGetUpdate(const MultiFiles* mf,
00828                      bool& toStdout, bool& noRecurs, bool& resetSticky,
00829                      CPStr& date, CPStr& rev,
00830                      bool& useMostRecent,
00831                      CPStr& rev1, CPStr& rev2,
00832                      bool& createMissDir,
00833                      bool& getCleanCopy,
00834                      CPStr& keyword)
00835 {
00836     bool userHitOK = false;
00837
00838     static CPStr sLastDate;
00839     static CPStr sLastRev;
00840     static CPStr sLastRev1;
00841     static CPStr sLastRev2;
00842     static CPStr sLastDate1;
00843     static CPStr sLastDate2;
00844
00845     bool hasDate = false;
00846     bool hasRev = false;
00847     bool merge1 = false;
00848     bool merge2 = false;
00849     bool hasDate1 = false;
00850     bool hasDate2 = false;
00851
00852     date = "";
00853     rev = "";
00854     rev1 = "";
00855     rev2 = "";
00856     toStdout = false;
00857     noRecurs = false;
00858     resetSticky = false;
00859     useMostRecent = false;
00860     createMissDir = false;
00861     getCleanCopy = false;
00862     keyword = "";
00863
00864 #ifdef WIN32
00865     COptionalPropertySheet pages(gCvsPrefs.HideCommandDlgUpdate(), _i18n("Update settings"));
00866     pages.m_psh.dwFlags |= PSH_NOAPPLYNOW;
00867     CUpdateMain page1;
00868     CUpdateSticky page2(mf, sLastRev, sLastDate, keyword);
00869     CUpdateMerge page3(mf, false, sLastRev1, sLastRev2, sLastDate1, sLastDate2);
00870     CGetPrefs_GLOBALS page4;
00871     pages.AddPage(&page1);
00872     pages.AddPage(&page2);
00873     pages.AddPage(&page3);
00874     pages.AddPage(&page4);
00875     if(pages.DoModal() == IDOK)
00876     {
00877         toStdout = page1.m_stdout == TRUE;
00878         noRecurs = page1.m_norecurs == TRUE;
00879         resetSticky = page1.m_delsticky == TRUE;
00880         createMissDir = page1.m_createmissdir == TRUE;
00881         getCleanCopy = page1.m_getcleancopy == TRUE;
00882
00883         sLastDate = page2.m_date;
00884         sLastRev = page2.m_rev;
00885         hasDate = page2.m_hasdate == TRUE;
00886         hasRev = page2.m_hasrev == TRUE;
00887         useMostRecent = page2.m_match == TRUE;
00888         keyword = page2.m_keyword;
00889
00890         merge1 = page3.m_merge >= 1;
00891         merge2 = page3.m_merge == 2;
00892         sLastRev1 = page3.m_rev1;
00893         sLastRev2 = page3.m_rev2;
00894         hasDate1 = page3.m_hasDate1 == TRUE;
00895         hasDate2 = page3.m_hasDate2 == TRUE;
00896         sLastDate1 = page3.m_date1;
00897         sLastDate2 = page3.m_date2;
00898
00899         page4.StoreValues();
00900         gCvsPrefs.SetHideCommandDlgUpdate(pages.GetHideCommandDlg());
00901         userHitOK = true;
00902     }
00903 #endif /* WIN32 */
00904 #ifdef qMacCvsPP
00905     StOptionalDialogHandler theHandler(dlg_Update, gCvsPrefs.HideCommandDlgUpdate(), LCommander::GetTopCommander());
00906     LWindow *theDialog = theHandler.GetDialog();
00907     ThrowIfNil_(theDialog);
00908     static UInt16 sRuntimePanel = 1;
00909
00910     LMultiPanelView *multiView = dynamic_cast<LMultiPanelView*>
00911         (theDialog->FindPaneByID(item_MultiViewPrefs));
00912     LPane *groupView = theDialog->FindPaneByID(item_GroupViewPrefs);
00913
00914     multiView->SwitchToPanel(4);
00915     DoDataExchange_Globals(theDialog, true);
00916     multiView->SwitchToPanel(3);
00917     DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, true);
00918     multiView->SwitchToPanel(2);
00919     DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, true);
00920     multiView->SwitchToPanel(1);
00921     DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, true);
00922
00923     groupView->SetValue(sRuntimePanel);
00924
00925     theHandler.ShowDialog();
00926     MessageT hitMessage;
00927     while (true)
00928     {       // Let DialogHandler process events
00929         hitMessage = theHandler.DoDialog();
00930
00931         if (hitMessage == msg_OK || hitMessage == msg_Cancel)
00932             break;
00933     }
00934     theDialog->Hide();
00935     sRuntimePanel = groupView->GetValue();
00936
00937     if(hitMessage == msg_OK)
00938     {
00939         multiView->SwitchToPanel(1);
00940         DoDataExchange_UpdateSettings(theDialog, toStdout, noRecurs, resetSticky, createMissDir, getCleanCopy, false);
00941         multiView->SwitchToPanel(2);
00942         DoDataExchange_UpdateSticky(theDialog, mf, hasDate, hasRev, sLastDate, sLastRev, useMostRecent, false);
00943         multiView->SwitchToPanel(3);
00944         DoDataExchange_UpdateMerge(theDialog, mf, merge1, merge2, sLastRev1, sLastRev2, false);
00945         multiView->SwitchToPanel(4);
00946         DoDataExchange_Globals(theDialog, false);
00947         gCvsPrefs.SetHideCommandDlgUpdate(theHandler.GetHideCommandDlg());
00948         userHitOK = true;
00949     }
00950 #endif /* qMacCvsPP */
00951 #if qUnix
00952     void *wid;
00953 #   if qGTK
00954     wid = UCreate_UpdateDlg();
00955 #   endif
00956
00957     UCvsUpdate *dlg = new UCvsUpdate();
00958     UCvsUpdate_MAIN *tab1 = new UCvsUpdate_MAIN();
00959     UCvsUpdate_STICKY *tab2 = new UCvsUpdate_STICKY(sLastRev, sLastDate);
00960     UCvsUpdate_MERGE *tab3 = new UCvsUpdate_MERGE(sLastRev1, sLastRev2);
00961     UEventSendMessage(dlg->GetWidID(), EV_INIT_WIDGET, kUMainWidget, wid);
00962     dlg->AddPage(tab1, UCvsUpdate::kTabGeneral, 0);
00963     dlg->AddPage(tab2, UCvsUpdate::kTabGeneral, 1);
00964     dlg->AddPage(tab3, UCvsUpdate::kTabGeneral, 2);
00965
00966     if(dlg->DoModal())
00967     {
00968         toStdout = tab1->m_toStdout;
00969         noRecurs = tab1->m_noRecurs;
00970         resetSticky = tab1->m_resetSticky;
00971         createMissDir = tab1->m_createMissDir;
00972         getCleanCopy = tab1->m_getCleanCopy;
00973
00974         sLastDate = tab2->m_date;
00975         sLastRev = tab2->m_rev;
00976         hasDate = tab2->m_hasdate;
00977         hasRev = tab2->m_hasrev;
00978         useMostRecent = tab2->m_match;
00979
00980         merge1 = tab3->m_merge >= 1;
00981         merge2 = tab3->m_merge == 2;
00982         sLastRev1 = tab3->m_rev1;
00983         sLastRev2 = tab3->m_rev2;
00984
00985         userHitOK = true;
00986     }
00987
00988     delete dlg;
00989 #endif // qUnix
00990
00991     if( userHitOK )
00992     {
00993         if( hasDate && !sLastDate.empty() )
00994             date = sLastDate;
00995
00996         if( hasRev && !sLastRev.empty() )
00997             rev = sLastRev;
00998
00999         if( merge1 && merge2 && !sLastRev1.empty() && !sLastRev2.empty() )
01000         {
01001             rev1 = sLastRev1;
01002             rev2 = sLastRev2;
01003
01004             if( hasDate1 )
01005                 rev1 << ":" << sLastDate1;
01006
01007             if( hasDate2 )
01008                 rev2 << ":" << sLastDate2;
01009         }
01010
01011         if( merge1 && !merge2 && !sLastRev1.empty() )
01012         {
01013             rev1 = sLastRev1;
01014
01015             if( hasDate1 )
01016                 rev1 << ":" << sLastDate1;
01017         }
01018
01019         gCvsPrefs.save();
01020     }
01021
01022     return userHitOK;
01023 }
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 #include "KeywordComboBox.h"
00036
00037 class MultiFiles;
00038
00039 bool CompatGetUpdate(const MultiFiles* mf,
00040                      bool& toStdout, bool& noRecurs, bool& resetSticky,
00041                      CPStr& date, CPStr& rev,
00042                      bool& useMostRecent,
00043                      CPStr& rev1, CPStr& rev2,
00044                      bool& createMissDir,
00045                      bool& getCleanCopy,
00046                      CPStr& keyword);
00047
00048 // persistent default values for the dates, tags...
00049 extern CMString gRevNames;
00050 extern CMString gReleasesNames;
00051 extern CMString gDateNames;
00052 extern CMString gDateOrRevNames;
00053
00054 #ifdef WIN32
00055 class CUpdateMain : public CPropertyPage
00056 {
00057     DECLARE_DYNAMIC(CUpdateMain)
00058
00059 // Construction
00060 public:
00061     CUpdateMain();
00062     ~CUpdateMain();
00063
00064 // Dialog Data
00065     //{{AFX_DATA(CUpdateMain)
00066     enum { IDD = IDD_UPDATE_MAIN };
00067     BOOL    m_delsticky;
00068     BOOL    m_norecurs;
00069     BOOL    m_stdout;
00070     BOOL    m_createmissdir;
00071     BOOL    m_getcleancopy;
00072     //}}AFX_DATA
00073
00074
00075 // Overrides
00076     // ClassWizard generate virtual function overrides
00077     //{{AFX_VIRTUAL(CUpdateMain)
00078     protected:
00079     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00080     //}}AFX_VIRTUAL
00081
00082 // Implementation
00083 protected:
00084     // Generated message map functions
00085     //{{AFX_MSG(CUpdateMain)
00086         // NOTE: the ClassWizard will add member functions here
00087     //}}AFX_MSG
00088     DECLARE_MESSAGE_MAP()
00089
00090 };
00091
00092 class CUpdateMerge : public CPropertyPage
00093 {
00094     DECLARE_DYNAMIC(CUpdateMerge)
00095
00096 // Construction
00097 public:
00098     CUpdateMerge(const MultiFiles* mf,
00099         bool isCheckout,
00100         const char* rev1, const char* rev2, const char* date1, const char* date2);
00101     ~CUpdateMerge();
00102
00103 // Dialog Data
00104     //{{AFX_DATA(CUpdateMerge)
00105     enum { IDD = IDD_UPDATE_MERGE };
00106     CSmartComboBox  m_date2Combo;
00107     CSmartComboBox  m_date1Combo;
00108     CSmartComboBox  m_rev2Combo;
00109     CSmartComboBox  m_rev1Combo;
00110     CString m_rev1;
00111     CString m_rev2;
00112     int m_merge;
00113     BOOL    m_hasDate1;
00114     BOOL    m_hasDate2;
00115     CString m_date1;
00116     CString m_date2;
00117     //}}AFX_DATA
00118
00119
00120 // Overrides
00121     // ClassWizard generate virtual function overrides
00122     //{{AFX_VIRTUAL(CUpdateMerge)
00123     protected:
00124     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00125     //}}AFX_VIRTUAL
00126
00127 // Implementation
00128 protected:
00129     // Generated message map functions
00130     //{{AFX_MSG(CUpdateMerge)
00131     afx_msg void OnMerge();
00132     afx_msg void OnMerge1();
00133     afx_msg void OnMerge2();
00134     afx_msg void OnCheckdate1();
00135     afx_msg void OnCheckdate2();
00136     afx_msg void OnBrowseTag1();
00137     afx_msg void OnBrowseTag2();
00138     //}}AFX_MSG
00139     DECLARE_MESSAGE_MAP()
00140 private:
00141     const MultiFiles* m_mf;
00142     bool m_isCheckout;
00143 };
00144
00145 class CUpdateSticky : public CPropertyPage
00146 {
00147     DECLARE_DYNAMIC(CUpdateSticky)
00148
00149 // Construction
00150 public:
00151     CUpdateSticky(const MultiFiles* mf,
00152         const char* rev, const char* date, const char* keyword);
00153     ~CUpdateSticky();
00154
00155 // Dialog Data
00156     //{{AFX_DATA(CUpdateSticky)
00157     enum { IDD = IDD_UPDATE_STICKY };
00158     CKeywordComboBox    m_keywordCombo;
00159     CStatic m_keywordDescStatic;
00160     CSmartComboBox  m_dateCombo;
00161     CSmartComboBox  m_revCombo;
00162     CString m_date;
00163     CString m_rev;
00164     BOOL    m_hasdate;
00165     BOOL    m_hasrev;
00166     BOOL    m_match;
00167     CString m_keyword;
00168     //}}AFX_DATA
00169
00170
00171 // Overrides
00172     // ClassWizard generate virtual function overrides
00173     //{{AFX_VIRTUAL(CUpdateSticky)
00174     protected:
00175     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00176     //}}AFX_VIRTUAL
00177
00178 // Implementation
00179 protected:
00180     // Generated message map functions
00181     //{{AFX_MSG(CUpdateSticky)
00182     afx_msg void OnDate();
00183     afx_msg void OnRev();
00184     afx_msg void OnBrowseTag();
00185     virtual BOOL OnInitDialog();
00186     //}}AFX_MSG
00187     DECLARE_MESSAGE_MAP()
00188 private:
00189     const MultiFiles* m_mf;
00190 };
00191
00192 //{{AFX_INSERT_LOCATION}}
00193 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
00194 #endif /* WIN32 */
00195
00196 #endif // !defined(AFX_UPDATEDLG_H__98CCBD22_845B_11D1_8949_444553540000__INCLUDED_)
Generated on Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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
00175         if(GTK_IS_DRAWING_AREA(widget))
00176         {
00177             m_drawable = GTK_DRAWING_AREA(widget)->widget.window;
00178             m_orig.x = 0;
00179             m_orig.y = 0;
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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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(TARGET_OS_MAC)
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 Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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     EV_CUSTOM_CLICK,    /* void OnCustimClick<Cmd>(void *drawInfo) */
00109
00110     /* tree */
00111     EV_TREE_RESETALL,   /* void OnTreeResetAll(int cmd) */
00112     EV_TREE_INSERT,     /* void OnTreeInsert(int cmd, UTREE_INSERT *data) */
00113     EV_TREE_GETINFO,    /* void OnTreeGetInfo(int cmd, UTREE_INFO *data) */
00114     EV_TREE_SETDATA,    /* void OnTreeSetData(int cmd, UTREE_INFO *data) */
00115     EV_TREE_SETICON,    /* void OnTreeSetIcon(int cmd, UTREE_INFO *data) */
00116     EV_TREE_DELETE,     /* void OnTreeDelete(int cmd, UTREEITEM item) */
00117     EV_TREE_EXPANDING,  /* void OnTreeExpanding<cmd>(int collapse, UTREEITEM item) */
00118     EV_TREE_SELECTING,  /* void OnTreeSelecting<cmd>(int deselecting, UTREEITEM item) */
00119     EV_TREE_EXPAND,     /* void OnTreeExpand(int cmd, int collapse, UTREEITEM item) */
00120     EV_TREE_SELECT,     /* void OnTreeSelect(int cmd, int deselect, UTREEITEM item) */
00121     EV_TREE_GETSEL,     /* void OnTreeGetSel(int cmd, UTREEITEM *item) */
00122
00123     /* list */
00124     EV_LIST_POPUP,          /* void OnListChange<Cmd>(int entry, const char *txt) */
00125     EV_LIST_SELECTING,      /* void OnListChange<Cmd>(int entry, const char *txt) */
00126     EV_LIST_SELCOLUMN,      /* void OnListSelColumn<Cmd>(int entry) */
00127     EV_LIST_RESORT,         /* void OnListResort(int cmd, int column, UListSorter s) */
00128     EV_LIST_SETSORTDIR,     /* void OnListSetSortDir(int cmd, int column, bool dir) */
00129     EV_LIST_DBLCLICK,       /* void OnListDblClick<Cmd>(void) */
00130     EV_LIST_RESETALL,       /* void OnListResetAll(int cmd) */
00131     EV_LIST_SETFEEDBACK,    /* void OnListSetFeedback(int cmd, int turnOn) */
00132     EV_LIST_ADDCOLUMNS,     /* void OnListAddColumns(int cmd, int num) */
00133     EV_LIST_SHOWCOLUMNS,    /* void OnListShowColumns(int cmd, int num) */
00134     EV_LIST_HIDECOLUMNS,    /* void OnListHideColumns(int cmd, int num) */
00135     EV_LIST_SETCOLTITLE,    /* void OnListSetColTitle(int cmd, int num, const char *title) */
00136     EV_LIST_SETCOLWIDTH,    /* void OnListSetColWidth(int cmd, int num, int width) */
00137     EV_LIST_NEWROW,         /* void OnListNewRow(int cmd, int *num) */
00138     EV_LIST_ROWSETDATA,     /* void OnListRowSetData(int cmd, int row, void *data) */
00139     EV_LIST_ROWGETDATA,     /* void OnListRowGetData(int cmd, int row, void **data) */
00140     EV_LIST_INSERT,         /* void OnListInsert(int cmd, ULIST_INSERT *data) */
00141     EV_LIST_ADDSEL,         /* void OnListAddSel(int cmd, int entry) */
00142     EV_LIST_DELROW,         /* void OnListDelRow(int cmd, int row) */
00143     EV_LIST_GETNEXTSEL,     /* int OnListGetNextSel(int cmd, int selectedCell) */
00144     EV_LIST_GETINFO,        /* void OnListGetInfo(int cmd, ULIST_INFO *data) */
00145     EV_LIST_GETNEXT,        /* int OnListGetNext(int cmd, int whichCell) */
00146
00147     /* combo */
00148     EV_COMBO_RESETALL,  /* void OnComboResetAll(int cmd) */
00149     EV_COMBO_APPEND,    /* void OnComboAppend(int cmd, const char *str) */
00150     EV_COMBO_SETSEL,    /* void OnComboSetPos(int cmd, int pos) */
00151     EV_COMBO_GETSEL,    /* int OnComboGetPos(int cmd, UStr *txt) */
00152     EV_COMBO_SEL,       /* void OnComboSel<Cmd>(int pos, const char *txt) */
00153     EV_COMBO_GETCOUNT,  /* int OnComboGetCount(int cmd) */
00154     EV_COMBO_DELSEL,    /* void OnComboDelSel(int cmd, int pos) */
00155     EV_COMBO_ENABLESEL, /* void OnComboEnableSel(int cmd, int pos, int state) */
00156     EV_COMBO_GETMENU,   /* void OnComboGetMenu(int cmd, UMENU *menu) */
00157
00158     /* smart combo (Win32 only at the moment)*/
00159     EV_SMARTCOMBO_SETFEATURE,   /* void OnSmartComboSetFeature(int cmd, int feature) */
00160     EV_SMARTCOMBO_SETITEMS  ,   /* void OnSmartComboSetItems(int cmd, CMString* items) */
00161     EV_SMARTCOMBO_SETREADONLY,  /* void OnSmartComboSetReadOnly(int cmd, bool readOnly) */
00162
00163     /* user defined */
00164     EV_COMMAND_START = 1000
00165 } UEventType;
00166
00167 #ifdef __cplusplus
00168
00169 #ifndef STD
00170 #   define STD std::
00171 #endif
00172
00173 class UCmdTarget;
00174 class UWidget;
00175 class UDragable;
00176 class UDropable;
00177
00178 typedef void (UCmdTarget::*UPMSG)(void);
00179 //{ #define ON_*
00180 #define ON_UCREATE(baseClass) \
00181     { EV_CREATE, epV_V, UMSG_NOEXT, 0, 0, \
00182         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnCreate },
00183
00184 #define ON_UDESTROY(baseClass) \
00185     { EV_DESTROY, epV_V, UMSG_NOEXT, 0, 0, \
00186         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnDestroy },
00187
00188 #define ON_UENTER(baseClass) \
00189     { EV_ENTER, epV_VP, UMSG_NOEXT, 0, 0, \
00190         (UPMSG)(void (UCmdTarget::*)(void *))&baseClass::OnEnter },
00191
00192 #define ON_ULEAVE(baseClass) \
00193     { EV_LEAVE, epV_V, UMSG_NOEXT, 0, 0, \
00194         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnLeave },
00195
00196 #define ON_UEXPOSE(baseClass) \
00197     { EV_EXPOSE, epV_V, UMSG_NOEXT, 0, 0, \
00198         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnExpose },
00199
00200 #define ON_UMMOVE(baseClass) \
00201     { EV_MMOVE, epV_iii, UMSG_NOEXT, 0, 0, \
00202         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnMouseMove },
00203
00204 #define ON_UBTNDOWN(baseClass) \
00205     { EV_BTNDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
00206         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDown },
00207
00208 #define ON_UBTNUP(baseClass) \
00209     { EV_BTNUP, epV_iii, UMSG_NOEXT, 0, 0, \
00210         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnUp },
00211
00212 #define ON_UBTNDBLDOWN(baseClass) \
00213     { EV_BTNDBLDOWN, epV_iii, UMSG_NOEXT, 0, 0, \
00214         (UPMSG)(void (UCmdTarget::*)(int x, int y, int mod))&baseClass::OnBtnDblDown },
00215
00216 #define ON_KEYDOWN(baseClass) \
00217     { EV_KEYDOWN, epV_i, UMSG_NOEXT, 0, 0, \
00218         (UPMSG)(void (UCmdTarget::*)(int c))&baseClass::OnKeyDown },
00219
00220 #define ON_RESIZE(cmd, hook) \
00221     { EV_RESIZE, epV_VP, UMSG_RANGE, cmd, cmd, \
00222         (UPMSG)(void (UCmdTarget::*)(const URECT * r))&hook },
00223
00224 #define ON_SETCURSOR(baseClass) \
00225     { EV_SETCURSOR, epV_V, UMSG_NOEXT, 0, 0, \
00226         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnSetCursor },
00227
00228 #define ON_CHGCURSOR(baseClass, cmdmin, cmdmax) \
00229     { EV_CHGCURSOR, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00230         (UPMSG)(void (UCmdTarget::*)(int cmd, UCURSOR cursor))&baseClass::OnChgCursor },
00231
00232 #define ON_TB_INIT(baseClass) \
00233     { EV_TB_INIT, epV_VP, UMSG_NOEXT, 0, 0, \
00234         (UPMSG)(void (UCmdTarget::*)(UTB_INIT *info))&baseClass::OnTbInit },
00235
00236 #define ON_TB_END(baseClass) \
00237     { EV_TB_END, epV_V, UMSG_NOEXT, 0, 0, \
00238         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbEnd },
00239
00240 #define ON_TB_BUTTON(baseClass) \
00241     { EV_TB_BUTTON, epV_VP, UMSG_NOEXT, 0, 0, \
00242         (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbButton },
00243
00244 #define ON_TB_DROPDOWN(baseClass) \
00245     { EV_TB_DROPDOWN, epV_VP, UMSG_NOEXT, 0, 0, \
00246         (UPMSG)(void (UCmdTarget::*)(UTB_DROPDOWN *info))&baseClass::OnTbDropDown },
00247
00248 #define ON_TB_CHECKBTN(baseClass) \
00249     { EV_TB_CHECKBTN, epV_VP, UMSG_NOEXT, 0, 0, \
00250         (UPMSG)(void (UCmdTarget::*)(UTB_BUTTON *info))&baseClass::OnTbCheckBtn },
00251
00252 #define ON_TB_GETCOLOR(baseClass) \
00253     { EV_TB_GETCOLOR, epV_iVP, UMSG_NOEXT, 0, 0, \
00254         (UPMSG)(void (UCmdTarget::*)(int cmd, float *color))&baseClass::OnTbGetColor },
00255
00256 #define ON_TB_SEPARATOR(baseClass) \
00257     { EV_TB_SEPARATOR, epV_V, UMSG_NOEXT, 0, 0, \
00258         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnTbSeparator },
00259
00260 #define ON_UCOMMAND(cmd, hook) \
00261     { EV_CMD, epi_V, UMSG_RANGE, cmd, cmd, \
00262         (UPMSG)(int (UCmdTarget::*)(void))&hook },
00263
00264 #define ON_UCOMMAND_RANGE(cmdmin, cmdmax, hook) \
00265     { EV_CMD, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00266         (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },
00267
00268 #define ON_UCOMMAND_RANGEEX(cmdmin, cmdmax, hook) \
00269     { EV_CMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00270         (UPMSG)(int (UCmdTarget::*)(int cmd, void *data))&hook },
00271
00272 #define ON_UUPDATECMD(cmd, hook) \
00273     { EV_UPDTCMD, epV_VP, UMSG_RANGE, cmd, cmd, \
00274         (UPMSG)(void (UCmdTarget::*)(UCmdUI *pCmdUI))&hook },
00275
00276 #define ON_FETCHCMD(baseClass, cmdmin, cmdmax) \
00277     { EV_FETCHCMD, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00278         (UPMSG)(int (UCmdTarget::*)(int cmd, void *widget))&baseClass::OnFetchCmd },
00279
00280 #define ON_UUPDATECMD_RANGE(cmdmin, cmdmax, hook) \
00281     { EV_UPDTCMD, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00282         (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },
00283
00284 #define ON_USETTOOLTIP(cmdmin, cmdmax, hook) \
00285     { EV_SETTOOLTIP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00286         (UPMSG)(void (UCmdTarget::*)(int cmd, UCmdUI *pCmdUI))&hook },
00287
00288 #define ON_UGETLLOC(cmdmin, cmdmax, hook) \
00289     { EV_GETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00290         (UPMSG)(void (UCmdTarget::*)(int cmd, URECT *r))&hook },
00291
00292 #define ON_USETLLOC(cmdmin, cmdmax, hook) \
00293     { EV_SETLOC, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00294         (UPMSG)(void (UCmdTarget::*)(int cmd, const URECT *r))&hook },
00295
00296 #define ON_QUERYSTATE(cmdmin, cmdmax, hook) \
00297     { EV_QUERYSTATE, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00298         (UPMSG)(int (UCmdTarget::*)(int cmd))&hook },
00299
00300 #define ON_EDITCHANGE(cmd, hook) \
00301     { EV_EDITCHANGE, epV_V, UMSG_RANGE, cmd, cmd, \
00302         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00303
00304 #define ON_EDITCHANGE_RANGE(cmdmin, cmdmax, hook) \
00305     { EV_EDITCHANGE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00306         (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },
00307
00308 #define ON_EDITACTIVATE(cmd, hook) \
00309     { EV_EDITACTIVATE, epV_V, UMSG_RANGE, cmd, cmd, \
00310         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00311
00312 #define ON_EDITACTIVATE_RANGE(cmdmin, cmdmax, hook) \
00313     { EV_EDITACTIVATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00314         (UPMSG)(void (UCmdTarget::*)(int cmd))&hook },
00315
00316 #define ON_SCROLLCHANGE(cmd, hook) \
00317     { EV_SCROLLCHANGE, epV_VP, UMSG_RANGE, cmd, cmd, \
00318         (UPMSG)(void (UCmdTarget::*)(int pos))&hook },
00319
00320 #define ON_SCROLLCHANGE_RANGE(cmdmin, cmdmax, hook) \
00321     { EV_SCROLLCHANGE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00322         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&hook },
00323
00324 #define ON_TIMER(cmd, hook) \
00325     { EV_TIMER, epV_VP, UMSG_RANGE, cmd, cmd, \
00326         (UPMSG)(void (UCmdTarget::*)(long time))&hook },
00327
00328 #define ON_UPDATEUI(baseClass) \
00329     { EV_UPDATEUI, epV_V, UMSG_NOEXT, 0, 0, \
00330         (UPMSG)(void (UCmdTarget::*)(void))&baseClass::OnUpdateUI },
00331
00332 #define ON_UPDATEFOCUS(baseClass) \
00333     { EV_UPDATEFOCUS, epi_iVP, UMSG_NOEXT, 0, 0, \
00334         (UPMSG)(int (UCmdTarget::*)(int leave, void *widget))&baseClass::OnUpdateFocus },
00335
00336 #define ON_SETSTATE(cmdmin, cmdmax, hook) \
00337     { EV_SETSTATE, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00338         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00339
00340 #define ON_ENABLECMD(cmdmin, cmdmax, hook) \
00341     { EV_ENABLECMD, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00342         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00343
00344 #define ON_CHGFOCUS(baseClass, cmdmin, cmdmax) \
00345     { EV_CHGFOCUS, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00346         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnChgFocus },
00347
00348 #define ON_INVALIDATE(baseClass, cmdmin, cmdmax) \
00349     { EV_INVALIDATE, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00350         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnInvalidate },
00351
00352 #define ON_REDRAW(baseClass, cmdmin, cmdmax) \
00353     { EV_REDRAW, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00354         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnRedraw },
00355
00356 #define ON_SHOW_WIDGET(cmd, hook) \
00357     { EV_SHOW_WIDGET, epV_I, UMSG_RANGE, cmd, cmd, \
00358         (UPMSG)(void (UCmdTarget::*)(int state))&hook },
00359
00360 #define ON_PAGE_CHANGED(baseClass, cmdmin, cmdmax) \
00361     { EV_PAGE_CHANGED, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00362         (UPMSG)(void (UCmdTarget::*)(int cmd, int pagenum))&baseClass::OnPageChanged },
00363
00364 #define ON_SHOW_WIDGET_RANGE(cmdmin, cmdmax, hook) \
00365     { EV_SHOW_WIDGET, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00366         (UPMSG)(void (UCmdTarget::*)(int cmd, int state))&hook },
00367
00368 #define ON_DROPREF(cmdmin, cmdmax, hook) \
00369     { EV_DROPREF, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00370         (UPMSG)(void (UCmdTarget::*)(int cmd, int numref, long *refs))&hook },
00371
00372 #define ON_UNOTIFY(cmd, hook) \
00373     { EV_NOTIFY, epV_V, UMSG_RANGE, cmd, cmd, \
00374         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00375
00376 #define ON_INIT_WIDGET(baseClass, cmdmin, cmdmax) \
00377     { EV_INIT_WIDGET, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00378         (UPMSG)(void (UCmdTarget::*)(int, void *))&baseClass::OnInitWidget },
00379
00380 #define ON_INIT_TAB_WIDGET(baseClass, cmdmin, cmdmax) \
00381     { EV_INIT_TAB_WIDGET, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00382         (UPMSG)(void (UCmdTarget::*)(int, int, void *))&baseClass::OnInitTabWidget },
00383
00384 #define ON_SETTEXT(cmdmin, cmdmax, hook) \
00385     { EV_SETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00386         (UPMSG)(void (UCmdTarget::*)(int, const char *))&hook },
00387
00388 #define ON_GETTEXT(cmdmin, cmdmax, hook) \
00389     { EV_GETTEXT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00390         (UPMSG)(void (UCmdTarget::*)(int, UStr *))&hook },
00391
00392 #define ON_SETFLOAT(baseClass, cmdmin, cmdmax) \
00393     { EV_SETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00394         (UPMSG)(void (UCmdTarget::*)(int cmd, const float *f))&baseClass::OnSetFloat },
00395
00396 #define ON_GETFLOAT(baseClass, cmdmin, cmdmax) \
00397     { EV_GETFLOAT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00398         (UPMSG)(void (UCmdTarget::*)(int cmd, float *f))&baseClass::OnGetFloat },
00399
00400 #define ON_DRAGQUERY(cmd, hook) \
00401     { EV_DRAGQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
00402         (UPMSG)(void (UCmdTarget::*)(UDragable *))&hook },
00403
00404 #define ON_DROPQUERY(cmd, hook) \
00405     { EV_DROPQUERY, epV_VP, UMSG_RANGE, cmd, cmd, \
00406         (UPMSG)(void (UCmdTarget::*)(UDropable **))&hook },
00407
00408 #define ON_DROPIT(cmd, hook) \
00409     { EV_DROPIT, epV_VP, UMSG_RANGE, cmd, cmd, \
00410         (UPMSG)(void (UCmdTarget::*)(const UDragable *))&hook },
00411
00412 #define ON_DRAGQUERY_RANGE(cmdmin, cmdmax, hook) \
00413     { EV_DRAGQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00414         (UPMSG)(void (UCmdTarget::*)(int, UDragable *))&hook },
00415
00416 #define ON_DROPQUERY_RANGE(cmdmin, cmdmax, hook) \
00417     { EV_DROPQUERY, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00418         (UPMSG)(void (UCmdTarget::*)(int, UDropable **))&hook },
00419
00420 #define ON_DROPIT_RANGE(cmdmin, cmdmax, hook) \
00421     { EV_DROPIT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00422         (UPMSG)(void (UCmdTarget::*)(int, const UDragable *))&hook },
00423
00424 #define ON_DROPQUERY_CMDID(baseClass) \
00425     { EV_DROPQUERY_CMDID, epV_iiVP, UMSG_NOEXT, 0, 0, \
00426         (UPMSG)(void (UCmdTarget::*)(int, int, int *))&baseClass::OnDropQueryCmdID },
00427
00428 #define ON_SET_SLIDER(baseClass, cmdmin, cmdmax) \
00429     { EV_SET_SLIDER, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00430         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos))&baseClass::OnSetSlider },
00431
00432 #define ON_GET_SLIDERPROP(baseClass, cmdmin, cmdmax) \
00433     { EV_GET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00434         (UPMSG)(void (UCmdTarget::*)(int cmd, USLIDER *prop))&baseClass::OnGetSliderProperty },
00435
00436 #define ON_SET_SLIDERPROP(baseClass, cmdmin, cmdmax) \
00437     { EV_SET_SLIDERPROP, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00438         (UPMSG)(void (UCmdTarget::*)(int cmd, const USLIDER *prop))&baseClass::OnSetSliderProperty },
00439
00440 #define ON_TREE_RESETALL(baseClass, cmdmin, cmdmax) \
00441     { EV_TREE_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00442         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnTreeResetAll },
00443
00444 #define ON_TREE_INSERT(baseClass, cmdmin, cmdmax) \
00445     { EV_TREE_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00446         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INSERT *data))&baseClass::OnTreeInsert },
00447
00448 #define ON_TREE_GETINFO(baseClass, cmdmin, cmdmax) \
00449     { EV_TREE_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00450         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeGetInfo },
00451
00452 #define ON_TREE_SETDATA(baseClass, cmdmin, cmdmax) \
00453     { EV_TREE_SETDATA, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00454         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetData },
00455
00456 #define ON_TREE_SETICON(baseClass, cmdmin, cmdmax) \
00457     { EV_TREE_SETICON, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00458         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREE_INFO *data))&baseClass::OnTreeSetIcon },
00459
00460 #define ON_TREE_DELETE(baseClass, cmdmin, cmdmax) \
00461     { EV_TREE_DELETE, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00462         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM item))&baseClass::OnTreeDelete },
00463
00464 #define ON_TREE_EXPAND(baseClass, cmdmin, cmdmax) \
00465     { EV_TREE_EXPAND, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00466         (UPMSG)(void (UCmdTarget::*)(int cmd, int collapse, UTREEITEM item))&baseClass::OnTreeExpand },
00467
00468 #define ON_TREE_SELECT(baseClass, cmdmin, cmdmax) \
00469     { EV_TREE_SELECT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00470         (UPMSG)(void (UCmdTarget::*)(int cmd, int deselect, UTREEITEM item))&baseClass::OnTreeSelect },
00471
00472 #define ON_TREE_GETSEL(baseClass, cmdmin, cmdmax) \
00473     { EV_TREE_GETSEL, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00474         (UPMSG)(void (UCmdTarget::*)(int cmd, UTREEITEM *item))&baseClass::OnTreeGetSel },
00475
00476 #define ON_TREE_EXPANDING(cmd, hook) \
00477     { EV_TREE_EXPANDING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00478         (UPMSG)(void (UCmdTarget::*)(int collapse, UTREEITEM item))&hook },
00479
00480 #define ON_TREE_SELECTING(cmd, hook) \
00481     { EV_TREE_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00482         (UPMSG)(void (UCmdTarget::*)(int deselect, UTREEITEM item))&hook },
00483
00484 #define ON_LIST_SELECTING(cmd, hook) \
00485     { EV_LIST_SELECTING, epV_IVP, UMSG_RANGE, cmd, cmd, \
00486         (UPMSG)(void (UCmdTarget::*)(int entry, const char *txt))&hook },
00487
00488 #define ON_LIST_SELCOLUMN(cmd, hook) \
00489     { EV_LIST_SELCOLUMN, epV_I, UMSG_RANGE, cmd, cmd, \
00490         (UPMSG)(void (UCmdTarget::*)(int entry))&hook },
00491
00492 #define ON_LIST_RESORT(baseClass, cmdmin, cmdmax) \
00493     { EV_LIST_RESORT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00494         (UPMSG)(void (UCmdTarget::*)(int cmd, int column, UListSorter s))&baseClass::OnListResort },
00495
00496 #define ON_LIST_SETSORTDIR(baseClass, cmdmin, cmdmax) \
00497     { EV_LIST_RESORT, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00498         (UPMSG)(void (UCmdTarget::*)(int cmd, int column, bool dir))&baseClass::OnListSetSortDir },
00499
00500 #define ON_LIST_DBLCLICK(cmd, hook) \
00501     { EV_LIST_DBLCLICK, epV_V, UMSG_RANGE, cmd, cmd, \
00502         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00503
00504 #define ON_LIST_POPUP(cmd, hook) \
00505     { EV_LIST_POPUP, epV_IVP, UMSG_RANGE, cmd, cmd, \
00506         (UPMSG)(void (UCmdTarget::*)(void))&hook },
00507
00508 #define ON_LIST_ADDSEL(baseClass, cmdmin, cmdmax) \
00509     { EV_LIST_ADDSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00510         (UPMSG)(void (UCmdTarget::*)(int cmd, int entry))&baseClass::OnListAddSel },
00511
00512 #define ON_LIST_DELROW(baseClass, cmdmin, cmdmax) \
00513     { EV_LIST_DELROW, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00514         (UPMSG)(void (UCmdTarget::*)(int cmd, int row))&baseClass::OnListDelRow },
00515
00516 #define ON_LIST_RESETALL(baseClass, cmdmin, cmdmax) \
00517     { EV_LIST_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00518         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnListResetAll },
00519
00520 #define ON_LIST_ADDCOLUMNS(baseClass, cmdmin, cmdmax) \
00521     { EV_LIST_ADDCOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00522         (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListAddColumns },
00523
00524 #define ON_LIST_SHOWCOLUMNS(baseClass, cmdmin, cmdmax) \
00525     { EV_LIST_SHOWCOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00526         (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListShowColumns },
00527
00528 #define ON_LIST_HIDECOLUMNS(baseClass, cmdmin, cmdmax) \
00529     { EV_LIST_HIDECOLUMNS, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00530         (UPMSG)(void (UCmdTarget::*)(int cmd, int num))&baseClass::OnListHideColumns },
00531
00532 #define ON_LIST_SETFEEDBACK(baseClass, cmdmin, cmdmax) \
00533     { EV_LIST_SETFEEDBACK, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00534         (UPMSG)(void (UCmdTarget::*)(int cmd, int turnOn))&baseClass::OnListSetFeedback },
00535
00536 #define ON_LIST_SETCOLTITLE(baseClass, cmdmin, cmdmax) \
00537     { EV_LIST_SETCOLTITLE, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00538         (UPMSG)(void (UCmdTarget::*)(int cmd, int num, const char *title))&baseClass::OnListSetColTitle },
00539
00540 #define ON_LIST_SETCOLWIDTH(baseClass, cmdmin, cmdmax) \
00541     { EV_LIST_SETCOLWIDTH, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
00542         (UPMSG)(void (UCmdTarget::*)(int cmd, int num, int width))&baseClass::OnListSetColWidth },
00543
00544 #define ON_LIST_NEWROW(baseClass, cmdmin, cmdmax) \
00545     { EV_LIST_NEWROW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00546         (UPMSG)(void (UCmdTarget::*)(int cmd, int *num))&baseClass::OnListNewRow },
00547
00548 #define ON_LIST_ROWSETDATA(baseClass, cmdmin, cmdmax) \
00549     { EV_LIST_ROWSETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00550         (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void *data))&baseClass::OnListRowSetData },
00551
00552 #define ON_LIST_ROWGETDATA(baseClass, cmdmin, cmdmax) \
00553     { EV_LIST_ROWGETDATA, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00554         (UPMSG)(void (UCmdTarget::*)(int cmd, int row, void **data))&baseClass::OnListRowGetData },
00555
00556 #define ON_LIST_INSERT(baseClass, cmdmin, cmdmax) \
00557     { EV_LIST_INSERT, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00558         (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INSERT *data))&baseClass::OnListInsert },
00559
00560 #define ON_LIST_GETNEXTSEL(baseClass, cmdmin, cmdmax) \
00561     { EV_LIST_GETNEXTSEL, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
00562         (UPMSG)(int (UCmdTarget::*)(int cmd, int selectedCell))&baseClass::OnListGetNextSel },
00563
00564 #define ON_LIST_GETNEXT(baseClass, cmdmin, cmdmax) \
00565     { EV_LIST_GETNEXT, epi_ii, UMSG_RANGE, cmdmin, cmdmax, \
00566         (UPMSG)(int (UCmdTarget::*)(int cmd, int whichCell))&baseClass::OnListGetNext },
00567
00568 #define ON_LIST_GETINFO(baseClass, cmdmin, cmdmax) \
00569     { EV_LIST_GETINFO, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00570         (UPMSG)(void (UCmdTarget::*)(int cmd, ULIST_INFO *data))&baseClass::OnListGetInfo },
00571
00572 #define ON_COMBO_RESETALL(baseClass, cmdmin, cmdmax) \
00573     { EV_COMBO_RESETALL, epV_i, UMSG_RANGE, cmdmin, cmdmax, \
00574         (UPMSG)(void (UCmdTarget::*)(int cmd))&baseClass::OnComboResetAll },
00575
00576 #define ON_COMBO_APPEND(baseClass, cmdmin, cmdmax) \
00577     { EV_COMBO_APPEND, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00578         (UPMSG)(void (UCmdTarget::*)(int cmd, const char *txt))&baseClass::OnComboAppend },
00579
00580 #define ON_COMBO_SETSEL(baseClass, cmdmin, cmdmax) \
00581     { EV_COMBO_SETSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00582         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboSetPos },
00583
00584 #define ON_COMBO_DELSEL(baseClass, cmdmin, cmdmax) \
00585     { EV_COMBO_DELSEL, epV_ii, UMSG_RANGE, cmdmin, cmdmax, \
00586         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel))&baseClass::OnComboDelSel },
00587
00588 #define ON_COMBO_ENABLESEL(baseClass, cmdmin, cmdmax) \
00589     { EV_COMBO_ENABLESEL, epV_iii, UMSG_RANGE, cmdmin, cmdmax, \
00590         (UPMSG)(void (UCmdTarget::*)(int cmd, int sel, int state))&baseClass::OnComboEnableSel },
00591
00592 #define ON_COMBO_GETSEL(baseClass, cmdmin, cmdmax) \
00593     { EV_COMBO_GETSEL, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00594         (UPMSG)(int (UCmdTarget::*)(int cmd, UStr *txt))&baseClass::OnComboGetPos },
00595
00596 #define ON_COMBO_GETMENU(baseClass, cmdmin, cmdmax) \
00597     { EV_COMBO_GETMENU, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00598         (UPMSG)(void (UCmdTarget::*)(int cmd, UMENU *menu))&baseClass::OnComboGetMenu },
00599
00600 #define ON_COMBO_GETCOUNT(baseClass, cmdmin, cmdmax) \
00601     { EV_COMBO_GETCOUNT, epi_i, UMSG_RANGE, cmdmin, cmdmax, \
00602         (UPMSG)(int (UCmdTarget::*)(int cmd))&baseClass::OnComboGetCount },
00603
00604 #define ON_COMBO_SEL(cmd, hook) \
00605     { EV_COMBO_SEL, epV_IVP, UMSG_RANGE, cmd, cmd, \
00606         (UPMSG)(void (UCmdTarget::*)(int pos, const char *txt))&hook },
00607
00608 #define ON_COMBO_SEL_RANGE(cmdmin, cmdmax, hook) \
00609     { EV_COMBO_SEL, epV_iiVP, UMSG_RANGE, cmdmin, cmdmax, \
00610         (UPMSG)(void (UCmdTarget::*)(int cmd, int pos, const char *txt))&hook },
00611
00612 #define ON_SMARTCOMBO_SETFEATURE(baseClass, cmdmin, cmdmax) \
00613     { EV_SMARTCOMBO_SETFEATURE, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00614         (UPMSG)(void (UCmdTarget::*)(int cmd, int feature))&baseClass::OnSmartComboSetFeature },
00615
00616 #define ON_SMARTCOMBO_SETITEMS(baseClass, cmdmin, cmdmax) \
00617     { EV_SMARTCOMBO_SETITEMS, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00618         (UPMSG)(void (UCmdTarget::*)(int cmd, CMString* items))&baseClass::OnSmartComboSetItems },
00619
00620 #define ON_SMARTCOMBO_SETREADONLY(baseClass, cmdmin, cmdmax) \
00621     { EV_SMARTCOMBO_SETREADONLY, epi_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00622         (UPMSG)(void (UCmdTarget::*)(int cmd, bool readOnly))&baseClass::OnSmartComboSetReadOnly },
00623
00624 #define ON_CUSTOM_CLICK(cmd, hook) \
00625     { EV_CUSTOM_CLICK, epV_VP, UMSG_RANGE, cmd, cmd, \
00626         (UPMSG)(void (UCmdTarget::*)(void *drawInfo))&hook },
00627 #define ON_CUSTOM_DRAW(cmd, hook) \
00628     { EV_CUSTOM_DRAW, epV_VP, UMSG_RANGE, cmd, cmd, \
00629         (UPMSG)(void (UCmdTarget::*)(void *drawInfo))&hook },
00630
00631 #define ON_CUSTOM_DRAW_RANGE(cmdmin, cmdmax, hook) \
00632     { EV_CUSTOM_DRAW, epV_iVP, UMSG_RANGE, cmdmin, cmdmax, \
00633         (UPMSG)(void (UCmdTarget::*)(int cmd, void *drawInfo))&hook },
00634 //}
00635
00636 typedef enum
00637 {
00638     epNone,
00639     epV_V,      // void (void)
00640     epV_VP,     // void (arg2)
00641     epV_iVP,    // void (arg1, arg2)
00642     epV_IVP,    // void (HI(arg1), arg2)
00643     epV_i,      // void (arg1)
00644     epV_I,      // void (HI(arg1))
00645     epV_ii,     // void (LO(arg1), HI(arg1))
00646     epV_iii,    // void (LO(arg1), HI(arg1), (int)arg2)
00647     epV_iiVP,   // void (LO(arg1), HI(arg1), arg2)
00648     epi_i,      // int (arg1)
00649     epi_V,      // int (void)
00650     epi_ii,     // int (LO(arg1), HI(arg1))
00651     epi_iVP,    // int (arg1, arg2)
00652     epi_VP      // int (arg2)
00653 } UEventParam;
00654
00655 typedef enum
00656 {
00657     UMSG_NOEXT,
00658     UMSG_RANGE
00659 } UMSG_EXT;
00660
00661 struct UMSGMAP_ENTRY
00662 {
00663     int/*UEventType*/ nMessage;   // message
00664     UEventParam nSig;       // signature type (parameters)
00665     UMSG_EXT ext;
00666     int ext1;
00667     int ext2;
00668     UPMSG pfn;    // routine to call
00669 };
00670
00671 struct UMSGMAP
00672 {
00673     const UMSGMAP* pBaseMap;
00674     const UMSGMAP_ENTRY* lpEntries;
00675 };
00676
00677 #define UDECLARE_MESSAGE_MAP() \
00678 private: \
00679     static const UMSGMAP_ENTRY _messageEntries[]; \
00680 protected: \
00681     static const UMSGMAP messageMap; \
00682     static const UMSGMAP* GetBaseMessageMap(); \
00683     static const UMSGMAP* GetThisMessageMap(); \
00684     virtual const UMSGMAP* GetMessageMap() const; \
00685
00686 #define UBEGIN_MESSAGE_MAP(theClass, baseClass) \
00687     const UMSGMAP* theClass::GetBaseMessageMap() \
00688         { return baseClass::GetThisMessageMap(); } \
00689     const UMSGMAP* theClass::GetThisMessageMap() \
00690         { return &theClass::messageMap; } \
00691     const UMSGMAP* theClass::GetMessageMap() const \
00692         { return &theClass::messageMap; } \
00693     const UMSGMAP theClass::messageMap = \
00694     { baseClass::GetThisMessageMap(), &theClass::_messageEntries[0] }; \
00695     const UMSGMAP_ENTRY theClass::_messageEntries[] = \
00696     { \
00697
00698 #define UEND_MESSAGE_MAP() \
00699         {EV_NONE, epNone, UMSG_NOEXT, 0, 0, (UPMSG)0 } \
00700     }; \
00701
00702 #define ev_msg // intentional placeholder
00703
00704 class UEXPORT UCmdTarget : public UObject
00705 {
00706     UDECLARE_DYNAMIC(UCmdTarget)
00707 public:
00708     UCmdTarget(int widid);
00709     virtual ~UCmdTarget();
00710
00711     typedef enum
00712     {
00713         kUNoDispatchInfo,
00714         kUDispatchHandled = 0x01
00715     } UDispatchInfo;
00716
00718     virtual int UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo);
00719
00720     inline int GetWidID(void) const { return m_widid; }
00721 private:
00722     int m_widid;
00723
00724     UDECLARE_MESSAGE_MAP()
00725 };
00726
00727 // the interface will ask regularly the widget if they want to be
00728 // disabled, checked (EV_UPDTCMD)...
00729 class UCmdUI
00730 {
00731 public:
00732     UCmdUI(int id) : m_nID(id)
00733 #ifdef WIN32
00734     , pCmdUI(0L)
00735     , pNMHDR(0L)
00736 #endif
00737 #ifdef qMacPP
00738     , m_wrapper(0L)
00739 #endif
00740     , m_widget(0L)
00741     , m_continue(true)
00742         {}
00743     virtual ~UCmdUI() {}
00744
00745 // Attributes
00746     int m_nID;
00747
00748 // Operations to do in ON_UUPDATECMD
00749     virtual void Enable(bool bOn = true);
00750     virtual void Check(bool bOn = true);
00751     virtual void SetText(const char *title);
00752         // by default this sets the continue state to false.
00753
00754     inline void SetContinue(bool state) { m_continue = state; }
00755     inline bool CanContinue(void) { return m_continue; }
00756
00757 // Operations to do in ON_USETTOOLTIP
00758     virtual void SetTooltip(const char *tooltip);
00759 #ifdef WIN32
00760     class CCmdUI *pCmdUI;
00761     void *pNMHDR;
00762 #endif
00763 #ifdef qMacPP
00764     struct UPseudoCmdStatusWrapper *m_wrapper;
00765 #endif
00766     void *m_widget;
00767     bool m_continue;
00768 };
00769
00770 class USemaphore
00771 {
00772 public:
00773     USemaphore(bool & semaphore) : m_semaphore(semaphore), m_didSetSemaphore(false),
00774         m_enteredTwice(false)
00775     {
00776         if(m_semaphore)
00777         {
00778             m_enteredTwice = true;
00779             return;
00780         }
00781         m_semaphore = true;
00782         m_didSetSemaphore = true;
00783     }
00784
00785     ~USemaphore()
00786     {
00787         if(m_didSetSemaphore)
00788             m_semaphore = false;
00789     }
00790
00791     inline bool IsEnteredTwice() const { return m_enteredTwice; }
00792
00793 protected:
00794     bool & m_semaphore;
00795     bool m_didSetSemaphore;
00796     bool m_enteredTwice;
00797 };
00798 #endif /* __cplusplus */
00799
00800 #define UMAKEINT(a, b)       ((int)(((short)(a)) | ((int)((short)(b))) << 16))
00801 #define ULOWORD(l)           ((short)(l))
00802 #define UHIWORD(l)           ((short)(((int)(l) >> 16) & 0xFFFF))
00803
00804 /* Modifier codes */
00805 #define UK_LBUTTON        0x01
00806 #define UK_MBUTTON        0x02
00807 #define UK_RBUTTON        0x04
00808 #define UK_CONTROL        0x08
00809 #define UK_SHIFT          0x10
00810 #define UK_ALT            0x20
00811
00812 /* Keyboard codes (non listed are ASCII codes) */
00813 #define UK_CANCEL         0x03
00814 #define UK_BACK           0x08
00815 #define UK_TAB            0x09
00816 #define UK_CLEAR          0x0C
00817 #define UK_RETURN         0x0D
00818 #define UK_ESCAPE         0x1B
00819 #define UK_SPACE          0x20
00820 #define UK_PRIOR          0x21
00821 #define UK_NEXT           0x22
00822 #define UK_END            0x23
00823 #define UK_HOME           0x24
00824 #define UK_LEFT           0x25
00825 #define UK_UP             0x26
00826 #define UK_RIGHT          0x27
00827 #define UK_DOWN           0x28
00828 #define UK_INSERT         0x2D
00829 #define UK_DELETE         0x2E
00830 #define UK_HELP           0x2F
00831
00832 #define UK_PLUS           0x6B
00833 #define UK_MINUS          0x6D
00834
00835 #define UK_NUMPAD0        0x60
00836 #define UK_NUMPAD1        0x61
00837 #define UK_NUMPAD2        0x62
00838 #define UK_NUMPAD3        0x63
00839 #define UK_NUMPAD4        0x64
00840 #define UK_NUMPAD5        0x65
00841 #define UK_NUMPAD6        0x66
00842 #define UK_NUMPAD7        0x67
00843 #define UK_NUMPAD8        0x68
00844 #define UK_NUMPAD9        0x69
00845 #define UK_MULTIPLY       0x6A
00846 #define UK_ADD            0x6B
00847 #define UK_SEPARATOR      0x6C
00848 #define UK_SUBTRACT       0x6D
00849 #define UK_DECIMAL        0x6E
00850 #define UK_DIVIDE         0x6F
00851 #define UK_F1             0x70
00852 #define UK_F2             0x71
00853 #define UK_F3             0x72
00854 #define UK_F4             0x73
00855 #define UK_F5             0x74
00856 #define UK_F6             0x75
00857 #define UK_F7             0x76
00858 #define UK_F8             0x77
00859 #define UK_F9             0x78
00860 #define UK_F10            0x79
00861 #define UK_F11            0x7A
00862 #define UK_F12            0x7B
00863 #define UK_F13            0x7C
00864 #define UK_F14            0x7D
00865 #define UK_F15            0x7E
00866 #define UK_F16            0x7F
00867 #define UK_F17            0x80
00868 #define UK_F18            0x81
00869 #define UK_F19            0x82
00870 #define UK_F20            0x83
00871 #define UK_F21            0x84
00872 #define UK_F22            0x85
00873 #define UK_F23            0x86
00874 #define UK_F24            0x87
00875
00876 #ifdef WIN32
00877 #   define WINCMD_DLG_START 2000
00878 #   define WINCMD_DLG_END 3000
00879 #   define UCMD_to_WINCMD(cmd) (cmd)
00880 #   define WINCMD_to_UCMD(cmd) (cmd)
00881 #   define UCMD_to_WINCTL(cmd) ((cmd)-EV_COMMAND_START+WINCMD_DLG_START)
00882 #   define WINCTL_to_UCMD(cmd) ((cmd)-WINCMD_DLG_START+EV_COMMAND_START)
00883 #endif
00884
00885 /* see umenu.h */
00886 typedef long UMENU;
00887 #define UMENU_NULL ((UMENU)0L)
00888
00889 /* toolbar manager */
00890 #define UTB_SEPARATOR (-1)
00891 typedef struct
00892 {
00893     int widthbtn, heightbtn;    /* dimensions of each icon */
00894     const char *title;          /* title bar */
00895 #ifdef WIN32
00896     int winid;                  /* if for the toolbar (WIN32 only) */
00897 #endif
00898 } UTB_INIT;
00899
00900 typedef enum
00901 {
00902     DDV_NONE
00903 } UTB_VAR;
00904
00905 typedef enum
00906 {
00907     DDD_NONE = 0x00
00908 } UTB_DROP;
00909
00910 typedef struct
00911 {
00912     const void *icon;       /* icon data (XPM) */
00913     int cmd;                /* associated command */
00914     UTB_VAR varcode;        /* misc. option */
00915     UTB_DROP drop;          /* for drag'n drop */
00916     const char *tooltip;    /* status tooltip/nprompt tooltip */
00917 } UTB_BUTTON;
00918
00919 typedef struct
00920 {
00921     int initialcmd;     /* initial value */
00922     UTB_BUTTON *btns;   /* all the dropdown buttons */
00923 } UTB_DROPDOWN;
00924
00925 typedef struct
00926 {
00927     int max; /* maximum of the scroll range */
00928     int min; /* minimum of the scroll range */
00929     int inc; /* increment of the scroll */
00930     int pos; /* current position of the slider */
00931 } USLIDER;
00932
00933 typedef enum
00934 {
00935     uCursArrow,
00936     uCursWatch
00937 } UCURSOR;
00938
00939 typedef struct
00940 {
00941     int cx, cy;
00942 } USIZE;
00943
00944 typedef struct
00945 {
00946     int x, y;
00947 } UPOINT;
00948
00949 typedef struct
00950 {
00951     int left, top, right, bottom;
00952 } URECT;
00953
00954 typedef void *UTREEITEM;
00955
00956 typedef struct
00957 {
00958     const char *title;          /* tree item title */
00959     UTREEITEM parent;           /* 0L if root */
00960     UTREEITEM result;           /* pointer on the result item */
00961     void *icon;                 /* icon of the item, 0L if any */
00962     void *data;                 /* user data of the item, 0L if any */
00963 } UTREE_INSERT;
00964
00965 typedef struct
00966 {
00967     UTREEITEM item;         /* pointer on the item */
00968     UTREEITEM parent;       /* pointer on the parent (0L if any) */
00969     UTREEITEM next;         /* pointer on the next item (0L if any) */
00970     UTREEITEM child;        /* pointer on the first child item (0L if any) */
00971     void *data;             /* data of the item */
00972     char *title;            /* title of the item */
00973     void *icon;             /* icon of the item */
00974     int expanded;           /* item is expanded */
00975 } UTREE_INFO;
00976
00977 typedef struct
00978 {
00979     int row, col;               /* the coordinates of the entry */
00980     const char *title;          /* the title of the entry (0L if any) */
00981     void *icon;                 /* the icon of the entry (0L if any) */
00982 } ULIST_INSERT;
00983
00984 typedef int (*UListSorter)(UWidget *wid, void *data1, void *data2);
00985
00986 typedef struct
00987 {
00988     int row, col;               /* the coordinates of the entry */
00989     const char *title;          /* the title of the entry (0L if any) */
00990     void *data;                 /* the user data */
00991 } ULIST_INFO;
00992
00993 #ifdef __cplusplus
00994 extern "C" {
00995 #endif
00996
00997 UEXPORT int UEventSendMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2);
00998     /* send a message to a pseudo-widget */
00999
01000 UEXPORT int UEventSendMessageExt(int wid, int/*UEventType*/ evt, int arg1, void *arg2, int * handledFlag);
01001     /* send a message to a pseudo-widget and tells if the message was handled */
01002
01003 UEXPORT int UEventPostMessage(int wid, int/*UEventType*/ evt, int arg1, void *arg2);
01004     /* post a message to a pseudo-widget (get executed later) */
01005
01006 UEXPORT int UEventNotifyMessage(int/*UEventType*/ evt, int arg1, void *arg2);
01007     /* send a message to all the current pseudo-widget */
01008
01009 UEXPORT int UEventGetWidID(void);
01010     /* create a new widget id */
01011
01012 UEXPORT void UEventRemoveWidID(int widid);
01013     /* remove the widget from the broadcast list */
01014
01015 UEXPORT void UEventSetTooltipHandler(void (*handler) (const char *));
01016     /* set the handler (usually a status bar) called when happens a tooltip call */
01017
01018 UEXPORT void UEventGiveTime(void);
01019     /* give some time to the event manager for handling internal timers */
01020
01021 UEXPORT long UTickCount(void);
01022     /* in milliseconds */
01023
01024 #ifdef __cplusplus
01025 }
01026 #endif
01027
01028 #ifdef __cplusplus
01029 #   include <map>
01030
01031     UEXPORT UCmdTarget *UEventQueryWidget(int widid);
01032         /* search for a widget (0L if failed) */
01033
01034     UEXPORT const STD map<int, UCmdTarget *> & UEventGetTargets(void);
01035         /* return the list of the current pseudo targets */
01036
01037 #   ifdef WIN32
01038         // XPM wrappers
01039         UEXPORT HBITMAP UMakeBitmap(const char *icon);
01040         UEXPORT HBITMAP UMakeBitmap(char **icon);
01041         UEXPORT HBITMAP UMakeBitmap(char **icon, int & width, int & height, COLORREF back);
01042 #   else /* !WIN32 */
01043 #       define UMakeBitmap(b) 0L
01044 #   endif /* !WIN32 */
01045 #endif
01046
01047 #endif /* UEVENT_H */
Generated on Fri Jan 31 12:08:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 UStr & UStr::operator+=(char *addToStr)
00315 {
00316     return *this << addToStr;
00317 }
00318
00319 UStr & UStr::operator+=(const char *addToStr)
00320 {
00321     return *this << addToStr;
00322 }
00323
00324 UStr & UStr::operator+=(const UStr & addToStr)
00325 {
00326     return *this << (const char *)addToStr;
00327 }
00328
00329 UStr & UStr::operator+=(int addToStr)
00330 {
00331     return *this << addToStr;
00332 }
00333
00334 bool UStr::operator<(const UStr & str) const
00335 {
00336     return strcmp(*this, str) < 0;
00337 }
00338
00339 bool UStr::operator>(const UStr & str) const
00340 {
00341     return strcmp(*this, str) > 0;
00342 }
00343
00344 bool UStr::operator==(const UStr & str) const
00345 {
00346     return strcmp(*this, str) == 0;
00347 }
00348
00349 bool UStr::operator==(const char *str) const
00350 {
00351     return strcmp(*this, str) == 0;
00352 }
00353
00354 bool UStr::operator!=(const UStr & str) const
00355 {
00356     return strcmp(*this, str) != 0;
00357 }
00358
00359 bool UStr::operator!=(const char *str) const
00360 {
00361     return strcmp(*this, str) != 0;
00362 }
00363 const int UStr::find(const char *thestr) const
00364 {
00365     if(thestr != NULL) {
00366         char* buf;
00367         buf = strstr(str, thestr);
00368
00369         if(buf != NULL)
00370             return buf - str;
00371     }
00372
00373     return 0;
00374 }
00375 const int UStr::find(char thechar) const
00376 {
00377     char* buf;
00378     buf = strchr(str, thechar);
00379
00380     if(buf != NULL)
00381         return buf - str;
00382
00383     return 0;
00384 }
00385 const int UStr::rfind(const char *thestr) const
00386 {
00387     if(thestr != NULL) {
00388         char* buf = str;
00389         char* last_buf = NULL;
00390
00391         while (buf) {
00392             last_buf = buf;
00393             buf++;
00394
00395             buf = strstr(buf, thestr);
00396         }
00397
00398         if(last_buf != NULL)
00399             return last_buf - str;
00400     }
00401
00402     return 0;
00403 }
00404
00405 const int UStr::rfind(char thechar) const
00406 {
00407     char* buf;
00408     buf = strrchr(str, thechar);
00409
00410     if(buf != NULL)
00411         return buf - str;
00412
00413     return 0;
00414 }
00415
00416
00417 char* UStr::substr(int idx, int len) const
00418 {
00419     char *newvalue = (char *)malloc((len + 1) * sizeof(char));
00420
00421     if(newvalue == 0L)
00422         UTHROW(std::bad_alloc());
00423
00424     for(int i=0; i<len; i++) {
00425         newvalue[i] = str[i+idx];
00426     }
00427
00428     newvalue[len] = '\0';
00429
00430     return newvalue;
00431 }
00432
00433 UStr& UStr::substr(int idx, int len, UStr& subStr) const
00434 {
00435   subStr.flush();
00436   subStr.str = this->substr(idx, len);
00437   return subStr;
00438 }
Generated on Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 /* TARGET_OS_MAC */
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);
00178     UStr & operator+=(int addToStr);
00180     UStr & operator+=(char *addToStr);
00182     UStr & operator+=(const char *addToStr);
00184     UStr & operator+=(const UStr & addToStr);
00185
00187     inline int compare(const char *thestr) const { return strcmp(*this, thestr); }
00188
00189     inline bool endsWith(char c) const {return !length() ? false : str[length()-1] == c;}
00190
00192     const UStr & replace(char which, char bywhich);
00193
00195     const int find(const char *thestr) const;
00196     const int rfind(const char *thestr) const;
00197
00199     const int find(char thechar) const;
00200     const int rfind(char thechar) const;
00201
00203     char* substr(int idx, int len) const;
00205     UStr& substr(int idx, int len, UStr& subStr) const;
00206
00207 protected :
00208     void flush(void);
00210     char *str;
00211 };
00212
00213 #endif /* USTR_H */
Generated on Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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[0]);
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 && styles.size())
00515     {
00516         // create the Win32 toolbar
00517         m_wndToolBar->SetButtons(&styles.begin()[0], 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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:08:50 2003 for WinCvs Source by doxygen 1.3-rc2


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_SHOWCOLUMNS(UWidget, 0, 0xFFFF)
00135     ON_LIST_HIDECOLUMNS(UWidget, 0, 0xFFFF)
00136     ON_LIST_RESORT(UWidget, 0, 0xFFFF)
00137     ON_LIST_SETSORTDIR(UWidget, 0, 0xFFFF)
00138     //ON_LIST_POPUP(UWidget, 0, 0xFFFF)
00139     ON_COMBO_RESETALL(UWidget, 0, 0xFFFF)
00140     ON_COMBO_APPEND(UWidget, 0, 0xFFFF)
00141     ON_COMBO_SETSEL(UWidget, 0, 0xFFFF)
00142     ON_COMBO_GETSEL(UWidget, 0, 0xFFFF)
00143     ON_COMBO_GETCOUNT(UWidget, 0, 0xFFFF)
00144     ON_COMBO_DELSEL(UWidget, 0, 0xFFFF)
00145     ON_COMBO_ENABLESEL(UWidget, 0, 0xFFFF)
00146     ON_COMBO_GETMENU(UWidget, 0, 0xFFFF)
00147     ON_SMARTCOMBO_SETFEATURE(UWidget, 0, 0xFFFF)
00148     ON_SMARTCOMBO_SETITEMS(UWidget, 0, 0xFFFF)
00149     ON_SMARTCOMBO_SETREADONLY(UWidget, 0, 0xFFFF)
00150 UEND_MESSAGE_MAP()
00151
00152 bool UWidget::sValidMenu = false;
00153 int UWidget::sFocusWidID = -1;
00154 int UWidget::sFocusCmdID;
00155
00156 bool UWidget::IsUIValid() { return sValidMenu; }
00157 void UWidget::DoValidUI(bool how) { sValidMenu = how; }
00158 int UWidget::GetFocus(void) { return sFocusWidID; }
00159 int UWidget::GetFocusCmd(void) { return sFocusCmdID; }
00160
00161 #if qGTK
00162 extern "C"
00163 {
00164     static void gtkdestroy(GtkWidget *widget, gpointer user_data)
00165     {
00166         UWidget *wid = (UWidget *)user_data;
00167         UEventSendMessage(wid->GetWidID(), EV_DESTROY, 0, 0L);
00168     }
00169
00170     static int gtkkeypress(GtkWidget *widget, GdkEventKey * event, gpointer user_data)
00171     {
00172         UWidget *wid = (UWidget *)user_data;
00173         UEventSendMessage(wid->GetWidID(), EV_KEYDOWN, event->keyval, 0L);
00174         return FALSE;
00175     }
00176
00177     static guint focus_in_signal_id;
00178     static guint focus_out_signal_id;
00179
00180     static gboolean gtkeventwatcher(GtkObject *object, guint signal_id, guint n_params, GtkArg *params, gpointer data)
00181     {
00182 #if 0
00183         g_print ("Watch: \"%s\" emitted for %s\n",
00184                  gtk_signal_name (signal_id),
00185                  gtk_type_name (GTK_OBJECT_TYPE (object)));
00186 #endif
00187
00188         // for a tree, we are interested to know about the tree, not just the item
00189         if(GTK_IS_TREE_ITEM(object))
00190         {
00191             GtkTree *parent = GTK_TREE(GTK_WIDGET(object)->parent);
00192             // now find the upper tree
00193             while(1)
00194             {
00195                 gpointer data = gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent");
00196                 if(data != 0L)
00197                     parent = GTK_TREE(GTK_WIDGET(data)->parent);
00198                 else
00199                     break;
00200             }
00201             object = GTK_OBJECT(parent);
00202         }
00203
00204         if(signal_id == focus_out_signal_id)
00205         {
00206             UEventNotifyMessage(EV_UPDATEFOCUS, 1, object);
00207         }
00208         else if(signal_id == focus_in_signal_id)
00209         {
00210             UEventNotifyMessage(EV_UPDATEFOCUS, 0, object);
00211         }
00212
00213         return TRUE;
00214     }
00215
00216     static void gtkmaindoevent(GdkEvent *event)
00217     {
00218         gtk_main_do_event(event);
00219
00220         switch(event->type)
00221         {
00222         case GDK_BUTTON_PRESS:
00223         case GDK_2BUTTON_PRESS:
00224         case GDK_3BUTTON_PRESS:
00225         case GDK_BUTTON_RELEASE:
00226         case GDK_KEY_PRESS:
00227         case GDK_KEY_RELEASE:
00228         case GDK_FOCUS_CHANGE:
00229             UWidget::DoValidUI(false);
00230             break;
00231         default:
00232             break;
00233         }
00234     }
00235
00236     static void gtkclicked(GtkButton *button, gpointer user_data)
00237     {
00238         int widid = ULOWORD((int)user_data);
00239         int cmdid = UHIWORD((int)user_data);
00240         UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00241     }
00242
00243     static void gtkmenuitemactivate(GtkMenuItem *menuitem, gpointer user_data)
00244     {
00245         int widid = ULOWORD((int)user_data);
00246         int cmdid = UHIWORD((int)user_data);
00247         UEventSendMessage(widid, EV_CMD, cmdid, 0L);
00248     }
00249
00250     static void gtkselectclist(GtkWidget *clist, gint row, gint column,
00251                                GdkEventButton *event, gpointer user_data)
00252     {
00253         int widid = ULOWORD((int)user_data);
00254         int cmdid = UHIWORD((int)user_data);
00255         gchar *text;
00256         gtk_clist_get_text(GTK_CLIST(clist), row, column, &text);
00257         UEventSendMessage(widid, EV_LIST_SELECTING, UMAKEINT(cmdid, row), text);
00258         //if(event) fprintf(stderr, "Button %d\n", event->button);
00259     }
00260
00261     static void gtkselectclistcolumn(GtkCList *clist, gint column, gpointer user_data)
00262     {
00263         int widid = ULOWORD((int)user_data);
00264         int cmdid = UHIWORD((int)user_data);
00265         UEventSendMessage(widid, EV_LIST_SELCOLUMN, UMAKEINT(cmdid, column), 0L);
00266     }
00267
00268     static gint gtkclistdblclick(GtkWidget *widget, GdkEventButton *event, gpointer data)
00269     {
00270         int widid = ULOWORD((int)data);
00271         int cmdid = UHIWORD((int)data);
00272
00273         //fprintf(stderr, "Button %d\n", event->button);
00274
00275         if (event->button == 3)
00276         {
00277             UEventSendMessage(widid, EV_LIST_POPUP, cmdid, 0L);
00278         }
00279
00280         if (event->type == GDK_2BUTTON_PRESS)
00281         {
00282             UEventSendMessage(widid, EV_LIST_DBLCLICK, cmdid, 0L);
00283             return FALSE;
00284         }
00285         return TRUE;
00286     }
00287
00288     static void gtkcomboclicked(GtkWidget *widget, gpointer user_data)
00289     {
00290         int widid = ULOWORD((int)user_data);
00291         int cmdid = UHIWORD((int)user_data);
00292
00293         GtkList *list = GTK_LIST(widget->parent);
00294         GList *selection = list->selection;
00295         int count = -1;
00296         UStr selTxt;
00297         if (selection)
00298         {
00299             GtkBin *bin = GTK_BIN( selection->data );
00300             gchar *txt;
00301             gtk_label_get(GTK_LABEL(bin->child), &txt);
00302             selTxt = txt;
00303             GList *child = list->children;
00304             count = 0;
00305             while (child)
00306             {
00307                 if (child->data == selection->data)
00308                     break;
00309                 count++;
00310                 child = child->next;
00311             }
00312             g_assert(child != 0L);
00313         }
00314         UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, count), (void *)(const char *)selTxt);
00315     }
00316
00317     GtkLabel *getLabelFromContainer(GtkContainer *w)
00318     {
00319         GList *list = gtk_container_children(w);
00320         GtkLabel *label = 0L;
00321         while(list != 0L)
00322         {
00323             GtkWidget *wid = GTK_WIDGET(list->data);
00324             if(GTK_IS_LABEL(wid))
00325             {
00326                 label = GTK_LABEL(wid);
00327                 break;
00328             }
00329             list = (GList *)g_list_next(list);
00330         }
00331         return label;
00332     }
00333
00334     static void gtkmenuactivated(GtkWidget *widget, gpointer user_data)
00335     {
00336         int widid = ULOWORD((int)user_data);
00337         int cmdid = UHIWORD((int)user_data);
00338
00339         UStr selTxt;
00340
00341         // fix me: where to find the label of the item ?
00342 #if 1
00343         selTxt = (char *)gtk_object_get_data(GTK_OBJECT(widget), "rf_menuitemtext");
00344 #else
00345         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(widget));
00346         gchar *txt;
00347         gtk_label_get(label, &txt);
00348         selTxt = txt;
00349 #endif
00350
00351         GtkMenu *menu = GTK_MENU(widget->parent);
00352         GList *list = GTK_MENU_SHELL(menu)->children;
00353         int count = 0;
00354         while(list != 0L)
00355         {
00356             GtkWidget *wid = GTK_WIDGET(list->data);
00357             if(wid == widget)
00358                 break;
00359             list = (GList *)g_list_next(list);
00360             count++;
00361         }
00362         g_assert(list != 0L);
00363         UEventSendMessage(widid, EV_COMBO_SEL, UMAKEINT(cmdid, count), (void *)(const char *)selTxt);
00364     }
00365
00366     static gint gtkcancel(GtkWidget *widget, GdkEvent* event, gpointer user_data)
00367     {
00368         static bool sSemaphore = false;
00369         USemaphore policeman(sSemaphore);
00370         if(policeman.IsEnteredTwice())
00371             return TRUE;
00372
00373         UWidget *wid = (UWidget *)user_data;
00374         wid->EndModal(false);
00375         return TRUE;
00376     }
00377
00378     static bool matchToken(const char *str, int &cmd)
00379     {
00380         if(str == 0L)
00381             return false;
00382
00383         const char *origStr = str;
00384         size_t len = strlen(kUgtkPrefixToken);
00385         if(strncmp(str, kUgtkPrefixToken, len) != 0)
00386             return false;
00387
00388         str += len;
00389         if(*str && *str != '_')
00390             str++;
00391         if(*str && *str == '_')
00392             str++;
00393
00394         if(sscanf(str, "%d", &cmd) == 1 && cmd >=0 && cmd < (32767 - EV_COMMAND_START))
00395         {
00396             cmd += EV_COMMAND_START;
00397             return true;
00398         }
00399         else
00400             g_warning("The widget '%s' has a wrong pseudo command '%d'\n", origStr, cmd);
00401
00402         return false;
00403     }
00404
00405     static void dataForeach(GQuark key_id, gpointer data, gpointer user_data)
00406     {
00407         const char *str = g_quark_to_string(key_id);
00408         int id = (int)user_data;
00409         int cmd;
00410         if(matchToken(str, cmd))
00411         {
00412             UASSERT(GTK_IS_WIDGET(data));
00413
00414             GtkWidget *w = (GtkWidget *)data;
00415             w = w->parent;
00416             while(w != 0L)
00417             {
00418                 if(GTK_IS_NOTEBOOK(w))
00419                 {
00420                     // don't extract widgets children of a notebook at this point
00421                     return;
00422                 }
00423                 w = w->parent;
00424             }
00425
00426             UEventSendMessage(id, EV_INIT_WIDGET, cmd, data);
00427         }
00428     }
00429
00430     typedef struct
00431     {
00432         int widid;
00433         int pageid;
00434         int pagenum;
00435     } _dataTabForeach;
00436
00437     static void dataTabForeach(GQuark key_id, gpointer data, gpointer user_data)
00438     {
00439         const char *str = g_quark_to_string(key_id);
00440         _dataTabForeach *mydata = (_dataTabForeach *)user_data;
00441         int cmd;
00442         if(matchToken(str, cmd))
00443         {
00444             UASSERT(GTK_IS_WIDGET(data));
00445             GtkWidget *w = (GtkWidget *)data;
00446             w = w->parent;
00447             while(w != 0L)
00448             {
00449                 if(GTK_IS_NOTEBOOK(w))
00450                 {
00451                     break;
00452                 }
00453                 w = w->parent;
00454             }
00455             if(w == 0L)
00456             {
00457                 // this is not a child of a notebook
00458                 return;
00459             }
00460
00461             gchar *name = gtk_widget_get_name(w);
00462             int pagecmd;
00463             if(!matchToken(name, pagecmd) || pagecmd != mydata->pageid)
00464                 return;
00465
00466             GtkNotebook *n = GTK_NOTEBOOK(w);
00467             w = (GtkWidget *)data;
00468             int pagenum = -1;
00469             while(w != 0L && pagenum == -1)
00470             {
00471                 int i = 0;
00472                 GtkWidget *p;
00473                 while((p = gtk_notebook_get_nth_page(n, i)) != 0L)
00474                 {
00475                     if(w == p)
00476                     {
00477                         pagenum = i;
00478                         break;
00479                     }
00480                     i++;
00481                 }
00482                 w = w->parent;
00483             }
00484
00485             if(pagenum == -1)
00486             {
00487                 g_warning("Could not find the page of the widget '%s'\n", str);
00488                 return;
00489             }
00490
00491             if(pagenum != mydata->pagenum)
00492                 return;
00493
00494             UEventSendMessage(mydata->widid, EV_INIT_WIDGET, cmd, data);
00495         }
00496     }
00497
00498     static void gtkpacktreeitem(GtkBox *m_box, const char *title, GtkPixmap *icon)
00499     {
00500         if(icon != 0L)
00501         {
00502             gtk_misc_set_alignment (GTK_MISC (icon), 0.0, 0.5);
00503             gtk_box_pack_start(m_box, GTK_WIDGET(icon), FALSE, FALSE, 0);
00504             gtk_widget_show (GTK_WIDGET(icon));
00505         }
00506
00507         GtkLabel *m_label_widget = GTK_LABEL(gtk_label_new (title != 0L ? title : ""));
00508         gtk_misc_set_alignment (GTK_MISC (m_label_widget), 0.5, 0.5);
00509         gtk_box_pack_start(m_box, GTK_WIDGET(m_label_widget), FALSE, FALSE, 0);
00510         gtk_widget_show (GTK_WIDGET(m_label_widget));
00511
00512         gtk_widget_show(GTK_WIDGET(m_box));
00513     }
00514
00515     static GtkTreeItem *gtknewtreeitem(const char *title, GtkPixmap *icon)
00516     {
00517         GtkTreeItem *item;
00518         item = GTK_TREE_ITEM(gtk_tree_item_new());
00519
00520         GtkHBox *m_box = GTK_HBOX(gtk_hbox_new(FALSE, 2));
00521         gtk_container_add (GTK_CONTAINER (item), GTK_WIDGET(m_box));
00522
00523         gtkpacktreeitem(GTK_BOX(m_box), title, icon);
00524
00525         return item;
00526     }
00527
00528     static void gtktreeexpand(GtkWidget *item, gpointer user_data)
00529     {
00530         int widid = ULOWORD((int)user_data);
00531         int cmdid = UHIWORD((int)user_data);
00532         g_assert(GTK_IS_TREE_ITEM(item));
00533         UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 0), item);
00534     }
00535
00536     static void gtktreecollapse(GtkWidget *item, gpointer user_data)
00537     {
00538         int widid = ULOWORD((int)user_data);
00539         int cmdid = UHIWORD((int)user_data);
00540         g_assert(GTK_IS_TREE_ITEM(item));
00541         UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 1), item);
00542     }
00543
00544     static void gtktreeselect(GtkWidget *item, gpointer user_data)
00545     {
00546         int widid = ULOWORD((int)user_data);
00547         int cmdid = UHIWORD((int)user_data);
00548         g_assert(GTK_IS_TREE_ITEM(item));
00549         UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 0), item);
00550     }
00551
00552     static void gtktreedeselect(GtkWidget *item, gpointer user_data)
00553     {
00554         int widid = ULOWORD((int)user_data);
00555         int cmdid = UHIWORD((int)user_data);
00556         g_assert(GTK_IS_TREE_ITEM(item));
00557         UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 1), item);
00558     }
00559
00560     static GtkLabel *gtktreegetlabel(GtkWidget *item)
00561     {
00562         GtkBox *box = GTK_BOX (GTK_BIN (item)->child);
00563         GList *list = box->children;
00564         GtkLabel *label = 0L;
00565         while(list != 0L)
00566         {
00567             GtkWidget *wid = ((GtkBoxChild *)list->data)->widget;
00568             if(GTK_IS_LABEL(wid))
00569             {
00570                 label = (GtkLabel *)wid;
00571                 break;
00572             }
00573             list = (GList *)g_list_next(list);
00574         }
00575         return label;
00576     }
00577
00578   static gint treeListSort(gconstpointer ptr1, gconstpointer ptr2)
00579   {
00580     GtkLabel *label1, *label2;
00581     gchar *title1, *title2;
00582
00583     label1 = gtktreegetlabel((GtkWidget*)ptr1);
00584     label2 = gtktreegetlabel((GtkWidget*)ptr2);
00585
00586     gtk_label_get(label1, &title1);
00587     gtk_label_get(label2, &title2);
00588
00589 #ifdef qUnix
00590     return strcmp(title1, title2);
00591 #else
00592     return _stricmp(title1, title2);
00593 #endif
00594   }
00595
00596   static void gtktreesort(GtkTree *w)
00597   {
00598     if(w == 0L)
00599       return;
00600
00601 #if qGTK
00602     if(!GTK_IS_TREE(w))
00603       return;
00604
00605     GtkTree *parent = GTK_TREE(w);
00606
00607     GList *list = GTK_TREE(parent)->children;
00608
00609     g_list_sort(list, treeListSort);
00610
00611     parent->children = g_list_first(list);
00612 #endif
00613   }
00614
00615     static void gtksettreeitemicon(GtkTreeItem *item, GtkPixmap *icon)
00616     {
00617         gchar *title = 0L;
00618         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
00619         if(label != 0L)
00620             gtk_label_get(label, &title);
00621         UStr str(title);
00622
00623         GtkBox *m_box = GTK_BOX(GTK_BIN (item)->child);
00624         GList *list = g_list_copy(m_box->children);
00625         while(list != 0L)
00626         {
00627             GtkWidget *wid = ((GtkBoxChild *)list->data)->widget;
00628             gtk_container_remove(GTK_CONTAINER(m_box), wid);
00629
00630             list = (GList *)g_list_next(list);
00631         }
00632         g_list_free(list);
00633
00634         gtkpacktreeitem(m_box, str, icon);
00635     }
00636
00637     // TODO: remove that when the GTK one is working
00638     static gint gtk_clist_get_text_is_buggy(GtkCList  *clist,
00639                                             gint       row,
00640                                             gint       column,
00641                                             gchar    **text)
00642     {
00643         GtkCListRow *clist_row;
00644
00645         g_return_val_if_fail (clist != NULL, 0);
00646         g_return_val_if_fail (GTK_IS_CLIST (clist), 0);
00647
00648         if (row < 0 || row >= clist->rows)
00649             return 0;
00650         if (column < 0 || column >= clist->columns)
00651             return 0;
00652
00653         clist_row = (GtkCListRow *)(g_list_nth (clist->row_list, row))->data;
00654
00655         if (clist_row->cell[column].type == GTK_CELL_TEXT)
00656         {
00657             if (text)
00658                 *text = GTK_CELL_TEXT (clist_row->cell[column])->text;
00659         }
00660         else if (clist_row->cell[column].type == GTK_CELL_PIXTEXT)
00661         {
00662             if (text)
00663                 *text = GTK_CELL_PIXTEXT(clist_row->cell[column])->text;
00664         }
00665         else
00666             return 0;
00667
00668         return 1;
00669     }
00670
00671     static void
00672     gtkswitchpage(GtkWidget       *w,
00673                   GtkNotebookPage *page,
00674                   gint             page_num,
00675                   gpointer         data)
00676     {
00677         int widid = ULOWORD((int)data);
00678         int cmdid = UHIWORD((int)data);
00679
00680         UEventSendMessage(widid, EV_PAGE_CHANGED, UMAKEINT(cmdid, page_num), 0L);
00681     }
00682
00683     static UListSorter sGtkClistDiff = 0L;
00684     static UWidget *sGtkClistWid = 0L;
00685
00686     static gint gtkclistdefcompare(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
00687     {
00688         if(sGtkClistDiff == 0L)
00689             return 0;
00690
00691         GtkCListRow *row1 = (GtkCListRow *) ptr1;
00692         GtkCListRow *row2 = (GtkCListRow *) ptr2;
00693         return sGtkClistDiff(sGtkClistWid, row1->data, row2->data);
00694     }
00695
00696     static gint gtkexposeevent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
00697     {
00698         int widid = ULOWORD((int)user_data);
00699         int cmdid = UHIWORD((int)user_data);
00700
00701         UEventSendMessage(widid, EV_CUSTOM_DRAW, cmdid, event);
00702         return TRUE;
00703     }
00704
00705     static gint gtklayoutclicked(GtkWidget *widget, GdkEvent *event, gpointer user_data)
00706     {
00707         int widid = ULOWORD((int)user_data);
00708         int cmdid = UHIWORD((int)user_data);
00709
00710         UEventSendMessage(widid, EV_CUSTOM_CLICK, cmdid, event);
00711         return TRUE;
00712     }
00713 } // extern "C"
00714
00715 #endif /* qGTK */
00716
00717 #if qMacAPP
00718     static bool macapp_getcmdid(TView *view, int & cmdid)
00719     {
00720         IDType atype = view->GetIdentifier();
00721         const char *atypestr = (char *)&atype;
00722         if(atypestr[0] != 'p' && atypestr[1] != 's')
00723             return false;
00724
00725         char cmd[3] = {atypestr[2], atypestr[3], 0};
00726         return sscanf(cmd, "%d", &cmdid) == 1;
00727     }
00728
00729     static void macapp_fecthview(int widid, TView *view)
00730     {
00731         if(view == 0L)
00732             return;
00733
00734         int cmdid;
00735         if(macapp_getcmdid(view, cmdid))
00736         {
00737             UEventSendMessage(widid, EV_INIT_WIDGET, cmdid + EV_COMMAND_START, view);
00738         }
00739
00740         if(MA_MEMBER(view, TTabbedView))
00741         {
00742             TTabbedView *tab = (TTabbedView *)view;
00743             TView *tabview;
00744             SInt32 tabIndex = 1;
00745             while((tabview = tab->GetPanelView(tabIndex++)) != 0L)
00746             {
00747                 macapp_fecthview(widid, tabview);
00748             }
00749         }
00750
00751         macapp_fecthview(widid, view->GetNextView());
00752         macapp_fecthview(widid, view->GetSubView());
00753     }
00754 #endif /* qMacAPP */
00755
00756 UWidget::UWidget(int widid) : UCmdTarget(widid), m_currentPage(-1)
00757 #if qGTK || qMacPP
00758     , m_modalLoop(false)
00759 #endif
00760 #ifdef WIN32
00761     , m_curModal(0L), m_noDispatch(false)
00762 #endif
00763 {
00764 #if qMacAPP
00765     static bool firstTime = true;
00766     if(firstTime)
00767     {
00768         firstTime = false;
00769         gDispatcher->AddBehavior(new TPseudoAppBehavior);
00770             // this behavior takes care about menu routing and giving time
00771             // to the pseudo-events.
00772         new UMacAppMenu();
00773             // for MacApp, we can create automatically the pseudo menu handling.
00774     }
00775 #endif
00776 #if qMacPP
00777     static bool firstTime = true;
00778     if(firstTime && LCommander::GetTopCommander() != 0L)
00779     {
00780         firstTime = false;
00781         LCommander::GetTopCommander()->AddAttachment(NEW LMainPseudoAttachment());
00782     }
00783 #endif
00784 }
00785
00786 UWidget::~UWidget()
00787 {
00788     std::vector<UCmdTarget *>::iterator i;
00789     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00790     {
00791         delete *i;
00792     }
00793     std::map<int, UWidget *>::iterator j;
00794     for(j = m_tabs.begin(); j != m_tabs.end(); ++j)
00795     {
00796         delete (*j).second;
00797     }
00798     if(HasFocus())
00799         sFocusWidID = -1;
00800 }
00801
00802 void UWidget::AddListener(UCmdTarget * listener)
00803 {
00804     m_listeners.push_back(listener);
00805 }
00806
00807 int UWidget::UDispatchMessage(int/*UEventType*/ evt, int arg1, void *arg2, UDispatchInfo & dispatchInfo)
00808 {
00809     std::vector<UCmdTarget *>::iterator i;
00810     for(i = m_listeners.begin(); i != m_listeners.end(); ++i)
00811     {
00812         (*i)->UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00813     }
00814     return UCmdTarget::UDispatchMessage(evt, arg1, arg2, dispatchInfo);
00815 }
00816
00817 void *UWidget::GetWidget(int cmd) const
00818 {
00819     std::map<int, void *>::const_iterator i = m_widgets.find(cmd);
00820     if(i == m_widgets.end())
00821     {
00822         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00823 #ifdef DEBUG
00824         printf( "Valid Ids are:\n");
00825         for ( i = m_widgets.begin(); i != m_widgets.end(); ++i) {
00826             printf( "    Id: %d, Addr: 0x%x\n", (*i).first, (*i).second);
00827         }
00828 #endif
00829         return 0L;
00830     }
00831     return (*i).second;
00832 }
00833
00834 const char *UWidget::GetTooltip(int cmd) const
00835 {
00836     std::map<int, UStr>::const_iterator i = m_tooltips.find(cmd);
00837     if(i == m_tooltips.end())
00838     {
00839         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", cmd, __FILE__, __LINE__);
00840 #ifdef DEBUG
00841         printf( "Valid Ids are:\n");
00842         for ( i = m_tooltips.begin(); i != m_tooltips.end(); ++i) {
00843             printf( "    Id: %d, Str: '%s'\n", (*i).first, (*i).second.c_str());
00844         }
00845 #endif
00846         return 0L;
00847     }
00848     return (*i).second;
00849 }
00850
00851 void UWidget::OnGetLoc(int cmd, URECT * r)
00852 {
00853     r->left = 0; // sanity
00854     r->right = 0;
00855     r->top = 0;
00856     r->bottom = 0;
00857
00858     void *w = GetWidget(cmd);
00859     if(w == 0L)
00860         return;
00861
00862 #if qMacAPP
00863     TView *view = (TView *)w;
00864     CViewRect mr = view->GetFrame();
00865     view->SuperViewToLocal(mr);
00866     view->LocalToRootView(mr);
00867     r->left = mr.left;
00868     r->right = mr.right;
00869     r->top = mr.top;
00870     r->bottom = mr.bottom;
00871 #endif
00872 #if qMacPP
00873     LPane *view = (LPane *)w;
00874     SPoint32 outLocation;
00875     SDimension16 outSize;
00876     view->GetFrameLocation(outLocation);
00877     view->GetFrameSize(outSize);
00878
00879     *r = URect(UPoint(outLocation.h, outLocation.v), USize(outSize.width, outSize.height));
00880 #endif
00881 #ifdef WIN32
00882     CRect mr;
00883     CWnd *wnd = (CWnd *)w;
00884     wnd->GetClientRect(mr);
00885     CWnd *parent = wnd->GetParent();
00886     if(parent != 0L)
00887     {
00888         wnd->ClientToScreen(mr);
00889         parent->ScreenToClient(mr);
00890     }
00891     r->left = mr.left;
00892     r->right = mr.right;
00893     r->top = mr.top;
00894     r->bottom = mr.bottom;
00895 #endif
00896 }
00897
00898 void UWidget::OnSetLoc(int cmd, const URECT * r)
00899 {
00900     void *w = GetWidget(cmd);
00901     if(w == 0L)
00902         return;
00903
00904 #if qMacAPP
00905     TView *view = (TView *)w;
00906     CViewRect mr(r->left, r->top, r->right, r->bottom);
00907     if(mr.right < mr.left)
00908         mr.right = mr.left;
00909     if(mr.bottom < mr.top)
00910         mr.bottom = mr.top;
00911     view->RootViewToLocal(mr);
00912     view->LocalToSuperView(mr);
00913     view->SetFrame(mr, true);
00914 #endif
00915 #if qMacPP
00916     LPane *view = (LPane *)w;
00917     SPoint32 oldLocation;
00918     view->GetFrameLocation(oldLocation);
00919     URect newDim(*r);
00920     UPoint offset = newDim.TopLeft() - UPoint(oldLocation.h, oldLocation.v);
00921     view->ResizeFrameTo(newDim.Width(), newDim.Height(), true);
00922     view->MoveBy(offset.x, offset.y, true);
00923 #endif
00924 #ifdef WIN32
00925     CRect wr(r->left, r->top, r->right, r->bottom);
00926     CWnd *wnd = (CWnd *)w;
00927     wnd->MoveWindow(wr, TRUE);
00928 #endif
00929 }
00930
00931 void UWidget::OnSetTooltip(int cmd, UCmdUI *pCmdUI)
00932 {
00933     const char *tooltip = GetTooltip(cmd);
00934     if(tooltip == 0L)
00935         return;
00936
00937     pCmdUI->SetTooltip(tooltip);
00938 }
00939
00940 bool UWidget::WidgetIsActive(int cmd) const
00941 {
00942     void *w = GetWidget(cmd);
00943     if(w == 0L)
00944         return false;
00945
00946 #ifdef WIN32
00947     CWnd *wnd = (CWnd *)w;
00948
00949     bool res = false;
00950
00951     CWnd* parent = wnd->GetOwner();
00952     if(parent && (HWND)*parent->GetFocus() == (HWND)*wnd)
00953         res = true;
00954
00955     return res;
00956 #endif
00957     return false;
00958 }
00959
00960 void UWidget::AddTooltip(int cmd, const char *tooltipID)
00961 {
00962     std::map<int, UStr>::value_type val(cmd, UStr(tooltipID));
00963     m_tooltips.insert(val);
00964 }
00965
00966 void UWidget::OnInitWidget(int cmd, void *widget)
00967 {
00968     std::map<int, void *>::value_type val(cmd, widget);
00969     m_widgets.insert(val);
00970
00971 #ifdef WIN32
00972
00973 #endif
00974 #if qMacPP
00975     LPane *view = (LPane *)widget;
00976     if(view != 0L)
00977     {
00978         // fetch the inside widgets and add them the the widget list
00979         static bool sSemaphore = false;
00980         USemaphore policeman(sSemaphore);
00981         if(!policeman.IsEnteredTwice())
00982         {
00983             macpp_fecthview(GetWidID(), view);
00984         }
00985
00986         LWindow *wind = dynamic_cast<LWindow*>(view);
00987         if(wind != 0L)
00988         {
00989             LPseudoWinAttachment *attach = NEW LPseudoWinAttachment(GetWidID());
00990             wind->AddAttachment(attach);
00991             macpp_linkbroadcasters(wind, attach);
00992
00993             SPaneInfo inPaneInfo;
00994             memset(&inPaneInfo, 0, sizeof(SPaneInfo));
00995             inPaneInfo.superView = wind;
00996             NEW UPseudoFakePane(inPaneInfo, attach);
00997
00998             // call the create callback
00999             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01000         }
01001     }
01002 #endif
01003 #if qMacAPP
01004     TView *view = (TView *)widget;
01005     if(MA_MEMBER(view, TView))
01006     {
01007         // fetch the inside widgets and add them the the widget list
01008         static bool sSemaphore = false;
01009         USemaphore policeman(sSemaphore);
01010         if(!policeman.IsEnteredTwice())
01011         {
01012             macapp_fecthview(GetWidID(), view);
01013             //macapp_workaround_adlib_bug(view);
01014         }
01015
01016         if(MA_MEMBER(view, TWindow))
01017         {
01018             // add the pseudo behaviour which re-routes the events to the pseudo-widget
01019             TPseudoWinBehavior *psbehavior = dynamic_cast_AC(TPseudoWinBehavior*,
01020                 view->GetBehaviorWithIdentifier(TPseudoWinBehavior::kPseudoWinBehavior));
01021
01022             if(psbehavior == 0L)
01023             {
01024                 psbehavior = TH_new TPseudoWinBehavior;
01025                 view->AddBehavior(psbehavior);
01026             }
01027             psbehavior->SetPseudoWidget(GetWidID());
01028
01029             // add the pseudo adorner which intercepts the frame size changes
01030             TPseudoWinAdorner *psadorner = dynamic_cast_AC(TPseudoWinAdorner*,
01031                 view->AdornerWithID(TPseudoWinAdorner::kPseudoWinAdorner));
01032
01033             if(psadorner == 0L)
01034             {
01035                 psadorner = TH_new TPseudoWinAdorner;
01036                 view->AddAdorner(psadorner, kAdornLast, false);
01037             }
01038             psadorner->SetPseudoWidget(GetWidID());
01039
01040             // call the create callback
01041             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01042         }
01043     }
01044 #endif
01045 #if qGTK
01046     static bool firstTime = true;
01047     if(firstTime)
01048     {
01049         // for the disable/enable handling notification (EV_UPDATEUI)
01050         gdk_event_handler_set((GdkEventFunc)gtkmaindoevent, NULL, NULL);
01051
01052         // listen focus events
01053         focus_in_signal_id = gtk_signal_lookup ("focus_in_event", GTK_TYPE_WIDGET);
01054         gtk_signal_add_emission_hook (focus_in_signal_id, gtkeventwatcher, NULL);
01055         focus_out_signal_id = gtk_signal_lookup ("focus_out_event", GTK_TYPE_WIDGET);
01056         gtk_signal_add_emission_hook (focus_out_signal_id, gtkeventwatcher, NULL);
01057
01058         firstTime = false;
01059     }
01060
01061     // so for every widget mapped, we'll be able to find the pseudo-widget associated with.
01062     gtk_object_set_data(GTK_OBJECT(widget), kUgtkDataToken, (gpointer)UMAKEINT(GetWidID(), cmd));
01063
01064     // we are only interesting about the main widgets here
01065     if(GTK_IS_WIDGET(widget))
01066     {
01067         if(cmd == kUMainWidget)
01068         {
01069             // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01070             g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataForeach, (gpointer)GetWidID());
01071
01072             // map the destroy callback
01073             gtk_signal_connect (GTK_OBJECT(widget), "destroy",
01074                                 GTK_SIGNAL_FUNC(gtkdestroy), (gpointer)this);
01075
01076             gtk_signal_connect (GTK_OBJECT (widget), "key_press_event",
01077                                 GTK_SIGNAL_FUNC(gtkkeypress), (gpointer)this);
01078
01079             // call the create callback
01080             UEventSendMessage(GetWidID(), EV_CREATE, 0, 0L);
01081         }
01082     }
01083
01084     if(GTK_IS_NOTEBOOK(widget))
01085     {
01086         gtk_signal_connect (GTK_OBJECT (widget), "switch_page",
01087                             GTK_SIGNAL_FUNC(gtkswitchpage),
01088                             (gpointer)UMAKEINT(GetWidID(), cmd));
01089     }
01090
01091     if(GTK_IS_BUTTON(widget))
01092     {
01093         gtk_signal_connect (GTK_OBJECT(widget), "clicked",
01094             GTK_SIGNAL_FUNC(gtkclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01095     }
01096
01097     if(GTK_IS_MENU_ITEM(widget))
01098     {
01099         gtk_signal_connect(GTK_OBJECT(widget), "activate",
01100             GTK_SIGNAL_FUNC(gtkmenuitemactivate), (gpointer)UMAKEINT(GetWidID(), cmd));
01101     }
01102
01103     if(GTK_IS_CLIST(widget))
01104     {
01105         gtk_signal_connect (GTK_OBJECT(widget), "select_row",
01106             GTK_SIGNAL_FUNC(gtkselectclist), (gpointer)UMAKEINT(GetWidID(), cmd));
01107
01108         gtk_signal_connect (GTK_OBJECT(widget), "click_column",
01109             GTK_SIGNAL_FUNC(gtkselectclistcolumn), (gpointer)UMAKEINT(GetWidID(), cmd));
01110
01111         gtk_signal_connect_after (GTK_OBJECT (widget), "button_press_event",
01112                                   GTK_SIGNAL_FUNC (gtkclistdblclick), (gpointer)UMAKEINT(GetWidID(), cmd));
01113     }
01114
01115     if(GTK_IS_DRAWING_AREA(widget))
01116     {
01117         gtk_signal_connect_after (GTK_OBJECT(widget), "button_press_event",
01118                                   GTK_SIGNAL_FUNC(gtklayoutclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01119         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01120                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01121         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01122     }
01123
01124     if(GTK_IS_LAYOUT(widget))
01125     {
01126         gtk_signal_connect_after (GTK_OBJECT(widget), "button_press_event",
01127                                   GTK_SIGNAL_FUNC(gtklayoutclicked), (gpointer)UMAKEINT(GetWidID(), cmd));
01128         gtk_signal_connect (GTK_OBJECT(widget), "expose_event",
01129                             GTK_SIGNAL_FUNC (gtkexposeevent), (gpointer)UMAKEINT(GetWidID(), cmd));
01130         gtk_widget_set_events (GTK_WIDGET(widget), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK);
01131     }
01132 #endif /* qGTK */
01133 }
01134
01135 void UWidget::OnInitTabWidget(int cmd, int page, void *widget)
01136 {
01137 #if qGTK
01138     if(GTK_IS_WIDGET(widget))
01139     {
01140         // extract and map to the pseudo widget the sub-widgets begining with 'kUgtkPrefixToken'
01141         _dataTabForeach data = {GetWidID(), cmd, page};
01142         g_datalist_foreach (&GTK_OBJECT(widget)->object_data, dataTabForeach, (gpointer)&data);
01143     }
01144 #endif /* qGTK */
01145 }
01146
01147 void UWidget::OnBlockHandler(void* widget, int cmd, int event)
01148 {
01149 #ifdef qGTK
01150     if(event == GDK_EXPOSE) {
01151         gtk_signal_handler_block_by_func( GTK_OBJECT(widget),
01152                                           GTK_SIGNAL_FUNC (gtkexposeevent),
01153                                           (gpointer)UMAKEINT(GetWidID(), cmd) );
01154     }
01155 #endif
01156 }
01157
01158 void UWidget::OnUnblockHandler(void* widget, int cmd, int event)
01159 {
01160 #ifdef qGTK
01161     if(event == GDK_EXPOSE) {
01162         gtk_signal_handler_unblock_by_func( GTK_OBJECT(widget),
01163                                             GTK_SIGNAL_FUNC (gtkexposeevent),
01164                                             (gpointer)UMAKEINT(GetWidID(), cmd));
01165     }
01166 #endif
01167 }
01168
01169 int UWidget::OnGetState(int cmd)
01170 {
01171     void *w = GetWidget(cmd);
01172     if(w == 0L)
01173         return 0;
01174
01175     int state = 0; // sanity
01176
01177 #ifdef WIN32
01178     CWnd *wnd = (CWnd *)w;
01179
01180     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01181     {
01182         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01183         state = btn->GetCurrent();
01184     }
01185     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01186     {
01187         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01188         state = btn->GetState();
01189     }
01190     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01191     {
01192         CButton *btn = (CButton *)wnd;
01193         state = btn->GetCheck() != 0;
01194     }
01195     else
01196     {
01197         CString s;
01198         wnd->GetWindowText(s);
01199         sscanf(s, "%d", &state);
01200     }
01201 #endif
01202 #if qGTK
01203     if(GTK_IS_TOGGLE_BUTTON(w))
01204     {
01205         state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) != 0;
01206     }
01207     else if(GTK_IS_ENTRY(w))
01208     {
01209         gchar *text = gtk_entry_get_text(GTK_ENTRY(w));
01210         sscanf(text, "%d", &state);
01211     }
01212 #endif
01213 #if qMacPP
01214     LPane *view = (LPane *)w;
01215     LCheckBox *check;
01216     LRadioButton *rad;
01217     LEditText *edit;
01218     LStaticText *stat;
01219     LBevelButton *bevel;
01220     UPseudoRotButton *rot;
01221     LCheckBoxGroupBox *groupbox;
01222     LPageController *tabctrl;
01223     LTabsControl *tabctrl2;
01224     LControl *ctrl;
01225     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01226     {
01227         state = check->GetValue() == Button_On ? 1 : 0;
01228     }
01229     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01230     {
01231         state = rad->GetValue() == Button_On ? 1 : 0;
01232     }
01233     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01234     {
01235         LStr255 pstr;
01236         edit->GetText(pstr);
01237         state = (SInt32)pstr;
01238     }
01239     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01240     {
01241         LStr255 pstr;
01242         stat->GetText(pstr);
01243         state = (SInt32)pstr;
01244     }
01245     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01246     {
01247         state = groupbox->GetValue() == Button_On ? 1 : 0;
01248     }
01249     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01250     {
01251         state = rot->GetCurrentState();
01252     }
01253     else if((bevel = dynamic_cast<LBevelButton *>(view)) != 0L)
01254     {
01255         state = bevel->GetValue() == Button_On ? 1 : 0;
01256     }
01257     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01258     {
01259         state = tabctrl->GetCurrentPageIndex() - 1;
01260     }
01261     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01262     {
01263         state = tabctrl2->GetValue() - 1;
01264     }
01265     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01266     {
01267         state = ctrl->GetValue();
01268     }
01269 #endif
01270 #if qMacAPP
01271     TView *view = (TView *)w;
01272     if(MA_MEMBER(view, TCheckBox))
01273     {
01274         TCheckBox *check = (TCheckBox *)view;
01275         state = check->GetState();
01276     }
01277     else if(MA_MEMBER(view, TRadio))
01278     {
01279         TRadio *rad = (TRadio *)view;
01280         state = rad->GetState();
01281     }
01282     else if(MA_MEMBER(view, TNumberText))
01283     {
01284         TNumberText *num = (TNumberText *)view;
01285         state = num->GetValue();
01286     }
01287 #endif
01288
01289     return state;
01290 }
01291
01292 void UWidget::OnGetFloat(int cmd, float *f)
01293 {
01294     *f = 0.0; // sanity
01295
01296     void *w = GetWidget(cmd);
01297     if(w == 0L)
01298         return;
01299
01300 #if qMacPP
01301     LPane *view = (LPane *)w;
01302     LEditText *edit;
01303     LStaticText *stat;
01304     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01305     {
01306         LStr255 pstr;
01307         edit->GetText(pstr);
01308         *f = (double)pstr;
01309     }
01310     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01311     {
01312         LStr255 pstr;
01313         stat->GetText(pstr);
01314         *f = (double)pstr;
01315     }
01316 #endif
01317 #if qMacAPP
01318     TView *view = (TView *)w;
01319     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01320     {
01321         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01322         *f = num->GetValue();
01323     }
01324 #endif
01325 #ifdef WIN32
01326     CWnd *wnd = (CWnd *)w;
01327
01328     CString s;
01329     wnd->GetWindowText(s);
01330     sscanf(s, "%f", f);
01331 #endif
01332 }
01333
01334 void UWidget::OnSetState(int cmd, int state)
01335 {
01336     void *w = GetWidget(cmd);
01337     if(w == 0L)
01338         return;
01339
01340 #ifdef WIN32
01341     CWnd *wnd = (CWnd *)w;
01342
01343     if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoRotButton)))
01344     {
01345         CPseudoRotButton *btn = (CPseudoRotButton *)wnd;
01346         btn->DoRotate(state);
01347     }
01348     else if(wnd->IsKindOf(RUNTIME_CLASS(CPseudoToggle)))
01349     {
01350         CPseudoToggle *btn = (CPseudoToggle *)wnd;
01351         btn->SetState(state);
01352     }
01353     else if(wnd->IsKindOf(RUNTIME_CLASS(CButton)))
01354     {
01355         CButton *btn = (CButton *)wnd;
01356         btn->SetCheck(state != 0);
01357     }
01358     else
01359     {
01360         USemaphore policeman(m_noDispatch);
01361         char tmp[100];
01362         sprintf(tmp, "%d", state);
01363         wnd->SetWindowText(tmp);
01364     }
01365 #endif
01366 #if qGTK
01367     if(GTK_IS_TOGGLE_BUTTON(w))
01368     {
01369         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), state != 0);
01370     }
01371     else if(GTK_IS_ENTRY(w))
01372     {
01373         char tmp[20];
01374         sprintf(tmp, "%d", state);
01375         gtk_entry_set_text(GTK_ENTRY(w), tmp);
01376     }
01377 #endif
01378 #if qMacPP
01379     USemaphore policeman(gTurnOffBroadcast);
01380
01381     LPane *view = (LPane *)w;
01382     LCheckBox *check;
01383     LRadioButton *rad;
01384     LEditText *edit;
01385     LStaticText *stat;
01386     UPseudoRotButton *rot;
01387     LCheckBoxGroupBox *groupbox;
01388     LPageController *tabctrl;
01389     LTabsControl *tabctrl2;
01390     LControl *ctrl;
01391     if((check = dynamic_cast<LCheckBox *>(view)) != 0L)
01392     {
01393         check->SetValue(state ? Button_On : Button_Off);
01394     }
01395     else if((rad = dynamic_cast<LRadioButton *>(view)) != 0L)
01396     {
01397         rad->SetValue(state ? Button_On : Button_Off);
01398     }
01399     else if((groupbox = dynamic_cast<LCheckBoxGroupBox *>(view)) != 0L)
01400     {
01401         groupbox->SetValue(state ? Button_On : Button_Off);
01402     }
01403     else if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01404     {
01405         LStr255 pstr((SInt32)state);
01406         edit->SetText(pstr);
01407     }
01408     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01409     {
01410         LStr255 pstr((SInt32)state);
01411         stat->SetText(pstr);
01412     }
01413     else if((rot = dynamic_cast<UPseudoRotButton *>(view)) != 0L)
01414     {
01415         rot->DoRotate(state);
01416     }
01417     else if((tabctrl = dynamic_cast<LPageController *>(view)) != 0L)
01418     {
01419         tabctrl->SetSelectedPageButtonByIndex(state + 1, false);
01420     }
01421     else if((tabctrl2 = dynamic_cast<LTabsControl *>(view)) != 0L)
01422     {
01423         tabctrl2->SetValue(state + 1);
01424     }
01425     else if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01426     {
01427         ctrl->SetValue(state);
01428     }
01429 #endif
01430 #if qMacAPP
01431     TView *view = (TView *)w;
01432     if(MA_MEMBER(view, TCheckBox))
01433     {
01434         TCheckBox *check = (TCheckBox *)view;
01435         check->SetState(state, true);
01436     }
01437     else if(MA_MEMBER(view, TRadio))
01438     {
01439         TRadio *rad = (TRadio *)view;
01440         rad->SetState(state, true);
01441     }
01442     else if(MA_MEMBER(view, TNumberText))
01443     {
01444         TNumberText *num = (TNumberText *)view;
01445         num->SetValue(state, true);
01446     }
01447     else if(MA_MEMBER(view, TPseudoRotateIconButton))
01448     {
01449         TPseudoRotateIconButton *rot = (TPseudoRotateIconButton *)view;
01450         rot->DoRotate(state);
01451     }
01452     else if(MA_MEMBER(view, TProgressIndicator))
01453     {
01454         TProgressIndicator *progress = (TProgressIndicator *)view;
01455         progress->SetValue(state, true);
01456     }
01457 #endif
01458 }
01459
01460 void UWidget::OnSetFloat(int cmd, const float *f)
01461 {
01462     void *w = GetWidget(cmd);
01463     if(w == 0L)
01464         return;
01465
01466 #if qMacAPP
01467     TView *view = (TView *)w;
01468     if(MA_MEMBER(view, TPseudoDoubleNumberText))
01469     {
01470         TPseudoDoubleNumberText *num = (TPseudoDoubleNumberText *)view;
01471         num->SetValue(*f, true);
01472     }
01473 #endif
01474 #if qMacPP
01475     USemaphore policeman(gTurnOffBroadcast);
01476
01477     LPane *view = (LPane *)w;
01478     LEditText *edit;
01479     LStaticText *stat;
01480     if((edit = dynamic_cast<LEditText *>(view)) != 0L)
01481     {
01482         LStr255 pstr((long double)*f, "\p#####.##");
01483         edit->SetText(pstr);
01484     }
01485     else if((stat = dynamic_cast<LStaticText *>(view)) != 0L)
01486     {
01487         LStr255 pstr((long double)*f, "\p#####.##");
01488         stat->SetText(pstr);
01489     }
01490 #endif
01491 #ifdef WIN32
01492     USemaphore policeman(m_noDispatch);
01493     CWnd *wnd = (CWnd *)w;
01494
01495     char tmp[100];
01496     sprintf(tmp, "%f", *f);
01497     wnd->SetWindowText(tmp);
01498 #endif
01499 }
01500
01501 void UWidget::OnEnableCmd(int cmd, int state)
01502 {
01503     void *w = GetWidget(cmd);
01504     if(w == 0L)
01505         return;
01506
01507 #if qMacPP
01508     LPane *view = (LPane *)w;
01509     if(state)
01510         view->Enable();
01511     else
01512         view->Disable();
01513 #endif
01514 #if qMacAPP
01515     TView *view = (TView *)w;
01516     if(MA_MEMBER(view, TView))
01517     {
01518         view->SetActiveState(state != 0, true);
01519     }
01520 #endif
01521 #if qGTK
01522     if(GTK_IS_WIDGET(w))
01523     {
01524         gtk_widget_set_sensitive(GTK_WIDGET(w), state != 0);
01525     }
01526 #endif
01527 #ifdef WIN32
01528     CWnd *wnd = (CWnd *)w;
01529
01530     wnd->EnableWindow(state != 0);
01531 #endif
01532 }
01533
01534 void UWidget::OnChgFocus(int cmd)
01535 {
01536     void *w = GetWidget(cmd);
01537     if(w == 0L)
01538         return;
01539
01540 #if qMacPP
01541     LPane *pane = (LPane *)w;
01542     LCommander *target = dynamic_cast<LCommander *>(pane);
01543     if(target != 0L)
01544     {
01545         LCommander::SwitchTarget(target);
01546     }
01547 #endif
01548 #if qMacAPP
01549     TView *view = (TView *)w;
01550     if(MA_MEMBER(view, TView))
01551     {
01552         if(view->GetWindow() != 0L)
01553             view->GetWindow()->SetWindowTarget(view);
01554     }
01555 #endif
01556 #if qGTK
01557     if(GTK_IS_WIDGET(w))
01558     {
01559         gtk_widget_grab_focus(GTK_WIDGET(w)); // TODO doesn't work
01560     }
01561 #endif
01562 #ifdef WIN32
01563     CWnd *wnd = (CWnd *)w;
01564
01565     wnd->SetFocus();
01566 #endif
01567 }
01568
01569 void UWidget::OnInvalidate(int cmd)
01570 {
01571     void *w = GetWidget(cmd);
01572     if(w == 0L)
01573         return;
01574
01575 #if qMacAPP
01576     TView *view = (TView *)w;
01577     if(MA_MEMBER(view, TView))
01578     {
01579         view->ForceRedraw();
01580     }
01581 #endif
01582 #if qMacPP
01583     LPane *pane = (LPane *)w;
01584     pane->Refresh();
01585 #endif
01586 #ifdef WIN32
01587     CWnd *wnd = (CWnd *)w;
01588
01589     wnd->Invalidate();
01590 #endif
01591 }
01592
01593 void UWidget::OnRedraw(int cmd)
01594 {
01595     void *w = GetWidget(cmd);
01596     if(w == 0L)
01597         return;
01598
01599 #if qMacAPP
01600     TView *view = (TView *)w;
01601     if(MA_MEMBER(view, TView))
01602     {
01603         view->ForceRedraw();
01604     }
01605 #endif
01606 #if qMacPP
01607     LPane *pane = (LPane *)w;
01608     pane->Draw(nil);
01609 #endif
01610 #ifdef WIN32
01611     CWnd *wnd = (CWnd *)w;
01612
01613     wnd->Invalidate();
01614 #endif
01615 }
01616
01617 void UWidget::OnSetText(int cmd, const char *text)
01618 {
01619     void *w = GetWidget(cmd);
01620     if(w == 0L)
01621         return;
01622
01623 #ifdef WIN32
01624     USemaphore policeman(m_noDispatch);
01625     CWnd *wnd = (CWnd *)w;
01626     wnd->SetWindowText(text);
01627 #endif
01628 #if qGTK
01629     if(GTK_IS_WINDOW(w))
01630     {
01631         gtk_window_set_title(GTK_WINDOW(w), text);
01632     }
01633     else if(GTK_IS_BUTTON(w))
01634     {
01635         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01636         if(label != 0L)
01637             gtk_label_set_text(label, text);
01638         else
01639             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01640     }
01641     else if(GTK_IS_TEXT(w))
01642     {
01643         GtkText *t = GTK_TEXT(w);
01644         gtk_text_set_point(t, 0);
01645         gtk_text_forward_delete(t, gtk_text_get_length(t));
01646         gtk_text_insert(t, 0L, 0L, 0L, text, -1);
01647     }
01648     else if(GTK_IS_ENTRY(w))
01649     {
01650         gtk_entry_set_text(GTK_ENTRY(w), text);
01651     }
01652     else if(GTK_IS_COMBO(w))
01653     {
01654         gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry), text);
01655     }
01656     else if(GTK_IS_LABEL(w))
01657     {
01658         GtkLabel *t = GTK_LABEL(w);
01659         gtk_label_set_text(t, text);
01660     }
01661 #endif
01662 #if qMacPP
01663     USemaphore policeman(gTurnOffBroadcast);
01664
01665     LPane *view = (LPane *)w;
01666     LTextEditView *txt;
01667     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01668     {
01669         txt->SetTextPtr((Ptr)text, strlen(text));
01670     }
01671     else
01672     {
01673         LStr255 pstr(text);
01674         LStr255 oldstr;
01675         view->GetDescriptor(oldstr);
01676         if(oldstr != pstr)
01677             view->SetDescriptor(pstr);
01678     }
01679 #endif
01680 #if qMacAPP
01681     TView *view = (TView *)w;
01682     if(MA_MEMBER(view, TCtlMgr))
01683     {
01684         TCtlMgr *ctrl = (TCtlMgr *)view;
01685         CStr255_AC pstr(text);
01686         ctrl->SetText(pstr, true);
01687     }
01688     else if(MA_MEMBER(view, TStaticText))
01689     {
01690         TStaticText *ctrl = (TStaticText *)view;
01691         CStr255_AC pstr(text);
01692         ctrl->SetText(pstr, true);
01693     }
01694     else if(MA_MEMBER(view, TWindow))
01695     {
01696         TWindow *ctrl = (TWindow *)view;
01697         CStr255_AC pstr(text);
01698         ctrl->SetTitle(pstr);
01699     }
01700 #endif
01701 }
01702
01703 void UWidget::OnGetText(int cmd, UStr *text)
01704 {
01705     *text = ""; // sanity
01706
01707     void *w = GetWidget(cmd);
01708     if(w == 0L)
01709         return;
01710
01711 #ifdef WIN32
01712     CWnd *wnd = (CWnd *)w;
01713
01714     CString s;
01715     wnd->GetWindowText(s);
01716     *text = s;
01717 #endif
01718 #if qGTK
01719     if(GTK_IS_WINDOW(w))
01720     {
01721         *text = GTK_WINDOW(w)->title;
01722     }
01723     else if(GTK_IS_BUTTON(w))
01724     {
01725         GtkLabel *label = getLabelFromContainer(GTK_CONTAINER(w));
01726         if(label != 0L)
01727         {
01728             gchar *str;
01729             gtk_label_get(label, &str);
01730
01731             if(str != 0L)
01732                                 *text = str;
01733         }
01734         else
01735             g_warning("Cannot find the label of '%s'\n", gtk_widget_get_name(GTK_WIDGET(w)));
01736     }
01737     else if(GTK_IS_ENTRY(w))
01738     {
01739         *text = gtk_entry_get_text(GTK_ENTRY(w));
01740     }
01741     else if(GTK_IS_COMBO(w))
01742     {
01743         *text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w)->entry));
01744     }
01745     else if(GTK_IS_TEXT(w))
01746     {
01747         GtkText *t = GTK_TEXT(w);
01748         size_t size = gtk_text_get_length(t);
01749         size_t idx;
01750
01751         for (idx = 0; idx < size; idx++) {
01752             *text << (char)GTK_TEXT_INDEX(t,idx);
01753         }
01754     }
01755     else if(GTK_IS_LABEL(w))
01756     {
01757         GtkLabel *t = GTK_LABEL(w);
01758         gchar *str;
01759         gtk_label_get(t, &str);
01760         if(str != 0L)
01761             *text = str;
01762     }
01763 #endif
01764 #if qMacPP
01765     LPane *view = (LPane *)w;
01766     LTextEditView *txt;
01767     if((txt = dynamic_cast<LTextEditView *>(view)) != 0L)
01768     {
01769         LStr255 pstr;
01770         Handle hdl = txt->GetTextHandle();
01771         text->set((const char *)*hdl, ::GetHandleSize(hdl));
01772     }
01773     else
01774     {
01775         LStr255 pstr;
01776         view->GetDescriptor(pstr);
01777         *text = pstr;
01778     }
01779 #endif
01780 #if qMacAPP
01781     TView *view = (TView *)w;
01782     if(MA_MEMBER(view, TCtlMgr))
01783     {
01784         TCtlMgr *ctrl = (TCtlMgr *)view;
01785         CStr255_AC pstr = ctrl->GetText();
01786         *text = pstr;
01787     }
01788     else if(MA_MEMBER(view, TStaticText))
01789     {
01790         TStaticText *ctrl = (TStaticText *)view;
01791         CStr255_AC pstr = ctrl->GetText();
01792         *text = pstr;
01793     }
01794     else if(MA_MEMBER(view, TWindow))
01795     {
01796         TWindow *ctrl = (TWindow *)view;
01797         CStr255_AC pstr = ctrl->GetTitle();
01798         *text = pstr;
01799     }
01800 #endif
01801 }
01802
01803 void UWidget::OnShowWidget(int cmd, int state)
01804 {
01805     void *w = GetWidget(cmd);
01806     if(w == 0L)
01807         return;
01808
01809 #ifdef WIN32
01810     CWnd *wnd = (CWnd *)w;
01811
01812     wnd->ShowWindow(state ? SW_SHOWNORMAL : SW_HIDE);
01813 #endif
01814 #if qGTK
01815     GtkWidget *wid = (GtkWidget *)w;
01816     if(state)
01817         gtk_widget_show(wid);
01818     else
01819         gtk_widget_hide(wid);
01820 #endif
01821 #if qMacAPP
01822     TView *view = (TView *)w;
01823     view->Show(state != 0, true);
01824 #endif
01825 #if qMacPP
01826     LPane *view = (LPane *)w;
01827     if(state)
01828         view->Show();
01829     else
01830         view->Hide();
01831 #endif
01832 }
01833
01834
01835 void UWidget::OnSetSlider(int cmd, int pos)
01836 {
01837     void *w = GetWidget(cmd);
01838     if(w == 0L)
01839         return;
01840
01841 #ifdef WIN32
01842     CWnd *wnd = (CWnd *)w;
01843
01844     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01845     {
01846         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01847         slider->SetPos(pos);
01848     }
01849     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01850     {
01851         CScrollBar *scroll = (CScrollBar *)wnd;
01852         scroll->SetScrollPos(pos);
01853     }
01854 #endif
01855 #if qMacAPP
01856     TView *view = (TView *)w;
01857     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01858     {
01859         TCtlMgr *ctrl = (TCtlMgr *)view;
01860         ctrl->SetValue(pos, true);
01861     }
01862 #endif
01863 #if qMacPP
01864     USemaphore policeman(gTurnOffBroadcast);
01865
01866     LPane *view = (LPane *)w;
01867     LControl *ctrl;
01868     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01869     {
01870         ctrl->SetValue(pos);
01871     }
01872 #endif
01873 }
01874
01875
01876 void UWidget::OnGetSliderProperty(int cmd, USLIDER *prop)
01877 {
01878     void *w = GetWidget(cmd);
01879     if(w == 0L)
01880         return;
01881
01882 #ifdef WIN32
01883     CWnd *wnd = (CWnd *)w;
01884
01885     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01886     {
01887         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01888         prop->max = slider->GetRangeMax();
01889         prop->min = slider->GetRangeMin();
01890         prop->inc = slider->GetPageSize();
01891         prop->pos = slider->GetPos();
01892     }
01893     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01894     {
01895         SCROLLINFO info;
01896         CScrollBar *scroll = (CScrollBar *)wnd;
01897         VERIFY(scroll->GetScrollInfo(&info));
01898         prop->max = info.nMax;
01899         prop->min = info.nMin;
01900         prop->inc = info.nPage;
01901         prop->pos = info.nPos;
01902     }
01903 #endif
01904 #if qMacAPP
01905     TView *view = (TView *)w;
01906     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01907     {
01908         TCtlMgr *ctrl = (TCtlMgr *)view;
01909         prop->max = ctrl->GetMaximum();
01910         prop->min = ctrl->GetMinimum();
01911         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01912             prop->inc = ((TPseudoScrollBar *)ctrl)->fPageStep;
01913         else
01914             prop->inc = 1;
01915         prop->pos = ctrl->GetValue();
01916     }
01917 #endif
01918 #if qMacPP
01919     LPane *view = (LPane *)w;
01920     LControl *ctrl;
01921     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01922     {
01923         prop->max = ctrl->GetMaxValue();
01924         prop->min = ctrl->GetMinValue();
01925         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01926         prop->inc = attach != 0L ? attach->GetPageValue(cmd) : 1;
01927         prop->pos = ctrl->GetValue();
01928     }
01929 #endif
01930 }
01931
01932 void UWidget::OnSetSliderProperty(int cmd, const USLIDER *prop)
01933 {
01934     void *w = GetWidget(cmd);
01935     if(w == 0L)
01936         return;
01937
01938 #ifdef WIN32
01939     CWnd *wnd = (CWnd *)w;
01940
01941     if(wnd->IsKindOf(RUNTIME_CLASS(CSliderCtrl)))
01942     {
01943         CSliderCtrl *slider = (CSliderCtrl *)wnd;
01944         slider->SetRange(prop->min, prop->max);
01945         slider->SetPos(prop->pos);
01946         slider->SetPageSize(prop->inc);
01947     }
01948     else if(wnd->IsKindOf(RUNTIME_CLASS(CScrollBar)))
01949     {
01950         SCROLLINFO info;
01951         memset(&info, 0, sizeof(info));
01952         info.cbSize = sizeof(info);
01953         info.fMask = SIF_DISABLENOSCROLL | SIF_PAGE | SIF_POS | SIF_RANGE;
01954         info.nMax = prop->max;
01955         info.nMin = prop->min;
01956         info.nPos = prop->pos;
01957         info.nPage = prop->inc;
01958         if(info.nPage > (UINT)(info.nMax - info.nMin))
01959             info.nPage = (UINT)(info.nMax - info.nMin) / 2;
01960         CScrollBar *scroll = (CScrollBar *)wnd;
01961         VERIFY(scroll->SetScrollInfo(&info));
01962         if(prop->max != prop->min)
01963             scroll->EnableWindow(TRUE);
01964     }
01965 #endif
01966 #if qMacAPP
01967     TView *view = (TView *)w;
01968     if(MA_MEMBER(view, TSlider) || MA_MEMBER(view, TScrollBar))
01969     {
01970         TCtlMgr *ctrl = (TCtlMgr *)view;
01971         ctrl->SetValues(prop->pos, prop->min, prop->max, true);
01972         if(MA_MEMBER(ctrl, TPseudoScrollBar))
01973             ((TPseudoScrollBar *)ctrl)->fPageStep = prop->inc;
01974     }
01975 #endif
01976 #if qMacPP
01977     USemaphore policeman(gTurnOffBroadcast);
01978
01979     LPane *view = (LPane *)w;
01980     LControl *ctrl;
01981     if((ctrl = dynamic_cast<LControl *>(view)) != 0L)
01982     {
01983         ctrl->SetMaxValue(prop->max);
01984         ctrl->SetMinValue(prop->min);
01985         ctrl->SetValue(prop->pos);
01986         LPseudoWinAttachment *attach = macpp_getattachwindow(this);
01987         if(attach != 0L)
01988             attach->SetPageValue(cmd, prop->inc);
01989     }
01990 #endif
01991 }
01992
01993 void UWidget::AddTimer(long lap, int cmd)
01994 {
01995     UTimer timer(lap, ::UTickCount(), cmd);
01996     m_timers.push_back(timer);
01997 }
01998
01999 void UWidget::RemoveTimer(int cmd)
02000 {
02001     std::vector<UTimer>::iterator i;
02002     for(i = m_timers.begin(); i != m_timers.end(); i++)
02003     {
02004         if((*i).m_cmd == cmd)
02005         {
02006             (*i).m_cmd = 0; // delay removing
02007             break;
02008         }
02009     }
02010 }
02011
02012 std::vector<UTimer> & UWidget::GetTimers(void)
02013 {
02014     // removed the delayed items
02015     std::vector<UTimer>::iterator i;
02016     for(i = m_timers.begin(); i != m_timers.end(); ++i)
02017     {
02018         if((*i).m_cmd == 0)
02019         {
02020             m_timers.erase(i);
02021             break;
02022         }
02023     }
02024
02025     return m_timers;
02026 }
02027
02028 void UWidget::OnUpdateUI()
02029 {
02030     std::map<int, void *>::const_iterator i;
02031     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
02032     {
02033         UCmdUI pUI((*i).first);
02034         pUI.m_widget = (*i).second;
02035         UEventSendMessage(GetWidID(), EV_UPDTCMD, pUI.m_nID, &pUI);
02036     }
02037 }
02038
02039 bool UWidget::DoModal(int id)
02040 {
02041     bool result = false;
02042
02043 #if !defined(qMacAPP) && !defined(qMacPP) && !defined(WIN32)
02044     void *w = GetWidget(kUMainWidget);
02045     if(w == 0L)
02046     {
02047         UAppConsole("Unable to find widget id : %d (file %s:%d)\n", kUMainWidget, __FILE__, __LINE__);
02048         return result;
02049     }
02050 #endif // !qMacAPP && !WIN32
02051
02052 #if qGTK || qMacPP
02053     if(m_modalLoop)
02054     {
02055         UAppConsole("Trying to break a modal state\n");
02056         return result;
02057     }
02058 #endif
02059
02060 #ifdef WIN32
02061     CPseudoDlg dlg(id, this);
02062     m_curModal = &dlg;
02063     result = dlg.DoModal() == IDOK;
02064     if(!result)
02065         Dismiss();
02066     m_curModal = 0L;
02067 #endif
02068 #if qMacAPP
02069     TWindow *view = gViewServer->NewTemplateWindow(id, nil);
02070     ThrowIfNULL_AC(view);
02071
02072     UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, view);
02073
02074     DoDataExchange(true);
02075     IDType resid = view->PoseModally();
02076
02077     TDialogBehavior* dlgb;
02078     if((dlgb = view->GetDialogBehavior()) != 0L)
02079     {
02080         result = resid == dlgb->fDefaultItem;
02081     }
02082
02083     if(result)
02084         DoDataExchange(false);
02085     else
02086         Dismiss();
02087
02088     view->Close();
02089 #endif
02090 #if qMacPP
02091     StDialogHandler theHandler(id, LCommander::GetTopCommander());
02092     LWindow *theDialog = theHandler.GetDialog();
02093
02094     if(theDialog != 0L)
02095     {
02096         UEventSendMessage(GetWidID(), EV_INIT_WIDGET, kUMainWidget, theDialog);
02097
02098         DoDataExchange(true);
02099         theDialog->Show();
02100         theHandler.SetSleepTime(0);
02101
02102         m_modalLoop = true;
02103         MessageT hitMessage;
02104         while (m_modalLoop)
02105         {       // Let DialogHandler process events
02106             hitMessage = theHandler.DoDialog();
02107
02108             if (hitMessage == msg_OK || hitMessage == msg_Cancel)
02109                 break;
02110         }
02111
02112         result = m_modalLoop ? hitMessage == msg_OK : m_modalRes;
02113
02114         if(result)
02115             DoDataExchange(false);
02116         else
02117             Dismiss();
02118
02119         //theDialog->Hide();
02120         //theDialog->DoClose();
02121     }
02122 #endif
02123 #if qGTK
02124     if(GTK_IS_WINDOW(w))
02125     {
02126         // emulate the click in tab 1
02127         std::map<int, UWidget *>::iterator i;
02128         for(i = m_tabs.begin(); i != m_tabs.end(); ++i)
02129         {
02130             int cmdid = ULOWORD((*i).first);
02131             int pagenum = UHIWORD((*i).first);
02132             if(pagenum == 0)
02133             {
02134                 UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(cmdid, pagenum), 0L);
02135                 break;
02136             }
02137         }
02138         gtk_signal_connect(GTK_OBJECT(w),"delete_event", GTK_SIGNAL_FUNC(gtkcancel), this);
02139         DoDataExchange(true);
02140         gtk_widget_show(GTK_WIDGET(w));
02141         m_modalLoop = true;
02142         gtk_grab_add (GTK_WIDGET(w));
02143         while (m_modalLoop)
02144         {
02145             if( gtk_main_iteration_do(TRUE))
02146                 break;
02147         }
02148         gtk_grab_remove (GTK_WIDGET(w));
02149         result = m_modalRes;
02150         m_modalLoop = false; // sanity...
02151         if(result)
02152         {
02153             UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(0, -1), 0L);
02154             DoDataExchange(false);
02155         }
02156         else
02157         {
02158             Dismiss();
02159         }
02160         gtk_widget_destroy(GTK_WIDGET(w));
02161     }
02162     else
02163         g_warning("Trying to modal on a non-window\n");
02164 #endif
02165
02166     return result;
02167 }
02168
02169 void UWidget::EndModal(bool result)
02170 {
02171     m_modalRes = result;
02172 #if qGTK || qMacPP
02173     if(!m_modalLoop)
02174         UAppConsole("EndModal called twice\n");
02175
02176     m_modalLoop = false;
02177 #endif
02178 #if qMacAPP
02179     void *w = GetWidget(kUMainWidget);
02180     if(w == 0L)
02181         return;
02182
02183     TWindow *wind = (TWindow *)w;
02184     TDialogBehavior* dlgb;
02185     if(MA_MEMBER(wind, TWindow) && (dlgb = wind->GetDialogBehavior()) != 0L)
02186     {
02187         wind->Dismiss(result ? dlgb->fDefaultItem : dlgb->fCancelItem, result);
02188     }
02189 #endif
02190 #ifdef WIN32
02191     if(m_curModal != 0L)
02192     {
02193         if (result && !m_curModal->UpdateData(TRUE))
02194         {
02195             TRACE0("UpdateData failed during dialog termination.\n");
02196             // the UpdateData routine will set focus to correct item
02197             return;
02198         }
02199         m_curModal->EndDialog(result ? IDOK : IDCANCEL);
02200     }
02201 #endif
02202 }
02203
02204 void UWidget::OnChgCursor(int cmd, UCURSOR cursor)
02205 {
02206     void *w = GetWidget(cmd);
02207     if(w == 0L)
02208         return;
02209
02210 #if qGTK
02211     if(GTK_IS_WIDGET(w) && GTK_WIDGET(w)->window != 0L)
02212     {
02213         static GdkCursor *cursor_arrow=0L;
02214         static GdkCursor *cursor_watch=0L;
02215         if(cursor_arrow == 0L)
02216         {
02217             cursor_arrow = gdk_cursor_new (GDK_TOP_LEFT_ARROW);
02218             cursor_watch = gdk_cursor_new (GDK_WATCH);
02219         }
02220         if(cursor == uCursArrow)
02221             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_arrow);
02222         else if(cursor == uCursWatch)
02223             gdk_window_set_cursor (GTK_WIDGET(w)->window, cursor_watch);
02224     }
02225 #endif
02226 }
02227
02228 void UWidget::OnTreeResetAll(int cmd)
02229 {
02230     void *w = GetWidget(cmd);
02231     if(w == 0L)
02232         return;
02233
02234 #if qGTK
02235     if(!GTK_IS_TREE(w))
02236         return;
02237
02238     GtkTree *tree = GTK_TREE(w);
02239     GList *list = g_list_copy(tree->children);
02240     GList *head = list;
02241     while(list != 0L)
02242     {
02243         GtkWidget *wid = GTK_WIDGET(list->data);
02244         gtk_container_remove(GTK_CONTAINER(tree), wid);
02245         list = (GList *)g_list_next(list);
02246     }
02247     g_list_free(head);
02248 #endif
02249 }
02250
02251 void UWidget::OnTreeInsert(int cmd, UTREE_INSERT *data)
02252 {
02253     data->result = 0L; // sanity
02254
02255     void *w = GetWidget(cmd);
02256     if(w == 0L)
02257         return;
02258
02259 #if qGTK
02260   if(!GTK_IS_TREE(w))
02261         return;
02262
02263     GtkTree *root;
02264     if(data->parent == 0L)
02265         root = GTK_TREE(w);
02266     else
02267     {
02268         GtkTreeItem *item = GTK_TREE_ITEM(data->parent);
02269
02270         if(item->subtree != 0L) {
02271             root = GTK_TREE(item->subtree);
02272         }
02273         else
02274         {
02275             root = GTK_TREE(gtk_tree_new());
02276             gtk_object_set_data(GTK_OBJECT(root), "rf_treeparent", item);
02277             gtk_tree_set_selection_mode (root, GTK_SELECTION_BROWSE); // TODO : find out it with the root
02278             gtk_tree_set_view_mode (root, GTK_TREE_VIEW_ITEM); // TODO : find out it with the root
02279             gtk_tree_item_set_subtree (item, GTK_WIDGET(root));
02280         }
02281     }
02282
02283   GtkTreeItem *item = gtknewtreeitem(data->title, data->icon == 0L ? 0L : GTK_PIXMAP(data->icon));
02284     gtk_object_set_data(GTK_OBJECT(item), "rf_treeitemdata", data->data);
02285     gtk_signal_connect(GTK_OBJECT(item), "select",
02286                        GTK_SIGNAL_FUNC(gtktreeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02287     gtk_signal_connect(GTK_OBJECT(item), "deselect",
02288                        GTK_SIGNAL_FUNC(gtktreedeselect), (gpointer)UMAKEINT(GetWidID(), cmd));
02289     gtk_signal_connect (GTK_OBJECT(item), "expand",
02290                         GTK_SIGNAL_FUNC(gtktreeexpand), (gpointer)UMAKEINT(GetWidID(), cmd));
02291     gtk_signal_connect (GTK_OBJECT(item), "collapse",
02292                         GTK_SIGNAL_FUNC(gtktreecollapse), (gpointer)UMAKEINT(GetWidID(), cmd));
02293
02294     gtk_tree_append(GTK_TREE(root), GTK_WIDGET(item));
02295   gtk_widget_show (GTK_WIDGET(item));
02296
02297     data->result = (UTREEITEM)item;
02298 #endif
02299 }
02300
02301 void UWidget::OnTreeSetData(int cmd, UTREE_INFO *data)
02302 {
02303     void *w = GetWidget(cmd);
02304     if(w == 0L)
02305         return;
02306
02307 #if qGTK
02308     if(!GTK_IS_TREE(w))
02309         return;
02310
02311     gtk_object_set_data(GTK_OBJECT(data->item), "rf_treeitemdata", data->data);
02312 #endif
02313 }
02314
02315 void UWidget::OnTreeSetIcon(int cmd, UTREE_INFO *data)
02316 {
02317     void *w = GetWidget(cmd);
02318     if(w == 0L)
02319         return;
02320
02321 #if qGTK
02322     if(!GTK_IS_TREE(w))
02323         return;
02324
02325     gtksettreeitemicon(GTK_TREE_ITEM(data->item), GTK_PIXMAP(data->icon));
02326 #endif
02327 }
02328
02329 void UWidget::OnTreeGetSel(int cmd, UTREEITEM *item)
02330 {
02331     *item = 0L; // sanity
02332
02333     void *w = GetWidget(cmd);
02334     if(w == 0L)
02335         return;
02336
02337 #if qGTK
02338     if(!GTK_IS_TREE(w))
02339         return;
02340
02341     GList *sel = GTK_TREE(w)->selection;
02342     if(sel == 0L || !GTK_IS_TREE_ITEM(sel->data))
02343         return;
02344
02345     *item = sel->data;
02346 #endif
02347 }
02348
02349 void UWidget::OnTreeGetInfo(int cmd, UTREE_INFO *desc)
02350 {
02351     // sanity
02352     desc->parent = 0L;
02353     desc->next = 0L;
02354     desc->child = 0L;
02355     desc->data = 0L;
02356     desc->title = 0L;
02357     desc->icon = 0L;
02358     desc->expanded = 0;
02359
02360     void *w = GetWidget(cmd);
02361     if(w == 0L)
02362         return;
02363
02364 #if qGTK
02365     if(!GTK_IS_TREE(w))
02366         return;
02367
02368     GtkTreeItem *item;
02369     if(desc->item == 0L)
02370     {
02371         GList *list = g_list_first(GTK_TREE(w)->children);
02372         GList *next = g_list_next(list);
02373         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02374         desc->item = item;
02375         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02376     }
02377     else
02378     {
02379         GtkTree *parent = GTK_TREE(GTK_WIDGET(desc->item)->parent);
02380         GList *list = g_list_find(GTK_TREE(parent)->children, desc->item);
02381         GList *next = g_list_next(list);
02382         item = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02383         desc->item = item;
02384         // the only way I found to guess the TREE_ITEM parent
02385         desc->parent = parent == w ? 0L : GTK_TREE_ITEM(gtk_object_get_data(GTK_OBJECT(parent), "rf_treeparent"));
02386         g_assert(desc->parent == 0L || GTK_IS_TREE_ITEM(desc->parent));
02387         desc->next = next != 0L ? GTK_TREE_ITEM(next->data) : 0L;
02388     }
02389     if(item != 0L)
02390     {
02391         if(item->subtree != 0L)
02392         {
02393             GtkTree *subtree = GTK_TREE(item->subtree);
02394             GList *list = g_list_first(GTK_TREE(subtree)->children);
02395             desc->child = list != 0L ? GTK_TREE_ITEM(list->data) : 0L;
02396         }
02397         desc->data = gtk_object_get_data(GTK_OBJECT(item), "rf_treeitemdata");
02398         GtkLabel *label = gtktreegetlabel(GTK_WIDGET(item));
02399         if(label != 0L)
02400             gtk_label_get(label, &desc->title);
02401         desc->expanded = item->expanded;
02402     }
02403 #endif
02404 }
02405
02406 void UWidget::OnTreeDelete(int cmd, UTREEITEM item)
02407 {
02408     // sanity
02409     void *w = GetWidget(cmd);
02410     if(w == 0L)
02411         return;
02412
02413 #if qGTK
02414     if(!GTK_IS_TREE(w) || item == 0L)
02415         return;
02416
02417     GtkTreeItem *i = GTK_TREE_ITEM(item);
02418
02419     GtkTree *parent = GTK_TREE(GTK_WIDGET(i)->parent);
02420     if (parent == 0L)
02421         return;
02422
02423     gtk_container_remove(GTK_CONTAINER(parent), GTK_WIDGET(i));
02424 #endif
02425 }
02426
02427 void UWidget::OnTreeExpand(int cmd, int collapse, UTREEITEM item)
02428 {
02429     // sanity
02430     void *w = GetWidget(cmd);
02431     if(w == 0L)
02432         return;
02433
02434 #if qGTK
02435   if(!GTK_IS_TREE(w) || item == 0L)
02436         return;
02437
02438   GtkTreeItem *i = GTK_TREE_ITEM(item);
02439
02440   gtktreesort(GTK_TREE(i->subtree));
02441
02442     int collapsed = !i->expanded;
02443     if((collapsed != 0) ^ (collapse != 0))
02444     {
02445         if(!collapse)
02446             gtk_tree_item_expand(i);
02447         else
02448             gtk_tree_item_collapse(i);
02449     }
02450 #endif
02451 }
02452
02453 void UWidget::OnTreeSelect(int cmd, int deselect, UTREEITEM item)
02454 {
02455     // sanity
02456     void *w = GetWidget(cmd);
02457     if(w == 0L)
02458         return;
02459
02460 #if qGTK
02461     if(!GTK_IS_TREE(w) || item == 0L)
02462         return;
02463
02464     GList *sel = GTK_TREE(w)->selection;
02465     while(sel)
02466     {
02467         gtk_tree_item_deselect(GTK_TREE_ITEM(sel->data));
02468         sel = g_list_next(sel);
02469     }
02470
02471     GtkWidget *i = GTK_WIDGET(item);
02472     if(!deselect)
02473         gtk_tree_select_child(GTK_TREE(w), i);
02474     else
02475         gtk_tree_unselect_child(GTK_TREE(w), i);
02476 #endif
02477 }
02478
02479 void UWidget::OnComboResetAll(int cmd)
02480 {
02481     void *w = GetWidget(cmd);
02482     if(w == 0L)
02483         return;
02484
02485 #ifdef WIN32
02486     CWnd *wnd = (CWnd *)w;
02487
02488     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02489     {
02490         CComboBox *combo = (CComboBox *)wnd;
02491         combo->ResetContent();
02492     }
02493 #endif
02494 #if qGTK
02495     if(GTK_IS_COMBO(w))
02496     {
02497         GtkList *listbox = GTK_LIST( GTK_COMBO(w)->list );
02498         if(listbox && listbox->children != 0L)
02499             gtk_list_remove_items( listbox, g_list_copy(listbox->children));
02500     }
02501     else if(GTK_IS_OPTION_MENU(w))
02502     {
02503         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02504         GList *list = g_list_copy(GTK_MENU_SHELL(menu)->children);
02505         GList *head = list;
02506         while(list != 0L)
02507         {
02508             GtkWidget *wid = GTK_WIDGET(list->data);
02509             gtk_container_remove(GTK_CONTAINER(menu), wid);
02510             list = (GList *)g_list_next(list);
02511         }
02512         g_list_free(head);
02513     }
02514 #endif
02515 #if qMacPP
02516     LPane *view = (LPane *)w;
02517     LMenuController *popup;
02518     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02519     {
02520         USemaphore policeman(gTurnOffBroadcast);
02521
02522         popup->DeleteAllMenuItems();
02523     }
02524 #endif
02525 #if qMacAPP
02526     TView *view = (TView *)w;
02527     if(MA_MEMBER(view, TPopup))
02528     {
02529         TPopup *popup = (TPopup *)view;
02530         while(popup->GetNumberOfItems() > 0)
02531             popup->DeleteItem(1);
02532     }
02533 #endif
02534 }
02535
02536 void UWidget::OnComboAppend(int cmd, const char *txt)
02537 {
02538     void *w = GetWidget(cmd);
02539     if(w == 0L)
02540         return;
02541
02542 #ifdef WIN32
02543     CWnd *wnd = (CWnd *)w;
02544
02545     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02546     {
02547         CComboBox *combo = (CComboBox *)wnd;
02548         combo->InsertString(-1, txt);
02549     }
02550 #endif
02551 #if qGTK
02552     if(GTK_IS_COMBO(w))
02553     {
02554         GtkWidget *list = GTK_COMBO(w)->list;
02555         GtkWidget *list_item = gtk_list_item_new_with_label(txt);
02556         gtk_container_add( GTK_CONTAINER(list), list_item );
02557         gtk_widget_show( list_item );
02558
02559         gtk_signal_connect( GTK_OBJECT(list_item), "select",
02560                             GTK_SIGNAL_FUNC(gtkcomboclicked), (gpointer)UMAKEINT(GetWidID(), cmd) );
02561     }
02562     else if(GTK_IS_OPTION_MENU(w))
02563     {
02564         GtkWidget *menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
02565         GtkWidget *item = gtk_menu_item_new_with_label(txt);
02566         // fix me: where to find the label of the item ?
02567         gtk_object_set_data_full(GTK_OBJECT(item), "rf_menuitemtext", strdup(txt), (GtkDestroyNotify)free);
02568         gtk_signal_connect (GTK_OBJECT(item), "activate",
02569             GTK_SIGNAL_FUNC(gtkmenuactivated), (gpointer)UMAKEINT(GetWidID(), cmd));
02570         gtk_widget_show(item);
02571         gtk_menu_append(GTK_MENU(menu), item);
02572     }
02573 #endif
02574 #if qMacPP
02575     LPane *view = (LPane *)w;
02576     LMenuController *popup;
02577     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02578     {
02579         USemaphore policeman(gTurnOffBroadcast);
02580
02581         if(strcmp(txt, "-") == 0)
02582             popup->InsertMenuItem("\p(-", max_Int16, false);
02583         else
02584             popup->InsertMenuItem(LStr255(txt), max_Int16);
02585     }
02586 #endif
02587 #if qMacAPP
02588     TView *view = (TView *)w;
02589     if(MA_MEMBER(view, TPopup))
02590     {
02591         TPopup *popup = (TPopup *)view;
02592         if(strcmp(txt, "-") == 0)
02593             popup->AddSeparator();
02594         else
02595             popup->AddItem(CStr255_AC(txt));
02596     }
02597 #endif
02598 }
02599
02600 void UWidget::OnComboSetPos(int cmd, int sel)
02601 {
02602     void *w = GetWidget(cmd);
02603     if(w == 0L)
02604         return;
02605
02606 #ifdef WIN32
02607     CWnd *wnd = (CWnd *)w;
02608
02609     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02610     {
02611         CComboBox *combo = (CComboBox *)wnd;
02612         combo->SetCurSel(sel);
02613     }
02614 #endif
02615 #if qGTK
02616     if(GTK_IS_COMBO(w))
02617     {
02618         GtkWidget *list = GTK_COMBO(w)->list;
02619         gtk_list_select_item(GTK_LIST(list), sel);
02620     }
02621     else if(GTK_IS_OPTION_MENU(w))
02622     {
02623         gtk_option_menu_set_history (GTK_OPTION_MENU(w), sel);
02624     }
02625
02626 #endif
02627 #if qMacAPP
02628     TView *view = (TView *)w;
02629     if(MA_MEMBER(view, TPopup))
02630     {
02631         TPopup *popup = (TPopup *)view;
02632         popup->SetCurrentItem(sel + 1, true);
02633     }
02634 #endif
02635 #if qMacPP
02636     LPane *view = (LPane *)w;
02637     LMenuController *popup;
02638     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02639     {
02640         USemaphore policeman(gTurnOffBroadcast);
02641
02642         popup->SetCurrentMenuItem(sel + 1);
02643     }
02644 #endif
02645 }
02646
02647 void UWidget::OnComboDelSel(int cmd, int sel)
02648 {
02649     void *w = GetWidget(cmd);
02650     if(w == 0L)
02651         return;
02652
02653 #ifdef WIN32
02654     CWnd *wnd = (CWnd *)w;
02655
02656     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02657     {
02658         CComboBox *combo = (CComboBox *)wnd;
02659         combo->DeleteString(sel);
02660     }
02661 #endif
02662 #if qMacPP
02663     LPane *view = (LPane *)w;
02664     LMenuController *popup;
02665     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02666     {
02667         USemaphore policeman(gTurnOffBroadcast);
02668
02669         popup->DeleteMenuItem(sel + 1);
02670     }
02671 #endif
02672 }
02673
02674 void UWidget::OnComboEnableSel(int cmd, int sel, int state)
02675 {
02676     void *w = GetWidget(cmd);
02677     if(w == 0L)
02678         return;
02679
02680 #ifdef WIN32
02681     CWnd *wnd = (CWnd *)w;
02682
02683     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02684     {
02685     }
02686 #endif
02687 #if qMacPP
02688     LPane *view = (LPane *)w;
02689     LMenuController *popup;
02690     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02691     {
02692         if(state)
02693             ::EnableMenuItem(popup->GetMacMenuH(), sel + 1);
02694         else
02695             ::DisableMenuItem(popup->GetMacMenuH(), sel + 1);
02696     }
02697 #endif
02698 }
02699
02700 void UWidget::OnComboGetMenu(int cmd, UMENU *menu)
02701 {
02702     *menu = UMENU_NULL; // sanity
02703
02704     void *w = GetWidget(cmd);
02705     if(w == 0L)
02706         return;
02707
02708 #ifdef WIN32
02709     CWnd *wnd = (CWnd *)w;
02710
02711     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02712     {
02713     }
02714 #endif
02715 #if qMacPP
02716     LPane *view = (LPane *)w;
02717     LMenuController *popup;
02718     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02719     {
02720         MenuHandle hdl = popup->GetMacMenuH();
02721         if(hdl != 0L)
02722 #   if ACCESSOR_CALLS_ARE_FUNCTIONS
02723             *menu = GetMenuID(hdl);
02724 #   else
02725             *menu = (**hdl).menuID;
02726 #   endif
02727     }
02728 #endif
02729 }
02730
02731 int UWidget::OnComboGetPos(int cmd, UStr *txt)
02732 {
02733     int res = -1; // sanity
02734     if(txt != 0L)
02735         *txt = "";
02736
02737     void *w = GetWidget(cmd);
02738     if(w == 0L)
02739         return res;
02740
02741 #ifdef WIN32
02742     CWnd *wnd = (CWnd *)w;
02743
02744     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02745     {
02746         CComboBox *combo = (CComboBox *)wnd;
02747         res = combo->GetCurSel();
02748         if(res != -1 && txt != 0L)
02749         {
02750             CString s;
02751             combo->GetLBText(res, s);
02752             *txt = s;
02753         }
02754     }
02755 #endif
02756 #if qMacAPP
02757     TView *view = (TView *)w;
02758     if(MA_MEMBER(view, TPopup))
02759     {
02760         TPopup *popup = (TPopup *)view;
02761         res = popup->GetCurrentItem() - 1;
02762         if(txt != 0L)
02763         {
02764             CStr255_AC pstr = popup->GetItemText(res + 1);
02765             *txt = pstr;
02766         }
02767     }
02768 #endif
02769 #if qMacPP
02770     LPane *view = (LPane *)w;
02771     LMenuController *popup;
02772     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02773     {
02774         res = popup->GetCurrentMenuItem() - 1;
02775         if(txt != 0L)
02776         {
02777             LStr255 pstr;
02778             popup->GetMenuItemText(res + 1, pstr);
02779             *txt = pstr;
02780         }
02781     }
02782 #endif
02783
02784     return res;
02785 }
02786
02787
02788
02789 int UWidget::OnComboGetCount(int cmd)
02790 {
02791     int res = 0; // sanity
02792
02793     void *w = GetWidget(cmd);
02794     if(w == 0L)
02795         return res;
02796
02797 #ifdef WIN32
02798     CWnd *wnd = (CWnd *)w;
02799
02800     if(wnd->IsKindOf(RUNTIME_CLASS(CComboBox)))
02801     {
02802         CComboBox *combo = (CComboBox *)wnd;
02803         res = combo->GetCount();
02804     }
02805 #endif
02806 #if qGTK
02807     if(GTK_IS_COMBO(w))
02808     {
02809         GtkList *list = GTK_LIST(GTK_COMBO(w)->list);
02810         if ( list)
02811         {
02812             GList *tmp_list;
02813             for( tmp_list = list->children; tmp_list; tmp_list = tmp_list->next)
02814                 ++res;
02815         }
02816     }
02817     else if(GTK_IS_OPTION_MENU(w))
02818     {
02819         GtkMenu *mm = GTK_MENU(gtk_option_menu_get_menu( GTK_OPTION_MENU(w)));
02820         if ( mm)
02821         {
02822             GList *tmp_list;
02823             for( tmp_list = mm->menu_shell.children; tmp_list; tmp_list = tmp_list->next)
02824                 ++res;
02825         }
02826     }
02827
02828 #endif
02829 #if qMacAPP
02830     TView *view = (TView *)w;
02831     if(MA_MEMBER(view, TPopup))
02832     {
02833         TPopup *popup = (TPopup *)view;
02834         res = popup->GetNumberOfItems();
02835     }
02836 #endif
02837 #if qMacPP
02838     LPane *view = (LPane *)w;
02839     LMenuController *popup;
02840     if((popup = dynamic_cast<LMenuController *>(view)) != 0L)
02841     {
02842         res = ::CountMenuItems(popup->GetMacMenuH());
02843     }
02844 #endif
02845
02846     return res;
02847 }
02848
02849 void UWidget::OnSmartComboSetFeature(int cmd, int feature)
02850 {
02851     void *w = GetWidget(cmd);
02852     if( w == 0L )
02853         return;
02854
02855 #ifdef WIN32
02856     CWnd* wnd = (CWnd*)w;
02857
02858     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02859     {
02860         CComboBox* combo = (CComboBox*)wnd;
02861         combo->SendMessage(WM_SMCB_SETFEATURE, WPARAM(feature));
02862     }
02863 #endif
02864 #if qMacPP
02865 #endif
02866 }
02867
02868 void UWidget::OnSmartComboSetItems(int cmd, CMString* items)
02869 {
02870     void *w = GetWidget(cmd);
02871     if( w == 0L )
02872         return;
02873
02874 #ifdef WIN32
02875     CWnd* wnd = (CWnd*)w;
02876
02877     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02878     {
02879         CComboBox* combo = (CComboBox*)wnd;
02880         combo->SendMessage(WM_SMCB_SETITEMS, WPARAM(items));
02881     }
02882 #endif
02883 #if qMacPP
02884 #endif
02885 }
02886
02887 void UWidget::OnSmartComboSetReadOnly(int cmd, bool readOnly)
02888 {
02889     void *w = GetWidget(cmd);
02890     if( w == 0L )
02891         return;
02892
02893 #ifdef WIN32
02894     CWnd* wnd = (CWnd*)w;
02895
02896     if( wnd->IsKindOf(RUNTIME_CLASS(CComboBox)) )
02897     {
02898         CComboBox* combo = (CComboBox*)wnd;
02899         combo->SendMessage(WM_SMCB_SETREADONLY, WPARAM(readOnly));
02900     }
02901 #endif
02902 #if qMacPP
02903 #endif
02904 }
02905
02906 void UWidget::OnListHideColumns(int cmd, int num)
02907 {
02908     void *w = GetWidget(cmd);
02909     if(w == 0L)
02910         return;
02911
02912 #if qGTK
02913     if(!GTK_IS_CLIST(w))
02914         return;
02915
02916     GtkCList *list = GTK_CLIST(w);
02917
02918     // one must always be visible. We use the first one
02919     for(int i=1; i< num; i++)
02920         gtk_clist_set_column_visibility (list, i, false);
02921 #endif
02922 }
02923
02924 void UWidget::OnListShowColumns(int cmd, int num)
02925 {
02926     void *w = GetWidget(cmd);
02927     if(w == 0L)
02928         return;
02929
02930 #if qGTK
02931     if(!GTK_IS_CLIST(w))
02932         return;
02933
02934     GtkCList *list = GTK_CLIST(w);
02935
02936     // one must always be visible. We use the first one
02937     for(int i=1; i< num; i++)
02938         gtk_clist_set_column_visibility (list, i, true);
02939 #endif
02940 }
02941
02942 void UWidget::OnListAddColumns(int cmd, int num)
02943 {
02944     void *w = GetWidget(cmd);
02945     if(w == 0L)
02946         return;
02947
02948 #if qGTK
02949     if(!GTK_IS_CLIST(w))
02950         return;
02951
02952     //GtkCList *list = GTK_CLIST(w);
02953         // don't know how to do that, for now it relies on glade settings
02954
02955 #endif
02956 #ifdef WIN32
02957     CWnd *wnd = (CWnd *)w;
02958
02959     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
02960     {
02961         CListCtrl *list = (CListCtrl *)wnd;
02962         DWORD dwExStyle = ListView_GetExtendedListViewStyle(list->m_hWnd);
02963         dwExStyle |= LVS_EX_FULLROWSELECT;
02964         ListView_SetExtendedListViewStyle(list->m_hWnd, dwExStyle);
02965
02966         while(num--)
02967             list->InsertColumn(0, "", LVCFMT_LEFT, 80);
02968     }
02969 #endif
02970 #if qMacPP
02971     LPane *view = (LPane *)w;
02972     LOutlineTable *table;
02973     LTextTableView *tabtext;
02974     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
02975     {
02976         macpp_preparetable(table);
02977         table->InsertCols( num, 0, nil, nil, false );
02978     }
02979     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
02980     {
02981         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
02982         tabtext->InsertCols( num, 0, nil, nil, false );
02983     }
02984 #endif
02985 }
02986
02987 void UWidget::OnListSetColTitle(int cmd, int num, const char *title)
02988 {
02989     void *w = GetWidget(cmd);
02990     if(w == 0L)
02991         return;
02992
02993 #if qGTK
02994     if(!GTK_IS_CLIST(w))
02995         return;
02996
02997     GtkCList *list = GTK_CLIST(w);
02998     gtk_clist_set_column_title (list, num, title);
02999 #endif
03000 #ifdef WIN32
03001     CWnd *wnd = (CWnd *)w;
03002
03003     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03004     {
03005         CListCtrl *list = (CListCtrl *)wnd;
03006         LVCOLUMN col;
03007         memset(&col, 0, sizeof(col));
03008         col.mask = LVCF_TEXT;
03009         col.pszText = (char *)title;
03010         VERIFY(list->SetColumn(num, &col));
03011     }
03012 #endif
03013 }
03014
03015 void UWidget::OnListSetColWidth(int cmd, int num, int width)
03016 {
03017     void *w = GetWidget(cmd);
03018     if(w == 0L)
03019         return;
03020
03021 #if qGTK
03022     if(!GTK_IS_CLIST(w))
03023         return;
03024
03025     GtkCList *list = GTK_CLIST(w);
03026     gtk_clist_set_column_width(list, num, width);
03027 #endif
03028 #ifdef WIN32
03029     CWnd *wnd = (CWnd *)w;
03030
03031     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03032     {
03033         CListCtrl *list = (CListCtrl *)wnd;
03034         LVCOLUMN col;
03035         memset(&col, 0, sizeof(col));
03036         col.mask = LVCF_WIDTH;
03037         col.cx = width;
03038         VERIFY(list->SetColumn(num, &col));
03039     }
03040 #endif
03041 #if qMacPP
03042     LPane *view = (LPane *)w;
03043     LOutlineTable *table;
03044     LTextTableView *tabtext;
03045     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03046     {
03047         macpp_preparetable(table);
03048         LTableGeometry *geom = table->GetTableGeometry();
03049         if(geom != 0L)
03050             geom->SetColWidth(width, num + 1, num + 1);
03051     }
03052     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03053     {
03054         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
03055         LTableGeometry *geom = tabtext->GetTableGeometry();
03056         if(geom != 0L)
03057             geom->SetColWidth(width, num + 1, num + 1);
03058     }
03059 #endif
03060 }
03061
03062 void UWidget::OnListResetAll(int cmd)
03063 {
03064     void *w = GetWidget(cmd);
03065     if(w == 0L)
03066         return;
03067
03068 #if qGTK
03069     if(!GTK_IS_CLIST(w))
03070         return;
03071
03072     GtkCList *list = GTK_CLIST(w);
03073     gtk_clist_clear(list);
03074 #endif
03075 #if qMacAPP
03076     TView *view = (TView *)w;
03077     if(MA_MEMBER(view, TPseudoTextListView))
03078     {
03079         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03080         txt->RemoveAll();
03081     }
03082 #endif
03083 #if qMacPP
03084     LPane *view = (LPane *)w;
03085     LOutlineTable *table;
03086     LTextTableView *tabtext;
03087     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03088     {
03089         macpp_preparetable(table);
03090         LArrayIterator iter(table->GetFirstLevelItems());
03091         LOutlineItem* item;
03092         while (iter.Next(&item))
03093         {
03094             table->RemoveItem(item, false, false);
03095         }
03096         table->AdjustImageSize(false);
03097         table->Refresh();
03098     }
03099     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03100     {
03101         macpp_preparetable(GetWidget(kUMainWidget), tabtext);
03102         tabtext->RemoveAllRows(false);
03103         tabtext->Refresh();
03104     }
03105 #endif
03106 #ifdef WIN32
03107     CWnd *wnd = (CWnd *)w;
03108
03109     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03110     {
03111         CListCtrl *list = (CListCtrl *)wnd;
03112         VERIFY(list->DeleteAllItems());
03113     }
03114 #endif
03115 }
03116
03117 void UWidget::OnListAddSel(int cmd, int entry)
03118 {
03119     void *w = GetWidget(cmd);
03120     if(w == 0L)
03121         return;
03122
03123 #if qMacAPP
03124     TView *view = (TView *)w;
03125     if(MA_MEMBER(view, TPseudoTextListView))
03126     {
03127         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03128         txt->SelectItem(entry + 1, false, true, true);
03129     }
03130 #endif
03131 #if qGTK
03132     if(!GTK_IS_CLIST(w))
03133         return;
03134
03135     GtkCList *list = GTK_CLIST(w);
03136     gtk_clist_select_row(list, entry, 0);
03137 #endif
03138 #ifdef WIN32
03139     CWnd *wnd = (CWnd *)w;
03140
03141     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03142     {
03143         CListCtrl *list = (CListCtrl *)wnd;
03144         VERIFY(list->SetItemState(entry, LVIS_SELECTED, LVIS_SELECTED));
03145         VERIFY(list->EnsureVisible(entry, true));
03146     }
03147 #endif
03148 #if qMacPP
03149     LPane *view = (LPane *)w;
03150     LTableView *table;
03151     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03152     {
03153         STableCell cell(entry + 1, 1);
03154         table->SelectCell(cell);
03155         table->ScrollCellIntoFrame(cell);
03156     }
03157 #endif
03158 }
03159
03160 void UWidget::OnListDelRow(int cmd, int entry)
03161 {
03162     void *w = GetWidget(cmd);
03163     if(w == 0L)
03164         return;
03165
03166 #if qMacAPP
03167     TView *view = (TView *)w;
03168     if(MA_MEMBER(view, TPseudoTextListView))
03169     {
03170         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03171         txt->DelItemAt(entry + 1, 1);
03172     }
03173 #endif
03174 #if qGTK
03175     if(!GTK_IS_CLIST(w))
03176         return;
03177
03178     GtkCList *list = GTK_CLIST(w);
03179     gtk_clist_remove(list, entry);
03180 #endif
03181 #ifdef WIN32
03182     CWnd *wnd = (CWnd *)w;
03183
03184     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03185     {
03186         CListCtrl *list = (CListCtrl *)wnd;
03187         VERIFY(list->DeleteItem(entry));
03188     }
03189 #endif
03190 #if qMacPP
03191     LPane *view = (LPane *)w;
03192     LOutlineTable *table;
03193     LTextTableView *tabtext;
03194     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03195     {
03196         LOutlineItem* item = table->FindItemForRow(entry + 1);
03197         if(item != 0L)
03198         {
03199             table->RemoveItem(item);
03200         }
03201     }
03202     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03203     {
03204         tabtext->RemoveRows(1, entry + 1, true);
03205     }
03206 #endif
03207 }
03208
03209 void UWidget::OnListSetFeedback(int cmd, int turnOn)
03210 {
03211     void *w = GetWidget(cmd);
03212     if(w == 0L)
03213         return;
03214
03215 #if qGTK
03216     if(!GTK_IS_CLIST(w))
03217         return;
03218
03219     GtkCList *list = GTK_CLIST(w);
03220     if(turnOn)
03221         gtk_clist_thaw(list);
03222     else
03223         gtk_clist_freeze(list);
03224 #endif
03225 }
03226
03227 void UWidget::OnListNewRow(int cmd, int *num)
03228 {
03229     *num = 0; // sanity
03230
03231     void *w = GetWidget(cmd);
03232     if(w == 0L)
03233         return;
03234
03235 #if qGTK
03236     if(!GTK_IS_CLIST(w))
03237         return;
03238
03239     gchar *emptyTxts[] = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
03240
03241     GtkCList *list = GTK_CLIST(w);
03242     *num = gtk_clist_append  (list, emptyTxts);
03243 #endif
03244 #if qMacAPP
03245     TView *view = (TView *)w;
03246     if(MA_MEMBER(view, TPseudoTextListView))
03247     {
03248         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03249         *num = txt->GetNumOfRows();
03250     }
03251 #endif
03252 #ifdef WIN32
03253     CWnd *wnd = (CWnd *)w;
03254
03255     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03256     {
03257         CListCtrl *list = (CListCtrl *)wnd;
03258         *num = list->GetItemCount();
03259     }
03260 #endif
03261 #if qMacPP
03262     LPane *view = (LPane *)w;
03263     LOutlineTable *table;
03264     LTextTableView *tabtext;
03265     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03266     {
03267         // Store this information in the list view
03268         CPseudoItem *theItem = NEW CPseudoItem(GetWidID(), cmd);
03269         if(theItem != 0L)
03270         {
03271             TableIndexT outRows, outCols;
03272             table->GetTableSize(outRows, outCols);
03273             // and insert it at the end of the table
03274             LOutlineItem *lastItem = table->FindItemForRow(outRows);
03275             table->InsertItem( theItem, nil, lastItem );
03276             *num = outRows;
03277         }
03278     }
03279     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03280     {
03281         TableIndexT outRows, outCols;
03282         tabtext->GetTableSize(outRows, outCols);
03283         tabtext->InsertRows(1, outRows);
03284         tabtext->AdjustImageSize(false);
03285         *num = outRows;
03286     }
03287 #endif
03288 }
03289
03290 void UWidget::OnListRowSetData(int cmd, int num, void *data)
03291 {
03292     void *w = GetWidget(cmd);
03293     if(w == 0L)
03294         return;
03295
03296 #if qGTK
03297     if(!GTK_IS_CLIST(w))
03298         return;
03299
03300     GtkCList *list = GTK_CLIST(w);
03301     gtk_clist_set_row_data(list, num, data);
03302 #endif
03303 #if qMacPP
03304     LPane *view = (LPane *)w;
03305     LOutlineTable *table;
03306     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03307     {
03308         // Store this information in the list view
03309         LOutlineItem *item = table->FindItemForRow(num + 1);
03310         CPseudoItem *theItem;
03311         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03312         {
03313             theItem->m_data = data;
03314         }
03315     }
03316 #endif
03317 }
03318
03319 void UWidget::OnListRowGetData(int cmd, int row, void **data)
03320 {
03321     *data = 0L; // sanity
03322
03323     void *w = GetWidget(cmd);
03324     if(w == 0L)
03325         return;
03326
03327 #if qGTK
03328     if(!GTK_IS_CLIST(w))
03329         return;
03330
03331     GtkCList *list = GTK_CLIST(w);
03332     *data = gtk_clist_get_row_data(list, row);
03333 #endif
03334 #if qMacPP
03335     LPane *view = (LPane *)w;
03336     LOutlineTable *table;
03337     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03338     {
03339         // Store this information in the list view
03340         LOutlineItem *item = table->FindItemForRow(row + 1);
03341         CPseudoItem *theItem;
03342         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03343         {
03344             *data = theItem->m_data;
03345         }
03346     }
03347 #endif
03348 }
03349
03350 int UWidget::OnListGetNextSel(int cmd, int selectedCell)
03351 {
03352     void *w = GetWidget(cmd);
03353     if(w == 0L)
03354         return -1;
03355
03356 #if qGTK
03357     if(!GTK_IS_CLIST(w))
03358         return -1;
03359
03360     GList *sel = GTK_CLIST(w)->selection;
03361     if(sel == 0L)
03362         return -1;
03363
03364     while(sel != 0L)
03365     {
03366         gint row = GPOINTER_TO_INT(sel->data);
03367         if(selectedCell == -1)
03368             return row;
03369
03370         sel = (GList *)g_list_next(sel);
03371
03372         if(selectedCell == row)
03373         {
03374             return sel == 0L ? -1 : GPOINTER_TO_INT(sel->data);
03375         }
03376     }
03377 #endif
03378 #if qMacAPP
03379     TView *view = (TView *)w;
03380     if(MA_MEMBER(view, TPseudoTextListView))
03381     {
03382         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03383         if(txt->FirstSelectedItem() == 0)
03384             return -1;
03385
03386         for(GridCoordinate c = 0; c < txt->GetNumOfRows(); ++c)
03387         {
03388             if(!txt->IsItemSelected(c + 1))
03389                 continue;
03390
03391             if(selectedCell == -1)
03392                 return c;
03393
03394             if(selectedCell == c)
03395                 selectedCell = -1; // so the next pick is the one
03396         }
03397     }
03398 #endif
03399 #ifdef WIN32
03400     CWnd *wnd = (CWnd *)w;
03401
03402     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03403     {
03404         CListCtrl *list = (CListCtrl *)wnd;
03405         return list->GetNextItem(selectedCell, LVNI_SELECTED);
03406     }
03407 #endif
03408 #if qMacPP
03409     LPane *view = (LPane *)w;
03410     LTableView *table;
03411     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03412     {
03413         STableCell sel;
03414         if(selectedCell == -1)
03415         {
03416             sel = table->GetFirstSelectedCell();
03417             return sel.row - 1;
03418         }
03419
03420         sel.row = selectedCell + 1;
03421         sel.col = 1;
03422         while(table->GetNextSelectedCell(sel))
03423         {
03424             if(sel.row != selectedCell + 1)
03425                 return sel.row - 1;
03426         }
03427     }
03428 #endif
03429
03430     return -1;
03431 }
03432
03433 int UWidget::OnListGetNext(int cmd, int whichCell)
03434 {
03435     void *w = GetWidget(cmd);
03436     if(w == 0L)
03437         return -1;
03438
03439 #if qGTK
03440     if(!GTK_IS_CLIST(w))
03441         return -1;
03442
03443     if(whichCell == -1)
03444         whichCell = 0;
03445     else
03446         whichCell++;
03447
03448     if(whichCell >= GTK_CLIST(w)->rows)
03449         whichCell = -1;
03450
03451     return whichCell;
03452 #endif
03453 #ifdef WIN32
03454     CWnd *wnd = (CWnd *)w;
03455
03456     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03457     {
03458         CListCtrl *list = (CListCtrl *)wnd;
03459         return list->GetNextItem(whichCell, LVNI_ALL);
03460     }
03461 #endif
03462 #if qMacPP
03463     LPane *view = (LPane *)w;
03464     LTableView *table;
03465     if((table = dynamic_cast<LTableView *>(view)) != 0L)
03466     {
03467         STableCell sel;
03468
03469         if(whichCell != -1)
03470         {
03471             sel.row = whichCell + 1;
03472             sel.col = 1;
03473         }
03474
03475         while(table->GetNextCell(sel))
03476         {
03477             if(sel.row != whichCell + 1)
03478                 return sel.row - 1;
03479         }
03480     }
03481 #endif
03482
03483     return -1;
03484 }
03485
03486 void UWidget::OnListInsert(int cmd, ULIST_INSERT *data)
03487 {
03488     void *w = GetWidget(cmd);
03489     if(w == 0L)
03490         return;
03491
03492 #if qGTK
03493     if(!GTK_IS_CLIST(w))
03494         return;
03495
03496     GtkCList *list = GTK_CLIST(w);
03497
03498     if(data->title == 0L && data->icon == 0L)
03499         g_warning("Got an empty cell !\n");
03500     else if(data->title == 0L)
03501     {
03502         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03503         gtk_clist_set_pixmap(list, data->row, data->col, pix->pixmap, pix->mask);
03504     }
03505     else if(data->icon == 0L)
03506     {
03507         gtk_clist_set_text(list, data->row, data->col, data->title);
03508     }
03509     else
03510     {
03511         GtkPixmap *pix = GTK_PIXMAP(data->icon);
03512         gtk_clist_set_pixtext(list, data->row, data->col, data->title, 2, pix->pixmap, pix->mask);
03513     }
03514 #endif
03515 #if qMacAPP
03516     TView *view = (TView *)w;
03517     if(MA_MEMBER(view, TPseudoTextListView))
03518     {
03519         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03520         //txt->InsStringBefore(data->row + 1, data->title);
03521         txt->InsStringLast(data->title);
03522     }
03523 #endif
03524 #ifdef WIN32
03525     CWnd *wnd = (CWnd *)w;
03526
03527     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03528     {
03529         CListCtrl *list = (CListCtrl *)wnd;
03530         if(data->col == 0)
03531         {
03532             LV_ITEM lvi;
03533             memset(&lvi, 0, sizeof(lvi));
03534             lvi.mask = LVIF_TEXT;
03535             lvi.iItem = data->row;
03536             lvi.iSubItem = 0;
03537             lvi.pszText = (char *)data->title;
03538
03539             list->InsertItem(&lvi);
03540         }
03541         else
03542         {
03543             list->SetItemText(data->row, data->col, data->title);
03544         }
03545     }
03546 #endif
03547 #if qMacPP
03548     LPane *view = (LPane *)w;
03549     LOutlineTable *table;
03550     LTextTableView *tabtext;
03551     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03552     {
03553         LOutlineItem *item = table->FindItemForRow(data->row + 1);
03554         CPseudoItem *theItem;
03555         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03556         {
03557             std::map<int, UStr>::value_type val(data->col + 1, UStr(data->title));
03558             theItem->m_texts.insert(val);
03559         }
03560     }
03561     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03562     {
03563         STableCell cell(data->row + 1, data->col + 1);
03564         tabtext->SetCellData(cell, data->title, strlen(data->title));
03565     }
03566 #endif
03567 }
03568
03569 void UWidget::OnListGetInfo(int cmd, ULIST_INFO *desc)
03570 {
03571     // sanity
03572     desc->data = 0L;
03573     desc->title = 0L;
03574
03575     void *w = GetWidget(cmd);
03576     if(w == 0L)
03577         return;
03578
03579 #if qMacAPP
03580     TView *view = (TView *)w;
03581     if(MA_MEMBER(view, TPseudoTextListView))
03582     {
03583         static UStr cstr; // no good
03584
03585         TPseudoTextListView *txt = (TPseudoTextListView *)view;
03586         CStr255_AC name = txt->GetItemText(desc->row + 1);
03587         cstr = name;
03588         desc->title = cstr;
03589     }
03590 #endif
03591 #if qGTK
03592     if(!GTK_IS_CLIST(w))
03593         return;
03594
03595     GtkCList *list = GTK_CLIST(w);
03596     desc->data = gtk_clist_get_row_data(list, desc->row);
03597     gtk_clist_get_text_is_buggy(list, desc->row, desc->col, (gchar **)&desc->title);
03598 #endif
03599 #ifdef WIN32
03600     CWnd *wnd = (CWnd *)w;
03601
03602     if(wnd->IsKindOf(RUNTIME_CLASS(CListCtrl)))
03603     {
03604         CListCtrl *list = (CListCtrl *)wnd;
03605
03606         desc->data = (void *)list->GetItemData(desc->row);
03607         static CString s;
03608         s = list->GetItemText(desc->row, desc->col);
03609         desc->title = s;
03610     }
03611 #endif
03612 #if qMacPP
03613     LPane *view = (LPane *)w;
03614     LOutlineTable *table;
03615     LTextTableView *tabtext;
03616     if((table = dynamic_cast<LOutlineTable *>(view)) != 0L)
03617     {
03618         LOutlineItem *item = table->FindItemForRow(desc->row + 1);
03619         CPseudoItem *theItem;
03620         if((theItem = dynamic_cast<CPseudoItem *>(item)) != 0L)
03621         {
03622             std::map<int, UStr>::iterator i = theItem->m_texts.find(desc->col + 1);
03623             if(i != theItem->m_texts.end())
03624             {
03625                 desc->title = (*i).second;
03626             }
03627             desc->data = theItem->m_data;
03628         }
03629     }
03630     else if((tabtext = dynamic_cast<LTextTableView *>(view)) != 0L)
03631     {
03632         STableCell cell(desc->row + 1, desc->col + 1);
03633         UInt32 ioDataSize = 255;
03634         char tmp[255];
03635         tabtext->GetCellData(cell, tmp, ioDataSize);
03636         static UStr res;
03637         res.set(tmp, ioDataSize);
03638         desc->title = res;
03639     }
03640 #endif
03641 }
03642
03643 void UWidget::OnListResort(int cmd, int column, UListSorter s)
03644 {
03645     void *w = GetWidget(cmd);
03646     if(w == 0L)
03647         return;
03648
03649 #if qGTK
03650     if(!GTK_IS_CLIST(w))
03651         return;
03652
03653     GtkCList *list = GTK_CLIST(w);
03654
03655     sGtkClistDiff = s;
03656     sGtkClistWid = this;
03657     gtk_clist_set_compare_func(list, gtkclistdefcompare);
03658     gtk_clist_set_sort_column(list, column);
03659     gtk_clist_sort(list);
03660     gtk_clist_set_compare_func(list, 0L);
03661 #endif
03662 }
03663
03664 void UWidget::OnListSetSortDir(int cmd, int column, bool dir)
03665 {
03666     void *w = GetWidget(cmd);
03667     if(w == 0L)
03668         return;
03669
03670 #if qGTK
03671     if(!GTK_IS_CLIST(w))
03672         return;
03673
03674     GtkCList *list = GTK_CLIST(w);
03675     gchar *text;
03676     guint8 spacing;
03677     GdkPixmap *pixmap;
03678     GdkBitmap *mask;
03679
03680     gtk_clist_get_pixtext (list, 0, column, &text, &spacing, &pixmap, &mask);
03681     gtk_clist_set_pixtext (list, 0, column, text, spacing, pixmap, mask);
03682 #endif
03683 }
03684
03685 int UWidget::OnUpdateFocus(int leave, void *widget)
03686 {
03687     std::map<int, void *>::const_iterator i;
03688
03689     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03690     {
03691         if((*i).second == widget)
03692             break;
03693     }
03694     if(i == m_widgets.end())
03695         return 0; // continue notification
03696
03697     if(leave)
03698     {
03699         if(sFocusWidID == GetWidID())
03700             sFocusWidID = -1;
03701     }
03702     else
03703     {
03704         sFocusWidID = GetWidID();
03705         sFocusCmdID = (*i).first;
03706     }
03707
03708     return 1; // stop notification
03709 }
03710
03711 bool UWidget::HasModal(void)
03712 {
03713 #if qGTK
03714     const STD map<int, UCmdTarget *> & targets = UEventGetTargets();
03715     STD map<int, UCmdTarget *>::const_iterator i;
03716     for(i = targets.begin(); i != targets.end(); ++i)
03717     {
03718         UCmdTarget *target = (*i).second;
03719         if(!target->IsKindOf(URUNTIME_CLASS(UWidget)))
03720             continue;
03721
03722         UWidget *wid = (UWidget *)target;
03723         if(wid->m_modalLoop)
03724             return true;
03725     }
03726 #endif
03727     return false;
03728 }
03729
03730 int UWidget::OnFetchCmd(int cmd, void *widget)
03731 {
03732     std::map<int, void *>::const_iterator i;
03733     for(i = m_widgets.begin(); i != m_widgets.end(); ++i)
03734     {
03735         if(widget == (*i).second)
03736             return (*i).first;
03737     }
03738     return -1;
03739 }
03740
03741 void UWidget::AddPage(UWidget *page, int pagecmd, int num_page)
03742 {
03743     void *wid = GetWidget(kUMainWidget);
03744     if(wid == 0L)
03745         return;
03746
03747     UEventSendMessage(page->GetWidID(), EV_INIT_TAB_WIDGET, UMAKEINT(pagecmd, num_page), wid);
03748     std::map<int, UWidget *>::value_type val(UMAKEINT(pagecmd, num_page), page);
03749     m_tabs.insert(val);
03750
03751 #if qMacPP
03752     // emulate the click in tab 1
03753     if(num_page == 0)
03754     {
03755         // emulate the click in tab 1
03756         UEventSendMessage(GetWidID(), EV_PAGE_CHANGED, UMAKEINT(pagecmd, num_page), 0L);
03757     }
03758 #endif /* qMacPP */
03759 }
03760
03761 void UWidget::OnPageChanged(int cmdid, int num_page)
03762 {
03763     if(m_currentPage == UMAKEINT(cmdid, num_page))
03764         return;
03765
03766     std::map<int, UWidget *>::iterator i;
03767     if(m_currentPage != -1)
03768     {
03769         i = m_tabs.find(m_currentPage);
03770         if(i != m_tabs.end())
03771         {
03772             UWidget *tab = (*i).second;
03773             tab->DoDataExchange(false);
03774
03775 #if qMacPP
03776             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03777             if(attach != 0L)
03778             {
03779                 attach->InvalidCache(tab);
03780             }
03781
03782             tab->m_widgets.erase(tab->m_widgets.begin(), tab->m_widgets.end());
03783 #endif /* qMacPP */
03784         }
03785     }
03786
03787     if(num_page == -1)
03788     {
03789         m_currentPage = -1;
03790         return;
03791     }
03792
03793     i = m_tabs.find(UMAKEINT(cmdid, num_page));
03794     if(i != m_tabs.end())
03795     {
03796         UWidget *tab = (*i).second;
03797
03798 #if qMacPP
03799         UPseudoPlaceHolder *holder = dynamic_cast<UPseudoPlaceHolder *>((LPane *)GetWidget(cmdid));
03800         if(holder != 0L)
03801         {
03802             macpp_fecthview(tab->GetWidID(), holder->GetCurrentView());
03803
03804             LPseudoWinAttachment *attach = macpp_getattachwindow(this);
03805             if(attach != 0L)
03806             {
03807                 macpp_linkbroadcasters(holder->GetCurrentView(), attach);
03808             }
03809         }
03810 #endif /* qMacPP */
03811
03812         tab->DoDataExchange(true);
03813     }
03814     m_currentPage = UMAKEINT(cmdid, num_page);
03815 }
03816
03817 #ifdef WIN32
03818 void UWidget::OverideMapWidget(int cmdid, CRuntimeClass *widClass)
03819 {
03820     std::map<int, CRuntimeClass *>::value_type val(cmdid, widClass);
03821     m_overide.insert(val);
03822 }
03823 #endif
03824
03825 #if qMacPP || qMacAPP
03826 SInt32 UWidget::GetPaneID(int cmdid)
03827 {
03828     cmdid -= EV_COMMAND_START;
03829     unsigned char tmp[50];
03830     unsigned char res[5] = {'p', 's', '\0', '\0', '\0'};
03831     sprintf((char *)tmp, "%d", cmdid);
03832     if(strlen((char *)tmp) > 2 || cmdid < 0)
03833     {
03834         UAppConsole("cmdid too big (%d)\n", cmdid);
03835     }
03836     else if(strlen((char *)tmp) == 2)
03837     {
03838         res[2] = tmp[0];
03839         res[3] = tmp[1];
03840     }
03841     else
03842     {
03843         res[2] = '0';
03844         res[3] = tmp[0];
03845     }
03846
03847     SInt32 num = (res[0] << 24) | (res[1] << 16) | (res[2] << 8) | res[3];
03848     return num;
03849 }
03850 #endif
Generated on Fri Jan 31 12:08:51 2003 for WinCvs Source by doxygen 1.3-rc2


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
00214     void OnBlockHandler(void* widget, int cmd, int event);
00215
00217     void OnUnblockHandler(void* widget, int cmd, int event);
00218
00222     void AddPage(UWidget *page, int pagecmd, int num_page);
00223
00224 #ifdef WIN32
00225     void OverideMapWidget(int cmdid, CRuntimeClass *widClass);
00226     inline std::map<int, CRuntimeClass *> & GetOverideList(void) { return m_overide; }
00227         // use a class instead of the one by default for this item.
00228         // to call before DoModal, before the widgets get created.
00229
00230     inline CDialog *GetCurModal() const { return m_curModal; }
00231         // during DoModal, this value is set to the MFC dialog
00232 #endif
00233 #if qMacPP || qMacAPP
00234
00235     static SInt32 GetPaneID(int cmdid);
00236 #endif
00237 protected:
00238
00239     std::vector<UCmdTarget *> m_listeners;
00240     std::map<int, void *> m_widgets;
00241     std::map<int, UStr> m_tooltips;
00242     std::vector<UTimer> m_timers;
00243     std::map<int, UWidget *> m_tabs;
00244
00245     bool m_modalRes;
00246     int m_currentPage;
00247 #if qGTK || qMacPP
00248     bool m_modalLoop;
00249 #endif
00250 #ifdef WIN32
00251     CDialog *m_curModal;
00252     std::map<int, CRuntimeClass *> m_overide; // see WinInitWidgets
00253     bool m_noDispatch;
00254 #endif
00255     static bool sValidMenu;
00256
00257     static int sFocusWidID;
00258     static int sFocusCmdID;
00259
00263     ev_msg int OnGetState(int cmd);
00264
00268     ev_msg void OnSetState(int cmd, int state);
00269
00273     ev_msg void OnEnableCmd(int cmd, int state);
00274
00277     ev_msg void OnChgFocus(int cmd);
00278
00281     ev_msg void OnInvalidate(int cmd);
00282
00285     ev_msg void OnRedraw(int cmd);
00286
00290     ev_msg void OnSetText(int cmd, const char *text);
00291
00295     ev_msg void OnGetText(int cmd, UStr *text);
00296
00300     ev_msg void OnSetFloat(int cmd, const float *f);
00301
00305     ev_msg void OnGetFloat(int cmd, float *f);
00306
00310     ev_msg void OnInitWidget(int cmd, void *widget);
00311
00317     ev_msg void OnInitTabWidget(int cmd, int page, void *widget);
00318
00322     ev_msg void OnShowWidget(int cmd, int state);
00323
00327     ev_msg void OnSetSlider(int cmd, int pos);
00328
00332     ev_msg void OnGetSliderProperty(int cmd, USLIDER *prop);
00333
00337     ev_msg void OnSetSliderProperty(int cmd, const USLIDER *prop);
00338
00341     ev_msg void OnSetTooltip(int cmd, UCmdUI *pCmdUI);
00342
00346     ev_msg void OnGetLoc(int cmd, URECT * r);
00347
00351     ev_msg void OnSetLoc(int cmd, const URECT * r);
00352
00357     ev_msg void OnChgCursor(int cmd, UCURSOR cursor);
00358
00363     ev_msg void OnUpdateUI(void);
00364
00366     ev_msg void OnTreeResetAll(int cmd);
00367
00369     ev_msg void OnTreeInsert(int cmd, UTREE_INSERT *data);
00370
00372     ev_msg void OnTreeGetInfo(int cmd, UTREE_INFO *data);
00373
00375     ev_msg void OnTreeSetData(int cmd, UTREE_INFO *data);
00376
00378     ev_msg void OnTreeSetIcon(int cmd, UTREE_INFO *data);
00379
00381     ev_msg void OnTreeDelete(int cmd, UTREEITEM item);
00382
00384     ev_msg void OnTreeExpand(int cmd, int collapse, UTREEITEM item);
00385
00387     ev_msg void OnTreeSelect(int cmd, int deselect, UTREEITEM item);
00388
00390     ev_msg void OnTreeGetSel(int cmd, UTREEITEM *item);
00391
00393     ev_msg void OnListAddColumns(int cmd, int num);
00394
00396     ev_msg void OnListShowColumns(int cmd, int num);
00397
00399     ev_msg void OnListHideColumns(int cmd, int num);
00400
00402     ev_msg void OnListSetColTitle(int cmd, int num, const char *title);
00403
00405     ev_msg void OnListSetColWidth(int cmd, int num, int width);
00406
00408     ev_msg void OnListResetAll(int cmd);
00409
00411     ev_msg void OnListAddSel(int cmd, int entry);
00412
00414     ev_msg void OnListPopup(int cmd, int entry);
00415
00417     ev_msg void OnListDelRow(int cmd, int row);
00418
00420     ev_msg void OnListSetFeedback(int cmd, int turnOn);
00421
00423     ev_msg void OnListNewRow(int cmd, int *num);
00424
00426     ev_msg void OnListRowSetData(int cmd, int row, void *data);
00427
00429     ev_msg void OnListRowGetData(int cmd, int row, void **data);
00430
00432     ev_msg void OnListInsert(int cmd, ULIST_INSERT *data);
00433
00435     ev_msg void OnListGetInfo(int cmd, ULIST_INFO *desc);
00436
00438     ev_msg int OnListGetNextSel(int cmd, int selectedCell);
00439
00441     ev_msg int OnListGetNext(int cmd, int whichCell);
00442
00444     ev_msg void OnListResort(int cmd, int column, UListSorter s);
00445
00447     ev_msg void OnListSetSortDir(int cmd, int column, bool dir);
00448
00450     ev_msg void OnComboResetAll(int cmd);
00451
00453     ev_msg void OnComboAppend(int cmd, const char *txt);
00454
00456     ev_msg void OnComboSetPos(int cmd, int sel);
00457
00459     ev_msg int OnComboGetPos(int cmd, UStr *txt);
00460
00462     ev_msg int OnComboGetCount(int cmd);
00463
00465     ev_msg void OnComboDelSel(int cmd, int sel);
00466
00469     ev_msg void OnComboEnableSel(int cmd, int sel, int state);
00470
00472     ev_msg void OnComboGetMenu(int cmd, UMENU *menu);
00473
00475     ev_msg void OnSmartComboSetFeature(int cmd, int feature);
00476
00478     ev_msg void OnSmartComboSetItems(int cmd, CMString* items);
00479
00481     ev_msg void OnSmartComboSetReadOnly(int cmd, bool readOnly);
00482
00484     ev_msg int OnUpdateFocus(int leave, void *widget);
00485
00487     ev_msg int OnFetchCmd(int cmd, void *widget);
00488
00490     ev_msg void OnPageChanged(int cmd, int pagenum);
00491     UDECLARE_MESSAGE_MAP()
00492
00493 #if qMacPP
00494     friend class LPseudoWinAttachment;
00495 #endif
00496 #ifdef WIN32
00497     friend LRESULT UWinPseudoWindowProc(CWnd *wnd, UWidget *wid, UINT message, WPARAM wParam, LPARAM lParam);
00498 #endif
00499 };
00500
00501 #endif /* __cplusplus */
00502
00503 #endif /* UWIDGET_H */
Generated on Fri Jan 31 12:08:52 2003 for WinCvs Source by doxygen 1.3-rc2


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_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_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
  • __PROTO : getline.h
  • __REQUIRED_RPCNDR_H_VERSION__ : 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_IID_Lookup() : CVS_Coworker_p.c
  • _cvs_coworker_InterfaceNamesList : CVS_Coworker_p.c
  • _cvs_coworker_ProxyVtblList : 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
  • _DIFF_CPP_ : DiffDlg.cpp
  • _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 : ImportFilterDlg.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 : ImportFilterDlg.cpp
  • _i18n : cvsgui_i18n.h
  • _ICvsCoworkerStubVtbl : CVS_Coworker_p.c
  • _LIBC : getopt.h
  • _loadPersistentSettings() : Persistent.cpp
  • _LoadSysColorBitmap() : CJToolBar.h, CJToolBar.cpp
  • _Module : StdAfx.h
  • _Py_NoneStruct_glue : PythonGlue.impl.h
  • _Py_TrueStruct_glue : PythonGlue.impl.h
  • _Py_ZeroStruct_glue : PythonGlue.impl.h
  • _PyObject_New : PythonGlue.impl.h
  • _PyObject_New_glue : PythonGlue.impl.h
  • _RGB_TO_RGBQUAD : CJToolBar.cpp
  • _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 -

  • AboutDialog() : AboutDlg.h, AboutDlg.cpp
  • addAccel() : umenu.cpp
  • AddFiles() : 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_ITEMLISTDLG_H__E6D16D27_1A84_4E8A_A926_3B76728E0F73__INCLUDED_ : ItemListDlg.h
  • AFX_KEYWORDCOMBOBOX_H__F5D656E1_FD93_49A0_A27B_231957D4AAC5__INCLUDED_ : KeywordComboBox.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_LOGIN_MAIN_H__CF191044_0332_477E_ABD2_13E56D643C14__INCLUDED_ : LoginDlg.h
  • AFX_MAINFRM_H__D2D77DCC_8299_11D1_8949_444553540000__INCLUDED_ : MainFrm.h
  • AFX_MFFILEDIALOG_H__66684391_7914_4A0D_9848_022A6CA7573C__INCLUDED_ : MfFileDialog.h
  • AFX_NOPYTHON_H__F675DE42_0FA7_4785_8946_E8FC861BBA57__INCLUDED_ : NoPython.h
  • AFX_OPTIONALPROPERTYSHEET_H__F82DC8BB_73CD_4AEA_8635_1A0932F24C7D__INCLUDED_ : OptionalPropertySheet.h
  • AFX_PROGRESSDLG_H__09D80542_6467_11D3_85F5_00609419FCC1__INCLUDED_ : ProgressDlg.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_SELECTIONDETAILSDLG_H__42708DEE_6E9B_41FD_BAE6_0224C8EE09D8__INCLUDED_ : SelectionDetailsDlg.h
  • AFX_SMARTCOMBOBOX_H__E3F8DAE6_C2EF_49CE_AE52_3AE54F5A629C__INCLUDED_ : SmartComboBox.h
  • AFX_STATICDRAW_H__8DCC3165_D42E_4FAA_BCCF_F4328685535E__INCLUDED_ : PseudoDraw.h
  • AFX_STATUSDLG_H__5EEE9989_6C76_4FD3_83FC_2D90DEA0CE21__INCLUDED_ : StatusDlg.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
  • AUTHORS_COUNT : wincvs.cpp
  • AUTHORS_PERMUTATIONS : wincvs.cpp
  • AUTO_INITALIZE : dll_garbage.c

- b -

  • BFT_BITMAP : dib.h
  • biBits : dib.c
  • bindtextdomain : cvsgui_i18n.h
  • 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
  • CBrowseFileView : UCvsFiles.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_i.h, cvs_coworker.h
  • CheckoutFiles() : CVS_Coworker_i.h, cvs_coworker.h
  • CheckSelectionHandler() : CvsCommands.cpp
  • 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_i.h, cvs_coworker.h
  • CLSID : CVS_Coworker_i.c
  • clsid : wincvs.cpp
  • CLSID_CvsCoworker : 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
  • cmdFILTERMASK : UCvsCommands.h
  • cmdFIND : UCvsCommands.h
  • cmdFINDER : UCvsCommands.h
  • cmdFLAT : UCvsCommands.h
  • cmdFONT : UCvsCommands.h
  • cmdGRAPH : UCvsCommands.h
  • cmdHIDE_UNKNOWN : 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
  • cmdVIEW_ADDED : UCvsCommands.h
  • cmdVIEW_CHANGED : UCvsCommands.h
  • cmdVIEW_CONFLICT : UCvsCommands.h
  • cmdVIEW_MISSING : UCvsCommands.h
  • cmdVIEW_MODIFIED : UCvsCommands.h
  • cmdVIEW_REMOVED : UCvsCommands.h
  • cmdVIEW_UNKNOWN : UCvsCommands.h
  • cmdWATCHERS : UCvsCommands.h
  • cmdWATCHOFF : UCvsCommands.h
  • cmdWATCHON : UCvsCommands.h
  • cmdWORKSPACE : UCvsCommands.h
  • COL_DESC : ImportFilterDlg.cpp
  • COL_KIND : ImportFilterDlg.cpp
  • COL_NUM : ImportFilterDlg.cpp
  • COL_STATE : ImportFilterDlg.cpp
  • COLOR_BLACK : CJControlBar.cpp
  • COLOR_WHITE : CJControlBar.cpp
  • columnsRecursive : BrowseViewColumn.cpp
  • columnsRegular : BrowseViewColumn.cpp
  • combozify() : CommitDlg.h, CommitDlg.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
  • CompatGetLogin() : LoginDlg.h, LoginDlg.cpp
  • CompatGetModuleListItem() : ItemListDlg.h, ItemListDlg.cpp
  • CompatGetPassword() : GetPassword.h, GetPassword.cpp
  • CompatGetPrefs() : GetPrefs.h, GetPrefs.cpp
  • CompatGetRelease() : ReleaseDlg.h, ReleaseDlg.cpp
  • CompatGetSelectionDetails() : SelectionDetailsDlg.h, SelectionDetailsDlg.cpp
  • CompatGetStatus() : StatusDlg.h, StatusDlg.cpp
  • CompatGetTagListItem() : ItemListDlg.h, ItemListDlg.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
  • CreateBrowseToolbar() : UCvsToolbar.h, UCvsToolbar.cpp
  • CreateDIB() : dib.h, dib.c
  • CreateFilterToolbar() : UCvsToolbar.h, UCvsToolbar.cpp
  • 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_CMD : CvsArgs.h
  • 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.cpp
  • cvs_process_new() : cvsgui_process.cpp
  • cvs_process_pop() : cvsgui_process.cpp
  • cvs_process_push() : cvsgui_process.cpp
  • cvs_process_recv_message() : cvsgui_process.cpp
  • cvs_process_run() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_stack : cvsgui_process.cpp
  • cvs_process_stop() : cvsgui_process.h, cvsgui_process.cpp
  • cvs_process_terminate() : cvsgui_process.cpp
  • cvs_process_write() : cvsgui_process.cpp
  • CvsAlert() : CvsAlert.h, CvsAlert.cpp
  • CvsCmdAdd() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdAnnotate() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCancelChanges() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCheckoutModule() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCommandLine() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdCommit() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdDiff() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEdit() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdEditors() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdImportModule() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdInit() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLock() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLog() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogin() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdLogout() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdMacrosAdmin() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdMoveToTrash() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRelease() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRemove() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagBranch() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagCreate() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdRtagDelete() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdStatus() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagBranch() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagCreate() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdTagDelete() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUnedit() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUnlock() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdUpdate() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchers() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOff() : CvsCommands.h, CvsCommands.cpp
  • CvsCmdWatchOn() : CvsCommands.h, CvsCommands.cpp
  • CvsCommand : CVS_Coworker_i.h, CVS_Coworker.idl, 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_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_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
  • CvsProcessStartupInfo : 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
  • dcgettext : cvsgui_i18n.h
  • 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_i.h, cvs_coworker.h
  • decodeCVS() : AppGlue.mac.h
  • DEF_CVS_CMD : LineCmd.h
  • DEFAULT_BOX_VALUE : CJColorPopup.cpp
  • DeferClientPos() : GfxSplitterWnd.cpp
  • dgettext : cvsgui_i18n.h
  • 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_i.h, cvs_coworker.h
  • DiffOptionsItem : DiffDlg.cpp
  • 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
  • errNoCvsguiProtocol : AppGlue.h
  • 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_CLICK : 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_HIDECOLUMNS : umain.h
  • EV_LIST_INSERT : umain.h
  • EV_LIST_NEWROW : umain.h
  • EV_LIST_POPUP : 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_LIST_SETSORTDIR : umain.h
  • EV_LIST_SHOWCOLUMNS : 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
  • 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
  • FILTER_ALL : PromptFiles.cpp
  • FILTER_END : PromptFiles.cpp
  • FILTER_EXECUTABLE : PromptFiles.cpp
  • FILTER_SEPARATOR : PromptFiles.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
  • 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
  • FormatDefaultSettingsLoc() : Persistent.h, Persistent.cpp
  • FormatItemDescription() : ItemListDlg.cpp
  • FormatListPath() : ItemListDlg.cpp
  • 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
  • gAuthors : wincvs.cpp
  • gAuthorsPermutations : wincvs.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.h, UpdateDlg.cpp, ItemListDlg.h, AnnotateDlg.h
  • gDateOrRevNames : UpdateDlg.h, UpdateDlg.cpp
  • gDiffOptions : DiffDlg.cpp
  • gDirtySupport : CvsPrefs.cpp
  • gDisableSplashScreen : CvsPrefs.cpp
  • gdouble : cvsgui_wire.h
  • gDummyFile : WinCvsBrowser.cpp, UCvsFolders.cpp
  • gEncryptCommunication : CvsPrefs.cpp
  • GetAllPersistentSettings() : Persistent.cpp
  • GetAsSystemTime() : CJDateTimeCtrl.cpp
  • GetChldError() : cvsgui_process.cpp
  • GetChldOutput() : cvsgui_process.cpp
  • GetCustomMenu() : wincvs_winutil.h, wincvs_winutil.cpp
  • GetDateTime() : CvsEntries.h, CvsEntries.cpp
  • GetDItemCtrlHdl() : MacMisc.h
  • GetDItemHdl() : MacMisc.h
  • GetDItemMenuSel() : MacMisc.h
  • GetEndOfDecendantWindow() : wincvs_winutil.cpp
  • getenv : dll_glue.h, cvsgui.h
  • GetEnvValue() : CvsCommands.h, CvsCommands.cpp
  • GetErrorMessage() : CVS_Coworker_i.h, cvs_coworker.h
  • GetExtension() : CvsCommands.h, CvsCommands.cpp
  • GetFileChanges() : CVS_Coworker_i.h, cvs_coworker.h
  • GetFilesToAdd() : 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
  • GetNextEntriesLine() : CvsEntries.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
  • GetPrevParentWindow() : wincvs_winutil.cpp
  • GetProject() : 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
  • getSettingName() : Persistent.cpp
  • getstr() : getline.h, getline.c
  • GetSubCMenu() : wincvs_winutil.h, wincvs_winutil.cpp
  • gettext : cvsgui_i18n.h
  • GetTimeZoneBias() : Stat.cpp
  • GetWinCvsDebugMask() : WinCvsDebug.h, WinCvsDebug.cpp
  • GetWinCvsDebugMaskBit() : WinCvsDebug.h, WinCvsDebug.cpp
  • gExtdiff : CvsPrefs.cpp
  • gFilesMenu : wincvs_winutil.cpp
  • 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
  • gHideCommandDlgStatus : 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
  • gItemListAutoRefreshModule : ItemListDlg.cpp
  • gItemListAutoRefreshTag : ItemListDlg.cpp
  • gItemListModuleList : ItemListDlg.cpp
  • gItemListTagRecurse : ItemListDlg.cpp
  • gKeywordModes : KeywordComboBox.cpp
  • gKserverPort : CvsPrefs.cpp
  • gLastWorkingDir : CvsPrefs.cpp
  • gLogDateNames : LogDlg.cpp
  • gLogoutTimeOut : CvsPrefs.cpp
  • gLogRevNames : LogDlg.cpp
  • gLogStateNames : LogDlg.cpp
  • gLogSupress : 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
  • gNoBlankLines : DiffDlg.cpp
  • gNoWhiteSpace : DiffDlg.cpp
  • gOldCvsroots : CvsPrefs.h, CvsPrefs.cpp
  • gOldLoc : HistComboBoxEx.cpp, UCvsFolders.cpp
  • gOldModules : RtagDlg.h, CheckoutDlg.h, CheckoutDlg.cpp
  • 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
  • gPrevCvsCmdDir : LineCmd.cpp
  • gProxyHost : CvsPrefs.cpp
  • gProxyPort : CvsPrefs.cpp
  • gPruneOption : CvsPrefs.cpp
  • gPserverPort : CvsPrefs.cpp
  • gQuietOption : CvsPrefs.cpp
  • gReleasesNames : UpdateDlg.h, ImportDlg.cpp
  • gRevNames : UpdateDlg.h, UpdateDlg.cpp, ItemListDlg.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
  • gSettingsFolder : CvsPrefs.cpp
  • gshort : cvsgui_wire.h
  • gSortParam : UCvsFiles.cpp
  • gStatusOutputType : CvsPrefs.cpp
  • gStrMonths : CvsEntries.cpp
  • gtkCompareWrap() : UCvsFiles.cpp
  • 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
  • gUnifiedDiff : DiffDlg.cpp
  • 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_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_i.h, cvs_coworker.h
  • ICvsCoworker_AddFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_AddFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckinFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckinFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckoutFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CheckoutFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CloseProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_CloseProject_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_DiffFile_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_DiffFile_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetErrorMessage_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetErrorMessage_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFileChanges_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFileChanges_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFilesToAdd_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetFilesToAdd_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetLastError_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetLastError_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_GetProject_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_HasAdvancedOptionsForCommand_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_HasAdvancedOptionsForCommand_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_OpenProject_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_OpenProject_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RemoveFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RemoveFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RenameFile_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_RenameFile_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowAdvancedOptionsForCommand_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowAdvancedOptionsForCommand_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileHistory_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileHistory_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileProperties_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowFileProperties_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowUserInterface_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_ShowUserInterface_Stub() : 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_i.h, cvs_coworker.h
  • ICvsCoworker_UncheckoutFiles_Stub() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_UpdateFiles_Proxy() : CVS_Coworker_p.c, CVS_Coworker_i.h, cvs_coworker.h
  • ICvsCoworker_UpdateFiles_Stub() : 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_IMPORT : resource.h
  • IDB_LIGHTBULB : resource.h
  • IDB_LOCATE : resource.h
  • IDB_MODULES : resource.h
  • IDB_PUSHPIN : CJResource.h
  • IDB_PYTHON : resource.h
  • IDB_SMALLICONS : resource.h
  • IDB_SPLASH : resource.h
  • IDC_ADD : resource.h
  • IDC_ADD_DEFAULT : resource.h
  • IDC_ADD_SELECTION : 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_ALTSETTINGSCHK : resource.h
  • IDC_ALWAYSROOT : resource.h
  • IDC_APPLY : resource.h
  • IDC_ATTIC : resource.h
  • IDC_AUTHEN : resource.h
  • IDC_AUTHENDESC : resource.h
  • IDC_AUTO_REFRESH : resource.h
  • IDC_BAR_BUTTON : CJResource.h
  • IDC_BAR_CAPTION : CJResource.h
  • IDC_BAR_TREE : resource.h
  • IDC_BRANCH : resource.h
  • IDC_BROWSE_MODULES : resource.h
  • IDC_BROWSE_READFROM : resource.h
  • IDC_BROWSE_TAG : resource.h
  • IDC_BROWSE_TAG1 : resource.h
  • IDC_BROWSE_TAG2 : resource.h
  • IDC_BTNHOME : resource.h
  • IDC_BTNPATH : resource.h
  • IDC_BTNPATH2 : resource.h
  • IDC_BTNPROGRAM : resource.h
  • IDC_BTNSETTINGS : resource.h
  • IDC_BULB : resource.h
  • IDC_BUTTON_HIDE : CJResource.h
  • IDC_BUTTON_MINI : CJResource.h
  • IDC_CAPT_BUTTON : CJResource.h
  • IDC_CHECK_OVERRIDECHECKOUTDIR : resource.h
  • IDC_CHECKANNOTATE : resource.h
  • IDC_CHECKDATE : 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_CHECKREV : resource.h
  • IDC_CHECKRHOSTPORT : resource.h
  • IDC_CHECKRSHNAME : resource.h
  • IDC_CHECKSERVERNAME : resource.h
  • IDC_CHECKSTATUS : 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_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_COMBOREV1 : 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_COMPARE_TYPE : resource.h
  • IDC_CONSOLE : resource.h
  • IDC_CREATEMISSDIR : resource.h
  • IDC_CTNLADD : resource.h
  • IDC_CURRENT_OPTIONS : resource.h
  • IDC_CUSTOMIZE_BAR : CJToolBar.cpp
  • IDC_CVSGUISFURL : resource.h
  • IDC_CVSROOT : resource.h
  • IDC_CVSVERS : resource.h
  • IDC_DATE : resource.h
  • IDC_DEAD : resource.h
  • IDC_DEFBRANCH : resource.h
  • IDC_DELALL : resource.h
  • IDC_DELCVSINFO : resource.h
  • IDC_DELDIR : resource.h
  • IDC_DELETED : resource.h
  • IDC_DELSTICKY : resource.h
  • IDC_DIFF : resource.h
  • IDC_DIFFOPTIONS : resource.h
  • IDC_DIFFPROG : resource.h
  • IDC_DIRECTORY : resource.h
  • IDC_DIRTYSUPPORT : resource.h
  • IDC_DISABLESPLASHSCREEN : 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_FILENAME : 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_GROUP_OPTIONS : resource.h
  • IDC_GRPBOX_TEXT : resource.h
  • IDC_HANDCUR : CJResource.h
  • IDC_HEADER : resource.h
  • IDC_HEADERS : resource.h
  • IDC_HEADERSDESC : resource.h
  • IDC_HELPINIT : resource.h
  • IDC_HELPLOGIN : 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_ISDATE1 : resource.h
  • IDC_ISDATE2 : resource.h
  • IDC_ITEM : resource.h
  • IDC_ITEMLABEL : resource.h
  • IDC_ITEMLIST : resource.h
  • IDC_KEYWORDDESC : resource.h
  • IDC_KEYWORDSUBSTITUTION : 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_MODULE : resource.h
  • IDC_MODULE_LIST : 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_OPTION : resource.h
  • IDC_OPTIONCHECK_BUTTON : OptionalPropertySheet.h
  • IDC_OPTIONDESC : resource.h
  • IDC_OPTIONDETAILS : resource.h
  • IDC_OPTIONSLIST : resource.h
  • IDC_OPTIONSMENU : resource.h
  • IDC_OPTIONSTRING : resource.h
  • IDC_OPTIONSTRING_SL : resource.h
  • IDC_OUTPUT_QUICK : resource.h
  • IDC_OUTPUT_STANDARD : resource.h
  • IDC_OUTPUT_VERBOSE : 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_PROGRESS_TEXT : 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_READFROM : resource.h
  • IDC_REFRESH : resource.h
  • IDC_REMIND : resource.h
  • IDC_REMOVE : resource.h
  • IDC_RESET : resource.h
  • IDC_REV : resource.h
  • IDC_REVISION : resource.h
  • IDC_REVISION_SPIN : 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_SELECTIONLIST : 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_STATIC_CURRENTOPTIONS : resource.h
  • IDC_STATIC_OPTDESC : resource.h
  • IDC_STATICGROUP_SELECTOPTIONS : resource.h
  • IDC_STDOUT : resource.h
  • IDC_SUPRESS : resource.h
  • IDC_TAB_CONTROL : CJResource.h
  • IDC_TAG : resource.h
  • IDC_TAG_LIST : 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_UNIFIEDDIFF : 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_ITEM_LIST : resource.h
  • IDD_LOG_FILTERS : resource.h
  • IDD_LOG_MAIN : resource.h
  • IDD_LOGIN_MAIN : resource.h
  • IDD_NOPYTHON : resource.h
  • IDD_PASSWRD : resource.h
  • IDD_PREFERENCES : resource.h
  • IDD_PREFS_CVS : 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_MAIN : resource.h
  • IDD_RSH : resource.h
  • IDD_RTAG_MAIN : resource.h
  • IDD_RTAG_OPTIONS : resource.h
  • IDD_SAVESETTINGS : resource.h
  • IDD_SELECTION_DETAILS : resource.h
  • IDD_SSH : resource.h
  • IDD_SSPI : resource.h
  • IDD_STATUS_MAIN : 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
  • 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_ITEMLIST : 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.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, UCvsFrame.cpp
  • IsDST() : Stat.cpp
  • IsHideCommandKeyPressed() : wincvs_winutil.h, wincvs_winutil.cpp
  • IsInInvertList() : CustomizeMenus.cpp
  • IsKeyMovingFocus() : LogFrm.cpp
  • IsLargeFonts() : wincvs_winutil.h, wincvs_winutil.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
  • IsShellType() : CJMenu.cpp
  • IsTargetWindow() : wincvs_winutil.cpp
  • IsValidHandle() : wincvs.cpp
  • ItemDescription : ItemListDlg.h
  • ItemList : ItemListDlg.h

- k -

  • kAddBinary : CvsCommands.h
  • kAddCmdType : CvsCommands.h
  • kAddNormal : CvsCommands.h
  • kAddSettings : Persistent.h
  • kAddUnicode : CvsCommands.h
  • kAdminOptionDlgType : AdminOptionDlg.h
  • kAutoRefreshAlways : ItemListDlg.h
  • kAutoRefreshDisable : ItemListDlg.h
  • kAutoRefreshFirstTime : ItemListDlg.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
  • kCompareAnotherRev : DiffDlg.h
  • kCompareSameRev : DiffDlg.h
  • kCompareTwoRev : DiffDlg.h
  • kConsoleColor : AppConsole.h
  • kContinueTraversal : FileTraversal.h
  • kCustomBrowserMenu : wincvs_winutil.h
  • kCustomFilesMenu : wincvs_winutil.h
  • kDiffCmdType : CvsCommands.h
  • kDiffFile : CvsCommands.h
  • kDiffFolder : CvsCommands.h
  • kDiffGraph : CvsCommands.h
  • kDisplayData : ItemListDlg.h
  • kDisplayInfo : ItemListDlg.h
  • kDisplayType : ItemListDlg.h
  • kDisplayWait : ItemListDlg.h
  • kEditCmdType : CvsCommands.h
  • kEditForce : CvsCommands.h
  • kEditNormal : CvsCommands.h
  • kEditReserved : CvsCommands.h
  • KEYWORD_MODE_COUNT : KeywordComboBox.cpp
  • 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
  • kFilesSelectionType : PromptFiles.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 : UCvsFolders.cpp
  • kIconFolderIgnoreOpened : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kIconFolderLost : WinCvsBrowser.cpp
  • kIconFolderOpened : WinCvsBrowser.cpp, UCvsFolders.cpp
  • kInflateNodeSpace : GraphView.cpp, UCvsGraph.cpp
  • kItalic : AppConsole.h
  • kItemListAutoRefreshType : ItemListDlg.h
  • kItemListDlg : ItemListDlg.h
  • kItemListModule : ItemListDlg.h
  • kItemListTag : ItemListDlg.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
  • kProgressBar : ProgressDlg.h
  • kProgressFile : ProgressDlg.h
  • kProgressText : ProgressDlg.h
  • kProgressType : ProgressDlg.h
  • kRectangle : GraphView.h
  • kRed : AppConsole.h
  • kReleaseDelAll : ReleaseDlg.h
  • kReleaseDelCvsInfo : ReleaseDlg.h
  • kReleaseDelDir : ReleaseDlg.h
  • kReleaseDelType : ReleaseDlg.h
  • kReleaseNoDel : ReleaseDlg.h
  • kRoundRect : GraphView.h
  • kRtagAdd : RtagDlg.h
  • kRtagDelete : RtagDlg.h
  • kRtagDlgType : RtagDlg.h
  • kRtagFork : RtagDlg.h
  • kSelDetFile : SelectionDetailsDlg.h
  • kSelDetPath : SelectionDetailsDlg.h
  • kSelDetRevision : SelectionDetailsDlg.h
  • kSelDetType : SelectionDetailsDlg.h
  • kSelDir : BrowseViewHandlers.h
  • kSelectAny : PromptFiles.h
  • kSelectExecutable : PromptFiles.h
  • kSelFiles : BrowseViewHandlers.h
  • kSelNone : BrowseViewHandlers.h
  • kSelType : BrowseViewHandlers.h
  • kserver : Authen.h
  • kSetDescription : AdminOptionDlg.h
  • kSetState : AdminOptionDlg.h
  • kSkipFile : FileTraversal.h
  • kSpc : BrowseFileView.cpp
  • kStopTraversal : FileTraversal.h
  • kTagAdd : TagDlg.h
  • kTagBranch : TagDlg.h
  • kTagDelete : TagDlg.h
  • kTagDlgType : TagDlg.h
  • kTCLPathDelimiter : TclGlue.h
  • kTclRes : TclGlue.h
  • kTContinue : GraphView.h
  • kTextBinTYPE : TextBinary.h
  • kTextEscapeChar : TextBinary.h
  • kTextIsBinary : TextBinary.h
  • kTextIsUnicode : TextBinary.h
  • kTextWrongLF : TextBinary.h
  • kTextWrongSig : TextBinary.h
  • kTGetDown : GraphView.h
  • kTGraph : GraphView.h
  • kTraversal : FileTraversal.h
  • kTraversalError : FileTraversal.h
  • kTStop : GraphView.h
  • kUCvsBrowseToolbarID : UCvsCommands.h
  • kUCvsFilesID : UCvsCommands.h
  • kUCvsFilterToolbarID : 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() : CvsCommands.h, CvsCommands.cpp
  • LaunchEditor() : CvsCommands.h, CvsCommands.cpp
  • LaunchItemListCommand() : ItemListDlg.cpp
  • LaunchViewer() : CvsCommands.h, CvsCommands.cpp
  • LayoutRowCol() : GfxSplitterWnd.cpp
  • lf : ImportFilter.cpp
  • LIBID_CVS_COWORKERLib : 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
  • ListPath : ItemListDlg.h
  • 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() : CvsCommands.h, CvsCommands.cpp
  • malloc : dll_garbage.h
  • MatchIgnoredList() : CvsIgnore.h, CvsIgnore.cpp
  • MatchToken() : wincvs.cpp
  • MAX : udraw.cpp
  • MAX_ARGS : CvsCommands.h
  • MAX_BUFLEN : TipDlg.cpp
  • MAX_CHAR_BY_LINE : wincvsView.h
  • MAX_CMD_LEN : CvsCommands.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_PROC_FORMAT_STRING : CVS_Coworker_p.c
  • MIDL_TYPE_FORMAT_STRING : CVS_Coworker_p.c
  • MIDL_user_allocate() : CVS_Coworker_i.h, cvs_coworker.h
  • MIDL_user_free() : CVS_Coworker_i.h, cvs_coworker.h
  • MIGRATECVSROOTLIST : CvsPrefs.h
  • MigrateCvsrootList() : CvsPrefs.h, CvsPrefs.cpp
  • 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
  • MonitorChld() : cvsgui_process.cpp
  • month_len : Stat.cpp
  • month_names : Stat.cpp
  • my_index : getopt.c
  • myflush() : cvsgui.c
  • mystrdup() : CvsArgs.cpp
  • myTcl_CreateInterp() : TclGlue.cpp

- n -

  • N_ : cvsgui_i18n.h
  • nameColumn : BrowseViewColumn.cpp
  • NAMESPACE : UCvsFiles.cpp, MultiString.h, CvsEntries.cpp
  • 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
  • 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_CLICK : 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_HIDECOLUMNS : umain.h
  • ON_LIST_INSERT : umain.h
  • ON_LIST_NEWROW : umain.h
  • ON_LIST_POPUP : 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_LIST_SETSORTDIR : umain.h
  • ON_LIST_SHOWCOLUMNS : 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, UCvsFiles.cpp
  • onFilterMaskEntered() : MainFrm.cpp
  • onIgnoreChanged() : WinCvsBrowser.cpp, UCvsFolders.cpp
  • open_cvs_process : cvsgui_process.cpp
  • opendir() : ndir.h, ndir.c
  • OpenProject() : 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_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
  • PostCloseEnum() : cvsgui_process.cpp
  • 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
  • PyObject_Free : PythonGlue.impl.h
  • PyObject_Free_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_i.h, cvs_coworker.h
  • RenameFile() : CVS_Coworker_i.h, cvs_coworker.h
  • reopen_consoles() : cvsgui.c
  • REQUIRE_ORDER : getopt.c
  • required_argument : getopt.h
  • RETURN_IN_ORDER : getopt.c
  • 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
  • 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
  • sDiffOptions : DiffDlg.cpp
  • sDummyObject : cvsgui_process.cpp
  • sDummyStarter : UPseudoSupport.cpp
  • seekdir() : ndir.h, ndir.c
  • ServeProtocol() : cvsgui_process.cpp
  • server : Authen.h
  • serverInstance : Authen.cpp
  • SetDItemMenuSel() : MacMisc.h
  • SetIcon() : WinCvsBrowser.cpp
  • SetListCtrlExtendedStyle() : wincvs_winutil.h, wincvs_winutil.cpp
  • setModule() : dll_garbage.c
  • SetRect() : udraw.h, udraw.cpp
  • SetRectEmpty() : udraw.h, udraw.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_i.h, cvs_coworker.h
  • ShowFileHistory() : CVS_Coworker_i.h, cvs_coworker.h
  • ShowFileProperties() : CVS_Coworker_i.h, cvs_coworker.h
  • ShowUserInterface() : 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
  • split() : MultiFiles.cpp
  • SplitPath() : CvsCommands.h, CvsCommands.cpp
  • sRetainedMsgs : uevent.cpp
  • ssh : Authen.h
  • sshInstance : Authen.cpp
  • sspi : Authen.h
  • sspiInstance : Authen.cpp
  • STARTPOINT_PT : GraphView.h
  • stat : StdAfx.h
  • statusColumn : BrowseViewColumn.cpp
  • STATUSOUTPUT_QUICK : CvsPrefs.h
  • STATUSOUTPUT_STANDARD : CvsPrefs.h
  • STATUSOUTPUT_TYPE : CvsPrefs.h
  • STATUSOUTPUT_VERBOSE : CvsPrefs.h
  • sTclBrowser : TclGlue.cpp
  • STD : umain.h
  • STD_STL : cvsgui_wire.cpp, cvsgui_process.cpp
  • sTemporaryTurnOffNotify : UCvsFolders.cpp
  • sTmpList : AppGlue.cpp
  • sTooltipHandler : uevent.cpp
  • stopCVS() : AppGlue.h, AppGlue.cpp
  • STR_DIFFOPT_DESC_A : DiffDlg.cpp
  • STR_DIFFOPT_DESC_B : DiffDlg.cpp
  • STR_DIFFOPT_DESC_BB : DiffDlg.cpp
  • STR_DIFFOPT_DESC_BINARY : DiffDlg.cpp
  • STR_DIFFOPT_DESC_BRIEF : DiffDlg.cpp
  • STR_DIFFOPT_DESC_C : DiffDlg.cpp
  • STR_DIFFOPT_DESC_C_G_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_CC : DiffDlg.cpp
  • STR_DIFFOPT_DESC_D : DiffDlg.cpp
  • STR_DIFFOPT_DESC_E : DiffDlg.cpp
  • STR_DIFFOPT_DESC_E_T : DiffDlg.cpp
  • STR_DIFFOPT_DESC_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_F_E : DiffDlg.cpp
  • STR_DIFFOPT_DESC_FF : DiffDlg.cpp
  • STR_DIFFOPT_DESC_H_L : DiffDlg.cpp
  • STR_DIFFOPT_DESC_HH : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_A_S : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_B_L : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_C : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_M_L : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_S_C : DiffDlg.cpp
  • STR_DIFFOPT_DESC_I_T : DiffDlg.cpp
  • STR_DIFFOPT_DESC_IFDEF : DiffDlg.cpp
  • STR_DIFFOPT_DESC_II : DiffDlg.cpp
  • STR_DIFFOPT_DESC_L_C : DiffDlg.cpp
  • STR_DIFFOPT_DESC_L_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_LABEL : DiffDlg.cpp
  • STR_DIFFOPT_DESC_LL : DiffDlg.cpp
  • STR_DIFFOPT_DESC_MINIMAL : DiffDlg.cpp
  • STR_DIFFOPT_DESC_N : DiffDlg.cpp
  • STR_DIFFOPT_DESC_N_G_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_N_L_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_NN : DiffDlg.cpp
  • STR_DIFFOPT_DESC_O_G_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_O_L_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_PP : DiffDlg.cpp
  • STR_DIFFOPT_DESC_RCS : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S_B_S : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S_C_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S_C_L : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S_F_L : DiffDlg.cpp
  • STR_DIFFOPT_DESC_S_L_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_T : DiffDlg.cpp
  • STR_DIFFOPT_DESC_TEXT : DiffDlg.cpp
  • STR_DIFFOPT_DESC_TT : DiffDlg.cpp
  • STR_DIFFOPT_DESC_U : DiffDlg.cpp
  • STR_DIFFOPT_DESC_U_G_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_U_L_F : DiffDlg.cpp
  • STR_DIFFOPT_DESC_UU : DiffDlg.cpp
  • STR_DIFFOPT_DESC_W : DiffDlg.cpp
  • STR_DIFFOPT_DESC_WW : DiffDlg.cpp
  • STR_DIFFOPT_DESC_Y : DiffDlg.cpp
  • STR_DIFFOPT_OPT_A : DiffDlg.cpp
  • STR_DIFFOPT_OPT_B : DiffDlg.cpp
  • STR_DIFFOPT_OPT_BB : DiffDlg.cpp
  • STR_DIFFOPT_OPT_BINARY : DiffDlg.cpp
  • STR_DIFFOPT_OPT_BRIEF : DiffDlg.cpp
  • STR_DIFFOPT_OPT_C : DiffDlg.cpp
  • STR_DIFFOPT_OPT_C_G_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_CC : DiffDlg.cpp
  • STR_DIFFOPT_OPT_D : DiffDlg.cpp
  • STR_DIFFOPT_OPT_E : DiffDlg.cpp
  • STR_DIFFOPT_OPT_E_T : DiffDlg.cpp
  • STR_DIFFOPT_OPT_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_F_E : DiffDlg.cpp
  • STR_DIFFOPT_OPT_FF : DiffDlg.cpp
  • STR_DIFFOPT_OPT_H_L : DiffDlg.cpp
  • STR_DIFFOPT_OPT_HH : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_A_S : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_B_L : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_C : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_M_L : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_S_C : DiffDlg.cpp
  • STR_DIFFOPT_OPT_I_T : DiffDlg.cpp
  • STR_DIFFOPT_OPT_IFDEF : DiffDlg.cpp
  • STR_DIFFOPT_OPT_II : DiffDlg.cpp
  • STR_DIFFOPT_OPT_L_C : DiffDlg.cpp
  • STR_DIFFOPT_OPT_L_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_LABEL : DiffDlg.cpp
  • STR_DIFFOPT_OPT_LL : DiffDlg.cpp
  • STR_DIFFOPT_OPT_MINIMAL : DiffDlg.cpp
  • STR_DIFFOPT_OPT_N : DiffDlg.cpp
  • STR_DIFFOPT_OPT_N_G_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_N_L_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_NN : DiffDlg.cpp
  • STR_DIFFOPT_OPT_O_G_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_O_L_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_P : DiffDlg.cpp
  • STR_DIFFOPT_OPT_RCS : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S_B_S : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S_C_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S_C_L : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S_F_L : DiffDlg.cpp
  • STR_DIFFOPT_OPT_S_L_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_T : DiffDlg.cpp
  • STR_DIFFOPT_OPT_TEXT : DiffDlg.cpp
  • STR_DIFFOPT_OPT_TT : DiffDlg.cpp
  • STR_DIFFOPT_OPT_U : DiffDlg.cpp
  • STR_DIFFOPT_OPT_U_G_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_U_L_F : DiffDlg.cpp
  • STR_DIFFOPT_OPT_UU : DiffDlg.cpp
  • STR_DIFFOPT_OPT_W : DiffDlg.cpp
  • STR_DIFFOPT_OPT_WW : DiffDlg.cpp
  • STR_DIFFOPT_OPT_Y : DiffDlg.cpp
  • STR_DIFFOPT_OPTIONDESCRIPTION_FORMAT : DiffDlg.cpp
  • STR_ITEMLIST_BRANCH : ItemListDlg.cpp
  • STR_ITEMLIST_DIR : ItemListDlg.cpp
  • STR_ITEMLIST_REVISION : ItemListDlg.cpp
  • STR_ITEMLIST_UP_DIR : ItemListDlg.cpp
  • STR_UNSETENV_EQUAL : Authen.cpp
  • strdup() : stdafx.h, UPseudoSupport.cpp, stdafx.h
  • StringToArgv() : CvsCommands.h, CvsCommands.cpp
  • 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
  • textdomain : cvsgui_i18n.h
  • TextOnly : CJMenu.h
  • theApp : wincvs.cpp
  • theHookMap : Subclass.cpp
  • THREAD_EXIT_SUCCESS : cvsgui_process.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
  • 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_AboutDlg() : UCvsDialogs.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_SelDetailsDlg() : UCvsDialogs.h
  • UCreate_SelTagBranchDlg() : UCvsDialogs.h
  • 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_i.h, cvs_coworker.h
  • UNDEF_STDC : TclGlue.cpp
  • UnionRect() : udraw.h, udraw.cpp
  • unloadCVS() : AppGlue.mac.h
  • unmodified() : CvsEntries.cpp
  • unsetenv : Authen.cpp
  • UpdateFiles() : 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 -

  • WaitForCvs() : AppGlue.h, AppGlue.cpp
  • wantDebugging : stdafx.h
  • WarnNoPython() : NoPython.h, NoPython.cpp
  • WCHARFORMAT : wincvsView.h, AppConsole.h
  • 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_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_MAX : SmartComboBox.h
  • WM_SMCB_MIN : SmartComboBox.h
  • 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 Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


Page Index

WinCvs Source Related Pages

Here is a list of all related documentation pages:
  • Todo List
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


Todo List

Member CleanupLogMsg (const char *msg)
mac : ISO conversion
Generated on Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


Graphical Class Hierarchy

WinCvs Source Graphical Class Hierarchy

Go to the textual class hierarchy

Generated on Fri Jan 31 12:22:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CViewInfo Member List

This is the complete list of members for CViewInfo, including all inherited members.
view CViewInfo
Generated on Fri Jan 31 12:20:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:30 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:17:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:50 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:18:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:13 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

UMSGMAP Member List

This is the complete list of members for UMSGMAP, including all inherited members.
lpEntries | UMSGMAP
pBaseMap | UMSGMAP
Generated on Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:39 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

USIZE Member List

This is the complete list of members for USIZE, including all inherited members.
cx | USIZE
cy | USIZE
Generated on Fri Jan 31 12:19:38 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

UPOINT Member List

This is the complete list of members for UPOINT, including all inherited members.
x | UPOINT
y | UPOINT
Generated on Fri Jan 31 12:18:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:36 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:18:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:57 2003 for WinCvs Source by doxygen 1.3-rc2


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]
find(const char *thestr) const | UStr |
find(char thechar) const | UStr |
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+=(int addToStr) | UStr |
operator+=(char *addToStr) | UStr |
operator+=(const char *addToStr) | UStr |
operator+=(const UStr &addToStr) | 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 |
rfind(const char *thestr) const | UStr |
rfind(char thechar) const | UStr |
set(const char *buf, unsigned int len) | UStr |
str | UStr | [protected]
substr(int idx, int len) const | UStr |
substr(int idx, int len, UStr &subStr) const | UStr |
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 Fri Jan 31 12:19:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:58 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AREF Member List

This is the complete list of members for AREF, including all inherited members.
bitmap | AREF
cnt | AREF
Generated on Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:51 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:20:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:21:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CAnnotate_MAIN Member List

This is the complete list of members for CAnnotate_MAIN, including all inherited members.
CAnnotate_MAIN(const MultiFiles *mf, const char *rev, bool isDate) | 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_mf | CAnnotate_MAIN | [private]
m_noRecurse | CAnnotate_MAIN |
m_revCombo | CAnnotate_MAIN |
m_strRev | CAnnotate_MAIN |
OnBrowseTag() | CAnnotate_MAIN | [protected]
OnIsdate() | CAnnotate_MAIN | [protected]
OnSpecifyRev() | CAnnotate_MAIN | [protected]
~CAnnotate_MAIN() | CAnnotate_MAIN |
Generated on Fri Jan 31 12:13:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:24 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CStreamConsole Member List

This is the complete list of members for CStreamConsole, including all inherited members.
CStreamConsole(FILE *out) | CStreamConsole |
cvs_err(char *txt, long len) | CStreamConsole | [virtual]
cvs_out(char *txt, long len) | CStreamConsole | [virtual]
m_fOut | CStreamConsole | [protected]
Generated on Fri Jan 31 12:19:51 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CAuthenSetUp Member List

This is the complete list of members for CAuthenSetUp, including all inherited members.
CAuthenSetUp() | CAuthenSetUp |
~CAuthenSetUp() | CAuthenSetUp | [virtual]
Generated on Fri Jan 31 12:13:43 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CTmpFiles Member List

This is the complete list of members for CTmpFiles, including all inherited members.
CTmpFiles() | CTmpFiles |
m_allfiles | CTmpFiles | [protected]
push_back(const char *file) | CTmpFiles | [inline]
~CTmpFiles() | CTmpFiles | [virtual]
Generated on Fri Jan 31 12:20:20 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:18:43 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:15:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:28 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenModel | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenModel | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | 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 Fri Jan 31 12:13:40 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenSSH | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenSSH | [inline, virtual]
HasUser(void) const | AuthenSSH | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
oldRsaIdentity | AuthenSSH | [private]
oldRsaOptions | AuthenSSH | [private]
oldRsh | AuthenSSH | [private]
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 Fri Jan 31 12:13:44 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:13:37 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenPserver | [inline, virtual]
HasLogin(void) const | AuthenPserver | [inline, virtual]
HasSettings(void) const | AuthenPserver | [inline, virtual]
HasUser(void) const | AuthenPserver | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
oldPserverPort | AuthenPserver | [private]
OnGetEnv(char *env) | AuthenPserver | [virtual]
OnRestoreEnv(void) | AuthenPserver | [virtual]
OnSetupEnv(void) | AuthenPserver | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenPserver() | AuthenPserver | [inline, virtual]
Generated on Fri Jan 31 12:13:42 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:13:33 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenRhosts | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenRhosts | [inline, virtual]
HasUser(void) const | AuthenRhosts | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
oldRhostPort | AuthenRhosts | [private]
oldRsa | AuthenRhosts | [private]
oldServerName | AuthenRhosts | [private]
OnGetEnv(char *env) | AuthenRhosts | [virtual]
OnRestoreEnv(void) | AuthenRhosts | [virtual]
OnSetupEnv(void) | AuthenRhosts | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenRhosts() | AuthenRhosts | [inline, virtual]
Generated on Fri Jan 31 12:13:42 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:13:35 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenKserver | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenKserver | [inline, virtual]
HasUser(void) const | AuthenKserver | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | 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 Fri Jan 31 12:13:39 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:13:32 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenNtserver | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenNtserver | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | 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 Fri Jan 31 12:13:41 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenGserver | [inline, virtual]
HasHost(void) const | AuthenGserver | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenGserver | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | 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 Fri Jan 31 12:13:39 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:13:30 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AuthenSspi Member List

This is the complete list of members for AuthenSspi, including all inherited members.
AuthenModel() | AuthenModel |
AuthenSspi() | AuthenSspi | [inline]
DoSettings(void) | AuthenSspi | [virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenSspi | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenSspi | [virtual]
GetToken(void) const | AuthenSspi | [inline, virtual]
HasEncryption(void) const | AuthenSspi | [inline, virtual]
HasHost(void) const | AuthenSspi | [inline, virtual]
HasLogin(void) const | AuthenSspi | [inline, virtual]
HasSettings(void) const | AuthenSspi | [inline, virtual]
HasUser(void) const | AuthenSspi | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenSspi | [virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenSspi() | AuthenSspi | [inline, virtual]
Generated on Fri Jan 31 12:13:44 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

UAuthen_Sspi Member List

This is the complete list of members for UAuthen_Sspi, including all inherited members.
_GetBaseClass() | UAuthen_Sspi | [protected, static]
_messageEntries | UAuthen_Sspi | [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_Sspi | UAuthen_Sspi | [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_Sspi | [virtual]
DoModal(int id=0) | UWidget |
DoValidUI(bool how) | UWidget | [static]
EndModal(bool result) | UWidget |
GetBaseMessageMap() | UAuthen_Sspi | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetMessageMap() const | UAuthen_Sspi | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRuntimeClass() const | UAuthen_Sspi | [virtual]
GetThisMessageMap() | UAuthen_Sspi | [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_Sspi |
kCheckEncrypt enum value | UAuthen_Sspi |
kOK enum value | UAuthen_Sspi |
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_Sspi | [protected, static]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
RemoveTimer(int cmd) | UWidget |
rtUAuthen_Sspi(void) | UAuthen_Sspi | [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_Sspi() | UAuthen_Sspi |
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_Sspi() | UAuthen_Sspi | [inline, virtual]
~UCmdTarget() | UCmdTarget | [virtual]
~UObject() | UObject | [inline, virtual]
~UWidget() | UWidget | [virtual]
Generated on Fri Jan 31 12:13:38 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AuthenServer Member List

This is the complete list of members for AuthenServer, including all inherited members.
AuthenModel() | AuthenModel |
AuthenServer() | AuthenServer | [inline]
DoSettings(void) | AuthenModel | [inline, virtual]
GetAllInstances(void) | AuthenModel | [static]
GetInstance(AuthenKind k) | AuthenModel | [static]
GetKind(void) const | AuthenServer | [inline, virtual]
GetSettingsDesc(UStr &desc) | AuthenModel | [inline, virtual]
GetToken(void) const | AuthenServer | [inline, virtual]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenServer | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenModel | [inline, virtual]
HasUser(void) const | AuthenServer | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenServer | [virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenModel() | AuthenModel | [virtual]
~AuthenServer() | AuthenServer | [inline, virtual]
Generated on Fri Jan 31 12:13:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:29 2003 for WinCvs Source by doxygen 1.3-rc2


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]
HasEncryption(void) const | AuthenModel | [inline, virtual]
HasHost(void) const | AuthenModel | [inline, virtual]
HasLogin(void) const | AuthenModel | [inline, virtual]
HasSettings(void) const | AuthenModel | [inline, virtual]
HasUser(void) const | AuthenModel | [inline, virtual]
m_instances | AuthenModel | [protected, static]
oldHome | AuthenModel | [protected, static]
OnGetEnv(char *env) | AuthenModel | [inline, virtual]
OnRestoreEnv(void) | AuthenModel | [virtual]
OnSetupEnv(void) | AuthenModel | [virtual]
~AuthenModel() | AuthenModel | [virtual]
Generated on Fri Jan 31 12:13:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:46 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KiSelectionHandler Member List

This is the complete list of members for KiSelectionHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
m_autoDelete | KiSelectionHandler | [private]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
m_pmf | KiSelectionHandler | [private]
m_selType | KiSelectionHandler | [private]
m_strCommand | KiSelectionHandler | [private]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf)=0 | KiSelectionHandler | [pure virtual]
OnFolder(const char *fullpath)=0 | KiSelectionHandler | [pure virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:55 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoMoveToTrashHandler Member List

This is the complete list of members for KoMoveToTrashHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoMoveToTrashHandler() | KoMoveToTrashHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoMoveToTrashHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoMoveToTrashHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:13 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoUpdateMoveToTrashHandler Member List

This is the complete list of members for KoUpdateMoveToTrashHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
IsEnabled() const | KoUpdateMoveToTrashHandler | [inline]
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoUpdateMoveToTrashHandler() | KoUpdateMoveToTrashHandler | [inline]
m_isFiles | KoUpdateMoveToTrashHandler | [private]
m_isFolders | KoUpdateMoveToTrashHandler | [private]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *) | KoUpdateMoveToTrashHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoUpdateMoveToTrashHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:31 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoCreateTagHandler Member List

This is the complete list of members for KoCreateTagHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoCreateTagHandler() | KoCreateTagHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoCreateTagHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoCreateTagHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:02 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoDeleteTagHandler Member List

This is the complete list of members for KoDeleteTagHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoDeleteTagHandler() | KoDeleteTagHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoDeleteTagHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoDeleteTagHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:03 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoBranchTagHandler Member List

This is the complete list of members for KoBranchTagHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoBranchTagHandler() | KoBranchTagHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoBranchTagHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoBranchTagHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:58 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoEditHandler Member List

This is the complete list of members for KoEditHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoEditHandler() | KoEditHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoEditHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoEditHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:05 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoReservedEditHandler Member List

This is the complete list of members for KoReservedEditHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoReservedEditHandler() | KoReservedEditHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoReservedEditHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoReservedEditHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:20 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoForceEditHandler Member List

This is the complete list of members for KoForceEditHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoForceEditHandler() | KoForceEditHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoForceEditHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoForceEditHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:08 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoUneditHandler Member List

This is the complete list of members for KoUneditHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoUneditHandler() | KoUneditHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoUneditHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoUneditHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:27 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoReleaseHandler Member List

This is the complete list of members for KoReleaseHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoReleaseHandler() | KoReleaseHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *) | KoReleaseHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoReleaseHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:19 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoWatchersHandler Member List

This is the complete list of members for KoWatchersHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoWatchersHandler() | KoWatchersHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoWatchersHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoWatchersHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:33 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoEditorsHandler Member List

This is the complete list of members for KoEditorsHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoEditorsHandler() | KoEditorsHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoEditorsHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoEditorsHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:05 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoWatchOnHandler Member List

This is the complete list of members for KoWatchOnHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoWatchOnHandler() | KoWatchOnHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoWatchOnHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoWatchOnHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:35 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoWatchOffHandler Member List

This is the complete list of members for KoWatchOffHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoWatchOffHandler() | KoWatchOffHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoWatchOffHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoWatchOffHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:35 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoDiffHandler Member List

This is the complete list of members for KoDiffHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoDiffHandler() | KoDiffHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoDiffHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoDiffHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:04 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoGraphDiffHandler Member List

This is the complete list of members for KoGraphDiffHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoGraphDiffHandler() | KoGraphDiffHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoGraphDiffHandler | [inline, virtual]
OnFolder(const char *) | KoGraphDiffHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:09 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoLogHandler Member List

This is the complete list of members for KoLogHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoLogHandler() | KoLogHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoLogHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoLogHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:13 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoGraphHandler Member List

This is the complete list of members for KoGraphHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoGraphHandler() | KoGraphHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KoGraphHandler | [inline, virtual]
OnFiles(MultiFiles *pmf) | KoGraphHandler | [inline, virtual]
OnFolder(const char *) | KoGraphHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:10 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoStatusHandler Member List

This is the complete list of members for KoStatusHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoStatusHandler() | KoStatusHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoStatusHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoStatusHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:25 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoFileRemoveHandler Member List

This is the complete list of members for KoFileRemoveHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoFileRemoveHandler() | KoFileRemoveHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoFileRemoveHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoFileRemoveHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:06 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoLockHandler Member List

This is the complete list of members for KoLockHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoLockHandler() | KoLockHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoLockHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoLockHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:12 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoUnlockHandler Member List

This is the complete list of members for KoUnlockHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoUnlockHandler() | KoUnlockHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoUnlockHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoUnlockHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:28 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoAddHandler Member List

This is the complete list of members for KoAddHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoAddHandler() | KoAddHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KoAddHandler | [inline, virtual]
OnFiles(MultiFiles *pmf) | KoAddHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoAddHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:56 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoAddBinaryHandler Member List

This is the complete list of members for KoAddBinaryHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoAddBinaryHandler() | KoAddBinaryHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KoAddBinaryHandler | [inline, virtual]
OnFiles(MultiFiles *pmf) | KoAddBinaryHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoAddBinaryHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:55 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoAddUnicodeHandler Member List

This is the complete list of members for KoAddUnicodeHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoAddUnicodeHandler() | KoAddUnicodeHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KoAddUnicodeHandler | [inline, virtual]
OnFiles(MultiFiles *pmf) | KoAddUnicodeHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoAddUnicodeHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:57 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoCommitHandler Member List

This is the complete list of members for KoCommitHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoCommitHandler() | KoCommitHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoCommitHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoCommitHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:01 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoUpdateHandler Member List

This is the complete list of members for KoUpdateHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoUpdateHandler() | KoUpdateHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoUpdateHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoUpdateHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:30 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoQueryUpdateHandler Member List

This is the complete list of members for KoQueryUpdateHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoQueryUpdateHandler() | KoQueryUpdateHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoQueryUpdateHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoQueryUpdateHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:16 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoAnnotateHandler Member List

This is the complete list of members for KoAnnotateHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoAnnotateHandler() | KoAnnotateHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoAnnotateHandler | [inline, virtual]
OnFolder(const char *) | KoAnnotateHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:57 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoCancelChangesHandler Member List

This is the complete list of members for KoCancelChangesHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoCancelChangesHandler() | KoCancelChangesHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoCancelChangesHandler | [inline, virtual]
OnFolder(const char *) | KoCancelChangesHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:59 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoCommandLineHandler Member List

This is the complete list of members for KoCommandLineHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoCommandLineHandler() | KoCommandLineHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoCommandLineHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoCommandLineHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:00 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoImportHandler Member List

This is the complete list of members for KoImportHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoImportHandler() | KoImportHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoImportHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoImportHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:11 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoCheckoutHandler Member List

This is the complete list of members for KoCheckoutHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoCheckoutHandler() | KoCheckoutHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoCheckoutHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoCheckoutHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:16:59 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoRtagCreateHandler Member List

This is the complete list of members for KoRtagCreateHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoRtagCreateHandler() | KoRtagCreateHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoRtagCreateHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoRtagCreateHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:22 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoRtagDeleteHandler Member List

This is the complete list of members for KoRtagDeleteHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoRtagDeleteHandler() | KoRtagDeleteHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoRtagDeleteHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoRtagDeleteHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:23 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoRtagBranchHandler Member List

This is the complete list of members for KoRtagBranchHandler, including all inherited members.
GetNeedSelection() const | KiSelectionHandler |
GetNeedViewReset() const | KiSelectionHandler |
GetSelection() | KiSelectionHandler | [virtual]
GetSelType() const | KiSelectionHandler |
KiSelectionHandler(const char *strCommand, bool needSelection=true, bool needResetView=false) | KiSelectionHandler |
KoRtagBranchHandler() | KoRtagBranchHandler | [inline]
m_needSelection | KiSelectionHandler | [protected]
m_needViewReset | KiSelectionHandler | [protected]
NeedsNormalize() | KiSelectionHandler | [virtual]
OnFiles(MultiFiles *pmf) | KoRtagBranchHandler | [inline, virtual]
OnFolder(const char *fullpath) | KoRtagBranchHandler | [inline, virtual]
~KiSelectionHandler() | KiSelectionHandler | [virtual]
Generated on Fri Jan 31 12:17:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [virtual]
Generated on Fri Jan 31 12:17:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [virtual]
Generated on Fri Jan 31 12:17:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [virtual]
Generated on Fri Jan 31 12:17:11 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCheckout_MAIN Member List

This is the complete list of members for CCheckout_MAIN, including all inherited members.
CCheckout_MAIN(const MultiFiles *mf, 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_checkoutDirEdit | CCheckout_MAIN |
m_mf | CCheckout_MAIN | [private]
m_moduleCombo | CCheckout_MAIN |
m_moduleName | CCheckout_MAIN |
m_noRecurse | CCheckout_MAIN |
m_overrideCoDir | CCheckout_MAIN |
m_overrideCoDirCheck | CCheckout_MAIN |
m_path | CCheckout_MAIN |
m_pathEdit | CCheckout_MAIN |
m_stdout | CCheckout_MAIN |
OnBrowseModules() | CCheckout_MAIN | [protected]
OnBtnPath() | CCheckout_MAIN | [protected]
OnCheckOverridecheckoutdir() | CCheckout_MAIN | [protected]
~CCheckout_MAIN() | CCheckout_MAIN |
Generated on Fri Jan 31 12:13:51 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCheckout_OPTIONS Member List

This is the complete list of members for CCheckout_OPTIONS, including all inherited members.
CCheckout_OPTIONS(const MultiFiles *mf, const char *rev, const char *date, const char *keyword) | CCheckout_OPTIONS |
DoDataExchange(CDataExchange *pDX) | CCheckout_OPTIONS | [protected, virtual]
IDD enum value | CCheckout_OPTIONS |
m_browseTagButton | CCheckout_OPTIONS |
m_date | CCheckout_OPTIONS |
m_dateCombo | CCheckout_OPTIONS |
m_export | CCheckout_OPTIONS |
m_forceRoot | CCheckout_OPTIONS |
m_hasDate | CCheckout_OPTIONS |
m_hasDateCheck | CCheckout_OPTIONS |
m_hasRev | CCheckout_OPTIONS |
m_hasRevCheck | CCheckout_OPTIONS |
m_keyword | CCheckout_OPTIONS |
m_keywordCombo | CCheckout_OPTIONS |
m_keywordDescStatic | CCheckout_OPTIONS |
m_match | CCheckout_OPTIONS |
m_mf | CCheckout_OPTIONS | [private]
m_rev | CCheckout_OPTIONS |
m_revCombo | CCheckout_OPTIONS |
OnBrowseTag() | CCheckout_OPTIONS | [protected]
OnDate() | CCheckout_OPTIONS | [protected]
OnInitDialog() | CCheckout_OPTIONS | [protected, virtual]
OnRev() | CCheckout_OPTIONS | [protected]
~CCheckout_OPTIONS() | CCheckout_OPTIONS |
Generated on Fri Jan 31 12:13:52 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCommit_MAIN Member List

This is the complete list of members for CCommit_MAIN, including all inherited members.
CCommit_MAIN(const MultiFiles *mf, const char *logMsg, const char *pathTmpl=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_mf | CCommit_MAIN | [private]
m_previewInfo | CCommit_MAIN |
m_prevLogsCombo | CCommit_MAIN |
m_tmplPath | CCommit_MAIN | [private]
m_wordWrap | CCommit_MAIN |
m_wordWrapCtrl | CCommit_MAIN |
OnDestroy() | CCommit_MAIN | [protected]
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 Fri Jan 31 12:15:12 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCommit_OPTIONS Member List

This is the complete list of members for CCommit_OPTIONS, including all inherited members.
CCommit_OPTIONS(const MultiFiles *mf) | 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_mf | CCommit_OPTIONS | [private]
m_noModuleProgram | CCommit_OPTIONS |
m_noRecurse | CCommit_OPTIONS |
m_rev | CCommit_OPTIONS |
m_revCombo | CCommit_OPTIONS |
OnBrowseTag() | CCommit_OPTIONS | [protected]
OnForcerevision() | CCommit_OPTIONS | [protected]
~CCommit_OPTIONS() | CCommit_OPTIONS |
Generated on Fri Jan 31 12:15:14 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | 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 Fri Jan 31 12:18:24 2003 for WinCvs Source by doxygen 1.3-rc2


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]
find(const char *thestr) const | UStr |
find(char thechar) const | UStr |
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(const char *only=0L) | 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+=(int addToStr) | UStr |
operator+=(char *addToStr) | UStr |
operator+=(const char *addToStr) | UStr |
operator+=(const UStr &addToStr) | 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]
rfind(const char *thestr) const | UStr |
rfind(char thechar) const | UStr |
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]
substr(int idx, int len) const | UStr |
substr(int idx, int len, UStr &subStr) const | UStr |
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 Fri Jan 31 12:18:26 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CStaticAllocT< T > Member List

This is the complete list of members for CStaticAllocT< T >, including all inherited members.
AdjustSize(size_t size) | CStaticAllocT< T > | [inline]
buf | CStaticAllocT< T > | [protected]
CStaticAllocT() | CStaticAllocT< T > | [inline]
numbuf | CStaticAllocT< T > | [protected]
operator const T *(void) const | CStaticAllocT< T > | [inline]
operator T *(void) const | CStaticAllocT< T > | [inline]
size() const | CStaticAllocT< T > | [inline]
~CStaticAllocT() | CStaticAllocT< T > | [inline]
Generated on Fri Jan 31 12:19:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:18 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CvsArgs Member List

This is the complete list of members for CvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | CvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs |
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 Fri Jan 31 12:20:48 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ControlCvsArgs Member List

This is the complete list of members for ControlCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs |
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 |
m_gotProblem | ControlCvsArgs | [private]
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs |
TypeDesc()=0 | ControlCvsArgs | [protected, pure virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Fri Jan 31 12:18:21 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AddCvsArgs Member List

This is the complete list of members for AddCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs |
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 |
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs |
TypeDesc() | AddCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Fri Jan 31 12:13:23 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AddBinCvsArgs Member List

This is the complete list of members for AddBinCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs |
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 |
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs |
TypeDesc() | AddBinCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Fri Jan 31 12:13:23 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

AddUnicodeCvsArgs Member List

This is the complete list of members for AddUnicodeCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | ControlCvsArgs | [virtual]
argc | CvsArgs | [protected]
Argc(void) const | CvsArgs |
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 |
print(const char *indirectory=0L) | CvsArgs |
reset(bool defargs=true) | CvsArgs |
SetProblem(bool newState) | ControlCvsArgs |
TypeDesc() | AddUnicodeCvsArgs | [inline, protected, virtual]
~CvsArgs() | CvsArgs | [virtual]
Generated on Fri Jan 31 12:13:24 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

RemoveCvsArgs Member List

This is the complete list of members for RemoveCvsArgs, including all inherited members.
add(const char *arg) | CvsArgs | [virtual]
addcvsroot() | CvsArgs |
addfile(const char *arg, const char *dir=0L, const FSSpec *spec=0L, const char *currRevision=0L) | RemoveCvsArgs | [virtual]
Argc(void) const | CvsArgs |
argc | CvsArgs | [protected]
argv | CvsArgs | [protected]
Argv(void) const | CvsArgs |
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 Fri Jan 31 12:19:22 2003 for WinCvs Source by doxygen 1.3-rc2


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() const | EntnodePath | [inline]
GetFullPathName(UStr &resPath, const char *name) const | EntnodePath |
Ref() | EntnodePath | [inline]
ref | EntnodePath | [protected]
UnRef() | EntnodePath | [inline]
~EntnodePath() | EntnodePath | [protected, virtual]
Generated on Fri Jan 31 12:15:59 2003 for WinCvs Source by doxygen 1.3-rc2


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() const | EntnodeData | [inline]
GetFolderPath() const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName() const | EntnodeData | [inline]
GetType() const=0 | EntnodeData | [pure virtual]
ignored | EntnodeData | [protected]
IsIgnored() const | EntnodeData | [inline]
IsLocked() const | EntnodeData | [inline]
IsMissing() const | EntnodeData | [inline]
IsRemoved() const | EntnodeData | [inline]
IsUnknown() const | EntnodeData | [inline]
IsUnmodified() const | EntnodeData | [inline]
IsVisited() 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 | [virtual]
Ref() | EntnodeData | [inline]
ref | EntnodeData | [protected]
removed | EntnodeData | [protected]
sbuffer | EntnodeData | [private, static]
SetDesc(const char *newdesc) | EntnodeData | [inline]
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() | EntnodeData | [inline]
user | EntnodeData | [private]
visited | EntnodeData | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
Generated on Fri Jan 31 12:15:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [virtual]
GetDesc() const | EntnodeData | [inline]
GetFolderPath() const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName() const | EntnodeData | [inline]
GetType() const | EntnodeFile | [virtual]
ignored | EntnodeData | [protected]
IsIgnored() const | EntnodeData | [inline]
IsLocked() const | EntnodeData | [inline]
IsMissing() const | EntnodeData | [inline]
IsRemoved() const | EntnodeData | [inline]
IsUnknown() const | EntnodeData | [inline]
IsUnmodified() const | EntnodeData | [inline]
IsVisited() 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 | [virtual]
option | EntnodeFile | [protected]
ref | EntnodeData | [protected]
Ref() | EntnodeData | [inline]
removed | EntnodeData | [protected]
SetDesc(const char *newdesc) | EntnodeData | [inline]
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() | EntnodeData | [inline]
visited | EntnodeData | [protected]
vn | EntnodeFile | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
~EntnodeFile() | EntnodeFile | [protected, virtual]
Generated on Fri Jan 31 12:15:57 2003 for WinCvs Source by doxygen 1.3-rc2


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() const | EntnodeData | [inline]
GetFolderPath() const | EntnodeData | [inline]
GetFullPathName(UStr &resPath) const | EntnodeData | [inline]
GetName() const | EntnodeData | [inline]
GetType() const | EntnodeFolder | [virtual]
ignored | EntnodeData | [protected]
IsIgnored() const | EntnodeData | [inline]
IsLocked() const | EntnodeData | [inline]
IsMissing() const | EntnodeData | [inline]
IsRemoved() const | EntnodeData | [inline]
IsUnknown() const | EntnodeData | [inline]
IsUnmodified() const | EntnodeData | [inline]
IsVisited() 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 | [virtual]
ref | EntnodeData | [protected]
Ref() | EntnodeData | [inline]
removed | EntnodeData | [protected]
SetDesc(const char *newdesc) | EntnodeData | [inline]
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() | EntnodeData | [inline]
visited | EntnodeData | [protected]
~EntnodeData() | EntnodeData | [protected, virtual]
~EntnodeFolder() | EntnodeFolder | [protected, virtual]
Generated on Fri Jan 31 12:15:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
shareData | ENTNODE | [protected]
~ENTNODE() | ENTNODE | [inline, virtual]
Generated on Fri Jan 31 12:15:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:56 2003 for WinCvs Source by doxygen 1.3-rc2


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
stopProcessEvent | _CvsProcess
threadID | _CvsProcess
threads | _CvsProcess
threadsID | _CvsProcess
write_buffer | _CvsProcess
write_buffer_index | _CvsProcess
Generated on Fri Jan 31 12:13:19 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

_CvsProcessStartupInfo Member List

This is the complete list of members for _CvsProcessStartupInfo, including all inherited members.
_CvsProcessStartupInfo() | _CvsProcessStartupInfo | [inline]
currentDirectory | _CvsProcessStartupInfo |
hasTty | _CvsProcessStartupInfo |
Generated on Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

_WireMessage Member List

This is the complete list of members for _WireMessage, including all inherited members.
data | _WireMessage
type | _WireMessage
Generated on Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
DisableSplashScreen(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 |
HideCommandDlgStatus(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 |
SetDisableSplashScreen(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 |
SetHideCommandDlgStatus(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 |
SetSettingsFolder(const char *settingsFolder) | CvsPrefs |
SetStatusOutputType(STATUSOUTPUT_TYPE outputType) | CvsPrefs |
SetTclFileRunning(bool launched) | CvsPrefs |
SettingsFolder(void) const | 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 |
StatusOutputType(void) const | 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 Fri Jan 31 12:20:56 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

_sDiffOptionsItem Member List

This is the complete list of members for _sDiffOptionsItem, including all inherited members.
description | _sDiffOptionsItem
option | _sDiffOptionsItem
Generated on Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CDiff_MAIN Member List

This is the complete list of members for CDiff_MAIN, including all inherited members.
CDiff_MAIN(const MultiFiles *mf, kDiffCmdType diffType, const char *rev1, const char *rev2, bool allowExtDiff, bool useExtDiff, bool unifiedDiff, bool noWhiteSpace, bool ignoreCase, const char *keyword, const char *diffOptions) | CDiff_MAIN |
DoDataExchange(CDataExchange *pDX) | CDiff_MAIN | [protected, virtual]
EnableCmdLineDiffOptions(bool enable) | CDiff_MAIN | [private]
EnableCompareType(int compareType) | CDiff_MAIN | [private]
IDD enum value | CDiff_MAIN |
m_allowExtDiff | CDiff_MAIN | [private]
m_browseTag1Button | CDiff_MAIN |
m_browseTag2Button | CDiff_MAIN |
m_compareType | CDiff_MAIN |
m_compareTypeCombo | CDiff_MAIN |
m_diffOptions | CDiff_MAIN |
m_diffOptionsCombo | CDiff_MAIN |
m_diffType | CDiff_MAIN | [private]
m_extDiff | CDiff_MAIN |
m_extDiffButton | CDiff_MAIN |
m_ignoreCase | CDiff_MAIN |
m_ignoreCaseCheck | CDiff_MAIN |
m_isDate1 | CDiff_MAIN |
m_isDate1Check | CDiff_MAIN |
m_isDate2 | CDiff_MAIN |
m_isDate2Check | CDiff_MAIN |
m_keyword | CDiff_MAIN |
m_keywordCombo | CDiff_MAIN |
m_keywordDescStatic | CDiff_MAIN |
m_mf | CDiff_MAIN | [private]
m_noRecurs | CDiff_MAIN |
m_noRecursCheck | CDiff_MAIN |
m_noWhiteSpace | CDiff_MAIN |
m_noWhiteSpaceCheck | CDiff_MAIN |
m_optionsMenuButton | CDiff_MAIN |
m_rev1 | CDiff_MAIN |
m_rev1Combo | CDiff_MAIN |
m_rev2 | CDiff_MAIN |
m_rev2Combo | CDiff_MAIN |
m_unifiedDiff | CDiff_MAIN |
m_unifiedDiffCheck | CDiff_MAIN |
OnBrowseTag1() | CDiff_MAIN | [protected]
OnBrowseTag2() | CDiff_MAIN | [protected]
OnCheck1() | CDiff_MAIN | [protected]
OnCheck2() | CDiff_MAIN | [protected]
OnExtdiff() | CDiff_MAIN | [protected]
OnInitDialog() | CDiff_MAIN | [protected, virtual]
OnOptionsmenu() | CDiff_MAIN | [protected]
OnSelchangeCompareType() | CDiff_MAIN | [protected]
~CDiff_MAIN() | CDiff_MAIN |
Generated on Fri Jan 31 12:15:47 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CDiff_Options Member List

This is the complete list of members for CDiff_Options, including all inherited members.
CDiff_Options(CWnd *pParent=NULL) | CDiff_Options |
CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam) | CDiff_Options | [private, static]
DoDataExchange(CDataExchange *pDX) | CDiff_Options | [protected, virtual]
GetDiffOptions() | CDiff_Options |
IDD enum value | CDiff_Options |
m_currentOptions | CDiff_Options |
m_diffOptions | CDiff_Options | [private]
m_headerCtrl | CDiff_Options | [private]
m_optionsListCtrl | CDiff_Options |
m_sortAsc | CDiff_Options | [private]
m_sortColumn | CDiff_Options | [private]
OnColumnclickOptionslist(NMHDR *pNMHDR, LRESULT *pResult) | CDiff_Options | [protected]
OnInitDialog() | CDiff_Options | [protected, virtual]
OnItemchangedOptionslist(NMHDR *pNMHDR, LRESULT *pResult) | CDiff_Options | [protected]
OnOK() | CDiff_Options | [protected, virtual]
SortItems(int column, bool asc) | CDiff_Options | [private]
Generated on Fri Jan 31 12:15:48 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CDiff_Options::CompareInfo Member List

This is the complete list of members for CDiff_Options::CompareInfo, including all inherited members.
m_asc | CDiff_Options::CompareInfo
m_column | CDiff_Options::CompareInfo
Generated on Fri Jan 31 12:15:48 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

_frameRec Member List

This is the complete list of members for _frameRec, including all inherited members.
entry | _frameRec
next | _frameRec
Generated on Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:36 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

garbyRec Member List

This is the complete list of members for garbyRec, including all inherited members.
pools garbyRec
Generated on Fri Jan 31 12:16:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:05 2003 for WinCvs Source by doxygen 1.3-rc2


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_authenDescEdit | 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_hostEdit | CGetPrefs_CVSROOT |
m_login | CGetPrefs_CVSROOT |
m_loginEdit | CGetPrefs_CVSROOT |
m_path | CGetPrefs_CVSROOT |
m_pathEdit | CGetPrefs_CVSROOT |
m_settingsButton | 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 Fri Jan 31 12:16:08 2003 for WinCvs Source by doxygen 1.3-rc2


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_disableSplashScreen | CGetPrefs_GLOBALS |
m_logout | CGetPrefs_GLOBALS |
m_logoutCheck | CGetPrefs_GLOBALS |
m_logoutEdit | CGetPrefs_GLOBALS |
m_logoutSpinButton | CGetPrefs_GLOBALS |
m_logoutTime | CGetPrefs_GLOBALS |
m_prune | CGetPrefs_GLOBALS |
m_quiet | CGetPrefs_GLOBALS |
m_tcpip | CGetPrefs_GLOBALS |
m_tcpipCheck | CGetPrefs_GLOBALS |
m_unixlf | CGetPrefs_GLOBALS |
m_zlevel | CGetPrefs_GLOBALS |
m_zlevelEdit | CGetPrefs_GLOBALS |
m_zspinSpinButton | 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 Fri Jan 31 12:16:10 2003 for WinCvs Source by doxygen 1.3-rc2


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_didInteract | CGetPrefs_WINCVS | [protected]
m_diffProg | CGetPrefs_WINCVS |
m_diffProgEdit | CGetPrefs_WINCVS |
m_extDiffSelButton | CGetPrefs_WINCVS |
m_settingsFolder | CGetPrefs_WINCVS |
m_settingsFolderButton | CGetPrefs_WINCVS |
m_settingsFolderEdit | CGetPrefs_WINCVS |
m_useExtDiff | CGetPrefs_WINCVS |
m_useExtDiffCheck | CGetPrefs_WINCVS |
m_useSettingsFolder | CGetPrefs_WINCVS |
m_useSettingsFolderCheck | CGetPrefs_WINCVS |
m_useViewerAlways | CGetPrefs_WINCVS |
m_viewer | CGetPrefs_WINCVS |
m_viewerEdit | CGetPrefs_WINCVS |
OnAltsettingschk() | CGetPrefs_WINCVS | [protected]
OnBtnsettings() | CGetPrefs_WINCVS | [protected]
OnBtnviewer() | CGetPrefs_WINCVS | [protected]
OnExtdiff() | CGetPrefs_WINCVS | [protected]
OnExtdiffsel() | CGetPrefs_WINCVS | [protected]
StoreValues() | CGetPrefs_WINCVS |
~CGetPrefs_WINCVS() | CGetPrefs_WINCVS |
Generated on Fri Jan 31 12:16:11 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CGetPrefs_CVS Member List

This is the complete list of members for CGetPrefs_CVS, including all inherited members.
CGetPrefs_CVS() | CGetPrefs_CVS |
DoDataExchange(CDataExchange *pDX) | CGetPrefs_CVS | [protected, virtual]
IDD enum value | CGetPrefs_CVS |
m_altCvs | CGetPrefs_CVS |
m_altCvsEdit | CGetPrefs_CVS |
m_didInteract | CGetPrefs_CVS | [protected]
m_home | CGetPrefs_CVS |
m_homeEdit | CGetPrefs_CVS |
m_selAltCvsButton | CGetPrefs_CVS |
m_useAltCvs | CGetPrefs_CVS |
m_useAltCvsCheck | CGetPrefs_CVS |
OnAltcvschk() | CGetPrefs_CVS | [protected]
OnAltcvssel() | CGetPrefs_CVS | [protected]
OnBtnhome() | CGetPrefs_CVS | [protected]
StoreValues() | CGetPrefs_CVS |
~CGetPrefs_CVS() | CGetPrefs_CVS |
Generated on Fri Jan 31 12:16:06 2003 for WinCvs Source by doxygen 1.3-rc2


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_hideStatus | 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 Fri Jan 31 12:16:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:27 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CImport_MAIN Member List

This is the complete list of members for CImport_MAIN, including all inherited members.
CImport_MAIN(const MultiFiles *mf, const char *logmsg, const char *modname, const char *rtag, const char *vtag) | CImport_MAIN |
DoDataExchange(CDataExchange *pDX) | CImport_MAIN | [protected, virtual]
IDD enum value | CImport_MAIN |
m_logmsg | CImport_MAIN |
m_mf | CImport_MAIN | [private]
m_moduleCombo | CImport_MAIN |
m_moduleName | CImport_MAIN |
m_rtag | CImport_MAIN |
m_rtagCombo | CImport_MAIN |
m_vtag | CImport_MAIN |
m_vtagCombo | CImport_MAIN |
OnBrowseModules() | CImport_MAIN | [protected]
OnBrowseTag1() | CImport_MAIN | [protected]
OnBrowseTag2() | CImport_MAIN | [protected]
~CImport_MAIN() | CImport_MAIN |
Generated on Fri Jan 31 12:16:35 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
DoDataExchange(CDataExchange *pDX) | CImport_OPTIONS | [protected, virtual]
IDD enum value | CImport_OPTIONS |
m_path | CImport_OPTIONS |
m_pathEdit | CImport_OPTIONS |
m_useDefIgnore | CImport_OPTIONS |
m_useFilesTime | CImport_OPTIONS |
OnBtnpath() | CImport_OPTIONS | [protected]
~CImport_OPTIONS() | CImport_OPTIONS |
Generated on Fri Jan 31 12:16:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
fcreator | ReportConflict | [protected]
ForceBinary(void) | ReportConflict |
forceBinary enum value | ReportConflict |
ForceNoKeywords(void) | ReportConflict |
forceNoKeywords enum value | ReportConflict |
ForceText(void) | ReportConflict |
forceText enum value | ReportConflict |
forceUnicode enum value | ReportConflict |
ForceUnicode(void) | ReportConflict |
ftype | ReportConflict | [protected]
GetDesc() const | ReportConflict |
GetKindDesc() const | ReportConflict |
GetMacCreator(void) const | ReportConflict |
GetMacType(void) const | ReportConflict |
GetPattern(void) const | ReportConflict |
GetStateDesc() const | ReportConflict |
hasConflict enum value | ReportConflict |
HasConflict(void) const | ReportConflict |
hasExtension enum value | ReportConflict |
HasForceBinary(void) const | ReportConflict |
HasForceNoKeywords(void) const | ReportConflict |
HasForceText(void) const | ReportConflict |
HasForceUnicode(void) const | ReportConflict |
HasIgnore(void) const | ReportConflict |
hasIgnore enum value | ReportConflict |
HasTypeCreatorConflict(void) const | ReportConflict |
hasTypeCreatorConflict enum value | ReportConflict |
Ignore(void) | ReportConflict |
isBinary enum value | ReportConflict |
IsBinary(void) const | ReportConflict |
IsExtension(void) const | ReportConflict |
isUnicode enum value | ReportConflict |
IsUnicode(void) const | 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 | [virtual]
Generated on Fri Jan 31 12:19:24 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ReportWarning Member List

This is the complete list of members for ReportWarning, including all inherited members.
AddWarning(const char *sample) | ReportWarning |
GetDesc() const | ReportWarning |
GetStateDesc() const | ReportWarning |
IsError() const | ReportWarning |
Kind(void) const | ReportWarning |
kind | ReportWarning | [protected]
maxWarnings | ReportWarning | [static]
next | ReportWarning |
PrintOut(UStr &out) const | ReportWarning |
ReportWarning(kTextBinTYPE akind) | ReportWarning |
samples | ReportWarning | [protected]
tooManyWarnings | ReportWarning | [protected]
~ReportWarning() | ReportWarning | [virtual]
Generated on Fri Jan 31 12:19:25 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ImportReport Member List

This is the complete list of members for ImportReport, including all inherited members.
conflicts | ImportReport | [private]
EnterDirectory(const char *fullpath, const char *dirname, const FSSpec *macspec) | ImportReport | [virtual]
ExitDirectory(const char *fullpath) | ImportReport | [virtual]
GetIgnoreList() | ImportReport | [inline]
gRunning | TraversalReport | [static]
ImportReport(const char *path, ReportWarning *&w, ReportConflict *&c) | ImportReport |
m_ignlist | ImportReport | [private]
m_progress | ImportReport | [private]
OnAlias(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | ImportReport | [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 | [virtual]
OnError(const char *err, int errcode) | ImportReport | [virtual]
OnFile(const char *fullpath, const char *fullname, const char *name, const struct stat &dir, const FSSpec *macspec) | ImportReport | [virtual]
OnIdle(const char *fullpath) | ImportReport | [virtual]
warnings | ImportReport | [private]
~ImportReport() | ImportReport | [virtual]
Generated on Fri Jan 31 12:16:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [private]
m_imageList | CImportFilterDlg | [private]
m_list | CImportFilterDlg |
m_warnings | CImportFilterDlg | [private]
OnDblclkListentries(NMHDR *pNMHDR, LRESULT *pResult) | CImportFilterDlg | [protected]
OnEditentry() | CImportFilterDlg | [protected]
OnInitDialog() | CImportFilterDlg | [protected, virtual]
Generated on Fri Jan 31 12:16:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:37 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CInit_MAIN Member List

This is the complete list of members for CInit_MAIN, including all inherited members.
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 Fri Jan 31 12:16:41 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ItemRowInfo Member List

This is the complete list of members for ItemRowInfo, including all inherited members.
m_description | ItemRowInfo
m_descriptionEx | ItemRowInfo
Generated on Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CItemListConsole Member List

This is the complete list of members for CItemListConsole, including all inherited members.
CItemListConsole() | CItemListConsole |
cvs_err(char *txt, long len) | CItemListConsole | [virtual]
cvs_out(char *txt, long len) | CItemListConsole | [virtual]
GetCvsErr() | CItemListConsole |
GetItemList() const | CItemListConsole |
GetLaunchRes() const | CItemListConsole |
m_cvsErr | CItemListConsole | [protected]
m_cvsOut | CItemListConsole | [protected]
m_itemList | CItemListConsole | [protected]
m_launchRes | CItemListConsole | [protected]
Parse(int launchRes)=0L | CItemListConsole | [pure virtual]
~CItemListConsole() | CItemListConsole | [virtual]
Generated on Fri Jan 31 12:16:44 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CTagParserConsole Member List

This is the complete list of members for CTagParserConsole, including all inherited members.
CItemListConsole() | CItemListConsole |
CTagParserConsole() | CTagParserConsole |
cvs_err(char *txt, long len) | CItemListConsole | [virtual]
cvs_out(char *txt, long len) | CItemListConsole | [virtual]
GetCvsErr() | CItemListConsole |
GetItemList() const | CItemListConsole |
GetLaunchRes() const | CItemListConsole |
m_cvsErr | CItemListConsole | [protected]
m_cvsOut | CItemListConsole | [protected]
m_itemList | CItemListConsole | [protected]
m_launchRes | CItemListConsole | [protected]
Parse(int launchRes) | CTagParserConsole | [virtual]
~CItemListConsole() | CItemListConsole | [virtual]
~CTagParserConsole() | CTagParserConsole | [virtual]
Generated on Fri Jan 31 12:19:55 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CModuleParserConsole Member List

This is the complete list of members for CModuleParserConsole, including all inherited members.
CItemListConsole() | CItemListConsole |
CModuleParserConsole() | CModuleParserConsole |
cvs_err(char *txt, long len) | CItemListConsole | [virtual]
cvs_out(char *txt, long len) | CItemListConsole | [virtual]
GetCvsErr() | CItemListConsole |
GetItemList() const | CItemListConsole |
GetLaunchRes() const | CItemListConsole |
m_cvsErr | CItemListConsole | [protected]
m_cvsOut | CItemListConsole | [protected]
m_itemList | CItemListConsole | [protected]
m_launchRes | CItemListConsole | [protected]
Parse(int launchRes) | CModuleParserConsole | [virtual]
~CItemListConsole() | CItemListConsole | [virtual]
~CModuleParserConsole() | CModuleParserConsole | [virtual]
Generated on Fri Jan 31 12:18:10 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CListParserConsole Member List

This is the complete list of members for CListParserConsole, including all inherited members.
CItemListConsole() | CItemListConsole |
CListParserConsole() | CListParserConsole |
cvs_err(char *txt, long len) | CItemListConsole | [virtual]
cvs_out(char *txt, long len) | CItemListConsole | [virtual]
GetCvsErr() | CItemListConsole |
GetItemList() const | CItemListConsole |
GetLaunchRes() const | CItemListConsole |
m_cvsErr | CItemListConsole | [protected]
m_cvsOut | CItemListConsole | [protected]
m_itemList | CItemListConsole | [protected]
m_launchRes | CItemListConsole | [protected]
Parse(int launchRes) | CListParserConsole | [virtual]
~CItemListConsole() | CItemListConsole | [virtual]
~CListParserConsole() | CListParserConsole | [virtual]
Generated on Fri Jan 31 12:17:40 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ItemDisplayInfo Member List

This is the complete list of members for ItemDisplayInfo, including all inherited members.
Create(const string &item, const ItemRowInfo &rowInfo) | ItemDisplayInfo |
GetDescription() const | ItemDisplayInfo |
GetDescriptionEx() const | ItemDisplayInfo |
GetItem() const | ItemDisplayInfo |
GetRowInfo() const | ItemDisplayInfo |
m_description | ItemDisplayInfo | [private]
m_descriptionEx | ItemDisplayInfo | [private]
m_item | ItemDisplayInfo | [private]
m_rowInfo | ItemDisplayInfo | [private]
Generated on Fri Jan 31 12:16:43 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CItemListDlg Member List

This is the complete list of members for CItemListDlg, including all inherited members.
CheckSettings() | CItemListDlg | [private]
CItemListDlg(const MultiFiles *mf, const char *item, kItemListDlg type, ItemList &itemList, const ListPath *listPath, bool forceCvsroot, const char *rev, const char *date, CWnd *pParent=NULL) | CItemListDlg |
CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam) | CItemListDlg | [private, static]
DeleteAllItems() | CItemListDlg | [private]
DisplayItems(const ItemList &itemList, const int launchRes, stringstream *cvsErr=NULL, const bool showUpDir=true) | CItemListDlg | [private]
DoDataExchange(CDataExchange *pDX) | CItemListDlg | [protected, virtual]
EnableControls(BOOL enable) | CItemListDlg | [private]
EnableDateRev() | CItemListDlg | [private]
GetImageForItem(kItemListDlg type, bool option, const ItemDisplayInfo *displayInfo) | CItemListDlg | [private]
IDD enum value | CItemListDlg |
InitListCtrl(const kDisplayType displayType) | CItemListDlg | [private]
InitOptionCtrls() | CItemListDlg | [private]
kItemImgBlank enum value | CItemListDlg | [private]
kItemImgBranch enum value | CItemListDlg | [private]
kItemImgBranchAndRevision enum value | CItemListDlg | [private]
kItemImgDir enum value | CItemListDlg | [private]
kItemImgFile enum value | CItemListDlg | [private]
kItemImgModule enum value | CItemListDlg | [private]
kItemImgRevision enum value | CItemListDlg | [private]
kItemImgUpDir enum value | CItemListDlg | [private]
m_autoRefreshCombo | CItemListDlg |
m_browseReadFromButton | CItemListDlg |
m_browseTagButton | CItemListDlg |
m_cancelButton | CItemListDlg |
m_cvsStopped | CItemListDlg | [private]
m_date | CItemListDlg |
m_dateCombo | CItemListDlg |
m_forceCvsroot | CItemListDlg |
m_forceCvsrootCheck | CItemListDlg |
m_hasDate | CItemListDlg |
m_hasDateCheck | CItemListDlg |
m_hasRev | CItemListDlg |
m_hasRevCheck | CItemListDlg |
m_headerCtrl | CItemListDlg | [private]
m_item | CItemListDlg |
m_itemEdit | CItemListDlg |
m_itemLabelStatic | CItemListDlg |
m_itemList | CItemListDlg | [private]
m_itemListCtrl | CItemListDlg |
m_itemsImageList | CItemListDlg | [private]
m_listPath | CItemListDlg |
m_mf | CItemListDlg | [private]
m_okButton | CItemListDlg |
m_option | CItemListDlg |
m_optionCheck | CItemListDlg |
m_readFrom | CItemListDlg |
m_readFromCombo | CItemListDlg |
m_refreshButton | CItemListDlg |
m_rev | CItemListDlg |
m_revCombo | CItemListDlg |
m_selectionButton | CItemListDlg |
m_sortAsc | CItemListDlg | [private]
m_sortColumn | CItemListDlg | [private]
m_type | CItemListDlg | [private]
OnBrowseReadfrom() | CItemListDlg | [protected]
OnBrowseTag() | CItemListDlg | [protected]
OnCancel() | CItemListDlg | [protected, virtual]
OnCheckdate() | CItemListDlg | [protected]
OnCheckrev() | CItemListDlg | [protected]
OnColumnclickItemlist(NMHDR *pNMHDR, LRESULT *pResult) | CItemListDlg | [protected]
OnDblclkItemlist(NMHDR *pNMHDR, LRESULT *pResult) | CItemListDlg | [protected]
OnDestroy() | CItemListDlg | [protected]
OnForceroot() | CItemListDlg | [protected]
OnInitDialog() | CItemListDlg | [protected, virtual]
OnItemchangedItemlist(NMHDR *pNMHDR, LRESULT *pResult) | CItemListDlg | [protected]
OnOK() | CItemListDlg | [protected, virtual]
OnOption() | CItemListDlg | [protected]
OnRefresh() | CItemListDlg | [protected]
OnSelchangeAutoRefresh() | CItemListDlg | [protected]
OnSelection() | CItemListDlg | [protected]
PostClickRefresh() | CItemListDlg | [private]
PreTranslateMessage(MSG *pMsg) | CItemListDlg | [virtual]
SelectItem(const char *item) | CItemListDlg | [private]
SortItems(int column, bool asc, kItemListDlg type, bool option) | CItemListDlg | [private]
Generated on Fri Jan 31 12:16:47 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CItemListDlg::CompareInfo Member List

This is the complete list of members for CItemListDlg::CompareInfo, including all inherited members.
m_asc | CItemListDlg::CompareInfo
m_column | CItemListDlg::CompareInfo
m_option | CItemListDlg::CompareInfo
m_type | CItemListDlg::CompareInfo
Generated on Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

keywordMode Member List

This is the complete list of members for keywordMode, including all inherited members.
desc | keywordMode
mode | keywordMode
Generated on Fri Jan 31 12:16:51 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CKeywordComboBox Member List

This is the complete list of members for CKeywordComboBox, including all inherited members.
AutoDropWidth enum value | USmartCombo |
CKeywordComboBox() | CKeywordComboBox |
CSmartComboBox(int feature=USmartCombo::DefaultFeature) | CSmartComboBox |
DefaultFeature enum value | USmartCombo |
Feature enum name | USmartCombo |
GetItems() | USmartCombo |
HasFeature(int feature) const | USmartCombo |
m_hDesc | CKeywordComboBox | [private]
None enum value | USmartCombo |
OnDropdown() | CSmartComboBox | [protected]
OnSelchange() | CKeywordComboBox | [protected]
OnSetFeature(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
OnSetItems(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
OnSetReadOnly(WPARAM wParam, LPARAM lParam) | CSmartComboBox | [protected]
PreSubclassWindow() | CKeywordComboBox | [protected, virtual]
PreTranslateMessage(MSG *pMsg) | CSmartComboBox | [virtual]
ReadOnly enum value | USmartCombo |
RemoveItem(const char *strItem) | USmartCombo | [virtual]
RemoveItems enum value | USmartCombo |
SetDescription() | CKeywordComboBox | [private]
SetDescriptionWnd(HWND hDesc) | CKeywordComboBox |
SetFeature(int feature) | USmartCombo |
SetItems(CMString *pstrItems) | USmartCombo |
SetReadOnly(bool readOnly=true) | CSmartComboBox | [virtual]
USmartCombo(int feature) | USmartCombo |
~CKeywordComboBox() | CKeywordComboBox | [virtual]
~CSmartComboBox() | CSmartComboBox | [virtual]
~USmartCombo() | USmartCombo | [virtual]
Generated on Fri Jan 31 12:16:51 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCmdLine_MAIN Member List

This is the complete list of members for CCmdLine_MAIN, including all inherited members.
CCmdLine_MAIN(const MultiFiles *mf, const char *lastcmd, bool hasPath, const char *lastpath, bool addDefault, bool addSelection, bool forceRoot) | CCmdLine_MAIN |
DoDataExchange(CDataExchange *pDX) | CCmdLine_MAIN | [protected, virtual]
IDD enum value | CCmdLine_MAIN |
m_addDefault | CCmdLine_MAIN |
m_addSelection | CCmdLine_MAIN |
m_addSelectionCheck | CCmdLine_MAIN |
m_checkPath | CCmdLine_MAIN |
m_checkPathCheck | CCmdLine_MAIN |
m_cmdLine | CCmdLine_MAIN |
m_cmdLineEdit | CCmdLine_MAIN |
m_firstTimeCmdline | CCmdLine_MAIN | [private]
m_folderLoc | CCmdLine_MAIN |
m_folderLocCombo | CCmdLine_MAIN |
m_forceRoot | CCmdLine_MAIN |
m_hasSelection | CCmdLine_MAIN | [private]
m_mf | CCmdLine_MAIN | [private]
m_prevCmdCombo | CCmdLine_MAIN |
m_selFolderButton | CCmdLine_MAIN |
OnAddSelection() | CCmdLine_MAIN | [protected]
OnCheckpath() | CCmdLine_MAIN | [protected]
OnInitDialog() | CCmdLine_MAIN | [protected, virtual]
OnModule() | CCmdLine_MAIN | [protected]
OnSelchangePrevcmd() | CCmdLine_MAIN | [protected]
OnSelfolder() | CCmdLine_MAIN | [protected]
OnSetfocusCmdline() | CCmdLine_MAIN | [protected]
OnTag() | CCmdLine_MAIN | [protected]
PreTranslateMessage(MSG *pMsg) | CCmdLine_MAIN | [virtual]
~CCmdLine_MAIN() | CCmdLine_MAIN |
Generated on Fri Jan 31 12:15:05 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CLogMain Member List

This is the complete list of members for CLogMain, including all inherited members.
CLogMain(bool supress) | CLogMain |
DoDataExchange(CDataExchange *pDX) | CLogMain | [protected, virtual]
IDD enum value | CLogMain |
m_defBranch | CLogMain |
m_headerDesc | CLogMain |
m_headerDescCheck | CLogMain |
m_headerOnly | CLogMain |
m_headerOnlyCheck | CLogMain |
m_noRecurs | CLogMain |
m_noTags | CLogMain |
m_onlyRCS | CLogMain |
m_supress | CLogMain |
OnHeaders() | CLogMain | [protected]
OnHeadersdesc() | CLogMain | [protected]
~CLogMain() | CLogMain |
Generated on Fri Jan 31 12:17:46 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CLogFilters Member List

This is the complete list of members for CLogFilters, including all inherited members.
CLogFilters(const MultiFiles *mf, const char *sLastDate, const char *sLastRev, const char *sLastUsers, const char *sLastStates) | CLogFilters |
DoDataExchange(CDataExchange *pDX) | CLogFilters | [protected, virtual]
IDD enum value | CLogFilters |
m_browseTagButton | CLogFilters |
m_date | CLogFilters |
m_dateCombo | CLogFilters |
m_hasDate | CLogFilters |
m_hasDateCheck | CLogFilters |
m_hasRev | CLogFilters |
m_hasRevCheck | CLogFilters |
m_hasState | CLogFilters |
m_hasStateCheck | CLogFilters |
m_hasUser | CLogFilters |
m_hasUserCheck | CLogFilters |
m_mf | CLogFilters | [private]
m_rev | CLogFilters |
m_revCombo | CLogFilters |
m_state | CLogFilters |
m_stateCombo | CLogFilters |
m_user | CLogFilters |
m_userCombo | CLogFilters |
OnBrowseTag() | CLogFilters | [protected]
OnDate() | CLogFilters | [protected]
OnRev() | CLogFilters | [protected]
OnState() | CLogFilters | [protected]
OnUser() | CLogFilters | [protected]
~CLogFilters() | CLogFilters |
Generated on Fri Jan 31 12:17:43 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CLogin_MAIN Member List

This is the complete list of members for CLogin_MAIN, including all inherited members.
CLogin_MAIN(bool forceRoot) | CLogin_MAIN |
DoDataExchange(CDataExchange *pDX) | CLogin_MAIN | [protected, virtual]
IDD enum value | CLogin_MAIN |
m_forceRoot | CLogin_MAIN |
m_helpLogin | CLogin_MAIN |
~CLogin_MAIN() | CLogin_MAIN |
Generated on Fri Jan 31 12:17:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:54 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

MACBINMAPENTRIES Member List

This is the complete list of members for MACBINMAPENTRIES, including all inherited members.
maps | MACBINMAPENTRIES
numMaps | MACBINMAPENTRIES
Generated on Fri Jan 31 12:17:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:55 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:57 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

match_dir Member List

This is the complete list of members for match_dir, including all inherited members.
dirPath | match_dir |
match_dir(const UStr &inDirPath) | match_dir | [inline]
operator()(const MultiFilesEntry &inEntry) const | match_dir | [inline]
Generated on Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

FileEntry Member List

This is the complete list of members for FileEntry, including all inherited members.
currRev | FileEntry | [protected]
file | FileEntry | [protected]
FileEntry() | FileEntry |
FileEntry(const char *filename, const FSSpec *macspec=0L, const char *currRevision=0L) | FileEntry |
FileEntry(const FileEntry &entry) | FileEntry |
MultiFiles class | FileEntry | [friend]
MultiFilesEntry class | FileEntry | [friend]
operator=(const FileEntry &entry) | FileEntry |
spec | FileEntry | [protected]
Generated on Fri Jan 31 12:16:00 2003 for WinCvs Source by doxygen 1.3-rc2


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, const char *currRevision=0L) | MultiFilesEntry |
add(CvsArgs &args) const | MultiFilesEntry |
dir | MultiFilesEntry | [protected]
files | MultiFilesEntry | [protected]
get(int index, UStr &path, UStr &fileName, UStr &currRev) const | MultiFilesEntry |
getdir() const | MultiFilesEntry | [inline]
MultiFiles class | MultiFilesEntry | [friend]
MultiFilesEntry() | MultiFilesEntry |
MultiFilesEntry(const char *path) | MultiFilesEntry |
MultiFilesEntry(const MultiFilesEntry &entries) | MultiFilesEntry |
NumFiles(void) const | MultiFilesEntry | [inline]
operator=(const MultiFilesEntry &entries) | MultiFilesEntry |
setdir(const char *newdir) | MultiFilesEntry |
Generated on Fri Jan 31 12:18:15 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

MultiFiles Member List

This is the complete list of members for MultiFiles, including all inherited members.
begin() const | MultiFiles | [inline]
const_iterator typedef | MultiFiles |
dirs | MultiFiles | [protected]
end() const | MultiFiles | [inline]
getdir(int index, UStr &path) const | MultiFiles |
MultiFiles() | MultiFiles |
newdir(const char *dir) | MultiFiles |
newfile(const char *file, const FSSpec *spec=0L, const char *currRevision=0L) | MultiFiles |
Normalize() | MultiFiles |
NumDirs(void) const | MultiFiles | [inline]
reset() | MultiFiles |
TotalNumFiles(void) const | MultiFiles |
Generated on Fri Jan 31 12:18:15 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

MultiFilesEntryIndex Member List

This is the complete list of members for MultiFilesEntryIndex, including all inherited members.
GetIndex() const | MultiFilesEntryIndex | [inline]
GetIterator() const | MultiFilesEntryIndex | [inline]
m_index | MultiFilesEntryIndex | [private]
m_mfi | MultiFilesEntryIndex | [private]
MultiFilesEntryIndex(int index, MultiFiles::const_iterator mfi) | MultiFilesEntryIndex | [inline]
Generated on Fri Jan 31 12:18:16 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TMPersistent< T > Member List

This is the complete list of members for TMPersistent< T >, 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< T > | [protected]
fBuf | TMPersistent< T > | [mutable, protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMPersistent< T > | [inline, virtual]
GetList(void) const | TMPersistent< T > | [inline]
GetList(void) | TMPersistent< T > | [inline]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMPersistent< T > |
LoadAll(const char *only=0L) | 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< T > | [inline, virtual]
SizeOf(void) const | TMPersistent< T > | [inline, virtual]
TMPersistent(const char *uniqueName, kClassPersistent pclass=kNoClass) | TMPersistent< T > | [inline]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~TMPersistent() | TMPersistent< T > | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Fri Jan 31 12:20:19 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TMString< T > Member List

This is the complete list of members for TMString< T >, including all inherited members.
_GetBaseClass() | CPersistent | [protected, static]
begin() const | TMString< T > | [inline]
classCPersistent | CPersistent | [protected, static]
classUObject | UObject | [protected, static]
Compare(const char *s1, const char *s2) const | TMString< T > | [inline, protected, virtual]
CPersistent(const char *uniqueName, kClassPersistent pclass) | CPersistent |
CreateObject(const char *className) | UObject | [static]
end() const | TMString< T > | [inline]
fAllEntries | CPersistent | [protected, static]
fAllStrs | TMString< T > | [protected]
fBuf | TMString< T > | [mutable, protected]
Find(const char *instr) const | TMString< T > |
CPersistent::Find(const char *uniqueName) | CPersistent | [static]
fMaxStr | TMString< T > | [protected]
fTimeStamp | CPersistent | [protected]
GetData(void) const | TMString< T > | [virtual]
GetList(void) const | TMString< T > | [inline]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
Insert(const char *newstr) | TMString< T > |
IsKindOf(const URuntimeClass *pClass) const | UObject |
list_t typedef | TMString< T > |
LoadAll(const char *only=0L) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
Remove(const char *newstr) | TMString< T > |
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< T > | [virtual]
SizeOf(void) const | TMString< T > | [virtual]
TMString(unsigned int maxstr, const char *uniqueName, char *const *defaultStr=0L, kClassPersistent pclass=kNoClass) | TMString< T > |
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~TMString() | TMString< T > | [virtual]
~UObject() | UObject | [inline, virtual]
Generated on Fri Jan 31 12:20:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 > | [mutable, 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(const char *only=0L) | 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 Fri Jan 31 12:18:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 > | [mutable, 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(const char *only=0L) | 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 Fri Jan 31 12:18:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 > | [mutable, 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(const char *only=0L) | 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 Fri Jan 31 12:16:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
GetOptionCheckRect(LPRECT lpRect) | COptionalPropertySheet | [protected]
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 Fri Jan 31 12:18:22 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:19:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:03 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | 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 Fri Jan 31 12:18:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:29 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CPersistentT< T > Member List

This is the complete list of members for CPersistentT< T >, 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< T > | [inline]
CreateObject(const char *className) | UObject | [static]
fAllEntries | CPersistent | [protected, static]
fDefValue | CPersistentT< T > | [protected]
Find(const char *uniqueName) | CPersistent | [static]
fTimeStamp | CPersistent | [protected]
fValue | CPersistentT< T > | [protected]
GetData(void) const | CPersistentT< T > | [inline, virtual]
GetRuntimeClass() const | CPersistent | [virtual]
GetTimeStamp() const | CPersistent | [inline]
IsKindOf(const URuntimeClass *pClass) const | UObject |
LoadAll(const char *only=0L) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const T &() const | CPersistentT< T > | [inline]
operator=(const T &val) | CPersistentT< T > | [inline]
operator==(const T &val) const | CPersistentT< T > | [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< T > | [inline, virtual]
SizeOf(void) const | CPersistentT< T > | [inline, virtual]
TouchTimeStamp() | CPersistent | [inline]
UObject() | UObject | [inline, protected]
~CPersistent() | CPersistent | [virtual]
~CPersistentT() | CPersistentT< T > | [inline, virtual]
~UObject() | UObject | [inline, virtual]
Generated on Fri Jan 31 12:18:33 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const bool &() const | CPersistentBool | [inline]
operator const T &() const | CPersistentT< bool > | [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 Fri Jan 31 12:18:30 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | CPersistent | [static]
NeedSave(bool onlySettings=false) | CPersistent | [static]
operator const int &() const | CPersistentInt | [inline]
operator const T &() const | CPersistentT< int > | [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 Fri Jan 31 12:18:32 2003 for WinCvs Source by doxygen 1.3-rc2


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, kProgressType progressType=kProgressBar) | CProgress |
ForceAbort(void) | CProgress | [private]
HasAborted(void) const | CProgress | [inline]
m_abort | CProgress | [private]
m_dlg | CProgress | [private]
SetProgress(int percent) | CProgress |
SetProgress(const char *text) | CProgress |
~CProgress() | CProgress | [virtual]
Generated on Fri Jan 31 12:18:38 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CProgressDlg Member List

This is the complete list of members for CProgressDlg, including all inherited members.
CProgressDlg(bool &abort, bool interruptable, const char *title=NULL, kProgressType progressType=kProgressBar, CWnd *pParent=NULL) | CProgressDlg |
Create() | CProgressDlg |
DoDataExchange(CDataExchange *pDX) | CProgressDlg | [protected, virtual]
FlushDisplay(const CDialog *dlg, const bool &abort) | CProgressDlg | [private, static]
IDD enum value | CProgressDlg |
m_abort | CProgressDlg | [private]
m_cancelButton | CProgressDlg |
m_hWndParent | CProgressDlg | [private]
m_interruptable | CProgressDlg | [private]
m_pParent | CProgressDlg | [private]
m_progressCtrl | CProgressDlg |
m_progressTextStatic | CProgressDlg |
m_progressType | CProgressDlg | [private]
m_title | CProgressDlg | [private]
OnInitDialog() | CProgressDlg | [protected, virtual]
OnOK() | CProgressDlg | [protected, virtual]
PostNcDestroy() | CProgressDlg | [protected, virtual]
SetProgress(int percent) | CProgressDlg |
SetProgress(const char *text) | CProgressDlg |
Generated on Fri Jan 31 12:18:40 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:03 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

PyAutoObject< T > Member List

This is the complete list of members for PyAutoObject< T >, including all inherited members.
CopyReturn(void) | PyAutoObject< T > | [inline]
IsValid(void) | PyAutoObject< T > | [inline]
m_o | PyAutoObject< T > | [protected]
operator T *() const | PyAutoObject< T > | [inline]
operator->(void) | PyAutoObject< T > | [inline]
operator=(T *o) | PyAutoObject< T > | [inline]
operator=(PyObject *o) | PyAutoObject< T > | [inline]
operator=(PyAutoObject &obj) | PyAutoObject< T > | [inline]
PyAutoObject() | PyAutoObject< T > | [inline]
PyAutoObject(T *o) | PyAutoObject< T > | [inline]
PyAutoObject(PyObject *o) | PyAutoObject< T > | [inline]
PyAutoObject(PyAutoObject &obj) | PyAutoObject< T > | [inline]
Ref(void) | PyAutoObject< T > | [inline, protected]
UnRef(void) | PyAutoObject< T > | [inline, protected]
~PyAutoObject() | PyAutoObject< T > | [inline]
Generated on Fri Jan 31 12:18:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:14 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CRelease_MAIN Member List

This is the complete list of members for CRelease_MAIN, including all inherited members.
CRelease_MAIN(const char *dir) | CRelease_MAIN |
DoDataExchange(CDataExchange *pDX) | CRelease_MAIN | [protected, virtual]
GetRemoveDirectoryOption() const | CRelease_MAIN |
IDD enum value | CRelease_MAIN |
m_delAllCheck | CRelease_MAIN |
m_delCvsInfoCheck | CRelease_MAIN |
m_delDirCheck | CRelease_MAIN |
m_dir | CRelease_MAIN |
m_removeDirectoryOption | CRelease_MAIN | [private]
OnDelall() | CRelease_MAIN | [protected]
OnDelcvsinfo() | CRelease_MAIN | [protected]
OnDeldir() | CRelease_MAIN | [protected]
~CRelease_MAIN() | CRelease_MAIN |
Generated on Fri Jan 31 12:19:21 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CRtag_MAIN Member List

This is the complete list of members for CRtag_MAIN, including all inherited members.
CRtag_MAIN(const MultiFiles *mf, kRtagDlgType type, const char *sLastModule, const char *sLastTag, bool noRecurs, bool lookAttic, bool overwriteExist=false) | CRtag_MAIN |
DoDataExchange(CDataExchange *pDX) | CRtag_MAIN | [protected, virtual]
IDD enum value | CRtag_MAIN |
m_grpBox | CRtag_MAIN |
m_lookAttic | CRtag_MAIN |
m_mf | CRtag_MAIN | [private]
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]
OnBrowseModules() | CRtag_MAIN | [protected]
OnBrowseTag() | CRtag_MAIN | [protected]
OnInitDialog() | CRtag_MAIN | [protected, virtual]
~CRtag_MAIN() | CRtag_MAIN |
Generated on Fri Jan 31 12:19:28 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CRtag_OPTIONS Member List

This is the complete list of members for CRtag_OPTIONS, including all inherited members.
CRtag_OPTIONS(const MultiFiles *mf, 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_mf | CRtag_OPTIONS | [private]
m_rev | CRtag_OPTIONS |
m_revCombo | CRtag_OPTIONS |
m_type | CRtag_OPTIONS | [private]
m_useMostRecent | CRtag_OPTIONS |
OnBrowseTag() | CRtag_OPTIONS | [protected]
OnDate() | CRtag_OPTIONS | [protected]
OnInitDialog() | CRtag_OPTIONS | [protected, virtual]
OnRev() | CRtag_OPTIONS | [protected]
~CRtag_OPTIONS() | CRtag_OPTIONS |
Generated on Fri Jan 31 12:19:30 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

SelectionDisplayInfo Member List

This is the complete list of members for SelectionDisplayInfo, including all inherited members.
Create(const string &fileName, const string &revision, const string &path) | SelectionDisplayInfo |
GetFileName() const | SelectionDisplayInfo |
GetPath() const | SelectionDisplayInfo |
GetRevision() const | SelectionDisplayInfo |
m_fileName | SelectionDisplayInfo | [private]
m_path | SelectionDisplayInfo | [private]
m_revision | SelectionDisplayInfo | [private]
Generated on Fri Jan 31 12:19:37 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CSelectionDetailsDlg Member List

This is the complete list of members for CSelectionDetailsDlg, including all inherited members.
CompareItems(LPARAM itemData1, LPARAM itemData2, LPARAM lParam) | CSelectionDetailsDlg | [private, static]
CSelectionDetailsDlg(const MultiFiles *mf, const kSelDetType selDetType, const char *selection, CWnd *pParent=NULL) | CSelectionDetailsDlg |
DeleteAllItems() | CSelectionDetailsDlg | [private]
DisplaySelection() | CSelectionDetailsDlg | [private]
DoDataExchange(CDataExchange *pDX) | CSelectionDetailsDlg | [protected, virtual]
EnableControls() | CSelectionDetailsDlg | [private]
IDD enum value | CSelectionDetailsDlg |
m_fileNameCheck | CSelectionDetailsDlg |
m_headerCtrl | CSelectionDetailsDlg | [private]
m_mf | CSelectionDetailsDlg | [private]
m_pathCheck | CSelectionDetailsDlg |
m_revisionCheck | CSelectionDetailsDlg |
m_revisionSpinCtrl | CSelectionDetailsDlg |
m_selDetType | CSelectionDetailsDlg |
m_selection | CSelectionDetailsDlg |
m_selectionEdit | CSelectionDetailsDlg |
m_selectionListCtrl | CSelectionDetailsDlg |
m_sortAsc | CSelectionDetailsDlg | [private]
m_sortColumn | CSelectionDetailsDlg | [private]
OnColumnclickSelectionlist(NMHDR *pNMHDR, LRESULT *pResult) | CSelectionDetailsDlg | [protected]
OnDblclkSelectionlist(NMHDR *pNMHDR, LRESULT *pResult) | CSelectionDetailsDlg | [protected]
OnDeltaposRevisionSpin(NMHDR *pNMHDR, LRESULT *pResult) | CSelectionDetailsDlg | [protected]
OnDestroy() | CSelectionDetailsDlg | [protected]
OnFilename() | CSelectionDetailsDlg | [protected]
OnInitDialog() | CSelectionDetailsDlg | [protected, virtual]
OnItemchangedSelectionlist(NMHDR *pNMHDR, LRESULT *pResult) | CSelectionDetailsDlg | [protected]
OnPath() | CSelectionDetailsDlg | [protected]
OnRevision() | CSelectionDetailsDlg | [protected]
SortItems(int column, bool asc) | CSelectionDetailsDlg | [private]
UpdateSelect(int item) | CSelectionDetailsDlg | [private]
Generated on Fri Jan 31 12:19:36 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CSelectionDetailsDlg::CompareInfo Member List

This is the complete list of members for CSelectionDetailsDlg::CompareInfo, including all inherited members.
m_asc | CSelectionDetailsDlg::CompareInfo
m_column | CSelectionDetailsDlg::CompareInfo
Generated on Fri Jan 31 12:19:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:43 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CSortList< T > Member List

This is the complete list of members for CSortList< T >, including all inherited members.
CSortList(int def_size, QsortMethod method_sort) | CSortList< T > | [inline]
Delete(const T &entry) | CSortList< T > | [inline]
Entry(int num_elem) const | CSortList< T > | [inline, private]
fDef | CSortList< T > | [private]
fElems | CSortList< T > | [private]
fMax | CSortList< T > | [private]
fMethod | CSortList< T > | [private]
fNewOne | CSortList< T > | [private]
fNum | CSortList< T > | [private]
Get(int index) const | CSortList< T > | [inline]
Insert(const T &entry, bool replaceIfAlreadyExists=false) | CSortList< T > | [inline]
Inside(const T &entry, int *indexptr=0L) const | CSortList< T > | [inline]
InsideAndInsert(const T &entry, int *indexptr=0L, bool replaceIfAlreadyExists=false) | CSortList< T > | [inline]
Location(const T &entry) | CSortList< T > | [inline, private]
NumOfElements(void) | CSortList< T > | [inline]
QsortMethod typedef | CSortList< T > |
Reset(void) | CSortList< T > | [inline]
Result(int *num_elem) | CSortList< T > | [inline]
~CSortList() | CSortList< T > | [inline]
Generated on Fri Jan 31 12:19:45 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CStatus_MAIN Member List

This is the complete list of members for CStatus_MAIN, including all inherited members.
CStatus_MAIN(bool noRecurs, STATUSOUTPUT_TYPE outputType) | CStatus_MAIN |
DoDataExchange(CDataExchange *pDX) | CStatus_MAIN | [protected, virtual]
IDD enum value | CStatus_MAIN |
m_noRecurs | CStatus_MAIN |
m_outputType | CStatus_MAIN |
~CStatus_MAIN() | CStatus_MAIN |
Generated on Fri Jan 31 12:19:49 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CTag_MAIN Member List

This is the complete list of members for CTag_MAIN, including all inherited members.
CTag_MAIN(const MultiFiles *mf, kTagDlgType type, const char *sLastTag, bool noRecurs, bool checkUnmod=false, bool overwriteExisting=false) | 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_mf | CTag_MAIN | [private]
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]
OnBrowseTag() | CTag_MAIN | [protected]
OnInitDialog() | CTag_MAIN | [protected, virtual]
~CTag_MAIN() | CTag_MAIN |
Generated on Fri Jan 31 12:19:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:06 2003 for WinCvs Source by doxygen 1.3-rc2


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]
gCvsProcess | UCvsApp | [protected, 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]
GetCvsProcess(void) | UCvsApp | [inline]
GetFilesView(void) | UCvsApp |
GetFilterModel() const | UCvsApp |
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetIgnoreModel() const | UCvsApp |
GetMainFrame(void) | UCvsApp | [inline]
GetMessageMap() const | UCvsApp | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRecursionModel() const | UCvsApp |
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_mainFrame | UCvsApp | [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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
PeekPumpAndIdle(bool) | UCvsApp |
RemoveTimer(int cmd) | UWidget |
rtUCmdTarget(void) | UCmdTarget | [static]
rtUCvsApp(void) | UCvsApp | [static]
rtUObject() | UObject | [static]
rtUWidget(void) | UWidget | [static]
SayWelcome(void) | UCvsApp |
SetCvsProcess(CvsProcess *proc) | UCvsApp | [inline]
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 Fri Jan 31 12:15:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:08 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:15:23 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

KoTraversalContext Member List

This is the complete list of members for KoTraversalContext, including all inherited members.
GetView() const | KoTraversalContext |
IsMatch(EntnodeData *data) const | KoTraversalContext | [inline]
IsMatch(EntnodeData *data) const | KoTraversalContext |
IsRecursive() const | KoTraversalContext | [inline]
IsRecursive() const | KoTraversalContext |
IsShowIgnored() const | KoTraversalContext | [inline]
IsShowIgnored() const | KoTraversalContext |
KoTraversalContext(UCvsFiles *view) | KoTraversalContext | [inline]
KoTraversalContext(CBrowseFileView *view) | KoTraversalContext |
m_filter | KoTraversalContext | [private]
m_filter | KoTraversalContext | [private]
m_isRecursive | KoTraversalContext | [private]
m_isShowIgnored | KoTraversalContext | [private]
m_view | KoTraversalContext |
m_view | KoTraversalContext | [private]
Generated on Fri Jan 31 12:17:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [virtual]
ExitDirectory(const char *fullpath) | TViewFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TViewFill | [virtual]
GetListCtrl() const | TViewFill | [inline]
GetListCtrl() const | TViewFill |
GetView() const | TViewFill | [inline]
GetView() const | TViewFill |
gRunning | TraversalReport | [static]
InitItem(EntnodeData *data, void *iImage, const char *tag=0L) | TViewFill | [inline]
InitItem(EntnodeData *data, int iImage, const char *tag=0L) | TViewFill |
IsRecursive() const | TViewFill | [inline]
IsRecursive() const | TViewFill |
IsShowIgnored() const | TViewFill | [inline]
IsShowIgnored() const | TViewFill |
m_context | TViewFill |
m_context | TViewFill | [private]
m_entries | TViewFill |
m_entries | TViewFill | [private]
m_ignlist | TViewFill |
m_ignlist | TViewFill | [private]
m_isShowIgnored | 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 stat &dir, const FSSpec *macspec) | TViewFill | [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 stat &dir, const FSSpec *macspec) | TViewFill | [virtual]
OnError(const char *err, int errcode) | TViewFill | [inline, virtual]
OnError(const char *err, int errcode) | TViewFill | [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 stat &dir, const FSSpec *macspec) | TViewFill | [virtual]
OnIdle(const char *fullpath) | TViewFill | [inline, virtual]
OnIdle(const char *fullpath) | TViewFill | [virtual]
TViewFill(const KoTraversalContext *context) | TViewFill | [inline]
TViewFill(const KoTraversalContext *context, CSortList< ENTNODE > &entries) | TViewFill | [inline]
TViewFill(const KoTraversalContext *context) | TViewFill |
~TViewFill() | TViewFill | [inline, virtual]
Generated on Fri Jan 31 12:20:42 2003 for WinCvs Source by doxygen 1.3-rc2


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(bool needSelection) | UCvsFiles | [protected]
DisableGeneric(void) | 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]
GetColumnModel() const | UCvsFiles | [inline]
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]
GetPath() const | UCvsFiles | [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]
HideColumns(void) | UCvsFiles | [protected]
IsKindOf(const URuntimeClass *pClass) const | UObject |
IsSortAscendant(void) | UCvsFiles | [inline]
IsUIValid() | UWidget | [static]
kUDispatchHandled enum value | UCmdTarget |
kUNoDispatchInfo enum value | UCmdTarget |
LoadColumns(void) | UCvsFiles | [protected]
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_isRecursive | UCvsFiles | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_modelColumns | UCvsFiles | [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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnCmdUIViewRecursive(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]
OnFilteringChanged() | UCvsFiles |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | UWidget | [protected]
OnMacroSel(int cmd) | UCvsFiles | [protected]
OnPageChanged(int cmd, int pagenum) | UWidget | [protected]
OnPopup(void) | UCvsFiles | [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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OnViewRecursive(void) | UCvsFiles | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
ProcessSelectionCommand(KiSelectionHandler &handler) | UCvsFiles | [protected]
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]
SaveColumns(void) | UCvsFiles | [protected]
Search(const char *title) | UCvsFiles | [protected]
SetRecursive(bool isRecursive) | UCvsFiles | [protected]
sFocusCmdID | UWidget | [protected, static]
sFocusWidID | UWidget | [protected, static]
ShowColumns(void) | UCvsFiles | [protected]
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 Fri Jan 31 12:15:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [private, virtual]
ExitDirectory(const char *fullpath) | TBrowserFillDummy | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFillDummy | [private, virtual]
GetItem() const | TBrowserFillDummy | [inline]
gRunning | TraversalReport | [static]
m_data | TBrowserFillDummy |
m_data | TBrowserFillDummy | [private]
m_dirname | TBrowserFillDummy |
m_empty | TBrowserFillDummy |
m_hascvs | TBrowserFillDummy |
m_item | TBrowserFillDummy |
m_item | TBrowserFillDummy | [private]
m_root | TBrowserFillDummy |
m_root | TBrowserFillDummy | [private]
m_treeCtrl | TBrowserFillDummy |
m_treeCtrl | TBrowserFillDummy | [private]
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 stat &dir, const FSSpec *macspec) | TBrowserFillDummy | [private, virtual]
OnError(const char *err, int errcode) | TBrowserFillDummy | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFillDummy | [private, 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 | [private, virtual]
TBrowserFillDummy(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, EntnodeData *data) | TBrowserFillDummy | [inline]
TBrowserFillDummy(CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, EntnodeData *data) | TBrowserFillDummy |
~TBrowserFillDummy() | TBrowserFillDummy | [inline, virtual]
Generated on Fri Jan 31 12:20:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [private, virtual]
ExitDirectory(const char *fullpath) | TBrowserFill | [inline, virtual]
ExitDirectory(const char *fullpath) | TBrowserFill | [private, virtual]
gRunning | TraversalReport | [static]
m_entries | TBrowserFill |
m_entries | TBrowserFill | [private]
m_hascvs | TBrowserFill | [private]
m_ignlist | TBrowserFill |
m_ignlist | TBrowserFill | [private]
m_isShowIgnored | TBrowserFill |
m_item | TBrowserFill |
m_item | TBrowserFill | [private]
m_root | TBrowserFill |
m_root | TBrowserFill | [private]
m_treeCtrl | TBrowserFill |
m_treeCtrl | TBrowserFill | [private]
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 stat &dir, const FSSpec *macspec) | TBrowserFill | [private, virtual]
OnError(const char *err, int errcode) | TBrowserFill | [inline, virtual]
OnError(const char *err, int errcode) | TBrowserFill | [private, 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 | [private, virtual]
TBrowserFill(UCvsFolders *treeCtrl, UTREEITEM root, UTREEITEM item, CSortList< ENTNODE > &entries) | TBrowserFill | [inline]
TBrowserFill(CTreeCtrl &treeCtrl, HTREEITEM root, HTREEITEM item, CSortList< ENTNODE > &entries) | TBrowserFill |
~TBrowserFill() | TBrowserFill | [inline, virtual]
Generated on Fri Jan 31 12:20:03 2003 for WinCvs Source by doxygen 1.3-rc2


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(void) | UCvsFolders |
DeleteAllItems(UTREEITEM root) | 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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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 |
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]
OnCmdUIViewRecursive(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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateGeneric(UCmdUI *pCmdUI, bool needCvsInfos) | UCvsFolders | [protected]
OnUpdateUI(void) | UWidget | [protected]
OnViewRecursive(void) | UCvsFolders | [protected]
OverideMapWidget(int cmdid, CRuntimeClass *widClass) | UWidget |
ProcessSelectionCommand(KiSelectionHandler &handler) | UCvsFolders | [protected]
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 Fri Jan 31 12:15:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 |
FreshenFileMask(void) | UCvsFrame |
GetBaseMessageMap() | UCvsFrame | [protected, static]
GetCurModal() const | UWidget | [inline]
GetFilterModel(void) | UCvsFrame | [inline]
GetFocus(void) | UWidget | [static]
GetFocusCmd(void) | UWidget | [static]
GetIgnoreModel(void) | UCvsFrame | [inline]
GetMessageMap() const | UCvsFrame | [protected, virtual]
GetOverideList(void) | UWidget | [inline]
GetRecursionModel(void) | UCvsFrame | [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_filter | UCvsFrame | [protected]
m_ignore | UCvsFrame | [protected]
m_listeners | UWidget | [protected]
m_modalRes | UWidget | [protected]
m_noDispatch | UWidget | [protected]
m_overide | UWidget | [protected]
m_recursion | UCvsFrame | [protected]
m_tabs | UWidget | [protected]
m_timers | UWidget | [protected]
m_tooltips | UWidget | [protected]
m_widgets | UWidget | [protected]
messageMap | UCvsFrame | [protected, static]
OnAbout(void) | UCvsFrame | [protected]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnCmdUIFilterMask(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIHideUnknown(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIMacroAdmin(int cmd, UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIQuit(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIStopcvs(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewAdded(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewChanged(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewConflict(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewIgnored(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewMissing(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewModified(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewRecursive(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewRemoved(UCmdUI *pCmdUI) | UCvsFrame | [protected]
OnCmdUIViewUnknown(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]
OnFilterMaskEntered(void) | UCvsFrame |
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]
OnHideUnknown(void) | UCvsFrame | [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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
OnUpdateFocus(int leave, void *widget) | UWidget | [protected]
OnUpdateUI(void) | UWidget | [protected]
OnViewAdded(void) | UCvsFrame | [protected]
OnViewChanged(void) | UCvsFrame | [protected]
OnViewConflict(void) | UCvsFrame | [protected]
OnViewIgnored(void) | UCvsFrame | [protected]
OnViewMissing(void) | UCvsFrame | [protected]
OnViewModified(void) | UCvsFrame | [protected]
OnViewRecursive(void) | UCvsFrame | [protected]
OnViewRemoved(void) | UCvsFrame | [protected]
OnViewUnknown(void) | UCvsFrame | [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 Fri Jan 31 12:15:37 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 &dc, 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 &dc, 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 offset) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
selfB | CWinLogData | [private]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(bool state) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
totB | CWinLogData | [private]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(void) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &dc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
UpdateSelf(CDC &dc, EntnodeData *entryInfo)=0 | CWinLogData | [protected, pure virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
Generated on Fri Jan 31 12:21:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 &dc, 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 &dc, 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 offset) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(bool state) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(void) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &dc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
UpdateSelf(CDC &dc, EntnodeData *entryInfo) | CWinLogHeaderData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogHeaderData() | CWinLogHeaderData | [inline, virtual]
~CWinLogHeaderData() | CWinLogHeaderData | [inline, virtual]
Generated on Fri Jan 31 12:21:29 2003 for WinCvs Source by doxygen 1.3-rc2


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 &dc, 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 &dc, 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 offset) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(bool state) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(void) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &dc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
UpdateSelf(CDC &dc, EntnodeData *entryInfo) | CWinLogRevData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogRevData() | CWinLogRevData | [inline, virtual]
~CWinLogRevData() | CWinLogRevData | [inline, virtual]
Generated on Fri Jan 31 12:21:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 &dc, 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 &dc, 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 offset) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(bool state) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(void) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &dc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
UpdateSelf(CDC &dc, EntnodeData *entryInfo) | CWinLogTagData | [protected, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogTagData() | CWinLogTagData | [inline, virtual]
~CWinLogTagData() | CWinLogTagData | [inline, virtual]
Generated on Fri Jan 31 12:21:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 &dc, 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 &dc, 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 offset) | CWinLogData |
sel | CWinLogData | [protected]
Selected(void) const | CWinLogData | [inline]
Selected(void) const | CWinLogData | [inline]
selfB | CWinLogData | [protected]
SelfBounds(void) | CWinLogData | [inline]
SelfBounds(void) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
SetSelected(bool state) | CWinLogData | [inline]
SetSelected(CScrollView *view, bool state) | CWinLogData |
totB | CWinLogData | [protected]
UnselectAll(CScrollView *view) | CWinLogData |
UnselectAll(void) | CWinLogData |
UnselectAll(CScrollView *view) | CWinLogData |
Update(UDC &hdc, EntnodeData *entryInfo=0L) | CWinLogData |
Update(CDC &dc, EntnodeData *entryInfo=0L) | CWinLogData |
UpdateSelf(UDC &hdc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
UpdateSelf(CDC &dc, EntnodeData *entryInfo) | CWinLogBranchData | [protected, virtual]
~CWinLogBranchData() | CWinLogBranchData | [inline, virtual]
~CWinLogBranchData() | CWinLogBranchData | [inline, virtual]
~CWinLogData() | CWinLogData | [virtual]
~CWinLogData() | CWinLogData | [virtual]
Generated on Fri Jan 31 12:21:26 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
OnBtnClick(void *info) | UCvsGraph | [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]
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:15:39 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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 Fri Jan 31 12:15:41 2003 for WinCvs Source by doxygen 1.3-rc2


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]
OnBlockHandler(void *widget, int cmd, int event) | UWidget |
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]
OnListHideColumns(int cmd, int num) | UWidget | [protected]
OnListInsert(int cmd, ULIST_INSERT *data) | UWidget | [protected]
OnListNewRow(int cmd, int *num) | UWidget | [protected]
OnListPopup(int cmd, int entry) | 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]
OnListSetSortDir(int cmd, int column, bool dir) | UWidget | [protected]
OnListShowColumns(int cmd, int num) | 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]
OnUnblockHandler(void *widget, int cmd, int event) | UWidget |
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(int widid) | 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 Fri Jan 31 12:15:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:43 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CUpdateMerge Member List

This is the complete list of members for CUpdateMerge, including all inherited members.
CUpdateMerge(const MultiFiles *mf, bool isCheckout, const char *rev1, const char *rev2, const char *date1, const char *date2) | 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_mf | CUpdateMerge | [private]
m_rev1 | CUpdateMerge |
m_rev1Combo | CUpdateMerge |
m_rev2 | CUpdateMerge |
m_rev2Combo | CUpdateMerge |
OnBrowseTag1() | CUpdateMerge | [protected]
OnBrowseTag2() | CUpdateMerge | [protected]
OnCheckdate1() | CUpdateMerge | [protected]
OnCheckdate2() | CUpdateMerge | [protected]
OnMerge() | CUpdateMerge | [protected]
OnMerge1() | CUpdateMerge | [protected]
OnMerge2() | CUpdateMerge | [protected]
~CUpdateMerge() | CUpdateMerge |
Generated on Fri Jan 31 12:20:44 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CUpdateSticky Member List

This is the complete list of members for CUpdateSticky, including all inherited members.
CUpdateSticky(const MultiFiles *mf, const char *rev, const char *date, const char *keyword) | CUpdateSticky |
DoDataExchange(CDataExchange *pDX) | CUpdateSticky | [protected, virtual]
IDD enum value | CUpdateSticky |
m_date | CUpdateSticky |
m_dateCombo | CUpdateSticky |
m_hasdate | CUpdateSticky |
m_hasrev | CUpdateSticky |
m_keyword | CUpdateSticky |
m_keywordCombo | CUpdateSticky |
m_keywordDescStatic | CUpdateSticky |
m_match | CUpdateSticky |
m_mf | CUpdateSticky | [private]
m_rev | CUpdateSticky |
m_revCombo | CUpdateSticky |
OnBrowseTag() | CUpdateSticky | [protected]
OnDate() | CUpdateSticky | [protected]
OnInitDialog() | CUpdateSticky | [protected, virtual]
OnRev() | CUpdateSticky | [protected]
~CUpdateSticky() | CUpdateSticky |
Generated on Fri Jan 31 12:20:46 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CRecursionLock Member List

This is the complete list of members for CRecursionLock, including all inherited members.
CRecursionLock(bool &semaphore) | CRecursionLock |
m_semaphore | CRecursionLock | [private]
~CRecursionLock() | CRecursionLock | [virtual]
Generated on Fri Jan 31 12:19:20 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CBrowseFileView Member List

This is the complete list of members for CBrowseFileView, including all inherited members.
AddColumns() | CBrowseFileView | [private]
CBrowseFileView() | CBrowseFileView | [protected]
CheckChanges(void) | CBrowseFileView | [inline]
DeleteColumns() | CBrowseFileView | [private]
DisableCommon(bool bCheckSelection=true) | CBrowseFileView | [private]
DoDrag() | CBrowseFileView | [private]
EditSel(EntnodeData *data, bool useDefault=false) | CBrowseFileView | [private]
GetColumnModel() const | CBrowseFileView | [inline]
GetEntriesModTime(time_t &newEntriesMod, time_t &newEntriesLogMod) | CBrowseFileView | [private]
GetImageForEntry(EntnodeData *data) | CBrowseFileView | [static]
GetMainFrame() | CBrowseFileView | [inline, private]
GetPath() const | CBrowseFileView | [inline]
GetPathLength(LPCTSTR path) | CBrowseFileView | [private]
GetViewType() const | CBrowseFileView | [private]
IsSamePath(LPCTSTR path1, LPCTSTR path2) | CBrowseFileView | [private]
LoadColumns() | CBrowseFileView | [private]
m_ascendant | CBrowseFileView | [private]
m_checkChanges | CBrowseFileView | [private]
m_ctrlHeader | CBrowseFileView | [private]
m_entriesLogMod | CBrowseFileView | [private]
m_entriesMod | CBrowseFileView | [private]
m_heightOfLines | CBrowseFileView | [private]
m_isFilesChange | CBrowseFileView | [private]
m_isRecursive | CBrowseFileView | [private]
m_isResetViewLocked | CBrowseFileView | [private]
m_isResetViewPending | CBrowseFileView | [private]
m_modelColumns | CBrowseFileView | [private]
m_numberByPages | CBrowseFileView | [private]
m_numberOfLines | CBrowseFileView | [private]
m_numberOfPages | CBrowseFileView | [private]
m_path | CBrowseFileView | [private]
m_smallImageList | CBrowseFileView | [private, static]
m_sort | CBrowseFileView | [private]
m_stateImageList | CBrowseFileView | [private, static]
m_uiFilechangeTimer | CBrowseFileView | [private]
m_watch | CBrowseFileView | [private]
OnAnnotate() | CBrowseFileView | [protected]
OnAppCmdline() | CBrowseFileView | [protected]
OnAppRtagbranch() | CBrowseFileView | [protected]
OnAppRtagcreate() | CBrowseFileView | [protected]
OnAppRtagdelete() | 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]
OnContextMenu(CWnd *pWnd, CPoint point) | 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]
OnMacro(UINT nID) | CBrowseFileView | [protected]
OnPreparePrinting(CPrintInfo *pInfo) | CBrowseFileView | [protected, virtual]
OnPrint(CDC *pDC, CPrintInfo *pInfo) | CBrowseFileView | [protected, virtual]
OnResetView(WPARAM, LPARAM) | CBrowseFileView | [protected]
OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message) | CBrowseFileView | [protected]
OnTimer(UINT nIDEvent) | CBrowseFileView | [protected]
OnUpdateCustomize(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateCvsCmd(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateMacro(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewAdd(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewAddB(CCmdUI *pCmdUI) | CBrowseFileView | [protected]
OnUpdateViewAnnotate(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 | [private]
ResetView(bool notifyBrowser=false, const char *selectFile=0L) | CBrowseFileView |
ResetView(const char *path, bool notifyBrowser=false, const char *selectFile=0L) | CBrowseFileView |
Resort(void) | CBrowseFileView | [private]
SaveColumns() | CBrowseFileView | [private]
SetFullRowSel(BOOL bFullRowSel) | CBrowseFileView | [private]
SetRecursive(bool isRecursive) | CBrowseFileView | [private]
SetViewType(DWORD dwViewType) | CBrowseFileView | [private]
~CBrowseFileView() | CBrowseFileView | [virtual]
Generated on Fri Jan 31 12:13:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:02 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:57 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:59 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

ColorTableEntry Member List

This is the complete list of members for ColorTableEntry, including all inherited members.
crColor | ColorTableEntry
szName | ColorTableEntry
Generated on Fri Jan 31 12:18:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:39 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:07 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:09 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:11 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:12 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:14 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:05 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:28 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:31 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:37 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CMenuItemInfo Member List

This is the complete list of members for CMenuItemInfo, including all inherited members.
CMenuItemInfo() CMenuItemInfo [inline]
Generated on Fri Jan 31 12:18:06 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:36 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:38 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:41 2003 for WinCvs Source by doxygen 1.3-rc2


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(NMHDR *pNMPGCalcSize, LRESULT *pResult) | CCJPagerCtrl | [protected, virtual]
OnPagerScroll(NMHDR *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 Fri Jan 31 12:14:42 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:43 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:44 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:46 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:48 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:56 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:51 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:54 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:53 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TOOLBARINFO Member List

This is the complete list of members for TOOLBARINFO, including all inherited members.
btnText | TOOLBARINFO
tbButton | TOOLBARINFO
Generated on Fri Jan 31 12:20:26 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:14:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:00 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:01 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:03 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:04 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:13 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:52 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:45 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:33 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:21 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:50 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:46 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | 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 Fri Jan 31 12:18:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:41 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:16 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:59 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:32 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CGraphDoc Member List

This is the complete list of members for CGraphDoc, including all inherited members.
CGraphDoc() | CGraphDoc | [protected]
Clear(void) | CGraphDoc | [private]
GetDir(void) const | CGraphDoc | [inline]
GetEntryInfo(void) | CGraphDoc | [inline]
GetName(void) const | CGraphDoc | [inline]
GetNode(void) | CGraphDoc | [inline]
GetTreeView(void) | CGraphDoc |
m_fData | CGraphDoc | [private]
m_fDir | CGraphDoc | [private]
m_fName | CGraphDoc | [private]
m_fNode | CGraphDoc | [private]
NumNodes() | CGraphDoc | [protected]
OnNewDocument() | CGraphDoc | [virtual]
Serialize(CArchive &ar) | CGraphDoc | [virtual]
SetNode(CLogNode *node, const char *dir) | CGraphDoc |
~CGraphDoc() | CGraphDoc | [virtual]
Generated on Fri Jan 31 12:16:23 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:24 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:13 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TGraphRectSelect Member List

This is the complete list of members for TGraphRectSelect, including all inherited members.
m_rect | TGraphRectSelect | [protected]
m_shiftOn | TGraphRectSelect | [protected]
m_view | TGraphRectSelect | [protected]
TGraphRectSelect(bool shiftOn, CGraphView *view, CRect &rect) | TGraphRectSelect |
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphRectSelect | [virtual]
Generated on Fri Jan 31 12:20:15 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TGraphCmdStatus Member List

This is the complete list of members for TGraphCmdStatus, including all inherited members.
GetSel1() const | TGraphCmdStatus |
GetSel2() const | TGraphCmdStatus |
GetSelCount() const | TGraphCmdStatus |
m_fSel1 | TGraphCmdStatus | [private]
m_fSel2 | TGraphCmdStatus | [private]
m_selCount | TGraphCmdStatus | [private]
TGraphCmdStatus() | TGraphCmdStatus |
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphCmdStatus | [virtual]
Generated on Fri Jan 31 12:20:14 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CGraphConsole Member List

This is the complete list of members for CGraphConsole, including all inherited members.
CGraphConsole() | CGraphConsole |
cvs_err(char *txt, long len) | CGraphConsole | [virtual]
cvs_out(char *txt, long len) | CGraphConsole | [virtual]
m_view | CGraphConsole | [private]
Generated on Fri Jan 31 12:16:22 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TGraphDelCmd Member List

This is the complete list of members for TGraphDelCmd, including all inherited members.
GetAllRevs() | TGraphDelCmd |
GetCountSel() const | TGraphDelCmd |
GetOnlyRev() const | TGraphDelCmd |
m_allRevs | TGraphDelCmd | [private]
m_countSel | TGraphDelCmd | [private]
m_onlyRev | TGraphDelCmd | [private]
TGraphDelCmd() | TGraphDelCmd |
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphDelCmd | [virtual]
Generated on Fri Jan 31 12:20:15 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

TGraphSelNonSig Member List

This is the complete list of members for TGraphSelNonSig, including all inherited members.
m_view | TGraphSelNonSig | [private]
TGraphSelNonSig(CGraphView *view) | TGraphSelNonSig |
TraverseGraph(CLogNode *node) | TGraph |
TraverseNode(CLogNode *node) | TGraphSelNonSig | [virtual]
Generated on Fri Jan 31 12:20:16 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CRevisionConsole Member List

This is the complete list of members for CRevisionConsole, including all inherited members.
CRevisionConsole() | CRevisionConsole |
cvs_err(char *txt, long len) | CRevisionConsole | [virtual]
cvs_out(char *txt, long len) | CRevisionConsole | [virtual]
init(LPCTSTR path, LPCTSTR fname) | CRevisionConsole |
m_fOut | CRevisionConsole | [protected]
~CRevisionConsole() | CRevisionConsole | [virtual]
Generated on Fri Jan 31 12:19:26 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CGraphRectTracker Member List

This is the complete list of members for CGraphRectTracker, including all inherited members.
CGraphRectTracker(CGraphView *view) | CGraphRectTracker | [inline]
m_view | CGraphRectTracker | [protected]
OnChangedRect(const CRect &rectOld) | CGraphRectTracker | [virtual]
Generated on Fri Jan 31 12:16:27 2003 for WinCvs Source by doxygen 1.3-rc2


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 | [private]
DisableUpdate(CCmdUI *pCmdUI) | CGraphView | [protected]
GetDeviceScrollPosition() | CScrollView | [inline]
GetImgList(void) | CGraphView | [inline, static]
InvalidateRect(const URECT *r) | CScrollView | [inline]
IsSelSingleNode(kLogNode type, bool equal=true) | CGraphView | [private]
m_imageList | CGraphView | [private, static]
m_numberOfPages | CGraphView | [private]
m_pageHeight | CGraphView | [private]
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 | [private]
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 Fri Jan 31 12:16:30 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:16:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:44 2003 for WinCvs Source by doxygen 1.3-rc2


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(const char *only=0L) | 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 Fri Jan 31 12:21:32 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:03 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CPathBuffer Member List

This is the complete list of members for CPathBuffer, including all inherited members.
Clear() | CPathBuffer | [inline]
CPathBuffer() | CPathBuffer |
GetBuffer(int size=0) | CPathBuffer | [inline]
m_buffer | CPathBuffer | [private]
m_bufferSize | CPathBuffer | [private]
~CPathBuffer() | CPathBuffer | [virtual]
Generated on Fri Jan 31 12:18:23 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CMfFileDialog Member List

This is the complete list of members for CMfFileDialog, including all inherited members.
CMfFileDialog(MultiFiles &mf, LPCTSTR lpszDefExt=NULL, LPCTSTR lpszFileName=NULL, DWORD dwFlags=OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, LPCTSTR lpszFilter=NULL, CWnd *pParentWnd=NULL) | CMfFileDialog |
DoModal() | CMfFileDialog | [virtual]
GetNextPathName(POSITION &pos) const | CMfFileDialog | [private]
GetStartPosition() const | CMfFileDialog | [private]
m_filesBuffer | CMfFileDialog | [private]
m_folderBuffer | CMfFileDialog | [private]
m_mf | CMfFileDialog | [private]
OnFileNameChange() | CMfFileDialog | [private, virtual]
Generated on Fri Jan 31 12:18:08 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:49 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:18:17 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:44 2003 for WinCvs Source by doxygen 1.3-rc2


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]
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 Fri Jan 31 12:19:47 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:15:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:19:58 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:20:25 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:10 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:17:47 2003 for WinCvs Source by doxygen 1.3-rc2


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_CvsGuiSfUrl | CAboutDlg |
m_vers | CAboutDlg |
m_WinCvsUrl | CAboutDlg |
OnInitDialog() | CAboutDlg | [protected, virtual]
Generated on Fri Jan 31 12:13:22 2003 for WinCvs Source by doxygen 1.3-rc2


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]
GetAppModule(UStr &module) const | CWincvsApp |
GetAppPath(UStr &path) const | CWincvsApp |
GetAppVersion(UStr &vers) const | CWincvsApp |
GetBrowserView(void) | CWincvsApp |
GetConsoleView(void) | CWincvsApp |
GetCvsProcess(void) | CWincvsApp | [inline]
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 |
gLogGraph | CWincvsApp |
gLogHtml | CWincvsApp |
gLogTempl | CWincvsApp |
IdleCvsProgress(void) | CWincvsApp |
InitATL() | CWincvsApp | [protected]
InitInstance() | CWincvsApp | [virtual]
IsCvsRunning(void) | CWincvsApp | [inline]
IsCvsStopping(void) | CWincvsApp | [inline]
LookForResourceFile(const char *what, UStr &path) | CWincvsApp | [protected]
m_bATLInited | CWincvsApp | [protected]
m_CvsProcess | CWincvsApp | [private]
m_CvsRunning | CWincvsApp | [private]
m_CvsStopping | CWincvsApp | [private]
m_idletime | CWincvsApp | [protected]
m_isBackgroundProcess | CWincvsApp |
m_LastCvsResult | CWincvsApp | [private]
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(bool doIdle) | CWincvsApp |
PreTranslateMessage(MSG *pMsg) | CWincvsApp | [virtual]
ResetIdleTime(void) | CWincvsApp | [inline]
SaveAllModified() | CWincvsApp | [virtual]
SetCvsProcess(CvsProcess *proc) | CWincvsApp | [inline]
SetCvsRunning(bool state) | CWincvsApp | [inline]
SetCvsStopping(bool state) | CWincvsApp | [inline]
ShowTipAtStartup(void) | CWincvsApp | [private]
ShowTipOfTheDay(void) | CWincvsApp | [private]
UpdateAllDocsView() | CWincvsApp |
Generated on Fri Jan 31 12:21:15 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:34 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:33 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CCvsThreadLock Member List

This is the complete list of members for CCvsThreadLock, including all inherited members.
CCvsThreadLock() | CCvsThreadLock |
Delete() | CCvsThreadLock | [static]
Initialize() | CCvsThreadLock | [static]
m_initialized | CCvsThreadLock | [private, static]
m_lock | CCvsThreadLock | [private, static]
~CCvsThreadLock() | CCvsThreadLock | [virtual]
Generated on Fri Jan 31 12:15:42 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CSelectionChangeNotifier Member List

This is the complete list of members for CSelectionChangeNotifier, including all inherited members.
CSelectionChangeNotifier(CWinCvsBrowser *view, bool notify) | CSelectionChangeNotifier |
m_notify | CSelectionChangeNotifier | [private]
m_view | CSelectionChangeNotifier | [private]
m_wasLocked | CSelectionChangeNotifier | [private]
~CSelectionChangeNotifier() | CSelectionChangeNotifier | [virtual]
Generated on Fri Jan 31 12:19:34 2003 for WinCvs Source by doxygen 1.3-rc2


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]
CWinCvsBrowser() | CWinCvsBrowser | [protected]
DeleteAllItems(HTREEITEM root=0L) | CWinCvsBrowser | [private]
DisableCommon() | CWinCvsBrowser | [private]
GetItemByLocation(const char *path) | CWinCvsBrowser | [private]
GetRoot(void) const | CWinCvsBrowser | [inline]
GetSelectionChanged() const | CWinCvsBrowser | [inline]
GetSelectionNotificationLocked() const | CWinCvsBrowser | [inline]
m_imageList | CWinCvsBrowser | [private, static]
m_resetViewPending | CWinCvsBrowser | [private]
m_root | CWinCvsBrowser | [private]
m_selectionChanged | CWinCvsBrowser | [private]
m_selectionNotificationLocked | CWinCvsBrowser | [private]
NotifySelectionChange() | CWinCvsBrowser |
OnAppCmdline() | CWinCvsBrowser | [protected]
OnAppRtagbranch() | CWinCvsBrowser | [protected]
OnAppRtagcreate() | CWinCvsBrowser | [protected]
OnAppRtagdelete() | CWinCvsBrowser | [protected]
OnContextMenu(CWnd *pWnd, CPoint point) | CWinCvsBrowser | [protected]
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]
OnUpdateAppCmdline(CCmdUI *pCmdUI) | CWinCvsBrowser | [protected]
OnUpdateCmd(CCmdUI *pCmdUI, BOOL needCvsInfos) | CWinCvsBrowser | [private]
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]
ProcessSelectionCommand(KiSelectionHandler *handler) | CWinCvsBrowser | [private]
ResetBrowser(const char *path, bool notifyView=false) | CWinCvsBrowser |
ResetView(bool forceReload=false, bool notifyView=false) | CWinCvsBrowser |
RetrievePath(HTREEITEM item, UStr &path) | CWinCvsBrowser | [private]
SetNewStyle(long lStyleMask, BOOL bSetBits) | CWinCvsBrowser | [private]
SetSelectionChanged(bool selectionChanged) | CWinCvsBrowser | [inline]
SetSelectionNotificationLocked(bool selectionNotificationLocked) | CWinCvsBrowser | [inline]
StepToLocation(const char *path, bool notifyView=false) | CWinCvsBrowser |
StoreExpanded(std::vector< UStr > &allExpanded, HTREEITEM root=0L) | CWinCvsBrowser | [private]
~CWinCvsBrowser() | CWinCvsBrowser | [protected, virtual]
Generated on Fri Jan 31 12:21:20 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:19 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:22 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:13:50 2003 for WinCvs Source by doxygen 1.3-rc2


Member List

CWincvsView Member List

This is the complete list of members for CWincvsView, including all inherited members.
CanPaste() const | CWincvsView | [private]
CWincvsView() | CWincvsView | [protected]
GetCurFormat(bool jumpEnd=true) | CWincvsView |
GetDocument() | CWincvsView | [inline]
IsSelected(const CObject *pDocItem) const | CWincvsView | [protected, virtual]
m_fRtfFormat | CWincvsView | [private]
m_sbuf | CWincvsView | [private, static]
m_snumbuf | CWincvsView | [private, static]
OnBeginPrinting(CDC *pDC, CPrintInfo *pInfo) | CWincvsView | [protected, virtual]
OnContextMenu(CWnd *pWnd, CPoint point) | CWincvsView | [protected]
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 |
OutLine(const char *buf, int numbuf, bool isStderr) | CWincvsView | [private]
PreCreateWindow(CREATESTRUCT &cs) | CWincvsView | [virtual]
QueryAcceptData(LPDATAOBJECT, CLIPFORMAT *, DWORD, BOOL, HGLOBAL) | CWincvsView | [private, virtual]
~CWincvsView() | CWincvsView | [virtual]
Generated on Fri Jan 31 12:21:24 2003 for WinCvs Source by doxygen 1.3-rc2


Alphabetical index

WinCvs Source Compound Index

_
CCJToolBarBase ItemDisplayInfo CMenu CStatusBar
_afxRichEditCookie CCJToolBarCtrl CItemListConsole UMenu UStr
_CvsProcess CCJToolCmdUI CItemListDlg CMenuItemInfo CStreamConsole
_CvsProcessStartupInfo CCJTreeCtrl CItemListDlg::CompareInfo UMessageMapFunctions CSubclassWnd
_dircontents CCJTreeCtrl::Color_Font ItemRowInfo CMfFileDialog CSubclassWndMap
_dirdesc CCJWindowPlacement IUnknown CMiniDockFrameWnd
T
_frameRec CCmdLine_MAIN Wincvs::IWincvs (Wincvs) mircAttrCvt CTabCtrl
_IID UCmdTarget
J
CMMenuString TAdorner
_MIDL_PROC_FORMAT_STRING CCmdUI CJX_COLORMAP CModuleParserConsole CTag_MAIN
_MIDL_TYPE_FORMAT_STRING UCmdUI CJX_CONTROLPOS CMPString tagCTV_ITEM
_sDiffOptionsItem UCOLOR
K
CMsg tagMENUITEMINFOA
_WireHandler UColor CKeyString UMSGMAP CTagParserConsole
_WireMessage CColorConsole CKeywordComboBox UMSGMAP_ENTRY tagTCB_ITEM
A
CColorMenu keywordMode CMString UTB_BUTTON
CAboutDlg CColorStatic KiColumn MultiFiles UTB_DROPDOWN
AddBinCvsArgs CComboBox KiColumnModel MultiFilesEntry UTB_INIT
AddCvsArgs CComboBoxEx KiFilterModel MultiFilesEntryIndex CTbEdit
AddUnicodeCvsArgs CComCoClass KiIgnoreModel CMyShellTree TBehavior
CAdminOptionDlg CCommit_MAIN KiRecursionModel
N
TbEntry
AFX_DLLVERSIONINFO CCommit_OPTIONS KiSelectionHandler CNoPython TbEntryButton
CAllHandlers CComModule KoAddBinaryHandler NotificationManager TbEntryChkButton
CAllTargets CComObjectRootEx KoAddHandler NotificationManager::Node TbEntryDropDown
CAnnotate_MAIN CContentItems KoAddUnicodeHandler
O
TbEntrySeparator
ansiAttrCvt CControlBar KoAnnotateHandler CObject TBrowserFill
ansiAttrCvt::AnsiSeq CCtrlView KoBranchTagHandler UObject TBrowserFillDummy
AREF CCustInvertTable KoCancelChangesHandler ColorTableEntry TBuggyPopup
aref CCustomizeMenus KoCheckoutHandler ControlCvsArgs CTcl_Interp
CAskYesNo CCVS_CoworkerModule KoColumnContext option CTCLBrowserEnt
Authen CCVSAlert KoCommandLineHandler COptionalPropertySheet CTCLCvsConsole
UAuthen_Gserver UCvsApp KoCommitHandler OUTBAR_INFO CTCP2Parse
UAuthen_Kserver UCvsConsole KoConflictColumn
P
CTCP2Parse::RGBColor
UAuthen_Pserver CCvsConsole KoCreateTagHandler CPathBuffer TEditText
UAuthen_Rhosts UCvsFiles KoDateColumn PCPStr CTempToggleBool
UAuthen_SSH UCvsFolders KoDeleteTagHandler PCStr TGraph
UAuthen_Sspi UCvsFrame KoDiffHandler UPen TGraphCmdStatus
AuthenGserver UCvsGraph KoEditHandler CPersistent TGraphDelCmd
AuthenKserver UCvsMenubar KoEditorsHandler CPersistent::CPersistentEntry TGraphRectSelect
AuthenLocal CCvsStatusBar KoFileRemoveHandler CPersistentBool TGraphSelNonSig
AuthenModel CCvsThreadLock KoFilterModel CPersistentInt TIconButton
AuthenNtserver UCvsToolbar KoForceEditHandler CPersistentT< T > TIconCheckBox
AuthenPserver
D
KoGraphDiffHandler UPoint TIconPopup
AuthenRhosts UDC KoGraphHandler UPOINT UTimer
AuthenServer CDestroyThreadLock KoIgnoreModel poolRec CTipDlg
CAuthenSetUp CDialog KoImportHandler UPPMenu TMPersistent< T >
AuthenSSH CDiff_MAIN KoLockHandler CProgress CTmpFiles
AuthenSspi CDiff_Options KoLogHandler CProgressDlg TMString< T >
awidget CDiff_Options::CompareInfo KoMoveToTrashHandler UPromptMessage UToolbar
B
direct KoNameColumn CPropertyPage CToolbarCombo
CBarConsole CDockBar KoOptionColumn CPropertySheet CToolBarCtrl
CBrowseFileView CDockContext KoPathColumn CPseudoButton CToolBarData
CBrowserBar CDocument KoQueryUpdateHandler UPseudoCmdStatusWrapper TOOLBARINFO
UBrush Wincvs::Document (Wincvs) KoRecursionModel CPseudoDlg TPopup
CBuffer DROPDOWNBUTTON KoRecursiveModel CPseudoDraw TPseudoAppBehavior
CButton CDummyClass KoRegularModel UPseudoFakePane TPseudoCustomView
C
CDummyInit KoReleaseHandler CPseudoItem TPseudoDoubleNumberText
CCharFormat DYN_LIST KoReservedEditHandler CPseudoList TPseudoIconButton
CCheckout_MAIN CDynToolBar KoRevisionColumn UPseudoPageHider TPseudoIconCheckBox
CCheckout_OPTIONS
E
KoRtagBranchHandler UPseudoPlaceHolder TPseudoIconPopup
CCJBrowseButton CEdit KoRtagCreateHandler UPseudoRotButton TPseudoRotateIconButton
CCJBrowseEdit UEditMessage KoRtagDeleteHandler CPseudoRotButton TPseudoScrollBar
CCJCaption CEditorMonDlg KoStatusColumn CPseudoToggle TPseudoTextListView
CCJCaptionButton ENTNODE KoStatusHandler UPStr TPseudoWinAdorner
CCJCaptionPopupWnd EntnodeData KoTagColumn PyAutoObject< T > TPseudoWinBehavior
CCJCBarButton EntnodeFile KoTraversalContext PyCmdUI TraversalReport
CCJColorPicker EntnodeFolder KoUneditHandler PyCmdUI::obj_t UTREE_INFO
CCJColorPopup EntnodePath KoUnlockHandler PyColorConsole UTREE_INSERT
CCJComboBoxEx CExploreBar KoUpdateHandler PyColorConsole::obj_t CTreeCtrl
CCJControlBar
F
KoUpdateMoveToTrashHandler PyContainer CTreeView
CCJDateEdit CFileDialog KoWatcher CPyCvsConsole TScrollBar
CCJDateTimeCtrl FileEntry KoWatchersHandler PyCvsEntry TTextListView
CCJDockBar CFillPyEntries KoWatchOffHandler PyCvsEntry::obj_t CTurnOffDispatching
CCJDockContext CFillTclEntries KoWatchOnHandler PyMenuMgr TView
CCJExplorerBar CFindSettings
L
PyMenuMgr::obj_t TViewFill
CCJFlatButton CFormView LAttachment PyPersistent
U
CCJFlatComboBox CFrameWnd LBevelButton PyPersistent::obj_t CUpdateMain
CCJFlatHeaderCtrl
G
LCommander PyRegistry CUpdateMerge
CCJFlatSplitterWnd garbyRec ULIST_INFO CPython_Interp CUpdateSticky
CCJFlatTabCtrl GetPassword ULIST_INSERT CPyThreadState CustInvertTable
CCJFontCombo CGetPrefs_CVS CListBox
R
V
CCJFrameWnd CGetPrefs_CVSCMD_DIALOGS CListCtrl URect vector
CCJHexEdit CGetPrefs_CVSROOT CListParserConsole URECT CView
CCJHtmlView CGetPrefs_GLOBALS CListView CRectTracker CViewInfo
CCJHyperLink CGetPrefs_WINCVS LListener CRecursionLock CvsArgs
CCJListBox GetValue LMainPseudoAttachment CRelease_MAIN CvsCoworker
CCJListCtrl CGfxGroupEdit CLogFilters RemoveCvsArgs CVS_COWORKERLib::CvsCoworker (CVS_COWORKERLib)
CCJListView CGfxOutBarCtrl CLogFrame ReportConflict CvsFilenames
CCJLogoPane CGfxOutBarCtrl::CBarFolder CLogin_MAIN ReportWarning CvsPrefs
CCJMaskEdit CGfxOutBarCtrl::CBarItem CLogMain CRevisionConsole CvsProcessCallbacks
CCJMDIChildWnd CGfxSplitterWnd CLogNodeData CRichEditView CvsProject
CCJMDIFrameWnd GPT_CONSOLE CLogoutThread CRtag_MAIN CvsString
CCJMemFile GPT_GETENV LOutlineItem CRtag_OPTIONS CvsTrace
CCJMenu GPT_QUIT LOutlineTable URuntimeClass
W
CCJMenuBar CGraphConsole LPane
S
UWaitCursor
CCJMenuBarFrameHook CGraphDoc LPeriodical USaveSettings UWidget
CCJMenuData CGraphFrame LPlaceHolder CScrollView Win32wstring
CCJMetaFileButton CGraphOptDlg LPseudoDrawAttachment CSelectionChangeNotifier CWinApp
CCJMiniDockFrameWnd CGraphRectTracker LPseudoWinAttachment CSelectionDetailsDlg CWincvsApp
CCJMonthCalCtrl CGraphView LSReport CSelectionDetailsDlg::CompareInfo CWinCvsBrowser
CCJOutlookBar
H
M
SelectionDisplayInfo CWincvsDoc
CCJPagerCtrl CHARFORMAT UMacAppMenu USemaphore CWincvsView
CCJReBar CHeaderCtrl CMacBinItem USIZE WINDOWPLACEMENT
CCJReBarCtrl CHistComboBoxEx MACBINMAP USize WININFO
CCJShellTree
I
MACBINMAPENTRIES USLIDER CWinLogBranchData
CCJSizeDockBar ICvsCoworker MacBinMaps USmartCombo CWinLogData
CCJSortClass ICvsCoworker CMacBinTable CSmartComboBox CWinLogHeaderData
CCJSortClass::CSortItem CImport_MAIN CMacroEntry CSortHeaderCtrl CWinLogRevData
CCJStatusBar CImport_OPTIONS CMacroSet CSortList< T > CWinLogTagData
CCJStatusBarPane CImportEntry MacroTraversal CSortParam CWinPlacement
CCJStatusBarPaneControlInfo CImportFilterDlg CMainFrame CSplashWnd CWinThread
CCJTabCtrl ImportReport CMapPtrToPtr CSplitterWnd CWnd
CCJTabCtrlBar CImportWarning match_dir CStackThreadLock CWndRedrawMngr
CCJTabView CInit_MAIN CMDIChildWnd CStatic wnt_stat
CCJTimeEdit irciiAttrCvt CMDIFrameWnd CStaticAllocT< T > wstring
CCJToolBar ISupportErrorInfo CMemFile CStatus_MAIN
Generated on Fri Jan 31 12:13:18 2003 for WinCvs Source by doxygen 1.3-rc2


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 Fri Jan 31 12:21:35 2003 for WinCvs Source by doxygen 1.3-rc2