X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/78b24692d45f090f846e4c327ca7fa2ee6d302eb..77dd5db92b788d747c11ee9c78d79df5b88e7a1d:/ObjectiveC/Internal.hpp diff --git a/ObjectiveC/Internal.hpp b/ObjectiveC/Internal.hpp index deb5e5d..fcfec70 100644 --- a/ObjectiveC/Internal.hpp +++ b/ObjectiveC/Internal.hpp @@ -27,22 +27,25 @@ #include "../Internal.hpp" struct Selector_privateData : - CYValue + CYRoot { + SEL value_; + _finline Selector_privateData(SEL value) : - CYValue(value) + value_(value) { } }; struct Instance : - CYValue + CYPrivateOld { typedef unsigned Flags; static const Flags None = 0; static const Flags Permanent = 1 << 0; static const Flags Uninitialized = 1 << 1; + id value_; Flags flags_; Instance(id value, Flags flags); @@ -63,35 +66,70 @@ struct Instance : namespace cy { struct Super : - CYValue + CYRoot { + id value_; Class class_; _finline Super(id value, Class _class) : - CYValue(value), + value_(value), class_(_class) { } }; } struct Messages : - CYValue + CYRoot { - _finline Messages(Class value) : - CYValue(value) + virtual Class GetClass() const = 0; +}; + +struct Prototype : + Messages +{ + static constexpr const char *const Cache_ = "p"; + + Class value_; + + _finline Prototype(Class value) : + value_(value) { } + Class GetClass() const override { + return value_; + } + + JSValueRef GetPrototype(JSContextRef context) const; +}; + +struct Constructor : + Messages +{ + static constexpr const char *const Cache_ = "m"; + + Class value_; + + _finline Constructor(Class value) : + value_(value) + { + } + + Class GetClass() const override { + return value_; + } + JSValueRef GetPrototype(JSContextRef context) const; }; struct Interior : - CYValue + CYRoot { + id value_; CYProtect owner_; _finline Interior(id value, JSContextRef context, JSObjectRef owner) : - CYValue(value), + value_(value), owner_(context, owner) { }