home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Programming / MR_Classes / Dev / Docs / supermodel_class.doc < prev    next >
Encoding:
Text File  |  2000-08-04  |  11.3 KB  |  525 lines

  1. TABLE OF CONTENTS
  2.  
  3. extras.lib/SM_IsMemberOf
  4. supermodel.class/--datasheet--
  5. supermodel.class/--datasheet-GlueFunc--
  6. supermodel.class/--datasheet-supericclass--
  7. supermodel.class/History
  8. supermodel.class/ProcessTagList
  9. supermodel.class/SM_NewSuperIC
  10. supermodel.class/SM_NewSuperModel
  11. supermodel.class/SM_SendGlueAttrs
  12. supermodel.class/SMTAG_AddTag
  13. supermodel.class/SMTAG_AddTags
  14. supermodel.class/SMTAG_AllocTags
  15. supermodel.class/SMTAG_ClearNumTags
  16. supermodel.class/SMTAG_ClearTags
  17. supermodel.class/SMTAG_FreeTags
  18. supermodel.class/SMTAG_RemTag
  19. supermodel.class/SMTAG_TagDone
  20. supermodel.class/SMTAG_TagMore
  21. extras.lib/SM_IsMemberOf                             extras.lib/SM_IsMemberOf
  22.  
  23.    NAME
  24.        extras.lib/SM_IsMemberOf -- Check if Object belongs to a Class
  25.  
  26.    SYNOPSIS
  27.        memberof = SM_IsMemberOf(Object, ClassPtr, ClassID)
  28.  
  29.        BOOL SM_IsMemberOf(Object *, Class *, STRPTR);
  30.  
  31.    FUNCTION
  32.  
  33.  
  34.    INPUTS
  35.  
  36.    RESULT
  37.  
  38.    EXAMPLE
  39.  
  40.    NOTES
  41.          Stolen from someone...
  42.           
  43.          Here's some IsMemberOf() code I whipped up quickly.  Might be nice i
  44. f we all
  45.          posted useful little BOOPSI snippets like this... maybe even collect
  46. ed them
  47.          together on a web site.  (I volunteer NOT to maintain this site :)
  48.  
  49.    BUGS
  50.  
  51.    SEE ALSO
  52.  
  53. supermodel.class/--datasheet--                 supermodel.class/--datasheet--
  54.  
  55.    NAME
  56.        supermodel.class -- Model and IC class
  57.  
  58.    SUPERCLASS
  59.        modelclass
  60.  
  61.    DESCRIPTION
  62.        
  63.  
  64.    METHODS
  65.        
  66.  
  67.    ATTRIBUTES
  68.        ICA_ attributes supported.
  69.        SMA_AddMember - calls OM_ADDMEMBER
  70.        SMA_RemMember - calls OM_REMMEMBER
  71.        SMA_GlueFunc - Glue code, does tag mapping, etc.  See example.
  72.            see --datasheet-GlueFunc--
  73.        SMA_GlueFuncA6 - If your glue code is in a library, set this to
  74.            your Library base.
  75.        SMA_GlueFuncUserData - 
  76.        SMA_CacheStringTag - cache string data
  77.  
  78.    NOTES
  79.  
  80.    BUGS
  81.  
  82.    SEE ALSO
  83.  
  84. supermodel.class/--datasheet-GlueFunc--upermodel.class/--datasheet-GlueFunc--
  85.  
  86.    NAME
  87.        GlueFunc
  88.  
  89.    SYNOPSIS
  90.        rv GlueFunc(GlueData, TagList, [userdata], [a6])
  91.        d0          a0        a1       a2          a6
  92.        
  93.        ULONG GlueFunc(struct smGlueData *, struct TagItem *, APTR, APTR);
  94.  
  95.    FUNCTION
  96.        GlueFunc is a function you provide to modify a tag list before
  97.        being sent to the members and ICA_TARGET of the modelclass.
  98.  
  99.        You may modify TagList and use the SMTAG_functions to modify 
  100.        TagList, however, don't free TagList.
  101.        
  102.        Call SM_SendGlueAttrsA() to send your new attributes back to the
  103.        model class for notifiaction.
  104.  
  105.    NOTES
  106.        There is room for 50 tags in TagList
  107.  
  108.    BUGS
  109.  
  110.    SEE ALSO
  111.  
  112. supermodel.class/--datasheet-supericclass--l.class/--datasheet-supericclass--
  113.  
  114.    NAME
  115.        supermodel.class -- IC class
  116.  
  117.    SUPERCLASS
  118.        icclass
  119.  
  120.    DESCRIPTION
  121.        
  122.  
  123.    METHODS
  124.        
  125.  
  126.    ATTRIBUTES
  127.        ICA_ attributes supported.
  128.        ICA_TARGET - targeted object.
  129.        ICA_MAP - MapList.
  130.        SICA_Model - Model object pointer, set by model object.
  131.  
  132.        SICA_InMap - TagMap, maps tags sent from Model object to Target object
  133. .
  134.        SICA_OutMap - TagMap, maps tags sent from Target object to Model.
  135.            Both must be allocated with CloneTagItems(), and are given to the
  136.            ic objects
  137.  
  138.    NOTES
  139.  
  140.    BUGS
  141.  
  142.    SEE ALSO
  143.  
  144. supermodel.class/History                             supermodel.class/History
  145.  
  146.    To Do
  147.  
  148.    44.1 -
  149.        * GlueCode was freeing memory twice.
  150.        * Added SMA_CacheStringTag - Anytime this tag is passed through
  151.          the model class, the string supplied is cached, and ti_Data
  152.          is updated to point to the cache.
  153.  
  154. supermodel.class/ProcessTagList               supermodel.class/ProcessTagList
  155.  
  156.    NAME
  157.        ProcessTagList -- Macro to process a taglist
  158.  
  159.    SYNOPSIS
  160.        ProcessTagList(TagList, Tag, TState)
  161.  
  162.        TState=TagList; 
  163.        while(Tag=NextTagItem(&TState))
  164.  
  165.    EXAMPLE
  166.        void SomeFunc(struct TagItem *TagList)
  167.        {
  168.          struct TagItem *tag, *tstate;
  169.  
  170.          ProcessTagList(TagList,tag,tstate)
  171.          {
  172.            seitch(tag->ti_Tag)
  173.            {
  174.              case GA_Left:
  175.                ...
  176.                break;
  177.              etc...
  178.            }
  179.          }
  180.        }
  181.  
  182. supermodel.class/SM_NewSuperIC                 supermodel.class/SM_NewSuperIC
  183.  
  184.    NAME
  185.        SM_NewSuperIC -- Allocare SuperIC object
  186.  
  187.    SYNOPSIS
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.    FUNCTION
  195.  
  196.  
  197.    INPUTS
  198.  
  199.    RESULT
  200.  
  201.    EXAMPLE
  202.  
  203.    NOTES
  204.  
  205.    BUGS
  206.  
  207.    SEE ALSO
  208.  
  209. supermodel.class/SM_NewSuperModel           supermodel.class/SM_NewSuperModel
  210.  
  211.    NAME
  212.        SM_NewSuperModel -- Allocate SuperModel object
  213.  
  214.    SYNOPSIS
  215.        model = SM_NewSuperModel( Tag1, Data1, TAg2, ...)
  216.  
  217.        Object *SM_NewSuperModel(Tag Tags, ...);
  218.  
  219.    FUNCTION
  220.        Allocate model object.
  221.  
  222.    INPUTS
  223.        Tags
  224.  
  225.    RESULT
  226.  
  227.    EXAMPLE
  228.  
  229.    NOTES
  230.        DisposeObject() returned model when done.
  231.  
  232.        Before targeted objects (ie gadgets) are freed you must either:
  233.        1. Dispose() the SuperModel object, which also Dispose()s all
  234.            SuperIC objects.
  235.        2. SetAttr() ICA_TARGET to NULL on every SuperIC object.
  236.        SuperIC objects need to clear the ICA_MAP and ICA_TARGET settings 
  237.        of it's targetted object.  If the target object nolonger exists,
  238.        expect bad things to happen.
  239.  
  240.    BUGS
  241.  
  242.    SEE ALSO
  243.  
  244. supermodel.class/SM_SendGlueAttrs           supermodel.class/SM_SendGlueAttrs
  245.  
  246.    NAME
  247.        SM_SendGlueAttrs -- Send attributes from GlueFunc (SMA_GlueFunc)
  248.  
  249.    SYNOPSIS
  250.        unknown = SM_SendGlueAttrs(GlueData, TagList)
  251.        d0                         a0        a1
  252.  
  253.        ULONG SM_SendGlueAttrs(struct smGlueData *, struct TagItem *);
  254.  
  255.    FUNCTION
  256.        This function sends TagList back to the modelclass for notification
  257.        of other objects.
  258.  
  259.        ONLY to be called from inside a GlueFunction.
  260.  
  261.    INPUTS
  262.        GlueData - 
  263.        TagList -
  264.  
  265.    RESULT
  266.  
  267.    EXAMPLE
  268.  
  269.    NOTES
  270.  
  271.    BUGS
  272.  
  273.    SEE ALSO
  274.  
  275. supermodel.class/SMTAG_AddTag                   supermodel.class/SMTAG_AddTag
  276.  
  277.    NAME
  278.        SMTAG_AddTag -- Add a tag toa taglist.
  279.  
  280.    SYNOPSIS
  281.        ok = SMTAG_AddTag(TagList, Tag, Data)
  282.  
  283.        BOOL SMTAG_AddTag(struct TagItem *, ULONG, ULONG);
  284.  
  285.    FUNCTION
  286.        Add a tag pair to a taglist created with SMTAG_AllocTags()
  287.  
  288.    INPUTS
  289.        TagList - TagList created with SMTAG_AllocTags()
  290.        Tag - ti_Tag value
  291.        Data - ti_Data value
  292.  
  293.    RESULT
  294.        non zero if the tag was added.
  295.        failure can be due to under sized taglist.
  296.  
  297.    EXAMPLE
  298.        see SMTAG_AllocTags()
  299.  
  300.    NOTES
  301.        Don't SMTAG_AddTag TAG_IGNORE, TAG_DONE, TAG_MORE, TAG_SKIP.
  302.        This function will only effect the specified TagList, and 
  303.        not any other lists referenced by TAG_MORE.
  304.        This function overwrites existing same tags.
  305.  
  306.    SEE ALSO
  307.        SMTAG_AllocTags()
  308.  
  309. supermodel.class/SMTAG_AddTags                 supermodel.class/SMTAG_AddTags
  310.  
  311.    NAME
  312.        SMTAG_AddTags -- Add a taglist to a taglist.
  313.  
  314.    SYNOPSIS
  315.        ok = SMTAG_AddTags(TagList, Tag, Data)
  316.  
  317.        BOOL SMTAG_AddTags(struct TagItem *, ULONG, ULONG);
  318.  
  319.    FUNCTION
  320.        Add a taglist to a taglist created with SMTAG_AllocTags()
  321.  
  322.    INPUTS
  323.        TagList - TagList created with SMTAG_AllocTags()
  324.        NewTags - Tags to add to TagList
  325.  
  326.    RESULT
  327.        non zero if the tag was added.
  328.        failure can be due to under sized taglist.
  329.  
  330.    EXAMPLE
  331.        see SMTAG_AllocTags()
  332.  
  333.    NOTES
  334.        This function will only effect the specified TagList, and 
  335.        not any other lists referenced by TAG_MORE.
  336.        This function overwrites existing same tags.
  337.  
  338.    SEE ALSO
  339.        SMTAG_AllocTags()
  340.  
  341. supermodel.class/SMTAG_AllocTags             supermodel.class/SMTAG_AllocTags
  342.  
  343.    NAME
  344.        SMTAG_AllocTags -- Allocate blank Tag List
  345.  
  346.    SYNOPSIS
  347.        taglist = SMTAG_AllocTags(TagCount)
  348.  
  349.        struct TagItem *SMTAG_AllocTags(ULONG);
  350.  
  351.    FUNCTION
  352.        Allocate tag space for use with other SMTAG_? functions.
  353.  
  354.    INPUTS
  355.        TagCount - Number of blank tags to allocate.
  356.  
  357.    RESULT
  358.        An empty tag space ending with TAG_DONE, or NULL.
  359.  
  360.    EXAMPLE
  361.  
  362.    NOTES
  363.  
  364.    BUGS
  365.  
  366.    SEE ALSO
  367.  
  368. supermodel.class/SMTAG_ClearNumTags       supermodel.class/SMTAG_ClearNumTags
  369.  
  370.    NAME
  371.        SMTAG_ClearTags -- Clear a TagList
  372.  
  373.    SYNOPSIS
  374.        void SMTAG_ClearTags(TagList, TagCount)
  375.  
  376.        SMTAG_ClearTags(struct TagItem *, ULONG);
  377.  
  378.    FUNCTION
  379.        Clears the TagList of all data.
  380.  
  381.    INPUTS
  382.        TagList - Allocated with SMTAG_AllocTags()
  383.        TagCount - Number of blank tags to allocate.
  384.  
  385.    EXAMPLE
  386.        see SMTAG_AllocTags()
  387.  
  388.    NOTES
  389.        This function is called by SMTAG_AllocTags(), so
  390.        the taglist is cleared when allocated.
  391.        This function will only effect the specified TagList, and 
  392.        not any other lists referenced by TAG_MORE.
  393.  
  394.    BUGS
  395.  
  396.    SEE ALSO
  397.        see SMTAG_AllocTags()
  398.  
  399. supermodel.class/SMTAG_ClearTags             supermodel.class/SMTAG_ClearTags
  400.  
  401.    NAME
  402.        SMTAG_ClearTags -- Clear a TagList
  403.  
  404.    SYNOPSIS
  405.        void SMTAG_ClearTags(TagList)
  406.  
  407.        SMTAG_ClearTags(struct TagItem *);
  408.  
  409.    FUNCTION
  410.        Clears the TagList of all data.
  411.  
  412.    INPUTS
  413.        TagList - Allocated with SMTAG_AllocTags()
  414.  
  415.    EXAMPLE
  416.        see SMTAG_AllocTags()
  417.  
  418.    NOTES
  419.        This function will only effect the specified TagList, and 
  420.        not any other lists referenced by TAG_MORE.
  421.  
  422.    BUGS
  423.  
  424.    SEE ALSO
  425.        see SMTAG_AllocTags()
  426.  
  427. supermodel.class/SMTAG_FreeTags               supermodel.class/SMTAG_FreeTags
  428.  
  429.    NAME
  430.        SMTAG_FreeTags -- Clear a TagList
  431.  
  432.    SYNOPSIS
  433.        void SMTAG_FreeTags(TagList)
  434.  
  435.        SMTAG_FreeTags(struct TagItem *);
  436.  
  437.    FUNCTION
  438.        Frees the TagList.
  439.  
  440.    INPUTS
  441.        TagList - Allocated with SMTAG_AllocTags().
  442.  
  443.    EXAMPLE
  444.        see SMTAG_AllocTags()
  445.  
  446.    SEE ALSO
  447.        see SMTAG_AllocTags()
  448.  
  449. supermodel.class/SMTAG_RemTag                   supermodel.class/SMTAG_RemTag
  450.  
  451.    NAME
  452.        SMTAG_RemTag -- Removea a tag to a taglist.
  453.  
  454.    SYNOPSIS
  455.        ok = SMTAG_RemTag(TagList, Tag)
  456.  
  457.        BOOL SMTAG_RemTag(struct TagItem *, ULONG);
  458.  
  459.    FUNCTION
  460.        Find and remove a tag from a taglist.
  461.  
  462.    INPUTS
  463.        TagList - TagList created with SMTAG_AllocTags()
  464.        Tag - ti_Tag value
  465.  
  466.    RESULT
  467.        non zero if the tag was found and removed.
  468.  
  469.    EXAMPLE
  470.        see SMTAG_AllocTags()
  471.  
  472.    NOTES
  473.        Don't SMTAG_AddTag TAG_IGNORE, TAG_DONE, TAG_MORE, TAG_SKIP.
  474.        This function will only effect the specified TagList, and 
  475.        not any other lists referenced by TAG_MORE.
  476.  
  477.    SEE ALSO
  478.        SMTAG_AllocTags()
  479.  
  480. supermodel.class/SMTAG_TagDone                 supermodel.class/SMTAG_TagDone
  481.  
  482.    NAME
  483.        SMTAG_TagDone -- End the TagList with TagDone
  484.  
  485.    SYNOPSIS
  486.        void SMTAG_FreeTags(TagList)
  487.  
  488.        SMTAG_FreeTags(struct TagItem *);
  489.  
  490.    FUNCTION
  491.        Ends the taglist with TAG_MORE and link the list to MoreTags
  492.  
  493.    INPUTS
  494.        TagList - Allocated with SMTAG_AllocTags().
  495.  
  496.    EXAMPLE
  497.        see SMTAG_AllocTags()
  498.  
  499.    SEE ALSO
  500.        see SMTAG_AllocTags()
  501.  
  502. supermodel.class/SMTAG_TagMore                 supermodel.class/SMTAG_TagMore
  503.  
  504.    NAME
  505.        SMTAG_TagMore -- End the TagList with TagMore
  506.  
  507.    SYNOPSIS
  508.        void SMTAG_FreeTags(TagList, MoreTags)
  509.  
  510.        SMTAG_FreeTags(struct TagItem *, struct TagItem *);
  511.  
  512.    FUNCTION
  513.        Ends the taglist with TAG_MORE and link the list to MoreTags
  514.  
  515.    INPUTS
  516.        TagList - Allocated with SMTAG_AllocTags().
  517.        MoreTags - Tags to link
  518.  
  519.    EXAMPLE
  520.        see SMTAG_AllocTags()
  521.  
  522.    SEE ALSO
  523.        see SMTAG_AllocTags()
  524.  
  525.