Ignore:
Timestamp:
Jun 22, 2009, 3:16:39 PM (15 years ago)
Author:
dkearney
Message:

updating the objects code and adding some more examples describing how i want developers to use the objects. some of the objects don't work yet, like the tree, anything with an example should work

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/objects/RpObject.h

    r1428 r1528  
    99 */
    1010
    11 #ifndef RAPPTURE_VARIABLE_H
    12 #define RAPPTURE_VARIABLE_H
     11#ifndef RAPPTURE_OBJECT_H
     12#define RAPPTURE_OBJECT_H
    1313
    1414#include "RpInt.h"
     
    1616#include "RpAccessor.h"
    1717#include "RpBuffer.h"
     18#include "RpPath.h"
    1819
    1920namespace Rappture {
    2021
    21 class Variable
     22class Object
    2223{
    2324    public:
    24         Variable ();
    25         Variable (  const char *path,
    26                     const char *label,
    27                     const char *desc,
    28                     const char *hints,
    29                     const char *color   );
    30         Variable (const Variable& o);
    31         virtual ~Variable();
     25        Object ();
     26        Object (const char *path,
     27                const char *label,
     28                const char *desc,
     29                const char *hints,
     30                const char *color);
     31        Object (const Object& o);
     32        virtual ~Object();
    3233
    33         Accessor<const char *> path;
    34         Accessor<const char *> label;
    35         Accessor<const char *> desc;
    36         Accessor<const char *> hints;
    37         Accessor<const char *> color;
    38         Accessor<Buffer> icon;
     34        const char *path(void) const;
     35        void path(const char *p);
     36
     37        const char *label(void) const;
     38        void label(const char *p);
     39
     40        const char *desc(void) const;
     41        void desc(const char *p);
     42
     43        const char *hints(void) const;
     44        void hints(const char *p);
     45
     46        const char *color(void) const;
     47        void color(const char *);
     48
     49        // void *icon(void) const;
     50        // void icon(void *p, size_t nbytes);
    3951
    4052        // these functions are not completely improper use proof
    4153        // user is responsible for calling propremove() on any item
    4254        // they put into the hash table.
    43         const void *property (const char *key, const void *val);
    44         const char *propstr (const char *key, const char *val);
    45         void *propremove (const char *key);
     55
     56        // get/set void* property
     57        const void *property (const char *key) const;
     58        void property (const char *key, const void *val, size_t nbytes);
     59
     60        // get/set const char * property
     61        const char *propstr (const char *key) const;
     62        void propstr (const char *key, const char *val);
     63
     64        // remove property from hash table
     65        void propremove (const char *key);
     66
     67        // get the Rappture1.1 xml text for this object
     68        virtual const char *xml() const;
     69
     70        // set the object properties based on Rappture1.1 xml text
     71        virtual void xml(const char *xmltext);
     72
     73        virtual const int is() const;
     74
     75    protected:
     76
     77        /// temprorary buffer for returning text to the user
     78        SimpleCharBuffer _tmpBuf;
    4679
    4780    private:
     
    5588        /// close out the object, freeing its memory
    5689        void __clear();
     90
    5791};
    5892
    59 } // RAPPTURE_VARIABLE_H
     93} // RAPPTURE_OBJECT_H
    6094
    6195/*--------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.