aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-06-05 23:49:22 +0800
committerXan Lopez <xan@gnome.org>2009-06-05 23:49:22 +0800
commit7792ee06ab725d997a2f288357cbe658525a120a (patch)
treed2754a1b938aa4637ef4291e0131b9fd6f300c36 /embed/ephy-embed.c
parentb8fa1b0cc55b60a0363a0cbe82e01e0d55e36e63 (diff)
downloadgsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar.gz
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar.bz2
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar.lz
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar.xz
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.tar.zst
gsoc2013-epiphany-7792ee06ab725d997a2f288357cbe658525a120a.zip
Kill EphyBaseEmbed, move the small widget logic it had to EphyEmbed.
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r--embed/ephy-embed.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index ad0a9f5f6..d3b092396 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -114,7 +114,7 @@ ephy_command_manager_iface_init (EphyCommandManagerIface *iface)
iface->can_do_command = impl_manager_can_do_command;
}
-G_DEFINE_TYPE_WITH_CODE (EphyEmbed, ephy_embed, EPHY_TYPE_BASE_EMBED,
+G_DEFINE_TYPE_WITH_CODE (EphyEmbed, ephy_embed, GTK_TYPE_BIN,
G_IMPLEMENT_INTERFACE (EPHY_TYPE_COMMAND_MANAGER,
ephy_command_manager_iface_init))
@@ -322,8 +322,55 @@ zoom_changed_cb (WebKitWebView *web_view,
}
static void
+ephy_embed_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ GtkWidget *child;
+
+ GTK_WIDGET_CLASS (ephy_embed_parent_class)->size_request (widget, requisition);
+
+ child = GTK_BIN (widget)->child;
+
+ if (child && GTK_WIDGET_VISIBLE (child)) {
+ GtkRequisition child_requisition;
+ gtk_widget_size_request (GTK_WIDGET (child), &child_requisition);
+ }
+}
+
+static void
+ephy_embed_size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation)
+{
+ GtkWidget *child;
+
+ widget->allocation = *allocation;
+
+ child = GTK_BIN (widget)->child;
+ g_return_if_fail (child != NULL);
+
+ gtk_widget_size_allocate (child, allocation);
+}
+
+static void
+ephy_embed_grab_focus (GtkWidget *widget)
+{
+ GtkWidget *child;
+
+ child = gtk_bin_get_child (GTK_BIN (widget));
+
+ if (child)
+ gtk_widget_grab_focus (child);
+}
+
+static void
ephy_embed_class_init (EphyEmbedClass *klass)
{
+ GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
+
+ widget_class->size_request = ephy_embed_size_request;
+ widget_class->size_allocate = ephy_embed_size_allocate;
+ widget_class->grab_focus = ephy_embed_grab_focus;
+
g_type_class_add_private (G_OBJECT_CLASS (klass), sizeof(EphyEmbedPrivate));
}