#include <iostream>
#include <string>
#include <lvtk/gtkui.hpp>
#include "workhorse.h"
using namespace Gtk;
using std::cout;
using Glib::ustring;
class WorkhorseGtk :
public UI<WorkhorseGtk, GtkUI<true>,
URID<true>, UIResize<false>,
DataAccess<false>, Parent<false>,
InstanceAccess<false> >
{
public:
WorkhorseGtk (const char* plugin_uri)
: plugin (NULL)
{
setup_instance_access();
if (LV2UI_Widget* parent = get_parent())
std::cout << "[WorkhorseGtk] got a parent\n";
else
std::cout << "[WorkhorseGtk] didn't get a parent\n";
Button *btn = manage (new Button(ustring("Workhorse")));
add (*btn);
}
private:
void
setup_instance_access()
{
plugin = get_instance();
if (plugin) {
cout << "[WorkhorseGtk] got plugin instance\n";
} else {
cout << "[WorkhorseGtk] didn't get plugin instance\n";
plugin = 0;
}
}
Handle plugin;
};
int _ = WorkhorseGtk::register_class ("http://lvtoolkit.org/plugins/workhorse#ui");