1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
3 * Copyright (C) 2005 Marco Pesenti Gritti
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include "ev-sidebar-page.h"
29 static void ev_sidebar_page_iface_init (gpointer iface);
32 ev_sidebar_page_get_type (void)
34 static GType type = 0;
36 if (G_UNLIKELY (type == 0))
38 const GTypeInfo sidebar_page_info =
40 sizeof (EvSidebarPageIface),
43 (GClassInitFunc)ev_sidebar_page_iface_init,
46 type = g_type_register_static (G_TYPE_INTERFACE,
48 &sidebar_page_info, (GTypeFlags)0);
56 ev_sidebar_page_support_document (EvSidebarPage *sidebar_page,
59 EvSidebarPageIface *iface;
61 g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), FALSE);
62 g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
64 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
66 g_return_val_if_fail (iface->set_document, FALSE);
68 return iface->support_document (sidebar_page, document);
72 ev_sidebar_page_set_document (EvSidebarPage *sidebar_page,
75 EvSidebarPageIface *iface;
77 g_return_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page));
78 g_return_if_fail (EV_IS_DOCUMENT (document));
80 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
82 g_return_if_fail (iface->set_document);
84 iface->set_document (sidebar_page, document);
90 ev_sidebar_page_get_label (EvSidebarPage *sidebar_page)
92 EvSidebarPageIface *iface;
94 g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), NULL);
96 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
98 g_return_val_if_fail (iface->get_label, NULL);
100 return iface->get_label (sidebar_page);
104 static void ev_sidebar_page_iface_init (gpointer iface)
106 g_object_interface_install_property (iface,
107 g_param_spec_object ("main-widget",
109 "Main page widget, used to handle focus",