TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Component.h
Go to the documentation of this file.
1 //===-- temu-c/Component.h - T-EMU Component Support ------------*- C++ -*-===//
2 //
3 // T-EMU: The Terma Emulator
4 // (c) Terma 2016
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 //------------------------------------------------------------------------------
10 // WARNING!!! WARNING!!! EXPERIMENTAL API WARNING!!! WARNING!!! WARNING!!!
11 //
12 // BE WARNED THAT THIS API IS EXPERIMENTAL, UNSTABLE AND NOT WELL TESTED.
13 // IN PARTICULAR, THE API MAY CRASH ON OCCASIONS.
14 //------------------------------------------------------------------------------
15 #ifndef TEMU_SUPPORT_COMPONENT_H
16 #define TEMU_SUPPORT_COMPONENT_H
17 
19 #include "temu-c/Support/Objsys.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #ifndef TEMU_COMPONENT_DEFINED
26 #define TEMU_COMPONENT_DEFINED
28 #endif // !TEMU_COMPONENT_DEFINED
29 
30 
40 temu_registerComponent(const char *CompClass,
41  temu_ObjectCreateFunc Create,
42  temu_ObjectDisposeFunc Dispose);
43 
59 
73 TEMU_API void temu_componentDispose(void *Comp); // Default destructor
74 
92  const char *Name,
93  temu_IfaceRef Iface);
94 
110  const char *Name, void *Obj,
111  const char *PropName);
112 
127  const char *Name);
128 
142  const char *Name);
143 
165 TEMU_API void* temu_createComponentObject(void *Comp, const char *Class,
166  const temu_CreateArg *Args,
167  const char *ObjNameFmt, ...);
168 
169 
176 TEMU_API void * temu_componentGetObject(void *Comp, const char *Name);
177 
178 
179 
180 // Call function on every component
187 TEMU_API void temu_foreachComponent(void (*Func)(temu_Component*,void*), void *Arg);
188 
195 TEMU_API void temu_foreachRootComponent(void (*Func)(temu_Component*,void*), void *Arg);
196 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif /* !TEMU_SUPPORT_COMPONENT_H */
TEMU_API void temu_foreachComponent(void(*Func)(temu_Component *, void *), void *Arg)
TEMU_API void temu_componentDispose(void *Comp)
TEMU_API temu_Class * temu_registerComponent(const char *CompClass, temu_ObjectCreateFunc Create, temu_ObjectDisposeFunc Dispose)
TEMU_API temu_PropName temu_componentGetDelegateProp(temu_Component *Comp, const char *Name)
TEMU_API void * temu_componentGetObject(void *Comp, const char *Name)
TEMU_API void temu_componentAddDelegateIface(temu_Component *Comp, const char *Name, temu_IfaceRef Iface)
void temu_Class
Definition: Objsys.h:58
TEMU_API void * temu_createComponentObject(void *Comp, const char *Class, const temu_CreateArg *Args, const char *ObjNameFmt,...)
TEMU_API temu_Component * temu_componentCreate(const char *Name)
TEMU_API temu_IfaceRef temu_componentGetDelegateIface(temu_Component *Comp, const char *Name)
void *(* temu_ObjectCreateFunc)(const char *Name, int Argc, const temu_CreateArg *Argv)
Definition: Objsys.h:1138
void(* temu_ObjectDisposeFunc)(void *)
Definition: Objsys.h:1140
TEMU_API void temu_foreachRootComponent(void(*Func)(temu_Component *, void *), void *Arg)
struct temu_Component temu_Component
Definition: Component.h:27
TEMU_API void temu_componentAddDelegateProp(temu_Component *Comp, const char *Name, void *Obj, const char *PropName)
#define TEMU_API
Definition: Attributes.h:53