/usr/include/qtruby/marshall_types.h is in libqtruby4shared-dev 4:4.8.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | /***************************************************************************
marshall_types.h - Derived from the PerlQt sources, see AUTHORS
for details
-------------------
begin : Fri Jul 4 2003
copyright : (C) 2003-2006 by Richard Dale
email : Richard_Dale@tipitina.demon.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
***************************************************************************/
#ifndef MARSHALL_TYPES_H
#define MARSHALL_TYPES_H
#include <QtCore/qstring.h>
#include <QtCore/qobject.h>
#include <QtCore/qmetaobject.h>
#include <smoke.h>
#include "marshall.h"
#include "qtruby.h"
#include "smokeruby.h"
Marshall::HandlerFn getMarshallFn(const SmokeType &type);
extern void smokeStackToQtStack(Smoke::Stack stack, void ** o, int start, int end, QList<MocArgument*> args);
extern void smokeStackFromQtStack(Smoke::Stack stack, void ** _o, int start, int end, QList<MocArgument*> args);
namespace QtRuby {
class Q_DECL_EXPORT MethodReturnValueBase : public Marshall
{
public:
MethodReturnValueBase(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack);
const Smoke::Method &method();
Smoke::StackItem &item();
Smoke *smoke();
SmokeType type();
void next();
bool cleanup();
void unsupported();
VALUE * var();
protected:
Smoke *_smoke;
Smoke::Index _method;
Smoke::Stack _stack;
SmokeType _st;
VALUE *_retval;
virtual const char *classname();
};
class Q_DECL_EXPORT VirtualMethodReturnValue : public MethodReturnValueBase {
public:
VirtualMethodReturnValue(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE retval);
Marshall::Action action();
private:
VALUE _retval2;
};
class Q_DECL_EXPORT MethodReturnValue : public MethodReturnValueBase {
public:
MethodReturnValue(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE * retval);
Marshall::Action action();
private:
const char *classname();
};
class Q_DECL_EXPORT MethodCallBase : public Marshall
{
public:
MethodCallBase(Smoke *smoke, Smoke::Index meth);
MethodCallBase(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack);
Smoke *smoke();
SmokeType type();
Smoke::StackItem &item();
const Smoke::Method &method();
virtual int items() = 0;
virtual void callMethod() = 0;
void next();
void unsupported();
protected:
Smoke *_smoke;
Smoke::Index _method;
Smoke::Stack _stack;
int _cur;
Smoke::Index *_args;
bool _called;
VALUE *_sp;
virtual const char* classname();
};
class Q_DECL_EXPORT VirtualMethodCall : public MethodCallBase {
public:
VirtualMethodCall(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, VALUE obj, VALUE *sp);
~VirtualMethodCall();
Marshall::Action action();
VALUE * var();
int items();
void callMethod();
bool cleanup();
private:
VALUE _obj;
};
class Q_DECL_EXPORT MethodCall : public MethodCallBase {
public:
MethodCall(Smoke *smoke, Smoke::Index method, VALUE target, VALUE *sp, int items);
~MethodCall();
Marshall::Action action();
VALUE * var();
inline void callMethod() {
if(_called) return;
_called = true;
if (_target == Qnil && !(method().flags & Smoke::mf_static)) {
rb_raise(rb_eArgError, "%s is not a class method\n", _smoke->methodNames[method().name]);
}
Smoke::ClassFn fn = _smoke->classes[method().classId].classFn;
void * ptr = 0;
if (_o != 0) {
const Smoke::Class &cl = _smoke->classes[method().classId];
ptr = _o->smoke->cast( _o->ptr,
_o->classId,
_o->smoke->idClass(cl.className, true).index );
}
_items = -1;
(*fn)(method().method, ptr, _stack);
if (method().flags & Smoke::mf_ctor) {
Smoke::StackItem s[2];
s[1].s_voidp = qtruby_modules[_smoke].binding;
(*fn)(0, _stack[0].s_voidp, s);
}
MethodReturnValue r(_smoke, _method, _stack, &_retval);
}
int items();
bool cleanup();
private:
VALUE _target;
smokeruby_object * _o;
VALUE *_sp;
int _items;
VALUE _retval;
const char *classname();
};
class Q_DECL_EXPORT SigSlotBase : public Marshall {
public:
SigSlotBase(QList<MocArgument*> args);
~SigSlotBase();
const MocArgument &arg();
SmokeType type();
Smoke::StackItem &item();
VALUE * var();
Smoke *smoke();
virtual const char *mytype() = 0;
virtual void mainfunction() = 0;
void unsupported();
void next();
void prepareReturnValue(void** o);
protected:
QList<MocArgument*> _args;
int _cur;
bool _called;
Smoke::Stack _stack;
int _items;
VALUE *_sp;
};
class Q_DECL_EXPORT EmitSignal : public SigSlotBase {
QObject *_obj;
int _id;
VALUE * _result;
public:
EmitSignal(QObject *obj, int id, int items, QList<MocArgument*> args, VALUE * sp, VALUE * result);
Marshall::Action action();
Smoke::StackItem &item();
const char *mytype();
void emitSignal();
void mainfunction();
bool cleanup();
};
class Q_DECL_EXPORT InvokeNativeSlot : public SigSlotBase {
QObject *_obj;
int _id;
VALUE * _result;
public:
InvokeNativeSlot(QObject *obj, int id, int items, QList<MocArgument*> args, VALUE * sp, VALUE * result);
Marshall::Action action();
Smoke::StackItem &item();
const char *mytype();
void invokeSlot();
void mainfunction();
bool cleanup();
};
class Q_DECL_EXPORT InvokeSlot : public SigSlotBase {
VALUE _obj;
ID _slotname;
void **_o;
public:
InvokeSlot(VALUE obj, ID slotname, QList<MocArgument*> args, void ** o);
~InvokeSlot();
Marshall::Action action();
const char *mytype();
bool cleanup();
void copyArguments();
void invokeSlot();
void mainfunction();
};
}
#endif
|