From 7fef38d9e59026334152230f1cd847e163e8457c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 13 Jun 2005 18:45:06 +0000 Subject: Separate scan and fill so that we can incrementally fill from the main 2005-06-13 Marco Pesenti Gritti * backend/ev-document-fonts.c: (ev_document_fonts_get_progress), (ev_document_fonts_scan), (ev_document_fonts_fill_model): * backend/ev-document-fonts.h: Separate scan and fill so that we can incrementally fill from the main thread. Add a progress api. * data/evince-properties.glade: * pdf/ev-poppler.cc: * shell/ev-jobs.c: (ev_job_fonts_new), (ev_job_fonts_run): * shell/ev-jobs.h: * shell/ev-properties.c: (update_progress_label), (job_fonts_finished_cb), (setup_fonts_view): Incrementally feel the list and show the progress percentage in a label like acrobat does. --- (limited to 'backend') diff --git a/backend/ev-document-fonts.c b/backend/ev-document-fonts.c index cd53d1e..854383d 100644 --- a/backend/ev-document-fonts.c +++ b/backend/ev-document-fonts.c @@ -47,12 +47,28 @@ ev_document_fonts_get_type (void) return type; } +double +ev_document_fonts_get_progress (EvDocumentFonts *document_fonts) +{ + EvDocumentFontsIface *iface = EV_DOCUMENT_FONTS_GET_IFACE (document_fonts); + + return iface->get_progress (document_fonts); +} + gboolean +ev_document_fonts_scan (EvDocumentFonts *document_fonts, + int n_pages) +{ + EvDocumentFontsIface *iface = EV_DOCUMENT_FONTS_GET_IFACE (document_fonts); + + return iface->scan (document_fonts, n_pages); +} + +void ev_document_fonts_fill_model (EvDocumentFonts *document_fonts, - GtkTreeModel *model, - int n_pages) + GtkTreeModel *model) { EvDocumentFontsIface *iface = EV_DOCUMENT_FONTS_GET_IFACE (document_fonts); - return iface->fill_model (document_fonts, model, n_pages); + iface->fill_model (document_fonts, model); } diff --git a/backend/ev-document-fonts.h b/backend/ev-document-fonts.h index 2a05e7e..d069b9d 100644 --- a/backend/ev-document-fonts.h +++ b/backend/ev-document-fonts.h @@ -53,16 +53,20 @@ struct _EvDocumentFontsIface { GTypeInterface base_iface; - /* Methods */ - gboolean (* fill_model) (EvDocumentFonts *document_fonts, - GtkTreeModel *model, - int n_pages); + /* Methods */ + gboolean (* scan) (EvDocumentFonts *document_fonts, + int n_pages); + double (* get_progress) (EvDocumentFonts *document_fonts); + void (* fill_model) (EvDocumentFonts *document_fonts, + GtkTreeModel *model); }; -GType ev_document_fonts_get_type (void); -gboolean ev_document_fonts_fill_model (EvDocumentFonts *document_fonts, - GtkTreeModel *model, - int n_pages); +GType ev_document_fonts_get_type (void); +gboolean ev_document_fonts_scan (EvDocumentFonts *document_fonts, + int n_pages); +double ev_document_fonts_get_progress (EvDocumentFonts *document_fonts); +void ev_document_fonts_fill_model (EvDocumentFonts *document_fonts, + GtkTreeModel *model); G_END_DECLS -- cgit v0.9.1