Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 63 lines (45 sloc) 1.487 kb
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
#include "JSObject.h"
#include "variant_list.h"
#include "DOM/Document.h"

#include "VideoWindowAPI.h"
// #include "common.h"
#include "lock.h"



#define mmethod(name) make_method(this, &VideoWindowAPI::name)
#define rmethod(name) registerMethod(#name, make_method(this, &VideoWindowAPI::call_##name))
#define rmethod2(name, func) registerMethod(#name, make_method(this, &VideoWindowAPI::call_##func))
#define rproperty(name) registerProperty(#name, make_property(this, &VideoWindowAPI::get_##name, &VideoWindowAPI::set_##name))
#define rpropertyg(name) registerProperty(#name, make_property(this, &VideoWindowAPI::get_##name))



VideoWindowAPI::VideoWindowAPI(const linphonePtr& plugin, const FB::BrowserHostPtr& host) :
    m_plugin(plugin), m_host(host)
{
  printf("VideoWindowAPI instance\n");

  // Register exported methods
  rmethod(test);

  // Register properties
  rproperty(x);
  rpropertyg(pluginWindowId);
}

VideoWindowAPI::~VideoWindowAPI()
{
  printf("deallocating VideoWindowAPI instance\n");
}

linphonePtr VideoWindowAPI::getPlugin()
{
    linphonePtr plugin(m_plugin.lock());
    if (!plugin) {
        throw FB::script_error("The plugin is invalid");
    }
    return plugin;
}



bool VideoWindowAPI::call_test(std::string uri) {
  return true;
}

std::string VideoWindowAPI::get_x(void) {
 return _x;
}

void VideoWindowAPI::set_x(std::string x) {
  _x = x;
}

unsigned long VideoWindowAPI::get_pluginWindowId(void) {
return getPlugin()->getNativeWindowId();
}
Something went wrong with that request. Please try again.