home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / NewDocs / baseobject_funcs.doc < prev    next >
Encoding:
Text File  |  1995-01-13  |  16.0 KB  |  499 lines

  1.  
  2. Base Object Class Functions: from the include files
  3.  
  4. PObject.h
  5. ===========
  6. Name:           CleanUp( self )
  7. Syntax:         void CleanUp( self );
  8.                 |struct PObject *self;
  9.  
  10. Description:    release any special resources allocated by PObject
  11.  
  12.  
  13. Name:           PObject_Init( self )
  14. Syntax:         void PObject_Init( self );
  15.                 |struct PObject *self;
  16.  
  17. Description:    initialize a PObject structure
  18.  
  19.  
  20. Name:           ClassName( self )
  21. Syntax:         name = ClassName( self );
  22.                 | const char *name;
  23.                 | struct PObject *self;
  24.  
  25. Description:    returns the name of the class to which object belongs
  26.  
  27.  
  28. Name:           isa( self, class )
  29. Syntax:         return = isa( self, class );
  30.                 | BOOL return;
  31.                 | const PObject *self;
  32.                 | const PClass *class
  33.  
  34. Description:    returns TRUE if 'self' is an instance of type 'class'
  35.  
  36.  
  37. Name:           SetObjectName( self, name )
  38. Syntax:         void SetObjectName( self, name );
  39.                 | struct PObject *self;
  40.                 | char *name;
  41.  
  42. Description:    used to set the name of a PObject
  43.  
  44.  
  45. GraphicObject.h
  46. ===============
  47. Name:           Location( self )
  48. Syntax:         where = Location( self );
  49.                 | Point where;
  50.                 | struct GraphicObject *self;
  51.  
  52. Description:    returns top/left edge coordinates of GraphicObject 'self'
  53.  
  54.  
  55. Name:           SetLocation( self, LeftEdge, TopEdge )
  56. Syntax:         where = SetLocation( self, LeftEdge, TopEdge );
  57.                 | Point where;
  58.                 | struct GraphicObject *self;
  59.                 | PIXELS LeftEdge;
  60.                 | PIXELS RightEdge;
  61.  
  62. Description:    tries to set the left/top edges of GraphicObject 'self' to
  63.                 variables 'LeftEdge' and 'TopEdge' and returns the actual
  64.                 results
  65.  
  66. Name:           Size( self )
  67. Syntax:         return = Size( self );
  68.                 | Point return;
  69.                 | struct GraphicObject *self;
  70.  
  71. Description:    returns the width,height of GraphicObject 'self'
  72.  
  73. Name:           AskSize( self, Width, Height )
  74. Syntax:         return = AskSize( self, Width, Height );
  75.                 | Point return;
  76.                 | struct GraphicObject *self;
  77.                 | PIXELS Width;
  78.                 | PIXELS Height;
  79.  
  80. Description:   Given a (Width, Height), returns the nearest (Width, Height)
  81.                that 'self' modify itself to be.  Does NOT actually change
  82.                the dimensions of 'self'.  (Some graphic objects have
  83.                constraints on their size.)
  84.  
  85. Name:          MinSize( self )
  86. Syntax:        return = MinSize( self );
  87.                | Point return;
  88.                | struct GraphicObject *self;
  89.  
  90. Description:   macro for AskSize( self, 0, 0 );
  91.  
  92. Name:          MaxSize( self )
  93. Syntax:        return = MaxSize( self );
  94.                | Point return;
  95.                | struct GraphicObject *self;
  96.  
  97. Description:   macro for AskSize( self, 32767, 32767 );
  98.  
  99.  
  100. Name:          SetSize( self, Width, Height )
  101. Syntax:        return = SetSize( self, Width, Height );
  102.                | Point return;
  103.                | struct GraphicObject *self;
  104.                | PIXELS Width;
  105.                | PIXELS Height;
  106.  
  107. Description:   Sets 'selfs' size to be as near (Width, Height) as possible,
  108.                returns the actual (Width, Height)
  109.  
  110.  
  111. Name:          SizeFlags( self )
  112. Syntax:        return = SizeFlags( self );
  113.                | UWORD return;
  114.                | struct GraphicObject *self;
  115.  
  116. Description:   Returns the flags which define the axis's on which this object may
  117.                be sized. (Useful for the Builder, for example)
  118.  
  119.  
  120. Name:          Render( self, RPort )
  121. Syntax:        void Render( self, RPort );
  122.                | struct GraphicObject *self;
  123.                | RastPort *RPort;
  124.  
  125. Description:   Draws the GraphicObject 'self' on the RastPort 'RPort'
  126.                using 'selfs' Location for placement of top-left corner.
  127.  
  128.  
  129. Name:          SetTitle( self, title )
  130. Syntax:        return = SetTitle( self, title );
  131.                | BOOL return;
  132.                | struct GraphicObject *self;
  133.                | char *title;
  134.  
  135. Description:   Returns FALSE if object does not support Titles
  136.                Returns TRUE if object supports titles, and replaces current
  137.                object title with 'title'.
  138.  
  139. Name:          Title( self )
  140. Syntax:        return = Title( self );
  141.                | char *return;
  142.                | struct GraphicObject *self;
  143.  
  144. Description:   Returns character string if object supports titles
  145.                else returns NULL;
  146.  
  147.  
  148. Name:          DefaultFont( self );
  149. Syntax:        return = DefaultFont( self );
  150.                | TextAttr *return;
  151.                | struct GraphicObject *self;
  152.  
  153. Description:   returns pointer to TextAttr if object supports default fonts
  154.                else returns NULL;
  155.  
  156.  
  157. Name:          SetDefaultFont( self, this_font )
  158. Syntax:        return = SetDefaultFont( self, this_font );
  159.                | BOOL return;
  160.                | struct GraphicObject *self;
  161.                | TextAttr *default_font;
  162.  
  163. Description:   returns TRUE if object supports default font 'this_font'
  164.                returns FALSE if object does not support default fonts
  165.                returns FALSE if object could not open 'this_font'
  166.  
  167. Name:          TextAlignment( self )
  168. Syntax:        return = TextAlignment( self );
  169.                | AlignInfo *return;
  170.                | struct GraphicObject *self;
  171.  
  172. Description:   returns pointer to the AlignInfo of a GraphicObject or NULL if none.
  173.  
  174.  
  175. Name:          SetTextAlignment( self, Flags, Xpad, Ypad )
  176. Syntax:        return = SetTextAlignment( self, Flags, Xpad, Ypad );
  177.                | BOOL return;
  178.                | struct GraphicObject *self;
  179.                | UBYTE Flags;
  180.                | BYTE Xpad;
  181.                | BYTE Ypad;
  182.  
  183. Description:   returns FALSE if GraphicObject cannot support the given arguments
  184.  
  185. Name:          GraphicObject_Init( self )
  186. Syntax:        void GraphicObject_Init( self );
  187.                | struct GraphicObject *self;
  188.  
  189. Description:   initializes the GraphicObject structure 'self'
  190.  
  191.  
  192. Interactor.h
  193. =================
  194.  
  195. Name:          Interactor_Init( self )
  196. Syntax:        void Interactor_Init( self );
  197.                | struct Interactor *self;
  198.  
  199. Description:   initializes an Interactor structure
  200.  
  201.  
  202. Name:          InteractorWindow( self )
  203. Syntax:        return = InteractorWindow( self );
  204.                | struct pcgWindow *return;
  205.                | struct Interactor *self;
  206.  
  207. Description:   returns a pointer to the Precognition Window to which this
  208.                interactor belongs or NULL if none.
  209.  
  210.  
  211. Name:          SetInteractorWindow( self, window )
  212. Syntax:        void SetInteractorWindow( self, window );
  213.                | struct Interactor *self;
  214.                | struct pcgWindow *window;
  215.  
  216. Description:   set the pcgWindow that interactor belongs to
  217.  
  218.  
  219. Name:          FirstGadget( self )
  220. Syntax:        return = FirstGadget( self );
  221.                | struct Gadget *return;
  222.                | struct Interactor *self;
  223.  
  224. Description:   returns the address of the first gadget in the interactor.
  225.                If there are no gadgets, returns NULL.
  226.                This is useful for building composite Interactors out of
  227.                other Interactors (scrolling lists, for example)
  228.  
  229.  
  230. Name:          nGadgets( self )
  231. Syntax:        return = nGadgets( self );
  232.                | USHORT nGadgets;
  233.                | struct Interactor *self;
  234.  
  235. Description:   returns the number of gadgets in an interactor
  236.  
  237.  
  238. Name:          IDCMPFlags( self )
  239. Syntax:        return = IDCMPFlags( self );
  240.                | ULONG return;
  241.                | struct Interactor *self;
  242.  
  243. Description:   returns the IDCMP flags that 'self' needs to function
  244.  
  245.  
  246. Name:          ClaimEvent( self, event )
  247. Syntax:        return = ClaimEvent( self, event );
  248.                | USHORT return;
  249.                | struct Interactor *self;
  250.                | IntuiMessage *event;
  251.  
  252. Description:   returns true if 'self' would respond to 'event'
  253.                This is useful to determine if an Interactor will respond before
  254.                it actually does.
  255.  
  256.  
  257. Name:          Respond( self, event )
  258. Syntax:        return = Respond( self, event );
  259.                | USHORT return;
  260.                | struct Interactor *self;
  261.                | IntuiMessage *event;
  262.  
  263. Description:   Respond() is THE routine for Interactors.  Calling Respond()
  264.                for an IntuiMessage tells the Interactor to do whatever it should
  265.                do for that message.
  266.  
  267.                 Returns a response code with the following bits:
  268.  
  269.                 RESPONDED      : Interactor paid attention to this event.
  270.                                  If not set, Interactor ignored event.
  271.  
  272.                 CONSUMED_EVENT : Interactor guarantees that this event
  273.                                  is _only_ for this Interactor.  This signals
  274.                                  the event loop that it need not bother sending
  275.                                  this event to any other interactor.
  276.  
  277.                 CHANGED_STATE  : The event caused the Interactor to change state.
  278.                                  (e.g. Slider moved, text entered, button
  279.                                   pressed.)
  280.                                  Certain events (e.g. REFRESHWINDOW) cause
  281.                                  the Interactor to respond without changing
  282.                                  state.
  283.  
  284.                 DEACTIVATED    : The event caused the interactor to go from an active
  285.                                  to an inactive state (string gadgets)
  286.  
  287.  
  288. Name:           Refresh( self )
  289. Syntax:         void Refresh( self );
  290.  
  291. Description:    Draws a interactor to a window.
  292.                 I know what you're thinking: "Class 'GraphicObject' already has a
  293.                 Render() methOD which does this, why do we need another?".  Because
  294.                 Render() draws to a RastPort, and the Intuition function to refresh
  295.                 Gadgets requires a pointer to a Window.  Therefore, we need a new
  296.                 method.  (although the default action of 'Refresh()' is simply to
  297.                 call 'Render() with the window's RastPort).
  298.  
  299. Name:           EnableIactor( self, enable )
  300. Syntax:         return = EnableIactor( self, enable )
  301.                 | BOOL return;
  302.                 | struct Interactor *self;
  303.                 | BOOL enable;
  304.  
  305. Description:    This turns an Interactor On/Off.
  306.                  i.e. 'EnableIactor( interactor, FALSE )'
  307.                     will ghost an interactor.
  308.                 'EnableIactor( interactor, TRUE )' un-ghosts.
  309.  
  310. Name:           isEnabled( self )
  311. Syntax:         return = isEnabled( self );
  312.                 | BOOL return;
  313.                 | struct Interactor *self;
  314.  
  315. Description:    returns TRUE if 'self' is currently enbabled
  316.  
  317.  
  318. Name:           Activate( self, activate )
  319. Syntax:         return = Activate( self, activate );
  320.                 | BOOL return;
  321.                 | struct Interactor *self;
  322.                 | BOOL activate;
  323.  
  324. Description:    If 'activate' == TRUE, Interactor gains control of the keyboard.
  325.                 returns FALSE if Interactor does not use the keyboard.
  326.                 (mostly for string/integer gadgets)
  327.  
  328.  
  329. Name:           isActive( self )
  330. Syntax:         return = isActive( self );
  331.                 | BOOL return;
  332.                 | struct Interactor *self;
  333.  
  334. Description:    returns TRUE if 'self' is active
  335.  
  336. Name:           ActivateNext( self )
  337. Syntax:         return = ActivateNext( self );
  338.                 | BOOL return;
  339.                 | struct Interactor *self;
  340.  
  341. Description:    Attempts to activate the next interactor in a chain
  342.                 returns TRUE if successful.
  343.  
  344.  
  345. Valuator.h
  346. ================
  347.  
  348. Name:           Valuator_Init( self )
  349. Syntax:         void Valuator_Init( self );
  350.                 | struct Valuator *self;
  351.  
  352. Description:    initializes a Valuator object structure
  353.  
  354.  
  355. Name:           Value( self )
  356. Syntax:         return = Value( self );
  357.                 | LONG return;
  358.                 | struct Valuator *self;
  359.  
  360. Description:    returns the current value of 'self'
  361.  
  362.  
  363. Name:           SetValue( self, selection )
  364. Syntax:         return = SetValue( self, selection );
  365.                 | LONG return;
  366.                 | struct Valuator *self;
  367.                 | LONG selection;
  368.  
  369. Description:    attempts to set the current value of 'self' to 'selection'
  370.                 returns actual value
  371.  
  372. Name:           StringValue( self )
  373. Syntax:         return = StringValue( self );
  374.                 | char *return;
  375.                 | struct Valuator *self
  376.  
  377. Description:    macro for (char *)Value( i )
  378.  
  379. Name:           SetStringValue( self, string )
  380. Syntax:         return = SetStringValue( self, string );
  381.  
  382. Description     macro for (char *)SetValue( self, (LONG)string );
  383.  
  384. pcgWindow.h
  385. ================
  386.  
  387. Name:           pcgWindow_Init( self, leftedge, topedge, width, height, minwidth,
  388.                                 minheight, maxwidth, maxheight, title, IDCMPFlags, screen )
  389.  
  390. Syntax:         void pcgWindow_Init( self, leftedge, topedge, width, height, minwidth,
  391.                                 minheight, maxwidth, maxheight, title, IDCMPFlags, screen );
  392.                 | struct pcgWindow     *self;
  393.                 | UWORD leftedge;
  394.                 | UWORD topedge;
  395.                 | UWORD width;
  396.                 | UWORD height;
  397.                 | UWORD minwidth;
  398.                 | UWORD minheight;
  399.                 | UWORD maxwidth;
  400.                 | UWORD maxheight;
  401.                 | char  *title;
  402.                 | ULONG IDCMPFlags;
  403.                 | ULONG flags;
  404.                 | struct Screen *screen;
  405.  
  406. Description:    initializes a pcgWindow object structure
  407.  
  408.  
  409. Name:           pcgOpenWindow( self )
  410. Syntax:         return = pcgOpenWindow( self );
  411.                 | struct Window *return;
  412.                 | struct pcgWindow *self;
  413.  
  414. Description:    opens a pcgWindow
  415.  
  416.  
  417. Name:           pcgCloseWindow( self )
  418. Syntax:         void pcgCloseWindow( self );
  419.                 | struct pcgWindow *self;
  420.  
  421. Description:    closes a pcgWindow
  422.  
  423.  
  424. Name:           iWindow( self )
  425. Syntax:         return = iWindow( self );
  426.                 | struct Window *return;
  427.                 | struct pcgWindow *self;
  428.  
  429. Description:    returns a pointer to the actual Intuition window
  430.                 used/created by 'self'
  431.  
  432. Name:         RPort( self )
  433. Syntax:       return = RPort( self );
  434.               | struct RastPort *return;
  435.               | struct pcgWindow *self;
  436.  
  437. Description:  returns a pointer to the Intuition Window's RastPort of 'self'
  438.  
  439.  
  440. Name:         SetIDCMPFlags( self, newflags )
  441. Syntax:       return = SetIDCMPFlags( self, newflags )
  442.               | ULONG return;
  443.               | struct pcgWindow *self;
  444.               | ULONG newflags;
  445.  
  446. Description:  trys to set the IDCMPFlags of 'self' with 'newflags'
  447.               returns actual IDCMPFlags.
  448.  
  449.  
  450. Name:         AddWindowPObject( self, graphic )
  451. Syntax:       void AddWindowPObject( self, graphic );
  452.               | struct pcgWindow *self;
  453.               | struct GraphicObject *graphic;
  454.  
  455. Description:  Adds GraphicObject 'graphic' to list of GraphicObjects owned by 'self'
  456.  
  457.  
  458. Name:         RemoveWindowPObject( self, graphic )
  459. Syntax:       void RemoveWindowPObject( self, graphic );
  460.               | struct pcgWindow *self;
  461.               | struct GraphicObject *graphic;
  462.  
  463. Description:  Removes GraphicObject 'graphic' from list of GraphicObjects owned by 'self'
  464.  
  465.  
  466. Name:         AddMenuStrip( self, menustrip )
  467. Syntax:       void AddMenuStrip( self, menustrip );
  468.               | struct pcgWindow *self;
  469.               | struct Menu *menustrip;
  470.  
  471. Description:  Adds Menu 'menustrip' to pcgWindow 'self'
  472.  
  473.  
  474. Name:         RemoveMenuStrip( self, menustrip )
  475. Syntax:       void RemoveMenuStrip( self );
  476.               | struct pcgWindow *self;
  477.  
  478. Description:  removes any current menustrip from 'self'
  479.  
  480.  
  481. Name:         AddInteractor( self, inter )
  482. Syntax:       void AddInteractor( self, inter );
  483.               | struct pcgWindow *self;
  484.               | struct Interactor *inter;
  485.  
  486. Description:  Adds Interactor Object 'inter' to list of interactors of 'self'
  487.  
  488.  
  489. Name:         AddGraphicObject( self, graphic )
  490. Syntax:       void AddGraphicObject( self, graphic );
  491.               | struct pcgWindow *self;
  492.               | struct GraphicObject *graphic;
  493.  
  494. Description:  Adds GraphicObject 'graphic' to list of graphic objects of 'self'
  495.  
  496.  
  497.  
  498.  
  499.