Module: environment-tools Synopsis: Environment Tools Author: Andy Armstrong, Chris Page Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Image constants //---*** hughg, 1998/11/02: This one really belongs in DUIM, but andrewa // agrees this'll do for now (for the playground dialog). define variable $check-bitmap :: = "X"; define variable $splash-screen-bitmap :: = #f; define variable $about-box-bitmap :: = #f; define variable $product-large-bitmap :: = #f; define variable $tutorial-large-bitmap :: = "Tutorial Icon"; define variable $examples-large-bitmap :: = "Examples Icon"; define variable $playground-large-bitmap :: = "Playground Icon"; define variable $dylan-file-large-bitmap :: = "Dylan Icon"; define variable $project-file-large-bitmap :: = "Project Icon"; define variable $text-file-large-bitmap :: = "Text Icon"; define variable $open-large-bitmap :: = "Open Icon"; define variable $application-bitmap :: = #f; define variable $class-bitmap :: = #f; define variable $constant-bitmap :: = #f; define variable $default-bitmap :: = #f; define variable $definition-bitmap :: = #f; define variable $dylan-file-bitmap :: = #f; define variable $canonical-source-bitmap :: = #f; define variable $current-source-bitmap :: = #f; define variable $error-bitmap :: = #f; define variable $foreign-bitmap :: = #f; define variable $function-bitmap :: = #f; define variable $generic-bitmap :: = #f; define variable $library-bitmap :: = #f; define variable $macro-bitmap :: = #f; define variable $method-bitmap :: = #f; define variable $module-bitmap :: = #f; define variable $object-bitmap :: = #f; define variable $project-bitmap :: = #f; define variable $restart-bitmap :: = #f; define variable $serious-warning-bitmap :: = #f; define variable $slot-bitmap :: = #f; define variable $stack-frame-bitmap :: = #f; define variable $text-file-bitmap :: = #f; define variable $threads-bitmap :: = #f; define variable $unbound-bitmap :: = #f; define variable $variable-bitmap :: = #f; define variable $warning-bitmap :: = #f; define variable $clients-folder-bitmap :: = #f; define variable $uses-folder-bitmap :: = #f; define variable $main-window-small-icon :: = #f; define variable $project-window-small-icon :: = #f; define variable $browser-window-small-icon :: = #f; define variable $editor-window-small-icon :: = #f; define variable $debugger-window-small-icon :: = #f; define variable $describer-window-small-icon :: = #f; define variable $find-window-small-icon :: = #f; /// environment-object-icon /// /// NB these functions deal with environment objects in a loose sense: /// objects visible in the environment. That is not just objects of type /// . define open generic environment-object-icon (project :: , object :: ); define method environment-object-icon (project :: , object :: ) values(environment-object-small-icon(project, object), environment-object-large-icon(project, object)) end method environment-object-icon; /// Large icons define open generic environment-object-large-icon (project :: , object :: ); define method environment-object-large-icon (project :: , object :: ) #f end method environment-object-large-icon; /// Small icons define open generic environment-object-small-icon (project :: , object :: ); define method environment-object-small-icon (project :: , object :: ) $default-bitmap end method environment-object-small-icon; define method environment-object-small-icon (project :: , sr :: ) environment-object-small-icon(project, source-record-location(sr)); end method environment-object-small-icon; define method environment-object-small-icon (project :: , loc :: ) $definition-bitmap // ---*** $range-source-location-bitmap end method environment-object-small-icon; define method environment-object-small-icon (project :: , obj :: ) select (obj by instance?) => $application-bitmap; => $error-bitmap; => $class-bitmap; => $class-bitmap; => $class-bitmap; => $foreign-bitmap; => $function-bitmap; => $generic-bitmap; => $macro-bitmap; => $module-bitmap; => $library-bitmap; => $project-bitmap; => $slot-bitmap; => $restart-bitmap; => $unbound-bitmap; => $constant-bitmap; => $variable-bitmap; => $definition-bitmap; otherwise => $object-bitmap; end end method environment-object-small-icon; define method environment-object-small-icon (project :: , object :: ) $method-bitmap /*---*** andrewa: this might be interesting, really we need a method-kind protocol if (method-generic-function(project, object)) $method-bitmap else $function-bitmap end */ end method environment-object-small-icon; define method environment-object-small-icon (project :: , name :: ) let object = name-value(project, name); if (object) environment-object-small-icon(project, object) else next-method() end end method environment-object-small-icon; define method environment-object-small-icon (project :: , obj :: ) select (obj by instance?) => $error-bitmap; => $serious-warning-bitmap; => $serious-warning-bitmap; otherwise => $warning-bitmap; end end method environment-object-small-icon; define method environment-object-small-icon (project :: , object :: ) $threads-bitmap end method environment-object-small-icon; define method environment-object-small-icon (project :: , object :: ) let type = stack-frame-type(project, object); select (type) #"dylan-call" => let function = stack-frame-function(project, object); if (function) environment-object-small-icon(project, function); else $stack-frame-bitmap; end if; #"foreign-call" => $stack-frame-bitmap; // ---*** $foreign-function-bitmap #"cleanup" => $stack-frame-bitmap; // ---*** $cleanup-stack-frame-bitmap #"unknown" => $stack-frame-bitmap; // ---*** $unknown-stack-frame-bitmap end select; end method environment-object-small-icon; define method environment-object-small-icon (project :: , breakpoint :: ) case ~breakpoint => $potential-breakpoint-image; breakpoint.breakpoint-current? => $current-location-image; breakpoint.breakpoint-profile? => $profile-point-image; breakpoint.breakpoint-transient? => $step-breakpoint-image; breakpoint.breakpoint-stop? => if (breakpoint-enabled?(breakpoint)) $enabled-breakpoint-image else $disabled-breakpoint-image end; breakpoint.breakpoint-message? => if (breakpoint-enabled?(breakpoint)) $enabled-tracepoint-image else $disabled-tracepoint-image end; otherwise => $potential-breakpoint-image; end end method environment-object-small-icon;