7.2 Relationships Between Sheets

  • 7.2.1 Sheet Relationship Functions
  • 7.2.2 Sheet Genealogy Classes
  • Sheets are arranged in a tree-structured, acyclic, top-down hierarchy. Thus, in general, a sheet has one parent (or no parent) and zero or more children. A sheet may have zero or more siblings (that is, other sheets that share the same parent). In order to describe the relationships between sheets, we need to define some terms. [annotate]

    Adopted
    A sheet is said to be adopted if it has a parent. A sheet becomes the parent of another sheet by adopting that sheet. [annotate]
    Disowned
    A sheet is said to be disowned if it does not have a parent. A sheet ceases to be a child of another sheet by being disowned. [annotate]
    Grafted
    A sheet is said to be grafted when it is part of a sheet hierarchy whose highest ancestor is a graft. In this case, the sheet may be visible on a particular window server. [annotate]
    Degrafted
    A sheet is said to be degrafted when it is part of a sheet hierarchy that cannot possibly be visible on a server, that is, the highest ancestor is not a graft. [annotate]
    Enabled
    A sheet is said to be enabled when it is actively participating in the windowing relationship with its parent. If a sheet is enabled and grafted, and all its ancestors are enabled (they are grafted by definition), then the sheet will be visible if it occupies a portion of the graft region that isn't clipped by its ancestors or ancestor's siblings. [annotate]
    Disabled
    The opposite of enabled is disabled. [annotate]

    7.2.1 Sheet Relationship Functions

    The generic functions in this section comprise the sheet protocol. All sheet objects must implement or inherit methods for each of these generic functions. [annotate]

    sheet-parent  sheet [Generic Function]
              

    Returns the parent of the sheet sheet, or nil if the sheet has no parent. [annotate]

    [annotate]

    sheet-children  sheet [Generic Function]
              

    Returns a list of sheets that are the children of the sheet sheet. Some sheet classes support only a single child; in this case, the result of sheet-children will be a list of one element. This function returns objects that reveal CLIM's internal state; do not modify those objects. [annotate]

    [annotate]

    sheet-adopt-child  sheet child [Generic Function]
              

    Adds the child sheet child to the set of children of the sheet sheet, and makes the sheet the child's parent. If child already has a parent, the sheet-already-has-parent error will be signalled. [annotate]

    Some sheet classes support only a single child. For such sheets, attempting to adopt more than a single child will cause the sheet-supports-only-one-child error to be signalled. [annotate]

    [annotate]

    Note: What should sheet-adopt-child return? The adopted child? All of the sheets children? no values? [edit]-- Cyrus Harmon 2018-08-26 18:37Z
     

    sheet-disown-child  sheet child &key (errorp t) [Generic Function]
              

    Removes the child sheet child from the set of children of the sheet sheet, and makes the parent of the child be nil. If child is not actually a child of sheet and errorp is true, then the sheet-is-not-child error will be signalled. [annotate]

    [annotate]

    sheet-siblings  sheet [Generic Function]
              

    Returns a list of all of the siblings of the sheet sheet. The sibling are all of the children of sheet's parent excluding sheet itself. This function returns fresh objects that may be modified. [annotate]

    [annotate]

    sheet-enabled-children  sheet [Generic Function]
              

    Returns a list of those children of the sheet sheet that are enabled. This function returns fresh objects that may be modified. [annotate]

    [annotate]

    sheet-ancestor-p  sheet putative-ancestor [Generic Function]
              

    Returns true if the the sheet putative-ancestor is in fact an ancestor of the sheet sheet, otherwise returns false. [annotate]

    [annotate]

    raise-sheet  sheet [Generic Function]
    bury-sheet  sheet [Generic Function]
              

    These functions reorder the children of a sheet by raising the sheet sheet to the top or burying it at the bottom. Raising a sheet puts it at the beginning of the ordering; burying it puts it at the end. If sheets overlap, the one that appears "on top" on the display device is earlier in the ordering than the one underneath. [annotate]

    This may change which parts of which sheets are visible on the display device. [annotate]

    [annotate]

    Note: Maybe we should have these as vanilla functions calling reorder-sheets. [edit]-- Gilbert Baumann 2004-11-20 23:52Z
     

    reorder-sheets  sheet new-ordering [Generic Function]
              

    Reorders the children of the sheet sheet to have the new ordering specified by new-ordering. new-ordering is an ordered list of the child sheets; elements at the front of new-ordering are "on top" of elements at the rear. [annotate]

    If new-ordering does not contain all of the children of sheet, the sheet-ordering-underspecified error will be signalled. If new-ordering contains a sheet that is not a child of sheet, the sheet-is-not-child error will be signalled. [annotate]

    [annotate]

    Note:

    An note-children-reordered generic function would be nice to have for some layout panes, which want react on the order changed by re-arranging the position of the children.

    Though I really don't know if that is the correct way. Also see the note to raise-sheet and bury-sheet

    [edit]-- Gilbert Baumann 2004-11-20 23:55Z
     

    sheet-enabled-p  sheet [Generic Function]
              

    Returns true if the the sheet sheet is enabled by its parent, otherwise returns false. Note that all of a sheet's ancestors must be enabled before the sheet is viewable. [annotate]

    [annotate]

    (setf sheet-enabled-p)  enabled-p sheet [Generic Function]
              

    When enabled-p is true, this enables the the sheet sheet. When enabled-p is false, this disables the sheet. [annotate]

    Note that a sheet is not visible unless it and all of its ancestors are enabled. [annotate]

    [annotate]

    sheet-viewable-p  sheet [Generic Function]
              

    Returns true if the sheet sheet and all its ancestors are enabled, and if one of its ancestors is a graft. See Chapter 9 for further information. [annotate]

    [annotate]

    sheet-occluding-sheets  sheet child [Generic Function]
              

    Returns a list of the sheet child's siblings that occlude part or all of the region of the child. In general, these are the siblings that are enabled and appear earlier in the sheet sheet's children. If sheet does not permit overlapping among its children, sheet-occluding-sheets will return nil. [annotate]

    This function returns fresh objects that may be modified. [annotate]

    [annotate]

    map-over-sheets  function sheet [Generic Function]
              

    Applies the function function to the sheet sheet, and then applies function to all of the descendents (the children, the children's children, and so forth) of sheet. [annotate]

    Function is a function of one argument, the sheet; it has dynamic extent. [annotate]

    [annotate]

    7.2.2 Sheet Genealogy Classes

    Different "mixin" classes are provided that implement the relationship protocol. None of the four following classes is instantiable. [annotate]

    sheet-parent-mixin   [Class]
              

    This class is mixed into sheet classes that have a parent. [annotate]

    [annotate]

    sheet-leaf-mixin   [Class]
              

    This class is mixed into sheet classes that will never have children. [annotate]

    [annotate]

    sheet-single-child-mixin   [Class]
              

    This class is mixed into sheet classes that have at most a single child. [annotate]

    [annotate]

    sheet-multiple-child-mixin   [Class]
              

    This class is mixed into sheet classes that may have zero or more children. [annotate]

    [annotate]