]> www.fi.muni.cz Git - evince.git/blob - shell/ev-sidebar-page.c
Hungarian translation added by "Last-Translator: \n".
[evince.git] / shell / ev-sidebar-page.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /*
3  *  Copyright (C) 2005 Marco Pesenti Gritti
4  *
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)
8  *  any later version.
9  *
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.
14  *
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.
18  *
19  */
20
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24
25 #include "ev-sidebar-page.h"
26
27 GType
28 ev_sidebar_page_get_type (void)
29 {
30         static GType type = 0;
31
32         if (G_UNLIKELY (type == 0))
33         {
34                 static const GTypeInfo sidebar_page_info =
35                 {
36                         sizeof (EvDocumentIface),
37                         NULL,
38                         NULL,
39                         NULL
40                 };
41
42                 type = g_type_register_static (G_TYPE_INTERFACE,
43                                                "EvSidebarPage",
44                                                &sidebar_page_info, (GTypeFlags)0);
45         }
46
47         return type;
48 }
49
50
51 gboolean 
52 ev_sidebar_page_support_document  (EvSidebarPage    *sidebar_page,
53                                    EvDocument *document)
54 {
55         EvSidebarPageIface *iface;
56
57         g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), FALSE);
58         g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
59
60         iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
61
62         g_return_val_if_fail (iface->set_document, FALSE);
63         
64         return iface->support_document (sidebar_page, document);    
65 }
66
67 void 
68 ev_sidebar_page_set_document      (EvSidebarPage    *sidebar_page,
69                                    EvDocument *document)
70 {
71         EvSidebarPageIface *iface;
72
73         g_return_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page));
74         g_return_if_fail (EV_IS_DOCUMENT (document));
75
76         iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
77
78         g_return_if_fail (iface->set_document);
79         
80         iface->set_document (sidebar_page, document);
81         
82         return;
83 }
84
85 const gchar*
86 ev_sidebar_page_get_label (EvSidebarPage    *sidebar_page)
87 {
88         EvSidebarPageIface *iface;
89
90         g_return_val_if_fail (EV_IS_SIDEBAR_PAGE (sidebar_page), NULL);
91
92         iface = EV_SIDEBAR_PAGE_GET_IFACE (sidebar_page);
93
94         g_return_val_if_fail (iface->get_label, NULL);
95         
96         return iface->get_label (sidebar_page);
97 }
98