Пример #1
0
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);
}
Пример #2
0
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;
}
Пример #3
0
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;	
}
Пример #4
0
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;
}
Пример #5
0
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;
}
Пример #6
0
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;
}
Пример #7
0
/*******************
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;
}
Пример #8
0
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;
}
Пример #9
0
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;
}
Пример #10
0
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;
}
Пример #11
0
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;
}
Пример #12
0
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;
}