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.
25 #include "ev-sidebar-page.h"
28 static void ev_sidebar_page_iface_init (gpointer iface);
31 ev_sidebar_page_get_type (void)
33 static GType type = 0;
35 if (G_UNLIKELY (type == 0))
37 const GTypeInfo sidebar_page_info =
39 sizeof (EvSidebarPageIface),
42 (GClassInitFunc)ev_sidebar_page_iface_init,
45 type = g_type_register_static (G_TYPE_INTERFACE,
47 &sidebar_page_info, (GTypeFlags)0);
55 ev_sidebar_page_support_document (EvSidebarPage *sidebar_page,
58 EvSidebarPageIface *iface;
60 g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), FALSE);
61 g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
63 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
65 g_return_val_if_fail (iface->set_document, FALSE);
67 return iface->support_document (sidebar_page, document);
71 ev_sidebar_page_set_document (EvSidebarPage *sidebar_page,
74 EvSidebarPageIface *iface;
76 g_return_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page));
77 g_return_if_fail (EV_IS_DOCUMENT (document));
79 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
81 g_return_if_fail (iface->set_document);
83 iface->set_document (sidebar_page, document);
89 ev_sidebar_page_get_label (EvSidebarPage *sidebar_page)
91 EvSidebarPageIface *iface;
93 g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), NULL);
95 iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
97 g_return_val_if_fail (iface->get_label, NULL);
99 return iface->get_label (sidebar_page);
103 static void ev_sidebar_page_iface_init (gpointer iface)
105 g_object_interface_install_property (iface,
106 g_param_spec_object ("main-widget",
108 "Main page widget, used to handle focus",