lib
rubyextension.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KROSS_RUBYRUBYEXTENSION_H
00020 #define KROSS_RUBYRUBYEXTENSION_H
00021
00022 #include <ruby.h>
00023
00024 #include <api/class.h>
00025 #include <api/dict.h>
00026 #include <api/list.h>
00027 #include <api/object.h>
00028
00029 namespace Kross {
00030
00031 namespace Ruby {
00032
00033 class RubyExtensionPrivate;
00034
00039 class RubyExtension{
00040 friend class RubyInterpreter;
00041 friend class RubyModule;
00042 friend class RubyScript;
00043 public:
00050 RubyExtension(Kross::Api::Object::Ptr object);
00054 ~RubyExtension();
00055 private:
00059 static VALUE method_missing(int argc, VALUE *argv, VALUE self);
00066 static VALUE call_method( Kross::Api::Object::Ptr obj, int argc, VALUE *argv);
00070 static void delete_object(void* object);
00074 static void delete_exception(void* object);
00075 private:
00079 static bool isOfExceptionType(VALUE obj);
00083 static bool isOfObjectType(VALUE obj);
00084 private:
00089 static Kross::Api::Exception::Ptr convertToException(VALUE obj);
00093 static VALUE convertFromException(Kross::Api::Exception::Ptr exc);
00097 static int convertHash_i(VALUE key, VALUE value, VALUE vmap);
00103 static Kross::Api::Object::Ptr toObject(VALUE value);
00111 static VALUE toVALUE(const QString& s);
00112
00118 static VALUE toVALUE(QStringList list);
00119
00125 static VALUE toVALUE(QMap<QString, QVariant> map);
00126
00132 static VALUE toVALUE(QValueList<QVariant> list);
00138 static VALUE toVALUE(const QVariant& variant);
00139
00145 static VALUE toVALUE(Kross::Api::Object::Ptr object);
00146
00152 static VALUE toVALUE(Kross::Api::List::Ptr list);
00153 private:
00155 RubyExtensionPrivate* d;
00156 };
00157
00158 }
00159
00160 }
00161
00162 #endif
|