[dasher: 130/217] Cleanup in CScreen class
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 130/217] Cleanup in CScreen class
- Date: Sat, 27 Feb 2016 12:11:15 +0000 (UTC)
commit 231d535ceec1e75fd53b58a1f55ddb4afa5c5be0
Author: ipomoena <amajorek google com>
Date: Thu Nov 19 16:26:29 2015 -0800
Cleanup in CScreen class
Src/DasherCore/DasherModel.cpp | 2 +-
Src/Gtk2/Canvas.cpp | 24 ------------------------
Src/Gtk2/Canvas.h | 6 ------
Src/Qt/QtDasherScreen.h | 6 +-----
Src/Win32/Widgets/Screen.h | 31 ++++++++++++++-----------------
Src/Win32/Widgets/Screen.inl | 9 ---------
6 files changed, 16 insertions(+), 62 deletions(-)
---
diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp
index c984681..8d1cdfd 100644
--- a/Src/DasherCore/DasherModel.cpp
+++ b/Src/DasherCore/DasherModel.cpp
@@ -280,7 +280,7 @@ bool CDasherModel::NextScheduledStep()
break;
}
++it;
- DASHER_ASSERT (it != E); //must find a child!
+ DASHER_ASSERT(it != m_Root->GetChildren().end()); //must find a child!
}
}
diff --git a/Src/Gtk2/Canvas.cpp b/Src/Gtk2/Canvas.cpp
index 84e76ce..6a8f756 100644
--- a/Src/Gtk2/Canvas.cpp
+++ b/Src/Gtk2/Canvas.cpp
@@ -100,30 +100,6 @@ void CCanvas::resize(screenint w,screenint h) {
InitSurfaces();
}
-void CCanvas::Blank() {
- // FIXME - this is replicated throughout this file - do something
- // about that
-#if WITH_CAIRO
-#else
- GdkGC *graphics_context;
- GdkColormap *colormap;
-
- graphics_context = m_pCanvas->style->fg_gc[GTK_WIDGET_STATE(m_pCanvas)];
- colormap = gdk_colormap_get_system();
-#endif
-
- BEGIN_DRAWING;
- SET_COLOR(0);
-
-#if WITH_CAIRO
- cairo_paint(cr);
-#else
- gdk_draw_rectangle(m_pOffscreenBuffer, graphics_context, TRUE, 0, 0, GetWidth(), GetHeight());
-#endif
-
- END_DRAWING;
-}
-
void CCanvas::Display() {
// FIXME - Some of this stuff is probably not needed
// GdkRectangle update_rect;
diff --git a/Src/Gtk2/Canvas.h b/Src/Gtk2/Canvas.h
index a2d1021..ece9647 100644
--- a/Src/Gtk2/Canvas.h
+++ b/Src/Gtk2/Canvas.h
@@ -160,12 +160,6 @@ public:
void Polygon(point *Points, int Number, int fillColour, int outlineColour, int iWidth) override;
///
- /// Blank the diplay
- ///
-
- void Blank();
-
- ///
/// Marks the end of the display process - at this point the offscreen buffer is copied onscreen.
///
diff --git a/Src/Qt/QtDasherScreen.h b/Src/Qt/QtDasherScreen.h
index a8747ba..d249a76 100644
--- a/Src/Qt/QtDasherScreen.h
+++ b/Src/Qt/QtDasherScreen.h
@@ -63,11 +63,7 @@ Q_OBJECT public:
std::vector < int >FontSizes;
std::vector < QFont > Fonts;
- void Blank() const {
- painter->begin(pixmap);
- painter->setPen(NoPen);
- painter->fillRect(0, 0, m_iWidth, m_iHeight, QColor(255, 255, 255));
- } void Display() {
+void Display() {
painter->end();
repaint();
}
diff --git a/Src/Win32/Widgets/Screen.h b/Src/Win32/Widgets/Screen.h
index e563057..aab14ba 100644
--- a/Src/Win32/Widgets/Screen.h
+++ b/Src/Win32/Widgets/Screen.h
@@ -34,31 +34,30 @@ public:
CScreen(HDC hdc, HWND hWnd, screenint width, screenint height);
~CScreen();
- void SetColourScheme(const Dasher::CColourIO::ColourInfo *pColours);
+ void SetColourScheme(const Dasher::CColourIO::ColourInfo *pColours) override;
void SetFont(const std::string &strFont);
/// Make label from UTF8-encoded string
/// \param iWrapSize 0 => single-line label (for nodes); any other value => wrapped to screen width
/// (we wrap the text in whatever fontsize it's DrawString/TextSize'd in, even tho we don't have to)
- CDasherScreen::Label *MakeLabel(const std::string &strText, unsigned int iWrapSize=0);
+ CDasherScreen::Label *MakeLabel(const std::string &strText, unsigned int iWrapSize = 0) override;
- std::pair<screenint,screenint> TextSize(CDasherScreen::Label *label, unsigned int Size);
+ std::pair<screenint, screenint> TextSize(CDasherScreen::Label *label, unsigned int Size) override;
//! Draw label at size Size positioned at x1 and y1
- void DrawString(CDasherScreen::Label *label, screenint x1, screenint y1, unsigned int Size, int Colour);
+ void DrawString(CDasherScreen::Label *label, screenint x1, screenint y1, unsigned int Size, int Colour)
override;
- void DrawRectangle(Dasher::screenint x1, Dasher::screenint y1, Dasher::screenint x2, Dasher::screenint y2,
int Colour, int iOutlineColour, int iThickness);
+ void DrawRectangle(Dasher::screenint x1, Dasher::screenint y1, Dasher::screenint x2, Dasher::screenint y2,
int Colour, int iOutlineColour, int iThickness) override;
- void CScreen::DrawCircle(screenint iCX, screenint iCY, screenint iR, int iFillColour, int iLineColour, int
iThickness);
+ void DrawCircle(screenint iCX, screenint iCY, screenint iR, int iFillColour, int iLineColour, int
iThickness) override;
// Draw a line of arbitrary colour.
//! Draw a line between each of the points in the array
//
//! \param Number the number of points in the array
//! \param Colour the colour to be drawn
- //void Polyline(point * Points, int Number, int iWidth, int Colour,int layer=0);
- void Polyline(point * Points, int Number, int iWidth, int Colour);
+ void Polyline(point * Points, int Number, int iWidth, int Colour) override;
// Draw a filled polygon - given vertices and color id
// This is not (currently) used in standard Dasher. However, it could be very
@@ -70,20 +69,18 @@ public:
//! \param Number number of points in the array
//! \param fillColour colour to fill polygon (numeric); -1 for don't fill
//! \param outlineColour colour to draw polygon outline (right the way around, i.e. repeating first point)
- //virtual void Polygon(point * Points, int Number, int Color);
- //virtual void Polygon(point * Points, int Number, int Color, int iWidth,int layer);
- virtual void Polygon(point * Points, int Number, int fillColour, int OutlineColour, int iWidth);
+ virtual void Polygon(point * Points, int Number, int fillColour, int OutlineColour, int iWidth) override;
- void Blank();
- void Display();
+ void Display() override;
- void RealDisplay(HDC hDC, RECT r);
-
- void SendMarker(int iMarker);
+ void SendMarker(int iMarker) override;
- void resize(screenint w,screenint h);
// Returns true if point on screen is not obscured by another window
bool IsPointVisible(screenint x, screenint y) override;
+
+ void RealDisplay(HDC hDC, RECT r);
+ void resize(screenint w, screenint h);
+
private:
const void point2POINT(const point * In, POINT * Out, int Number);
diff --git a/Src/Win32/Widgets/Screen.inl b/Src/Win32/Widgets/Screen.inl
index dce01f0..56a9f67 100644
--- a/Src/Win32/Widgets/Screen.inl
+++ b/Src/Win32/Widgets/Screen.inl
@@ -63,15 +63,6 @@ inline void CScreen::Polyline(point *Points, int Number, int iWidth, int iColour
SelectObject(m_hDCBuffer, hpOld);
}
-inline void CScreen::Blank() {
- RECT rect;
- rect.top = 0;
- rect.right = long (GetWidth());
- rect.bottom = long (GetHeight());
- rect.left = 0;
- FillRect(m_hDCBuffer, &rect, (HBRUSH) GetStockObject(WHITE_BRUSH));
-}
-
inline void CScreen::Display() {
// BitBlt(m_hdc, 0, 0, m_iWidth, m_iHeight, m_hDCBuffer, 0, 0, SRCCOPY);
InvalidateRect(m_hWnd, NULL, false);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]