diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-06-13 18:45:06 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-06-13 18:45:06 (GMT) |
commit | 7fef38d9e59026334152230f1cd847e163e8457c (patch) | |
tree | 83fb7731c11b20f6447c6e50cd62b1253acb0360 /backend | |
parent | 2b426ab269babe95b051894c1484929543e19ce9 (diff) |
Separate scan and fill so that we can incrementally fill from the main
2005-06-13 Marco Pesenti Gritti <mpg@redhat.com>
* 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.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ev-document-fonts.c | 22 | ||||
-rw-r--r-- | backend/ev-document-fonts.h | 20 |
2 files changed, 31 insertions, 11 deletions
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 |