procedure(CDS_P4WindowTrigger(trigList) ;_Jun 29 01 sikand 1751
prog(( client cellddid xto xt w wname fdata fdatav wnamev)
;; make sure there is a pcells library available
;; add pcell menu to layout windows
when( ddGetObj("pcells") && trigList->rootType == "maskLayout"
VCI_LayoutMenu=vci_pcell_menu()
unless(member('VCI_LayoutMenu hiGetBannerMenus(trigList->window))
hiInsertBannerMenu(trigList->window
VCI_LayoutMenu
length(hiGetBannerMenus(trigList->window))
)
) ; ** unless member **
) ; ** when ddGetObj **
when( ddGetObjDMSys(trigList->libId) == "p4"
when( trigList->mode != 'close
client = CDS_P4GetClient(trigList->libId)
CDS_P4CurrentClient=client
cellddid = trigList->viewFileId
if( trigList->eip || !cellddid then
;;if( member(trigList->viewName CDS_P4UnManaged)
;;return(t)
;;)
xto = ddGetObj(trigList->libName trigList->cellName trigList->viewName "*")
xt = xto~>writePath
else
xto=cellddid
xt= xto~>writePath
) ; ** if trigList **
when((member(xto~>viewName CDS_P4ViewsUnManaged) ||
member(xto~>view~>name CDS_P4ViewsUnManaged))
return(t)
)
when((member(xto~>cellName CDS_P4CellsUnManaged) ||
member(xto~>cell~>name CDS_P4CellsUnManaged))
return(t)
)
w= trigList->window
wname = hiGetWindowName(w)
fdata = CDS_P4Fstat(xt)
if( trigList->accessMode == "a"
;; make sure the file is opened
when( fdata~>action == 'unbound
CDS_ErrorDialogBox("P4 Interface"
"This cell could not be opened correctly for edit.\nIt's possible the cell is UNIX r/w or an unmanaged object\nIf it is a managed object, you should do a chmod -w on the files in question.\nSeek HELP if you do not understand this message\n")
hiCloseWindow(w)
)
) ; ** if trigList **
if(fdata~>headRev == 'unbound
then
fdatav = "0"
else
fdatav = fdata~>headRev
) ; ** if fdata **
wnamev = strcat(wname " #" fdatav)
hiSetWindowName(w wnamev)
) ; ** when trigList **
) ; ** when ddGetObjDMSys **
) ; ** prog **
) ; ** procedure CDS_P4WindowTrigger **
procedure(CDS_P4EditTrigger(arglist) ;_Nov 8 99 sikand 1499
prog(( save mode action cellddid xt status client user validedit editname
xto cellview)
when( ddGetObjDMSys(arglist->libId) != "p4"
return()
)
mode = arglist->accessMode
action = arglist->action
cellddid = arglist->viewFileId
cellview = arglist->window~>cellView
;; is it a Perforce controlled object
client = CDS_P4GetClient(arglist->libId)
CDS_P4CurrentClient=client
when( action == 'close && cellview~>modifiedButNotSaved
if( hiGraphicMode() then
save = CDS_WarnDialogBox(strcat("Save Changes for "
cellview~>cell~>name " "
cellview~>view~>name)
"This cellview has been modified\nDo you want to save your changes ?")
when( save
dbSave(cellview)
)
) ; ** if hiGraphicMode **
) ; ** when action **
when( action != 'close
when( mode == "a"
;; make sure that no-one else has this cell checked
;; out
if( arglist->eip || !cellddid then
xto = ddGetObj(arglist->libName arglist->cellName arglist->viewName "*")
xt = CDS_NFSSimplify(xto~>writePath)
else
xt= CDS_NFSSimplify(cellddid~>writePath)
) ; ** if arglist **
status = CDS_P4IPCBufferProcess(strcat("opened -a " xt))
when( status
client = CDS_P4GetClient(arglist->libId)
user = getLogin()
validedit = strcat(user "@" client)
editname = car(reverse(parseString(CDS_IPCBuffer)))
unless( (rexMatchp("file(s) not opened anywhere" CDS_IPCBuffer) ||
;; hack for 99.1 bug in opened -a
rexMatchp("file(s) not in client view" CDS_IPCBuffer))
editname = car(reverse(parseString(CDS_IPCBuffer)))
unless( editname == validedit
if( hiGraphicMode() then
CDS_ErrorDialogBox("P4 Interface"
strcat("File already being edited by " editname))
else
printf("Error: File already being edited by %s\n" editname)
) ; ** if hiGraphicMode **
;;hiCloseWindow(arglist->window)
geChangeEditMode("r" arglist->window)
) ; ** unless editname **
) ; ** unless rexMatchp **
) ; ** when status **
) ; ** when mode **
) ; ** when action **
) ; ** prog **
) ; ** procedure CDS_P4EditTrigger **
;deRegUserTriggers("maskLayout" nil nil 'CDS_P4WindowTrigger)
;deRegUserTriggers("maskLayout" 'CDS_P4EditTrigger nil nil)
;deRegUserTriggers("schematic" nil nil 'CDS_P4WindowTrigger)
;deRegUserTriggers("schematic" 'CDS_P4EditTrigger nil nil)
;deRegUserTriggers("schematicSymbol" nil nil 'CDS_P4WindowTrigger)
;deRegUserTriggers("schematicSymbol" 'CDS_P4EditTrigger nil nil)