Module: gtk-duim Synopsis: GTK help implementation Author: Andy Armstrong, Scott McKay 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 /// GTK help management /*---*** No help for now... ///---*** WHAT ON EARTH DO WE DO ABOUT THIS? define abstract open class () end class ; define sealed class () keyword name: = "GTK Help"; end class ; /// Frame Manager Help Systems define variable *default-help-system* :: false-or() = #f; define open generic frame-manager-help-system (framem :: ) => (system :: false-or()); define open generic frame-manager-help-system-setter (value :: false-or(), framem :: ) => (system :: false-or()); define sealed method frame-manager-help-system (framem :: ) => (system :: false-or()) *default-help-system* end method frame-manager-help-system; define sealed method frame-manager-help-system-setter (value :: false-or(), framem :: ) => (system :: false-or()) *default-help-system* := value end method frame-manager-help-system-setter; *default-help-system* := make(); /// Errors define class () end class; define class () keyword format-string: = "%s is not installed."; end class ; define method make (class == , #key system) => (condition :: ) next-method(class, format-arguments: vector(help-system-name(system))); end method make; /// Display Help define sealed method display-help (framem :: , frame :: , command :: ) => () block () let system = frame-manager-help-system(framem); let top-sheet = top-level-sheet(frame); when (top-sheet) do-display-help(system, window-handle(top-sheet), help-path(system, command), help-id(system, command), help-data(system, command)); end; exception (condition :: ) notify-user(format-to-string("%s", condition), owner: frame); end block; end method display-help; /// Do Display Help define sealed method do-display-help (system :: , handle, path, id, data) => () //---*** What should this do? end method do-display-help; /// Help Path define sealed method help-path (system :: , command :: ) => (path :: ) "" end method help-path; define sealed method help-path (system :: , command :: ) => (path :: ) let path = as(, help-source-locator(help-source(command))); let path-window = unless (any?(curry(\=, '>'), path)) help-path-window(system, command, path) end unless; if (path-window) concatenate(path, ">", path-window) else path end end method help-path; /// Help Path Window define sealed method help-path-window (system :: , command :: , path :: ) => (window :: ) help-secondary-window(command) | path end method help-path-window; /// Help ID (HtmlHelp) define sealed method help-id (system :: , command :: ) => (id :: ) $HH-DISPLAY-TOPIC end method help-id; define sealed method help-id (system :: , command :: ) => (id :: ) $HH-DISPLAY-TOPIC end method help-id; define sealed method help-id (system :: , command :: ) => (id :: ) $HH-DISPLAY-TOPIC end method help-id; define sealed method help-id (system :: , command :: ) => (id :: ) $HH-HELP-CONTEXT end method help-id; define sealed method help-id (system :: , command :: ) => (id :: ) $HH-KEYWORD-LOOKUP end method help-id; /// Help Data define sealed method help-data (system :: , command :: ) => (data :: ) 0 end method help-data; define sealed method help-data (system :: , command :: ) => (data :: ) help-topic-id(command) end method help-data; define sealed method help-data (system :: , command :: ) => (data :: ) pointer-address(as(, help-keyword(command))) end method help-data; define sealed method help-data (system :: , command :: ) => (data :: ) pointer-address(as(, help-macro(command))) end method help-data; /*---*** This won't work yet! define sealed method help-data (system :: , command :: ) => (data :: ) let region = help-window-region(command); let (left, top, right, bottom) = box-edges(region); let info = make(, x: left, y: top, dx: right - left, dy: bottom - top, wMax: $SW-SHOWNA); info end method help-data; */ */