The Meta-Environment API

rstore-actions.tb

Go to the documentation of this file.
00001 #ifndef __RSTORE_ACTIONS__
00002 #define __RSTORE_ACTIONS__
00003 
00004 #include <configuration-manager.idef>
00005 #include <fbi.tb>
00006 
00007 process HandleRStoreEvent(Type: term, Event: term, RStoreId: term) is
00008 let
00009   Action: str
00010 in
00011   snd-msg(cm-get-action(Type, Event))
00012   . rec-msg(cm-action(Action?))
00013   . Action(RStoreId)
00014 endlet
00015 
00016 process GetRStorePopupEvents(PopupMenu: list?) is
00017 let
00018   Events: list 
00019 in
00020   snd-msg(cm-get-events(factbrowser-popup))
00021   . rec-msg(cm-events(PopupMenu?))
00022 endlet
00023 
00024 process HandleRStorePopup is
00025 let
00026   RStoreId: term,
00027   Menu: term,
00028   PopupMenu: list,
00029   Type: term
00030 in
00031   (
00032     FB-RequestPopup(RStoreId?)
00033     . GetRStorePopupEvents(PopupMenu?)
00034     . FB-ShowPopup(RStoreId, PopupMenu)
00035   +
00036     FB-PopupEvent(RStoreId?, Menu?)
00037     . HandleRStoreEvent(factbrowser-popup, Menu, RStoreId)
00038   )
00039   *
00040   delta
00041 endlet
00042 
00043 toolbus(HandleRStorePopup)
00044 
00045 process UnloadRStoreAction(RStoreId: term) is
00046   snd-msg(rc-unload-rstore(RStoreId))
00047   . rec-msg(rc-rstore-unloaded(RStoreId))
00048   . snd-msg(fb-rstore-unloaded(RStoreId))
00049 
00050 process SaveRStoreAction(RStoreId: term) is
00051 let
00052   Cancel: bool,
00053   Path: str,
00054   RStore: rstore,
00055   Store: term,
00056   Summary: summary
00057 in
00058   PromptForFileWithExtension("Save RStore", [], ".rstore", Cancel?, Path?)
00059   .
00060   if equal(Cancel, true) then
00061     tau
00062   else
00063     snd-msg(rc-get-rstore(RStoreId))
00064     . rec-msg(rc-rstore(RStoreId, RStore?))
00065     . snd-msg(io-write-term-as-text(Path, RStore))
00066     . 
00067     (
00068       rec-msg(io-file-written)
00069     +
00070       rec-msg(io-file-not-written(Summary?))
00071     )
00072   fi
00073 endlet
00074 
00075 #endif /* __RSTORE_ACTIONS__ */

Generated on Fri Sep 12 13:18:43 2008 for rscript-meta by  doxygen 1.4.6