oboy/src/qt/oboy.cpp

32 lines
657 B
C++
Raw Normal View History

2019-05-11 20:00:33 +02:00
#include "oboy.h"
2019-05-11 21:13:09 +02:00
#include <caml/mlvalues.h>
#include <caml/callback.h>
2019-05-11 20:00:33 +02:00
OBoy::OBoy(QObject *parent) : QObject(parent)
{
}
2019-05-11 21:13:09 +02:00
QString OBoy::name() const
{
2019-05-14 13:54:17 +02:00
value * closure_f = caml_named_value("oboy_name");
2019-05-11 21:13:09 +02:00
if (closure_f == nullptr) {
return QString("<Unreachable>");
}
const char *str = String_val(caml_callback(*closure_f, Val_unit));
return QString(str);
}
QString OBoy::version() const
{
2019-05-14 13:54:17 +02:00
value * closure_f = caml_named_value("oboy_version");
2019-05-11 21:13:09 +02:00
if (closure_f == nullptr) {
return QString("<Unreachable>");
}
const char *str = String_val(caml_callback(*closure_f, Val_unit));
return QString(str);
}