summaryrefslogtreecommitdiff
path: root/support/dktools/DkWxBufferedControl.cpp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
committerNorbert Preining <norbert@preining.info>2020-09-20 03:03:26 +0000
commit1f457376b478257b88d4a857f5ec1b6155442dd7 (patch)
tree2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/DkWxBufferedControl.cpp
parentac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff)
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/DkWxBufferedControl.cpp')
-rw-r--r--support/dktools/DkWxBufferedControl.cpp124
1 files changed, 58 insertions, 66 deletions
diff --git a/support/dktools/DkWxBufferedControl.cpp b/support/dktools/DkWxBufferedControl.cpp
index b13c94bfb9..a478f88ab0 100644
--- a/support/dktools/DkWxBufferedControl.cpp
+++ b/support/dktools/DkWxBufferedControl.cpp
@@ -1,52 +1,30 @@
/*
- WARNING: This file was generated by dkct.
- Changes you make here will be lost if dkct is run again!
- You should modify the original source and run dkct on it.
- Original source: DkWxBufferedControl.cpt
+Copyright (C) 2013-2020, Dirk Krause
+SPDX-License-Identifier: BSD-3-Clause
*/
/*
-Copyright (C) 2013-2017, Dirk Krause
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above opyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of the author nor the names of contributors may be used
- to endorse or promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ WARNING: This file was generated by the dkct program (see
+ http://dktools.sourceforge.net/ for details).
+ Changes you make here will be lost if dkct is run again!
+ You should modify the original source and run dkct on it.
+ Original source: DkWxBufferedControl.cpt
*/
/** @file DkWxBufferedControl.cpp The DkWxBufferedControl module.
*/
-#line 188 "DkWxBufferedControl.cpt"
-
+#line 196 "DkWxBufferedControl.cpt"
+#include "dk3conf.h"
#include "DkWxBufferedControl.h"
-#line 195 "DkWxBufferedControl.cpt"
+#line 203 "DkWxBufferedControl.cpt"
@@ -55,12 +33,26 @@ wxChar const DkWxBufferedControl::DkWxBufferedControlName[] = {
};
+#if wxCHECK_VERSION(3,0,0)
+wxIMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl);
+#else
IMPLEMENT_DYNAMIC_CLASS(DkWxBufferedControl, wxControl)
+#endif
+
+
+#if wxCHECK_VERSION(3,0,0)
+wxBEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#else
BEGIN_EVENT_TABLE(DkWxBufferedControl,wxControl)
+#endif
EVT_ERASE_BACKGROUND(DkWxBufferedControl::OnErase)
EVT_PAINT(DkWxBufferedControl::OnPaint)
+#if wxCHECK_VERSION(3,0,0)
+wxEND_EVENT_TABLE()
+#else
END_EVENT_TABLE()
+#endif
@@ -68,7 +60,7 @@ DkWxBufferedControl::DkWxBufferedControl()
{
-#line 215 "DkWxBufferedControl.cpt"
+#line 237 "DkWxBufferedControl.cpt"
pBitmap = NULL;
iWidth = -1;
iHeight = -1;
@@ -76,7 +68,7 @@ DkWxBufferedControl::DkWxBufferedControl()
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 221 "DkWxBufferedControl.cpt"
+#line 243 "DkWxBufferedControl.cpt"
}
@@ -127,7 +119,7 @@ DkWxBufferedControl::DkWxBufferedControl(
{
-#line 270 "DkWxBufferedControl.cpt"
+#line 292 "DkWxBufferedControl.cpt"
pBitmap = NULL;
iWidth = -1;
iHeight = -1;
@@ -135,7 +127,7 @@ DkWxBufferedControl::DkWxBufferedControl(
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-#line 276 "DkWxBufferedControl.cpt"
+#line 298 "DkWxBufferedControl.cpt"
}
@@ -144,12 +136,12 @@ DkWxBufferedControl::~DkWxBufferedControl()
{
-#line 283 "DkWxBufferedControl.cpt"
+#line 305 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
if(NULL != pBitmap) {
-#line 286 "DkWxBufferedControl.cpt"
+#line 308 "DkWxBufferedControl.cpt"
delete(pBitmap);
pBitmap = NULL;
}
@@ -159,21 +151,21 @@ DkWxBufferedControl::~DkWxBufferedControl()
}
-#line 294 "DkWxBufferedControl.cpt"
+#line 316 "DkWxBufferedControl.cpt"
}
void
-DkWxBufferedControl::OnErase(wxEraseEvent & event)
+DkWxBufferedControl::OnErase(wxEraseEvent & WXUNUSED(event))
{
-#line 302 "DkWxBufferedControl.cpt"
+#line 324 "DkWxBufferedControl.cpt"
/* Do nothing here. */
-#line 304 "DkWxBufferedControl.cpt"
+#line 326 "DkWxBufferedControl.cpt"
}
@@ -187,7 +179,7 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
int h = 0;
-#line 316 "DkWxBufferedControl.cpt"
+#line 338 "DkWxBufferedControl.cpt"
wxPaintDC paintDC(this);
{
wxMutexLocker lock(mxProtectData);
@@ -200,45 +192,45 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
if((iWidth != sz.x) || (iHeight != sz.y)) {
delete(pBitmap);
-#line 327 "DkWxBufferedControl.cpt"
+#line 349 "DkWxBufferedControl.cpt"
pBitmap = NULL;
mustdraw = true;
-#line 329 "DkWxBufferedControl.cpt"
+#line 351 "DkWxBufferedControl.cpt"
}
}
w = iWidth = sz.x; h = iHeight = sz.y;
if(NULL == pBitmap) {
-#line 333 "DkWxBufferedControl.cpt"
+#line 355 "DkWxBufferedControl.cpt"
pBitmap = new wxBitmap(iWidth, iHeight);
mustdraw = true;
-#line 335 "DkWxBufferedControl.cpt"
+#line 357 "DkWxBufferedControl.cpt"
}
if(NULL != pBitmap) {
-#line 337 "DkWxBufferedControl.cpt"
+#line 359 "DkWxBufferedControl.cpt"
if(false == mustdraw) {
if(bMustDraw) {
-#line 339 "DkWxBufferedControl.cpt"
+#line 361 "DkWxBufferedControl.cpt"
mustdraw = true;
}
}
if(mustdraw) {
-#line 343 "DkWxBufferedControl.cpt"
+#line 365 "DkWxBufferedControl.cpt"
wxMemoryDC memDC;
memDC.SelectObject(*pBitmap);
InternalPaint(memDC, event, true, w, h);
memDC.SelectObject(wxNullBitmap);
bMustDraw = false;
-#line 348 "DkWxBufferedControl.cpt"
+#line 370 "DkWxBufferedControl.cpt"
} else {
-#line 349 "DkWxBufferedControl.cpt"
+#line 371 "DkWxBufferedControl.cpt"
}
paintDC.DrawBitmap(*pBitmap, 0, 0, false);
done = true;
@@ -246,22 +238,22 @@ DkWxBufferedControl::OnPaint(wxPaintEvent & event)
}
if(!(done)) {
-#line 355 "DkWxBufferedControl.cpt"
+#line 377 "DkWxBufferedControl.cpt"
InternalPaint(paintDC, event, false, w, h);
}
-#line 357 "DkWxBufferedControl.cpt"
+#line 379 "DkWxBufferedControl.cpt"
}
void
DkWxBufferedControl::PaintOperation(
- wxDC & pdc,
- wxPaintEvent & event,
- bool buffered,
- int clWidth,
- int clHeight
+ wxDC & WXUNUSED(pdc),
+ wxPaintEvent & WXUNUSED(event),
+ bool WXUNUSED(buffered),
+ int WXUNUSED(clWidth),
+ int WXUNUSED(clHeight)
)
{
/* The default implementation intentionally does nothing. */
@@ -287,7 +279,7 @@ DkWxBufferedControl::InternalPaint(
int bgm = pdc.GetBackgroundMode();
-#line 392 "DkWxBufferedControl.cpt"
+#line 414 "DkWxBufferedControl.cpt"
PaintOperation(pdc, event, buffered, clWidth, clHeight);
pdc.SetBackgroundMode(bgm);
@@ -299,7 +291,7 @@ DkWxBufferedControl::InternalPaint(
pdc.SetBrush(br);
-#line 402 "DkWxBufferedControl.cpt"
+#line 424 "DkWxBufferedControl.cpt"
}
@@ -309,14 +301,14 @@ DkWxBufferedControl::SetMustUpdate(bool flag)
{
-#line 410 "DkWxBufferedControl.cpt"
+#line 432 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
bMustDraw = flag;
}
-#line 415 "DkWxBufferedControl.cpt"
+#line 437 "DkWxBufferedControl.cpt"
}
@@ -326,17 +318,17 @@ DkWxBufferedControl::releaseBuffer(void)
{
-#line 423 "DkWxBufferedControl.cpt"
+#line 445 "DkWxBufferedControl.cpt"
{
wxMutexLocker lock(mxProtectData);
if(pBitmap) {
-#line 426 "DkWxBufferedControl.cpt"
+#line 448 "DkWxBufferedControl.cpt"
delete(pBitmap);
pBitmap = NULL;
}
}
-#line 430 "DkWxBufferedControl.cpt"
+#line 452 "DkWxBufferedControl.cpt"
}