From dbe438c1e95c6d2901c282a0c0e204c94114fb75 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 04 Jun 2005 16:47:07 +0000 Subject: Implement fonts list. Defined out for now, since it depends on a not yet 2005-06-04 Marco Pesenti Gritti * backend/Makefile.am: * backend/ev-document-fonts.c: (ev_document_fonts_get_type), (ev_document_fonts_get_fonts_model): * backend/ev-document-fonts.h: * data/evince-properties.glade: * pdf/ev-poppler.cc: * shell/ev-properties.c: (setup_fonts_view), (ev_properties_new): * shell/ev-properties.h: * shell/ev-window.c: (ev_window_cmd_file_properties): Implement fonts list. Defined out for now, since it depends on a not yet committed poppler patch. --- (limited to 'backend') diff --git a/backend/Makefile.am b/backend/Makefile.am index b85f62d..744c932 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -17,6 +17,8 @@ libevbackend_la_SOURCES= \ ev-document.h \ ev-document-thumbnails.c \ ev-document-thumbnails.h \ + ev-document-fonts.c \ + ev-document-fonts.h \ ev-document-links.c \ ev-document-links.h \ ev-document-security.c \ diff --git a/backend/ev-document-fonts.c b/backend/ev-document-fonts.c new file mode 100644 index 0000000..9c4d4d6 --- /dev/null +++ b/backend/ev-document-fonts.c @@ -0,0 +1,60 @@ +/* ev-document-fonts.h + * this file is part of evince, a gnome document_fonts viewer + * + * Copyright (C) 2004 Red Hat, Inc. + * + * Author: + * Marco Pesenti Gritti + * + * Evince is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Evince is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * 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. + */ + +#include "config.h" + +#include "ev-document-fonts.h" +#include "ev-job-queue.h" + +GType +ev_document_fonts_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) + { + static const GTypeInfo our_info = + { + sizeof (EvDocumentFontsIface), + NULL, + NULL, + }; + + type = g_type_register_static (G_TYPE_INTERFACE, + "EvDocumentFonts", + &our_info, (GTypeFlags)0); + } + + return type; +} + +GtkTreeModel * +ev_document_fonts_get_fonts_model (EvDocumentFonts *document_fonts) +{ + EvDocumentFontsIface *iface = EV_DOCUMENT_FONTS_GET_IFACE (document_fonts); + GtkTreeModel *retval; + + retval = iface->get_fonts_model (document_fonts); + + return retval; +} diff --git a/backend/ev-document-fonts.h b/backend/ev-document-fonts.h new file mode 100644 index 0000000..6cb07e2 --- /dev/null +++ b/backend/ev-document-fonts.h @@ -0,0 +1,65 @@ +/* ev-document-fonts.h + * this file is part of evince, a gnome document viewer + * + * Copyright (C) 2004 Red Hat, Inc. + * + * Author: + * Marco Pesenti Gritti + * + * Evince is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Evince is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * 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. + */ + +#ifndef EV_DOCUMENT_FONTS_H +#define EV_DOCUMENT_FONTS_H + +#include +#include +#include + +#include "ev-document.h" +#include "ev-link.h" + +G_BEGIN_DECLS + + +#define EV_TYPE_DOCUMENT_FONTS (ev_document_fonts_get_type ()) +#define EV_DOCUMENT_FONTS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_FONTS, EvDocumentFonts)) +#define EV_DOCUMENT_FONTS_IFACE(k) (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_FONTS, EvDocumentFontsIface)) +#define EV_IS_DOCUMENT_FONTS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_DOCUMENT_FONTS)) +#define EV_IS_DOCUMENT_FONTS_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_FONTS)) +#define EV_DOCUMENT_FONTS_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_FONTS, EvDocumentFontsIface)) + +typedef struct _EvDocumentFonts EvDocumentFonts; +typedef struct _EvDocumentFontsIface EvDocumentFontsIface; + +enum { + EV_DOCUMENT_FONTS_COLUMN_NAME, + EV_DOCUMENT_FONTS_COLUMN_NUM_COLUMNS +}; + +struct _EvDocumentFontsIface +{ + GTypeInterface base_iface; + + /* Methods */ + GtkTreeModel *(* get_fonts_model) (EvDocumentFonts *document_fonts); +}; + +GType ev_document_fonts_get_type (void); +GtkTreeModel *ev_document_fonts_get_fonts_model (EvDocumentFonts *document_fonts); + +G_END_DECLS + +#endif -- cgit v0.9.1