Move src/plugins/docgen/CairoDoc.py to src/plugins/lib/libcairodoc.py.
svn: r12363
This commit is contained in:
parent
fec7f5f7c0
commit
a39b1ba156
@ -296,7 +296,8 @@ src/plugins/import/ImportGrdb.py
|
||||
src/plugins/import/ImportProGen.py
|
||||
src/plugins/import/ImportVCard.py
|
||||
|
||||
# plugins/lib directory
|
||||
# plugins/lib directory
|
||||
src/plugins/lib/libcairodoc.py
|
||||
src/plugins/lib/libholiday.py
|
||||
src/plugins/lib/libmapservice.py
|
||||
src/plugins/lib/libgrampsxml.py
|
||||
|
@ -43,7 +43,7 @@ import os
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import BaseDoc
|
||||
from CairoDoc import CairoDoc
|
||||
import libcairodoc
|
||||
from gen.plug import PluginManager, DocGenPlugin
|
||||
import Errors
|
||||
|
||||
@ -509,7 +509,7 @@ class PrintPreview:
|
||||
# GtkPrint class
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class GtkPrint(CairoDoc):
|
||||
class GtkPrint(libcairodoc.CairoDoc):
|
||||
"""Print document via GtkPrint* interface.
|
||||
|
||||
Requires Gtk+ 2.10.
|
||||
|
@ -7,7 +7,6 @@ pkgdatadir = $(datadir)/@PACKAGE@/plugins/docgen
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
AsciiDoc.py \
|
||||
CairoDoc.py \
|
||||
GtkPrint.py \
|
||||
HtmlDoc.py \
|
||||
LaTeXDoc.py \
|
||||
|
@ -36,7 +36,7 @@ from gettext import gettext as _
|
||||
# Gramps modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from CairoDoc import CairoDoc
|
||||
import libcairodoc
|
||||
from gen.plug import PluginManager, DocGenPlugin
|
||||
import Utils
|
||||
|
||||
@ -71,7 +71,7 @@ DPI = 72.0
|
||||
# PdfDoc class
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class PdfDoc(CairoDoc):
|
||||
class PdfDoc(libcairodoc.CairoDoc):
|
||||
"""Render the document into PDF file using Cairo.
|
||||
"""
|
||||
def run(self):
|
||||
|
@ -6,6 +6,7 @@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/plugins/lib
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
libcairodoc.py\
|
||||
libgrampsxml.py\
|
||||
libholiday.py\
|
||||
libmapservice.py
|
||||
|
@ -3,6 +3,7 @@
|
||||
#
|
||||
# Copyright (C) 2007 Zsolt Foldvari
|
||||
# Copyright (C) 2009 Benny Malengier
|
||||
# Copyright (C) 2009 Brian Matherly
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -29,6 +30,7 @@
|
||||
# Python modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gettext import gettext as _
|
||||
from math import radians
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
@ -39,6 +41,7 @@ from xml.sax.saxutils import escape
|
||||
#------------------------------------------------------------------------
|
||||
import BaseDoc
|
||||
from ReportBase import ReportUtils
|
||||
from gen.plug import PluginManager, Plugin
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -46,7 +49,7 @@ from ReportBase import ReportUtils
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import logging
|
||||
log = logging.getLogger(".CairoDoc")
|
||||
log = logging.getLogger(".libcairodoc")
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -1483,3 +1486,20 @@ class CairoDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc, BaseDoc.DrawDoc):
|
||||
cr.stroke()
|
||||
|
||||
self._pages[page_nr].draw(cr, layout, width, dpi_x, dpi_y)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# register_plugin
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def register_plugin():
|
||||
PluginManager.get_instance().register_plugin(
|
||||
Plugin(
|
||||
name = __name__,
|
||||
description = _("Provides a library for using Cairo to "
|
||||
"generate documents."),
|
||||
module_name = __name__
|
||||
)
|
||||
)
|
||||
|
||||
register_plugin()
|
Loading…
Reference in New Issue
Block a user