*
* 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "config.h"
g_set_error_literal (error,
EV_DOCUMENT_ERROR,
EV_DOCUMENT_ERROR_INVALID,
- _("DJVU document has incorrect format"));
+ _("DjVu document has incorrect format"));
return FALSE;
}
G_FILE_ERROR,
G_FILE_ERROR_EXIST,
_("The document is composed of several files. "
- "One or more of such files cannot be accessed."));
+ "One or more of these files cannot be accessed."));
return FALSE;
}
ddjvu_page_t *d_page;
ddjvu_page_rotation_t rotation;
double page_width, page_height, tmp;
- static const cairo_user_data_key_t key;
d_page = ddjvu_page_create_by_pageno (djvu_document->d_document, rc->page->index);
default:
rotation = DDJVU_ROTATE_0;
}
-#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH
- rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, page_width);
-#else
- rowstride = page_width * 4;
-#endif
- pixels = (gchar *) g_malloc (page_height * rowstride);
- surface = cairo_image_surface_create_for_data ((guchar *)pixels,
- CAIRO_FORMAT_RGB24,
- page_width,
- page_height,
- rowstride);
- cairo_surface_set_user_data (surface, &key,
- pixels, (cairo_destroy_func_t)g_free);
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+ page_width, page_height);
+ rowstride = cairo_image_surface_get_stride (surface);
+ pixels = (gchar *)cairo_image_surface_get_data (surface);
+
prect.x = 0;
prect.y = 0;
prect.w = page_width;
rowstride,
pixels);
- return surface;
-}
-
-static EvDocumentInfo *
-djvu_document_get_info (EvDocument *document)
-{
- EvDocumentInfo *info;
-
- info = g_new0 (EvDocumentInfo, 1);
+ cairo_surface_mark_dirty (surface);
- return info;
+ return surface;
}
static void
ev_document_class->get_n_pages = djvu_document_get_n_pages;
ev_document_class->get_page_size = djvu_document_get_page_size;
ev_document_class->render = djvu_document_render;
- ev_document_class->get_info = djvu_document_get_info;
}
static gchar *
static GList *
djvu_document_links_get_links (EvDocumentLinks *document_links,
- gint page)
+ EvPage *page)
{
- return djvu_links_get_links (document_links, page, SCALE_FACTOR);
+ return djvu_links_get_links (document_links, page->index, SCALE_FACTOR);
}
static void