+2008-11-15 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * libdocument/Makefile.am:
+ * libdocument/ev-document-layers.[ch]:
+ * libdocument/ev-layer.[ch]:
+
+ Add optional content (layers) interface.
+
2008-11-12 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* cut-n-paste/toolbar-editor/eggtreemultidnd.c:
ev-document.h \
ev-document-images.h \
ev-document-info.h \
+ ev-document-layers.h \
ev-document-links.h \
ev-document-misc.h \
ev-document-security.h \
ev-file-helpers.h \
ev-form-field.h \
ev-image.h \
+ ev-layer.h \
ev-link-action.h \
ev-link-dest.h \
ev-link.h \
ev-attachment.c \
ev-backends-manager.c \
ev-backend-marshal.c \
+ ev-layer.c \
ev-link.c \
ev-link-action.c \
ev-link-dest.c \
ev-document-factory.c \
ev-document-thumbnails.c \
ev-document-fonts.c \
+ ev-document-layers.c \
ev-document-links.c \
ev-document-images.c \
ev-document-security.c \
--- /dev/null
+/* ev-document-layers.c
+ * this file is part of evince, a gnome document_links viewer
+ *
+ * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Evince is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "ev-document-layers.h"
+
+GType
+ev_document_layers_get_type (void)
+{
+ static GType type = 0;
+
+ if (G_UNLIKELY (type == 0)) {
+ const GTypeInfo our_info = {
+ sizeof (EvDocumentLayersIface),
+ NULL,
+ NULL,
+ };
+
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "EvDocumentLayers",
+ &our_info, (GTypeFlags)0);
+ }
+
+ return type;
+}
+
+gboolean
+ev_document_layers_has_layers (EvDocumentLayers *document_layers)
+{
+ EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
+
+ return iface->has_layers (document_layers);
+}
+
+GtkTreeModel *
+ev_document_layers_get_layers (EvDocumentLayers *document_layers)
+{
+ EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
+
+ return iface->get_layers (document_layers);
+}
+
+void
+ev_document_layers_show_layer (EvDocumentLayers *document_layers,
+ EvLayer *layer)
+{
+ EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
+
+ iface->show_layer (document_layers, layer);
+}
+
+void
+ev_document_layers_hide_layer (EvDocumentLayers *document_layers,
+ EvLayer *layer)
+{
+ EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
+
+ iface->hide_layer (document_layers, layer);
+}
+
+gboolean
+ev_document_layers_layer_is_visible (EvDocumentLayers *document_layers,
+ EvLayer *layer)
+{
+ EvDocumentLayersIface *iface = EV_DOCUMENT_LAYERS_GET_IFACE (document_layers);
+
+ return iface->layer_is_visible (document_layers, layer);
+}
--- /dev/null
+/* ev-document-layers.h
+ * this file is part of evince, a gnome document viewer
+ *
+ * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Evince is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EV_DOCUMENT_LAYERS_H
+#define EV_DOCUMENT_LAYERS_H
+
+#include <glib-object.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+
+#include "ev-layer.h"
+
+G_BEGIN_DECLS
+
+#define EV_TYPE_DOCUMENT_LAYERS (ev_document_layers_get_type ())
+#define EV_DOCUMENT_LAYERS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_LAYERS, EvDocumentLayers))
+#define EV_DOCUMENT_LAYERS_IFACE(k) (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_LAYERS, EvDocumentLayersIface))
+#define EV_IS_DOCUMENT_LAYERS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_LAYERS))
+#define EV_IS_DOCUMENT_LAYERS_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_LAYERS))
+#define EV_DOCUMENT_LAYERS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_LAYERS, EvDocumentLayersIface))
+
+typedef struct _EvDocumentLayers EvDocumentLayers;
+typedef struct _EvDocumentLayersIface EvDocumentLayersIface;
+
+enum {
+ EV_DOCUMENT_LAYERS_COLUMN_TITLE,
+ EV_DOCUMENT_LAYERS_COLUMN_LAYER,
+ EV_DOCUMENT_LAYERS_COLUMN_VISIBLE,
+ EV_DOCUMENT_LAYERS_COLUMN_ENABLED,
+ EV_DOCUMENT_LAYERS_COLUMN_SHOWTOGGLE,
+ EV_DOCUMENT_LAYERS_COLUMN_RBGROUP,
+ EV_DOCUMENT_LAYERS_N_COLUMNS
+};
+
+struct _EvDocumentLayersIface
+{
+ GTypeInterface base_iface;
+
+ /* Methods */
+ gboolean (* has_layers) (EvDocumentLayers *document_layers);
+ GtkTreeModel *(* get_layers) (EvDocumentLayers *document_layers);
+
+ void (* show_layer) (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+ void (* hide_layer) (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+ gboolean (* layer_is_visible) (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+};
+
+GType ev_document_layers_get_type (void) G_GNUC_CONST;
+
+gboolean ev_document_layers_has_layers (EvDocumentLayers *document_layers);
+GtkTreeModel *ev_document_layers_get_layers (EvDocumentLayers *document_layers);
+void ev_document_layers_show_layer (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+void ev_document_layers_hide_layer (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+gboolean ev_document_layers_layer_is_visible (EvDocumentLayers *document_layers,
+ EvLayer *layer);
+
+G_END_DECLS
+
+#endif /* EV_DOCUMENT_LAYERS_H */
--- /dev/null
+/* this file is part of evince, a gnome document viewer
+ *
+ * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Evince is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+
+#include "ev-layer.h"
+
+struct _EvLayerPrivate {
+ guint id;
+ gboolean is_parent;
+ gint rb_group;
+};
+
+#define EV_LAYER_GET_PRIVATE(object) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LAYER, EvLayerPrivate))
+
+G_DEFINE_TYPE (EvLayer, ev_layer, G_TYPE_OBJECT)
+
+static void
+ev_layer_class_init (EvLayerClass *klass)
+{
+ GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (g_object_class, sizeof (EvLayerPrivate));
+}
+
+static void
+ev_layer_init (EvLayer *layer)
+{
+ layer->priv = EV_LAYER_GET_PRIVATE (layer);
+}
+
+EvLayer *
+ev_layer_new (guint layer_id,
+ gboolean is_parent,
+ gint rb_group)
+{
+ EvLayer *layer;
+
+ layer = EV_LAYER (g_object_new (EV_TYPE_LAYER, NULL));
+ layer->priv->id = layer_id;
+ layer->priv->is_parent = is_parent;
+ layer->priv->rb_group = rb_group;
+
+ return layer;
+}
+
+guint
+ev_layer_get_id (EvLayer *layer)
+{
+ g_return_val_if_fail (EV_IS_LAYER (layer), 0);
+
+ return layer->priv->id;
+}
+
+gboolean
+ev_layer_is_parent (EvLayer *layer)
+{
+ g_return_val_if_fail (EV_IS_LAYER (layer), FALSE);
+
+ return layer->priv->is_parent;
+}
+
+gint
+ev_layer_get_rb_group (EvLayer *layer)
+{
+ g_return_val_if_fail (EV_IS_LAYER (layer), 0);
+
+ return layer->priv->rb_group;
+}
--- /dev/null
+/* this file is part of evince, a gnome document viewer
+ *
+ * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
+ *
+ * Evince is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __EV_LAYER_H__
+#define __EV_LAYER_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EvLayer EvLayer;
+typedef struct _EvLayerClass EvLayerClass;
+typedef struct _EvLayerPrivate EvLayerPrivate;
+
+#define EV_TYPE_LAYER (ev_layer_get_type())
+#define EV_LAYER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_LAYER, EvLayer))
+#define EV_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_LAYER, EvLayerClass))
+#define EV_IS_LAYER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_LAYER))
+#define EV_IS_LAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_LAYER))
+#define EV_LAYER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_LAYER, EvLayerClass))
+
+struct _EvLayer {
+ GObject base_instance;
+
+ EvLayerPrivate *priv;
+};
+
+struct _EvLayerClass {
+ GObjectClass base_class;
+};
+
+GType ev_layer_get_type (void) G_GNUC_CONST;
+EvLayer *ev_layer_new (guint layer_id,
+ gboolean is_parent,
+ gint rb_group);
+guint ev_layer_get_id (EvLayer *layer);
+gboolean ev_layer_is_parent (EvLayer *layer);
+gint ev_layer_get_rb_group (EvLayer *layer);
+
+G_END_DECLS
+
+#endif /* __EV_LAYER_H__ */