From a0436a3b6be4274c77bdc82468d5251828511cd1 Mon Sep 17 00:00:00 2001 From: David Hughes Date: Fri, 5 Aug 2016 16:03:43 +0100 Subject: [PATCH] Updated intra-doc links to ensure fully qualified names --- wx/lib/pdfviewer/__init__.py | 8 ++++---- wx/lib/pdfviewer/bezier.py | 2 +- wx/lib/pdfviewer/buttonpanel.py | 6 +++--- wx/lib/pdfviewer/dcgraphics.py | 32 ++++++++++++++++---------------- wx/lib/pdfviewer/viewer.py | 13 +++++++------ 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/wx/lib/pdfviewer/__init__.py b/wx/lib/pdfviewer/__init__.py index e8ee02dc..4781a3d9 100644 --- a/wx/lib/pdfviewer/__init__.py +++ b/wx/lib/pdfviewer/__init__.py @@ -13,13 +13,13 @@ # #---------------------------------------------------------------------------- """ -:class:`~lib.pdfviewer.viewer.pdfViewer` class is derived from :class:`ScrolledWindow` class +:class:`~lib.pdfviewer.viewer.pdfViewer` class is derived from :class:`wx.ScrolledWindow` class and can display and print PDF files. Description =========== -The :class:`~lib.pdfviewer.viewer.pdfViewer` class is derived from :class:`ScrolledWindow` +The :class:`~lib.pdfviewer.viewer.pdfViewer` class is derived from :class:`wx.ScrolledWindow` and can display and print PDF files. The whole file can be scrolled from end to end at whatever magnification (zoom-level) is specified. @@ -103,8 +103,8 @@ Externally callable methods are: :meth:`~lib.pdfviewer.viewer.pdfViewer.GoPage` The viewer renders the pdf file content using Cairo if installed, -otherwise :class:`GraphicsContext` is used. Printing is achieved by writing -directly to a :class:`PrinterDC` and using :class:`Printer`. +otherwise :class:`wx.GraphicsContext` is used. Printing is achieved by writing +directly to a :class:`wx.PrinterDC` and using :class:`wx.Printer`. The icons used in :class:`~lib.pdfviewer.buttonpanel.pdfButtonPanel` are Free Icons by Axialis Software: http://www.axialis.com. You can freely use them in any project, diff --git a/wx/lib/pdfviewer/bezier.py b/wx/lib/pdfviewer/bezier.py index 60e6df28..18fb7989 100644 --- a/wx/lib/pdfviewer/bezier.py +++ b/wx/lib/pdfviewer/bezier.py @@ -58,7 +58,7 @@ def compute_points(controlpoints, nsteps=30): """ Input 4 control points as :class:`RealPoint` and convert to vec2d instances. compute the nsteps points on the resulting curve and return them - as a list of :class:`Point` + as a list of :class:`wx.Point` """ controlvectors = [] for p in controlpoints: diff --git a/wx/lib/pdfviewer/buttonpanel.py b/wx/lib/pdfviewer/buttonpanel.py index 36927a35..5ac86515 100644 --- a/wx/lib/pdfviewer/buttonpanel.py +++ b/wx/lib/pdfviewer/buttonpanel.py @@ -32,14 +32,14 @@ class pdfButtonPanel(bp.ButtonPanel): """ Default class constructor. - :param Window `parent`: parent window. Must not be ``None``; + :param wx.Window `parent`: parent window. Must not be ``None``; :param integer `nid`: window identifier. A value of -1 indicates a default value; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; - :type `pos`: tuple or :class:`Point` + :type `pos`: tuple or :class:`wx.Point` :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; - :type `size`: tuple or :class:`Size` + :type `size`: tuple or :class:`wx.Size` :param integer `style`: the button style (unused); """ diff --git a/wx/lib/pdfviewer/dcgraphics.py b/wx/lib/pdfviewer/dcgraphics.py index cb417fa3..9ad0dfdd 100644 --- a/wx/lib/pdfviewer/dcgraphics.py +++ b/wx/lib/pdfviewer/dcgraphics.py @@ -15,17 +15,17 @@ # #---------------------------------------------------------------------------- """ -This module implements an API similar to :class:`GraphicsContext` and the -related classes. The implementation is done using :class:`DC` +This module implements an API similar to :class:`wx.GraphicsContext` and the +related classes. The implementation is done using :class:`wx.DC` -Why do this? Neither :class:`GraphicsContext` nor the Cairo-based +Why do this? Neither :class:`wx.GraphicsContext` nor the Cairo-based GraphicsContext API provided by wx.lib.graphics can be written -directly to a :class:`PrinterDC`. It can be done via an intermediate bitmap in -a :class:`MemoryDC` but transferring this to a :class:`PrinterDC` is an order of +directly to a :class:`wx.PrinterDC`. It can be done via an intermediate bitmap in +a :class:`wx.MemoryDC` but transferring this to a :class:`wx.PrinterDC` is an order of magnitude slower than writing directly. -Why not just use :class:`PrinterDC` directly? There may be times when you do want -to use :class:`GraphicsContext` for its displayed appearance and for its +Why not just use :class:`wx.PrinterDC` directly? There may be times when you do want +to use :class:`wx.GraphicsContext` for its displayed appearance and for its clean(er) API, so being able to use the same code for printing as well is nice. It started out with the intention of being a full implementation of the @@ -148,9 +148,9 @@ class dcGraphicsContext(object): The incoming co-ordinates have a bottom left origin with increasing y downwards (so y values are all negative). The DC origin is top left also with increasing y down. - :class:`DC` and :class:`GraphicsContext` fonts are too big in the ratio + :class:`wx.DC` and :class:`wx.GraphicsContext` fonts are too big in the ratio of pixels per inch to points per inch. If screen rendering used Cairo, - printed fonts need to be scaled but if :class:`GCDC` was used, they are + printed fonts need to be scaled but if :class:`wx.GCDC` was used, they are already scaled. :param `context`: **TBW** (?) @@ -170,7 +170,7 @@ class dcGraphicsContext(object): @staticmethod def Create(dc, yoffset, have_cairo): """ - The created pGraphicsContext instance uses the dc itself. + The created dcGraphicsContext instance uses the dc itself. """ assert isinstance(dc, wx.DC) return dcGraphicsContext(dc, yoffset, have_cairo) @@ -229,30 +229,30 @@ class dcGraphicsContext(object): def SetPen(self, pen): """ - Set the :class:`Pen` to be used for stroking lines in future drawing + Set the :class:`wx.Pen` to be used for stroking lines in future drawing operations. - :param `pen`: the :class:`Pen` to be used from now on. + :param `pen`: the :class:`wx.Pen` to be used from now on. """ self._context.SetPen(pen) def SetBrush(self, brush): """ - Set the :class:`Brush` to be used for filling shapes in future drawing + Set the :class:`wx.Brush` to be used for filling shapes in future drawing operations. - :param `brush`: the :class:`Brush` to be used from now on. + :param `brush`: the :class:`wx.Brush` to be used from now on. """ self._context.SetBrush(brush) def SetFont(self, font, colour=None): """ - Sets the :class:`Font` to be used for drawing text. + Sets the :class:`wx.Font` to be used for drawing text. Don't set the dc font yet as it may need to be scaled - :param `font`: the :class:`Font` for drawing text + :param `font`: the :class:`wx.Font` for drawing text :param `colour`: the colour to be used """ diff --git a/wx/lib/pdfviewer/viewer.py b/wx/lib/pdfviewer/viewer.py index 13eb9a41..d0145af1 100644 --- a/wx/lib/pdfviewer/viewer.py +++ b/wx/lib/pdfviewer/viewer.py @@ -34,7 +34,8 @@ from six import BytesIO, string_types import wx -CACHE_LATE_PAGES = True +CACHE_LATE_PAGES = False # TODO Cacheing of page bitmaps does not currently + # work when using cairocffi and Python 3.4 (MSW) LATE_THRESHOLD = 200 # Time to render (ttr), milliseconds VERBOSE = False @@ -113,14 +114,14 @@ class pdfViewer(wx.ScrolledWindow): """ Default class constructor. - :param Window `parent`: parent window. Must not be ``None``; + :param wx.Window `parent`: parent window. Must not be ``None``; :param integer `nid`: window identifier. A value of -1 indicates a default value; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; - :type `pos`: tuple or :class:`Point` + :type `pos`: tuple or :class:`wx.Point` :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; - :type `size`: tuple or :class:`Size` + :type `size`: tuple or :class:`wx.Size` :param integer `style`: the button style (unused); """ @@ -247,8 +248,8 @@ class pdfViewer(wx.ScrolledWindow): immediately. Default: True. :param string `printer_name`: the name of the printer that is to receive the printout. Default: as set by the O/S. - :param `orientation`: select the orientation (wx.PORTRAIT or - wx.LANDSCAPE) for the printout. Default: as set by the O/S. + :param `orientation`: select the orientation (:class:`wx.PORTRAIT` or + :class:`wx.LANDSCAPE`) for the printout. Default: as set by the O/S. """ pdd = wx.PrintDialogData() pdd.SetMinPage(1)