Skip to content

Commit bcfcd2f

Browse files
committed
Preparation for release of version 0.9.6
1 parent ae71068 commit bcfcd2f

6 files changed

Lines changed: 99 additions & 12 deletions

File tree

docs/Doxyfile

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Doxyfile 1.8.10
1+
# Doxyfile 1.8.13
22

33
# This file describes the settings to be used by the documentation system
44
# doxygen (www.doxygen.org) for a project.
@@ -38,7 +38,7 @@ PROJECT_NAME = wxPdfDocument
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 0.9.5
41+
PROJECT_NUMBER = 0.9.6
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a
@@ -303,6 +303,15 @@ EXTENSION_MAPPING =
303303

304304
MARKDOWN_SUPPORT = YES
305305

306+
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
307+
# to that level are automatically included in the table of contents, even if
308+
# they do not have an id attribute.
309+
# Note: This feature currently applies only to Markdown headings.
310+
# Minimum value: 0, maximum value: 99, default value: 0.
311+
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
312+
313+
TOC_INCLUDE_HEADINGS = 0
314+
306315
# When enabled doxygen tries to link words that correspond to documented
307316
# classes, or namespaces to their corresponding documentation. Such a link can
308317
# be prevented in individual cases by putting a % sign in front of the word or
@@ -749,6 +758,12 @@ WARN_IF_DOC_ERROR = YES
749758

750759
WARN_NO_PARAMDOC = YES
751760

761+
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
762+
# a warning is encountered.
763+
# The default value is: NO.
764+
765+
WARN_AS_ERROR = NO
766+
752767
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
753768
# can produce. The string should contain the $file, $line, and $text tags, which
754769
# will be replaced by the file and line number from which the warning originated
@@ -797,8 +812,8 @@ INPUT_ENCODING = UTF-8
797812
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
798813
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
799814
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
800-
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
801-
# *.vhdl, *.ucf, *.qsf, *.as and *.js.
815+
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
816+
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
802817

803818
FILE_PATTERNS = *.d \
804819
*.ii \
@@ -901,6 +916,10 @@ IMAGE_PATH =
901916
# Note that the filter must not add or remove lines; it is applied before the
902917
# code is scanned, but not when the output code is generated. If lines are added
903918
# or removed, the anchors will not be placed correctly.
919+
#
920+
# Note that for custom extensions or not directly supported extensions you also
921+
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
922+
# properly processed by doxygen.
904923

905924
INPUT_FILTER =
906925

@@ -910,6 +929,10 @@ INPUT_FILTER =
910929
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
911930
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
912931
# patterns match the file name, INPUT_FILTER is applied.
932+
#
933+
# Note that for custom extensions or not directly supported extensions you also
934+
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
935+
# properly processed by doxygen.
913936

914937
FILTER_PATTERNS =
915938

@@ -1027,7 +1050,7 @@ VERBATIM_HEADERS = NO
10271050
# rich C++ code for which doxygen's built-in parser lacks the necessary type
10281051
# information.
10291052
# Note: The availability of this option depends on whether or not doxygen was
1030-
# compiled with the --with-libclang option.
1053+
# generated with the -Duse-libclang=ON option for CMake.
10311054
# The default value is: NO.
10321055

10331056
CLANG_ASSISTED_PARSING = NO
@@ -1771,6 +1794,14 @@ LATEX_SOURCE_CODE = NO
17711794

17721795
LATEX_BIB_STYLE = plain
17731796

1797+
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
1798+
# page will contain the date and time when the page was generated. Setting this
1799+
# to NO can help when comparing the output of multiple runs.
1800+
# The default value is: NO.
1801+
# This tag requires that the tag GENERATE_LATEX is set to YES.
1802+
1803+
LATEX_TIMESTAMP = NO
1804+
17741805
#---------------------------------------------------------------------------
17751806
# Configuration options related to the RTF output
17761807
#---------------------------------------------------------------------------
@@ -2364,6 +2395,11 @@ DIAFILE_DIRS =
23642395

23652396
PLANTUML_JAR_PATH =
23662397

2398+
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
2399+
# configuration file for plantuml.
2400+
2401+
PLANTUML_CFG_FILE =
2402+
23672403
# When using plantuml, the specified paths are searched for files specified by
23682404
# the !include statement in a plantuml block.
23692405

include/wx/pdfdocdef.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,19 @@ Or you can send a mail to the author
6969
\section version Version history
7070
7171
<dl>
72-
<dt><b>0.9.6</b> - <i>January 2017</i></dt>
72+
<dt><b>0.9.6</b> - <i>April 2017</i></dt>
7373
<dd>
7474
wxPdfDocument is compatible with wxWidgets version 2.8.12 and version 3.1.0.
7575
7676
General changes:<br>
7777
- Overhauled the build system
7878
- Added continuous integration (Travis CI)
7979
- Replaced all occurrences of macro \b wxT by \b wxS
80+
- Added version information as Windows resource for DLL builds on Windows
8081
8182
Fixed bugs:<br>
83+
- Fixed adjustment of angles in method wxPdfDocument::Ellipse
84+
- Fixed issue with drawing arcs from wxPdfDC by forcing angles into proper range for counter-clockwise drawing
8285
- Replaced MD5 implementation to resolve a license incompatibility issue
8386
- Replaced image in transparency sample to resolve a potential license issue
8487

include/wx/pdfdocument.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ class WXDLLIMPEXP_PDFDOC wxPdfDocument
15221522
* If a transparent colour is defined, it will be taken into account (but will be only interpreted
15231523
* by Acrobat 4 and above).
15241524
*
1525-
* For GIF, all flavors the wsWidgets GIF decoder is able to handle are supported
1525+
* For GIF, all flavors the wxWidgets GIF decoder is able to handle are supported
15261526
*
15271527
* For WMF: WMF files contain vector data described in terms of Windows Graphics Device Interface
15281528
* (GDI) commands. There are approximately 80 different GDI commands allowed for in the WMF standard.
@@ -1591,7 +1591,7 @@ class WXDLLIMPEXP_PDFDOC wxPdfDocument
15911591

15921592
/**
15931593
* Prepares an image for use as an image mask
1594-
* The image is given as the name of the file conatining the image
1594+
* The image is given as the name of the file containing the image
15951595
* \param file Name of the file containing the image.
15961596
* \param mimeType Image format. Possible values are: image/jpeg, image/png, image/gif, image/wmf.
15971597
* \return id of the image mask, or 0 in case of an error
@@ -2575,6 +2575,16 @@ class WXDLLIMPEXP_PDFDOC wxPdfDocument
25752575
int align = wxPDF_ALIGN_LEFT, int fill = 0,
25762576
const wxPdfLink& link = wxPdfLink(-1));
25772577

2578+
/// Get size of an image
2579+
/**
2580+
* The size of the image is determined from the given graphics file.
2581+
*
2582+
* \param file Name of the file containing the image.
2583+
* \param mimeType Image format. Possible values are: image/jpeg, image/png, image/gif, image/wmf.
2584+
* \return width and height of the image
2585+
*/
2586+
virtual wxSize GetImageSize(const wxString& file, const wxString& mimeType = wxEmptyString);
2587+
25782588
/// Start document
25792589
virtual void BeginPage(int orientation, wxSize pageSize);
25802590

src/pdfdocument.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,6 +1628,22 @@ wxPdfDocument::WriteGlyphArray(wxPdfArrayDouble& x, wxPdfArrayDouble& y, wxPdfAr
16281628
return ok;
16291629
}
16301630

1631+
wxSize
1632+
wxPdfDocument::GetImageSize(const wxString& file, const wxString& mimeType)
1633+
{
1634+
wxSize imageSize(0, 0);
1635+
wxImage image(file, mimeType);
1636+
if (image.IsOk())
1637+
{
1638+
#if wxCHECK_VERSION(2,9,0)
1639+
imageSize = image.GetSize();
1640+
#else
1641+
imageSize.Set(image.GetWidth(), image.GetHeight());
1642+
#endif
1643+
}
1644+
return imageSize;
1645+
}
1646+
16311647
bool
16321648
wxPdfDocument::Image(const wxString& file, double x, double y, double w, double h,
16331649
const wxString& type, const wxPdfLink& link, int maskImage)

src/pdfxml.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,15 +942,23 @@ wxPdfDocument::PrepareXmlCell(wxXmlNode* node, wxPdfCellContext& context)
942942
wxString src = GetXmlAttribute(child, wxS("src"), wxS(""));
943943
if (src.Length() > 0)
944944
{
945-
// long width;
945+
wxSize imageSize = GetImageSize(src);
946+
double wImage = ((double) imageSize.GetWidth()) / (GetImageScale() * GetScaleFactor());
947+
double hImage = ((double)imageSize.GetHeight()) / (GetImageScale() * GetScaleFactor());
948+
long width;
946949
long height;
947-
// wxString strWidth = child->GetPropVal(wxS("width"), wxS("0"));
950+
wxString strWidth = GetXmlAttribute(child, wxS("width"), wxS("0"));
948951
wxString strHeight = GetXmlAttribute(child, wxS("height"), wxS("0"));
949-
// if (!strWidth.ToLong(&width)) width = 0;
952+
if (!strWidth.ToLong(&width)) width = 0;
950953
if (!strHeight.ToLong(&height)) height = 0;
954+
double w = ((double) width) / (GetImageScale() * GetScaleFactor());
951955
double h = ((double) height) / (GetImageScale() * GetScaleFactor());
952956
// TODO: handle image
953957
// line height, position, margins etc.
958+
if (h <= 0 && wImage > 0)
959+
{
960+
h = (w <= 0) ? hImage : hImage * (w / wImage);
961+
}
954962
context.AddHeight(h);
955963
}
956964
}
@@ -1590,6 +1598,9 @@ wxPdfDocument::WriteXmlCell(wxXmlNode* node, wxPdfCellContext& context)
15901598
wxString src = GetXmlAttribute(child, wxS("src"), wxS(""));
15911599
if (src.Length() > 0)
15921600
{
1601+
wxSize imageSize = GetImageSize(src);
1602+
double wImage = ((double) imageSize.GetWidth()) / (GetImageScale() * GetScaleFactor());
1603+
double hImage = ((double) imageSize.GetHeight()) / (GetImageScale() * GetScaleFactor());
15931604
long width;
15941605
long height;
15951606
wxString strWidth = GetXmlAttribute(child, wxS("width"), wxS("0"));
@@ -1600,6 +1611,14 @@ wxPdfDocument::WriteXmlCell(wxXmlNode* node, wxPdfCellContext& context)
16001611
double y = GetY();
16011612
double w = ((double) width) / (GetImageScale() * GetScaleFactor());
16021613
double h = ((double) height) / (GetImageScale() * GetScaleFactor());
1614+
if (width <= 0 && wImage > 0)
1615+
{
1616+
w = (height <= 0) ? wImage : wImage * (h / hImage);
1617+
}
1618+
if (height <= 0 && wImage > 0)
1619+
{
1620+
h = (width <= 0) ? hImage : hImage * (w / wImage);
1621+
}
16031622
wxString align = GetXmlAttribute(child, wxS("align"), wxS("left")).Lower();
16041623
double delta;
16051624
if (align == wxS("right"))

wxpdfdoc.pc.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
# Package Information for pkg-config
2+
13
prefix=@prefix@
24
exec_prefix=@exec_prefix@
35
includedir=@includedir@
46
libdir=@libdir@
7+
wxver=@WX_VERSION_MAJOR@.@WX_VERSION_MINOR@
58

6-
Name: wxPdfDocument
9+
Name: wxPdfDocument-@WX_VERSION_MAJOR@.@WX_VERSION_MINOR@
710
Description: Generation of PDF documents from wxWidgets applications
811
URL: https://github.com/utelle/wxpdfdoc/
912
Version: @PACKAGE_VERSION@

0 commit comments

Comments
 (0)