From 38eb38d945e08b878d8680025e1cc7239a59afe4 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 22 Mar 2021 17:34:34 +1100 Subject: Remove IntegerRectangle.h as not widely useful Add IntegerRectangle struct for local use in PlatGTK.cxx. --- gtk/PlatGTK.cxx | 15 ++++++++++++++- gtk/deps.mak | 1 - 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 97f406f4b..580e42414 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -30,7 +30,6 @@ #include "Scintilla.h" #include "ScintillaWidget.h" -#include "IntegerRectangle.h" #include "XPM.h" #include "UniConversion.h" @@ -60,6 +59,20 @@ constexpr float floatFromPangoUnits(int pu) noexcept { return static_cast(pu) / PANGO_SCALE; } +struct IntegerRectangle { + int left; + int top; + int right; + int bottom; + + explicit IntegerRectangle(PRectangle rc) noexcept : + left(static_cast(rc.left)), top(static_cast(rc.top)), + right(static_cast(rc.right)), bottom(static_cast(rc.bottom)) { + } + int Width() const noexcept { return right - left; } + int Height() const noexcept { return bottom - top; } +}; + GdkWindow *WindowFromWidget(GtkWidget *w) noexcept { return gtk_widget_get_window(w); } diff --git a/gtk/deps.mak b/gtk/deps.mak index 09c47dcde..0ae4b48e5 100644 --- a/gtk/deps.mak +++ b/gtk/deps.mak @@ -7,7 +7,6 @@ PlatGTK.o: \ ../include/Scintilla.h \ ../include/Sci_Position.h \ ../include/ScintillaWidget.h \ - ../src/IntegerRectangle.h \ ../src/XPM.h \ ../src/UniConversion.h \ Converter.h -- cgit v1.2.3