gluezilla_bind (CallbackBin *events, Handle *hwnd, PRInt32 width, PRInt32 height, const char * startDir, const char * dataDir, Platform platform) { Widget *widget = new Widget (strdup(startDir), strdup(dataDir), platform); Params * p = new Params (); p->name = "init"; p->instance = widget; p->events = events; nsresult result = widget->BeginInvoke (p); if (p) delete (p); if (!NS_SUCCEEDED(result)) return NULL; Handle * handle = hwnd; p = new Params (); p->name = "bind"; p->instance = widget; p->hwnd = hwnd; p->width = width; p->height = height; result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; p->hwnd = NULL; delete (p); } if (!NS_SUCCEEDED(result)) return NULL; return reinterpret_cast<Handle*>(widget); }
NS_METHOD_(int) gluezilla_createBrowserWindow (Handle *instance) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "create"; p->instance = widget; nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return result; }
gluezilla_shutdown (Handle *instance) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "shutdown"; p->instance = widget; nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return result; }
gluezilla_getServiceManager2 (Handle *instance) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "getServiceManager"; p->instance = widget; nsresult rv = widget->BeginInvoke (p); nsIServiceManager * ret (reinterpret_cast<nsIServiceManager *> (p->result)); NS_ADDREF(ret); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return ret; }
gluezilla_getWebNavigation (Handle *instance) { Widget * widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "getNavigation"; p->instance = widget; nsresult result = widget->BeginInvoke (p); nsIWebNavigation * ret (p->navigation); NS_ADDREF(ret); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return ret; }
gluezilla_reload (Handle *instance, ReloadOption option) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "reload"; p->instance = widget; p->option = option; nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return result; }
/******************* Layout *******************/ NS_METHOD_(int) gluezilla_focus (Handle *instance, FocusOption focus) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "focus"; p->instance = widget; p->focus = focus; nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return result; }
gluezilla_getDomDocument (Handle *instance) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "getDocument"; p->instance = widget; nsresult result = widget->BeginInvoke (p); nsIDOMHTMLDocument * ret (p->document); NS_ADDREF(ret); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return ret; }
NS_METHOD_(int) gluezilla_resize (Handle *instance, PRUint32 width, PRUint32 height) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "resize"; p->instance = widget; p->width = width; p->height = height; nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; delete (p); } return result; }
gluezilla_navigate (Handle *instance, const char * uri) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "navigate"; p->instance = widget; p->string = strdup (uri); nsresult result = widget->BeginInvoke (p); if (p) { p->name = NULL; p->instance = NULL; free (p->string); p->string = NULL; delete (p); } return result; }
gluezilla_evalScript (Handle *instance, const char * script) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "evalScript"; p->instance = widget; p->string = strdup (script); nsresult result = widget->BeginInvoke (p, FALSE); if (NS_FAILED(result)) return NULL; PRUnichar * string = p->uniString; if (p) { free (p->string); p->instance = NULL; p->name = NULL; delete (p); } return string; }
gluezilla_getProxyForObject (Handle *instance, REFNSIID iid, nsISupports *object, nsISupports ** result) { Widget *widget = reinterpret_cast<Widget *> (instance); Params * p = new Params (); p->name = "getProxyForObject"; p->instance = widget; p->object = object; p->iid = iid; nsresult rv = widget->BeginInvoke (p); NS_ADDREF(*result = p->result); NS_RELEASE (p->result); if (p) { p->name = NULL; p->instance = NULL; p->object = NULL; delete (p); } return; }