+static EvLink *
+ev_link_from_dest (PopplerAction *action)
+{
+ EvLink *link = NULL;
+ const char *unimplemented_dest = NULL;
+
+ switch (action->goto_dest.dest->type) {
+ case POPPLER_DEST_UNKNOWN:
+ unimplemented_dest = "POPPLER_DEST_UNKNOWN";
+ break;
+ case POPPLER_DEST_XYZ:
+ link = ev_link_new_page_xyz (action->any.title,
+ action->goto_dest.dest->page_num - 1,
+ action->goto_dest.dest->left,
+ action->goto_dest.dest->top,
+ action->goto_dest.dest->zoom);
+ break;
+ case POPPLER_DEST_FIT:
+ link = ev_link_new_page_fit (action->any.title,
+ action->goto_dest.dest->page_num - 1);
+ break;
+ case POPPLER_DEST_FITH:
+ link = ev_link_new_page_fith (action->any.title,
+ action->goto_dest.dest->page_num - 1,
+ action->goto_dest.dest->top);
+ break;
+ case POPPLER_DEST_FITV:
+ link = ev_link_new_page_fitv (action->any.title,
+ action->goto_dest.dest->page_num - 1,
+ action->goto_dest.dest->left);
+ break;
+ case POPPLER_DEST_FITR:
+ link = ev_link_new_page_fitr (action->any.title,
+ action->goto_dest.dest->page_num - 1,
+ action->goto_dest.dest->left,
+ action->goto_dest.dest->bottom,
+ action->goto_dest.dest->right,
+ action->goto_dest.dest->top);
+ break;
+ case POPPLER_DEST_FITB:
+ unimplemented_dest = "POPPLER_DEST_FITB";
+ break;
+ case POPPLER_DEST_FITBH:
+ unimplemented_dest = "POPPLER_DEST_FITBH";
+ break;
+ case POPPLER_DEST_FITBV:
+ unimplemented_dest = "POPPLER_DEST_FITBV";
+ break;
+ }
+
+ if (unimplemented_dest) {
+ g_warning ("Unimplemented destination: %s, please post a bug report with a testcase.",
+ unimplemented_dest);
+ }
+
+ if (link == NULL) {
+ link = ev_link_new_page (action->any.title, action->goto_dest.dest->page_num - 1);
+ }
+
+ return link;
+}
+