Commit Graph

412 Commits

Author SHA1 Message Date
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Maarten Bent
2f78849d24 Fix build without precompiled headers 2018-11-26 23:51:40 +01:00
Maarten Bent
39ff5b90e5 Replace wxDeprecatedGUIConstants enum values 2018-11-25 21:29:32 +01:00
Vadim Zeitlin
d09a7180e7 Make wxHtmlContainerCell ctor explicit
No real changes, just make it more difficult to misuse it accidentally.
2018-08-25 21:19:33 +02:00
Vadim Zeitlin
a59f5932df Add wxHtmlContainerCell::Detach()
This allows manipulating the HTML DOM from the outside, e.g. to detach
a header element in order to be able to repeat it on all pages.
2018-08-25 21:16:55 +02:00
Vadim Zeitlin
012baf1ff2 Remove unnecessary heap allocations in wxHtmlDCRenderer
Make m_Parser and m_FS simple objects instead of pointers as it's
completely unnecessary to allocate them on the heap here.

Note that both wxHtmlWinParser (by explicitly including its header) and
wxFileSystem (which is implicitly included via wx/html/htmlpars.h) are
fully declared in the header, so using pointers doesn't even help with
reducing compilation dependencies.

No real changes.
2018-08-25 14:29:25 +02:00
Vadim Zeitlin
9db0234abc Allow passing already parsed HTML to wxHtmlDCRenderer
This is more efficient when the same HTML is reused multiple times, e.g.
for measuring it first and then rendering it.

The new function also makes it simpler to parse HTML and manipulate it
in some way before measuring and rendering it.
2018-08-25 02:37:55 +02:00
Blake-Eryx
49e20a961d Fix misspellings in comments and documentation
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/870
2018-07-31 13:20:17 +02:00
pavel-t
710474c634 Allow configuring showing printing dialog in wxHtmlEasyPrinting
Add wxHtmlEasyPrinting::SetPromptMode() to allow suppressing the
"prompt" shown by wxPrinter::Print() when it's called from this class
code.

Closes https://github.com/wxWidgets/wxWidgets/pull/838
2018-06-21 16:03:38 +02:00
Vadim Zeitlin
adfde70054 Remove redundant wxHtmlDCRenderer::m_NumPages
The actual number of pages is given by the number of elements in
m_PageBreaks vector after CountPages() is shown and is unknown until
then, so m_NumPages is completely unnecessary and can be just removed.
2018-05-25 01:35:34 +02:00
Vadim Zeitlin
8d7601295b Make wxHtmlDCRenderer::FindNextPageBreak() const
It doesn't modify the renderer.
2018-05-25 01:31:54 +02:00
Vadim Zeitlin
c5bb583cdf Replace wxList used in wxHtmlPrintout with wxVector<> too
Prefer the use of the standard-like template class to macro-based list.

It also makes more sense to use a vector rather than a linked list here,
as the elements are never removed from or inserted into m_Filters, so
there is no reason to prefer the list structure.
2018-05-25 01:22:29 +02:00
Vadim Zeitlin
edeca4d9d6 Use wxVector<int> instead of wxArrayInt in wxHtmlDCRenderer
No real changes, just prefer standard-like template class to the legacy
wx one.
2018-05-25 01:19:01 +02:00
Vadim Zeitlin
b9b6ccb804 Remove "known_pagebreaks" from wxHtmlCell::AdjustPagebreak()
This parameter is not actually needed for any reasonable page breaking
algorithm, as it shouldn't care about any previous page breaks except
for the last one, which is already known as "*pagebreak - pageHeight" in
this function.

Removing it will allow to stop using wxArrayInt in the code using this
method and switch to an std::vector<int> instead.

This is not a backwards compatible change, but it seems that there is
very little code actually overriding this function (none could be found
in any open source repositories) and updating it should be as simple as
removing the now unneeded argument.
2018-05-24 18:12:40 +02:00
Vadim Zeitlin
63add2cd19 Don't call AdjustPagebreak() in a loop, this seems useless
There doesn't seem to be any reason to call this function more than once
on the same cell as the existing implementations are idempotent and it's
difficult to see why this should ever not be the case.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
e01892c669 Split and simplify wxHtmlDCRenderer::Render()
This function was difficult to understand as it did two quite different
things depending on the value of its "dont_render" argument and using it
also made CountPages() logic more complicated than necessary.

Simplify the code by splitting Render() into FindNextPageBreak(), which
is used by CountPages(), and Render() itself, which doesn't need to deal
with pagination at all as it's either already provided the page start
and end positions or can just assume that everything fits on a single
page (the latter is the case for the headers and footers renderer).

This is a notionally backwards-incompatible change, but no code using
wxHtmlDCRenderer could be found in the wild and the new API is so much
simpler that it seems to be worth switching to it.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
9fa9880f97 Pass known page breaks as const ref to wxHtmlDCRenderer::Render()
This method doesn't modify the known page breaks, it only uses them to
find the next one, so make it more clear by using const reference in the
function signature.
2018-05-21 19:06:21 +02:00
Vadim Zeitlin
f1ea4afdbe Make wxHtmlPrintout::m_Renderer{,Hdr} objects instead of pointers
There is no need to allocate these objects on the heap and delete them
later when we can just make them members of wxHtmlPrintout object
itself.

No real changes.
2018-05-21 16:39:02 +02:00
rmpowell77
af56ccd46f Use semicolons as statement separators in wxHTML code
This avoids (harmless in this, but not necessarily in the other, case)
clang warning: possible misuse of comma operator here [-Wcomma].

See https://github.com/wxWidgets/wxWidgets/pull/662
2018-01-06 17:37:20 +01:00
Vadim Zeitlin
f72575ad08 Remove unnecessary semicolon at top level
This results in a warning from gcc with -pedantic.
2017-08-21 00:19:31 +02:00
Stefan Csomor
d28dd3333b change code to help analyzer trace ownership properly 2017-06-07 23:00:28 +02:00
Paul Cornett
01909a20c8 Remove initializations of wxString with wxEmptyString
An empty string is the default
2017-05-28 23:53:44 -07:00
Paul Cornett
7358202d29 Use ctor initializer for non-trivial data members 2017-05-28 23:49:55 -07:00
Paul Cornett
1532afcb2f Use ctor initializer for non-trivial data members 2017-05-28 23:40:34 -07:00
Paul Cornett
d35e516fd5 Use compiler-generated copy ctor and assignment operator for wxHtmlLinkInfo 2017-05-28 23:29:10 -07:00
Paul Cornett
5feb43c8a2 Fix accidental use of comma operator 2017-05-28 22:42:13 -07:00
Maarten
977a826639 use more wxOVERRIDE (#329) 2016-09-25 13:21:28 -07:00
Vadim Zeitlin
b4d6348c6b Don't use a dummy menu with wxHtmlHelpFrame under OS X
Contrary to the comment in wxHtmlHelpFrame::Create(), this doesn't seem to be
necessary and can be actually problematic.

Never adding this menu obviates the need for the wxHF_MENU style from #15538.

Closes #15538.
2016-03-06 22:12:29 +01:00
Troels Knakkergaard
c9a3a23e5a Add wxHtmlPrintout::SetMargins(wxPageSetupDialogData) overload
Make it simpler to set the user-configured margins.

Closes #16872.
2016-03-05 03:33:08 +01:00
Vadim Zeitlin
0dc57e9e23 Avoid 1px gaps between consecutive underlined words in wxHTML
At least when using standard fonts under MSW, the underlines under the
consecutive words didn't overlap, resulting in ugly gaps between them when
using more than one word as the link text, for example.

Work around this by drawing an extra, slightly offset, underlined space when
the previous cell was drawn underlined.
2016-01-29 17:19:29 +01:00
Paul Cornett
03aae8254f remove unused private member variables 2016-01-16 11:04:27 -08:00
Paul Cornett
56701052eb remove const from pass-by-value parameters 2016-01-16 10:55:01 -08:00
Hartwig
da7c2e67b9 Addition of missing overrides to webkit.h 2015-11-22 09:45:47 +01:00
Vadim Zeitlin
ac02d331e4 Initialize wxHtmlSelectionState::m_bgMode in ctor
Don't leave the variable uninitialized to avoid warnings from static code
analyzer and to ensure that it is never used before being initialized (while
this does seem to be the case already, it's not exactly obvious).
2015-09-23 00:52:40 +02:00
Paul Cornett
27a8d28029 more use of wxOVERRIDE 2015-09-06 17:20:42 -07:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
fb99672f62 Hopefully finish removing the old wxCocoa port.
Get rid of the rest of __WXCOCOA__ tests in the sources.

Drop configure option for using it.

Also remove the documentation for this port.

This should have also been part of r76735.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-03 22:03:21 +00:00
Stefan Csomor
1a5b712103 using proper types for webkit variants, see #16329
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-20 08:14:46 +00:00
Vadim Zeitlin
895a58609b Fix misspellings of "occurred" and "occurrences".
See https://github.com/wxWidgets/wxWidgets/pull/9

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-06-11 15:25:33 +00:00
Paul Cornett
8b3e3e594b avoid double-to-float conversion warnings in headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-05 17:13:46 +00:00
Paul Cornett
8b4ae731d3 use wxOVERRIDE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 00:02:23 +00:00
Paul Cornett
967a94c91a remove WXWIN_COMPATIBILITY_2_6, add WXWIN_COMPATIBILITY_3_0
closes #15792

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-04 20:07:33 +00:00
Vadim Zeitlin
fba8b37345 Add wxHtmlWindow::SetDefaultHTMLCursor().
This allows to change the cursors used by any HTML windows, before creating
them.

Closes #15324.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-12-18 16:00:43 +00:00
Vadim Zeitlin
486a0fa75f Add wxHtmlTag::GetParamAsString() convenience method.
This is more convenient to use than HasParam() + GetParam() and also slightly
more efficient as we search for the tag name only once.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-30 23:48:38 +00:00
Vadim Zeitlin
b0ad146aba Fix assorted typos in comments and other non-code.
Closes #15509.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-09-17 15:25:59 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
e24c4e1238 Set mouse cursor correctly over image map links in wxHTML.
The cursor didn't change to a link one when the mouse was over link areas in
an image map.

Fix this by generalizing wxHtmlCell::GetMouseCursor() into GetMouseCursorAt().

Closes #15350.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-17 17:27:14 +00:00
Václav Slavík
17473a770a Fix lots of warnings reported by Clang.
Mostly potentially lossy implicit conversions in headers (long->int). Also dangling else warnings. Struct/class mismatches.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-10 16:41:34 +00:00
Vadim Zeitlin
88343ddae9 Allow resetting background colour of wxHtmlContainerCell.
Don't use m_UseBkColour flag which remained always set once
SetBackgroundColour() had been called, but just rely on m_BkColour itself
being valid to determine whether we should use it. This allows to reset the
background colour after setting it.

Closes #15287.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-29 12:50:37 +00:00
Vadim Zeitlin
ce7fe42e84 Provide shorter synonyms for wxEVT_XXX constants.
Use the same short names as are used by the event table macros for the event
type constants themselves. This makes them much more comfortable to use, e.g.
Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED).

The old long names are still kept for backwards compatibility and shouldn't be
removed as it doesn't really cost anything to continue providing them, but all
new event types should only use the short versions.

Closes #10661.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 10:11:03 +00:00