The Meta-Environment API

gui-utils.tb

Go to the documentation of this file.
00001 #ifndef __GUI_UTILS__
00002 #define __GUI_UTILS__
00003 
00004 #include <gui-actions.tb>
00005 #include <gui.idef>
00006 #include <console-gui.idef>
00007 #include <dialog.idef>
00008 #include <graph-painter.idef>
00009 #include <progress.idef>
00010 #include <moduledetails.idef>
00011 #include <error-viewer.idef>
00012 #include <svg-gui.idef>
00013 
00014 process AddJob(Message: str) is
00015   snd-msg(gui-add-job(Message))
00016 
00017 process JobDone(Message: str) is
00018   snd-msg(gui-job-done(Message))
00019 
00020 process ConsoleMessage(Message: str) is
00021   snd-msg(cg-add-message(Message))
00022 
00023 process Error(Message: str) is
00024   printf("error: %s\n", Message)
00025 
00026 process Warning(Message: str) is
00027   printf("warning: %s\n", Message)
00028 
00029 process RemoveSummaryFor(SummaryId: str) is
00030   snd-msg(ui-remove-feedback-summary("Issues", SummaryId))
00031   
00032 process RemoveSummary(Producer: str, SummaryId: str) is
00033   snd-msg(ui-remove-feedback-summary("Issues", Producer, SummaryId))
00034   
00035 process DisplaySummary(Summary: summary) is
00036   snd-msg(ui-show-feedback-summary("Issues", Summary))
00037 
00038 process RefreshSummary(Summary: summary) is
00039   snd-msg(ui-refresh-feedback-summary("Issues", Summary))
00040 
00041 process HandleEvent(Type: term, Event: term) is
00042 let
00043   Actions: list,
00044   Action: str
00045 in
00046   snd-msg(cm-get-action(Type, Event))
00047   . rec-msg(cm-action(Action?))
00048   .
00049   (
00050     printf("Warning: process not found %s\n", Action)
00051   +>
00052     Action()
00053   )
00054 endlet
00055 
00056 process LocationSelected(Location: term) is
00057 let
00058   Action: str
00059 in
00060   snd-msg(cm-get-action(feedback-list, click))
00061   . rec-msg(cm-action(Action?))
00062   . 
00063   (
00064     printf("Warning: process not found %s\n", Action)
00065   +>
00066     Action(Location)
00067   )
00068 endlet
00069 
00070 process MessageSelected(Modulename: str, Tree: term) is
00071 let
00072   Action: str
00073 in
00074   snd-msg(get-action(click, message-list, Modulename))
00075   . rec-msg(action(click, message-list, Modulename, Action?))
00076   . 
00077   (
00078     printf("Warning: process not found %s\n", Action)
00079   +>
00080     Action(Tree, Modulename)
00081   )
00082 endlet
00083 
00084 process NodeSelected(GraphId: str, Node: term) is
00085 let
00086   Action: str,
00087   Location: term
00088 in
00089   snd-msg(gc-get-node-origin(Node))
00090   .
00091   (
00092     rec-msg(gc-origin(Location?))
00093     . snd-msg(cm-get-action(tree-panel, click))
00094     . rec-msg(cm-action(Action?))
00095     .
00096     (
00097       printf("Warning: process not found %s\n", Action)
00098     +>
00099       Action("Tree Panel selection", Location)
00100     )
00101   +
00102     rec-msg(gc-no-origin)
00103   )
00104 endlet
00105 
00106 process UserInterfaceHandler is
00107 let
00108   Error: term,
00109   Event: term,
00110   GraphId: str,
00111   Modulename: str,
00112   Node: term,
00113   Pid: int,
00114   Tree: term,
00115   Type: term
00116 in
00117   (
00118     rec-msg(ui-button-selected(Type?, Event?))
00119     . create(HandleEvent(Type, Event), Pid?)
00120   +
00121     rec-msg(ui-location-selected(Error?))
00122     . create(LocationSelected(Error), Pid?)
00123   +
00124     rec-msg(ui-node-selected(GraphId?, Node?))
00125     . create(NodeSelected(GraphId, Node), Pid?)
00126   +
00127     rec-msg(ui-message-selected(Modulename?, Tree?))
00128     . create(MessageSelected(Modulename, Tree), Pid?)
00129   +
00130     rec-msg(gui-window-closing)
00131     . ExitAction
00132   )
00133   *
00134   delta
00135 endlet
00136 
00137 toolbus(UserInterfaceHandler)
00138 
00139 /* StatusDisplay should be removed. Errors should be handled by error-support */
00140 process StatusDisplay is
00141 let
00142   Lst: list,
00143   Str: str,
00144   Summary: summary
00145 in
00146   subscribe(ui-status(<term>))
00147   .
00148   (
00149     rec-note(ui-status(error(Str?)))
00150     . printf("TODO: Remove this process and use error-support or Display processes\n")
00151     . printf("Error: %s", Str)
00152   +
00153     rec-note(ui-status(errorf(Str?, Lst?)))
00154     . printf("TODO: Remove this process and use error-support or Display processes\n")
00155     . printf("Error: %s [%t]\n", Str, Lst)
00156   +
00157     rec-note(ui-status(messagef(Str?, Lst?)))
00158     . printf("TODO: Remove this process and use error-support or Display processes\n")
00159     . printf("Message: %s [%t]\n", Str, Lst)
00160   )
00161   *
00162   delta
00163 endlet
00164 
00165 toolbus(StatusDisplay)
00166 
00167 #endif /* __GUI_UTILS__ */

Generated on Fri Sep 12 13:08:53 2008 for meta by  doxygen 1.4.6