All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.weblite.objc.Runtime Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package ca.weblite.objc;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;

/**
 * A JNA wrapper around the objective-c runtime.  This contains all of the functions
 * needed to interact with the runtime (e.g. send messages, etc..).
 *
 * 

Sample Usage

* * * @author shannah * @see Objective-C Runtime Reference * @version $Id: $Id * @since 1.1 */ public interface Runtime extends Library { /** Constant INSTANCE */ public static Runtime INSTANCE = (Runtime)Native.loadLibrary("objc.A", Runtime.class); public long acceptNSRange(Object o); /** *

objc_lookUpClass.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_lookUpClass(String name); /** *

class_getName.

* * @param id a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String class_getName(Pointer id); /** *

class_getProperty.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getProperty(Pointer cls, String name); /** *

class_getSuperclass.

* * @param cls a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getSuperclass(Pointer cls); /** *

class_getVersion.

* * @param theClass a {@link com.sun.jna.Pointer} object. * @return a int. */ public int class_getVersion(Pointer theClass); /** *

class_getWeakIvarLayout.

* * @param cls a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String class_getWeakIvarLayout(Pointer cls); /** *

class_isMetaClass.

* * @param cls a {@link com.sun.jna.Pointer} object. * @return a boolean. */ public boolean class_isMetaClass(Pointer cls); /** *

class_getInstanceSize.

* * @param cls a {@link com.sun.jna.Pointer} object. * @return a int. */ public int class_getInstanceSize(Pointer cls); /** *

class_getInstanceVariable.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getInstanceVariable(Pointer cls, String name); /** *

class_getInstanceMethod.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param aSelector a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getInstanceMethod(Pointer cls, Pointer aSelector); /** *

class_getClassMethod.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param aSelector a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getClassMethod(Pointer cls, Pointer aSelector); /** *

class_getIvarLayout.

* * @param cls a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String class_getIvarLayout(Pointer cls); /** *

class_getMethodImplementation.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getMethodImplementation(Pointer cls, Pointer name); /** *

class_getMethodImplementation_stret.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_getMethodImplementation_stret(Pointer cls, Pointer name); /** *

class_replaceMethod.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link com.sun.jna.Pointer} object. * @param imp a {@link com.sun.jna.Pointer} object. * @param types a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_replaceMethod(Pointer cls, Pointer name, Pointer imp, String types); /** *

class_respondsToSelector.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param sel a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_respondsToSelector(Pointer cls, Pointer sel); /** *

class_setIvarLayout.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param layout a {@link java.lang.String} object. */ public void class_setIvarLayout(Pointer cls, String layout); /** *

class_setSuperclass.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param newSuper a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer class_setSuperclass(Pointer cls, Pointer newSuper); /** *

class_setVersion.

* * @param theClass a {@link com.sun.jna.Pointer} object. * @param version a int. */ public void class_setVersion(Pointer theClass, int version); /** *

class_setWeakIvarLayout.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param layout a {@link java.lang.String} object. */ public void class_setWeakIvarLayout(Pointer cls, String layout); /** *

ivar_getName.

* * @param ivar a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String ivar_getName(Pointer ivar); /** *

ivar_getOffset.

* * @param ivar a {@link com.sun.jna.Pointer} object. * @return a long. */ public long ivar_getOffset(Pointer ivar); /** *

ivar_getTypeEncoding.

* * @param ivar a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String ivar_getTypeEncoding(Pointer ivar); /** *

method_copyArgumentType.

* * @param method a {@link com.sun.jna.Pointer} object. * @param index a int. * @return a {@link java.lang.String} object. */ public String method_copyArgumentType(Pointer method, int index); /** *

method_copyReturnType.

* * @param method a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String method_copyReturnType(Pointer method); /** *

method_exchangeImplementations.

* * @param m1 a {@link com.sun.jna.Pointer} object. * @param m2 a {@link com.sun.jna.Pointer} object. */ public void method_exchangeImplementations(Pointer m1, Pointer m2); /** *

method_getArgumentType.

* * @param method a {@link com.sun.jna.Pointer} object. * @param index a int. * @param dst a {@link com.sun.jna.Pointer} object. * @param dst_len a long. */ public void method_getArgumentType(Pointer method, int index, Pointer dst, long dst_len); /** *

method_getImplementation.

* * @param method a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer method_getImplementation(Pointer method); /** *

method_getName.

* * @param method a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer method_getName(Pointer method); /** *

method_getNumberOfArguments.

* * @param method a {@link com.sun.jna.Pointer} object. * @return a int. */ public int method_getNumberOfArguments(Pointer method); /** *

method_getReturnType.

* * @param method a {@link com.sun.jna.Pointer} object. * @param dst a {@link com.sun.jna.Pointer} object. * @param dst_len a long. */ public void method_getReturnType(Pointer method, Pointer dst, long dst_len); /** *

method_getTypeEncoding.

* * @param method a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String method_getTypeEncoding(Pointer method); /** *

method_setImplementation.

* * @param method a {@link com.sun.jna.Pointer} object. * @param imp a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer method_setImplementation(Pointer method, Pointer imp); /** *

objc_allocateClassPair.

* * @param superclass a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @param extraBytes a long. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_allocateClassPair(Pointer superclass, String name, long extraBytes); /** *

objc_copyProtocolList.

* * @param outCount a {@link com.sun.jna.Pointer} object. * @return an array of {@link com.sun.jna.Pointer} objects. */ public Pointer[] objc_copyProtocolList(Pointer outCount); /** *

objc_getAssociatedObject.

* * @param object a {@link com.sun.jna.Pointer} object. * @param key a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getAssociatedObject(Pointer object, String key); /** *

objc_getClass.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getClass(String name); /** *

objc_getClassList.

* * @param buffer a {@link com.sun.jna.Pointer} object. * @param bufferlen a int. * @return a int. */ public int objc_getClassList(Pointer buffer, int bufferlen); /** *

objc_getFutureClass.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getFutureClass(String name); /** *

objc_getMetaClass.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getMetaClass(String name); /** *

objc_getProtocol.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getProtocol(String name); /** *

objc_getRequiredClass.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer objc_getRequiredClass(String name); /** *

objc_msgSend.

* * @param theReceiver a {@link com.sun.jna.Pointer} object. * @param theSelector a {@link com.sun.jna.Pointer} object. * @param arguments a {@link java.lang.Object} object. * @return a long. */ public long objc_msgSend(Pointer theReceiver, Pointer theSelector); public long objc_msgSend(Pointer theReceiver, Pointer theSelector,Object arg); public long objc_msgSend(Pointer theReceiver, Pointer theSelector,Object arg, Object arg2); public long objc_msgSend(Pointer theReceiver, Pointer theSelector,Object arg, Object arg2, Object arg3); public long objc_msgSend(Pointer theReceiver, Pointer theSelector,Object arg, Object arg2, Object arg3, Object arg4); /** *

objc_msgSendSuper.

* * @param superClassStruct a {@link com.sun.jna.Pointer} object. * @param op a {@link com.sun.jna.Pointer} object. * @param arguments a {@link java.lang.Object} object. * @return a long. */ public long objc_msgSendSuper(Pointer superClassStruct, Pointer op, Object... arguments); /** *

objc_msgSendSuper_stret.

* * @param superClassStruct a {@link com.sun.jna.Pointer} object. * @param op a {@link com.sun.jna.Pointer} object. * @param arguments a {@link java.lang.Object} object. * @return a long. */ public long objc_msgSendSuper_stret(Pointer superClassStruct, Pointer op); /** *

objc_msgSend_fpret.

* * @param self a {@link com.sun.jna.Pointer} object. * @param op a {@link com.sun.jna.Pointer} object. * @param arguments a {@link java.lang.Object} object. * @return a double. */ public double objc_msgSend_fpret(Pointer self, Pointer op); public double objc_msgSend_fpret(Pointer self, Pointer op, Object arg); public double objc_msgSend_fpret(Pointer self, Pointer op, Object arg, Object arg2); public double objc_msgSend_fpret(Pointer self, Pointer op, Object arg, Object arg2, Object arg3); public double objc_msgSend_fpret(Pointer self, Pointer op, Object arg, Object arg2, Object arg3, Object arg4); /** *

objc_msgSend_stret.

* * @param stretAddr a {@link com.sun.jna.Pointer} object. * @param theReceiver a {@link com.sun.jna.Pointer} object. * @param theSelector a {@link com.sun.jna.Pointer} object. * @param arguments a {@link java.lang.Object} object. */ public void objc_msgSend_stret(Pointer stretAddr, Pointer theReceiver, Pointer theSelector); public void objc_msgSend_stret(Pointer stretAddr, Pointer theReceiver, Pointer theSelector, Object arg); public void objc_msgSend_stret(Pointer stretAddr, Pointer theReceiver, Pointer theSelector, Object arg, Object arg2); public void objc_msgSend_stret(Pointer stretAddr, Pointer theReceiver, Pointer theSelector, Object arg, Object arg2, Object arg3); public void objc_msgSend_stret(Pointer stretAddr, Pointer theReceiver, Pointer theSelector, Object arg, Object arg2, Object arg3, Object arg4); /** *

objc_registerClassPair.

* * @param cls a {@link com.sun.jna.Pointer} object. */ public void objc_registerClassPair(Pointer cls); /** *

objc_removeAssociatedObjects.

* * @param object a {@link com.sun.jna.Pointer} object. */ public void objc_removeAssociatedObjects(Pointer object); /** *

objc_setAssociatedObject.

* * @param object a {@link com.sun.jna.Pointer} object. * @param key a {@link com.sun.jna.Pointer} object. * @param value a {@link com.sun.jna.Pointer} object. * @param policy a {@link com.sun.jna.Pointer} object. */ public void objc_setAssociatedObject(Pointer object, Pointer key, Pointer value, Pointer policy); /** *

objc_setFutureClass.

* * @param cls a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. */ public void objc_setFutureClass(Pointer cls, String name); /** *

object_copy.

* * @param obj a {@link com.sun.jna.Pointer} object. * @param size a long. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_copy(Pointer obj, long size); /** *

object_dispose.

* * @param obj a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_dispose(Pointer obj); /** *

object_getClass.

* * @param object a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_getClass(Pointer object); /** *

object_getClassName.

* * @param obj a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String object_getClassName(Pointer obj); /** *

object_getIndexedIvars.

* * @param obj a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_getIndexedIvars(Pointer obj); /** *

object_getInstanceVariable.

* * @param obj a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @param outValue a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_getInstanceVariable(Pointer obj, String name, Pointer outValue); /** *

object_getIvar.

* * @param object a {@link com.sun.jna.Pointer} object. * @param ivar a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_getIvar(Pointer object, Pointer ivar); /** *

object_setClass.

* * @param object a {@link com.sun.jna.Pointer} object. * @param cls a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_setClass(Pointer object, Pointer cls); /** *

object_setInstanceVariable.

* * @param obj a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @param value a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer object_setInstanceVariable(Pointer obj, String name, Pointer value); /** *

object_setIvar.

* * @param object a {@link com.sun.jna.Pointer} object. * @param ivar a {@link com.sun.jna.Pointer} object. * @param value a {@link com.sun.jna.Pointer} object. */ public void object_setIvar(Pointer object, Pointer ivar, Pointer value); /** *

property_getAttributes.

* * @param property a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String property_getAttributes(Pointer property); /** *

protocol_conformsToProtocol.

* * @param proto a {@link com.sun.jna.Pointer} object. * @param other a {@link com.sun.jna.Pointer} object. * @return a boolean. */ public boolean protocol_conformsToProtocol(Pointer proto, Pointer other); /** *

protocol_copyMethodDescriptionList.

* * @param protocol a {@link com.sun.jna.Pointer} object. * @param isRequiredMethod a boolean. * @param isInstanceMethod a boolean. * @param outCount a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Structure} object. */ public Structure protocol_copyMethodDescriptionList(Pointer protocol, boolean isRequiredMethod, boolean isInstanceMethod, Pointer outCount); /** *

protocol_copyPropertyList.

* * @param proto a {@link com.sun.jna.Pointer} object. * @param outCount a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer protocol_copyPropertyList(Pointer proto, Pointer outCount); /** *

protocol_copyProtocolList.

* * @param proto a {@link com.sun.jna.Pointer} object. * @param outCount a {@link com.sun.jna.Pointer} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer protocol_copyProtocolList(Pointer proto, Pointer outCount); /** *

protocol_getMethodDescription.

* * @param proto a {@link com.sun.jna.Pointer} object. * @param aSel a {@link com.sun.jna.Pointer} object. * @param isRequiredMethod a boolean. * @param isInstanceMethod a boolean. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer protocol_getMethodDescription(Pointer proto, Pointer aSel, boolean isRequiredMethod, boolean isInstanceMethod); /** *

protocol_getName.

* * @param proto a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String protocol_getName(Pointer proto); /** *

protocol_getProperty.

* * @param proto a {@link com.sun.jna.Pointer} object. * @param name a {@link java.lang.String} object. * @param isRequiredProperty a boolean. * @param isInstanceProperty a boolean. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer protocol_getProperty(Pointer proto, String name, boolean isRequiredProperty, boolean isInstanceProperty); /** *

protocol_isEqual.

* * @param protocol a {@link com.sun.jna.Pointer} object. * @param other a {@link com.sun.jna.Pointer} object. * @return a boolean. */ public boolean protocol_isEqual(Pointer protocol, Pointer other); /** *

sel_getName.

* * @param aSelector a {@link com.sun.jna.Pointer} object. * @return a {@link java.lang.String} object. */ public String sel_getName(Pointer aSelector); /** *

sel_getUid.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer sel_getUid(String name); /** *

sel_isEqual.

* * @param lhs a {@link com.sun.jna.Pointer} object. * @param rhs a {@link com.sun.jna.Pointer} object. * @return a boolean. */ public boolean sel_isEqual(Pointer lhs, Pointer rhs); /** *

sel_registerName.

* * @param name a {@link java.lang.String} object. * @return a {@link com.sun.jna.Pointer} object. */ public Pointer sel_registerName(String name); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy