* Added an implicit type conversion operator so that a PlasmaScripting.Applet
[kdebindings.git] / ruby / qtwebkit / qtwebkit.cpp
blobaa5909ad000dcfe4a7f8b749ff0a176195d3a3e6
1 #include <ruby.h>
3 #include <QHash>
4 #include <QList>
5 #include <QtDebug>
7 #include <smoke/qtwebkit_smoke.h>
9 #include <qtruby.h>
11 #include <iostream>
13 static VALUE getClassList(VALUE /*self*/)
15 VALUE classList = rb_ary_new();
16 for (int i = 1; i < qtwebkit_Smoke->numClasses; i++) {
17 if (qtwebkit_Smoke->classes[i].className && !qtwebkit_Smoke->classes[i].external)
18 rb_ary_push(classList, rb_str_new2(qtwebkit_Smoke->classes[i].className));
20 return classList;
23 const char*
24 resolve_classname_qtwebkit(smokeruby_object * o)
26 return o->smoke->binding->className(o->classId);
29 extern TypeHandler QtWebKit_handlers[];
31 extern "C" {
33 VALUE qtwebkit_module;
34 VALUE qtwebkit_internal_module;
36 Q_DECL_EXPORT void
37 Init_qtwebkit()
39 init_qtwebkit_Smoke();
41 qtwebkit_Smoke->binding = new QtRubySmokeBinding(qtwebkit_Smoke);
43 smokeList << qtwebkit_Smoke;
45 QtRubyModule module = { "QtWebKit", resolve_classname_qtwebkit, 0 };
46 qtruby_modules[qtwebkit_Smoke] = module;
48 install_handlers(QtWebKit_handlers);
50 qtwebkit_module = rb_define_module("QtWebKit");
51 qtwebkit_internal_module = rb_define_module_under(qtwebkit_module, "Internal");
53 rb_define_singleton_method(qtwebkit_internal_module, "getClassList", (VALUE (*) (...)) getClassList, 0);
55 rb_require("qtwebkit/qtwebkit.rb");
56 rb_funcall(qtwebkit_internal_module, rb_intern("init_all_classes"), 0);