## generated-gui.api
## (C) 1996, 1998, Bremen Institute for Safe Systems, Universitaet Bremen
## Author: cxl (Last modification by $Author: 2cxl $)
# Compiled by:
#
src/lib/tk/src/toolkit/sources.sublib# **************************************************************************
#
# Api for the generic graphical user interface.
#
# Generated_GUI is the export api of generate_gui_g
#
# See <a href=file:../../doc/manual::html>the documentation</a> for more
# details. tests+examples/simpleinst.pkg contains a small example
# of how to use this package.
#
# $Date: 2001/03/30 13:39:42 $
# $Revision: 3.0 $
#
# **************************************************************************
### "Do what you love.
### It works. Trust me."
###
### -- George Burns
# Configuration for the gen_gui-- modfiying its visual appearance.
api Gen_Gui0_Conf {
# This is the width and height of the notepad area
width: Int;
height: Int;
# The background colour of the notepad and construction area
# moved to global_configuration !!! bu
# my background: tk::Color
# The font and the width of the box, in pixels,
# used to display the icons
icon_name_font: tk::Font;
icon_name_width: Int;
# if opaqueMove is TRUE, then the whole item will move if it
# is grabbed; ows. only change cursor to indicate an object is
# being moved.
move_opaque: Bool;
# The minimum distance between two objects' dropzones when placing
# new objects
delta: Int;
};
api Gen_Gui_Conf {
include api Gen_Gui0_Conf; # Gen_Gui0_Conf is from
src/lib/tk/src/toolkit/generated-gui.api # if oneWindow is TRUE, the construction area will appear as
# a widget within the lower part of the window (which will be
# large enough to hold it. Actually, this should be called _one
# widget_, since it means that both construction and assembly
# come within one frame); otherwise, the construction area
# will appear as a separate window
one_window: Bool;
# The height and width of the construction area, and the
# position of the window. The X/Y position and the caTitle options
# determine the placing and title of the construction area window,
# and only take effect if oneWindow is FALSE.
ca_height: Int;
ca_width: Int;
ca_xy: null_or::Null_Or ((Int, Int));
ca_title: String -> String;
# The icon used to display the trashcan, and its initial position
# NB. Can only construct tk icons at runtime
trashcan_icon: Void -> icons::Icon;
trashcan_coord: tk::Coordinate;
};
/*
Export api for the simple generic GUI.
*/
api Generated_Gui {
Part_Ilk;
New_Part;
# the state of the gui
Gui_State;
intro: New_Part -> Void;
# introduce (not "create" really) a new object into the
# manipulation area
elim: Part_Ilk -> Void;
# remove (not "delete" really) an (selected!) object from the
# manipulation area; causes *not* appl::delete
# The generate_gui_g main widget. You MUST use the init function below
# to initialize this widget. (Note generate_gui_g doesn't check this
# itself.)
main_wid: tk::Window_Id -> tk::Widget;
# In the following, init takes a gui_state and returns a function
# which has to be used as the init function of the main window,
# as it sets up the generate_gui_g.
#
# state returns the current gui_state suitable as an argument to init.
init: Gui_State -> Void;
# Call that as init action of main window
state: Void -> Gui_State;
# This is the initial state which only has those objects as given
# by the application's init() function (see above).
initial_state: Void -> Gui_State;
# Resynchronize all icons, e::g. if objects have changed their mode.
# (Unfortunately, we cinnae change icons of single objects, since
# we can't identify objects...)
redisplay_icons: (Part_Ilk -> Bool) -> Void;
exception GENERATE_GUI_FN String;
# something went wrong-- this execption indicates a
# critical error on part of the gen_gui. This may either
# be a genuine bug (although due to the state-of-the-art
# software technology used to implement gen_gui, this is un-
# likely), or wrong usage of GenGUI.
# The exception is critical in the sense that it's all right
# to just panic after it has been raised. Alternatively, catch
# it, ignore it and hope for the best.
# The clipboard is just reexported, to allow external components
# (e::g. the filer) to create objects.
Cb_Objects; # = (Void -> List( Part_Ilk ) ) ; # Sharing in SML97
# can be so tedious...
cb_objects_abs: (Void -> List( Part_Ilk ) ) -> Cb_Objects;
cb_objects_rep: Cb_Objects -> (Void -> List( Part_Ilk ) );
package clipboard: Clipboard; # Clipboard is from
src/lib/tk/src/toolkit/clipboard-g.pkg sharing clipboard::Part == Cb_Objects;
};
# generic generate_gui_g (package appl: Application ) :
# api
# include Generated_GUI
# sharing Part_Ilk = appl::Part_Ilk
# and type New_Part = appl::New_Part
# end
#
# = ?