diff options
| author | Neil <nyamatongwe@gmail.com> | 2018-05-14 13:42:24 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2018-05-14 13:42:24 +1000 |
| commit | 8e94953b2d9f7d946445759fe31d169879b680c8 (patch) | |
| tree | a5f38b198b2c82cec50b3bbe8def5907e6358ac2 /gtk/PlatGTK.cxx | |
| parent | 13c4548805a2a5ef718fc5dfa6f77bb60c6bed2b (diff) | |
| download | scintilla-mirror-8e94953b2d9f7d946445759fe31d169879b680c8.tar.gz | |
Backport: Modernize Platform.h (1) - noexcept, const, standard methods.
Changes made to FontParameters, Font, Window, ListBoxEvent, ListBox, Menu,
DynamicLibrary, and Platform.
Backport of changeset 6938:a42c7cc3254b.
Diffstat (limited to 'gtk/PlatGTK.cxx')
| -rw-r--r-- | gtk/PlatGTK.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index f9ee02bfc..6c0432198 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -105,7 +105,7 @@ static GtkWidget *PWidget(WindowID wid) { return static_cast<GtkWidget *>(wid); } -Font::Font() : fid(0) {} +Font::Font() noexcept : fid(0) {} Font::~Font() {} @@ -961,7 +961,7 @@ void Window::Destroy() { } } -PRectangle Window::GetPosition() { +PRectangle Window::GetPosition() const { // Before any size allocated pretend its 1000 wide so not scrolled PRectangle rc(0, 0, 1000, 1000); if (wid) { @@ -1005,15 +1005,15 @@ GdkRectangle MonitorRectangleForWidget(GtkWidget *wid) { } -void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { +void Window::SetPositionRelative(PRectangle rc, const Window *relativeTo) { int ox = 0; int oy = 0; - GdkWindow *wndRelativeTo = WindowFromWidget(PWidget(relativeTo.wid)); + GdkWindow *wndRelativeTo = WindowFromWidget(PWidget(relativeTo->wid)); gdk_window_get_origin(wndRelativeTo, &ox, &oy); ox += rc.left; oy += rc.top; - GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(relativeTo.wid)); + GdkRectangle rcMonitor = MonitorRectangleForWidget(PWidget(relativeTo->wid)); /* do some corrections to fit into screen */ int sizex = rc.right - rc.left; @@ -1032,7 +1032,7 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { gtk_window_resize(GTK_WINDOW(wid), sizex, sizey); } -PRectangle Window::GetClientPosition() { +PRectangle Window::GetClientPosition() const { // On GTK+, the client position is the window position return GetPosition(); } @@ -1143,7 +1143,7 @@ static void list_image_free(gpointer, gpointer value, gpointer) { g_free(list_image); } -ListBox::ListBox() { +ListBox::ListBox() noexcept { } ListBox::~ListBox() { @@ -1866,7 +1866,7 @@ void ListBoxX::SetList(const char *listText, char separator, char typesep) { } } -Menu::Menu() : mid(0) {} +Menu::Menu() noexcept : mid(0) {} void Menu::CreatePopUp() { Destroy(); |
