english
version "1.0"
identify "wxyz"

# Copyright (c) 1998 by Wayne C. Gramlich.
# All rights reserved.
#
# Permission to use, copy, modify, distribute, and sell this software
# for any purpose is hereby granted without fee provided that the above
# copyright notice and this permission are retained.  The author makes
# no representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.

module swit_item

#: This module support items in a SWIT canvas.


#: {item} procedures:

procedure canvas_get@item
    takes
	item item
    returns canvas

    #: This procedure will create and return the {canvas} parent for {item}.


procedure children_increment@item
    takes
	item item
    returns_nothing

    #: This procedure will increment the modification count of all
    #, the children nodes.  It does not increment the parents
    #, {item_group}'s.


procedure clone@item
    takes
	master_item item
	parent item_group
	uid unsigned
    returns item

    #: This procedure will create and return a clone of {master_item}
    #, as a member of {parent} with a unique identifier of {uid}.


procedure create@item1[additional]
    routine_types
	procedure additional_set
	    takes item_additional, additional
	    returns_nothing
    takes
	additional additional
	additional_set additional_set
	parent item_group
	uid unsigned
    returns item

    #: This procedure will create and return an initialized {item} object
    #, contains {additiona}.  The parent group is {parent}.  {additional_set}
    #, is used to store {additional} into {item}.  If {uid} is 0, a new
    #, unique identifier is allocated; otherwise, {uid} is used for the
    #, returned item's unique identifier.


procedure destroy@item
    takes
	item item
    returns_nothing

    #: This procedure will destroy {item}.

    #format@format1[address](debug_stream,
    #  "destroy@item(0x%x%) returns\n\", item.address)



procedure increment@item
    takes
	item item
    returns_nothing

    #: This procedure will increment the modification count for {item}
    #, and its parents.


procedure item_insert@item
    takes
	item item
    returns_nothing

    #: This procedure will insert {item} into the application table.


procedure level_get@item
    takes
	item item
    returns unsigned

    #: This procedure will return the modification count for {item}.


procedure level_set@item
    takes
	item item
	new_level unsigned
    returns_nothing

    #: This procedure will set the level of {item} to {new_level}.


procedure level_insert@item
    takes
	item item
    returns_nothing

    #: This procedure will insert {item}.{uid} onto the appropriate
    #, {item_level} list.


procedure level_update@item
    takes
	master_item item
	clone_item item
    returns_nothing

    #: This procedure will cause the levels in {clone_item} to become updated
    #, with respect to {clone_item}.


procedure tag_append@item
    takes
	item item
	tag string
    returns_nothing

    #: This procedure will at {tag} to the tag list of {item}.


procedure tags_update@item
    takes
	master_item item
	clone_item item
    returns_nothing

    #: This procedure will force the {clone_tags} to contain the same
    #, tags as {master_tags} using {parent} and {uid}.  If there are
    #, any differences, the appropriate Tcl/Tk command.



procedure update@item
    takes
	master_item item
	clone_item item
    returns_nothing

    #: This procedure will cause {clone_item} to become updated
    #, with respect to {clone_item}.


procedure x_get@item
    takes
	item item
    returns integer

    #: This procedure will return the relative X coordinate of {item}.


procedure x_set@item
    takes
	item item
	x integer
    returns_nothing

    #: This procedure will set the relative X coordinate of {item} to {x}.


procedure y_get@item
    takes
	item item
    returns integer

    #: This procedure will return the relative Y coordinate of {item}.


procedure y_set@item
    takes
	item item
	y integer
    returns_nothing

    #: This procedure will set the relative Y coordinate of {item} to {y}.