aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-container.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2007-11-17 03:14:38 +0800
committerXan Lopez <xan@src.gnome.org>2007-11-17 03:14:38 +0800
commit7eadb5acd98f20acabb002f7975804dc5c5c8200 (patch)
treed080b22d3b60f324b71f61eab9106cab1beb8138 /embed/ephy-embed-container.c
parentbb91baf251c755a40fc3a167741797680fba5efb (diff)
downloadgsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar.gz
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar.bz2
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar.lz
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar.xz
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.tar.zst
gsoc2013-epiphany-7eadb5acd98f20acabb002f7975804dc5c5c8200.zip
Add type checkings in the EmbedContainer interface, not in the implementations.
svn path=/trunk/; revision=7706
Diffstat (limited to 'embed/ephy-embed-container.c')
-rw-r--r--embed/ephy-embed-container.c47
1 files changed, 40 insertions, 7 deletions
diff --git a/embed/ephy-embed-container.c b/embed/ephy-embed-container.c
index 083730185..704e61b51 100644
--- a/embed/ephy-embed-container.c
+++ b/embed/ephy-embed-container.c
@@ -87,7 +87,12 @@ ephy_embed_container_add_child (EphyEmbedContainer *container,
gint position,
gboolean jump_to)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), -1);
+ g_return_val_if_fail (EPHY_IS_EMBED (child), -1);
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->add_child (container, child, position, jump_to);
}
@@ -102,7 +107,13 @@ void
ephy_embed_container_set_active_child (EphyEmbedContainer *container,
EphyEmbed *child)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_if_fail (EPHY_IS_EMBED_CONTAINER (container));
+ g_return_if_fail (EPHY_IS_EMBED (child));
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+
iface->set_active_child (container, child);
}
@@ -117,7 +128,13 @@ void
ephy_embed_container_remove_child (EphyEmbedContainer *container,
EphyEmbed *child)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_if_fail (EPHY_IS_EMBED_CONTAINER (container));
+ g_return_if_fail (EPHY_IS_EMBED (child));
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+
iface->remove_child (container, child);
}
@@ -132,7 +149,11 @@ ephy_embed_container_remove_child (EphyEmbedContainer *container,
EphyEmbed *
ephy_embed_container_get_active_child (EphyEmbedContainer *container)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), NULL);
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_active_child (container);
}
@@ -147,7 +168,11 @@ ephy_embed_container_get_active_child (EphyEmbedContainer *container)
GList *
ephy_embed_container_get_children (EphyEmbedContainer *container)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), NULL);
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_children (container);
}
@@ -162,7 +187,11 @@ ephy_embed_container_get_children (EphyEmbedContainer *container)
gboolean
ephy_embed_container_get_is_popup (EphyEmbedContainer *container)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), FALSE);
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_is_popup (container);
}
@@ -178,7 +207,11 @@ ephy_embed_container_get_is_popup (EphyEmbedContainer *container)
EphyEmbedChrome
ephy_embed_container_get_chrome (EphyEmbedContainer *container)
{
- EphyEmbedContainerIface *iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
+ EphyEmbedContainerIface *iface;
+
+ g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), 0);
+
+ iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_chrome (container);
}