[GME-commit]
GMESRC/GME/Gme GMEOLEIt.cpp,NONE,1.1 GMEOLEIt.h,NONE,1.1
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Fri Apr 15 19:40:24 CDT 2005
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv19970
Added Files:
GMEOLEIt.cpp GMEOLEIt.h
Log Message:
CVS User: Zoltan Molnar, ISIS (zolmol)
--- NEW FILE: GMEOLEIt.h ---
#if !defined(AFX_GMEOLEIT_H__338DD18C_3C58_4C65_9202_2B5E00CF740A__INCLUDED_)
#define AFX_GMEOLEIT_H__338DD18C_3C58_4C65_9202_2B5E00CF740A__INCLUDED_
#include "GuiMeta.h"
#include "GMEView.h"
#include "MainFrm.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GMEOLEIt.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CGMEOLEIt command target
class CGMEOLEIt : public CCmdTarget
{
DECLARE_DYNCREATE(CGMEOLEIt)
CGMEOLEIt(); // protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
// Overrides
public:
virtual void OnFinalRelease();
//}}AFX_VIRTUAL
// Implementation
protected:
CGMEView * m_theView;
CComPtr<IMgaModel> m_theMgaModel;
virtual ~CGMEOLEIt();
// this method is called by PRECONDITION_VALID_MODEL macro
bool AmIValid();
// mga related helpers
static bool createObjs( CComPtr<IMgaModel>& mm, LPCTSTR partname, LPCTSTR newnm, IMgaFCO** pNewObj );
static bool cloneObjs( CComPtr<IMgaModel>& mm, IMgaFCO* pExistingObj, LPCTSTR partname, LPCTSTR newnm, IMgaFCO** pNewObj );
static void rename( CComPtr<IMgaFCO> pFco, LPCTSTR pName);
static CComPtr<IMgaObject> myParent( const CComPtr<IMgaObject>& obj);
static CComPtr<IMgaFCO> fcoByPath( const CComPtr<IMgaModel>& mod, LPCTSTR p_objPath);
static CComPtr<IMgaFCO> getChildInByName( CComPtr<IMgaModel> model, LPCTSTR name );
static bool isValidChildIn( CComPtr<IMgaModel> model, CComPtr<IMgaFCO> fco);
static CComPtr<IMgaMetaRole> metaRolePtrInByName( CComPtr<IMgaModel> p_model, CComBSTR p_part );
static CComPtr<IMgaMetaRole> connMetaRolePtrInBetween( CComPtr<IMgaModel> p_model, CComPtr<IMgaFCO> p_src, CComPtr<IMgaFCO> p_dst );
static CComPtr<IMgaMetaRole> connMetaRolePtrInBetween( CComPtr<IMgaModel> p_model, CComPtr<IMgaFCO> p_srcRole1, CComPtr<IMgaFCO> p_srcRole2, CComPtr<IMgaFCO> p_dstRole1, CComPtr<IMgaFCO> p_dstRole2);
static CComPtr<IMgaMetaRole> connMetaRolePtrInBetween( CComPtr<IMgaModel> p_model, const CComBSTR& src_localpath, const CComBSTR& dst_localpath);
static CComBSTR roleNameOf( CComPtr<IMgaFCO> one_fco );
static objtype_enum myTypeIs( CComPtr<IMgaFCO> fco);
static void refPortFinderAndChainBuilder( LPCTSTR p_portRole, CComPtr<IMgaFCO> p_ref, CComPtr<IMgaFCO>& p_portResult, CComPtr<IMgaFCOs>& p_refChainResult );
static bool areCollectionsEqual( const CComPtr<IMgaFCOs>& op1, const CComPtr<IMgaFCOs>& op2);
// gui related helpers
void moveAspect( int dir);
void moveView( int dir);
// transaction related helper methods
bool m_isInUserInitiatedTransaction;
bool m_initedByMe;
bool start();
bool end();
bool beginTrans();
bool commitTrans();
LPDISPATCH putInTerr( LPDISPATCH);
CComPtr<IMgaFCO> putInTerr( const CComPtr<IMgaFCO>& fco);
// Generated message map functions
//{{AFX_MSG(CGMEOLEIt)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// OLE dispatch map functions
afx_msg LPDISPATCH GetAspects();
afx_msg void SetAspects(LPDISPATCH newValue);
afx_msg void Print();
afx_msg void PrintDialog();
afx_msg void DumpWindowsMetaFile(LPCTSTR filePath);
afx_msg void CheckConstraints();
afx_msg void RunComponent(LPCTSTR appID);
afx_msg void RunComponentDialog();
afx_msg void Close();
afx_msg void GrayOutFCO(BOOL bGray, BOOL bNeighbours, LPDISPATCH mgaFCOs);
afx_msg void GrayOutHide();
afx_msg void ShowSetMembers(LPDISPATCH mgaFCO);
afx_msg void HideSetMembers();
afx_msg void Zoom(long percent);
afx_msg void ZoomTo(LPDISPATCH mgaFCOs);
afx_msg void Scroll(long bar, long scroll);
afx_msg BOOL GetValid();
afx_msg void SetValid(BOOL);
afx_msg LPDISPATCH GetMgaModel();
afx_msg void SetMgaModel(LPDISPATCH);
afx_msg void ShowFCO( LPCTSTR);
afx_msg LPDISPATCH Child( LPCTSTR);
afx_msg LPDISPATCH Create( LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH Duplicate( LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH DuplicateFCO( LPDISPATCH, LPCTSTR);
afx_msg void Rename( LPCTSTR, LPCTSTR);
afx_msg void SetName( LPDISPATCH, LPCTSTR);
afx_msg void Include( LPCTSTR, LPCTSTR);
afx_msg void IncludeFCO( LPDISPATCH, LPDISPATCH);
afx_msg void Exclude( LPCTSTR, LPCTSTR);
afx_msg void ExcludeFCO( LPDISPATCH, LPDISPATCH);
afx_msg LPDISPATCH Connect( LPCTSTR, LPCTSTR, LPCTSTR);
afx_msg void Disconnect( LPCTSTR, LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH ConnectThruPort( LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR);
afx_msg void DisconnectThruPort( LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH ConnectFCOs( LPDISPATCH, LPDISPATCH, LPCTSTR);
afx_msg void DisconnectFCOs( LPDISPATCH, LPDISPATCH, LPCTSTR);
afx_msg void Refer( LPCTSTR, LPCTSTR);
afx_msg void ReferFCO( LPDISPATCH, LPDISPATCH);
afx_msg void SetAttribute( LPCTSTR, LPCTSTR, LPCTSTR);
afx_msg VARIANT GetAttribute( LPCTSTR, LPCTSTR);
afx_msg void SetAttributeFCO( LPDISPATCH, LPCTSTR, LPCTSTR);
afx_msg VARIANT GetAttributeFCO( LPDISPATCH, LPCTSTR);
afx_msg LPDISPATCH SubType( LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH Instantiate( LPCTSTR, LPCTSTR);
afx_msg LPDISPATCH SubTypeFCO( LPDISPATCH, LPCTSTR);
afx_msg LPDISPATCH InstantiateFCO( LPDISPATCH, LPCTSTR);
afx_msg void BeginTransaction( );
afx_msg void CommitTransaction( );
afx_msg VARIANT_BOOL IsInTransaction( );
afx_msg LPDISPATCH PutInTerritory( LPDISPATCH);
afx_msg void Help( );
afx_msg void SetSelected( LPCTSTR);
afx_msg BSTR GetSelected( );
afx_msg void SetSelectedFCOs( LPDISPATCH);
afx_msg LPDISPATCH GetSelectedFCOs( );
afx_msg void NextAspect( );
afx_msg void PrevAspect( );
afx_msg void Next( );
afx_msg void Prev( );
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
BEGIN_DUAL_INTERFACE_PART(Dual, IGMEOLEIt)
STDMETHOD(get_Valid)(THIS_ VARIANT_BOOL* isValid);
STDMETHOD(get_MgaModel)(THIS_ IMgaModel** model);
STDMETHOD(get_Aspects)(THIS_ IGMEOLEColl** coll);
STDMETHOD(Print)(THIS);
STDMETHOD(PrintDialog)(THIS);
STDMETHOD(DumpWindowsMetaFile)(THIS_ BSTR filePath);
STDMETHOD(CheckConstraints)(THIS);
STDMETHOD(RunComponent)(THIS_ BSTR appID);
STDMETHOD(RunComponentDialog)(THIS);
STDMETHOD(Close)(THIS);
STDMETHOD(GrayOutFCO)(THIS_ VARIANT_BOOL bGray, VARIANT_BOOL bNeighbours, IMgaFCOs* mgaFCO);
STDMETHOD(GrayOutHide)(THIS);
STDMETHOD(ShowSetMembers)(THIS_ IMgaFCO* mgaFCO);
STDMETHOD(HideSetMembers)(THIS);
STDMETHOD(Zoom)(THIS_ DWORD percent);
STDMETHOD(ZoomTo)(THIS_ IMgaFCOs* mgaFCOs);
STDMETHOD(Scroll)(THIS_ bar_enum bar, scroll_enum scroll);
STDMETHOD(ShowFCO)(THIS_ BSTR path);
STDMETHOD(Child)(THIS_ BSTR name, IMgaFCO** child_fco);
STDMETHOD(Create)(THIS_ BSTR part, BSTR name, IMgaFCO** new_fco);
STDMETHOD(Duplicate)(THIS_ BSTR existing_fco_name, BSTR new_fco_name, IMgaFCO** new_fco);
STDMETHOD(DuplicateFCO)(THIS_ IMgaFCO* existing_fco, BSTR new_fco_name, IMgaFCO** new_fco);
STDMETHOD(Rename)(THIS_ BSTR oldname, BSTR newname);
STDMETHOD(SetName)(THIS_ IMgaFCO* fco, BSTR name);
STDMETHOD(Include)(THIS_ BSTR setname, BSTR fconame);
STDMETHOD(IncludeFCO)(THIS_ IMgaSet* set, IMgaFCO* fco);
STDMETHOD(Exclude)(THIS_ BSTR setname, BSTR fconame);
STDMETHOD(ExcludeFCO)(THIS_ IMgaSet* set, IMgaFCO* fco);
STDMETHOD(Connect)(THIS_ BSTR name1, BSTR name2, BSTR connection, IMgaConnection** conn );
STDMETHOD(Disconnect)(THIS_ BSTR part1, BSTR part2, BSTR connection);
STDMETHOD(ConnectThruPort)(THIS_ BSTR part1, BSTR port1, BSTR part2, BSTR port2, BSTR connection, IMgaConnection ** conn );
STDMETHOD(DisconnectThruPort)(THIS_ BSTR part1, BSTR port1, BSTR part2, BSTR port2, BSTR connection);
STDMETHOD(ConnectFCOs)(THIS_ IMgaFCO* part1, IMgaFCO* part2, BSTR connection, IMgaConnection ** conn );
STDMETHOD(DisconnectFCOs)(THIS_ IMgaFCO* part1, IMgaFCO* part2, BSTR connection);
STDMETHOD(Refer)(THIS_ BSTR reference, BSTR referred);
STDMETHOD(ReferFCO)(THIS_ IMgaReference* reference, IMgaFCO* referred);
STDMETHOD(SetAttribute)(THIS_ BSTR name, BSTR attr_name, BSTR value);
STDMETHOD(GetAttribute)(THIS_ BSTR name, BSTR attr_name, BSTR* value);
STDMETHOD(SetAttributeFCO)(THIS_ IMgaFCO* fco, BSTR attr_name, BSTR value);
STDMETHOD(GetAttributeFCO)(THIS_ IMgaFCO* fco, BSTR attr_name, BSTR* value);
STDMETHOD(SubType)( THIS_ BSTR base, BSTR name_of_subtype, IMgaFCO** subtype);
STDMETHOD(Instantiate)( THIS_ BSTR base, BSTR name_of_instance, IMgaFCO** instance);
STDMETHOD(SubTypeFCO)( THIS_ IMgaFCO* base, BSTR name_of_subtype, IMgaFCO** subtype);
STDMETHOD(InstantiateFCO)( THIS_ IMgaFCO* base, BSTR name_of_instance, IMgaFCO** instance);
STDMETHOD(BeginTransaction)(THIS);
STDMETHOD(CommitTransaction)(THIS);
STDMETHOD(IsInTransaction)(THIS_ VARIANT_BOOL* intrans);
STDMETHOD(PutInTerritory)(THIS_ IMgaFCO* fco, IMgaFCO** newfco);
STDMETHOD(Help)(THIS);
STDMETHOD(SetSelected)(THIS_ BSTR space_delimited_string );
STDMETHOD(GetSelected)(THIS_ BSTR * space_delimited_string );
STDMETHOD(SetSelectedFCOs)(THIS_ IMgaFCOs* fcos_to_select);
STDMETHOD(GetSelectedFCOs)(THIS_ IMgaFCOs** selected_fcos);
STDMETHOD(NextAspect)(THIS);
STDMETHOD(PrevAspect)(THIS);
STDMETHOD(Next)(THIS);
STDMETHOD(Prev)(THIS);
END_DUAL_INTERFACE_PART(Dual)
// add declaration of ISupportErrorInfo implementation
// to indicate we support the OLE Automation error object
DECLARE_DUAL_ERRORINFO()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GMEOLEIT_H__338DD18C_3C58_4C65_9202_2B5E00CF740A__INCLUDED_)
--- NEW FILE: GMEOLEIt.cpp ---
// GMEOLEActiveModel.cpp : implementation file
//
#include "stdafx.h"
#include "gme.h"
#include "GMEOLEIt.h"
#include "GMEOLEAspect.h"
#include "GMEOLEError.h"
#include "GMEOLEColl.h"
#include "GMEDoc.h"
#include "MainFrm.h"
#include "GMEEventLogger.h"
#include "CommonStl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
[...3159 lines suppressed...]
TRY_DUAL(IID_IGMEOLEIt)
{
pThis->Next();
return NOERROR;
}
CATCH_ALL_DUAL
}
STDMETHODIMP CGMEOLEIt::XDual::Prev(THIS)
{
METHOD_PROLOGUE(CGMEOLEIt, Dual)
TRY_DUAL(IID_IGMEOLEIt)
{
pThis->Prev();
return NOERROR;
}
CATCH_ALL_DUAL
}
More information about the GME-commit
mailing list