]> www.fi.muni.cz Git - evince.git/commitdiff
Rename bookmark to link, and use "Index" for the sidebar panel.
authorMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 10 Jan 2005 19:08:15 +0000 (19:08 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 10 Jan 2005 19:08:15 +0000 (19:08 +0000)
23 files changed:
ChangeLog
backend/Makefile.am
backend/ev-bookmark.h [deleted file]
backend/ev-document-bookmarks.c [deleted file]
backend/ev-document-bookmarks.h [deleted file]
backend/ev-document-links.c [new file with mode: 0644]
backend/ev-document-links.h [new file with mode: 0644]
backend/ev-link.c [moved from backend/ev-bookmark.c with 52% similarity]
backend/ev-link.h [new file with mode: 0644]
pdf/xpdf/pdf-document.cc
shell/Makefile.am
shell/ev-application.c
shell/ev-application.h
shell/ev-history.c
shell/ev-history.h
shell/ev-sidebar-bookmarks.h [deleted file]
shell/ev-sidebar-links.c [moved from shell/ev-sidebar-bookmarks.c with 55% similarity]
shell/ev-sidebar-links.h [new file with mode: 0644]
shell/ev-sidebar.c
shell/ev-view.c
shell/ev-view.h
shell/ev-window.c
shell/ev-window.h

index e7692c88a5f884a67734c6d55b774f7a992d201f..5adbe5f28517d2246e410f09ab9da249cf0e4fdc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2005-01-10  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * backend/Makefile.am:
+       * backend/ev-bookmark.c:
+       * backend/ev-bookmark.h:
+       * backend/ev-document-bookmarks.c:
+       * backend/ev-document-bookmarks.h:
+       * backend/ev-document-links.c: (ev_document_links_get_type),
+       (ev_document_links_has_document_links),
+       (ev_document_links_begin_read), (ev_document_links_get_link),
+       (ev_document_links_get_child), (ev_document_links_next),
+       (ev_document_links_free_iter):
+       * backend/ev-document-links.h:
+       * backend/ev-link.c: (ev_link_type_get_type), (ev_link_get_title),
+       (ev_link_set_title), (ev_link_get_uri), (ev_link_set_uri),
+       (ev_link_get_link_type), (ev_link_set_link_type),
+       (ev_link_get_page), (ev_link_set_page), (ev_link_get_property),
+       (ev_link_set_property), (ev_window_dispose), (ev_link_init),
+       (ev_link_class_init), (ev_link_new_title), (ev_link_new_page),
+       (ev_link_new_external):
+       * backend/ev-link.h:
+       * pdf/xpdf/pdf-document.cc:
+       * shell/Makefile.am:
+       * shell/ev-application.c: (ev_application_open_link):
+       * shell/ev-application.h:
+       * shell/ev-history.c: (ev_history_add_link), (ev_history_add_page),
+       (ev_history_get_link_nth):
+       * shell/ev-history.h:
+       * shell/ev-sidebar-bookmarks.c:
+       * shell/ev-sidebar-bookmarks.h:
+       * shell/ev-sidebar-links.c: (ev_sidebar_links_destroy),
+       (ev_sidebar_links_class_init), (selection_changed_cb),
+       (ev_sidebar_links_construct), (ev_sidebar_links_init),
+       (links_page_num_func), (ev_sidebar_links_new), (stack_data_free),
+       (do_one_iteration), (populate_links_idle),
+       (ev_sidebar_links_clear_document), (ev_sidebar_links_set_document):
+       * shell/ev-sidebar-links.h:
+       * shell/ev-sidebar.c: (ev_sidebar_set_document):
+       * shell/ev-view.c: (go_to_link), (ev_view_go_to_link),
+       (go_to_index):
+       * shell/ev-view.h:
+       * shell/ev-window.c: (ev_window_open_link), (ev_window_init):
+       * shell/ev-window.h:
+
+       Rename bookmark to link, and use "Index" for the sidebar panel.
+
 2005-01-09  Marco Pesenti Gritti  <marco@gnome.org>
 
        * shell/Makefile.am:
index 03a9103348b0f2bb648b9c0b1e78054ab7f81d8a..ea599fd3d5c01b435da6e3bb5e338bc7cc545377 100644 (file)
@@ -11,14 +11,14 @@ noinst_LTLIBRARIES = libevbackend.la
 
 libevbackend_la_SOURCES=                       \
        ev-backend-marshal.c                    \
-       ev-bookmark.c                           \
-       ev-bookmark.h                           \
+       ev-link.c                               \
+       ev-link.h                               \
        ev-document.c                           \
        ev-document.h                           \
        ev-document-thumbnails.c                \
        ev-document-thumbnails.h                \
-       ev-document-bookmarks.c                 \
-       ev-document-bookmarks.h                 \
+       ev-document-links.c                     \
+       ev-document-links.h                     \
        ev-document-find.c                      \
        ev-document-find.h                      \
        ev-ps-exporter.c                        \
diff --git a/backend/ev-bookmark.h b/backend/ev-bookmark.h
deleted file mode 100644 (file)
index 654ee94..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* this file is part of evince, a gnome document viewer
- *
- *  Copyright (C) 2005 Red Hat, Inc.
- *
- * 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_BOOKMARK_H
-#define EV_BOOKMARK_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-typedef struct _EvBookmark EvBookmark;
-typedef struct _EvBookmarkClass EvBookmarkClass;
-typedef struct _EvBookmarkPrivate EvBookmarkPrivate;
-
-#define EV_TYPE_BOOKMARK               (ev_bookmark_get_type())
-#define EV_BOOKMARK(object)            (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_BOOKMARK, EvBookmark))
-#define EV_BOOKMARK_CLASS(klass)       (G_TYPE_CHACK_CLASS_CAST((klass), EV_TYPE_BOOKMARK, EvBookmarkClass))
-#define EV_IS_BOOKMARK(object)         (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_BOOKMARK))
-#define EV_IS_BOOKMARK_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_BOOKMARK))
-#define EV_BOOKMARK_GET_CLASS(object)  (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_BOOKMARK, EvBookmarkClass))
-
-#define EV_TYPE_BOOKMARK_TYPE (ev_bookmark_type_get_type ())
-
-typedef enum
-{
-       EV_BOOKMARK_TYPE_TITLE,
-       EV_BOOKMARK_TYPE_LINK,
-       EV_BOOKMARK_TYPE_EXTERNAL_URI
-} EvBookmarkType;
-
-struct _EvBookmark {
-       GObject base_instance;
-       EvBookmarkPrivate *priv;
-};
-
-struct _EvBookmarkClass {
-       GObjectClass base_class;
-};
-
-GType           ev_bookmark_type_get_type       (void);
-GType          ev_bookmark_get_type            (void);
-
-EvBookmark     *ev_bookmark_new_title          (const char     *title);
-EvBookmark     *ev_bookmark_new_link           (const char     *title,
-                                                int             page);
-EvBookmark     *ev_bookmark_new_external       (const char     *title,
-                                                const char     *uri);
-const char     *ev_bookmark_get_title          (EvBookmark     *bookmark);
-void           ev_bookmark_set_title           (EvBookmark     *bookmark,
-                                                const char     *title);
-const char     *ev_bookmark_get_uri            (EvBookmark     *bookmark);
-void           ev_bookmark_set_uri             (EvBookmark     *bookmark,
-                                                const char     *uri);
-EvBookmarkType  ev_bookmark_get_bookmark_type  (EvBookmark     *bookmark);
-void           ev_bookmark_set_bookmark_type   (EvBookmark     *bookmark,
-                                                EvBookmarkType  type);
-int            ev_bookmark_get_page            (EvBookmark     *bookmark);
-void           ev_bookmark_set_page            (EvBookmark     *bookmark,
-                                                int             page);
-
-G_END_DECLS
-
-#endif /* !EV_BOOKMARK_H */
diff --git a/backend/ev-document-bookmarks.c b/backend/ev-document-bookmarks.c
deleted file mode 100644 (file)
index 7b0d141..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ev-document-bookmarks.h
- *  this file is part of evince, a gnome document_bookmarks viewer
- * 
- * Copyright (C) 2004 Red Hat, Inc.
- *
- * Author:
- *   Jonathan Blandford <jrb@alum.mit.edu>
- *
- * 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-bookmarks.h"
-
-GType
-ev_document_bookmarks_get_type (void)
-{
-       static GType type = 0;
-
-       if (G_UNLIKELY (type == 0))
-       {
-               static const GTypeInfo our_info =
-               {
-                       sizeof (EvDocumentBookmarksIface),
-                       NULL,
-                       NULL,
-               };
-
-               type = g_type_register_static (G_TYPE_INTERFACE,
-                                              "EvDocumentBookmarks",
-                                              &our_info, (GTypeFlags)0);
-       }
-
-       return type;
-}
-
-gboolean
-ev_document_bookmarks_has_document_bookmarks (EvDocumentBookmarks *document_bookmarks)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-       return iface->has_document_bookmarks (document_bookmarks);
-}
-
-EvDocumentBookmarksIter *
-ev_document_bookmarks_begin_read (EvDocumentBookmarks *document_bookmarks)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-
-       return iface->begin_read (document_bookmarks);
-}
-
-EvBookmark * 
-ev_document_bookmarks_get_bookmark (EvDocumentBookmarks      *document_bookmarks,
-                                   EvDocumentBookmarksIter  *iter)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-
-       return iface->get_bookmark (document_bookmarks, iter);
-}
-
-EvDocumentBookmarksIter *
-ev_document_bookmarks_get_child (EvDocumentBookmarks     *document_bookmarks,
-                                EvDocumentBookmarksIter *iter)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-
-       return iface->get_child (document_bookmarks, iter);
-}
-
-
-gboolean 
-ev_document_bookmarks_next (EvDocumentBookmarks     *document_bookmarks,
-                           EvDocumentBookmarksIter *iter)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-
-       return iface->next (document_bookmarks, iter);
-}
-
-
-void
-ev_document_bookmarks_free_iter (EvDocumentBookmarks     *document_bookmarks,
-                                EvDocumentBookmarksIter *iter)
-{
-       EvDocumentBookmarksIface *iface = EV_DOCUMENT_BOOKMARKS_GET_IFACE (document_bookmarks);
-
-       iface->free_iter (document_bookmarks, iter);
-}
diff --git a/backend/ev-document-bookmarks.h b/backend/ev-document-bookmarks.h
deleted file mode 100644 (file)
index 6ee36a7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ev-document-bookmarks.h
- *  this file is part of evince, a gnome document_bookmarks viewer
- * 
- * Copyright (C) 2004 Red Hat, Inc.
- *
- * Author:
- *   Jonathan Blandford <jrb@alum.mit.edu>
- *
- * 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.
- */
-
-/* Acrobat insists on calling the TOC a bookmark, b/c they allow people to add
- * their own..  We will continue this convention despite it being an obviously
- * bad name.
- */
-
-#ifndef EV_DOCUMENT_BOOKMARKS_H
-#define EV_DOCUMENT_BOOKMARKS_H
-
-#include <glib-object.h>
-#include <glib.h>
-#include <gdk/gdk.h>
-
-#include "ev-document.h"
-#include "ev-bookmark.h"
-
-G_BEGIN_DECLS
-
-
-#define EV_TYPE_DOCUMENT_BOOKMARKS           (ev_document_bookmarks_get_type ())
-#define EV_DOCUMENT_BOOKMARKS(o)             (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_BOOKMARKS, EvDocumentBookmarks))
-#define EV_DOCUMENT_BOOKMARKS_IFACE(k)       (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_BOOKMARKS, EvDocumentBookmarksIface))
-#define EV_IS_DOCUMENT_BOOKMARKS(o)          (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_BOOKMARKS))
-#define EV_IS_DOCUMENT_BOOKMARKS_IFACE(k)     (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_BOOKMARKS))
-#define EV_DOCUMENT_BOOKMARKS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_BOOKMARKS, EvDocumentBookmarksIface))
-
-typedef struct _EvDocumentBookmarks            EvDocumentBookmarks;
-typedef struct _EvDocumentBookmarksIface       EvDocumentBookmarksIface;
-typedef struct _EvDocumentBookmarksIter        EvDocumentBookmarksIter;
-
-struct _EvDocumentBookmarksIface
-{
-       GTypeInterface base_iface;
-
-       /* Methods  */
-       gboolean                 (* has_document_bookmarks) (EvDocumentBookmarks      *document_bookmarks);
-       EvDocumentBookmarksIter *(* begin_read)             (EvDocumentBookmarks      *document_bookmarks);
-       EvBookmark              *(* get_bookmark)           (EvDocumentBookmarks      *document_bookmarks,
-                                                            EvDocumentBookmarksIter  *iter);
-       EvDocumentBookmarksIter *(* get_child)              (EvDocumentBookmarks      *document_bookmarks,
-                                                            EvDocumentBookmarksIter  *iter);
-       gboolean                 (* next)                   (EvDocumentBookmarks      *document_bookmarks,
-                                                            EvDocumentBookmarksIter  *iter);
-       void                     (* free_iter)              (EvDocumentBookmarks      *document_bookmarks,
-                                                            EvDocumentBookmarksIter  *iter);
-};
-
-GType                    ev_document_bookmarks_get_type               (void);
-gboolean                 ev_document_bookmarks_has_document_bookmarks (EvDocumentBookmarks      *document_bookmarks);
-EvDocumentBookmarksIter *ev_document_bookmarks_begin_read             (EvDocumentBookmarks      *document_bookmarks);
-EvBookmark             *ev_document_bookmarks_get_bookmark           (EvDocumentBookmarks      *document_bookmarks,
-                                                                      EvDocumentBookmarksIter  *iter);
-EvDocumentBookmarksIter *ev_document_bookmarks_get_child              (EvDocumentBookmarks      *document_bookmarks,
-                                                                      EvDocumentBookmarksIter  *iter);
-gboolean                 ev_document_bookmarks_next                   (EvDocumentBookmarks      *document_bookmarks,
-                                                                      EvDocumentBookmarksIter  *iter);
-void                     ev_document_bookmarks_free_iter              (EvDocumentBookmarks      *document_bookmarks,
-                                                                      EvDocumentBookmarksIter  *iter);
-
-
-G_END_DECLS
-
-#endif
diff --git a/backend/ev-document-links.c b/backend/ev-document-links.c
new file mode 100644 (file)
index 0000000..242efb6
--- /dev/null
@@ -0,0 +1,101 @@
+/* ev-document-links.h
+ *  this file is part of evince, a gnome document_links viewer
+ * 
+ * Copyright (C) 2004 Red Hat, Inc.
+ *
+ * Author:
+ *   Jonathan Blandford <jrb@alum.mit.edu>
+ *
+ * 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-links.h"
+
+GType
+ev_document_links_get_type (void)
+{
+       static GType type = 0;
+
+       if (G_UNLIKELY (type == 0))
+       {
+               static const GTypeInfo our_info =
+               {
+                       sizeof (EvDocumentLinksIface),
+                       NULL,
+                       NULL,
+               };
+
+               type = g_type_register_static (G_TYPE_INTERFACE,
+                                              "EvDocumentLinks",
+                                              &our_info, (GTypeFlags)0);
+       }
+
+       return type;
+}
+
+gboolean
+ev_document_links_has_document_links (EvDocumentLinks *document_links)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+       return iface->has_document_links (document_links);
+}
+
+EvDocumentLinksIter *
+ev_document_links_begin_read (EvDocumentLinks *document_links)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+
+       return iface->begin_read (document_links);
+}
+
+EvLink * 
+ev_document_links_get_link (EvDocumentLinks      *document_links,
+                           EvDocumentLinksIter  *iter)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+
+       return iface->get_link (document_links, iter);
+}
+
+EvDocumentLinksIter *
+ev_document_links_get_child (EvDocumentLinks     *document_links,
+                            EvDocumentLinksIter *iter)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+
+       return iface->get_child (document_links, iter);
+}
+
+
+gboolean 
+ev_document_links_next (EvDocumentLinks     *document_links,
+                       EvDocumentLinksIter *iter)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+
+       return iface->next (document_links, iter);
+}
+
+
+void
+ev_document_links_free_iter (EvDocumentLinks     *document_links,
+                            EvDocumentLinksIter *iter)
+{
+       EvDocumentLinksIface *iface = EV_DOCUMENT_LINKS_GET_IFACE (document_links);
+
+       iface->free_iter (document_links, iter);
+}
diff --git a/backend/ev-document-links.h b/backend/ev-document-links.h
new file mode 100644 (file)
index 0000000..4576e8c
--- /dev/null
@@ -0,0 +1,80 @@
+/* ev-document-links.h
+ *  this file is part of evince, a gnome document_links viewer
+ * 
+ * Copyright (C) 2004 Red Hat, Inc.
+ *
+ * Author:
+ *   Jonathan Blandford <jrb@alum.mit.edu>
+ *
+ * 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_LINKS_H
+#define EV_DOCUMENT_LINKS_H
+
+#include <glib-object.h>
+#include <glib.h>
+#include <gdk/gdk.h>
+
+#include "ev-document.h"
+#include "ev-link.h"
+
+G_BEGIN_DECLS
+
+
+#define EV_TYPE_DOCUMENT_LINKS           (ev_document_links_get_type ())
+#define EV_DOCUMENT_LINKS(o)             (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_LINKS, EvDocumentLinks))
+#define EV_DOCUMENT_LINKS_IFACE(k)       (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_LINKS, EvDocumentLinksIface))
+#define EV_IS_DOCUMENT_LINKS(o)                  (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_LINKS))
+#define EV_IS_DOCUMENT_LINKS_IFACE(k)    (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_LINKS))
+#define EV_DOCUMENT_LINKS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_LINKS, EvDocumentLinksIface))
+
+typedef struct _EvDocumentLinks             EvDocumentLinks;
+typedef struct _EvDocumentLinksIface EvDocumentLinksIface;
+typedef struct _EvDocumentLinksIter  EvDocumentLinksIter;
+
+struct _EvDocumentLinksIface
+{
+       GTypeInterface base_iface;
+
+       /* Methods  */
+       gboolean             (* has_document_links) (EvDocumentLinks      *document_links);
+       EvDocumentLinksIter *(* begin_read)         (EvDocumentLinks      *document_links);
+       EvLink              *(* get_link)           (EvDocumentLinks      *document_links,
+                                                    EvDocumentLinksIter  *iter);
+       EvDocumentLinksIter *(* get_child)          (EvDocumentLinks      *document_links,
+                                                    EvDocumentLinksIter  *iter);
+       gboolean             (* next)               (EvDocumentLinks      *document_links,
+                                                    EvDocumentLinksIter  *iter);
+       void                 (* free_iter)          (EvDocumentLinks      *document_links,
+                                                    EvDocumentLinksIter  *iter);
+};
+
+GType                    ev_document_links_get_type           (void);
+gboolean                 ev_document_links_has_document_links (EvDocumentLinks      *document_links);
+EvDocumentLinksIter     *ev_document_links_begin_read         (EvDocumentLinks      *document_links);
+EvLink                 *ev_document_links_get_link           (EvDocumentLinks      *document_links,
+                                                              EvDocumentLinksIter  *iter);
+EvDocumentLinksIter     *ev_document_links_get_child          (EvDocumentLinks      *document_links,
+                                                              EvDocumentLinksIter  *iter);
+gboolean                 ev_document_links_next               (EvDocumentLinks      *document_links,
+                                                              EvDocumentLinksIter  *iter);
+void                     ev_document_links_free_iter          (EvDocumentLinks      *document_links,
+                                                              EvDocumentLinksIter  *iter);
+
+
+G_END_DECLS
+
+#endif
similarity index 52%
rename from backend/ev-bookmark.c
rename to backend/ev-link.c
index f2d9f235fa005523f711e967ee9025605f1a31c6..14ef3a244f2322e661ddcbfd35ca5dffa4cba42f 100644 (file)
@@ -22,7 +22,7 @@
 #include "config.h"
 #endif
 
-#include "ev-bookmark.h"
+#include "ev-link.h"
 
 enum {
        PROP_0,
@@ -32,51 +32,51 @@ enum {
        PROP_URI
 };
 
-struct _EvBookmarkPrivate {
+struct _EvLinkPrivate {
        char *title;
        char *uri;
-       EvBookmarkType type;
+       EvLinkType type;
        int page;
 };
 
 static GObjectClass *parent_class = NULL;
 
-G_DEFINE_TYPE (EvBookmark, ev_bookmark, G_TYPE_OBJECT)
+G_DEFINE_TYPE (EvLink, ev_link, G_TYPE_OBJECT)
 
-#define EV_BOOKMARK_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_BOOKMARK, EvBookmarkPrivate))
+#define EV_LINK_GET_PRIVATE(object) \
+       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_LINK, EvLinkPrivate))
 
 GType
-ev_bookmark_type_get_type (void)
+ev_link_type_get_type (void)
 {
        static GType type = 0;
 
        if (G_UNLIKELY (type == 0)) {
                static const GEnumValue values[] = {
-                       { EV_BOOKMARK_TYPE_TITLE, "EV_BOOKMARK_TYPE_TITLE", "title" },
-                       { EV_BOOKMARK_TYPE_LINK, "EV_BOOKMARK_TYPE_LINK", "link" },
-                       { EV_BOOKMARK_TYPE_EXTERNAL_URI, "EV_BOOKMARK_TYPE_EXTERNAL_URI", "external" },
+                       { EV_LINK_TYPE_TITLE, "EV_LINK_TYPE_TITLE", "title" },
+                       { EV_LINK_TYPE_PAGE, "EV_LINK_TYPE_PAGE", "page" },
+                       { EV_LINK_TYPE_EXTERNAL_URI, "EV_LINK_TYPE_EXTERNAL_URI", "external" },
                        { 0, NULL, NULL }
                 };
 
-                type = g_enum_register_static ("EvBookmarkType", values);
+                type = g_enum_register_static ("EvLinkType", values);
         }
 
         return type;
 }
 
 const char *
-ev_bookmark_get_title (EvBookmark *self)
+ev_link_get_title (EvLink *self)
 {
-       g_return_val_if_fail (EV_IS_BOOKMARK (self), NULL);
+       g_return_val_if_fail (EV_IS_LINK (self), NULL);
        
        return self->priv->title;
 }
 
 void
-ev_bookmark_set_title (EvBookmark* self, const char *title)
+ev_link_set_title (EvLink* self, const char *title)
 {
-       g_assert (EV_IS_BOOKMARK (self));
+       g_assert (EV_IS_LINK (self));
        g_assert (title != NULL);
 
        if (self->priv->title != NULL) {
@@ -89,17 +89,17 @@ ev_bookmark_set_title (EvBookmark* self, const char *title)
 }
 
 const char *
-ev_bookmark_get_uri (EvBookmark *self)
+ev_link_get_uri (EvLink *self)
 {
-       g_return_val_if_fail (EV_IS_BOOKMARK (self), NULL);
+       g_return_val_if_fail (EV_IS_LINK (self), NULL);
        
        return self->priv->uri;
 }
 
 void
-ev_bookmark_set_uri (EvBookmark* self, const char *uri)
+ev_link_set_uri (EvLink* self, const char *uri)
 {
-       g_assert (EV_IS_BOOKMARK (self));
+       g_assert (EV_IS_LINK (self));
        g_assert (uri != NULL);
 
        if (self->priv->uri != NULL) {
@@ -111,18 +111,18 @@ ev_bookmark_set_uri (EvBookmark* self, const char *uri)
        g_object_notify (G_OBJECT (self), "uri");
 }
 
-EvBookmarkType
-ev_bookmark_get_bookmark_type (EvBookmark *self)
+EvLinkType
+ev_link_get_link_type (EvLink *self)
 {
-       g_return_val_if_fail (EV_IS_BOOKMARK (self), 0);
+       g_return_val_if_fail (EV_IS_LINK (self), 0);
        
        return self->priv->type;
 }
 
 void
-ev_bookmark_set_bookmark_type (EvBookmark* self, EvBookmarkType type)
+ev_link_set_link_type (EvLink* self, EvLinkType type)
 {
-       g_assert (EV_IS_BOOKMARK (self));
+       g_assert (EV_IS_LINK (self));
 
        self->priv->type = type;
 
@@ -130,17 +130,17 @@ ev_bookmark_set_bookmark_type (EvBookmark* self, EvBookmarkType type)
 }
 
 int
-ev_bookmark_get_page (EvBookmark *self)
+ev_link_get_page (EvLink *self)
 {
-       g_return_val_if_fail (EV_IS_BOOKMARK (self), 0);
+       g_return_val_if_fail (EV_IS_LINK (self), 0);
        
        return self->priv->page;
 }
 
 void
-ev_bookmark_set_page (EvBookmark* self, int page)
+ev_link_set_page (EvLink* self, int page)
 {
-       g_assert (EV_IS_BOOKMARK (self));
+       g_assert (EV_IS_LINK (self));
 
        self->priv->page = page;
 
@@ -148,12 +148,12 @@ ev_bookmark_set_page (EvBookmark* self, int page)
 }
 
 static void
-ev_bookmark_get_property (GObject *object, guint prop_id, GValue *value,
-                         GParamSpec *param_spec)
+ev_link_get_property (GObject *object, guint prop_id, GValue *value,
+                     GParamSpec *param_spec)
 {
-       EvBookmark *self;
+       EvLink *self;
 
-       self = EV_BOOKMARK (object);
+       self = EV_LINK (object);
 
        switch (prop_id) {
        case PROP_TITLE:
@@ -177,25 +177,25 @@ ev_bookmark_get_property (GObject *object, guint prop_id, GValue *value,
 }
 
 static void
-ev_bookmark_set_property (GObject *object, guint prop_id, const GValue *value,
-                         GParamSpec *param_spec)
+ev_link_set_property (GObject *object, guint prop_id, const GValue *value,
+                     GParamSpec *param_spec)
 {
-       EvBookmark *self;
+       EvLink *self;
        
-       self = EV_BOOKMARK (object);
+       self = EV_LINK (object);
        
        switch (prop_id) {
        case PROP_TITLE:
-               ev_bookmark_set_title (self, g_value_get_string (value));
+               ev_link_set_title (self, g_value_get_string (value));
                break;
        case PROP_URI:
-               ev_bookmark_set_uri (self, g_value_get_string (value));
+               ev_link_set_uri (self, g_value_get_string (value));
                break;
        case PROP_TYPE:
-               ev_bookmark_set_bookmark_type (self, g_value_get_enum (value));
+               ev_link_set_link_type (self, g_value_get_enum (value));
                break;
        case PROP_PAGE:
-               ev_bookmark_set_page (self, g_value_get_int (value));
+               ev_link_set_page (self, g_value_get_int (value));
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
@@ -208,11 +208,11 @@ ev_bookmark_set_property (GObject *object, guint prop_id, const GValue *value,
 static void
 ev_window_dispose (GObject *object)
 {
-       EvBookmarkPrivate *priv;
+       EvLinkPrivate *priv;
 
-       g_return_if_fail (EV_IS_BOOKMARK (object));
+       g_return_if_fail (EV_IS_LINK (object));
 
-       priv = EV_BOOKMARK (object)->priv;
+       priv = EV_LINK (object)->priv;
 
        if (priv->title) {
                g_free (priv->title);
@@ -223,15 +223,15 @@ ev_window_dispose (GObject *object)
 }
 
 static void
-ev_bookmark_init (EvBookmark *ev_bookmark)
+ev_link_init (EvLink *ev_link)
 {
-       ev_bookmark->priv = EV_BOOKMARK_GET_PRIVATE (ev_bookmark);
+       ev_link->priv = EV_LINK_GET_PRIVATE (ev_link);
 
-       ev_bookmark->priv->type = EV_BOOKMARK_TYPE_TITLE;
+       ev_link->priv->type = EV_LINK_TYPE_TITLE;
 }
 
 static void
-ev_bookmark_class_init (EvBookmarkClass *ev_window_class)
+ev_link_class_init (EvLinkClass *ev_window_class)
 {
        GObjectClass *g_object_class;
 
@@ -239,72 +239,72 @@ ev_bookmark_class_init (EvBookmarkClass *ev_window_class)
 
        g_object_class = G_OBJECT_CLASS (ev_window_class);
        g_object_class->dispose = ev_window_dispose;
-       g_object_class->set_property = ev_bookmark_set_property;
-       g_object_class->get_property = ev_bookmark_get_property;
+       g_object_class->set_property = ev_link_set_property;
+       g_object_class->get_property = ev_link_get_property;
 
-       g_type_class_add_private (g_object_class, sizeof (EvBookmarkPrivate));
+       g_type_class_add_private (g_object_class, sizeof (EvLinkPrivate));
 
        g_object_class_install_property (g_object_class,
                                         PROP_TITLE,
                                         g_param_spec_string ("title",
-                                                             "Bookmark Title",
-                                                             "The bookmark title",
+                                                             "Link Title",
+                                                             "The link title",
                                                              NULL,
                                                              G_PARAM_READWRITE));
 
        g_object_class_install_property (g_object_class,
                                         PROP_URI,
                                         g_param_spec_string ("uri",
-                                                             "Bookmark URI",
-                                                             "The bookmark URI",
+                                                             "Link URI",
+                                                             "The link URI",
                                                              NULL,
                                                              G_PARAM_READWRITE));
 
        g_object_class_install_property (g_object_class,
                                         PROP_TYPE,
                                         g_param_spec_enum  ("type",
-                                                            "Bookmark Type",
-                                                            "The bookmark type",
-                                                            EV_TYPE_BOOKMARK_TYPE,
-                                                            EV_BOOKMARK_TYPE_TITLE,
+                                                            "Link Type",
+                                                            "The link type",
+                                                            EV_TYPE_LINK_TYPE,
+                                                            EV_LINK_TYPE_TITLE,
                                                             G_PARAM_READWRITE));
 
        g_object_class_install_property (g_object_class,
                                         PROP_PAGE,
                                         g_param_spec_int ("page",
-                                                          "Bookmark Page",
-                                                          "The bookmark page",
+                                                          "Link Page",
+                                                          "The link page",
                                                            0,
                                                            G_MAXINT,
                                                            0,
                                                            G_PARAM_READWRITE));
 }
 
-EvBookmark *
-ev_bookmark_new_title (const char *title)
+EvLink *
+ev_link_new_title (const char *title)
 {
-       return EV_BOOKMARK (g_object_new (EV_TYPE_BOOKMARK,
-                                         "title", title,
-                                         "type", EV_BOOKMARK_TYPE_TITLE,
-                                         NULL));
+       return EV_LINK (g_object_new (EV_TYPE_LINK,
+                                     "title", title,
+                                     "type", EV_LINK_TYPE_TITLE,
+                                     NULL));
 }
 
-EvBookmark *
-ev_bookmark_new_link (const char *title, int page)
+EvLink *
+ev_link_new_page (const char *title, int page)
 {
-       return EV_BOOKMARK (g_object_new (EV_TYPE_BOOKMARK,
-                                         "title", title,
-                                         "page", page,
-                                         "type", EV_BOOKMARK_TYPE_LINK,
-                                         NULL));
+       return EV_LINK (g_object_new (EV_TYPE_LINK,
+                                     "title", title,
+                                     "page", page,
+                                     "type", EV_LINK_TYPE_PAGE,
+                                     NULL));
 }
 
-EvBookmark *
-ev_bookmark_new_external (const char *title, const char *uri)
+EvLink *
+ev_link_new_external (const char *title, const char *uri)
 {
-       return EV_BOOKMARK (g_object_new (EV_TYPE_BOOKMARK,
-                                         "title", title,
-                                         "uri", uri,
-                                         "type", EV_BOOKMARK_TYPE_EXTERNAL_URI,
-                                         NULL));
+       return EV_LINK (g_object_new (EV_TYPE_LINK,
+                                     "title", title,
+                                     "uri", uri,
+                                     "type", EV_LINK_TYPE_EXTERNAL_URI,
+                                     NULL));
 }
diff --git a/backend/ev-link.h b/backend/ev-link.h
new file mode 100644 (file)
index 0000000..00d97c4
--- /dev/null
@@ -0,0 +1,79 @@
+/* this file is part of evince, a gnome document viewer
+ *
+ *  Copyright (C) 2005 Red Hat, Inc.
+ *
+ * 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_LINK_H
+#define EV_LINK_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _EvLink EvLink;
+typedef struct _EvLinkClass EvLinkClass;
+typedef struct _EvLinkPrivate EvLinkPrivate;
+
+#define EV_TYPE_LINK             (ev_link_get_type())
+#define EV_LINK(object)                  (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_LINK, EvLink))
+#define EV_LINK_CLASS(klass)     (G_TYPE_CHACK_CLASS_CAST((klass), EV_TYPE_LINK, EvLinkClass))
+#define EV_IS_LINK(object)       (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_LINK))
+#define EV_IS_LINK_CLASS(klass)          (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_LINK))
+#define EV_LINK_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_LINK, EvLinkClass))
+
+#define EV_TYPE_LINK_TYPE        (ev_link_type_get_type ())
+
+typedef enum
+{
+       EV_LINK_TYPE_TITLE,
+       EV_LINK_TYPE_PAGE,
+       EV_LINK_TYPE_EXTERNAL_URI
+} EvLinkType;
+
+struct _EvLink {
+       GObject base_instance;
+       EvLinkPrivate *priv;
+};
+
+struct _EvLinkClass {
+       GObjectClass base_class;
+};
+
+GType           ev_link_type_get_type  (void);
+GType          ev_link_get_type        (void);
+
+EvLink        *ev_link_new_title       (const char     *title);
+EvLink        *ev_link_new_page        (const char     *title,
+                                        int             page);
+EvLink        *ev_link_new_external    (const char     *title,
+                                        const char     *uri);
+const char     *ev_link_get_title      (EvLink     *link);
+void           ev_link_set_title       (EvLink     *link,
+                                        const char     *title);
+const char     *ev_link_get_uri                (EvLink     *link);
+void           ev_link_set_uri         (EvLink     *link,
+                                        const char     *uri);
+EvLinkType     ev_link_get_link_type   (EvLink     *link);
+void           ev_link_set_link_type   (EvLink     *link,
+                                        EvLinkType  type);
+int            ev_link_get_page        (EvLink     *link);
+void           ev_link_set_page        (EvLink     *link,
+                                        int             page);
+
+G_END_DECLS
+
+#endif /* !EV_LINK_H */
index 6f137dd926e39c7b82a3225be21461077d67720f..929435669f2010061deadfd777345d5602a639c1 100644 (file)
@@ -24,7 +24,7 @@
 #include "ev-ps-exporter.h"
 #include "ev-document-find.h"
 #include "gpdf-g-switch.h"
-#include "ev-document-bookmarks.h"
+#include "ev-document-links.h"
 #include "ev-document-misc.h"
 #include "ev-document-thumbnails.h"
 
@@ -91,7 +91,7 @@ struct _PdfDocument
        PdfDocumentSearch *search;
 };
 
-static void pdf_document_document_bookmarks_iface_init  (EvDocumentBookmarksIface  *iface);
+static void pdf_document_document_links_iface_init      (EvDocumentLinksIface  *iface);
 static void pdf_document_document_thumbnails_iface_init (EvDocumentThumbnailsIface *iface);
 static void pdf_document_document_iface_init            (EvDocumentIface           *iface);
 static void pdf_document_ps_exporter_iface_init (EvPSExporterIface   *iface);
@@ -103,8 +103,8 @@ G_DEFINE_TYPE_WITH_CODE (PdfDocument, pdf_document, G_TYPE_OBJECT,
                          {
                                 G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT,
                                                        pdf_document_document_iface_init);
-                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_BOOKMARKS,
-                                                       pdf_document_document_bookmarks_iface_init);
+                                G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_LINKS,
+                                                       pdf_document_document_links_iface_init);
                                 G_IMPLEMENT_INTERFACE (EV_TYPE_DOCUMENT_THUMBNAILS,
                                                        pdf_document_document_thumbnails_iface_init);
                                 G_IMPLEMENT_INTERFACE (EV_TYPE_PS_EXPORTER,
@@ -675,14 +675,14 @@ pdf_document_ps_export_end (EvPSExporter *exporter)
 }
 
 
-/* EvDocumentBookmarks Implementation */
+/* EvDocumentLinks Implementation */
 typedef struct
 {
        /* goo GList, not glib */
        GList *items;
        int index;
        int level;
-} BookmarksIter;
+} LinksIter;
 
 static gchar *
 unicode_to_char (OutlineItem *outline_item,
@@ -702,12 +702,12 @@ unicode_to_char (OutlineItem *outline_item,
 
 
 static gboolean
-pdf_document_bookmarks_has_document_bookmarks (EvDocumentBookmarks *document_bookmarks)
+pdf_document_links_has_document_links (EvDocumentLinks *document_links)
 {
-       PdfDocument *pdf_document = PDF_DOCUMENT (document_bookmarks);
+       PdfDocument *pdf_document = PDF_DOCUMENT (document_links);
        Outline *outline;
 
-       g_return_val_if_fail (PDF_IS_DOCUMENT (document_bookmarks), FALSE);
+       g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), FALSE);
 
        outline = pdf_document->doc->getOutline();
        if (outline->getItems() != NULL &&
@@ -717,44 +717,44 @@ pdf_document_bookmarks_has_document_bookmarks (EvDocumentBookmarks *document_boo
        return FALSE;
 }
 
-static EvDocumentBookmarksIter *
-pdf_document_bookmarks_begin_read (EvDocumentBookmarks *document_bookmarks)
+static EvDocumentLinksIter *
+pdf_document_links_begin_read (EvDocumentLinks *document_links)
 {
-       PdfDocument *pdf_document = PDF_DOCUMENT (document_bookmarks);
+       PdfDocument *pdf_document = PDF_DOCUMENT (document_links);
        Outline *outline;
-       BookmarksIter *iter;
+       LinksIter *iter;
        GList *items;
 
-       g_return_val_if_fail (PDF_IS_DOCUMENT (document_bookmarks), NULL);
+       g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), NULL);
 
        outline = pdf_document->doc->getOutline();
        items = outline->getItems();
        if (! items)
                return NULL;
 
-       iter = g_new0 (BookmarksIter, 1);
+       iter = g_new0 (LinksIter, 1);
        iter->items = items;
        iter->index = 0;
        iter->level = 0;
 
-       return (EvDocumentBookmarksIter *) iter;
+       return (EvDocumentLinksIter *) iter;
 }
 
 /* FIXME This returns a new object every time, probably we should cache it
    in the iter */
-static EvBookmark *
-pdf_document_bookmarks_get_bookmark (EvDocumentBookmarks      *document_bookmarks,
-                                    EvDocumentBookmarksIter  *bookmarks_iter)
+static EvLink *
+pdf_document_links_get_link (EvDocumentLinks      *document_links,
+                                EvDocumentLinksIter  *links_iter)
 {
-       PdfDocument *pdf_document = PDF_DOCUMENT (document_bookmarks);
-       EvBookmark *bookmark = NULL;
-       BookmarksIter *iter = (BookmarksIter *)bookmarks_iter;
+       PdfDocument *pdf_document = PDF_DOCUMENT (document_links);
+       EvLink *link = NULL;
+       LinksIter *iter = (LinksIter *)links_iter;
        OutlineItem *anItem;
        LinkAction *link_action;
        Unicode *link_title;
        const char *title;
 
-       g_return_val_if_fail (PDF_IS_DOCUMENT (document_bookmarks), FALSE);
+       g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), FALSE);
        g_return_val_if_fail (iter != NULL, FALSE);
 
        anItem = (OutlineItem *)iter->items->get(iter->index);
@@ -763,7 +763,7 @@ pdf_document_bookmarks_get_bookmark (EvDocumentBookmarks      *document_bookmark
        title = unicode_to_char (anItem, pdf_document->umap);
 
        if (link_action == NULL) {
-               bookmark = ev_bookmark_new_title (title);
+               link = ev_link_new_title (title);
        } else if (link_action->getKind () == actionGoTo) {
                LinkDest *link_dest;
                LinkGoTo *link_goto;
@@ -794,51 +794,51 @@ pdf_document_bookmarks_get_bookmark (EvDocumentBookmarks      *document_bookmark
                        delete link_dest;
                }
 
-               bookmark = ev_bookmark_new_link (title, page_num);
+               link = ev_link_new_page (title, page_num);
        } else if (link_action->getKind () == actionURI) {
                LinkURI *link_uri;
 
                link_uri = dynamic_cast <LinkURI *> (link_action);
-               bookmark = ev_bookmark_new_external
+               link = ev_link_new_external
                        (title, link_uri->getURI()->getCString());
        } else if (link_action->getKind () == actionNamed) {
                        /*Skip, for now */
        }
 
-       return bookmark;
+       return link;
 }
 
-static EvDocumentBookmarksIter *
-pdf_document_bookmarks_get_child (EvDocumentBookmarks     *document_bookmarks,
-                                 EvDocumentBookmarksIter *bookmarks_iter)
+static EvDocumentLinksIter *
+pdf_document_links_get_child (EvDocumentLinks     *document_links,
+                                 EvDocumentLinksIter *links_iter)
 {
-       BookmarksIter *iter = (BookmarksIter *)bookmarks_iter;
-       BookmarksIter *child_iter;
+       LinksIter *iter = (LinksIter *)links_iter;
+       LinksIter *child_iter;
        OutlineItem *anItem;
 
-       g_return_val_if_fail (PDF_IS_DOCUMENT (document_bookmarks), FALSE);
+       g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), FALSE);
 
        anItem = (OutlineItem *)iter->items->get(iter->index);
        anItem->open ();
        if (! (anItem->hasKids() && anItem->getKids()) )
                return NULL;
 
-       child_iter = g_new0 (BookmarksIter, 1);
+       child_iter = g_new0 (LinksIter, 1);
        child_iter->index = 0;
        child_iter->level = iter->level + 1;
        child_iter->items = anItem->getKids ();
        g_assert (child_iter->items);
 
-       return (EvDocumentBookmarksIter *) child_iter;
+       return (EvDocumentLinksIter *) child_iter;
 }
 
 static gboolean
-pdf_document_bookmarks_next (EvDocumentBookmarks     *document_bookmarks,
-                            EvDocumentBookmarksIter *bookmarks_iter)
+pdf_document_links_next (EvDocumentLinks     *document_links,
+                            EvDocumentLinksIter *links_iter)
 {
-       BookmarksIter *iter = (BookmarksIter *) bookmarks_iter;
+       LinksIter *iter = (LinksIter *) links_iter;
 
-       g_return_val_if_fail (PDF_IS_DOCUMENT (document_bookmarks), FALSE);
+       g_return_val_if_fail (PDF_IS_DOCUMENT (document_links), FALSE);
 
        iter->index++;
        if (iter->index >= iter->items->getLength())
@@ -848,10 +848,10 @@ pdf_document_bookmarks_next (EvDocumentBookmarks     *document_bookmarks,
 }
 
 static void
-pdf_document_bookmarks_free_iter (EvDocumentBookmarks     *document_bookmarks,
-                                 EvDocumentBookmarksIter *iter)
+pdf_document_links_free_iter (EvDocumentLinks     *document_links,
+                                 EvDocumentLinksIter *iter)
 {
-       g_return_if_fail (PDF_IS_DOCUMENT (document_bookmarks));
+       g_return_if_fail (PDF_IS_DOCUMENT (document_links));
        g_return_if_fail (iter != NULL);
 
        /* FIXME: Should I close all the nodes?? Free them? */
@@ -1032,14 +1032,14 @@ pdf_document_find_iface_init (EvDocumentFindIface *iface)
 }
 
 static void
-pdf_document_document_bookmarks_iface_init (EvDocumentBookmarksIface *iface)
+pdf_document_document_links_iface_init (EvDocumentLinksIface *iface)
 {
-       iface->has_document_bookmarks = pdf_document_bookmarks_has_document_bookmarks;
-       iface->begin_read = pdf_document_bookmarks_begin_read;
-       iface->get_bookmark = pdf_document_bookmarks_get_bookmark;
-       iface->get_child = pdf_document_bookmarks_get_child;
-       iface->next = pdf_document_bookmarks_next;
-       iface->free_iter = pdf_document_bookmarks_free_iter;
+       iface->has_document_links = pdf_document_links_has_document_links;
+       iface->begin_read = pdf_document_links_begin_read;
+       iface->get_link = pdf_document_links_get_link;
+       iface->get_child = pdf_document_links_get_child;
+       iface->next = pdf_document_links_next;
+       iface->free_iter = pdf_document_links_free_iter;
 }
 
 /* Thumbnails */
index 7b088f79f5902cca6bddb1bb6b6b03698155a470..5fb0bdbb6d78db96b98471a116a1f43c3c13d950 100644 (file)
@@ -39,8 +39,8 @@ evince_SOURCES=                               \
        ev-window.h                     \
        ev-sidebar.c                    \
        ev-sidebar.h                    \
-       ev-sidebar-bookmarks.c          \
-       ev-sidebar-bookmarks.h          \
+       ev-sidebar-links.c              \
+       ev-sidebar-links.h              \
        ev-sidebar-thumbnails.c         \
        ev-sidebar-thumbnails.h         \
        ev-stock-icons.c                \
index 896fa902eb17a28ae4f3b8e28d35ca19e519eda3..05f86ce85bc8df5308d022d55ece7f33b6979e3a 100644 (file)
@@ -170,24 +170,24 @@ ev_application_open (EvApplication *application, GError *err)
 }
 
 void
-ev_application_open_bookmark (EvApplication *application,
-                             EvWindow      *window,
-                             EvBookmark    *bookmark,
-                             GError        *error)
+ev_application_open_link (EvApplication *application,
+                         EvWindow      *window,
+                         EvLink        *link,
+                         GError        *error)
 {
-       EvBookmarkType type;
+       EvLinkType type;
        const char *uri;
 
-       type = ev_bookmark_get_bookmark_type (bookmark);
+       type = ev_link_get_link_type (link);
        
        switch (type) {
-               case EV_BOOKMARK_TYPE_TITLE:
+               case EV_LINK_TYPE_TITLE:
                        break;
-               case EV_BOOKMARK_TYPE_LINK:
-                       ev_window_open_bookmark (window, bookmark);
+               case EV_LINK_TYPE_PAGE:
+                       ev_window_open_link (window, link);
                        break;
-               case EV_BOOKMARK_TYPE_EXTERNAL_URI:
-                       uri = ev_bookmark_get_uri (bookmark);
+               case EV_LINK_TYPE_EXTERNAL_URI:
+                       uri = ev_link_get_uri (link);
                        gnome_vfs_url_show (uri);
                        break;
        }
index 19a848bfb6a4e5670a9cef1dc17427e9b8a57e1d..a22e7dca787837f18d0b010f82fe75ffc3c547a8 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "ev-window.h"
 #include "ev-document.h"
-#include "ev-bookmark.h"
+#include "ev-link.h"
 
 G_BEGIN_DECLS
 
@@ -59,9 +59,9 @@ EvApplication *ev_application_get_instance            (void);
 void            ev_application_open                    (EvApplication *application,
                                                         GError        *err);
 EvWindow       *ev_application_new_window              (EvApplication *application);
-void            ev_application_open_bookmark           (EvApplication *application,
+void            ev_application_open_link               (EvApplication *application,
                                                         EvWindow      *window,
-                                                        EvBookmark    *bookmark,
+                                                        EvLink        *link,
                                                         GError        *err);
 
 G_END_DECLS
index 47fa300cb752ae267973c907ddda543c40005635..267b41b69d09e76ab3a0539905790e3b3b5a69c2 100644 (file)
@@ -77,16 +77,16 @@ ev_history_class_init (EvHistoryClass *class)
 }
 
 void
-ev_history_add_link (EvHistory *history, EvBookmark *bookmark)
+ev_history_add_link (EvHistory *history, EvLink *link)
 {
        int length;
 
        g_return_if_fail (EV_IS_HISTORY (history));
-       g_return_if_fail (EV_IS_BOOKMARK (bookmark));
+       g_return_if_fail (EV_IS_LINK (link));
 
-       g_object_ref (bookmark);
+       g_object_ref (link);
        history->priv->links = g_list_append (history->priv->links,
-                                             bookmark);
+                                             link);
 
        length = g_list_length (history->priv->links);
        history->priv->current_index = length - 1;
@@ -97,19 +97,19 @@ ev_history_add_link (EvHistory *history, EvBookmark *bookmark)
 void
 ev_history_add_page (EvHistory *history, int page)
 {
-       EvBookmark *bookmark;
+       EvLink *link;
        char *title;
 
        g_return_if_fail (EV_IS_HISTORY (history));
 
        title = g_strdup_printf (_("Page %d\n"), page);
-       bookmark = ev_bookmark_new_link (title, page);
+       link = ev_link_new_page (title, page);
        g_free (title);
 
-       ev_history_add_link (history, bookmark);
+       ev_history_add_link (history, link);
 }
 
-EvBookmark *
+EvLink *
 ev_history_get_link_nth        (EvHistory *history, int index)
 {
        GList *l;
@@ -118,7 +118,7 @@ ev_history_get_link_nth     (EvHistory *history, int index)
 
        l = g_list_nth (history->priv->links, index);
 
-       return EV_BOOKMARK (l->data);
+       return EV_LINK (l->data);
 }
 
 int
index f69cd48a3089f78c965bd09333268532e55e6ae0..b8cfceb63af0adc6402c4adbcbcc5b818f1eb7c9 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <glib-object.h>
 
-#include "ev-bookmark.h"
+#include "ev-link.h"
 
 G_BEGIN_DECLS
 
@@ -54,10 +54,10 @@ struct _EvHistoryClass
 GType          ev_history_get_type             (void);
 EvHistory      *ev_history_new                 (void);
 void           ev_history_add_link             (EvHistory  *history,
-                                                EvBookmark *bookmark);
+                                                EvLink     *linkk);
 void           ev_history_add_page             (EvHistory  *history,
                                                 int         page);
-EvBookmark     *ev_history_get_link_nth                (EvHistory  *history,
+EvLink        *ev_history_get_link_nth         (EvHistory  *history,
                                                 int         index);
 int            ev_history_get_n_links          (EvHistory  *history);
 int            ev_history_get_current_index    (EvHistory  *history);
diff --git a/shell/ev-sidebar-bookmarks.h b/shell/ev-sidebar-bookmarks.h
deleted file mode 100644 (file)
index e3f3cc6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ev-sidebar-bookmarks.h
- *  this file is part of evince, a gnome document viewer
- * 
- * Copyright (C) 2004 Red Hat, Inc.
- *
- * Author:
- *   Jonathan Blandford <jrb@alum.mit.edu>
- *
- * 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_SIDEBAR_BOOKMARKS_H__
-#define __EV_SIDEBAR_BOOKMARKS_H__
-
-#include <gtk/gtkvbox.h>
-#include "ev-document.h"
-
-G_BEGIN_DECLS
-
-typedef struct _EvSidebarBookmarks EvSidebarBookmarks;
-typedef struct _EvSidebarBookmarksClass EvSidebarBookmarksClass;
-typedef struct _EvSidebarBookmarksPrivate EvSidebarBookmarksPrivate;
-
-#define EV_TYPE_SIDEBAR_BOOKMARKS              (ev_sidebar_bookmarks_get_type())
-#define EV_SIDEBAR_BOOKMARKS(object)           (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_SIDEBAR_BOOKMARKS, EvSidebarBookmarks))
-#define EV_SIDEBAR_BOOKMARKS_CLASS(klass)      (G_TYPE_CHACK_CLASS_CAST((klass), EV_TYPE_SIDEBAR_BOOKMARKS, EvSidebarBookmarksClass))
-#define EV_IS_SIDEBAR_BOOKMARKS(object)                (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_SIDEBAR_BOOKMARKS))
-#define EV_IS_SIDEBAR_BOOKMARKS_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_SIDEBAR_BOOKMARKS))
-#define EV_SIDEBAR_BOOKMARKS_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_SIDEBAR_BOOKMARKS, EvSidebarBookmarksClass))
-
-struct _EvSidebarBookmarks {
-       GtkVBox base_instance;
-
-       EvSidebarBookmarksPrivate *priv;
-};
-
-struct _EvSidebarBookmarksClass {
-       GtkVBoxClass base_class;
-};
-
-GType      ev_sidebar_bookmarks_get_type       (void);
-GtkWidget *ev_sidebar_bookmarks_new            (void);
-void       ev_sidebar_bookmarks_set_document   (EvSidebarBookmarks *ev_sidebar_bookmarks,
-                                               EvDocument         *document);
-void       ev_sidebar_bookmarks_clear_document (EvSidebarBookmarks *sidebar_bookmarks);
-
-G_END_DECLS
-
-#endif /* __EV_SIDEBAR_BOOKMARKS_H__ */
-
-
similarity index 55%
rename from shell/ev-sidebar-bookmarks.c
rename to shell/ev-sidebar-links.c
index 5c463b4e00a50ff40a9ec43b8e55fcb9e36ddffb..4db11b668cfc642c051a2802c53317fd37a4b623 100644 (file)
 #include <string.h>
 #include <gtk/gtk.h>
 
-#include "ev-sidebar-bookmarks.h"
-#include "ev-document-bookmarks.h"
+#include "ev-sidebar-links.h"
+#include "ev-document-links.h"
 #include "ev-application.h"
 
 /* Amount of time we devote to each iteration of the idle, in microseconds */
 #define IDLE_WORK_LENGTH 5000
 
 typedef struct {
-       EvDocumentBookmarksIter *bookmarks_iter;
+       EvDocumentLinksIter *links_iter;
        GtkTreeIter *tree_iter;
 } IdleStackData;
 
-struct _EvSidebarBookmarksPrivate {
+struct _EvSidebarLinksPrivate {
        GtkWidget *tree_view;
        GtkTreeModel *model;
        EvDocument *current_document;
@@ -48,94 +48,94 @@ struct _EvSidebarBookmarksPrivate {
 };
 
 enum {
-       BOOKMARKS_COLUMN_MARKUP,
-       BOOKMARKS_COLUMN_PAGE_NUM,
-       BOOKMARKS_COLUMN_PAGE_VALID,
-       BOOKMARKS_COLUMN_BOOKMARK,
-       BOOKMARKS_COLUMN_NUM_COLUMNS
+       LINKS_COLUMN_MARKUP,
+       LINKS_COLUMN_PAGE_NUM,
+       LINKS_COLUMN_PAGE_VALID,
+       LINKS_COLUMN_LINK,
+       LINKS_COLUMN_NUM_COLUMNS
 };
 
-static void bookmarks_page_num_func (GtkTreeViewColumn *tree_column,
-                                    GtkCellRenderer   *cell,
-                                    GtkTreeModel      *tree_model,
-                                    GtkTreeIter       *iter,
-                                    gpointer           data);
+static void links_page_num_func (GtkTreeViewColumn *tree_column,
+                                GtkCellRenderer   *cell,
+                                GtkTreeModel      *tree_model,
+                                GtkTreeIter       *iter,
+                                gpointer           data);
 
-G_DEFINE_TYPE (EvSidebarBookmarks, ev_sidebar_bookmarks, GTK_TYPE_VBOX)
+G_DEFINE_TYPE (EvSidebarLinks, ev_sidebar_links, GTK_TYPE_VBOX)
 
-#define EV_SIDEBAR_BOOKMARKS_GET_PRIVATE(object) \
-       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_BOOKMARKS, EvSidebarBookmarksPrivate))
+#define EV_SIDEBAR_LINKS_GET_PRIVATE(object) \
+       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR_LINKS, EvSidebarLinksPrivate))
 
 
 static void
-ev_sidebar_bookmarks_destroy (GtkObject *object)
+ev_sidebar_links_destroy (GtkObject *object)
 {
-       EvSidebarBookmarks *ev_sidebar_bookmarks = (EvSidebarBookmarks *) object;
+       EvSidebarLinks *ev_sidebar_links = (EvSidebarLinks *) object;
 
-       g_print ("ev_sidebar_bookmarks_destroy!\n");
-       ev_sidebar_bookmarks_clear_document (ev_sidebar_bookmarks);
+       g_print ("ev_sidebar_links_destroy!\n");
+       ev_sidebar_links_clear_document (ev_sidebar_links);
 }
 
 static void
-ev_sidebar_bookmarks_class_init (EvSidebarBookmarksClass *ev_sidebar_bookmarks_class)
+ev_sidebar_links_class_init (EvSidebarLinksClass *ev_sidebar_links_class)
 {
        GObjectClass *g_object_class;
        GtkObjectClass *gtk_object_class;
 
-       g_object_class = G_OBJECT_CLASS (ev_sidebar_bookmarks_class);
-       gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_bookmarks_class);
+       g_object_class = G_OBJECT_CLASS (ev_sidebar_links_class);
+       gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_links_class);
 
-       gtk_object_class->destroy = ev_sidebar_bookmarks_destroy;
+       gtk_object_class->destroy = ev_sidebar_links_destroy;
 
-       g_type_class_add_private (g_object_class, sizeof (EvSidebarBookmarksPrivate));
+       g_type_class_add_private (g_object_class, sizeof (EvSidebarLinksPrivate));
 }
 
 static void
 selection_changed_cb (GtkTreeSelection   *selection,
-                     EvSidebarBookmarks *ev_sidebar_bookmarks)
+                     EvSidebarLinks     *ev_sidebar_links)
 {
        EvDocument *document;
        GtkTreeModel *model;
        GtkTreeIter iter;
 
-       g_return_if_fail (EV_IS_SIDEBAR_BOOKMARKS (ev_sidebar_bookmarks));
+       g_return_if_fail (EV_IS_SIDEBAR_LINKS (ev_sidebar_links));
 
-       document = EV_DOCUMENT (ev_sidebar_bookmarks->priv->current_document);
-       g_return_if_fail (ev_sidebar_bookmarks->priv->current_document != NULL);
+       document = EV_DOCUMENT (ev_sidebar_links->priv->current_document);
+       g_return_if_fail (ev_sidebar_links->priv->current_document != NULL);
 
        if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
-               EvBookmark *bookmark;
+               EvLink *link;
                EvApplication *app;
                GtkWidget *window;
                GValue value = {0, };
 
                gtk_tree_model_get_value (model, &iter,
-                                         BOOKMARKS_COLUMN_BOOKMARK, &value);
+                                         LINKS_COLUMN_LINK, &value);
 
-               bookmark = EV_BOOKMARK (g_value_get_object (&value));
-               g_return_if_fail (bookmark != NULL);
+               link = EV_LINK (g_value_get_object (&value));
+               g_return_if_fail (link != NULL);
 
-               window = gtk_widget_get_ancestor (GTK_WIDGET (ev_sidebar_bookmarks),
+               window = gtk_widget_get_ancestor (GTK_WIDGET (ev_sidebar_links),
                                                  EV_TYPE_WINDOW);
                if (window) {
                        app = ev_application_get_instance ();
-                       ev_application_open_bookmark (app, EV_WINDOW (window),
-                                                     bookmark, NULL);
+                       ev_application_open_link (app, EV_WINDOW (window),
+                                                 link, NULL);
                }
        }
 }
 
 static void
-ev_sidebar_bookmarks_construct (EvSidebarBookmarks *ev_sidebar_bookmarks)
+ev_sidebar_links_construct (EvSidebarLinks *ev_sidebar_links)
 {
-       EvSidebarBookmarksPrivate *priv;
+       EvSidebarLinksPrivate *priv;
        GtkWidget *swindow;
        GtkTreeViewColumn *column;
        GtkCellRenderer *renderer;
        GtkTreeSelection *selection;
 
-       priv = ev_sidebar_bookmarks->priv;
-       priv->model = (GtkTreeModel *) gtk_tree_store_new (BOOKMARKS_COLUMN_NUM_COLUMNS,
+       priv = ev_sidebar_links->priv;
+       priv->model = (GtkTreeModel *) gtk_tree_store_new (LINKS_COLUMN_NUM_COLUMNS,
                                                           G_TYPE_STRING,
                                                           G_TYPE_INT,
                                                           G_TYPE_BOOLEAN,
@@ -155,8 +155,8 @@ ev_sidebar_bookmarks_construct (EvSidebarBookmarks *ev_sidebar_bookmarks)
        gtk_container_add (GTK_CONTAINER (swindow), priv->tree_view);
        gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->tree_view), TRUE);
 
-       gtk_box_pack_start (GTK_BOX (ev_sidebar_bookmarks), swindow, TRUE, TRUE, 0);
-       gtk_widget_show_all (GTK_WIDGET (ev_sidebar_bookmarks));
+       gtk_box_pack_start (GTK_BOX (ev_sidebar_links), swindow, TRUE, TRUE, 0);
+       gtk_widget_show_all (GTK_WIDGET (ev_sidebar_links));
 
        column = gtk_tree_view_column_new ();
        gtk_tree_view_column_set_expand (GTK_TREE_VIEW_COLUMN (column), TRUE);
@@ -168,43 +168,43 @@ ev_sidebar_bookmarks_construct (EvSidebarBookmarks *ev_sidebar_bookmarks)
                              NULL);
        gtk_tree_view_column_pack_start (GTK_TREE_VIEW_COLUMN (column), renderer, TRUE);
        gtk_tree_view_column_set_attributes (GTK_TREE_VIEW_COLUMN (column), renderer,
-                                            "markup", BOOKMARKS_COLUMN_MARKUP,
+                                            "markup", LINKS_COLUMN_MARKUP,
                                             NULL);
 
        renderer = gtk_cell_renderer_text_new ();
        gtk_tree_view_column_pack_end (GTK_TREE_VIEW_COLUMN (column), renderer, FALSE);
        gtk_tree_view_column_set_cell_data_func (GTK_TREE_VIEW_COLUMN (column), renderer,
-                                                (GtkTreeCellDataFunc) bookmarks_page_num_func,
+                                                (GtkTreeCellDataFunc) links_page_num_func,
                                                 NULL, NULL);
 
 
        selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
        g_signal_connect (selection, "changed",
                          G_CALLBACK (selection_changed_cb),
-                         ev_sidebar_bookmarks);
+                         ev_sidebar_links);
 }
 
 static void
-ev_sidebar_bookmarks_init (EvSidebarBookmarks *ev_sidebar_bookmarks)
+ev_sidebar_links_init (EvSidebarLinks *ev_sidebar_links)
 {
-       ev_sidebar_bookmarks->priv = EV_SIDEBAR_BOOKMARKS_GET_PRIVATE (ev_sidebar_bookmarks);
+       ev_sidebar_links->priv = EV_SIDEBAR_LINKS_GET_PRIVATE (ev_sidebar_links);
 
-       ev_sidebar_bookmarks_construct (ev_sidebar_bookmarks);
+       ev_sidebar_links_construct (ev_sidebar_links);
 }
 
 static void
-bookmarks_page_num_func (GtkTreeViewColumn *tree_column,
-                        GtkCellRenderer   *cell,
-                        GtkTreeModel      *tree_model,
-                        GtkTreeIter       *iter,
-                        gpointer           data)
+links_page_num_func (GtkTreeViewColumn *tree_column,
+                    GtkCellRenderer   *cell,
+                    GtkTreeModel      *tree_model,
+                    GtkTreeIter       *iter,
+                    gpointer           data)
 {
        int page_num;
        gboolean page_valid;
 
        gtk_tree_model_get (tree_model, iter,
-                           BOOKMARKS_COLUMN_PAGE_NUM, &page_num,
-                           BOOKMARKS_COLUMN_PAGE_VALID, &page_valid,
+                           LINKS_COLUMN_PAGE_NUM, &page_num,
+                           LINKS_COLUMN_PAGE_VALID, &page_valid,
                            -1);
 
        if (page_valid) {
@@ -224,69 +224,69 @@ bookmarks_page_num_func (GtkTreeViewColumn *tree_column,
 /* Public Functions */
 
 GtkWidget *
-ev_sidebar_bookmarks_new (void)
+ev_sidebar_links_new (void)
 {
-       GtkWidget *ev_sidebar_bookmarks;
+       GtkWidget *ev_sidebar_links;
 
-       ev_sidebar_bookmarks = g_object_new (EV_TYPE_SIDEBAR_BOOKMARKS, NULL);
+       ev_sidebar_links = g_object_new (EV_TYPE_SIDEBAR_LINKS, NULL);
 
-       return ev_sidebar_bookmarks;
+       return ev_sidebar_links;
 }
 
 static void
 stack_data_free (IdleStackData       *stack_data,
-                EvDocumentBookmarks *document_bookmarks)
+                EvDocumentLinks     *document_links)
 {
        g_assert (stack_data);
 
        if (stack_data->tree_iter)
                gtk_tree_iter_free (stack_data->tree_iter);
-       if (stack_data->bookmarks_iter)
-               ev_document_bookmarks_free_iter (document_bookmarks, stack_data->bookmarks_iter);
+       if (stack_data->links_iter)
+               ev_document_links_free_iter (document_links, stack_data->links_iter);
        g_free (stack_data);
 }
 
 static gboolean
-do_one_iteration (EvSidebarBookmarks *ev_sidebar_bookmarks)
+do_one_iteration (EvSidebarLinks *ev_sidebar_links)
 {
-       EvSidebarBookmarksPrivate *priv = ev_sidebar_bookmarks->priv;
-       EvBookmark *bookmark;
+       EvSidebarLinksPrivate *priv = ev_sidebar_links->priv;
+       EvLink *link;
        IdleStackData *stack_data;
        GtkTreeIter tree_iter;
-       EvDocumentBookmarksIter *child_iter;
+       EvDocumentLinksIter *child_iter;
        gint page;
 
        g_assert (priv->idle_stack);
 
        stack_data = (IdleStackData *) priv->idle_stack->data;
 
-       bookmark = ev_document_bookmarks_get_bookmark
-               (EV_DOCUMENT_BOOKMARKS (priv->current_document),
-                stack_data->bookmarks_iter);
-       if (bookmark == NULL) {
+       link = ev_document_links_get_link
+               (EV_DOCUMENT_LINKS (priv->current_document),
+                stack_data->links_iter);
+       if (link == NULL) {
                g_warning ("mismatch in model.  No values available at current level.\n");
                return FALSE;
        }
 
-       page = ev_bookmark_get_page (bookmark);
+       page = ev_link_get_page (link);
        gtk_tree_store_append (GTK_TREE_STORE (priv->model), &tree_iter, stack_data->tree_iter);
        gtk_tree_store_set (GTK_TREE_STORE (priv->model), &tree_iter,
-                           BOOKMARKS_COLUMN_MARKUP, ev_bookmark_get_title (bookmark),
-                           BOOKMARKS_COLUMN_PAGE_NUM, page,
+                           LINKS_COLUMN_MARKUP, ev_link_get_title (link),
+                           LINKS_COLUMN_PAGE_NUM, page,
                            /* FIXME: Handle links for real. */
-                           BOOKMARKS_COLUMN_PAGE_VALID, (page >= 0),
-                           BOOKMARKS_COLUMN_BOOKMARK, bookmark,
+                           LINKS_COLUMN_PAGE_VALID, (page >= 0),
+                           LINKS_COLUMN_LINK, link,
                            -1);
-       g_object_unref (bookmark);
+       g_object_unref (link);
        
-       child_iter = ev_document_bookmarks_get_child (EV_DOCUMENT_BOOKMARKS (priv->current_document),
-                                                     stack_data->bookmarks_iter);
+       child_iter = ev_document_links_get_child (EV_DOCUMENT_LINKS (priv->current_document),
+                                                     stack_data->links_iter);
        if (child_iter) {
                IdleStackData *child_stack_data;
 
                child_stack_data = g_new0 (IdleStackData, 1);
                child_stack_data->tree_iter = gtk_tree_iter_copy (&tree_iter);
-               child_stack_data->bookmarks_iter = child_iter;
+               child_stack_data->links_iter = child_iter;
                priv->idle_stack = g_list_prepend (priv->idle_stack, child_stack_data);
 
                return TRUE;
@@ -294,13 +294,13 @@ do_one_iteration (EvSidebarBookmarks *ev_sidebar_bookmarks)
 
        /* We don't have children, so we need to walk to the next node */
        while (TRUE) {
-               if (ev_document_bookmarks_next (EV_DOCUMENT_BOOKMARKS (priv->current_document),
-                                               stack_data->bookmarks_iter))
+               if (ev_document_links_next (EV_DOCUMENT_LINKS (priv->current_document),
+                                               stack_data->links_iter))
                        return TRUE;
 
                /* We're done with this level.  Pop it off the idle stack and go
                 * to the next level */
-               stack_data_free (stack_data, EV_DOCUMENT_BOOKMARKS (priv->current_document));
+               stack_data_free (stack_data, EV_DOCUMENT_LINKS (priv->current_document));
                priv->idle_stack = g_list_delete_link (priv->idle_stack, priv->idle_stack);
                if (priv->idle_stack == NULL)
                        return FALSE;
@@ -309,14 +309,14 @@ do_one_iteration (EvSidebarBookmarks *ev_sidebar_bookmarks)
 }
 
 static gboolean
-populate_bookmarks_idle (gpointer data)
+populate_links_idle (gpointer data)
 {
        GTimer *timer;
        gint i;
        gulong microseconds = 0;
 
-       EvSidebarBookmarks *ev_sidebar_bookmarks = (EvSidebarBookmarks *)data;
-       EvSidebarBookmarksPrivate *priv = ev_sidebar_bookmarks->priv;
+       EvSidebarLinks *ev_sidebar_links = (EvSidebarLinks *)data;
+       EvSidebarLinksPrivate *priv = ev_sidebar_links->priv;
 
        if (priv->idle_stack == NULL) {
                priv->idle_id = 0;
@@ -329,7 +329,7 @@ populate_bookmarks_idle (gpointer data)
        timer = g_timer_new ();
        i = 0;
        g_timer_start (timer);
-       while (do_one_iteration (ev_sidebar_bookmarks)) {
+       while (do_one_iteration (ev_sidebar_links)) {
                i++;
                g_timer_elapsed (timer, &microseconds);
                if (microseconds > IDLE_WORK_LENGTH)
@@ -343,13 +343,13 @@ populate_bookmarks_idle (gpointer data)
 }
 
 void
-ev_sidebar_bookmarks_clear_document (EvSidebarBookmarks *sidebar_bookmarks)
+ev_sidebar_links_clear_document (EvSidebarLinks *sidebar_links)
 {
-       EvSidebarBookmarksPrivate *priv;
+       EvSidebarLinksPrivate *priv;
 
-       g_return_if_fail (EV_IS_SIDEBAR_BOOKMARKS (sidebar_bookmarks));
+       g_return_if_fail (EV_IS_SIDEBAR_LINKS (sidebar_links));
 
-       priv = sidebar_bookmarks->priv;
+       priv = sidebar_links->priv;
        if (priv->current_document) {
                g_object_unref (priv->current_document);
                priv->current_document = NULL;
@@ -368,31 +368,31 @@ ev_sidebar_bookmarks_clear_document (EvSidebarBookmarks *sidebar_bookmarks)
 }
 
 void
-ev_sidebar_bookmarks_set_document (EvSidebarBookmarks *sidebar_bookmarks,
-                                  EvDocument         *document)
+ev_sidebar_links_set_document (EvSidebarLinks *sidebar_links,
+                              EvDocument     *document)
 {
-       EvSidebarBookmarksPrivate *priv;
-       EvDocumentBookmarksIter *bookmarks_iter;
+       EvSidebarLinksPrivate *priv;
+       EvDocumentLinksIter *links_iter;
 
-       g_return_if_fail (EV_IS_SIDEBAR_BOOKMARKS (sidebar_bookmarks));
+       g_return_if_fail (EV_IS_SIDEBAR_LINKS (sidebar_links));
        g_return_if_fail (EV_IS_DOCUMENT (document));
 
-       priv = sidebar_bookmarks->priv;
+       priv = sidebar_links->priv;
 
        g_object_ref (document);
-       ev_sidebar_bookmarks_clear_document (sidebar_bookmarks);
+       ev_sidebar_links_clear_document (sidebar_links);
 
        priv->current_document = document;
-       bookmarks_iter = ev_document_bookmarks_begin_read (EV_DOCUMENT_BOOKMARKS (document));
-       if (bookmarks_iter) {
+       links_iter = ev_document_links_begin_read (EV_DOCUMENT_LINKS (document));
+       if (links_iter) {
                IdleStackData *stack_data;
 
                stack_data = g_new0 (IdleStackData, 1);
-               stack_data->bookmarks_iter = bookmarks_iter;
+               stack_data->links_iter = links_iter;
                stack_data->tree_iter = NULL;
 
                priv->idle_stack = g_list_prepend (priv->idle_stack, stack_data);
-               priv->idle_id = g_idle_add (populate_bookmarks_idle, sidebar_bookmarks);
+               priv->idle_id = g_idle_add (populate_links_idle, sidebar_links);
        }
 }
 
diff --git a/shell/ev-sidebar-links.h b/shell/ev-sidebar-links.h
new file mode 100644 (file)
index 0000000..59af8bb
--- /dev/null
@@ -0,0 +1,63 @@
+/* ev-sidebar-links.h
+ *  this file is part of evince, a gnome document viewer
+ * 
+ * Copyright (C) 2004 Red Hat, Inc.
+ *
+ * Author:
+ *   Jonathan Blandford <jrb@alum.mit.edu>
+ *
+ * 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_SIDEBAR_LINKS_H__
+#define __EV_SIDEBAR_LINKS_H__
+
+#include <gtk/gtkvbox.h>
+#include "ev-document.h"
+
+G_BEGIN_DECLS
+
+typedef struct _EvSidebarLinks EvSidebarLinks;
+typedef struct _EvSidebarLinksClass EvSidebarLinksClass;
+typedef struct _EvSidebarLinksPrivate EvSidebarLinksPrivate;
+
+#define EV_TYPE_SIDEBAR_LINKS             (ev_sidebar_links_get_type())
+#define EV_SIDEBAR_LINKS(object)          (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_SIDEBAR_LINKS, EvSidebarLinks))
+#define EV_SIDEBAR_LINKS_CLASS(klass)     (G_TYPE_CHACK_CLASS_CAST((klass), EV_TYPE_SIDEBAR_LINKS, EvSidebarLinksClass))
+#define EV_IS_SIDEBAR_LINKS(object)       (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_SIDEBAR_LINKS))
+#define EV_IS_SIDEBAR_LINKS_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_SIDEBAR_LINKS))
+#define EV_SIDEBAR_LINKS_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_SIDEBAR_LINKS, EvSidebarLinksClass))
+
+struct _EvSidebarLinks {
+       GtkVBox base_instance;
+
+       EvSidebarLinksPrivate *priv;
+};
+
+struct _EvSidebarLinksClass {
+       GtkVBoxClass base_class;
+};
+
+GType      ev_sidebar_links_get_type       (void);
+GtkWidget *ev_sidebar_links_new            (void);
+void       ev_sidebar_links_set_document   (EvSidebarLinks *ev_sidebar_links,
+                                           EvDocument         *document);
+void       ev_sidebar_links_clear_document (EvSidebarLinks *sidebar_links);
+
+G_END_DECLS
+
+#endif /* __EV_SIDEBAR_LINKS_H__ */
+
+
index f042f0c5b3612beb92c6c2e72a46abb13c707b54..d21a13add609455e0932c8d81c36ec0fb7c9c494 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "ev-sidebar.h"
 #include "ev-document-thumbnails.h"
-#include "ev-document-bookmarks.h"
-#include "ev-sidebar-bookmarks.h"
+#include "ev-document-links.h"
+#include "ev-sidebar-links.h"
 #include "ev-sidebar-thumbnails.h"
 
 typedef struct
@@ -207,18 +207,15 @@ ev_sidebar_set_document (EvSidebar   *sidebar,
                                    PAGE_COLUMN_MAIN_WIDGET, &widget,
                                    -1);
 
-               if (EV_IS_SIDEBAR_BOOKMARKS (widget)
-                   && EV_IS_DOCUMENT_BOOKMARKS (document)
-                   && ev_document_bookmarks_has_document_bookmarks (EV_DOCUMENT_BOOKMARKS (document)))
-                       ev_sidebar_bookmarks_set_document (EV_SIDEBAR_BOOKMARKS (widget),
-                                                          document);
+               if (EV_IS_SIDEBAR_LINKS (widget)
+                   && EV_IS_DOCUMENT_LINKS (document)
+                   && ev_document_links_has_document_links (EV_DOCUMENT_LINKS (document)))
+                       ev_sidebar_links_set_document (EV_SIDEBAR_LINKS (widget),
+                                                      document);
                else if (EV_IS_SIDEBAR_THUMBNAILS (widget) &&
                         EV_IS_DOCUMENT_THUMBNAILS (document))
                        ev_sidebar_thumbnails_set_document (EV_SIDEBAR_THUMBNAILS (widget),
                                                            document);
-                               
-
-                 
        }
        
 
index 678770bd41563716178368680dc1d45e3b854c5c..2b04c87576e1aae4b22a0b30e182a0f6ac61ad11 100644 (file)
@@ -930,35 +930,35 @@ set_document_page (EvView *view, int page)
 }
 
 static void
-go_to_bookmark (EvView *view, EvBookmark *bookmark)
+go_to_link (EvView *view, EvLink *link)
 {
-       EvBookmarkType type;
+       EvLinkType type;
        int page;
 
-       type = ev_bookmark_get_bookmark_type (bookmark);
+       type = ev_link_get_link_type (link);
 
-       if (type == EV_BOOKMARK_TYPE_LINK) {
-               page = ev_bookmark_get_page (bookmark);
+       if (type == EV_LINK_TYPE_PAGE) {
+               page = ev_link_get_page (link);
                set_document_page (view, page);
        }
 }
 
 void
-ev_view_go_to_bookmark (EvView *view, EvBookmark *bookmark)
+ev_view_go_to_link (EvView *view, EvLink *link)
 {
-       go_to_bookmark (view, bookmark);
-       ev_history_add_link (view->history, bookmark);
+       go_to_link (view, link);
+       ev_history_add_link (view->history, link);
 }
 
 static void
 go_to_index (EvView *view, int index)
 {
-       EvBookmark *bookmark;
+       EvLink *link;
        
-       bookmark = ev_history_get_link_nth (view->history, index);
-       g_return_if_fail (bookmark != NULL);
+       link = ev_history_get_link_nth (view->history, index);
+       g_return_if_fail (link != NULL);
 
-       go_to_bookmark (view, bookmark);
+       go_to_link (view, link);
 }
 
 void
index 067873bc2658c66ef35c83edd1d9db0f5923d563..93902637141910f10727993a8316ce9965631d0b 100644 (file)
@@ -23,7 +23,7 @@
 #include <gtk/gtkwidget.h>
 
 #include "ev-document.h"
-#include "ev-bookmark.h"
+#include "ev-link.h"
 
 G_BEGIN_DECLS
 
@@ -47,8 +47,8 @@ void          ev_view_select_all      (EvView     *view);
 /* Navigation */
 void           ev_view_go_back         (EvView     *view);
 void           ev_view_go_forward      (EvView     *view);
-void           ev_view_go_to_bookmark  (EvView     *view,
-                                        EvBookmark *bookmark);
+void           ev_view_go_to_link      (EvView     *view,
+                                        EvLink     *link);
 void           ev_view_set_page        (EvView     *view,
                                         int         page);
 int            ev_view_get_page        (EvView     *view);
index 0f26863ba707ec6093e2bc118885af091c266130..f4a9288f4d795abfb55e8b8907d68ebd26a8dcea 100644 (file)
@@ -32,7 +32,7 @@
 #include "ev-navigation-action.h"
 #include "ev-page-action.h"
 #include "ev-sidebar.h"
-#include "ev-sidebar-bookmarks.h"
+#include "ev-sidebar-links.h"
 #include "ev-sidebar-thumbnails.h"
 #include "ev-view.h"
 #include "ev-print-job.h"
@@ -191,9 +191,9 @@ update_action_sensitivity (EvWindow *ev_window)
 }
 
 void
-ev_window_open_bookmark        (EvWindow *ev_window, EvBookmark *bookmark)
+ev_window_open_link (EvWindow *ev_window, EvLink *link)
 {
-       ev_view_go_to_bookmark (EV_VIEW (ev_window->priv->view), bookmark);
+       ev_view_go_to_link (EV_VIEW (ev_window->priv->view), link);
 }
 
 gboolean
@@ -1452,11 +1452,11 @@ ev_window_init (EvWindow *ev_window)
                        ev_window->priv->sidebar);
 
        /* Stub sidebar, for now */
-       sidebar_widget = ev_sidebar_bookmarks_new ();
+       sidebar_widget = ev_sidebar_links_new ();
        gtk_widget_show (sidebar_widget);
        ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar),
-                            "bookmarks",
-                            _("Bookmarks"),
+                            "index",
+                            _("Index"),
                             sidebar_widget);
 
        sidebar_widget = ev_sidebar_thumbnails_new ();
index ebd1fc44148149e03851eb687ca653a5cc53bcf0..97e0e020658914582cee2208e8f579e98997d0b9 100644 (file)
@@ -26,7 +26,7 @@
 #include <glib-object.h>
 #include <gtk/gtkwindow.h>
 
-#include "ev-bookmark.h"
+#include "ev-link.h"
 
 G_BEGIN_DECLS
 
@@ -54,11 +54,12 @@ struct _EvWindowClass {
                                 const char     *string);
 };
 
-GType          ev_window_get_type              (void);
-void           ev_window_open                  (EvWindow *ev_window, const char *uri);
-void           ev_window_open_bookmark         (EvWindow   *ev_window,
-                                                EvBookmark *bookmark);
-gboolean       ev_window_is_empty              (const EvWindow *ev_window);
+GType          ev_window_get_type      (void);
+void           ev_window_open          (EvWindow       *ev_window,
+                                        const char     *uri);
+void           ev_window_open_link     (EvWindow       *ev_window,
+                                        EvLink         *link);
+gboolean       ev_window_is_empty      (const EvWindow *ev_window);
 
 G_END_DECLS