/+junk/c_sdl_joypad_ducktape

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape

« back to all changes in this revision

Viewing changes to src/Object.h

  • Committer: Gustav Hartvigsson
  • Date: 2014-09-02 20:15:48 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140902201548-h1kss1wdocqhs8df
* Fixed Makefile
* Changed all void * to _pointer in DynamicArray.[h,c].
* Fixed GameObject to work with the new base-type.
* Made the Object stuffs...
* added string_new_printf utility function in utils.[h,c]

* Derp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
25
25
 
26
26
/**
27
 
 * Is the primitive for the the <tt> to_string </tt> method in the
28
 
 * <tt>ObjectClass</tt>.
 
27
 * Is the primitive for the the <tt>ObjectClass::to_string_func</tt> method in
 
28
 * the <tt>ObjectClass</tt>.
29
29
 */
30
30
typedef char * (* ToStringFunc)(Object * object);
31
31
 
32
32
/**
33
 
 * This is the primitive for the <tt> new_func </tt> method.
 
33
 * This is the primitive for the <tt>ObjectClass::new_func</tt> method.
34
34
 */
35
 
typedef char * (* NewFunc)(Object * object);
 
35
typedef char * (* NewFunc)(Object * object, ...);
36
36
 
37
37
/**
38
38
 * The class for the Object, it is what holds the methods for the object.
58
58
 
59
59
 
60
60
/**
61
 
 * Initialises the object to a sane values.
 
61
 * Initialises the Object to a sane values.
62
62
 * 
63
63
 * @warning This does NOT allocate any memory for the instance.
64
64
 * 
74
74
                        char * name,
75
75
                        _pointer klass);
76
76
 
77
 
 
 
77
/**
 
78
 * Initialises a ObjectClass with methods.
 
79
 *
 
80
 * @warning This does NOT allocate any memory for the ObjectClass.
 
81
 *
 
82
 * @param klass The ObjectClass to initialise.
 
83
 * 
 
84
 * @param new_func The method that is used when creating a new instance of
 
85
 *                 the object that the class belongs to.
 
86
 *
 
87
 * @param to_string_func The method to be used when calling
 
88
 *        <tt>object_to_string ()</tt> on the object.
 
89
 */
78
90
void object_class_initialize (ObjectClass * klass,
79
91
                              NewFunc new_func,
80
92
                              FreeFunc free_func,
81
 
                              ToStringFunc to_string_func
82
 
                              );
 
93
                              ToStringFunc to_string_func);
83
94
 
 
95
/**
 
96
 * Add a private data structure ta a Object.
 
97
 *
 
98
 * @param object the object to add the private data to.
 
99
 * @param priv_data the data structure to add to the object.
 
100
 */
 
101
void object_add_private (Object * object, _pointer priv_data);
84
102
 
85
103
/**
86
104
 * Create a new object of the same type as the one that this is executed on.