1 /* Cycript - Optimizing JavaScript Compiler/Runtime
 
   2  * Copyright (C) 2009-2014  Jay Freeman (saurik)
 
   5 /* GNU Affero General Public License, Version 3 {{{ */
 
   7  * This program is free software: you can redistribute it and/or modify
 
   8  * it under the terms of the GNU Affero General Public License as published by
 
   9  * the Free Software Foundation, either version 3 of the License, or
 
  10  * (at your option) any later version.
 
  12  * This program is distributed in the hope that it will be useful,
 
  13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  15  * GNU Affero General Public License for more details.
 
  17  * You should have received a copy of the GNU Affero General Public License
 
  18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
  22 #ifndef CYCRIPT_OBJECTIVEC_INTERNAL_HPP
 
  23 #define CYCRIPT_OBJECTIVEC_INTERNAL_HPP
 
  25 #include <Internal.hpp>
 
  26 #include <objc/objc.h>
 
  28 struct Selector_privateData :
 
  31     _finline Selector_privateData(SEL value) :
 
  36     _finline SEL GetValue() const {
 
  37         return reinterpret_cast<SEL>(value_);
 
  40     virtual Type_privateData *GetType() const;
 
  49         Uninitialized = (1 << 1),
 
  54     _finline Instance(id value, Flags flags) :
 
  62     static JSObjectRef Make(JSContextRef context, id object, Flags flags = None);
 
  64     _finline id GetValue() const {
 
  65         return reinterpret_cast<id>(value_);
 
  68     _finline bool IsUninitialized() const {
 
  69         return (flags_ & Uninitialized) != 0;
 
  72     virtual Type_privateData *GetType() const;
 
  81     _finline Super(id value, Class _class) :
 
  82         Instance(value, Instance::Transient),
 
  87     static JSObjectRef Make(JSContextRef context, id object, Class _class);
 
  93     _finline Messages(Class value) :
 
  98     static JSObjectRef Make(JSContextRef context, Class _class);
 
 100     _finline Class GetValue() const {
 
 101         return reinterpret_cast<Class>(value_);
 
 108     _finline Internal(id value, JSContextRef context, JSObjectRef owner) :
 
 109         CYOwned(value, context, owner)
 
 113     static JSObjectRef Make(JSContextRef context, id object, JSObjectRef owner);
 
 115     _finline id GetValue() const {
 
 116         return reinterpret_cast<id>(value_);
 
 120 #endif/*CYCRIPT_OBJECTIVEC_INTERNAL_HPP*/