]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-document-layers.c
Fix mime type handling.
[evince.git] / libdocument / ev-document-layers.c
1 /* ev-document-layers.c
2  *  this file is part of evince, a gnome document_links viewer
3  * 
4  * Copyright (C) 2008 Carlos Garcia Campos  <carlosgc@gnome.org>
5  *
6  * Evince is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * Evince is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19  */
20
21 #include "config.h"
22
23 #include "ev-document-layers.h"
24
25 GType
26 ev_document_layers_get_type (void)
27 {
28         static GType type = 0;
29
30         if (G_UNLIKELY (type == 0)) {
31                 const GTypeInfo our_info = {
32                         sizeof (EvDocumentLayersIface),
33                         NULL,
34                         NULL,
35                 };
36
37                 type = g_type_register_static (G_TYPE_INTERFACE,
38                                                "EvDocumentLayers",
39                                                &our_info, (GTypeFlags)0);
40         }
41
42         return type;
43 }
44
45 gboolean
46 ev_document_layers_has_layers (EvDocumentLayers *document_layers)
47 {
48         EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
49
50         return iface->has_layers (document_layers);
51 }
52
53 GtkTreeModel *
54 ev_document_layers_get_layers (EvDocumentLayers *document_layers)
55 {
56         EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
57
58         return iface->get_layers (document_layers);
59 }
60
61 void
62 ev_document_layers_show_layer (EvDocumentLayers *document_layers,
63                                EvLayer          *layer)
64 {
65         EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
66
67         iface->show_layer (document_layers, layer);
68 }
69
70 void
71 ev_document_layers_hide_layer (EvDocumentLayers *document_layers,
72                                EvLayer          *layer)
73 {
74         EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
75
76         iface->hide_layer (document_layers, layer);
77 }
78
79 gboolean
80 ev_document_layers_layer_is_visible (EvDocumentLayers *document_layers,
81                                      EvLayer          *layer)
82 {
83         EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
84
85         return iface->layer_is_visible (document_layers, layer);
86 }