]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-layer.c
[windows] Do not use g_content_type_guess() on Windows
[evince.git] / libdocument / ev-layer.c
1 /* this file is part of evince, a gnome document viewer
2  *
3  * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
4  *
5  * Evince is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * Evince is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * 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 #include <config.h>
21
22 #include "ev-layer.h"
23
24 struct _EvLayerPrivate {
25         guint      id;
26         gboolean   is_parent;
27         gint       rb_group;
28 };
29
30 #define EV_LAYER_GET_PRIVATE(object) \
31                 (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LAYER, EvLayerPrivate))
32
33 G_DEFINE_TYPE (EvLayer, ev_layer, G_TYPE_OBJECT)
34
35 static void
36 ev_layer_class_init (EvLayerClass *klass)
37 {
38         GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
39
40         g_type_class_add_private (g_object_class, sizeof (EvLayerPrivate));
41 }
42
43 static void
44 ev_layer_init (EvLayer *layer)
45 {
46         layer->priv = EV_LAYER_GET_PRIVATE (layer);
47 }
48
49 EvLayer *
50 ev_layer_new (guint    layer_id,
51               gboolean is_parent,
52               gint     rb_group)
53 {
54         EvLayer *layer;
55
56         layer = EV_LAYER (g_object_new (EV_TYPE_LAYER, NULL));
57         layer->priv->id = layer_id;
58         layer->priv->is_parent = is_parent;
59         layer->priv->rb_group = rb_group;
60
61         return layer;
62 }
63
64 guint
65 ev_layer_get_id (EvLayer *layer)
66 {
67         g_return_val_if_fail (EV_IS_LAYER (layer), 0);
68
69         return layer->priv->id;
70 }
71
72 gboolean
73 ev_layer_is_parent (EvLayer *layer)
74 {
75         g_return_val_if_fail (EV_IS_LAYER (layer), FALSE);
76
77         return layer->priv->is_parent;
78 }
79
80 gint
81 ev_layer_get_rb_group (EvLayer *layer)
82 {
83         g_return_val_if_fail (EV_IS_LAYER (layer), 0);
84
85         return layer->priv->rb_group;
86 }