+Sat Apr 16 18:53:47 2005 Jonathan Blandford <jrb@redhat.com>
+
+ * shell/ev-sidebar-links.c: (selection_changed_cb):
+ * shell/ev-view.c: (ev_view_finalize), (go_to_link),
+ (ev_view_button_release_event), (ev_view_set_document):
+ * shell/ev-view.h:
+ * shell/ev-window.c: (find_bar_search_changed_cb):
+ * shell/ev-window.h: Minor cleanups removing some dead code.
+
2005-04-16 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* backend/ev-page-cache.c: (_ev_page_cache_new):
g_signal_handler_block (ev_sidebar_links->priv->page_cache,
ev_sidebar_links->priv->page_changed_id);
+ /* FIXME: we should handle this better. This breaks w/ URLs */
ev_page_cache_set_link (ev_sidebar_links->priv->page_cache, link);
g_signal_handler_unblock (ev_sidebar_links->priv->page_cache,
ev_sidebar_links->priv->page_changed_id);
LOG ("Finalize");
-
- ev_view_set_scroll_adjustments (view, NULL, NULL);
+ g_free (view->status);
+ g_free (view->find_status);
G_OBJECT_CLASS (ev_view_parent_class)->finalize (object);
}
return TRUE;
}
+/* FIXME: standardize this sometime */
+static void
+go_to_link (EvView *view, EvLink *link)
+{
+ EvLinkType type;
+ const char *uri;
+ int page;
+
+ type = ev_link_get_link_type (link);
+
+ switch (type) {
+ case EV_LINK_TYPE_TITLE:
+ break;
+ case EV_LINK_TYPE_PAGE:
+ page = ev_link_get_page (link);
+ ev_page_cache_set_current_page (view->page_cache, page);
+ break;
+ case EV_LINK_TYPE_EXTERNAL_URI:
+ uri = ev_link_get_uri (link);
+ gnome_vfs_url_show (uri);
+ break;
+ }
+}
+
+
static gboolean
ev_view_button_release_event (GtkWidget *widget,
GdkEventButton *event)
link = get_link_at_location (view, event->x, event->y);
if (link) {
- ev_view_go_to_link (view, link);
+ go_to_link (view, link);
}
}
}
}
-int
-ev_view_get_page (EvView *view)
-{
- return view->current_page;
-}
-
-static void
-go_to_link (EvView *view, EvLink *link)
-{
- EvLinkType type;
- const char *uri;
- int page;
-
- type = ev_link_get_link_type (link);
-
- switch (type) {
- case EV_LINK_TYPE_TITLE:
- break;
- case EV_LINK_TYPE_PAGE:
- page = ev_link_get_page (link);
- ev_page_cache_set_current_page (view->page_cache, page);
- break;
- case EV_LINK_TYPE_EXTERNAL_URI:
- uri = ev_link_get_uri (link);
- gnome_vfs_url_show (uri);
- break;
- }
-}
-
-void
-ev_view_go_to_link (EvView *view, EvLink *link)
-{
- go_to_link (view, link);
-}
-
static void
ev_view_zoom (EvView *view,
double factor,
GtkWidget* ev_view_new (void);
void ev_view_set_document (EvView *view,
EvDocument *document);
-int ev_view_get_page (EvView *view);
/* Clipboard */
void ev_view_copy (EvView *view);
void ev_view_select_all (EvView *view);
-/* Navigation */
-void ev_view_go_to_link (EvView *view,
- EvLink *link);
-
/* Page size */
void ev_view_zoom_in (EvView *view);
void ev_view_zoom_out (EvView *view);
}
}
-void
-ev_window_open_link (EvWindow *ev_window, EvLink *link)
-{
- ev_view_go_to_link (EV_VIEW (ev_window->priv->view), link);
-}
-
gboolean
ev_window_is_empty (const EvWindow *ev_window)
{
if (visible && search_string && search_string[0]) {
g_mutex_lock (EV_DOC_MUTEX);
ev_document_find_begin (EV_DOCUMENT_FIND (ev_window->priv->document),
- ev_view_get_page (EV_VIEW (ev_window->priv->view)),
+ ev_page_cache_get_current_page (ev_window->priv->page_cache),
search_string,
case_sensitive);
g_mutex_unlock (EV_DOC_MUTEX);
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);
void ev_window_open_page (EvWindow *ev_window,
int page);
gboolean ev_window_is_empty (const EvWindow *ev_window);