slist.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef __SLIST_H
  2. #define __SLIST_H
  3. #include <api/script/objects/rootobject.h>
  4. #include <api/script/objects/rootobj.h>
  5. #include <bfc/ptrlist.h>
  6. #include <bfc/tlist.h>
  7. class ScriptObject;
  8. // {B2023AB5-434D-4ba1-BEAE-59637503F3C6}
  9. static const GUID slistGuid =
  10. { 0xb2023ab5, 0x434d, 0x4ba1, { 0xbe, 0xae, 0x59, 0x63, 0x75, 0x3, 0xf3, 0xc6 } };
  11. #define SLIST_SCRIPTPARENT RootObjectInstance
  12. class ListScriptController : public ScriptObjectControllerI {
  13. public:
  14. virtual const wchar_t *getClassName();
  15. virtual const wchar_t *getAncestorClassName();
  16. virtual ScriptObjectController *getAncestorController() { return rootScriptObjectController; }
  17. virtual int getNumFunctions();
  18. virtual const function_descriptor_struct *getExportedFunctions();
  19. virtual GUID getClassGuid();
  20. virtual ScriptObject *instantiate();
  21. virtual void destroy(ScriptObject *o);
  22. virtual void *encapsulate(ScriptObject *o);
  23. virtual void deencapsulate(void *o);
  24. private:
  25. static function_descriptor_struct exportedFunction[];
  26. };
  27. extern ListScriptController *listController;
  28. class SList : public SLIST_SCRIPTPARENT {
  29. public:
  30. SList();
  31. virtual ~SList();
  32. TList<scriptVar> *getTList();
  33. private:
  34. TList<scriptVar> list;
  35. // -- SCRIPT -----------------------------------------------------
  36. public:
  37. // INSERT_SCRIPT_OBJECT_CONTROL
  38. static scriptVar script_vcpu_enumItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar i);
  39. static scriptVar script_vcpu_addItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar obj);
  40. static scriptVar script_vcpu_removeItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar obj);
  41. static scriptVar script_vcpu_getNumItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  42. static scriptVar script_vcpu_findItem2(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar obj, scriptVar start);
  43. static scriptVar script_vcpu_findItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar obj);
  44. static scriptVar script_vcpu_removeAll(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  45. };
  46. #endif