Implement a couple properties
This commit is contained in:
parent
4ac79faf03
commit
ebcf2da3c0
|
@ -46,6 +46,8 @@ static void _browser_destroy(BrowserWidget * browser);
|
||||||
|
|
||||||
static GtkWidget * _browser_get_widget(BrowserWidget * browser);
|
static GtkWidget * _browser_get_widget(BrowserWidget * browser);
|
||||||
|
|
||||||
|
static int _browser_set_property(BrowserWidget * browser, va_list ap);
|
||||||
|
|
||||||
|
|
||||||
/* public */
|
/* public */
|
||||||
/* variables */
|
/* variables */
|
||||||
|
@ -56,7 +58,8 @@ DesktopWidgetDefinition widget =
|
||||||
NULL,
|
NULL,
|
||||||
_browser_init,
|
_browser_init,
|
||||||
_browser_destroy,
|
_browser_destroy,
|
||||||
_browser_get_widget
|
_browser_get_widget,
|
||||||
|
_browser_set_property
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,3 +96,26 @@ static GtkWidget * _browser_get_widget(BrowserWidget * browser)
|
||||||
{
|
{
|
||||||
return browser_get_widget(browser->browser);
|
return browser_get_widget(browser->browser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* browser_set_property */
|
||||||
|
static int _browser_set_property(BrowserWidget * browser, va_list ap)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
String const * property;
|
||||||
|
String const * s;
|
||||||
|
unsigned int u;
|
||||||
|
|
||||||
|
while((property = va_arg(ap, String const *)) != NULL)
|
||||||
|
if(strcmp(property, "location") == 0)
|
||||||
|
{
|
||||||
|
s = va_arg(ap, String const *);
|
||||||
|
ret = browser_set_location(browser->browser, s);
|
||||||
|
}
|
||||||
|
else if(strcmp(property, "view") == 0)
|
||||||
|
{
|
||||||
|
u = va_arg(ap, unsigned int);
|
||||||
|
browser_set_view(browser->browser, u);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user